]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.1.1/pci-quirk-mmc-always-check-for-lower-base-frequency-quirk-for-ricoh-1180-e823.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.1.1 / pci-quirk-mmc-always-check-for-lower-base-frequency-quirk-for-ricoh-1180-e823.patch
CommitLineData
a0aa785a
GKH
1From 3e309cdf07c930f29a4e0f233e47d399bea34c68 Mon Sep 17 00:00:00 2001
2From: Josh Boyer <jwboyer@redhat.com>
3Date: Wed, 5 Oct 2011 11:44:50 -0400
4Subject: PCI quirk: mmc: Always check for lower base frequency quirk for Ricoh 1180:e823
5
6From: Josh Boyer <jwboyer@redhat.com>
7
8commit 3e309cdf07c930f29a4e0f233e47d399bea34c68 upstream.
9
10Commit 15bed0f2f added a quirk for the e823 Ricoh card reader to lower the
11base frequency. However, the quirk first checks to see if the proprietary
12MMC controller is disabled, and returns if so. On some devices, such as the
13Lenovo X220, the MMC controller is already disabled by firmware it seems,
14but the frequency change is still needed so sdhci-pci can talk to the cards.
15Since the MMC controller is disabled, the frequency fixup was never being run
16on these machines.
17
18This moves the e823 check above the MMC controller check so that it always
19gets run.
20
21This fixes https://bugzilla.redhat.com/show_bug.cgi?id=722509
22
23Signed-off-by: Josh Boyer <jwboyer@redhat.com>
24Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
25Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
26
27---
28 drivers/pci/quirks.c | 28 ++++++++++++++--------------
29 1 file changed, 14 insertions(+), 14 deletions(-)
30
31--- a/drivers/pci/quirks.c
32+++ b/drivers/pci/quirks.c
33@@ -2745,20 +2745,6 @@ static void ricoh_mmc_fixup_r5c832(struc
34 /* disable must be done via function #0 */
35 if (PCI_FUNC(dev->devfn))
36 return;
37-
38- pci_read_config_byte(dev, 0xCB, &disable);
39-
40- if (disable & 0x02)
41- return;
42-
43- pci_read_config_byte(dev, 0xCA, &write_enable);
44- pci_write_config_byte(dev, 0xCA, 0x57);
45- pci_write_config_byte(dev, 0xCB, disable | 0x02);
46- pci_write_config_byte(dev, 0xCA, write_enable);
47-
48- dev_notice(&dev->dev, "proprietary Ricoh MMC controller disabled (via firewire function)\n");
49- dev_notice(&dev->dev, "MMC cards are now supported by standard SDHCI controller\n");
50-
51 /*
52 * RICOH 0xe823 SD/MMC card reader fails to recognize
53 * certain types of SD/MMC cards. Lowering the SD base
54@@ -2781,6 +2767,20 @@ static void ricoh_mmc_fixup_r5c832(struc
55
56 dev_notice(&dev->dev, "MMC controller base frequency changed to 50Mhz.\n");
57 }
58+
59+ pci_read_config_byte(dev, 0xCB, &disable);
60+
61+ if (disable & 0x02)
62+ return;
63+
64+ pci_read_config_byte(dev, 0xCA, &write_enable);
65+ pci_write_config_byte(dev, 0xCA, 0x57);
66+ pci_write_config_byte(dev, 0xCB, disable | 0x02);
67+ pci_write_config_byte(dev, 0xCA, write_enable);
68+
69+ dev_notice(&dev->dev, "proprietary Ricoh MMC controller disabled (via firewire function)\n");
70+ dev_notice(&dev->dev, "MMC cards are now supported by standard SDHCI controller\n");
71+
72 }
73 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);
74 DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);