summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Boyer <jwboyer@redhat.com>2011-10-06 14:31:40 -0400
committerJosh Boyer <jwboyer@redhat.com>2011-10-06 20:33:00 -0400
commit220cb1c7cb10259793d1126a9dbbf8943209dd28 (patch)
treeeaa5b98bcf158fce760d231c126ece1377bd7309
parent64f1bc96d9377bee8c6e79fec4e2ea3e26e27718 (diff)
downloadkernel-220cb1c7cb10259793d1126a9dbbf8943209dd28.tar.gz
kernel-220cb1c7cb10259793d1126a9dbbf8943209dd28.tar.xz
kernel-220cb1c7cb10259793d1126a9dbbf8943209dd28.zip
Add patch to fix Ricoh e823 SD card readers (rhbz 722509)
-rw-r--r--TODO1
-rw-r--r--kernel.spec12
-rw-r--r--mmc-Always-check-for-lower-base-frequency-quirk-for-.patch73
3 files changed, 85 insertions, 1 deletions
diff --git a/TODO b/TODO
index 7d13d68bf..ff6db7d5e 100644
--- a/TODO
+++ b/TODO
@@ -16,6 +16,7 @@
* usb-add-quirk-for-logitech-webcams.patch
* add-macbookair41-keyboard.patch
* ucvideo-fix-crash-when-linking-entities.patch
+* mmc-Always-check-for-lower-base-frequency-quirk-for-.patch (also CC'd stable)
**** Other stuff that should go upstream (in decreasing likelyhood) ************************************
diff --git a/kernel.spec b/kernel.spec
index a04e18170..445f1536d 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -51,7 +51,7 @@ Summary: The Linux kernel
# For non-released -rc kernels, this will be prepended with "0.", so
# for example a 3 here will become 0.3
#
-%global baserelease 0
+%global baserelease 1
%global fedora_build %{baserelease}
# base_sublevel is the kernel version we're starting with and patching
@@ -733,6 +733,10 @@ Patch20000: utrace.patch
# Flattened devicetree support
Patch21000: arm-omap-dt-compat.patch
Patch21001: arm-smsc-support-reading-mac-address-from-device-tree.patch
+
+#rhbz #722509
+Patch21002: mmc-Always-check-for-lower-base-frequency-quirk-for-.patch
+
%endif
BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -1341,6 +1345,9 @@ ApplyPatch hvcs_pi_buf_alloc.patch
ApplyPatch powerpc-Fix-deadlock-in-icswx-code.patch
+#rhbz #722509
+ApplyPatch mmc-Always-check-for-lower-base-frequency-quirk-for-.patch
+
# utrace.
ApplyPatch utrace.patch
@@ -2052,6 +2059,9 @@ fi
# ||----w |
# || ||
%changelog
+* Thu Oct 06 2011 Josh Boyer <jwboyer@redhat.com>
+- Add patch to fix base frequency check for Ricoh e823 devices (rhbz 722509)
+
* Thu Oct 06 2011 Dave Jones <davej@redhat.com>
- Taint if virtualbox modules have been loaded.
diff --git a/mmc-Always-check-for-lower-base-frequency-quirk-for-.patch b/mmc-Always-check-for-lower-base-frequency-quirk-for-.patch
new file mode 100644
index 000000000..2d7caad83
--- /dev/null
+++ b/mmc-Always-check-for-lower-base-frequency-quirk-for-.patch
@@ -0,0 +1,73 @@
+From 65ff02dff67bf26a9c27d9aa11a30eaf3d28469e Mon Sep 17 00:00:00 2001
+From: Josh Boyer <jwboyer@redhat.com>
+Date: Wed, 5 Oct 2011 11:29:57 -0400
+Subject: [PATCH] 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
+
+Signed-off-by: Josh Boyer <jwboyer@redhat.com>
+---
+ drivers/pci/quirks.c | 28 ++++++++++++++--------------
+ 1 files changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
+index 1196f61..cec4629 100644
+--- a/drivers/pci/quirks.c
++++ b/drivers/pci/quirks.c
+@@ -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);
+--
+1.7.6.4
+