mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Linus Torvalds <torvalds@osdl.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	Dan Burcaw <dburcaw@terrasoftsolutions.com>
Subject: [PATCH] g5: Fix iommu vs. pci_device_to_OF_node
Date: Tue, 16 Mar 2004 17:46:04 +1100	[thread overview]
Message-ID: <1079419564.1966.235.camel@gaston> (raw)

Hi !

The g5 iommu code would fill the "iommu_table" member of whatever
device node was pointed to by pcidev->sysdata during boot. However,
the ppc64 kernel fills that with a pointer to the PHB node which is
later replaced "lazily" with a pointer to the real node when calling
pci_device_to_OF_node(). In this case, we were thus "losign" the
iommu_table pointer. Typical symptom: loss of the SATA when looking
at it's /proc entry.

This fixes it by forcing the update to the final sysdata pointer
when filling up the iommu_table pointers. The "lazy" thing is useless
on pmac anyway.

Please apply,
Ben.

===== arch/ppc64/kernel/pmac_iommu.c 1.1 vs edited =====
--- 1.1/arch/ppc64/kernel/pmac_iommu.c	Sat Feb 28 09:44:57 2004
+++ edited/arch/ppc64/kernel/pmac_iommu.c	Tue Mar 16 17:45:10 2004
@@ -289,8 +289,11 @@
 	 * things simple. Setup all PCI devices to point to this table
 	 */
 	while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
-		dn = PCI_GET_DN(dev);
-
+		/* We must use pci_device_to_OF_node() to make sure that
+		 * we get the real "final" pointer to the device in the
+		 * pci_dev sysdata and not the temporary PHB one
+		 */
+		struct device_node *dn = pci_device_to_OF_node(dev);
 		if (dn)
 			dn->iommu_table = &iommu_table_pmac;
 	}



                 reply	other threads:[~2004-03-16  9:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1079419564.1966.235.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=dburcaw@terrasoftsolutions.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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

all inboxes | Powered by JetHome®