Skip to content

Commit 85ec688

Browse files
committed
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
2 parents 7bffc48 + 0ca4934 commit 85ec688

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

drivers/firewire/net.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -929,17 +929,17 @@ static void fwnet_write_complete(struct fw_card *card, int rcode,
929929
if (rcode == RCODE_COMPLETE) {
930930
fwnet_transmit_packet_done(ptask);
931931
} else {
932-
fwnet_transmit_packet_failed(ptask);
933-
934932
if (printk_timed_ratelimit(&j, 1000) || rcode != last_rcode) {
935933
dev_err(&ptask->dev->netdev->dev,
936934
"fwnet_write_complete failed: %x (skipped %d)\n",
937935
rcode, errors_skipped);
938936

939937
errors_skipped = 0;
940938
last_rcode = rcode;
941-
} else
939+
} else {
942940
errors_skipped++;
941+
}
942+
fwnet_transmit_packet_failed(ptask);
943943
}
944944
}
945945

drivers/firewire/ohci.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ static char ohci_driver_name[] = KBUILD_MODNAME;
290290
#define QUIRK_NO_MSI 0x10
291291
#define QUIRK_TI_SLLZ059 0x20
292292
#define QUIRK_IR_WAKE 0x40
293-
#define QUIRK_PHY_LCTRL_TIMEOUT 0x80
294293

295294
/* In case of multiple matches in ohci_quirks[], only the first one is used. */
296295
static const struct {
@@ -303,10 +302,7 @@ static const struct {
303302
QUIRK_BE_HEADERS},
304303

305304
{PCI_VENDOR_ID_ATT, PCI_DEVICE_ID_AGERE_FW643, 6,
306-
QUIRK_PHY_LCTRL_TIMEOUT | QUIRK_NO_MSI},
307-
308-
{PCI_VENDOR_ID_ATT, PCI_ANY_ID, PCI_ANY_ID,
309-
QUIRK_PHY_LCTRL_TIMEOUT},
305+
QUIRK_NO_MSI},
310306

311307
{PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_SB1394, PCI_ANY_ID,
312308
QUIRK_RESET_PACKET},
@@ -353,7 +349,6 @@ MODULE_PARM_DESC(quirks, "Chip quirks (default = 0"
353349
", disable MSI = " __stringify(QUIRK_NO_MSI)
354350
", TI SLLZ059 erratum = " __stringify(QUIRK_TI_SLLZ059)
355351
", IR wake unreliable = " __stringify(QUIRK_IR_WAKE)
356-
", phy LCtrl timeout = " __stringify(QUIRK_PHY_LCTRL_TIMEOUT)
357352
")");
358353

359354
#define OHCI_PARAM_DEBUG_AT_AR 1
@@ -2299,21 +2294,15 @@ static int ohci_enable(struct fw_card *card,
22992294
* TI TSB82AA2 + TSB81BA3(A) cards signal LPS enabled early but
23002295
* cannot actually use the phy at that time. These need tens of
23012296
* 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.
23052297
*/
23062298

23072299
reg_write(ohci, OHCI1394_HCControlSet,
23082300
OHCI1394_HCControl_LPS |
23092301
OHCI1394_HCControl_postedWriteEnable);
23102302
flush_writes(ohci);
23112303

2312-
if (!(ohci->quirks & QUIRK_PHY_LCTRL_TIMEOUT))
2304+
for (lps = 0, i = 0; !lps && i < 3; i++) {
23132305
msleep(50);
2314-
2315-
for (lps = 0, i = 0; !lps && i < 150; i++) {
2316-
msleep(1);
23172306
lps = reg_read(ohci, OHCI1394_HCControlSet) &
23182307
OHCI1394_HCControl_LPS;
23192308
}

0 commit comments

Comments
 (0)