tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [patch] PCI memory & i/o enables



On Fri, Apr 08, 2011 at 06:38:19PM +0000, Eduardo Horvath wrote:
> On Fri, 8 Apr 2011, David Young wrote:
> 
> > Here is a patch that changes the way that the PCI subsystem and drivers
> > use PCI_FLAGS_IO_ENABLED and PCI_FLAGS_MEM_ENABLED.  I went ahead and
> > renamed the flags in order to poison old-fashioned uses.  Now they're
> > called PCI_FLAGS_IO_OKAY and PCI_FLAGS_MEM_OKAY.
> > 
> > For simplicity's sake, I'll just write of PCI_FLAGS_IO_ENABLED, below,
> > but the same discussion applies to PCI_FLAGS_MEM_ENABLED.
> > 
> > Traditionally, if PCI_FLAGS_IO_ENABLED is set in the
> > pci_attach_args.pa_flags, it tells a PCI device driver, "the bridges
> > upstream forward PCI I/O transactions to this device, *and* I/O
> > transactions are enabled in the device's PCI CSR."  Some drivers,
> > finding that neither PCI_FLAGS_IO_ENABLED nor the corresponding PCI CSR
> > bit is set set both pa_flags and the CSR themselves.  Those drivers
> > assume that the upstream bridges are forwarding I/O transactions, which
> > may or may not be true.  They have to assume, though, because the
> > information in pa_flags is not specific.
> > 
> > My patch makes the PCI_FLAGS_IO_OKAY condition more specific: it tells a
> > PCI device driver, "the bridges upstream forward PCI I/O transactions to
> > this device".  If the flag isn't set, the driver has no business setting
> > it.  Also, if the flag isn't set, there's not much use in the driver
> > setting the corresponding bit in the PCI CSR.
> 
> It looks like you're renaming constants.  What is the functional change 
> here other than renaming things?  What happens to drivers that use the old 
> *IO_ENABLED flags?  What are you trying to accomplish here?

The functional change is that drivers such as chipsfb, machfb, and
viaide will not finish attaching if the bridge is not configured in the
way that they require for it to be.  Right now, those drivers pretend
as if they can make up for PCI bus-bridge misconfiguration by modifying
pa_flags, but they cannot.

This change will require a kernel ABI version bump.  After the bump, old
driver modules will not load.  Drivers that use the old constants will
not compile.

Dave

-- 
David Young             OJC Technologies
dyoung%ojctech.com@localhost      Urbana, IL * (217) 344-0444 x24


Home | Main Index | Thread Index | Old Index