Re: pdev_enable_device no longer used ?

From: Gérard Roudier (groudier@club-internet.fr)
Date: Mon Dec 11 2000 - 17:07:01 EST


On Mon, 11 Dec 2000, David S. Miller wrote:

> Date: Mon, 11 Dec 2000 22:30:59 +0100 (CET)
> From: Gérard Roudier <groudier@club-internet.fr>
>
> On Mon, 11 Dec 2000, David S. Miller wrote:
>
> > Really, in 2.4.x sparc64 requires PCI config space hackery no longer.
>
> Really?
>
> I was thinking about the pcivtophys() alias bus_dvma_to_mem() hackery used
> to retrieve the actual BAR address from the so-called pcidev bar cookies.
>
> Really :-) This conversation was about drivers making modifications
> to PCI config space areas which are being argued to be only modified
> by arch-specific PCI support layers. That is the context in which
> I made my statements.

Was more general in my opinion. :-)

> Interpreting physical BAR values is another issue altogether. Kernel
> wide interfaces for this may be easily added to include/asm/pci.h
> infrastructure, please just choose some sane name for it and I will
> compose a patch ok? :-)

Really? :-)

It is the bar cookies in pci dev structure that are insane, in my opinion.

If a driver needs BARs values, it needs actual BARs values and not some
stinking cookies. What a driver can do with BAR cookies other than using
them as band-aid for dubiously designed kernel interface.

BUT, a driver does not care about handles passed to read*/write* and
friends and should not have to care. Using cookies, handle or tag or
whatever means 'user should not worry about but just pass them when
needed' is good here.

So, if you want to fix this insane PCI interface:

1) Provide the _actual_ BARs values in the pci dev structure, otherwise
   drivers that need them will have to deal with ugly hackery or access
   explicitely the PCI configuration space.

2) Provide an interface that accepts the PCI dev and the BAR offset as
   input and that return somes cookie for read*/write* interface.
       GiveMeSomeCookieForMmIo(pcidev, bar_offset).

  Gérard.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Dec 15 2000 - 21:00:22 EST