mmc: Always check for lower base frequency quirk for Ricoh 1180:e823
PATCH 1/1 mmc: Always check for lower base frequency quirk for Ricoh 1180:e823
Commit 15bed0f2f added a quirk for the e823 Ricoh card reader to lower the base frequency. However, the quirk first checks to see if the proprietary MMC controller is disabled, and returns if so. On some devices, such as the Lenovo X220, the MMC controller is already disabled by firmware it seems, but the frequency change is still needed so sdhci-pci can talk to the cards. Since the MMC controller is disabled, the frequency fixup was never being run on these machines.
This moves the e823 check above the MMC controller check so that it always gets run.
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=722509
--- drivers/pci/quirks.c | 28 ++++++++++++++-------------- 1 files changed, 14 insertions(+), 14 deletions(-)
drivers/pci/quirks.c +14 -14
@@ -2745,20 +2745,6 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev)/* disable must be done via function #0 */ if (PCI_FUNC (dev->devfn))return ; - -pci_read_config_byte (dev,0xCB , &disable); - -if (disable &0x02 ) -return ; - -pci_read_config_byte (dev,0xCA , &write_enable); -pci_write_config_byte (dev,0xCA ,0x57 ); -pci_write_config_byte (dev,0xCB , disable |0x02 ); -pci_write_config_byte (dev,0xCA , write_enable); - -dev_notice (&dev->dev,"proprietary Ricoh MMC controller disabled (via firewire function)\n" ); -dev_notice (&dev->dev,"MMC cards are now supported by standard SDHCI controller\n" ); -/* * RICOH 0xe823 SD/MMC card reader fails to recognize * certain types of SD/MMC cards. Lowering the SD base
@@ -2781,6 +2767,20 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev)dev_notice (&dev->dev,"MMC controller base frequency changed to 50Mhz.\n" ); } + +pci_read_config_byte (dev,0xCB , &disable); + +if (disable &0x02 ) +return ; + +pci_read_config_byte (dev,0xCA , &write_enable); +pci_write_config_byte (dev,0xCA ,0x57 ); +pci_write_config_byte (dev,0xCB , disable |0x02 ); +pci_write_config_byte (dev,0xCA , write_enable); + +dev_notice (&dev->dev,"proprietary Ricoh MMC controller disabled (via firewire function)\n" ); +dev_notice (&dev->dev,"MMC cards are now supported by standard SDHCI controller\n" ); + }DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_RICOH ,PCI_DEVICE_ID_RICOH_R5C832 , ricoh_mmc_fixup_r5c832);DECLARE_PCI_FIXUP_RESUME_EARLY (PCI_VENDOR_ID_RICOH ,PCI_DEVICE_ID_RICOH_R5C832 , ricoh_mmc_fixup_r5c832);
Signature · 1 line
1.7.6.4
Quoted 4 lines · Josh Boyer
Commit
15bed0f2fadded a quirk for the e823 Ricoh card reader to lower the base frequency. However, the quirk first checks to see if the proprietary MMC controller is disabled, and returns if so. On some devices, such as the Lenovo X220, the MMC controller is already disabled by firmware it seems,
It is possible that the newer firmware from Lenovo disables the MMC controller. When the patch was done, these laptops had just been announced, so they had a very early version of the firmware (ver 1.02 iirc).
Quoted 64 lines
but the frequency change is still needed so sdhci-pci can talk to the cards. Since the MMC controller is disabled, the frequency fixup was never being run on these machines.
This moves the e823 check above the MMC controller check so that it always gets run.
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=722509
Signed-off-by Josh Boyer <[email protected]>---
drivers/pci/quirks.c| 28 ++++++++++++++--------------1 files changed, 14 insertions(+), 14 deletions(-)drivers/pci/quirks.c +14
-14@@ -2745,20 +2745,6 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev)/* disable must be done via function #0 */ if (PCI_FUNC (dev->devfn))return ; - -pci_read_config_byte (dev,0xCB , &disable); - -if (disable &0x02 ) -return ; - -pci_read_config_byte (dev,0xCA , &write_enable); -pci_write_config_byte (dev,0xCA ,0x57 ); -pci_write_config_byte (dev,0xCB , disable |0x02 ); -pci_write_config_byte (dev,0xCA , write_enable); - -dev_notice (&dev->dev,"proprietary Ricoh MMC controller disabled (via firewire function)\n" ); -dev_notice (&dev->dev,"MMC cards are now supported by standard SDHCI controller\n" ); -/* * RICOH 0xe823 SD/MMC card reader fails to recognize * certain types of SD/MMC cards. Lowering the SD base @@ -2781,6 +2767,20 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev)dev_notice (&dev->dev,"MMC controller base frequency changed to 50Mhz.\n" ); } + +pci_read_config_byte (dev,0xCB , &disable); + +if (disable &0x02 ) +return ; + +pci_read_config_byte (dev,0xCA , &write_enable); +pci_write_config_byte (dev,0xCA ,0x57 ); +pci_write_config_byte (dev,0xCB , disable |0x02 ); +pci_write_config_byte (dev,0xCA , write_enable); + +dev_notice (&dev->dev,"proprietary Ricoh MMC controller disabled (via firewire function)\n" ); +dev_notice (&dev->dev,"MMC cards are now supported by standard SDHCI controller\n" ); + }DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_RICOH ,PCI_DEVICE_ID_RICOH_R5C832 , ricoh_mmc_fixup_r5c832);DECLARE_PCI_FIXUP_RESUME_EARLY (PCI_VENDOR_ID_RICOH ,PCI_DEVICE_ID_RICOH_R5C832 , ricoh_mmc_fixup_r5c832);Signature · 1 line
1.7.6.4
--
====================
Manoj Iyer
Ubuntu/Canonical
Hardware Enablement
====================
Quoted 11 lines · Manoj Iyer
Quoted 4 lines · Josh Boyer
Commit
15bed0f2fadded a quirk for the e823 Ricoh card reader to lower the base frequency. However, the quirk first checks to see if the proprietary MMC controller is disabled, and returns if so. On some devices, such as the Lenovo X220, the MMC controller is already disabled by firmware it seems,It is possible that the newer firmware from Lenovo disables the MMC controller. When the patch was done, these laptops had just been announced, so they had a very early version of the firmware (ver 1.02 iirc).
Seems so. The X220 laptop I debugged this on shows:
[jwboyer@zod linux-2.6]$ cat /sys/devices/virtual/dmi/id/bios_version 8DET42WW (1.12 )
josh
Quoted 13 lines · Josh Boyer
Quoted 11 lines · Manoj Iyer
Quoted 4 lines · Josh Boyer
Commit
15bed0f2fadded a quirk for the e823 Ricoh card reader to lower the base frequency. However, the quirk first checks to see if the proprietary MMC controller is disabled, and returns if so. On some devices, such as the Lenovo X220, the MMC controller is already disabled by firmware it seems,It is possible that the newer firmware from Lenovo disables the MMC controller. When the patch was done, these laptops had just been announced, so they had a very early version of the firmware (ver 1.02 iirc).
Quoted 4 lines
Seems so. The X220 laptop I debugged this on shows:
[jwboyer@zod linux-2.6]$ cat
/sys/devices/virtual/dmi/id/bios_version8DET42WW (1.12 )
I was able to track down the one I debugged, luckily the firmware on it was never updated, and great! the bios is even older than I thought...
u@u:~$ cat /sys/devices/virtual/dmi/id/bios_version 8DET25WW (0.25 ) u@u:~$
So, yes definitely looks like BIOS might have disabled MMC in the newer releases. /me wonders when IBVs will get their act together ...
Quoted 4 lines
josh
--
====================
Manoj Iyer
Ubuntu/Canonical
Hardware Enablement
====================
Jesse Barnes
AppliedQuoted 8 lines · On Wed, 5 Oct 2011 11:44:50 -0400 Josh Boyer <[email protected]> wrote:
Commit
15bed0f2fadded a quirk for the e823 Ricoh card reader to lower the base frequency. However, the quirk first checks to see if the proprietary MMC controller is disabled, and returns if so. On some devices, such as the Lenovo X220, the MMC controller is already disabled by firmware it seems, but the frequency change is still needed so sdhci-pci can talk to the cards. Since the MMC controller is disabled, the frequency fixup was never being run on these machines.
Quoted 5 lines
This moves the e823 check above the MMC controller check so that it always gets run.
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=722509
Applied to linux-next, thanks. I forgot to cc stable on it though; once it hits Linus's tree you may want to make sure it gets backported to 3.0.x and 3.1.x.
Thanks,
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Quoted 14 lines · Jesse Barnes
Quoted 11 lines · On Wed, 5 Oct 2011 11:44:50 -0400 Josh Boyer <[email protected]> wrote:
Commit
15bed0f2fadded a quirk for the e823 Ricoh card reader to lower the base frequency. However, the quirk first checks to see if the proprietary MMC controller is disabled, and returns if so. On some devices, such as the Lenovo X220, the MMC controller is already disabled by firmware it seems, but the frequency change is still needed so sdhci-pci can talk to the cards. Since the MMC controller is disabled, the frequency fixup was never being run on these machines.This moves the e823 check above the MMC controller check so that it always gets run.
Quoted 6 lines
Quoted 2 lines
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=722509
Applied to linux-next, thanks. I forgot to cc stable on it though; once it hits Linus's tree you may want to make sure it gets backported to 3.0.x and 3.1.x.
OK. Will do. Thanks Jesse.
josh
Greg KH
AppliedQuoted 15 lines · Josh Boyer
Quoted 14 lines · Jesse Barnes
Quoted 11 lines · On Wed, 5 Oct 2011 11:44:50 -0400 Josh Boyer <[email protected]> wrote:
Commit
15bed0f2fadded a quirk for the e823 Ricoh card reader to lower the base frequency. However, the quirk first checks to see if the proprietary MMC controller is disabled, and returns if so. On some devices, such as the Lenovo X220, the MMC controller is already disabled by firmware it seems, but the frequency change is still needed so sdhci-pci can talk to the cards. Since the MMC controller is disabled, the frequency fixup was never being run on these machines.This moves the e823 check above the MMC controller check so that it always gets run.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=722509
Applied to linux-next, thanks. I forgot to cc stable on it though; once it hits Linus's tree you may want to make sure it gets backported to 3.0.x and 3.1.x.
OK. Will do. Thanks Jesse.
I've queued it up now, no need for you to remind me.
greg k-h