From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Jesse Barnes <jbarnes@virtuousgeek.org>,
Dominik Brodowski <linux@dominikbrodowski.net>,
Stefan Bader <stefan.bader@canonical.com>
Subject: [19/30] PCI/cardbus: Add a fixup hook and fix powerpc
Date: Wed, 20 Jan 2010 20:15:40 -0800 [thread overview]
Message-ID: <20100121041834.949640153@mini.kroah.org> (raw)
In-Reply-To: <20100121041852.GA9656@kroah.com>
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
commit 2d1c861871d767153538a77c498752b36d4bb4b8 upstream
The cardbus code creates PCI devices without ever going through the
necessary fixup bits and pieces that normal PCI devices go through.
There's in fact a commented out call to pcibios_fixup_bus() in there,
it's commented because ... it doesn't work.
I could make pcibios_fixup_bus() do the right thing on powerpc easily
but I felt it cleaner instead to provide a specific hook pci_fixup_cardbus
for which a weak empty implementation is provided by the PCI core.
This fixes cardbus on powerbooks and probably all other PowerPC
platforms which was broken completely for ever on some platforms and
since 2.6.31 on others such as PowerBooks when we made the DMA ops
mandatory (since those are setup by the fixups).
Acked-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/powerpc/kernel/pci-common.c | 13 +++++++++++++
drivers/pci/pci.c | 5 +++++
drivers/pcmcia/cardbus.c | 2 +-
include/linux/pci.h | 3 +++
4 files changed, 22 insertions(+), 1 deletion(-)
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1107,6 +1107,12 @@ void __devinit pcibios_setup_bus_devices
list_for_each_entry(dev, &bus->devices, bus_list) {
struct dev_archdata *sd = &dev->dev.archdata;
+ /* Cardbus can call us to add new devices to a bus, so ignore
+ * those who are already fully discovered
+ */
+ if (dev->is_added)
+ continue;
+
/* Setup OF node pointer in archdata */
sd->of_node = pci_device_to_OF_node(dev);
@@ -1147,6 +1153,13 @@ void __devinit pcibios_fixup_bus(struct
}
EXPORT_SYMBOL(pcibios_fixup_bus);
+void __devinit pci_fixup_cardbus(struct pci_bus *bus)
+{
+ /* Now fixup devices on that bus */
+ pcibios_setup_bus_devices(bus);
+}
+
+
static int skip_isa_ioresource_align(struct pci_dev *dev)
{
if ((ppc_pci_flags & PPC_PCI_CAN_SKIP_ISA_ALIGN) &&
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2723,6 +2723,11 @@ int __attribute__ ((weak)) pci_ext_cfg_a
return 1;
}
+void __weak pci_fixup_cardbus(struct pci_bus *bus)
+{
+}
+EXPORT_SYMBOL(pci_fixup_cardbus);
+
static int __init pci_setup(char *str)
{
while (str) {
--- a/drivers/pcmcia/cardbus.c
+++ b/drivers/pcmcia/cardbus.c
@@ -214,7 +214,7 @@ int __ref cb_alloc(struct pcmcia_socket
unsigned int max, pass;
s->functions = pci_scan_slot(bus, PCI_DEVFN(0, 0));
-// pcibios_fixup_bus(bus);
+ pci_fixup_cardbus(bus);
max = bus->secondary;
for (pass = 0; pass < 2; pass++)
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -564,6 +564,9 @@ void pcibios_align_resource(void *, stru
resource_size_t);
void pcibios_update_irq(struct pci_dev *, int irq);
+/* Weak but can be overriden by arch */
+void pci_fixup_cardbus(struct pci_bus *);
+
/* Generic PCI functions used internally */
extern struct pci_bus *pci_find_bus(int domain, int busnr);
next prev parent reply other threads:[~2010-01-21 4:27 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-21 4:18 [00/30] 2.6.32.5 review Greg KH
2010-01-21 4:15 ` [01/30] inotify: do not reuse watch descriptors Greg KH
2010-01-21 4:15 ` [02/30] inotify: only warn once for inotify problems Greg KH
2010-01-21 4:15 ` [03/30] revert "drivers/video/s3c-fb.c: fix clock setting for Samsung SoC Framebuffer" Greg KH
2010-01-21 4:15 ` [04/30] memcg: ensure list is empty at rmdir Greg KH
2010-01-21 4:15 ` [05/30] drm/i915: remove loop in Ironlake interrupt handler Greg KH
2010-01-21 4:15 ` [06/30] block: Fix incorrect reporting of partition alignment Greg KH
2010-01-21 4:15 ` [07/30] x86, mce: Thermal monitoring depends on APIC being enabled Greg KH
2010-01-21 4:15 ` [08/30] futexes: Remove rw parameter from get_futex_key() Greg KH
2010-01-21 4:15 ` [09/30] page allocator: update NR_FREE_PAGES only when necessary Greg KH
2010-01-21 4:15 ` [10/30] x86, apic: use physical mode for IBM summit platforms Greg KH
2010-01-21 4:15 ` [11/30] edac: i5000_edac critical fix panic out of bounds Greg KH
2010-01-21 4:15 ` [12/30] x86: SGI UV: Fix mapping of MMIO registers Greg KH
2010-01-21 4:15 ` [13/30] mfd: WM835x GPIO direction register is not locked Greg KH
2010-01-21 4:15 ` [14/30] mfd: Correct WM835x ISINK ramp time defines Greg KH
2010-01-21 4:15 ` [15/30] ALSA: hda - Fix missing capture mixer for ALC861/660 codecs Greg KH
2010-01-21 4:15 ` [16/30] V4L/DVB (13868): gspca - sn9c20x: Fix test of unsigned Greg KH
2010-01-21 4:15 ` [17/30] reiserfs: truncate blocks not used by a write Greg KH
2010-01-21 4:15 ` [18/30] HID: add device IDs for new model of Apple Wireless Keyboard Greg KH
2010-01-21 4:15 ` Greg KH [this message]
2010-01-21 4:15 ` [20/30] [SCSI] megaraid_sas: remove sysfs poll_mode_io world writeable permissions Greg KH
2010-01-21 4:15 ` [21/30] Input: pmouse - move Sentelic probe down the list Greg KH
2010-01-21 4:15 ` [22/30] asus-laptop: add Lenovo SL hotkey support Greg KH
2010-01-21 4:15 ` [23/30] sched: Fix cpu_clock() in NMIs, on !CONFIG_HAVE_UNSTABLE_SCHED_CLOCK Greg KH
2010-01-21 4:15 ` [24/30] sparc64: Fix NMI programming when perf events are active Greg KH
2010-01-21 4:15 ` [25/30] sparc64: Fix Niagara2 perf event handling Greg KH
2010-01-21 4:15 ` [26/30] i2c: Do not use device name after device_unregister Greg KH
2010-01-21 4:15 ` [27/30] i2c/pca: Dont use *_interruptible Greg KH
2010-01-21 4:15 ` [28/30] serial/8250_pnp: add a new Fujitsu Wacom Tablet PC device Greg KH
2010-01-21 4:15 ` [29/30] sched: Fix task priority bug Greg KH
2010-01-21 4:15 ` [30/30] vfs: Fix vmtruncate() regression Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100121041834.949640153@mini.kroah.org \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=benh@kernel.crashing.org \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
--cc=stable-review@kernel.org \
--cc=stable@kernel.org \
--cc=stefan.bader@canonical.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome