aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-03-08 13:52:43 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-03-08 13:52:43 -0500
commit85ec688c161a497c3becb6a056cd856552240227 (patch)
treee9108c12c73544583f9af64ca6b83d5ac2765b97 /drivers/firewire
parent7bffc48177ed461ab29cbae1102552a09601ef97 (diff)
parent0ca49345b6f489e95f8d6edeb0b092e257475b2a (diff)
Merge tag 'firewire-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394
Pull firewire fixes from Stefan Richter: "Fix a use-after-free regression since v3.4 and an initialization regression since v3.10" * tag 'firewire-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394: firewire: ohci: fix probe failure with Agere/LSI controllers firewire: net: fix use after free
Diffstat (limited to 'drivers/firewire')
-rw-r--r--drivers/firewire/net.c6
-rw-r--r--drivers/firewire/ohci.c15
2 files changed, 5 insertions, 16 deletions
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
index 6b895986dc22..4af0a7bad7f2 100644
--- a/drivers/firewire/net.c
+++ b/drivers/firewire/net.c
@@ -929,8 +929,6 @@ static void fwnet_write_complete(struct fw_card *card, int rcode,
929 if (rcode == RCODE_COMPLETE) { 929 if (rcode == RCODE_COMPLETE) {
930 fwnet_transmit_packet_done(ptask); 930 fwnet_transmit_packet_done(ptask);
931 } else { 931 } else {
932 fwnet_transmit_packet_failed(ptask);
933
934 if (printk_timed_ratelimit(&j, 1000) || rcode != last_rcode) { 932 if (printk_timed_ratelimit(&j, 1000) || rcode != last_rcode) {
935 dev_err(&ptask->dev->netdev->dev, 933 dev_err(&ptask->dev->netdev->dev,
936 "fwnet_write_complete failed: %x (skipped %d)\n", 934 "fwnet_write_complete failed: %x (skipped %d)\n",
@@ -938,8 +936,10 @@ static void fwnet_write_complete(struct fw_card *card, int rcode,
938 936
939 errors_skipped = 0; 937 errors_skipped = 0;
940 last_rcode = rcode; 938 last_rcode = rcode;
941 } else 939 } else {
942 errors_skipped++; 940 errors_skipped++;
941 }
942 fwnet_transmit_packet_failed(ptask);
943 } 943 }
944} 944}
945 945
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index 6f74d8d3f700..8db663219560 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -290,7 +290,6 @@ static char ohci_driver_name[] = KBUILD_MODNAME;
290#define QUIRK_NO_MSI 0x10 290#define QUIRK_NO_MSI 0x10
291#define QUIRK_TI_SLLZ059 0x20 291#define QUIRK_TI_SLLZ059 0x20
292#define QUIRK_IR_WAKE 0x40 292#define QUIRK_IR_WAKE 0x40
293#define QUIRK_PHY_LCTRL_TIMEOUT 0x80
294 293
295/* In case of multiple matches in ohci_quirks[], only the first one is used. */ 294/* In case of multiple matches in ohci_quirks[], only the first one is used. */
296static const struct { 295static const struct {
@@ -303,10 +302,7 @@ static const struct {
303 QUIRK_BE_HEADERS}, 302 QUIRK_BE_HEADERS},
304 303
305 {PCI_VENDOR_ID_ATT, PCI_DEVICE_ID_AGERE_FW643, 6, 304 {PCI_VENDOR_ID_ATT, PCI_DEVICE_ID_AGERE_FW643, 6,
306 QUIRK_PHY_LCTRL_TIMEOUT | QUIRK_NO_MSI}, 305 QUIRK_NO_MSI},
307
308 {PCI_VENDOR_ID_ATT, PCI_ANY_ID, PCI_ANY_ID,
309 QUIRK_PHY_LCTRL_TIMEOUT},
310 306
311 {PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_SB1394, PCI_ANY_ID, 307 {PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_SB1394, PCI_ANY_ID,
312 QUIRK_RESET_PACKET}, 308 QUIRK_RESET_PACKET},
@@ -353,7 +349,6 @@ MODULE_PARM_DESC(quirks, "Chip quirks (default = 0"
353 ", disable MSI = " __stringify(QUIRK_NO_MSI) 349 ", disable MSI = " __stringify(QUIRK_NO_MSI)
354 ", TI SLLZ059 erratum = " __stringify(QUIRK_TI_SLLZ059) 350 ", TI SLLZ059 erratum = " __stringify(QUIRK_TI_SLLZ059)
355 ", IR wake unreliable = " __stringify(QUIRK_IR_WAKE) 351 ", IR wake unreliable = " __stringify(QUIRK_IR_WAKE)
356 ", phy LCtrl timeout = " __stringify(QUIRK_PHY_LCTRL_TIMEOUT)
357 ")"); 352 ")");
358 353
359#define OHCI_PARAM_DEBUG_AT_AR 1 354#define OHCI_PARAM_DEBUG_AT_AR 1
@@ -2299,9 +2294,6 @@ static int ohci_enable(struct fw_card *card,
2299 * TI TSB82AA2 + TSB81BA3(A) cards signal LPS enabled early but 2294 * TI TSB82AA2 + TSB81BA3(A) cards signal LPS enabled early but
2300 * cannot actually use the phy at that time. These need tens of 2295 * cannot actually use the phy at that time. These need tens of
2301 * millisecods pause between LPS write and first phy access too. 2296 * millisecods pause between LPS write and first phy access too.
2302 *
2303 * But do not wait for 50msec on Agere/LSI cards. Their phy
2304 * arbitration state machine may time out during such a long wait.
2305 */ 2297 */
2306 2298
2307 reg_write(ohci, OHCI1394_HCControlSet, 2299 reg_write(ohci, OHCI1394_HCControlSet,
@@ -2309,11 +2301,8 @@ static int ohci_enable(struct fw_card *card,
2309 OHCI1394_HCControl_postedWriteEnable); 2301 OHCI1394_HCControl_postedWriteEnable);
2310 flush_writes(ohci); 2302 flush_writes(ohci);
2311 2303
2312 if (!(ohci->quirks & QUIRK_PHY_LCTRL_TIMEOUT)) 2304 for (lps = 0, i = 0; !lps && i < 3; i++) {
2313 msleep(50); 2305 msleep(50);
2314
2315 for (lps = 0, i = 0; !lps && i < 150; i++) {
2316 msleep(1);
2317 lps = reg_read(ohci, OHCI1394_HCControlSet) & 2306 lps = reg_read(ohci, OHCI1394_HCControlSet) &
2318 OHCI1394_HCControl_LPS; 2307 OHCI1394_HCControl_LPS;
2319 } 2308 }