aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Barksdale <amatus@amatus.name>2014-08-13 16:29:15 -0500
committerDavid Barksdale <amatus@amatus.name>2014-08-13 16:29:15 -0500
commit205ac4d83fc388c1e2d0bb590a2a36e9a4c2fd78 (patch)
tree1dbd529848c396058dfc9c8a4f402dcbe3546317
parentace6c6d243016e272050787c14e27a83ecd94a25 (diff)
-rwxr-xr-xarch/powerpc/boot/dts/beech.dts9
-rw-r--r--arch/powerpc/include/asm/apm82181-adma.h2
-rw-r--r--arch/powerpc/kernel/dma.c10
-rw-r--r--arch/powerpc/platforms/44x/Kconfig11
-rw-r--r--arch/powerpc/platforms/44x/Makefile1
-rw-r--r--arch/powerpc/platforms/44x/ppc44x_simple.c1
-rw-r--r--arch/powerpc/sysdev/ppc4xx_pci.c3
-rwxr-xr-xbuild.sh48
-rw-r--r--crypto/tcrypt.c10
-rw-r--r--crypto/testmgr.c38
-rw-r--r--crypto/testmgr.h125
-rwxr-xr-xdrivers/ata/sata_dwc_pmp.c16
-rw-r--r--drivers/char/hw_random/trng4xx.c2
-rw-r--r--drivers/crypto/amcc/crypto4xx_alg.c50
-rw-r--r--drivers/crypto/amcc/crypto4xx_core.c47
-rw-r--r--drivers/crypto/amcc/crypto4xx_core.h44
-rw-r--r--drivers/md/raid0.c2
-rw-r--r--drivers/md/raid5.c31
-rw-r--r--drivers/mtd/maps/physmap_of.c9
-rw-r--r--drivers/mtd/nand/ndfc.c2
-rw-r--r--drivers/net/ibm_newemac/core.c23
-rw-r--r--drivers/net/ibm_newemac/phy.c26
-rw-r--r--fs/splice.c255
-rw-r--r--include/linux/leds.h10
-rw-r--r--net/core/sock.c36
-rw-r--r--net/ipv4/tcp.c84
26 files changed, 716 insertions, 179 deletions
diff --git a/arch/powerpc/boot/dts/beech.dts b/arch/powerpc/boot/dts/beech.dts
index 0e64ec4e365..341fb2cf0af 100755
--- a/arch/powerpc/boot/dts/beech.dts
+++ b/arch/powerpc/boot/dts/beech.dts
@@ -102,13 +102,11 @@
reg = <4 0x00040000 0x8000>; /* 32K */
};
- /* TODO: Check this for Maui */
SDR0: sdr {
compatible = "ibm,sdr-460ex";
dcr-reg = <0x00e 0x002>;
};
- /* TODO: Change for Maui */
CPR0: cpr {
compatible = "ibm,cpr-460ex";
dcr-reg = <0x00c 0x002>;
@@ -167,7 +165,7 @@
compatible = "ppc4xx-pka", "amcc, ppc4xx-pka";
reg = <4 0x00114000 0x4000>;
interrupt-parent = <&UIC0>;
- interrupts = <0x14 0x2>;
+ interrupts = <0x14 0x1>;
};
TRNG: trng@110000 {
@@ -175,7 +173,7 @@
compatible = "ppc4xx-trng", "amcc, ppc4xx-trng";
reg = <4 0x00110000 0x100>;
interrupt-parent = <&UIC1>;
- interrupts = <0x3 0x2>;
+ interrupts = <0x3 0x4>;
};
RTC: rtc {
@@ -205,7 +203,6 @@
/*RX1 COAL 0xd 0x2*/>;
};
- /* TODO: Check for Maui */
USBOTG0: usbotg@bff80000 {
compatible = "amcc,usb-otg-405ex";
reg = <4 0xbff80000 0x10000>;
@@ -311,7 +308,6 @@
interrupts = <0x6 0x4>;
interrupt-parent = <&UIC1>;
- /* TODO: Change for Beech platform . 4M Nor Flash */
nor_flash@0,0 {
compatible = "amd,s29gl512n", "cfi-flash";
bank-width = <1>;
@@ -423,7 +419,6 @@
reg = <0xef601350 0x00000030>;
};
- /* TODO: Change for Maui */
EMAC0: ethernet@ef600c00 {
device_type = "network";
compatible = "ibm,emac-405ex", "ibm,emac4sync";
diff --git a/arch/powerpc/include/asm/apm82181-adma.h b/arch/powerpc/include/asm/apm82181-adma.h
index b16014b8c07..bfc7803c3fa 100644
--- a/arch/powerpc/include/asm/apm82181-adma.h
+++ b/arch/powerpc/include/asm/apm82181-adma.h
@@ -203,6 +203,8 @@ typedef struct apm82181_adma_plb_desc_slot {
unsigned long flags;
unsigned long reverse_flags[8];
#define APM82181_DESC_INT 0 /* generate interrupt on complete */
+#define APM82181_DESC_FENCE 1 /* Other tx will use its result */
+ /* This tx needs to be polled to complete */
}apm82181_desc_t;
diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c
index 6215062caf8..868b5fd5f1e 100644
--- a/arch/powerpc/kernel/dma.c
+++ b/arch/powerpc/kernel/dma.c
@@ -132,6 +132,14 @@ static inline void dma_direct_sync_single_range(struct device *dev,
{
__dma_sync(bus_to_virt(dma_handle+offset), size, direction);
}
+
+static inline void dma_direct_sync_single(struct device *dev,
+ dma_addr_t dma_handle, size_t size,
+ enum dma_data_direction direction)
+{
+ __dma_sync(bus_to_virt(dma_handle), size, direction);
+}
+
#endif
struct dma_map_ops dma_direct_ops = {
@@ -143,6 +151,8 @@ struct dma_map_ops dma_direct_ops = {
.map_page = dma_direct_map_page,
.unmap_page = dma_direct_unmap_page,
#ifdef CONFIG_NOT_COHERENT_CACHE
+ .sync_single_for_cpu = dma_direct_sync_single,
+ .sync_single_for_device = dma_direct_sync_single,
.sync_single_range_for_cpu = dma_direct_sync_single_range,
.sync_single_range_for_device = dma_direct_sync_single_range,
.sync_sg_for_cpu = dma_direct_sync_sg,
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 642036461cd..0551086e350 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -115,6 +115,17 @@ config APOLLO3G
help
This option enables support for the WDC Apollo3G NAS.
+config BLUESTONE
+ bool "Bluestone"
+ depends on 44x
+ default n
+ select PPC44x_SIMPLE
+ select APM82181
+ select PPC4xx_PCI_EXPRESS
+ select IBM_NEW_EMAC_RGMII
+ help
+ This option enables support for the AMCC APM82181 evaluation board.
+
config CANYONLANDS
bool "Canyonlands"
depends on 44x
diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
index fd5583c8e86..084f9b0561a 100644
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -7,3 +7,4 @@ obj-$(CONFIG_XILINX_VIRTEX_5_FXT) += virtex.o
obj-$(CONFIG_XILINX_ML510) += virtex_ml510.o
obj-$(CONFIG_BEECH) += beech-usb.o
obj-$(CONFIG_APOLLO3G) += apollo3g-gpio.o
+obj-$(CONFIG_BLUESTONE) += bluestone-usb.o
diff --git a/arch/powerpc/platforms/44x/ppc44x_simple.c b/arch/powerpc/platforms/44x/ppc44x_simple.c
index 2c78cc8bc59..5f4a4548c6b 100644
--- a/arch/powerpc/platforms/44x/ppc44x_simple.c
+++ b/arch/powerpc/platforms/44x/ppc44x_simple.c
@@ -54,6 +54,7 @@ static char *board[] __initdata = {
"amcc,bamboo",
"amcc,beech",
"amcc,apollo3g",
+ "amcc,bluestone",
"amcc,canyonlands",
"amcc,glacier",
"ibm,ebony",
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
index 716b57f1e03..94ff12e0bac 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.c
+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -1960,7 +1960,8 @@ static void __init ppc4xx_pciex_port_setup_hose(struct ppc4xx_pciex_port *port)
port->index);
}
#if defined (CONFIG_APM82181) && defined(CONFIG_PCIE_MAX_PAYLOAD_SIZE_256)
- ppc440_config_pcie_mps(hose);
+ if(port->link)
+ ppc440_config_pcie_mps(hose);
#endif
return;
fail:
diff --git a/build.sh b/build.sh
index 6497ca2b509..f4fd4da618d 100755
--- a/build.sh
+++ b/build.sh
@@ -1,44 +1,44 @@
#!/bin/sh
-
#
-# build support for apollo3g
+# kernel build script for apollo3g
#
-local _CROSS_COMPILE=${1:-"ppc_4xxFP-"}
-local _ARCH=${2:-"powerpc"}
-
-if [ ! -z ${3} ]; then
- if [ ! -d ${3} ]; then
- mkdir -p "${3}"
- fi
- OUTPREFIX="${3}/"
- OUTLOC="O=${3}"
+# Usage: 'sh build.sh' to just use defaults (need to have the ELDK installed)
+# 'sh build.sh CROSS_COMPILE ARCH OUTLOC' to specifiy all parameters
+#
+_CROSS_COMPILE=${1:-ppc_4xxFP-}
+_ARCH=${2:-powerpc}
+OUTLOC=${3:-_BuildOutput}
+if [ ! -d ${OUTLOC} ]; then
+ mkdir -p "${OUTLOC}"
fi
-#echo "CROSS_COMPILE=${_CROSS_COMPILE} ARCH=${_ARCH} OUTLOC=${OUTLOC}"
-
echo =========== Building Linux ===============
make distclean
make mrproper
-make ${OUTLOC} CROSS_COMPILE=${_CROSS_COMPILE} ARCH=${_ARCH} 44x/apollo_3G_nas_defconfig
-make ${OUTLOC} CROSS_COMPILE=${_CROSS_COMPILE} ARCH=${_ARCH} -j 5 uImage
+make O=${OUTLOC} CROSS_COMPILE=${_CROSS_COMPILE} ARCH=${_ARCH} 44x/apollo_3G_nas_defconfig
+make O=${OUTLOC} CROSS_COMPILE=${_CROSS_COMPILE} ARCH=${_ARCH} -j 5 uImage
echo
echo =========== Building device tree ===========
-make ${OUTLOC} CROSS_COMPILE=${_CROSS_COMPILE} ARCH=${_ARCH} -j 5 apollo3g.dtb
+make O=${OUTLOC} CROSS_COMPILE=${_CROSS_COMPILE} ARCH=${_ARCH} -j 5 apollo3g.dtb
echo
-echo =========== Combining images ===============
-dd if=/dev/zero of=apollo3g_boot.img bs=1 count=5M
-dd if=${OUTPREFIX}arch/powerpc/boot/uImage of=apollo3g_boot.img conv=notrunc bs=1
-dd if=${OUTPREFIX}arch/powerpc/boot/apollo3g.dtb of=apollo3g_boot.img conv=notrunc bs=1 seek=4M
+echo "=========== Copying images to directory $(pwd) ==============="
+cp -v ${OUTLOC}/arch/powerpc/boot/uImage .
+cp -v ${OUTLOC}/arch/powerpc/boot/apollo3g.dtb .
+ls -ll *.dtb uImage
+
+# We don't use the combined image
+#echo
+#echo =========== Combining images ===============
+#dd if=/dev/zero of=apollo3g_boot.img bs=1 count=5M
+#dd if=${OUTLOC}/arch/powerpc/boot/uImage of=apollo3g_boot.img conv=notrunc bs=1
+#dd if=${OUTLOC}/arch/powerpc/boot/apollo3g.dtb of=apollo3g_boot.img conv=notrunc bs=1 seek=4M
-echo
-ls -ll apollo3g_boot.img
#
-# beech ?
+# original beech script...
#
-
#echo =========== Building Linux ===============
#make distclean
#make 44x/beech_nas_optimized_defconfig
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index aa3f84ccc78..3092728bf4c 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -883,7 +883,15 @@ static int do_test(int m)
case 399:
break;
-
+ case 400:
+ tcrypt_test("f8(kasumi)");
+ break;
+ case 401:
+ tcrypt_test("kasumi");
+ break;
+ case 402:
+ tcrypt_test("f9(kasumi)");
+ break;
case 1000:
test_available();
break;
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index deacec764fb..01f3f79de7e 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -1498,6 +1498,22 @@ static const struct alg_test_desc alg_test_descs_k[] = {
.count = 1
},
.dec = {
+ .vecs = kasumi_f8_dec_template,
+ .count = 1
+ }
+ }
+ }
+ },
+ {
+ .alg = "kasumi",
+ .test = alg_test_skcipher,
+ .suite = {
+ .cipher = {
+ .enc = {
+ .vecs = kasumi_enc_template,
+ .count = 1
+ },
+ .dec = {
.vecs = kasumi_dec_template,
.count = 1
}
@@ -1577,7 +1593,7 @@ static const struct alg_test_desc alg_test_descs_k[] = {
/* Currently disabled all the DTLS testing since,
* the DTLS enc test cases fail due to Random IV generation
*/
-#if 0
+#if 1
{
.alg = "dtls(aes-sha1)",
.test = alg_test_aead,
@@ -2408,7 +2424,18 @@ static const struct alg_test_desc alg_test_descs[] = {
.count = MD4_TEST_VECTORS
}
}
- }, {
+ },
+ {
+ .alg = "f9(kasumi)",
+ .test = alg_test_hash,
+ .suite = {
+ .hash = {
+ .vecs = kasumi_f9_tv_template,
+ .count = 1
+ }
+ }
+ },
+ {
.alg = "md5",
.test = alg_test_hash,
.suite = {
@@ -2709,6 +2736,10 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask)
int j;
int rc;
+ //printk("Testing alg = %s, driver name: %s\n", alg, driver);
+ if ((strcmp(alg, "kasumi") == 0) || (strcmp(alg, "f8(kasumi)") == 0)){
+ printk("Testing kasumi now\n");
+ }
if ((type & CRYPTO_ALG_TYPE_MASK) == CRYPTO_ALG_TYPE_CIPHER) {
char nalg[CRYPTO_MAX_ALG_NAME];
@@ -2727,9 +2758,12 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask)
goto test_done;
}
+
/* Enable these if want to test DTLS, SSL, TLS and TLSV11 and Kasumi */
+
#if 1
for ( i = 0; i < 15; i++) {
+ //printk("Testing special alg = %s, driver = %s\n", alg, driver);
if (strcmp(alg, alg_test_descs_k[i].alg) == 0) {
rc = alg_test_descs_k[i].test(alg_test_descs_k + i, driver,
type, mask);
diff --git a/crypto/testmgr.h b/crypto/testmgr.h
index ade892af4c2..4de793d4bdf 100644
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
@@ -2863,53 +2863,106 @@ static struct cipher_testvec cast6_dec_tv_template[] = {
.rlen = 16,
},
};
-
-
-static struct cipher_testvec kasumi_dec_template[] = {
+static struct cipher_testvec kasumi_f8_dec_template[] = {
{
- .key = "\x01\x02\x03\x04\x05\x06\x07"
- "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10",
- .klen = 16,
- .input = "\xec\xa7\xdb\xe8\xd9\xf4\x93\x2e",
- .ilen = 8,
- .result = "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8",
- .rlen = 8,
+ .key = "\x96\x18\xae\x46\x89\x1f\x86\x57\x8e\xeb\xe9\x0e\xf7\xa1\x20\x2e",
+ .iv = "\xc6\x75\xa6\x4b\x64\x00\x00\x00",
+
+ .result = "\x8d\xaa\x17\xb1\xae\x05\x05\x29\xc6\x82\x7f\x28\xc0\xef\x6a\x12"
+ "\x42\xe9\x3f\x8b\x31\x4f\xb1\x8a\x77\xf7\x90\xae\x04\x9f\xed\xd6"
+ "\x12\x26\x7f\xec\xae\xfc\x45\x01\x74\xd7\x6d\x9f\x9a\xa7\x75\x5a"
+ "\x30\xcd\x90\xa9\xa5\x87\x4b\xf4\x8e\xaf\x70\xee\xa3\xa6\x2a\x25"
+ "\x0a\x8b\x6b\xd8\xd9\xb0\x8b\x08\xd6\x4e\x32\xd1\x81\x77\x77\xfb"
+ "\x54\x4d\x49\xcd\x49\x72\x0e\x21\x9d\xbf\x8b\xbe\xd3\x39\x04\xe1"
+ "\xfd\x40\xa4\x1d\x37\x0a\x1f\x65\x74\x50\x95\x68\x7d\x47\xba\x1d"
+ "\x36\xd2\x34\x9e\x23\xf6\x44\x39\x2c\x8e\xa9\xc4\x9d\x40\xc1\x32"
+ "\x71\xaf\xf2\x64\xd0\xf2\x48\x41\xd6\x46\x5f\x09\x96\xff\x84\xe6"
+ "\x5f\xc5\x17\xc5\x3e\xfc\x33\x63\xc3\x84\x92\xa8",
+ .klen = 16,
+ .ilen = 156,
+ .input = "\xaa\xf8\xe8\xb3\x49\xfb\xab\xb9\x5c\x62\x1d\xe6\xfb\x51\x67\x44"
+ "\x60\x54\xae\x7c\xfa\x94\x6f\x99\x6c\x26\x00\x53\x45\xa1\xa2\xaf"
+ "\x44\xee\xa6\x88\xb7\x59\xff\xe3\xe2\x2d\x6e\x17\xbd\x9e\x70\x79"
+ "\xcc\x54\xe8\xd4\x92\xdb\xfd\xe7\x9e\x84\x04\x38\x49\x82\x1a\x24"
+ "\x7a\x67\xd3\x50\x9b\xa1\x6b\x49\x15\xfd\xdd\xd6\x38\xe2\x52\xf4"
+ "\x37\x1e\x47\x1d\x1b\x39\xb4\x15\x8b\x47\xf1\x4d\x03\x7b\xbd\x28"
+ "\x37\x80\x41\x34\xad\x49\x3b\xfc\x14\x0e\x43\x7f\x5e\xbf\x9c\x29"
+ "\xd5\xd8\xa5\x81\x6f\x92\x6a\xa2\x76\xe9\xa7\x43\xa6\x21\x41\xad"
+ "\xeb\x65\x3b\xd2\x96\x3c\x9f\x54\x1f\x5e\x13\x34\xb7\x75\x92\xb1"
+ "\xad\xed\x44\x36\x72\x28\x28\x01\x32\xa7\x47\xde",
+ .rlen = 156,
},
};
static struct cipher_testvec kasumi_f8_enc_template[] ={
-
- {
-
+ {
.key = "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00"
- "\x95\x2c\x49\x10"
- "\x48\x81\xff\x48",
-
+ "\x95\x2c\x49\x10\x48\x81\xff\x48",
.klen = 16,
-
.iv = "\x72\xa4\xf2\x0f\x64\x00\x00\x00",
-
.input = "\x7e\xc6\x12\x72\x74\x3b\xf1\x61"
- "\x47\x26\x44\x6a\x6c\x38\xce\xd1"
- "\x66, \xf6, \xca, \x76, \xeb, \x54, \x30, \x04"
- "\x42, \x86, \x34, \x6c, \xef, \x13, \x0f, \x92"
- "\x92, \x2b, \x03, \x45, \x0d, \x3a, \x99, \x75, \xe5, \xbd, \x2e, \xa0"
- "\xeb, \x55, \xad, \x8e, \x1b, \x19, \x9e, \x3e, \xc4, \x31, \x60, \x20"
- "\xe9, \xa1, \xb2, \x85, \xe7, \x62, \x79, \x53, \x59, \xb7, \xbd, \xfd, \x39, \xbe, \xf4, \xb2"
- "\x48, \x45, \x83, \xd5,\xaf, \xe0, \x82, \xae,\xe6, \x38, \xbf, \x5f, \xd5, \xa6, \x06, \x19"
- "\x39, \x01, \xa0, \x8f, \x4a, \xb4, \x1a, \xab, \x9b, \x13, \x48, \x80",
-
+ "\x47\x26\x44\x6a\x6c\x38\xce\xd1",
.ilen = 16,
- .result = "\xd1, \xe2, \xde, \x70, \xee, \xf8, \x6c, \x69, \x64, \xfb, \x54, \x2b, \xc2, \xd4, \x60, \xaa"
- "\xbf, \xaa, \x10, \xa4, \xa0, \x93, \x26, \x2b, \x7d, \x19, \x9e, \x70, \x6f, \xc2, \xd4, \x89"
- "\x15, \x53, \x29, \x69, \x10, \xf3, \xa9, \x73, \x01, \x26, \x82, \xe4, \x1c, \x4e, \x2b, \x02"
- "\xbe, \x20, \x17, \xb7, \x25, \x3b, \xbf, \x93, \x09, \xde, \x58, \x19, \xcb, \x42, \xe8, \x19"
- "\x56, \xf4, \xc9, \x9b, \xc9, \x76, \x5c, \xaf, \x53, \xb1, \xd0, \xbb, \x82, \x79, \x82, \x6a"
- "\xdb, \xbc, \x55, \x22, \xe9, \x15, \xc1, \x20, \xa6, \x18, \xa5, \xa7, \xf5, \xe8, \x97, \x08"
- "\x93, \x39, \x65, \x0f",
- .rlen = 10,
- },
+ .result = "\xd1\xe2\xde\x70\xee\xf8\x6c\x69"
+ "\x64\xfb\x54\x2b\xc2\xd4\x60\xaa",
+ .rlen = 16,
+ },
+};
+
+static struct cipher_testvec kasumi_enc_template[] = {
+ {
+ .key = "\x01\x02\x03\x04\x05\x06\x07\x08"
+ "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10",
+ .klen = 16,
+ .input = "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8",
+ .ilen = 8,
+ .result = "\xed\xa7\xdb\xe8\xd9\xf4\x93\x2e",
+ .rlen = 8,
+ },
+};
+
+static struct cipher_testvec kasumi_dec_template[] = {
+ {
+ .key = "\x01\x02\x03\x04\x05\x06\x07\x08"
+ "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10",
+ .klen = 16,
+ .input = "\xec\xa7\xdb\xe8\xd9\xf4\x93\x2e",
+ .ilen = 8,
+ .result = "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8",
+ .rlen = 8,
+ },
};
+
+static struct hash_testvec kasumi_f9_tv_template[] = {
+ {
+ .key = "\x5d\x0a\x80\xd8\x13\x4a\xe1\x96\x77\x82\x4b\x67\x1e\x83\x8a\xf4",
+ .ksize = 16,
+ .plaintext = "\x78\x27\xfa\xb2\xa5\x6c\x6c\xa2\x01\x00\x00\x00\x00\x00\x00\x00"
+ "\x70\xde\xdf\x2d\xc4\x2c\x5c\xbd\x3a\x96\xf8\xa0\xb1\x14\x18\xb3"
+ "\x60\x8d\x57\x33\x60\x4a\x2c\xd3\x6a\xab\xc7\x0c\xe3\x19\x3b\xb5"
+ "\x15\x3b\xe2\xd3\xc0\x6d\xfd\xb2\xd1\x6e\x9c\x35\x71\x58\xbe\x6a"
+ "\x41\xd6\xb8\x61\xe4\x91\xdb\x3f\xbf\xeb\x51\x8e\xfc\xf0\x48\xd7"
+ "\xd5\x89\x53\x73\x0f\xf3\x0c\x9e\xc4\x70\xff\xcd\x66\x3d\xc3\x42"
+ "\x01\xc3\x6a\xdd\xc0\x11\x1c\x35\xb3\x8a\xfe\xe7\xcf\xdb\x58\x2e"
+ "\x37\x31\xf8\xb4\xba\xa8\xd1\xa8\x9c\x06\xe8\x11\x99\xa9\x71\x62"
+ "\x27\xbe\x34\x4e\xfc\xb4\x36\xdd\xd0\xf0\x96\xc0\x64\xc3\xb5\xe2"
+ "\xc3\x99\x99\x3f\xc7\x73\x94\xf9\xe0\x97\x20\xa8\x11\x85\x0e\xf2"
+ "\x3b\x2e\xe0\x5d\x9e\x61\x73\x60\x9d\x86\xe1\xc0\xc1\x8e\xa5\x1a"
+ "\x01\x2a\x00\xbb\x41\x3b\x9c\xb8\x18\x8a\x70\x3c\xd6\xba\xe3\x1c"
+ "\xc6\x7b\x34\xb1\xb0\x00\x19\xe6\xa2\xb2\xa6\x90\xf0\x26\x71\xfe"
+ "\x7c\x9e\xf8\xde\xc0\x09\x4e\x53\x37\x63\x47\x8d\x58\xd2\xc5\xf5"
+ "\xb8\x27\xa0\x14\x8c\x59\x48\xa9\x69\x31\xac\xf8\x4f\x46\x5a\x64"
+ "\xe6\x2c\xe7\x40\x07\xe9\x91\xe3\x7e\xa8\x23\xfa\x0f\xb2\x19\x23"
+ "\xb7\x99\x05\xb7\x33\xb6\x31\xe6\xc7\xd6\x86\x0a\x38\x31\xac\x35"
+ "\x1a\x9c\x73\x0c\x52\xff\x72\xd9\xd3\x08\xee\xdb\xab\x21\xfd\xe1"
+ "\x43\xa0\xea\x17\xe2\x3e\xdc\x1f\x74\xcb\xb3\x63\x8a\x20\x33\xaa"
+ "\xa1\x54\x64\xea\xa7\x33\x38\x5d\xbb\xeb\x6f\xd7\x35\x09\xb8\x57"
+ "\xe6\xa4\x19\xdc\xa1\xd8\x90\x7a\xf9\x77\xfb\xac\x4d\xfa\x35\xec",
+ .psize = 336,
+ .digest = "\x04\x91\x20\x48\x82\x37\xc4\x1a",
+ },
+};
+
/*
* AES test vectors.
*/
diff --git a/drivers/ata/sata_dwc_pmp.c b/drivers/ata/sata_dwc_pmp.c
index c1b0cff6ae6..df3b490f86e 100755
--- a/drivers/ata/sata_dwc_pmp.c
+++ b/drivers/ata/sata_dwc_pmp.c
@@ -104,8 +104,8 @@
#define AHB_DMA_BRST_DFLT 64 /* 16 data items burst length */
#endif
-#if defined(CONFIG_APM82181)
- extern void signal_hdd_led(int, int);
+#if defined(CONFIG_APOLLO3G)
+extern void signal_hdd_led(int, int);
#endif
struct dmareg {
u32 low; /* Low bits 0-31 */
@@ -1033,8 +1033,8 @@ static void dma_dwc_xfer_start(int dma_ch)
#endif
-#if defined(CONFIG_APM82181)
- signal_hdd_led(1 /*blink=yes*/, 2 /* _3G_LED_GREEN */);
+#if defined(CONFIG_APOLLO3G)
+ signal_hdd_led(1 /*blink=yes*/, 2 /* _3G_LED_GREEN */);
#endif
}
@@ -1742,7 +1742,9 @@ static irqreturn_t sata_dwc_isr(int irq, void *dev_instance)
if (intpr & SATA_DWC_INTPR_ERR) {
sata_dwc_error_intr(ap, hsdev, intpr);
handled = 1;
- signal_hdd_led(0 /*off blink*/, 1 /*red color*/);
+#if defined(CONFIG_APOLLO3G)
+ signal_hdd_led(0 /*off blink*/, 1 /*red color*/);
+#endif
goto done_irqrestore;
}
@@ -1928,8 +1930,8 @@ still_busy:
done_irqrestore:
spin_unlock_irqrestore(&host->lock, flags);
-#if defined(CONFIG_APM82181)
- signal_hdd_led(0 /*off blink*/, -1 /* no color */);
+#if defined(CONFIG_APOLLO3G)
+ signal_hdd_led(0 /*off blink*/, -1 /* no color */);
#endif
return IRQ_RETVAL(handled);
}
diff --git a/drivers/char/hw_random/trng4xx.c b/drivers/char/hw_random/trng4xx.c
index ece45e74aa1..ae62cc20693 100644
--- a/drivers/char/hw_random/trng4xx.c
+++ b/drivers/char/hw_random/trng4xx.c
@@ -162,7 +162,7 @@ static void trng4xx_chk_overflow(void)
} __attribute__((packed));
- rc = trng4xx_hw_write32(TRNG4XX_ALARMCNT_ADDR, val);
+ rc = trng4xx_hw_read32(TRNG4XX_ALARMCNT_ADDR, &val);
if (rc != 0)
return;
diff --git a/drivers/crypto/amcc/crypto4xx_alg.c b/drivers/crypto/amcc/crypto4xx_alg.c
index 9d81d8f7571..79fe7ec3306 100644
--- a/drivers/crypto/amcc/crypto4xx_alg.c
+++ b/drivers/crypto/amcc/crypto4xx_alg.c
@@ -366,7 +366,6 @@ int crypto4xx_compute_gcm_hash_key_sw(struct crypto4xx_ctx *ctx,
goto out;
crypto4xx_memcpy_le(ctx->sa_in +
get_dynamic_sa_offset_inner_digest(ctx), src, 16);
-
out:
crypto_free_blkcipher(aes_tfm);
return rc;
@@ -471,6 +470,7 @@ static int crypto4xx_setkey_3des(struct crypto_ablkcipher *cipher,
sa = (struct dynamic_sa_ctl *) ctx->sa_out;
sa->sa_command_0.bf.dir = DIR_OUTBOUND;
+ CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm));
return 0;
}
@@ -516,6 +516,8 @@ int crypto4xx_encrypt(struct ablkcipher_request *req)
ctx->is_hash = 0;
ctx->pd_ctl = 0x1;
+ CRYPTO4XX_TXLOG("encrypt %s nbytes %d",
+ req->base.tfm->__crt_alg->cra_name, req->nbytes);
return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
req->nbytes, NULL, 0, req->info,
get_dynamic_sa_iv_size(ctx));
@@ -530,6 +532,8 @@ int crypto4xx_decrypt(struct ablkcipher_request *req)
ctx->pd_ctl = 0x1;
ctx->direction = DIR_INBOUND;
+ CRYPTO4XX_TXLOG("decrypt %s nbytes %d",
+ req->base.tfm->__crt_alg->cra_name, req->nbytes);
return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
req->nbytes, NULL, 0, req->info,
get_dynamic_sa_iv_size(ctx));
@@ -545,6 +549,8 @@ int crypto4xx_encrypt_ctr(struct ablkcipher_request *req)
ctx->pd_ctl = 0x1;
ctx->direction = DIR_OUTBOUND;
+ CRYPTO4XX_TXLOG("encrypt %s nbytes %d",
+ req->base.tfm->__crt_alg->cra_name, req->nbytes);
return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
req->nbytes, NULL, 0,
req->info,
@@ -561,6 +567,8 @@ int crypto4xx_decrypt_ctr(struct ablkcipher_request *req)
ctx->pd_ctl = 0x1;
ctx->direction = DIR_INBOUND;
+ CRYPTO4XX_TXLOG("decrypt %s nbytes %d",
+ req->base.tfm->__crt_alg->cra_name, req->nbytes);
return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
req->nbytes, NULL, 0,
req->info,
@@ -637,6 +645,7 @@ static int crypto4xx_setkey_aes(struct crypto_ablkcipher *cipher,
sa = (struct dynamic_sa_ctl *) ctx->sa_out;
sa->sa_command_0.bf.dir = DIR_OUTBOUND;
+ CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm));
return 0;
}
@@ -728,6 +737,7 @@ int crypto4xx_setkey_aes_ctr(struct crypto_ablkcipher *cipher,
sa = (struct dynamic_sa_ctl *) ctx->sa_out;
sa->sa_command_0.bf.dir = DIR_OUTBOUND;
+ CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm));
return 0;
}
@@ -856,7 +866,8 @@ int crypto4xx_setkey_aes_gcm(struct crypto_aead *cipher,
sa = (struct dynamic_sa_ctl *) ctx->sa_out;
sa->sa_command_0.bf.dir = DIR_OUTBOUND;
sa->sa_command_0.bf.opcode = SA_OPCODE_ENCRYPT_HASH;
-
+
+ CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm));
return 0;
err:
crypto4xx_free_sa(ctx);
@@ -871,6 +882,8 @@ int crypto4xx_encrypt_aes_gcm(struct aead_request *req)
ctx->direction = DIR_OUTBOUND;
ctx->append_icv = 1;
+ CRYPTO4XX_TXLOG("encrypt %s nbytes %d",
+ req->base.tfm->__crt_alg->cra_name, req->cryptlen);
return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
req->cryptlen, req->assoc, req->assoclen,
req->iv, crypto_aead_ivsize(aead));
@@ -882,6 +895,8 @@ int crypto4xx_decrypt_aes_gcm(struct aead_request *req)
struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
int len = req->cryptlen - crypto_aead_authsize(aead);
+ CRYPTO4XX_TXLOG("decrypt %s nbytes %d",
+ req->base.tfm->__crt_alg->cra_name, req->cryptlen);
ctx->direction = DIR_INBOUND;
ctx->append_icv = 0;
return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
@@ -993,7 +1008,7 @@ int crypto4xx_setkey_aes_ccm(struct crypto_aead *cipher, const u8 *key,
SA_SEQ_MASK_OFF, SA_MC_ENABLE,
SA_NOT_COPY_PAD, SA_COPY_PAYLOAD,
SA_NOT_COPY_HDR);
-
+ CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm));
return 0;
}
@@ -1153,6 +1168,7 @@ int crypto4xx_setkey_kasumi(struct crypto_ablkcipher *cipher,
sa = (struct dynamic_sa_ctl *) ctx->sa_out;
sa->sa_command_0.bf.dir = DIR_OUTBOUND;
+ CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm));
return 0;
}
@@ -1185,6 +1201,8 @@ int crypto4xx_encrypt_kasumi(struct ablkcipher_request *req)
ctx->direction = DIR_OUTBOUND;
ctx->pd_ctl = 0x1;
+ CRYPTO4XX_TXLOG("encrypt %s nbytes %d",
+ req->base.tfm->__crt_alg->cra_name, req->nbytes);
return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
req->nbytes, NULL, 0, NULL, 0);
}
@@ -1315,7 +1333,7 @@ int crypto4xx_setkey_arc4(struct crypto_ablkcipher *cipher,
sa = (struct dynamic_sa_ctl *) ctx->sa_out;
sa->sa_command_0.bf.dir = DIR_OUTBOUND;
-
+ CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm));
return 0;
}
@@ -1460,6 +1478,11 @@ int crypto4xx_hash_digest(struct ahash_request *req)
ctx->pd_ctl = 0x11;
ctx->direction = DIR_INBOUND;
+#if 0
+ ESP_PHD(KERN_CONT, "", DUMP_PREFIX_OFFSET,
+ 16, 1,
+ (void*)req, sizeof(struct ahash_request), false);
+#endif
return crypto4xx_build_pd(&req->base, ctx, req->src,
(struct scatterlist *) req->result,
req->nbytes, NULL, 0, NULL, 0);
@@ -1550,7 +1573,8 @@ int crypto4xx_hash_hmac_setkey(struct crypto_ahash *hash,
memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4);
sa = (struct dynamic_sa_ctl *) ctx->sa_out;
sa->sa_command_0.bf.dir = DIR_OUTBOUND;
-
+
+ CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm));
return 0;
err:
crypto4xx_free_sa(ctx);
@@ -1799,7 +1823,7 @@ int crypto4xx_xcbc_setkey(struct crypto_ahash *hash,
memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4);
sa = (struct dynamic_sa_ctl *) ctx->sa_out;
sa->sa_command_0.bf.dir = DIR_OUTBOUND;
-
+ CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm));
return 0;
err:
crypto4xx_free_sa(ctx);
@@ -1872,7 +1896,7 @@ int crypto4xx_kasumi_f9_setkey(struct crypto_ahash *hash,
ctx->hash_final = 1;
ctx->pd_ctl = 0x11;
ctx->bypass = 4;
-
+ CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm));
return 0;
}
@@ -2093,7 +2117,7 @@ int crypto4xx_setkey_esp_tunnel(struct crypto_aead *cipher,
ctx->is_hash = 0;
ctx->pad_ctl = param->pad_block_size/4;
ctx->append_icv = 0;
-
+ CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm));
return 0;
err_nomem_sr:
@@ -3021,7 +3045,7 @@ int crypto4xx_setkey_macsec_gcm(struct crypto_aead *cipher,
ctx->hash_final = 1;
ctx->is_hash = 0;
ctx->bypass = 0;
-
+ CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm));
return 0;
err_nomem_sr:
@@ -3177,6 +3201,7 @@ static int crypto4xx_setkey_dtls(struct crypto_aead *cipher,
CRYPTO_FEEDBACK_MODE_NO_FB, SA_EXTENDED_SN_ON,
SA_SEQ_MASK_OFF, SA_MC_ENABLE,
SA_COPY_PAD, SA_COPY_PAYLOAD, SA_COPY_HDR);
+ CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm));
return 0;
err_nomem_sr:
@@ -3413,7 +3438,7 @@ static int crypto4xx_setkey_ssl_tls(struct crypto_aead *cipher,
SA_COPY_PAD,
SA_COPY_PAYLOAD,
SA_COPY_HDR);
-
+ CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm));
return 0;
err_nomem_sr:
@@ -3617,7 +3642,8 @@ int crypto4xx_setkey_ssl_tls_arc4(struct crypto_aead *cipher,
sa->sa_command_1.bf.arc4_stateful = 1;
sa->sa_command_1.bf.save_arc4_state = 1;
-
+
+ CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm));
return 0;
err_nomem_arc4:
@@ -4070,11 +4096,11 @@ int crypto4xx_setkey_transport_esp_rfc4106_gcm(struct crypto_aead *cipher,
ctx->authenc = 0;
ctx->hash_final = 1;
ctx->is_hash = 0;
- printk("param->pad_block_size = %d\n", param->pad_block_size);
//ctx->pad_ctl = param->pad_block_size / 4;
ctx->pad_ctl = 0x08;
ctx->append_icv = 0;
+ CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm));
return 0;
err_nomem_sr:
diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c
index 8c00e30e9e6..f1721e85770 100644
--- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -1279,9 +1279,10 @@ u32 crypto4xx_build_pd(struct crypto_async_request *req,
*/
crypto4xx_memcpy_le(pd_uinfo->sr_va +
CTR_RFC3686_NONCE_SIZE, iv, iv_len);
- } else
+ } else {
crypto4xx_memcpy_le(pd_uinfo->sr_va,
iv, iv_len);
+ }
}
if (ctx->is_gcm || ctx->ctr_aes) {
u32 seq = 1;
@@ -1444,14 +1445,15 @@ u32 crypto4xx_build_pd(struct crypto_async_request *req,
pd_uinfo->state = PD_ENTRY_INUSE;
wmb();
/* write any value to push engine to read a pd */
+
if (dev->core_dev->revb_ver == 1) {
#ifndef CONFIG_SEC_HW_POLL
writel(1, dev->ce_base + CRYPTO4XX_INT_DESCR_RD);
#endif
- } else
+ } else {
writel(1, dev->ce_base + CRYPTO4XX_INT_DESCR_RD);
+ }
-
dev->pkt_cnt++;
return -EINPROGRESS;
}
@@ -1596,14 +1598,16 @@ static irqreturn_t crypto4xx_ce_interrupt_handler(int irq, void *data)
{
struct device *dev = (struct device *)data;
struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev);
- //u32 int_status;
+ u32 int_status, dev_status;
if (core_dev->dev->ce_base == 0)
return 0;
- //int_status = readl(core_dev->dev->ce_base + CRYPTO4XX_INT_UNMASK_STAT);
- //printk("Interrupt status = 0x%08x\n", int_status);
+ int_status = readl(core_dev->dev->ce_base + CRYPTO4XX_INT_UNMASK_STAT);
+ printk("Interrupt status = 0x%08x\n", int_status);
+ dev_status = readl(core_dev->dev->ce_base + CRYPTO4XX_DEVICE_INFO);
+ printk("dev status = 0x%08x\n", dev_status);
/* For RevB, 460EX and 460ExR Rev B */
if (core_dev->revb_ver == 1) {
writel(PPC4XX_INTERRUPT_CLR_REVB,
@@ -1625,7 +1629,7 @@ static irqreturn_t crypto4xx_ce_interrupt_handler(int irq, void *data)
*/
struct crypto4xx_alg_common crypto4xx_alg[] = {
/* Crypto DES ECB, CBC, modes */
-#if 1
+#if 0
{ .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = {
.cra_name = "cbc(des)",
.cra_driver_name = "ppc4xx-cbc-des",
@@ -1885,6 +1889,7 @@ struct crypto4xx_alg_common crypto4xx_alg[] = {
}
}
}},
+#endif
/* Hash MD5 */
{ .type = CRYPTO_ALG_TYPE_AHASH, .u.hash = {
@@ -1907,8 +1912,8 @@ struct crypto4xx_alg_common crypto4xx_alg[] = {
.cra_module = THIS_MODULE,
}
}},
-#endif
-#if 1
+
+#if 0
/* Hash MD5-HMAC */
{ .type = CRYPTO_ALG_TYPE_AHASH, .u.hash = {
.init = crypto4xx_hash_init,
@@ -1972,7 +1977,7 @@ struct crypto4xx_alg_common crypto4xx_alg[] = {
}
}},
-#if 1
+#if 0
{ .type = CRYPTO_ALG_TYPE_AHASH, .u.hash = {
.init = crypto4xx_hash_init,
.update = crypto4xx_hash_update,
@@ -2117,7 +2122,7 @@ struct crypto4xx_alg_common crypto4xx_alg[] = {
}
}},
#endif
-#if 1
+#if 0
{ .type = CRYPTO_ALG_TYPE_AHASH, .u.hash = {
.init = crypto4xx_hash_init,
.update = crypto4xx_hash_update,
@@ -2157,7 +2162,7 @@ struct crypto4xx_alg_common crypto4xx_alg[] = {
.cra_module = THIS_MODULE,
}
}},
-
+#endif
/* Crypto Kasumi and Kasumi F8 */
{ .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = {
.cra_name = "kasumi",
@@ -2224,8 +2229,8 @@ struct crypto4xx_alg_common crypto4xx_alg[] = {
.cra_module = THIS_MODULE,
}
}},
-#endif
-#if 1
+
+#if 0
/* Crypto ARC4 - stateless */
{ .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = {
.cra_name = "ecb(arc4)",
@@ -2273,7 +2278,7 @@ struct crypto4xx_alg_common crypto4xx_alg[] = {
}
}},
#endif
-#if 1
+#if 0
/* IPSec combined hash and crypto Algorithms */
{ .type = CRYPTO_ALG_TYPE_AEAD, .u.cipher = {
.cra_name = "tunnel(esp(authenc(hmac(md5),cbc(aes))))",
@@ -2323,7 +2328,7 @@ struct crypto4xx_alg_common crypto4xx_alg[] = {
}
}},
#endif
-#if 1
+#if 0
/* IPSec combined hash and crypto Algorithms */
{ .type = CRYPTO_ALG_TYPE_AEAD, .u.cipher = {
.cra_name = "tunnel(esp(authenc(hmac(sha224),cbc(aes))))",
@@ -2349,7 +2354,7 @@ struct crypto4xx_alg_common crypto4xx_alg[] = {
}
}},
#endif
-#if 1
+#if 0
/* IPSec combined hash and crypto Algorithms */
{ .type = CRYPTO_ALG_TYPE_AEAD, .u.cipher = {
.cra_name = "tunnel(esp(authenc(hmac(sha256),cbc(aes))))",
@@ -3108,7 +3113,7 @@ struct crypto4xx_alg_common crypto4xx_alg[] = {
}
}},
#endif
-#if 1
+#if 0
/* IPSec combined hash and crypto Algorithms */
{ .type = CRYPTO_ALG_TYPE_AEAD, .u.cipher = {
.cra_name = "transport(esp(authenc(hmac(sha256),cbc(des3_ede))))",
@@ -3251,7 +3256,7 @@ struct crypto4xx_alg_common crypto4xx_alg[] = {
}
}},
#endif
-#if 1
+#if 0
{ .type = CRYPTO_ALG_TYPE_AEAD, .u.cipher = {
.cra_name = "dtls(aes-sha1)",
.cra_driver_name = "dtls-ppc4xx",
@@ -3278,7 +3283,7 @@ struct crypto4xx_alg_common crypto4xx_alg[] = {
}
}},
#endif
-#if 1
+#if 0
{ .type = CRYPTO_ALG_TYPE_AEAD, .u.cipher = {
.cra_name = "dtls(des-sha1)",
.cra_driver_name = "ppc4xx-dtls-des-sha1",
@@ -3305,7 +3310,7 @@ struct crypto4xx_alg_common crypto4xx_alg[] = {
}
}},
#endif
-#if 1
+#if 0
{ .type = CRYPTO_ALG_TYPE_AEAD, .u.cipher = {
.cra_name = "dtls(des3-sha1)",
.cra_driver_name = "ppc4xx-dtls-des3-sha1",
diff --git a/drivers/crypto/amcc/crypto4xx_core.h b/drivers/crypto/amcc/crypto4xx_core.h
index 658a2416294..fea57ff139e 100644
--- a/drivers/crypto/amcc/crypto4xx_core.h
+++ b/drivers/crypto/amcc/crypto4xx_core.h
@@ -50,6 +50,50 @@
#define PD_ENTRY_FREE 0
#define ERING_WAS_FULL 0xffffffff
+#if 0
+#define CRYPTO4XX_DEBUG_LOG
+#define CRYPTO4XX_TXDEBUG
+#endif
+
+/* Debugging Macro */
+#define CRYPTO4XX_HDR "CRYPTO4XX: "
+
+#define CRYPTO4XX_ERR(fmt, ...) \
+ printk(KERN_ERR CRYPTO4XX_HDR fmt "\n", ##__VA_ARGS__);
+#define CRYPTO4XX_LOG(fmt, ...) \
+ printk(KERN_INFO CRYPTO4XX_HDR fmt "\n", ##__VA_ARGS__);
+
+#if !defined(CRYPTO4XX_TXDEBUG)
+# define CRYPTO4XX_TXLOG(fmt, ...)
+# define CRYPTO4XX_TXDUMP(hdr, d, l)
+#else
+# define CRYPTO4XX_TXLOG(fmt, ...) \
+ do { \
+ printk(KERN_INFO CRYPTO4XX_HDR fmt "\n", ##__VA_ARGS__); \
+} while(0);
+# define CRYPTO4XX_TXDUMP(hdr, d, l) \
+ do { \
+ print_hex_dump(KERN_INFO, CRYPTO4XX_HDR hdr, \
+ DUMP_PREFIX_ADDRESS, 16, 4, d, l, 1); \
+} while(0);
+#endif
+
+#if !defined(CRYPTO4XX_DEBUG_LOG)
+# define CRYPTO4XX_DEBUG(fmt, ...)
+# define CRYPTO4XX_DEBUG_DUMP(hdr, fmt, ...)
+#else
+# define CRYPTO4XX_DEBUG(fmt, ...) \
+ do { \
+ printk(KERN_INFO CRYPTO4XX_HDR fmt "\n", ##__VA_ARGS__); \
+} while(0);
+# define CRYPTO4XX_DEBUG_DUMP(hdr, d, l) \
+ do { \
+ print_hex_dump(KERN_INFO, CRYPTO4XX_HDR hdr, \
+ DUMP_PREFIX_ADDRESS, 16, 4, d, l, 1); \
+} while(0);
+#endif
+
+
struct crypto4xx_device;
struct pd_uinfo {
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 122d07af5b5..d3a4ce06015 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -453,7 +453,7 @@ static int raid0_make_request(struct request_queue *q, struct bio *bio)
int cpu;
if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER))) {
- md_barrier_request(mddev, bio);
+ bio_endio(bio, -EOPNOTSUPP);
return 0;
}
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 0d403ca12ae..1cb830da54d 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -96,6 +96,16 @@
#define printk_rl(args...) ((void) (printk_ratelimit() && printk(args)))
+#ifdef CONFIG_MD_RAID_SKIP_BIO_COPY
+/* Define SKIP_BIO_COPY_ERR to enable work around for the issue
+ * SKIP_BIO_COPY malfunction when RAID degrades
+ */
+#define SKIP_BIO_COPY_ERR
+#if defined(SKIP_BIO_COPY_ERR)
+static int degraded = 0;
+#endif
+#endif
+
/*
* We maintain a biased count of active stripes in the bottom 16 bits of
* bi_phys_segments, and a count of processed stripes in the upper 16 bits
@@ -956,6 +966,12 @@ ops_run_biodrain(struct stripe_head *sh, struct dma_async_tx_descriptor *tx)
(unsigned long long)sh->sector);
#ifdef CONFIG_MD_RAID_SKIP_BIO_COPY
+#ifdef SKIP_BIO_COPY_ERR
+ if(degraded){
+ fswrite = 0;
+ goto not_use_skip_bio;
+ }
+#endif
/* initially assume that the operation is a full-stripe write*/
for (i = disks; i-- ;) {
struct r5dev *dev = &sh->dev[i];
@@ -1018,6 +1034,9 @@ do_copy:
async_tx_issue_pending_all();
}
#endif
+#ifdef SKIP_BIO_COPY_ERR
+not_use_skip_bio:
+#endif
for (i = disks; i--; ) {
struct r5dev *dev = &sh->dev[i];
@@ -1127,7 +1146,7 @@ ops_run_reconstruct5(struct stripe_head *sh, struct raid5_percpu *percpu,
* set ASYNC_TX_XOR_DROP_DST and ASYNC_TX_XOR_ZERO_DST
* for the synchronous xor case
*/
- flags = ASYNC_TX_ACK |
+ flags = ASYNC_TX_FENCE | ASYNC_TX_ACK |
(prexor ? ASYNC_TX_XOR_DROP_DST : ASYNC_TX_XOR_ZERO_DST);
atomic_inc(&sh->count);
@@ -1718,6 +1737,7 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev)
*/
set_bit(MD_RECOVERY_INTR, &mddev->recovery);
}
+ degraded = 1;
set_bit(Faulty, &rdev->flags);
printk(KERN_ALERT
"raid5: Disk failure on %s, disabling device.\n"
@@ -3977,6 +3997,12 @@ static int make_request(struct request_queue *q, struct bio * bi)
const int rw = bio_data_dir(bi);
int cpu, remaining;
+#if defined(SKIP_BIO_COPY_ERR)
+ if(mddev->degraded)
+ degraded = 1;
+ else
+ degraded = 0;
+#endif
if (unlikely(bio_rw_flagged(bi, BIO_RW_BARRIER))) {
/* Drain all pending writes. We only really need
* to ensure they have been submitted, but this is
@@ -5235,6 +5261,9 @@ static int stop(mddev_t *mddev)
blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
free_conf(conf);
mddev->private = &raid5_attrs_group;
+#if defined(SKIP_BIO_COPY_ERR)
+ degraded = 0;
+#endif
return 0;
}
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index efb2d3699e4..4b2f062218b 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -228,6 +228,7 @@ static int __devinit of_flash_probe(struct of_device *dev,
" tree\n");
goto err_out;
}
+
dev_dbg(&dev->dev, "of_flash device: %.8llx-%.8llx\n",
(unsigned long long)res.start,
(unsigned long long)res.end);
@@ -345,6 +346,12 @@ err_flash_remove:
}
static struct of_device_id of_flash_match[] = {
+#ifndef CONFIG_APOLLO3G
+ {
+ .compatible = "cfi-flash",
+ .data = (void *)"cfi_probe",
+ },
+#endif
{
/* FIXME: JEDEC chips can't be safely and reliably
* probed, although the mtd code gets it right in
@@ -356,10 +363,12 @@ static struct of_device_id of_flash_match[] = {
.compatible = "jedec-flash",
.data = (void *)"jedec_probe",
},
+#ifdef CONFIG_APOLLO3G
{
.compatible = "cfi-flash",
.data = (void *)"cfi_probe",
},
+#endif
{
.compatible = "mtd-ram",
.data = (void *)"map_ram",
diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c
index 568608d638c..c1d4ddd3458 100644
--- a/drivers/mtd/nand/ndfc.c
+++ b/drivers/mtd/nand/ndfc.c
@@ -102,7 +102,7 @@ static int ndfc_calculate_ecc(struct mtd_info *mtd,
wmb();
ecc = in_be32(ndfc->ndfcbase + NDFC_ECC);
/* The NDFC uses Smart Media (SMC) bytes order */
-#if !defined(CONFIG_APM82181)
+#if !defined(CONFIG_APOLLO3G)
ecc_code[0] = p[1];
ecc_code[1] = p[2];
ecc_code[2] = p[3];
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c
index fb9049bcbce..eabad755e4a 100644
--- a/drivers/net/ibm_newemac/core.c
+++ b/drivers/net/ibm_newemac/core.c
@@ -1365,9 +1365,11 @@ static int emac_open(struct net_device *ndev)
{
struct emac_instance *dev = netdev_priv(ndev);
int err, i;
+ unsigned long flags;
DBG(dev, "open" NL);
+
/* Setup error IRQ handler */
err = request_irq(dev->emac_irq, emac_irq, 0, "EMAC", dev);
if (err) {
@@ -1385,6 +1387,7 @@ static int emac_open(struct net_device *ndev)
return err;
}
}
+
/* Allocate RX ring */
for (i = 0; i < NUM_RX_BUFF; ++i)
if (emac_alloc_rx_skb(dev, i, GFP_KERNEL)) {
@@ -1443,17 +1446,24 @@ static int emac_open(struct net_device *ndev)
/* Required for Pause packet support in EMAC */
dev_mc_add(ndev, default_mcast_addr, sizeof(default_mcast_addr), 1);
+ local_irq_save(flags); /* disable interrupts */
emac_configure(dev);
+
mal_poll_add(dev->mal, &dev->commac);
mal_enable_tx_channel(dev->mal, dev->mal_tx_chan);
mal_set_rcbs(dev->mal, dev->mal_rx_chan, emac_rx_size(ndev->mtu));
+
mal_enable_rx_channel(dev->mal, dev->mal_rx_chan);
emac_tx_enable(dev);
emac_rx_enable(dev);
+ local_irq_restore(flags);
+
emac_netif_start(dev);
+
mutex_unlock(&dev->link_lock);
+
return 0;
oom:
emac_clean_rx_ring(dev);
@@ -1962,6 +1972,9 @@ static inline int emac_rx_sg_append(struct emac_instance *dev, int slot)
dev_kfree_skb(dev->rx_sg_skb);
dev->rx_sg_skb = NULL;
} else {
+ if(unlikely((dev->rx_sg_skb->tail + len) > dev->rx_sg_skb->end))
+ goto out;
+
cacheable_memcpy(skb_tail_pointer(dev->rx_sg_skb),
dev->rx_skb[slot]->data, len);
skb_put(dev->rx_sg_skb, len);
@@ -1969,6 +1982,7 @@ static inline int emac_rx_sg_append(struct emac_instance *dev, int slot)
return 0;
}
}
+out:
emac_recycle_rx_skb(dev, slot, 0);
return -1;
}
@@ -2027,6 +2041,7 @@ static int emac_poll_rx(void *param, int budget)
goto oom;
skb_put(skb, len);
+
push_packet:
skb->dev = dev->ndev;
skb->protocol = eth_type_trans(skb, dev->ndev);
@@ -3071,7 +3086,7 @@ static int __devinit emac_init_phy(struct emac_instance *dev)
}
emac_configure(dev);
-
+
if (dev->phy_address != 0xffffffff)
phy_map = ~(1 << dev->phy_address);
@@ -3105,6 +3120,7 @@ static int __devinit emac_init_phy(struct emac_instance *dev)
/* Disable any PHY features not supported by the platform */
dev->phy.def->features &= ~dev->phy_feat_exc;
+ dev->phy.features &= ~dev->phy_feat_exc;
/* Setup initial link parameters */
if (dev->phy.features & SUPPORTED_Autoneg) {
@@ -3537,6 +3553,11 @@ static int __devinit emac_probe(struct of_device *ofdev,
INIT_DELAYED_WORK(&dev->link_work, emac_link_timer);
/* Find PHY if any */
+#if defined(CONFIG_APM82181)
+ dev->phy_feat_exc = (SUPPORTED_1000baseT_Half |
+ SUPPORTED_100baseT_Half |
+ SUPPORTED_10baseT_Half);
+#endif
err = emac_init_phy(dev);
if (err != 0)
goto err_detach_tah;
diff --git a/drivers/net/ibm_newemac/phy.c b/drivers/net/ibm_newemac/phy.c
index 635cb96ef64..2db264e1b21 100644
--- a/drivers/net/ibm_newemac/phy.c
+++ b/drivers/net/ibm_newemac/phy.c
@@ -631,6 +631,31 @@ static struct mii_phy_def m88e1141_phy_def = {
.ops = &m88e1141_phy_ops,
};
+static int rtl8211cl_init(struct mii_phy *phy)
+{
+ phy_write(phy, 31,0x0002);
+ phy_write(phy, 24,0xA1E0);
+ phy_write(phy, 31,0x0000);
+
+ return 0;
+}
+
+static struct mii_phy_ops rtl8211cl_phy_ops = {
+ .init = rtl8211cl_init,
+ .setup_aneg = genmii_setup_aneg,
+ .setup_forced = genmii_setup_forced,
+ .poll_link = genmii_poll_link,
+ .read_link = genmii_read_link
+};
+
+static struct mii_phy_def rtl8211cl_phy_def = {
+ .phy_id = 0x001CC910, /* 0x01cc912 */
+ .phy_id_mask = 0xfffffff0,
+ .name = "Realtek 8211CL Ethernet",
+ .ops = &rtl8211cl_phy_ops,
+};
+
+
static struct mii_phy_def *mii_phy_table[] = {
&et1011c_phy_def,
&cis8201_phy_def,
@@ -641,6 +666,7 @@ static struct mii_phy_def *mii_phy_table[] = {
&m88e1111_phy_def,
&m88e1112_phy_def,
&m88e1141_phy_def,
+ &rtl8211cl_phy_def,
&genmii_phy_def,
NULL
};
diff --git a/fs/splice.c b/fs/splice.c
index 4dc75c96334..0d810e86f6c 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -58,6 +58,21 @@ static void put_splice_pipe(struct pipe_inode_info *pipe);
//#define SPLICE_NO_IO 1
+//#define SPLICE_CHECK_SIGNAL_PENDING
+#define SPLICE_READ_ALL
+#define SPLICE_FAST
+
+static inline int ignore_splice_error ( long ret )
+{
+ switch ( ret )
+ {
+ case -EAGAIN :
+ case -ERESTARTSYS :
+ case -EINTR : return 1;
+ default : return 0;
+ }
+}
+
/*
* Attempt to steal a page from a pipe buffer. This should perhaps go into
* a vm helper function, it's already simplified quite a bit by the
@@ -214,10 +229,12 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
for (;;) {
if (!pipe->readers) {
send_sig(SIGPIPE, current, 0);
- if (!ret)
+ if (!ret) {
+ printk(KERN_ERR "%s:%s:%d\n"
+ "returning EPIPE\n", __FUNCTION__, __FILE__, __LINE__);
ret = -EPIPE;
+ }
break;
- printk("%s:%d No readers breaking\n", __FUNCTION__, __LINE__);
}
@@ -251,13 +268,16 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
}
if (spd->flags & SPLICE_F_NONBLOCK) {
- if (!ret)
+ if (!ret) {
+ printk(KERN_ERR "%s:%s:%d\n"
+ "returning EAGAIN\n", __FUNCTION__, __FILE__, __LINE__);
ret = -EAGAIN;
+ }
break;
}
- if (signal_pending(current)) {
+ if (signal_pending(current)) { // exists in distro-kernel
if (!ret)
ret = -ERESTARTSYS;
@@ -882,11 +902,6 @@ ssize_t __splice_from_pipe_special(struct pipe_inode_info *pipe, struct splice_d
remaining = 0;
offset = sd->pos & ~PAGE_CACHE_MASK;
- if (signal_pending(current)) {
- release_splice_pipebufs_special(pipe);
- return -ERESTARTSYS;
- }
-
#if 0
printk("%s:%s:%d len = %d, pipe->nrbufs = %d sd->pos=%lx\n",
__FILE__, __FUNCTION__, __LINE__, len, pipe->nrbufs, sd->pos);
@@ -925,8 +940,11 @@ ssize_t __splice_from_pipe_special(struct pipe_inode_info *pipe, struct splice_d
AOP_FLAG_UNINTERRUPTIBLE, &page, &fsdata);
- if (unlikely(ret))
+ if (unlikely(ret)) {
+ printk(KERN_ERR "%s:%s:%d\n"
+ "returning err %d\n", __FUNCTION__, __FILE__, __LINE__, ret);
goto out;
+ }
char *dst = kmap(page);
while(not_copied) {
@@ -997,8 +1015,11 @@ ssize_t __splice_from_pipe_special(struct pipe_inode_info *pipe, struct splice_d
break;
if (sd->flags & SPLICE_F_NONBLOCK) {
- if (!retval)
+ if (!retval) {
+ printk(KERN_ERR "%s:%s:%d\n"
+ "returning EAGAIN\n", __FUNCTION__, __FILE__, __LINE__);
retval = -EAGAIN;
+ }
break;
}
}
@@ -1044,20 +1065,19 @@ ssize_t __splice_from_pipe_dma(struct pipe_inode_info *pipe, struct splice_desc
return sd->total_len;
#endif
- if (signal_pending(current)) {
- retval = -ERESTARTSYS;
- goto cleanup;
- }
-
sd_p = kzalloc(sizeof(*sd_p), GFP_ATOMIC);
if(!sd_p) {
retval = -ENOMEM;
+ printk(KERN_ERR "%s:%s:%d\n"
+ "returning ENOMEM\n", __FUNCTION__, __FILE__, __LINE__);
goto cleanup;
}
pipe_addr_map = kzalloc(sizeof(*pipe_addr_map) * PIPE_BUFFERS, GFP_ATOMIC);
if(!pipe_addr_map) {
retval = -ENOMEM;
+ printk(KERN_ERR "%s:%s:%d\n"
+ "returning ENOMEM\n", __FUNCTION__, __FILE__, __LINE__);
goto cleanup;
}
@@ -1083,6 +1103,9 @@ ssize_t __splice_from_pipe_dma(struct pipe_inode_info *pipe, struct splice_desc
if (unlikely(ret)) {
retval = ret;
+ printk(KERN_ERR "%s:%s:%d\n"
+ "returning err %d\n",
+ __FUNCTION__, __FILE__, __LINE__, ret);
goto cleanup;
}
@@ -1105,6 +1128,9 @@ ssize_t __splice_from_pipe_dma(struct pipe_inode_info *pipe, struct splice_desc
ret = buf->ops->confirm(pipe, buf);
if (unlikely(ret)) {
retval = ret;
+ printk(KERN_ERR "%s:%s:%d\n"
+ "returning err %d\n",
+ __FUNCTION__, __FILE__, __LINE__, ret);
goto cleanup;
}
#endif
@@ -1173,7 +1199,8 @@ ssize_t __splice_from_pipe_dma(struct pipe_inode_info *pipe, struct splice_desc
mutex_unlock(&splice_dma_lock);
if(ret) {
- printk("%s:%s:%d - splice_dma_memcpy failed with %d\n",
+ printk("%s:%s:%d\n"
+ "splice_dma_memcpy failed with %d\n",
__FILE__, __FUNCTION__, __LINE__, ret);
kunmap(page);
pagecache_write_end(file, mapping, page_pos, 0, 0,
@@ -1205,8 +1232,11 @@ ssize_t __splice_from_pipe_dma(struct pipe_inode_info *pipe, struct splice_desc
if (sd->flags & SPLICE_F_NONBLOCK) {
- if (!retval)
+ if (!retval) {
+ printk(KERN_ERR "%s:%s:%d\n"
+ "returning EAGAIN\n", __FUNCTION__, __FILE__, __LINE__);
retval = -EAGAIN;
+ }
break;
}
}
@@ -1644,11 +1674,6 @@ ssize_t splice_from_pipe_special(struct pipe_inode_info *pipe, struct file *out,
.u.file = out,
};
- if (signal_pending(current)) {
- release_splice_pipebufs_special(pipe);
- return -ERESTARTSYS;
- }
-
/*
* The actor worker might be calling ->prepare_write and
* ->commit_write. Most of the time, these expect i_mutex to
@@ -1687,7 +1712,7 @@ int splice_from_pipe_next(struct pipe_inode_info *pipe, struct splice_desc *sd)
if (sd->flags & SPLICE_F_NONBLOCK)
return -EAGAIN;
- if (signal_pending(current))
+ if (signal_pending(current)) // exists in distro-kernel
return -ERESTARTSYS;
if (sd->need_wakeup) {
@@ -1820,14 +1845,15 @@ generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out,
ssize_t ret;
int err = 0;
- if (signal_pending(current)) {
- release_splice_pipebufs_special(pipe);
- return -ERESTARTSYS;
- }
-
err = file_remove_suid(out);
- if(err)
+ if(err) {
+ release_splice_pipebufs_special(pipe);
+ printk(KERN_ERR "%s:%s:%d\n"
+ "returning err %d.\n",
+ __FUNCTION__, __FILE__, __LINE__,
+ err);
return err;
+ }
file_update_time(out);
mutex_lock(&inode->i_mutex);
@@ -1920,11 +1946,6 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
if (unlikely(out->f_flags & O_APPEND))
return -EINVAL;
- if (signal_pending(current)) {
- release_splice_pipebufs_special(pipe);
- return -ERESTARTSYS;
- }
-
ret = rw_verify_area(WRITE, out, ppos, len);
if (unlikely(ret < 0))
return ret;
@@ -2451,9 +2472,14 @@ static long do_splice_2(int fd_in, struct file *in, loff_t __user *off_in,
struct pipe_inode_info *pipe;
loff_t offset, *off;
long ret;
+ size_t spliced_len;
- if (signal_pending(current))
- return -ERESTARTSYS;
+ if (signal_pending(current)) {
+ printk(KERN_ERR "%s:%s:%d\n"
+ "signal pending returning EINTR.\n",
+ __FUNCTION__, __FILE__, __LINE__);
+ return -EINTR;
+ }
#ifdef DEBUG_SPLICE
printk("%s:%s:%d - len=%d\n", __FILE__, __FUNCTION__, __LINE__, len);
@@ -2462,8 +2488,9 @@ static long do_splice_2(int fd_in, struct file *in, loff_t __user *off_in,
#ifndef SPLICE_DEFER_DMA
pipe = alloc_pipe_info(NULL);
if (!pipe) {
- printk("%s %s:%d alloc_pipe_info failed\n",
- __FUNCTION__, __FILE__, __LINE__);
+ printk( KERN_ERR "%s %s:%d\n"
+ "alloc_pipe_info failed.\n",
+ __FUNCTION__, __FILE__, __LINE__);
return -ENOMEM;
}
@@ -2477,28 +2504,35 @@ static long do_splice_2(int fd_in, struct file *in, loff_t __user *off_in,
#else
pipe = get_splice_pipe();
- if(!pipe)
+ if(!pipe) {
+ printk(KERN_ERR "%s:%s:%d\n"
+ "returning ENOMEM.\n",
+ __FUNCTION__, __FILE__, __LINE__);
return -ENOMEM;
+ }
pipe->readers = 1;
#endif
if (off_in) {
- printk(KERN_ERR "%s:%s:%d off_in is seekable\n",
+ printk(KERN_ERR "%s:%s:%d\n"
+ "off_in is seekable.\n",
__FUNCTION__, __FILE__, __LINE__);
ret = -ESPIPE;
goto out;
}
if (off_out) {
if (out->f_op->llseek == no_llseek) {
- printk(KERN_ERR "%s:%s:%d out is non-seekable\n",
+ printk(KERN_ERR "%s:%s:%d\n"
+ "out is non-seekable.\n",
__FUNCTION__, __FILE__, __LINE__);
ret = -EINVAL;
goto out;
}
if (copy_from_user(&offset, off_out, sizeof(loff_t))) {
- printk(KERN_ERR "%s:%s:%d copy_from_user failed\n",
- __FUNCTION__, __FILE__, __LINE__);
+ printk(KERN_ERR "%s:%s:%d\n"
+ "copy_from_user failed.\n",
+ __FUNCTION__, __FILE__, __LINE__);
ret = -EFAULT;
goto out;
}
@@ -2511,6 +2545,8 @@ static long do_splice_2(int fd_in, struct file *in, loff_t __user *off_in,
printk("%s:%s:%d - calling in->f_op.splice_read len=%d\n",
__FILE__, __FUNCTION__, __LINE__, len);
#endif
+
+#ifndef SPLICE_READ_ALL
ret = in->f_op->splice_read(in, off_in, pipe, len, flags);
#ifdef DEBUG_SPLICE
@@ -2518,7 +2554,8 @@ static long do_splice_2(int fd_in, struct file *in, loff_t __user *off_in,
#endif
if(!ret) {
- printk(KERN_ERR "%s:%s:%d sock_splice_read read nothing\n",
+ printk(KERN_ERR "%s:%s:%d\n"
+ "sock_splice_read read nothing.\n",
__FILE__, __FUNCTION__, __LINE__);
ret = -EAGAIN;
goto out;
@@ -2526,22 +2563,119 @@ static long do_splice_2(int fd_in, struct file *in, loff_t __user *off_in,
#ifdef DEBUG_SPLICE
-
printk("%s:%s:%d - Number of pipe bufs = %d\n",
__FILE__, __FUNCTION__, __LINE__, pipe->nrbufs);
#endif
- len = ret;
- ret = do_splice_from(pipe, out, off, len, flags);
+ if ( ret != len )
+ {
+ printk( KERN_ERR "%s:%s:%d\n"
+ "splice read %ld instead of %d, offset is %d.\n",
+ __FILE__, __FUNCTION__, __LINE__,
+ ret, len, (off == NULL) ? 0 : *off );
+ }
+
+ /** save the returned data length */
+ spliced_len = ret;
+
+#else // SPLICE_READ_ALL
+ {
+ size_t data_len;
+ int attempt;
+
+ /** init */
+ data_len = len ;
+ spliced_len = 0 ;
+ attempt = 0 ;
+
+ /** read data until expected length is received */
+ while ( data_len )
+ {
+ attempt++;
+
+ /** read data (calls tcp_splice_read() in tcp.c) */
+ ret = in->f_op->splice_read( in, off_in, pipe, data_len, flags );
+
+ /** handle error status */
+ if( ret <= 0 )
+ {
+ printk( KERN_ERR "%s:%s:%d\n"
+ "sock_splice_read read error %ld.\n",
+ __FILE__, __FUNCTION__, __LINE__,
+ ret );
+
+ /** fail on specific errors */
+ if ( ret == 0 || ! ignore_splice_error ( ret ) )
+ {
+ printk( KERN_ERR "%s:%s:%d\n"
+ "returning read error %ld "
+ "after reading %d out of %d bytes.\n",
+ __FILE__, __FUNCTION__, __LINE__,
+ ret, spliced_len, len );
+
+ release_splice_pipebufs_special(pipe);
+ goto out;
+ }
+ }
+
+ /** compute the balance data to be read in next iteration */
+ if ( ret > 0 )
+ {
+ data_len -= ret;
+ spliced_len += ret;
+ }
+
+ /** warn if attempting more than 1 splice read */
+ if ( data_len != 0 )
+ {
+ printk( KERN_ERR "%s:%s:%d\n"
+ "Warning: Could not read all the data on "
+ "attempt# %d. Read: %ld, Total Read: %d"
+ " ... trying again.\n",
+ __FILE__, __FUNCTION__, __LINE__,
+ attempt, ret, spliced_len );
+ }
+ }
+
+ /** warn if more data than expected is read */
+ // NB: Should not happen
+ if ( spliced_len != len )
+ {
+ printk( KERN_ERR "%s:%s:%d\n"
+ "Should Not Happen. "
+ "splice read %ld instead of %d, offset is %lld.\n",
+ __FILE__, __FUNCTION__, __LINE__,
+ ret, len, (off == NULL) ? 0 : *off );
+ }
+
+ }
+#endif // SPLICE_READ_ALL
+
+ ret = do_splice_from(pipe, out, off, spliced_len, flags);
#ifdef DEBUG_SPLICE
printk("%s:%s:%d do_splice_from returns %d\n", __FILE__, __FUNCTION__, __LINE__,
ret);
#endif
+ /** handle errors */
+ if ( ret < 0 )
+ {
+ release_splice_pipebufs_special(pipe);
+ goto out;
+ }
+
+ if ( ret != spliced_len )
+ {
+ printk( KERN_ERR "%s:%s:%d\n"
+ "splice wrote %ld instead of %d\n",
+ __FILE__, __FUNCTION__, __LINE__,
+ ret, spliced_len );
+ }
+
if (off_out && copy_to_user(off_out, off, sizeof(loff_t))) {
printk(KERN_ERR "%s:%s:%d copy_to_user failed\n",
- __FILE__, __FUNCTION__, __LINE__);
+ __FILE__, __FUNCTION__, __LINE__);
ret = -EFAULT;
}
@@ -2551,6 +2685,15 @@ static long do_splice_2(int fd_in, struct file *in, loff_t __user *off_in,
out:
kfree(pipe);
+
+ if ( ret < 0 )
+ {
+ printk( KERN_ERR "%s:%s:%d\n"
+ "returning ret=%ld\n",
+ __FILE__, __FUNCTION__, __LINE__,
+ ret );
+ }
+
return ret;
}
/*
@@ -2888,8 +3031,12 @@ SYSCALL_DEFINE6(splice, int, fd_in, loff_t __user *, off_in,
if (unlikely(!len))
return 0;
- if (signal_pending(current))
- return -ERESTARTSYS;
+ if (signal_pending(current)) {
+ printk(KERN_ERR "%s:%s:%d\n"
+ "signal pending returning EINTR.\n",
+ __FUNCTION__, __FILE__, __LINE__);
+ return -EINTR;
+ }
in = fget_light(fd_in, &fput_in);
if (in) {
@@ -2897,7 +3044,7 @@ SYSCALL_DEFINE6(splice, int, fd_in, loff_t __user *, off_in,
out = fget_light(fd_out, &fput_out);
if (out) {
if (out->f_mode & FMODE_WRITE)
-#if 0
+#ifndef SPLICE_FAST
error = do_splice(in, off_in,
out, off_out,
len, flags);
@@ -2937,7 +3084,7 @@ static int ipipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
pipe_lock(pipe);
while (!pipe->nrbufs) {
- if (signal_pending(current)) {
+ if (signal_pending(current)) { // exists in distro-kernel
ret = -ERESTARTSYS;
break;
}
@@ -2984,7 +3131,7 @@ static int opipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
ret = -EAGAIN;
break;
}
- if (signal_pending(current)) {
+ if (signal_pending(current)) { // exists in distro-kernel
ret = -ERESTARTSYS;
break;
}
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 709b7ad3607..bb027c19fc5 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -32,18 +32,22 @@ struct led_classdev {
int brightness;
int max_brightness;
int flags;
- int color;
- int blink;
+#ifdef CONFIG_APOLLO3G
+ int color;
+ int blink;
+#endif
/* Lower 16 bits reflect status */
#define LED_SUSPENDED (1 << 0)
/* Upper 16 bits reflect control information */
#define LED_CORE_SUSPENDRESUME (1 << 16)
+#ifdef CONFIG_APOLLO3G
void (*color_set)(struct led_classdev *led_cdev,
enum led_brightness color);
/* Get LED brightness level */
enum led_brightness (*color_get)(struct led_classdev *led_cdev);
+#endif
/* Set LED brightness level */
/* Must not sleep, use a workqueue if needed */
@@ -60,8 +64,10 @@ struct led_classdev {
unsigned long *delay_on,
unsigned long *delay_off);
+#ifdef CONFIG_APOLLO3G
int (*blink_set_3g)(struct led_classdev *led_cdev, int value );
int (*blink_get_3g)(struct led_classdev *led_cdev);
+#endif
struct device *dev;
struct list_head node; /* LED Device list */
diff --git a/net/core/sock.c b/net/core/sock.c
index 6605e756bcd..22d6cc1a320 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -130,6 +130,12 @@
#include <net/tcp.h>
#endif
+//#define DEBUG_CHECK_SIGNAL_PENDING
+
+#ifdef DEBUG_CHECK_SIGNAL_PENDING
+ #include <linux/signal.h>
+#endif
+
/*
* Each address family might have different locking rules, so we have
* one slock key per address family:
@@ -1537,6 +1543,36 @@ int sk_wait_data(struct sock *sk, long *timeo)
prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
set_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
rc = sk_wait_event(sk, timeo, !skb_queue_empty(&sk->sk_receive_queue));
+
+#ifdef DEBUG_CHECK_SIGNAL_PENDING
+ if ( signal_pending ( current ) )
+ {
+ printk( "%s:%s:%d\n", __FILE__, __FUNCTION__, __LINE__ );
+
+ if ( _NSIG_WORDS == 1 )
+ {
+ printk( "Signal set0 is 0x%08lx\n",
+ current->signal->shared_pending.signal.sig[0] );
+ }
+ else
+ {
+ printk( "Signal set0 is 0x%08lx\n",
+ current->signal->shared_pending.signal.sig[0] );
+ printk( "Signal set1 is 0x%08lx\n",
+ current->signal->shared_pending.signal.sig[1] );
+
+// printk("Signal set0 is 0x%08lx, flags 0x%08lx\n",
+// current->signal->shared_pending.signal.sig[0],
+// ((struct thread_info *)current->stack)->flags );
+//
+// printk("Signal %d is %s\n", SIGRTMIN+3,
+// sigismember(&current->signal->shared_pending.signal,
+// SIGRTMIN+3) ? "present" : "not present" );
+
+ }
+ }
+#endif // DEBUG_CHECK_SIGNAL_PENDING
+
clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
finish_wait(sk->sk_sleep, &wait);
return rc;
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 8b8b2766253..72fa141d17d 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -610,8 +610,12 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,
/*
* We can't seek on a socket input
*/
- if (unlikely(ppos))
+ if (unlikely(ppos)) {
+ printk(KERN_ERR "%s:%s:%d\n"
+ "returning ESPIPE\n",
+ __FUNCTION__, __FILE__, __LINE__);
return -ESPIPE;
+ }
ret = spliced = 0;
@@ -620,39 +624,81 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,
timeo = sock_rcvtimeo(sk, sock->file->f_flags & O_NONBLOCK);
while (tss.len) {
ret = __tcp_splice_read(sk, &tss);
- if (ret < 0)
+ if (ret < 0) {
+ printk(KERN_ERR "%s:%s:%d\n"
+ "breaking err %d\n",
+ __FUNCTION__, __FILE__, __LINE__, ret);
break;
+ }
else if (!ret) {
if (spliced >= len)
break;
if (flags & SPLICE_F_NONBLOCK) {
ret = -EAGAIN;
+ printk(KERN_ERR "%s:%s:%d\n"
+ "breaking -EAGAIN\n",
+ __FUNCTION__, __FILE__, __LINE__);
break;
}
if (sock_flag(sk, SOCK_DONE))
+ {
+ printk(KERN_ERR "%s:%s:%d\n"
+ "breaking %d\n",
+ __FUNCTION__, __FILE__, __LINE__,
+ ret);
break;
+ }
if (sk->sk_err) {
ret = sock_error(sk);
+ printk(KERN_ERR "%s:%s:%d\n"
+ "breaking err %d\n",
+ __FUNCTION__, __FILE__, __LINE__,
+ ret);
break;
}
if (sk->sk_shutdown & RCV_SHUTDOWN)
+ {
+ printk(KERN_ERR "%s:%s:%d\n"
+ "breaking %d\n",
+ __FUNCTION__, __FILE__, __LINE__,
+ ret);
break;
+ }
if (sk->sk_state == TCP_CLOSE) {
+ printk(KERN_ERR "%s:%s:%d\n"
+ "breaking %d\n",
+ __FUNCTION__, __FILE__, __LINE__,
+ ret);
/*
* This occurs when user tries to read
* from never connected socket.
*/
- if (!sock_flag(sk, SOCK_DONE))
+ if (!sock_flag(sk, SOCK_DONE)) {
+ printk(KERN_ERR "%s:%s:%d\n"
+ "breaking ENOTCONN\n",
+ __FUNCTION__, __FILE__, __LINE__);
ret = -ENOTCONN;
+ }
break;
}
if (!timeo) {
ret = -EAGAIN;
+ printk(KERN_ERR "%s:%s:%d\n"
+ "breaking EAGAIN\n",
+ __FUNCTION__, __FILE__, __LINE__);
break;
}
sk_wait_data(sk, &timeo);
- if (signal_pending(current)) {
+ if (signal_pending(current)) { // exists in distro-kernel
ret = sock_intr_errno(timeo);
+ if ( spliced == 0 )
+ {
+ printk( KERN_ERR "%s:%s:%d\n"
+ "signal pending recd during "
+ "tcp splice read .. returning %d.\n",
+ __FILE__, __FUNCTION__, __LINE__,
+ ret );
+ }
break;
}
continue;
@@ -661,14 +707,38 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,
spliced += ret;
if (!timeo)
+ {
+ printk(KERN_ERR "%s:%s:%d\n"
+ "breaking %d\n",
+ __FUNCTION__, __FILE__, __LINE__,
+ ret);
break;
+ }
release_sock(sk);
lock_sock(sk);
if (sk->sk_err || sk->sk_state == TCP_CLOSE ||
- (sk->sk_shutdown & RCV_SHUTDOWN) ||
- signal_pending(current))
+ (sk->sk_shutdown & RCV_SHUTDOWN))
+ {
+ printk(KERN_ERR "%s:%s:%d\n"
+ "breaking %d\n",
+ __FUNCTION__, __FILE__, __LINE__,
+ ret);
+ break;
+ }
+
+ if (signal_pending(current))
+ {
+ if ( spliced == 0 )
+ {
+ printk( KERN_ERR "%s:%s:%d\n"
+ "signal pending recd at end of while during "
+ "tcp splice read .. returning %d.\n",
+ __FILE__, __FUNCTION__, __LINE__,
+ ret );
+ }
break;
+ }
}
release_sock(sk);
@@ -1338,7 +1408,7 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
sk_eat_skb(sk, skb, 0);
if (!desc->count)
break;
- tp->copied_seq = seq;
+ tp->copied_seq = seq;
}
tp->copied_seq = seq;