From: Chris Wright Date: Sat, 16 Dec 2006 05:40:49 +0000 (-0800) Subject: added IB/srp patch from Roland X-Git-Tag: v2.6.18.6~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=62cfa25b7dfc044adcec18d1ffe1d7f9c140b679;p=thirdparty%2Fkernel%2Fstable-queue.git added IB/srp patch from Roland --- diff --git a/queue-2.6.19/ib-srp-fix-fmr-mapping-for-32-bit-kernels-and-addresses-above-4g.patch b/queue-2.6.19/ib-srp-fix-fmr-mapping-for-32-bit-kernels-and-addresses-above-4g.patch new file mode 100644 index 00000000000..555e8e21752 --- /dev/null +++ b/queue-2.6.19/ib-srp-fix-fmr-mapping-for-32-bit-kernels-and-addresses-above-4g.patch @@ -0,0 +1,51 @@ +From stable-bounces@linux.kernel.org Fri Dec 15 21:04:20 2006 +To: stable@kernel.org +From: Roland Dreier +Date: Fri, 15 Dec 2006 20:58:14 -0800 +Message-ID: +Subject: IB/srp: Fix FMR mapping for 32-bit kernels and addresses above 4G + +struct srp_device.fmr_page_mask was unsigned long, which means that +the top part of addresses above 4G was being chopped off on 32-bit +architectures. Of course nothing good happens when data from SRP +targets is DMAed to the wrong place. + +Fix this by changing fmr_page_mask to u64, to match the addresses +actually used by IB devices. + +Thanks to Brian Cain and David McMillen + for help diagnosing the bug and testing +the fix. + +Signed-off-by: Roland Dreier +Signed-off-by: Chris Wright +--- +I just asked Linus to pull this. It fixes nasty corruption/crash +problems on 32-bit systems with > 4G of memory. + + drivers/infiniband/ulp/srp/ib_srp.c | 2 +- + drivers/infiniband/ulp/srp/ib_srp.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- linux-2.6.19.1.orig/drivers/infiniband/ulp/srp/ib_srp.c ++++ linux-2.6.19.1/drivers/infiniband/ulp/srp/ib_srp.c +@@ -1879,7 +1879,7 @@ static void srp_add_one(struct ib_device + */ + srp_dev->fmr_page_shift = max(9, ffs(dev_attr->page_size_cap) - 1); + srp_dev->fmr_page_size = 1 << srp_dev->fmr_page_shift; +- srp_dev->fmr_page_mask = ~((unsigned long) srp_dev->fmr_page_size - 1); ++ srp_dev->fmr_page_mask = ~((u64) srp_dev->fmr_page_size - 1); + + INIT_LIST_HEAD(&srp_dev->dev_list); + +--- linux-2.6.19.1.orig/drivers/infiniband/ulp/srp/ib_srp.h ++++ linux-2.6.19.1/drivers/infiniband/ulp/srp/ib_srp.h +@@ -87,7 +87,7 @@ struct srp_device { + struct ib_fmr_pool *fmr_pool; + int fmr_page_shift; + int fmr_page_size; +- unsigned long fmr_page_mask; ++ u64 fmr_page_mask; + }; + + struct srp_host { diff --git a/queue-2.6.19/series b/queue-2.6.19/series index 0416155c445..acdb62288c4 100644 --- a/queue-2.6.19/series +++ b/queue-2.6.19/series @@ -12,3 +12,4 @@ ieee1394-ohci1394-add-ppc_pmac-platform-code-to-driver-probe.patch kbuild-don-t-put-temp-files-in-source.patch arm-add-sys_-at-syscalls.patch sched-remove-__cpuinitdata-anotation-to-cpu_isolated_map.patch +ib-srp-fix-fmr-mapping-for-32-bit-kernels-and-addresses-above-4g.patch