From: "Keshavamurthy, Anil S" <anil.s.keshavamurthy@intel.com>
To: Paul Mackerras <paulus@samba.org>, muli@il.ibm.com
Cc: "Keshavamurthy, Anil S" <anil.s.keshavamurthy@intel.com>,
akpm@osdl.org, Greg KH <greg@kroah.com>,
Linux Kernel <linux-kernel@vger.kernel.org>,
kristen.c.accardi@intel.com
Subject: Re: [RFC][Intel-IOMMU] Fix for IOMMU early crash
Date: Tue, 11 Sep 2007 10:42:31 -0700 [thread overview]
Message-ID: <20070911174231.GC24627@askeshav-devel.jf.intel.com> (raw)
In-Reply-To: <18148.12140.21118.252581@cargo.ozlabs.ibm.com>
On Mon, Sep 10, 2007 at 03:37:48AM +1000, Paul Mackerras wrote:
> Keshavamurthy, Anil S writes:
>
> > Subject: [RFC][Intel-IOMMU] Fix for IOMMU early crash
> >
> > Populating pci_bus->sysdata way early in the pci discovery phase
> > sets NON-NULL value to pci_dev->sysdata which breaks the assumption
> > in the Intel IOMMU driver and crashes the system.
> >
> >
> > In the drivers/pci/probe.c, pci_dev->sysdata gets a copy of
> > its pci_bus->sysdata which is not required as
> > the same can be obtained from pci_dev->bus->sysdata. More over
> > the left hand assignment of pci_dev->sysdata is never being used,
>
> Wrong. You needed to grep a bit more widely...
Ah..Thanks for pointing this out. sorry I had checked only i386 and x86_64.
>
> > so their is no point is setting
> > pci_dev->sysdata = pci_bus->sysdata;
> >
> > This patch removes sysdata from pci_dev struct and creates a new
> > field called sys_data which is exclusively used
> > by IOMMU driver to keep its per device context pointer.
>
> This will break powerpc, because we use the pci_dev->sysdata field to
> point to a firmware device tree node. Please figure out another way
> to solve your problem.
Yes, I agree that pci_dev->sysdata can;t be removed. Even we (IOMMU)
were dependent on this field but somehow this field is being overwritten
to point to pci_bus's->sysdata and hence IOMMU was failing. Earlier
it was overwritten to NULL and hence we were not failing but now it
is overwritten to non-NULL and hence we fail.
My therory is that we don;t need to copy pci_bus's->sysdata to
pci_dev's->sysdata. Below patch solves my problem.
Any objection to below patch?
---
drivers/pci/hotplug/fakephp.c | 1 -
drivers/pci/probe.c | 1 -
2 files changed, 2 deletions(-)
Index: work/drivers/pci/hotplug/fakephp.c
===================================================================
--- work.orig/drivers/pci/hotplug/fakephp.c 2007-09-11 10:29:30.000000000 -0700
+++ work/drivers/pci/hotplug/fakephp.c 2007-09-11 10:35:22.000000000 -0700
@@ -243,7 +243,6 @@
return;
dev->bus = (struct pci_bus*)bus;
- dev->sysdata = bus->sysdata;
for (devfn = 0; devfn < 0x100; devfn += 8) {
dev->devfn = devfn;
pci_rescan_slot(dev);
Index: work/drivers/pci/probe.c
===================================================================
--- work.orig/drivers/pci/probe.c 2007-09-11 10:29:30.000000000 -0700
+++ work/drivers/pci/probe.c 2007-09-11 10:35:22.000000000 -0700
@@ -994,7 +994,6 @@
return NULL;
dev->bus = bus;
- dev->sysdata = bus->sysdata;
dev->dev.parent = bus->bridge;
dev->dev.bus = &pci_bus_type;
dev->devfn = devfn;
next prev parent reply other threads:[~2007-09-10 17:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-08 20:05 [RFC][Intel-IOMMU] Fix for IOMMU early crash Keshavamurthy, Anil S
2007-09-09 11:16 ` Muli Ben-Yehuda
2007-09-10 15:43 ` Keshavamurthy, Anil S
2007-09-09 17:51 ` Muli Ben-Yehuda
2007-09-11 17:22 ` Keshavamurthy, Anil S
2007-09-09 17:37 ` Paul Mackerras
2007-09-11 17:42 ` Keshavamurthy, Anil S [this message]
2007-09-10 20:25 ` Muli Ben-Yehuda
2007-09-11 20:43 ` Keshavamurthy, Anil S
2007-09-12 19:28 ` [patch][Intel-IOMMU] " Keshavamurthy, Anil S
2007-09-11 19:48 ` Paul Mackerras
2007-09-12 21:55 ` Keshavamurthy, Anil S
2007-09-11 22:05 ` [BUG:] forcedeth: MCP55 not allowing DHCP Casey Dahlin
2007-09-18 1:59 ` Casey Dahlin
2007-09-13 1:29 ` [patch][Intel-IOMMU] Fix for IOMMU early crash Keshavamurthy, Anil S
2007-09-14 16:30 ` Paul Mackerras
2007-09-25 17:07 ` Keshavamurthy, Anil S
2007-10-03 21:13 ` [patch take 2][Intel-IOMMU] " Keshavamurthy, Anil S
2007-10-04 1:19 ` Benjamin Herrenschmidt
2007-10-04 1:36 ` Keshavamurthy, Anil S
2007-10-04 3:39 ` Benjamin Herrenschmidt
2007-10-04 19:20 ` Keshavamurthy, Anil S
2007-10-05 3:08 ` 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=20070911174231.GC24627@askeshav-devel.jf.intel.com \
--to=anil.s.keshavamurthy@intel.com \
--cc=akpm@osdl.org \
--cc=greg@kroah.com \
--cc=kristen.c.accardi@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=muli@il.ibm.com \
--cc=paulus@samba.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