tech-kern archive

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

Re: take 2: MI overrides of bus_dma(9), bus_space(9), pci(9)



On Thursday 08 April 2010 15:48:47 David Young wrote:
> On Thu, Apr 08, 2010 at 09:15:38AM +0200, Hans Petter Selasky wrote:
> > On Thursday 08 April 2010 02:10:28 David Young wrote:
> > > I would like for MI drivers to be able to override pci(9),
> > > bus_space(9), and bus_dma(9) behavior for the purpose of handling
> > > exceptions, managing bus resources, creating test harnesses, and
> > > counting events.
> > >
> > > Matt Thomas nudged me in some private discussions to leave MD the
> > > bus_space_tag_t and pci_chipset_tag_t, instead of embedding an MI tag,
> > > and to let each architecture provide its own implementation of an
> > > MI override functions for bus_space(9) and pci(9).  Matt powerfully
> > > influenced the look of the override API.
> >
> > Hi,
> >
> > If for example a PCI device is behind an USB interface, should the bus
> > space methods take a mutex argument to allow sleeping which is due to the
> > fact that USB cannot complete the I/O operation immediately?
> 
> bus_space_read_4() and family are called from interrupt context, where
> sleeping is not allowed.  I suppose that if the kernel can initiate
> USB requests from interrupt context, and if the USB host controller
> interrupts occur at a higher priority than any PCI interrupt handler,
> bus_space_read_4() could spin-wait for a read to complete.  Would it
> even be worth the trouble to make it work?
> 
> Does a USB-to-PCI bridge exist?

Hi,

I think that exists, but I guess you are right it might not be worth the work.

--HPS


Home | Main Index | Thread Index | Old Index