diff options
author | Ryan Underwood <nemesis@icequake.net> | 2015-01-25 19:07:09 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-07-21 13:10:01 -0400 |
commit | 37100f76f93236e99a89c0f0c5531eff03920725 (patch) | |
tree | c880e7bdcde380b9d0e25f1fe7152e149ad36a82 | |
parent | 77d10175396e764488886923eeaec58c3ff1fb7b (diff) |
Disable write buffering on Toshiba ToPIC95
commit 2fb22a8042fe96b4220843f79241c116d90922c4 upstream.
Disable write buffering on the Toshiba ToPIC95 if it is enabled by
somebody (it is not supposed to be a power-on default according to
the datasheet). On the ToPIC95, practically no 32-bit Cardbus card
will work under heavy load without locking up the whole system if
this is left enabled. I tried about a dozen. It does not affect
16-bit cards. This is similar to the O2 bugs in early controller
revisions it seems.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=55961
Signed-off-by: Ryan C. Underwood <nemesis@icequake.net>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/pcmcia/topic.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/pcmcia/topic.h b/drivers/pcmcia/topic.h index 615a45a8fe86..582688fe7505 100644 --- a/drivers/pcmcia/topic.h +++ b/drivers/pcmcia/topic.h | |||
@@ -104,6 +104,9 @@ | |||
104 | #define TOPIC_EXCA_IF_CONTROL 0x3e /* 8 bit */ | 104 | #define TOPIC_EXCA_IF_CONTROL 0x3e /* 8 bit */ |
105 | #define TOPIC_EXCA_IFC_33V_ENA 0x01 | 105 | #define TOPIC_EXCA_IFC_33V_ENA 0x01 |
106 | 106 | ||
107 | #define TOPIC_PCI_CFG_PPBCN 0x3e /* 16-bit */ | ||
108 | #define TOPIC_PCI_CFG_PPBCN_WBEN 0x0400 | ||
109 | |||
107 | static void topic97_zoom_video(struct pcmcia_socket *sock, int onoff) | 110 | static void topic97_zoom_video(struct pcmcia_socket *sock, int onoff) |
108 | { | 111 | { |
109 | struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket); | 112 | struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket); |
@@ -138,6 +141,7 @@ static int topic97_override(struct yenta_socket *socket) | |||
138 | static int topic95_override(struct yenta_socket *socket) | 141 | static int topic95_override(struct yenta_socket *socket) |
139 | { | 142 | { |
140 | u8 fctrl; | 143 | u8 fctrl; |
144 | u16 ppbcn; | ||
141 | 145 | ||
142 | /* enable 3.3V support for 16bit cards */ | 146 | /* enable 3.3V support for 16bit cards */ |
143 | fctrl = exca_readb(socket, TOPIC_EXCA_IF_CONTROL); | 147 | fctrl = exca_readb(socket, TOPIC_EXCA_IF_CONTROL); |
@@ -146,6 +150,18 @@ static int topic95_override(struct yenta_socket *socket) | |||
146 | /* tell yenta to use exca registers to power 16bit cards */ | 150 | /* tell yenta to use exca registers to power 16bit cards */ |
147 | socket->flags |= YENTA_16BIT_POWER_EXCA | YENTA_16BIT_POWER_DF; | 151 | socket->flags |= YENTA_16BIT_POWER_EXCA | YENTA_16BIT_POWER_DF; |
148 | 152 | ||
153 | /* Disable write buffers to prevent lockups under load with numerous | ||
154 | Cardbus cards, observed on Tecra 500CDT and reported elsewhere on the | ||
155 | net. This is not a power-on default according to the datasheet | ||
156 | but some BIOSes seem to set it. */ | ||
157 | if (pci_read_config_word(socket->dev, TOPIC_PCI_CFG_PPBCN, &ppbcn) == 0 | ||
158 | && socket->dev->revision <= 7 | ||
159 | && (ppbcn & TOPIC_PCI_CFG_PPBCN_WBEN)) { | ||
160 | ppbcn &= ~TOPIC_PCI_CFG_PPBCN_WBEN; | ||
161 | pci_write_config_word(socket->dev, TOPIC_PCI_CFG_PPBCN, ppbcn); | ||
162 | dev_info(&socket->dev->dev, "Disabled ToPIC95 Cardbus write buffers.\n"); | ||
163 | } | ||
164 | |||
149 | return 0; | 165 | return 0; |
150 | } | 166 | } |
151 | 167 | ||