From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: <linuxppc-dev@ozlabs.org>
Subject: [PATCH 13/15] [POWERPC] Fixup powermac enable device hook
Date: Fri, 14 Dec 2007 15:56:13 +1100 [thread overview]
Message-ID: <20071214045620.734F0DE702@ozlabs.org> (raw)
In-Reply-To: <1197608163.200976.87755569596.qpush@grosgo>
Powermac's use of the pcibios_enable_device_hook() got slightly
broken by the recent PCI merge in that it won't be called for
the "initial" case of assigning resources to a previously
unassigned device. This was an abuse of that hook anyway, so
instead we now use a header quirk.
While at it, we move a #ifdef CONFIG_PPC32 to enclose more code
that is only ever used on 32 bits.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/platforms/powermac/pci.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
--- linux-merge.orig/arch/powerpc/platforms/powermac/pci.c 2007-12-14 15:49:34.000000000 +1100
+++ linux-merge/arch/powerpc/platforms/powermac/pci.c 2007-12-14 15:49:34.000000000 +1100
@@ -1058,6 +1058,7 @@ void __init pmac_pci_init(void)
#endif
}
+#ifdef CONFIG_PPC32
int pmac_pci_enable_device_hook(struct pci_dev *dev)
{
struct device_node* node;
@@ -1106,7 +1107,6 @@ int pmac_pci_enable_device_hook(struct p
* bridge and we must not, for example, enable MWI or set the
* cache line size on them.
*/
-#ifdef CONFIG_PPC32
if (updatecfg) {
u16 cmd;
@@ -1118,12 +1118,23 @@ int pmac_pci_enable_device_hook(struct p
pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE,
L1_CACHE_BYTES >> 2);
-#endif
}
return 0;
}
+void __devinit pmac_pci_fixup_ohci(struct pci_dev *dev)
+{
+ struct device_node *node = pci_device_to_OF_node(dev);
+
+ /* We don't want to assign resources to USB controllers
+ * absent from the OF tree (iBook second controller)
+ */
+ if (dev->class == PCI_CLASS_SERIAL_USB_OHCI && !node)
+ dev->resource[0].flags = 0;
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_APPLE, PCI_ANY_ID, pmac_pci_fixup_ohci);
+
/* We power down some devices after they have been probed. They'll
* be powered back on later on
*/
@@ -1171,7 +1182,6 @@ void __init pmac_pcibios_after_init(void
of_node_put(nd);
}
-#ifdef CONFIG_PPC32
void pmac_pci_fixup_cardbus(struct pci_dev* dev)
{
if (!machine_is(powermac))
@@ -1259,7 +1269,7 @@ void pmac_pci_fixup_pciata(struct pci_de
}
}
DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, pmac_pci_fixup_pciata);
-#endif
+#endif /* CONFIG_PPC32 */
/*
* Disable second function on K2-SATA, it's broken
next prev parent reply other threads:[~2007-12-14 4:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-14 4:56 [PATCH 0/15] [POWERPC] PCI updates & merges Benjamin Herrenschmidt
2007-12-14 4:56 ` [PATCH 1/15] [POWERPC] pci32: remove bogus alignment message Benjamin Herrenschmidt
2007-12-14 4:56 ` [PATCH 2/15] [POWERPC] pci32: use generic pci_assign_unassign_resources Benjamin Herrenschmidt
2007-12-14 4:56 ` [PATCH 3/15] [POWERPC] pci32: Remove PowerMac P2P bridge IO hack Benjamin Herrenschmidt
2007-12-14 4:56 ` [PATCH 4/15] [POWERPC] pci32: Add flags modifying the PCI code behaviour Benjamin Herrenschmidt
2007-12-14 8:43 ` Olof Johansson
2007-12-14 9:00 ` Benjamin Herrenschmidt
2007-12-14 4:56 ` [PATCH 5/15] [POWERPC] pci32: Remove obsolete PowerMac bus number hack Benjamin Herrenschmidt
2007-12-14 4:56 ` [PATCH 6/15] [POWERPC] pci32: Add platform option to enable /proc PCI domains Benjamin Herrenschmidt
2007-12-14 4:56 ` [PATCH 8/15] [POWERPC] Merge PCI resource fixups Benjamin Herrenschmidt
2007-12-14 4:56 ` [PATCH 7/15] [POWERPC] Merge pcibios_resource_to_bus/bus_to_resource Benjamin Herrenschmidt
2007-12-14 4:56 ` [PATCH 9/15] [POWERPC] Merge PCI resource allocation & assignment Benjamin Herrenschmidt
2007-12-14 4:56 ` [PATCH 11/15] [POWERPC] Updates/fixes to 32 bits pcibios_enable_device() Benjamin Herrenschmidt
2007-12-14 4:56 ` [PATCH 10/15] [POWERPC] fix iSeries PCI resource management Benjamin Herrenschmidt
2007-12-14 4:56 ` [PATCH 12/15] [POWERPC] Merge 32 and 64 bits pcibios_enable_device Benjamin Herrenschmidt
2007-12-14 4:56 ` Benjamin Herrenschmidt [this message]
2007-12-14 4:56 ` [PATCH 14/15] [POWERPC] Clear pci_probe_only on 64 bits PowerMac Benjamin Herrenschmidt
2007-12-14 4:56 ` [PATCH 15/15] [POWERPC] Various fixes to pcibios_enable_device() Benjamin Herrenschmidt
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=20071214045620.734F0DE702@ozlabs.org \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).