Re: [problem] mpt2sas load fails with LSISAS2008

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 30, 2015 at 8:25 AM, Paul Johnson <pjay@xxxxxxxxxxx> wrote:
> There is a bug report here https://bugzilla.kernel.org/show_bug.cgi?id=92351
>
> I found mpt2sas is loaded successfully up through 3.4.0 and fails in 3.4.1;
> in 3.4.1 it will load
> if pci=realloc=off is added to the command line.
>
> A file with dmesg output for 3.4.0 3.4.1 and 3.4.1 with pci=realloc=off is
> attached to the bug report.

ok, when pci realloc is enabled, we do assign the new correct resource
to the all BAR
including IOV bars.

[    0.337471] pci 0000:00:03.0: resource 14 [mem
0xfbd00000-0xfbdfffff] released
[    0.337474] pci 0000:00:03.0: PCI bridge to [bus 01-01]
[    0.337482] pci 0000:00:03.0: bridge window [mem
0x00100000-0x001fffff] to [bus 01-01] add_size 500000
[    0.337503] pci 0000:00:03.0: res[14]=[mem 0x00100000-0x001fffff]
get_res_add_size add_size 500000
[    0.337507] pci 0000:00:03.0: BAR 14: assigned [mem 0xefb00000-0xf00fffff]
[    0.337517] pci 0000:01:00.0: reg 174: [mem 0xfbd00000-0xfbd03fff 64bit]
[    0.337525] pci 0000:01:00.0: reg 17c: [mem 0x00000000-0x0003ffff 64bit]
[    0.337529] pci 0000:01:00.0: res[9]=[mem
0x00000000-0xffffffffffffffff 64bit] get_res_add_size add_size 400000
[    0.337533] pci 0000:01:00.0: res[7]=[mem
0x00000000-0xffffffffffffffff 64bit] get_res_add_size add_size 40000
[    0.337538] pci 0000:01:00.0: BAR 3: assigned [mem
0xefb00000-0xefb3ffff 64bit]
[    0.337550] pci 0000:01:00.0: reg 17c: [mem 0x00000000-0x0003ffff 64bit]
[    0.337553] pci 0000:01:00.0: BAR 9: assigned [mem
0xefb40000-0xeff3ffff 64bit]
[    0.337558] pci 0000:01:00.0: BAR 1: assigned [mem
0xeff40000-0xeff43fff 64bit]
[    0.337570] pci 0000:01:00.0: reg 174: [mem 0xfbd00000-0xfbd03fff 64bit]
[    0.337573] pci 0000:01:00.0: BAR 7: assigned [mem
0xeff44000-0xeff83fff 64bit]

but looks like the mpt2 firmware does not like us to change the bar.

[    3.197114] mpt2sas version 12.100.00.00 loaded
[    3.197206] scsi8 : Fusion MPT SAS Host
[    3.197517] mpt2sas0: 64 BIT PCI BUS DMA ADDRESSING SUPPORTED,
total mem (16426944 kB)
[    3.197584] mpt2sas 0000:01:00.0: irq 46 for MSI/MSI-X
[    3.197619] mpt2sas0-msix0: PCI-MSI-X enabled: IRQ 46
[    3.197624] mpt2sas0: iomem(0x00000000eff40000),
mapped(0xffffc900065c8000), size(16384)
[    3.197629] mpt2sas0: ioport(0x000000000000ce00), size(256)
[    3.197659] mpt2sas0: doorbell is in use  (line=3015)
[    3.197664] mpt2sas0: _base_get_ioc_facts: handshake failed (r=-14)
[    3.197667] mpt2sas0: sending diag reset !!
[    3.357230] mpt2sas0: diag reset: FAILED
[    3.357298] mpt2sas0: failure at
/home/apw/COD/linux/drivers/scsi/mpt2sas/mpt2sas_scsih.c:8038/_scsih_probe()!

Please try if attached patch could avoid the problem.

Thanks

Yinghai
---
 drivers/pci/setup-bus.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Index: linux-2.6/drivers/pci/setup-bus.c
===================================================================
--- linux-2.6.orig/drivers/pci/setup-bus.c
+++ linux-2.6/drivers/pci/setup-bus.c
@@ -1640,6 +1640,22 @@ again:
 						 fail_res->flags & type_mask,
 						 rel_type);
 
+	/* reset LSI device */
+	list_for_each_entry(fail_res, &fail_head, list) {
+		struct pci_dev *pdev;
+		struct pci_bus *pbus = fail_res->dev->bus;
+
+		if (pci_is_root_bus(pbus) || !pbus->self)
+			continue;
+
+		/* LSI device firmware is not happy with changing BAR value */
+		list_for_each_entry(pdev, &pbus->devices, bus_list)
+			if (pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC) {
+				pci_reset_secondary_bus(pbus->self);
+				break;
+			}
+	}
+
 	/* restore size and flags */
 	list_for_each_entry(fail_res, &fail_head, list) {
 		struct resource *res = fail_res->res;

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux