Skip to contentSkip to conversation

megaraid_sas: Quirk mmio hook for 1078 MR controller

PATCH In review [email protected] 2 participants 4 messages Dec 23, 2013 – Dec 24, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 megaraid_sas: Quirk mmio hook for 1078 MR controller

This patch has fix for LSI Gen-1 MR controller issue which only pop-up on few systems and it is not generic.

On few system, MR 1078 MR controller is not working if mmio decoding is off. This patch proposed early quirck entry for Device id 0x1000/0x0411 to enable mmio.

---

drivers/pci/quirks.c +4 -0
index f6c31fa..a20fe41 100644
@@ -43,6 +43,10 @@ static void quirk_mmio_always_on(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_ANY_ID, PCI_ANY_ID,
 				PCI_CLASS_BRIDGE_HOST, 8, quirk_mmio_always_on);
+/* LSI controller device id 0x0411 has some issues if mmio_always_on is not set. 
+ * It pop-up only on few specific system, where decoding disable is not working.
+ */
+DECLARE_PCI_FIXUP_EARLY(0x1000, 0x0411, quirk_mmio_always_on);
 
 /* The Mellanox Tavor device gives false positive parity errors
  * Mark this device with a broken_parity_status, to allow
maintainer
#1 lore raw
Quoted 13 lines · On Mon, Dec 23, 2013 at 8:13 AM, <[email protected]> wrote:

This patch has fix for LSI Gen-1 MR controller issue which only pop-up on few systems and it is not generic.

On few system, MR 1078 MR controller is not working if mmio decoding is off. This patch proposed early quirck entry for Device id 0x1000/0x0411 to enable mmio.

---

drivers/pci/quirks.c +0 -0
index f6c31fa..a20fe41 100644

drivers/pci/quirks.c static void quirk_mmio_always_on(struct pci_dev *dev) · line 49

Quoted 7 lines
drivers/pci/quirks.c +4 -0
@@ -43,6 +43,10 @@ static void quirk_mmio_always_on(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_ANY_ID, PCI_ANY_ID,
                                PCI_CLASS_BRIDGE_HOST, 8, quirk_mmio_always_on);
+/* LSI controller device id 0x0411 has some issues if mmio_always_on is not set.
+ * It pop-up only on few specific system, where decoding disable is not working.
+ */
+DECLARE_PCI_FIXUP_EARLY(0x1000, 0x0411, quirk_mmio_always_on);

What is the actual problem that happens without this quirk? Is there some hardware defect in the MR 1078 that makes it fail when we disable decoding?

Disabling decoding is important because it prevents conflicts with other devices while sizing and updating BARs, so I don't want to use this quirk unless it's really necessary.

Bjorn

#2 lore raw

DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogQmpvcm4gSGVsZ2FhcyBb bWFpbHRvOmJoZWxnYWFzQGdvb2dsZS5jb21dDQo+IFNlbnQ6IE1vbmRheSwgRGVjZW1iZXIgMjMs IDIwMTMgMTE6MjggUE0NCj4gVG86IERlc2FpLCBLYXNoeWFwDQo+IENjOiBsaW51eC1zY3NpQHZn ZXIua2VybmVsLm9yZzsgbGludXgtcGNpQHZnZXIua2VybmVsLm9yZzsgSmFtZXMgRS5KLg0KPiBC b3R0b21sZXk7IFNheGVuYSwgU3VtaXQ7IEFkYW0gUmFkZm9yZA0KPiBTdWJqZWN0OiBSZTogW1BB VENIXSBtZWdhcmFpZF9zYXM6IFF1aXJrIG1taW8gaG9vayBmb3IgMTA3OCBNUiBjb250cm9sbGVy DQo+IA0KPiBPbiBNb24sIERlYyAyMywgMjAxMyBhdCA4OjEzIEFNLCAgPEthc2h5YXAuRGVzYWlA bHNpLmNvbT4gd3JvdGU6DQo+ID4gVGhpcyBwYXRjaCBoYXMgZml4IGZvciBMU0kgR2VuLTEgTVIg Y29udHJvbGxlciBpc3N1ZSB3aGljaCBvbmx5IHBvcC11cA0KPiA+IG9uIGZldyBzeXN0ZW1zIGFu ZCBpdCBpcyBub3QgZ2VuZXJpYy4NCj4gPg0KPiA+IE9uIGZldyBzeXN0ZW0sIE1SIDEwNzggTVIg Y29udHJvbGxlciBpcyBub3Qgd29ya2luZyBpZiBtbWlvIGRlY29kaW5nIGlzDQo+IG9mZi4NCj4g PiBUaGlzIHBhdGNoIHByb3Bvc2VkIGVhcmx5IHF1a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zIHRvIGNhdXNlIHByb2JsZW1zIG9uIGN1c3RvbWVyIHNldHVwLg0K DQoxMDc4IE1SIGNvbnRyb2xsZXIgaXMgcHJldHR5IG9sZCBoL3cgYW5kIHdlIG1heSBuZWVkIG1v cmUgdGltZSB0byBhY3R1YWxseSBmaWd1cmUgb3V0IHdoeSBuZXcgcGNpX3JlYWQgbWV0aG9kIGlz IGZhaWxpbmcgb24gY3VzdG9tZXIgc3lzdGVtLiAgQXMgYW4gYWx0ZXJuYXRpdmUgKGNvbnNpZGVy IHRoYXQgTFNJIGgvdyBoYXMgc29tZSBpc3N1ZSksIHdlIG9wdCB0byBlbmFibGUgbW1pbyB2aWEg cXVpcmsgZW50cnkuIA0KDQogfiBLYXNoeWFwDQoNCj4gDQo+IEJqb3JuDQo+IA0KDQo=

maintainer
#3 lore raw

[+cc Myron]

Quoted 39 lines · Kashyap
Quoted 39 lines

-----Original Message-----
From: Bjorn Helgaas [mailto:[email protected]]
Sent: Monday, December 23, 2013 11:28 PM
To: Desai, Kashyap
Cc: [email protected]; [email protected]; James E.J. Bottomley; Saxena, Sumit; Adam Radford
Subject: Re: [PATCH] megaraid_sas: Quirk mmio hook for 1078 MR controller

Quoted 4 lines · On Mon, Dec 23, 2013 at 8:13 AM, <[email protected]> wrote:

This patch has fix for LSI Gen-1 MR controller issue which only pop-up on few systems and it is not generic.

On few system, MR 1078 MR controller is not working if mmio decoding is

off.

Quoted 1 line

This patch proposed early quirck entry for Device id 0x1000/0x0411 to

enable mmio.

drivers/pci/quirks.c static void quirk_mmio_always_on(struct pci_dev · line 46

Quoted 12 lines

---

drivers/pci/quirks.c index renamed from drivers/pci/quirks.c +0 -0

f6c31fa..a20fe41 100644

drivers/pci/quirks.c +1 -0
@@ -43,6 +43,10 @@ static void quirk_mmio_always_on(struct pci_dev
 *dev)  }  DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_ANY_ID, PCI_ANY_ID,
                                PCI_CLASS_BRIDGE_HOST, 8,
 quirk_mmio_always_on);
+/* LSI controller device id 0x0411 has some issues if mmio_always_on is

not set.

drivers/pci/quirks.c static void quirk_mmio_always_on(struct pci_dev · line 47

Quoted 1 line
drivers/pci/quirks.c +1 -0
+ * It pop-up only on few specific system, where decoding disable is not

working.

drivers/pci/quirks.c static void quirk_mmio_always_on(struct pci_dev *dev) · line 49

Quoted 2 lines
drivers/pci/quirks.c +2 -0
+ */
+DECLARE_PCI_FIXUP_EARLY(0x1000, 0x0411, quirk_mmio_always_on);

What is the actual problem that happens without this quirk? Is there some hardware defect in the MR 1078 that makes it fail when we disable decoding?

Quoted 6 lines
Quoted 3 lines

Disabling decoding is important because it prevents conflicts with other devices while sizing and updating BARs, so I don't want to use this quirk unless it's really necessary.

LSI is still investigating on h/w issue. It was originally reported from customer site and they have found this issue when they upgrade RHEL6.3 to RHEL6.4.

Kernel/Driver fault with machine check on RHEL6.4 at the time of driver reading base address registers. New way, used in RHEL6.4 (similar to upstream kernel) is to disable mmio memory mapping a and i/o to the device, read the value and then re-enable mmio memory mapping and i/o. This seems to cause problems on customer setup.

Is there a bug report we can look at? Maybe a dmesg or console log of the issue happening, along with "lspci -vv" output and contents of /proc/iomem and /proc/ioports?

Unless there's some 1078 hardware defect related to writing the command register, the current code should be safe. It's possible there's a driver defect or something else that causes an access to the device while it is disabled. If that's happening, *that* is what needs to be fixed.

I am opposed to making a change like this to upstream until we understand what's actually going on. Of course, RH may want to put the change in their kernel as a pragmatic measure.

Quoted 8 lines

1078 MR controller is pretty old h/w and we may need more time to actually figure out why new pci_read method is failing on customer system. As an alternative (consider that LSI h/w has some issue), we opt to enable mmio via quirk entry.

~ Kashyap

Quoted 3 lines

Bjorn