From 1118f8d048dd595efbadf05e8bca4e19684ffb4d Mon Sep 17 00:00:00 2001 From: Daeseok Youn Date: Tue, 29 Apr 2014 18:49:47 +0900 Subject: firewire: net: fix NULL derefencing in fwnet_probe() "dev" and "net" are NULL when alloc_netdev() is failed. So just unlock and return an error. Signed-off-by: Daeseok Youn Signed-off-by: Stefan Richter --- drivers/firewire/net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c index 4af0a7bad7f2..c3986452194d 100644 --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c @@ -1462,8 +1462,8 @@ static int fwnet_probe(struct fw_unit *unit, net = alloc_netdev(sizeof(*dev), "firewire%d", fwnet_init_dev); if (net == NULL) { - ret = -ENOMEM; - goto out; + mutex_unlock(&fwnet_device_mutex); + return -ENOMEM; } allocated_netdev = true; -- cgit v1.2.3-58-ga151 From b3d681a4fc108f9653bbb44e4f4e72db2b8a5734 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 15 May 2014 15:29:23 +0200 Subject: firewire: Use COMPILE_TEST for build testing Stop using BROKEN as an alternative dependency for the purpose of build testing the firewire core. The newly introduced COMPILE_TEST is better suited for that purpose. Signed-off-by: Jean Delvare Signed-off-by: Stefan Richter --- drivers/firewire/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firewire/Kconfig b/drivers/firewire/Kconfig index 7a701a58bbf0..4199849e3758 100644 --- a/drivers/firewire/Kconfig +++ b/drivers/firewire/Kconfig @@ -1,5 +1,5 @@ menu "IEEE 1394 (FireWire) support" - depends on PCI || BROKEN + depends on PCI || COMPILE_TEST # firewire-core does not depend on PCI but is # not useful without PCI controller driver -- cgit v1.2.3-58-ga151 From d151f9854f21fbb6a2df73553a27f9b664ecd10c Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Wed, 16 Apr 2014 01:08:08 +0200 Subject: firewire: ohci: enable MSI for VIA VT6315 rev 1, drop cycle timer quirk Commit af0cdf494781 "firewire: ohci: fix regression with VIA VT6315, disable MSI" acted upon a report against VT6315 rev 0: http://linux.derkeiler.com/Mailing-Lists/Kernel/2010-12/msg02301.html $ lspci -nn VIA Technologies, Inc. VT6315 Series Firewire Controller [1106:3403] I now got a card with $ lspci -nn VIA Technologies, Inc. VT6315 Series Firewire Controller [1106:3403] (rev 01) and this works fine with MSI enabled. Second, I tested this VT6315 rev 1 without CYCLE_TIMER quirk flag using http://me.in-berlin.de/~s5r6/linux1394/utils/test_cycle_time_v20100125.c and found that this chip does in fact access the cycle timer atomically. Things I can't test because I don't have the hardware: - whether VT6315 rev 0 really needs QUIRK_CYCLE_TIMER, - whether the VT6320 PCI device needs QUIRK_CYCLE_TIMER, - whether the VT6325 and VT6330 PCIe devices need QUIRK_CYCLE_TIMER and QUIRK_NO_MSI. Hence, just add a whitelist entry specifically for VT6315 rev >= 1 without any quirk flags. Before this entry we need an extra entry to catch VT6315 rev <= 0 due to how our ID matching logic works. Signed-off-by: Stefan Richter --- drivers/firewire/ohci.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 8db663219560..5b0934d0d968 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -282,6 +282,7 @@ static char ohci_driver_name[] = KBUILD_MODNAME; #define PCI_DEVICE_ID_TI_TSB82AA2 0x8025 #define PCI_DEVICE_ID_VIA_VT630X 0x3044 #define PCI_REV_ID_VIA_VT6306 0x46 +#define PCI_DEVICE_ID_VIA_VT6315 0x3403 #define QUIRK_CYCLE_TIMER 0x1 #define QUIRK_RESET_PACKET 0x2 @@ -334,6 +335,12 @@ static const struct { {PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT630X, PCI_REV_ID_VIA_VT6306, QUIRK_CYCLE_TIMER | QUIRK_IR_WAKE}, + {PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT6315, 0, + QUIRK_CYCLE_TIMER | QUIRK_NO_MSI}, + + {PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT6315, PCI_ANY_ID, + 0}, + {PCI_VENDOR_ID_VIA, PCI_ANY_ID, PCI_ANY_ID, QUIRK_CYCLE_TIMER | QUIRK_NO_MSI}, }; -- cgit v1.2.3-58-ga151