Skip to contentSkip to conversation

mmc: sdhci-pci: add quirk for broken MSI on O2Micro ctrls.

PATCH In review Manuel Lauss 2 participants 2 messages Apr 1, 2012

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

PATCH v2 1/1 mmc: sdhci-pci: add quirk for broken MSI on O2Micro ctrls.

MSI on my O2Micro OZ600 SD card reader is broken. This patch adds a quirk to disable MSI on these controllers.

---
v2: also wrap pci_disable_msi() calls as requested by Chris Ball.

 drivers/mmc/host/sdhci-pci.c |   10 +++++++---
 include/linux/mmc/sdhci.h    |    2 ++
 2 files changed, 9 insertions(+), 3 deletions(-)
drivers/mmc/host/sdhci-pci.c +7 -3
index fbbebe2..5439b18 100644
@@ -561,6 +561,7 @@ static int jmicron_resume(struct sdhci_pci_chip *chip)
 
 static const struct sdhci_pci_fixes sdhci_o2 = {
 	.probe		= o2_probe,
+	.quirks2	= SDHCI_QUIRK2_BROKEN_MSI,
 };
 
 static const struct sdhci_pci_fixes sdhci_jmicron = {
@@ -1418,7 +1419,8 @@ static int __devinit sdhci_pci_probe(struct pci_dev *pdev,
 
 	slots = chip->num_slots;	/* Quirk may have changed this */
 
-	pci_enable_msi(pdev);
+	if (!(chip->quirks2 & SDHCI_QUIRK2_BROKEN_MSI))
+		pci_enable_msi(pdev);
 
 	for (i = 0; i < slots; i++) {
 		slot = sdhci_pci_probe_slot(pdev, chip, first_bar, i);
@@ -1438,7 +1440,8 @@ static int __devinit sdhci_pci_probe(struct pci_dev *pdev,
 	return 0;
 
 free:
-	pci_disable_msi(pdev);
+	if (!(chip->quirks2 & SDHCI_QUIRK2_BROKEN_MSI))
+		pci_disable_msi(pdev);
 
 	pci_set_drvdata(pdev, NULL);
 	kfree(chip);
@@ -1462,7 +1465,8 @@ static void __devexit sdhci_pci_remove(struct pci_dev *pdev)
 		for (i = 0; i < chip->num_slots; i++)
 			sdhci_pci_remove_slot(chip->slots[i]);
 
-		pci_disable_msi(pdev);
+		if (!(chip->quirks2 & SDHCI_QUIRK2_BROKEN_MSI))
+			pci_disable_msi(pdev);
 
 		pci_set_drvdata(pdev, NULL);
 		kfree(chip);
include/linux/mmc/sdhci.h +2 -0
index e9051e1..9752fe4 100644
@@ -91,6 +91,8 @@ struct sdhci_host {
 	unsigned int quirks2;	/* More deviations from spec. */
 
 #define SDHCI_QUIRK2_HOST_OFF_CARD_ON			(1<<0)
+/* broken MSI Interrupts */
+#define SDHCI_QUIRK2_BROKEN_MSI				(1<<1)
 
 	int irq;		/* Device IRQ */
 	void __iomem *ioaddr;	/* Mapped address */
Signature · 1 line
1.7.8.5
#1 lore raw

Hi,

Quoted 58 lines · Manuel Lauss

MSI on my O2Micro OZ600 SD card reader is broken. This patch adds a quirk to disable MSI on these controllers.

---
v2: also wrap pci_disable_msi() calls as requested by Chris Ball.

 drivers/mmc/host/sdhci-pci.c |   10 +++++++---
 include/linux/mmc/sdhci.h    |    2 ++
 2 files changed, 9 insertions(+), 3 deletions(-)
drivers/mmc/host/sdhci-pci.c +7 -3
index fbbebe2..5439b18 100644
@@ -561,6 +561,7 @@ static int jmicron_resume(struct sdhci_pci_chip *chip)
 
 static const struct sdhci_pci_fixes sdhci_o2 = {
 	.probe		= o2_probe,
+	.quirks2	= SDHCI_QUIRK2_BROKEN_MSI,
 };
 
 static const struct sdhci_pci_fixes sdhci_jmicron = {
@@ -1418,7 +1419,8 @@ static int __devinit sdhci_pci_probe(struct pci_dev *pdev,
 
 	slots = chip->num_slots;	/* Quirk may have changed this */
 
-	pci_enable_msi(pdev);
+	if (!(chip->quirks2 & SDHCI_QUIRK2_BROKEN_MSI))
+		pci_enable_msi(pdev);
 
 	for (i = 0; i < slots; i++) {
 		slot = sdhci_pci_probe_slot(pdev, chip, first_bar, i);
@@ -1438,7 +1440,8 @@ static int __devinit sdhci_pci_probe(struct pci_dev *pdev,
 	return 0;
 
 free:
-	pci_disable_msi(pdev);
+	if (!(chip->quirks2 & SDHCI_QUIRK2_BROKEN_MSI))
+		pci_disable_msi(pdev);
 
 	pci_set_drvdata(pdev, NULL);
 	kfree(chip);
@@ -1462,7 +1465,8 @@ static void __devexit sdhci_pci_remove(struct pci_dev *pdev)
 		for (i = 0; i < chip->num_slots; i++)
 			sdhci_pci_remove_slot(chip->slots[i]);
 
-		pci_disable_msi(pdev);
+		if (!(chip->quirks2 & SDHCI_QUIRK2_BROKEN_MSI))
+			pci_disable_msi(pdev);
 
 		pci_set_drvdata(pdev, NULL);
 		kfree(chip);
include/linux/mmc/sdhci.h +0 -0
index e9051e1..9752fe4 100644

include/linux/mmc/sdhci.h struct sdhci_host { · line 98

Quoted 8 lines
include/linux/mmc/sdhci.h +2 -0
@@ -91,6 +91,8 @@ struct sdhci_host {
 	unsigned int quirks2;	/* More deviations from spec. */
 
 #define SDHCI_QUIRK2_HOST_OFF_CARD_ON			(1<<0)
+/* broken MSI Interrupts */
+#define SDHCI_QUIRK2_BROKEN_MSI				(1<<1)
 
 	int irq;		/* Device IRQ */
 	void __iomem *ioaddr;	/* Mapped address */

Thanks, pushed to mmc-next for 3.4.

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child