]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.14.7/firewire-revert-to-4-gb-rdma-fix-protocols-using-memory-space.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.14.7 / firewire-revert-to-4-gb-rdma-fix-protocols-using-memory-space.patch
1 From 2fe2023adf695d08af5b598b2be3b288a95d563c Mon Sep 17 00:00:00 2001
2 From: Stefan Richter <stefanr@s5r6.in-berlin.de>
3 Date: Thu, 29 May 2014 15:23:26 +0200
4 Subject: firewire: revert to 4 GB RDMA, fix protocols using Memory Space
5
6 From: Stefan Richter <stefanr@s5r6.in-berlin.de>
7
8 commit 2fe2023adf695d08af5b598b2be3b288a95d563c upstream.
9
10 Undo a feature introduced in v3.14 by commit fcd46b34425d
11 "firewire: Enable remote DMA above 4 GB". That change raised the
12 minimum address at which protocol drivers and user programs can register
13 for request reception from 0x0001'0000'0000 to 0x8000'0000'0000.
14 It turned out that at least one vendor-specific protocol exists which
15 uses lower addresses: https://bugzilla.kernel.org/show_bug.cgi?id=76921
16
17 For the time being, revert most of commit fcd46b34425d so that affected
18 protocols work like with kernel v3.13 and before. Just keep the valid
19 documentation parts from the regressing commit, and the ability to
20 identify controllers which could be programmed to accept >32 bit
21 physical DMA addresses. The rest of fcd46b34425d should probably be
22 brought back as an optional instead of default feature.
23
24 Reported-by: Fabien Spindler <fabien.spindler@inria.fr>
25 Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
26 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27
28 ---
29 Documentation/debugging-via-ohci1394.txt | 13 ++++++++-----
30 drivers/firewire/core.h | 4 ++--
31 drivers/firewire/ohci.c | 2 +-
32 3 files changed, 11 insertions(+), 8 deletions(-)
33
34 --- a/Documentation/debugging-via-ohci1394.txt
35 +++ b/Documentation/debugging-via-ohci1394.txt
36 @@ -25,9 +25,11 @@ using data transfer rates in the order o
37 With most FireWire controllers, memory access is limited to the low 4 GB
38 of physical address space. This can be a problem on IA64 machines where
39 memory is located mostly above that limit, but it is rarely a problem on
40 -more common hardware such as x86, x86-64 and PowerPC. However, at least
41 -Agere/LSI FW643e and FW643e2 controllers are known to support access to
42 -physical addresses above 4 GB.
43 +more common hardware such as x86, x86-64 and PowerPC.
44 +
45 +At least LSI FW643e and FW643e2 controllers are known to support access to
46 +physical addresses above 4 GB, but this feature is currently not enabled by
47 +Linux.
48
49 Together with a early initialization of the OHCI-1394 controller for debugging,
50 this facility proved most useful for examining long debugs logs in the printk
51 @@ -101,8 +103,9 @@ Step-by-step instructions for using fire
52 compliant, they are based on TI PCILynx chips and require drivers for Win-
53 dows operating systems.
54
55 - The mentioned kernel log message contains ">4 GB phys DMA" in case of
56 - OHCI-1394 controllers which support accesses above this limit.
57 + The mentioned kernel log message contains the string "physUB" if the
58 + controller implements a writable Physical Upper Bound register. This is
59 + required for physical DMA above 4 GB (but not utilized by Linux yet).
60
61 2) Establish a working FireWire cable connection:
62
63 --- a/drivers/firewire/core.h
64 +++ b/drivers/firewire/core.h
65 @@ -237,8 +237,8 @@ static inline bool is_next_generation(in
66
67 #define LOCAL_BUS 0xffc0
68
69 -/* arbitrarily chosen maximum range for physical DMA: 128 TB */
70 -#define FW_MAX_PHYSICAL_RANGE (128ULL << 40)
71 +/* OHCI-1394's default upper bound for physical DMA: 4 GB */
72 +#define FW_MAX_PHYSICAL_RANGE (1ULL << 32)
73
74 void fw_core_handle_request(struct fw_card *card, struct fw_packet *request);
75 void fw_core_handle_response(struct fw_card *card, struct fw_packet *packet);
76 --- a/drivers/firewire/ohci.c
77 +++ b/drivers/firewire/ohci.c
78 @@ -3716,7 +3716,7 @@ static int pci_probe(struct pci_dev *dev
79 version >> 16, version & 0xff, ohci->card.index,
80 ohci->n_ir, ohci->n_it, ohci->quirks,
81 reg_read(ohci, OHCI1394_PhyUpperBound) ?
82 - ", >4 GB phys DMA" : "");
83 + ", physUB" : "");
84
85 return 0;
86