public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* PCI question
@ 2004-02-03 22:35 Pat Gefre
  2004-02-03 22:56 ` Matthew Wilcox
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Pat Gefre @ 2004-02-03 22:35 UTC (permalink / raw)
  To: linux-ia64



The usage of pci_dev.sysdata is a bit confusing to me. I had initially
thought that this was available for any system specific use,  but then
in pcibios_fixup_device_resources() it is specifically cast as a struct
pci_controller *:

#define PCI_CONTROLLER(busdev) ((struct pci_controller *) busdev->sysdata)

void __init
pcibios_fixup_device_resources (struct pci_dev *dev, struct pci_bus *bus)
{
   struct pci_controller *controller = PCI_CONTROLLER(dev);

In this funtion  the pci_controller elements 'window[]' and 'windows'
are also used.  This implies to me that these fields must be maintained
in any system specific structure ? i.e.

struct my_sysdata_struct {
   struct pci_controller dummy;
   /* my stuff would go here */
   struct my_real_sysdata_stuff;
};

Yet I don't see where anyone else is doing the above. Am I missing
something obvious ??

Thanks,
-- Pat


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PCI question
  2004-02-03 22:35 PCI question Pat Gefre
@ 2004-02-03 22:56 ` Matthew Wilcox
  2004-02-03 23:15 ` Patrick Gefre
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Matthew Wilcox @ 2004-02-03 22:56 UTC (permalink / raw)
  To: linux-ia64

On Tue, Feb 03, 2004 at 04:35:26PM -0600, Pat Gefre wrote:
> The usage of pci_dev.sysdata is a bit confusing to me. I had initially
> thought that this was available for any system specific use,  but then
> in pcibios_fixup_device_resources() it is specifically cast as a struct
> pci_controller *:

It's up to the architecture how it's used.  ia64 has decided that it
shall be a struct pci_controller *.

> In this funtion  the pci_controller elements 'window[]' and 'windows'
> are also used.  This implies to me that these fields must be maintained
> in any system specific structure ? i.e.
> 
> struct my_sysdata_struct {
>    struct pci_controller dummy;
>    /* my stuff would go here */
>    struct my_real_sysdata_stuff;
> };
> 
> Yet I don't see where anyone else is doing the above. Am I missing
> something obvious ??

Urgh, don't do that.  What do you need to do that can't be added to the
pci_controller?

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PCI question
  2004-02-03 22:35 PCI question Pat Gefre
  2004-02-03 22:56 ` Matthew Wilcox
@ 2004-02-03 23:15 ` Patrick Gefre
  2004-02-03 23:29 ` Jesse Barnes
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Patrick Gefre @ 2004-02-03 23:15 UTC (permalink / raw)
  To: linux-ia64

Matthew Wilcox wrote:

>On Tue, Feb 03, 2004 at 04:35:26PM -0600, Pat Gefre wrote:
>  
>
>>The usage of pci_dev.sysdata is a bit confusing to me. I had initially
>>thought that this was available for any system specific use,  but then
>>in pcibios_fixup_device_resources() it is specifically cast as a struct
>>pci_controller *:
>>    
>>
>
>It's up to the architecture how it's used.  ia64 has decided that it
>shall be a struct pci_controller *.
>
>  
>
>>In this funtion  the pci_controller elements 'window[]' and 'windows'
>>are also used.  This implies to me that these fields must be maintained
>>in any system specific structure ? i.e.
>>
>>struct my_sysdata_struct {
>>   struct pci_controller dummy;
>>   /* my stuff would go here */
>>   struct my_real_sysdata_stuff;
>>};
>>
>>Yet I don't see where anyone else is doing the above. Am I missing
>>something obvious ??
>>    
>>
>
>Urgh, don't do that.  What do you need to do that can't be added to the
>pci_controller?
>
>  
>
OK- good - thanks. Yes the other option is to add it to the 
pci_controller struct.

-- Pat



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PCI question
  2004-02-03 22:35 PCI question Pat Gefre
  2004-02-03 22:56 ` Matthew Wilcox
  2004-02-03 23:15 ` Patrick Gefre
@ 2004-02-03 23:29 ` Jesse Barnes
  2004-02-03 23:36 ` Patrick Gefre
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Jesse Barnes @ 2004-02-03 23:29 UTC (permalink / raw)
  To: linux-ia64

On Tue, Feb 03, 2004 at 05:15:44PM -0600, Patrick Gefre wrote:
> >Urgh, don't do that.  What do you need to do that can't be added to the
> >pci_controller?
>
> OK- good - thanks. Yes the other option is to add it to the 
> pci_controller struct.

Add what?  How about pci_controller->platform_data?  That's private to
the subarch, right?

Jesse

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PCI question
  2004-02-03 22:35 PCI question Pat Gefre
                   ` (2 preceding siblings ...)
  2004-02-03 23:29 ` Jesse Barnes
@ 2004-02-03 23:36 ` Patrick Gefre
  2004-02-04  3:28 ` Jesse Barnes
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Patrick Gefre @ 2004-02-03 23:36 UTC (permalink / raw)
  To: linux-ia64

Jesse Barnes wrote:

>On Tue, Feb 03, 2004 at 05:15:44PM -0600, Patrick Gefre wrote:
>  
>
>>>Urgh, don't do that.  What do you need to do that can't be added to the
>>>pci_controller?
>>>      
>>>
>>OK- good - thanks. Yes the other option is to add it to the 
>>pci_controller struct.
>>    
>>
>
>Add what?  How about pci_controller->platform_data?  That's private to
>the subarch, right?
>
>Jesse
>  
>
But not in 2.6 ??

struct pci_controller {
        void *acpi_handle;
        void *iommu;
        int segment;

        unsigned int windows;
        struct pci_window *window;
};



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PCI question
  2004-02-03 22:35 PCI question Pat Gefre
                   ` (3 preceding siblings ...)
  2004-02-03 23:36 ` Patrick Gefre
@ 2004-02-04  3:28 ` Jesse Barnes
  2004-02-04 17:04 ` Patrick Gefre
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Jesse Barnes @ 2004-02-04  3:28 UTC (permalink / raw)
  To: linux-ia64

On Tue, Feb 03, 2004 at 05:36:53PM -0600, Patrick Gefre wrote:
> But not in 2.6 ??
> 
> struct pci_controller {
>        void *acpi_handle;
>        void *iommu;
>        int segment;
> 
>        unsigned int windows;
>        struct pci_window *window;
> };

Oops, I was looking at a 2.4 tree.  I wonder if we can overload
acpi_handle for our purposes though?  Since we don't have an ACPI
namespace, we obviously don't store things like the bridge base address
and PIO mapping information there, so we may be able to make this field
point to an sn2 specific structure that contains this info (I'm assuming
that's what we need).

What else do we need to keep track of?  The PCI to node mapping should
be stored seperately (I think mkp had a patch to implement that), but
I'm sure there are other things I'm missing...

Thanks,
Jesse

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PCI question
  2004-02-03 22:35 PCI question Pat Gefre
                   ` (4 preceding siblings ...)
  2004-02-04  3:28 ` Jesse Barnes
@ 2004-02-04 17:04 ` Patrick Gefre
  2004-02-04 17:48 ` Grant Grundler
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Patrick Gefre @ 2004-02-04 17:04 UTC (permalink / raw)
  To: linux-ia64

Jesse Barnes wrote:

>On Tue, Feb 03, 2004 at 05:36:53PM -0600, Patrick Gefre wrote:
>  
>
>>But not in 2.6 ??
>>
>>struct pci_controller {
>>       void *acpi_handle;
>>       void *iommu;
>>       int segment;
>>
>>       unsigned int windows;
>>       struct pci_window *window;
>>};
>>    
>>
>
>Oops, I was looking at a 2.4 tree.  I wonder if we can overload
>acpi_handle for our purposes though?  Since we don't have an ACPI
>namespace, we obviously don't store things like the bridge base address
>and PIO mapping information there, so we may be able to make this field
>point to an sn2 specific structure that contains this info (I'm assuming
>that's what we need).
>
>What else do we need to keep track of?  The PCI to node mapping should
>be stored seperately (I think mkp had a patch to implement that), but
>I'm sure there are other things I'm missing...
>
>Thanks,
>Jesse
>  
>
I think the 2.4 definition will be fine - at least for now. Was there a 
reason it was changed in 2.6 ?

2.4 definition:
struct pci_controller {
        void *acpi_handle;
        void *iommu;
        int segment;

        unsigned int windows;
        struct pci_window *window;

        void *platform_data;
};


-- Pat


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PCI question
  2004-02-03 22:35 PCI question Pat Gefre
                   ` (5 preceding siblings ...)
  2004-02-04 17:04 ` Patrick Gefre
@ 2004-02-04 17:48 ` Grant Grundler
  2004-02-04 19:10 ` Patrick Gefre
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Grant Grundler @ 2004-02-04 17:48 UTC (permalink / raw)
  To: linux-ia64

On Wed, Feb 04, 2004 at 11:04:42AM -0600, Patrick Gefre wrote:
> I think the 2.4 definition will be fine - at least for now. Was there a 
> reason it was changed in 2.6 ?

Because no one was using it?

Pat,
two (three?) people have asked you to state what you want to add.
Can you state the basic problem additional data fields would solve?

It might be easier to just add those fields directly to pci_controller
instead of messing with platform_data.

grant

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PCI question
  2004-02-03 22:35 PCI question Pat Gefre
                   ` (6 preceding siblings ...)
  2004-02-04 17:48 ` Grant Grundler
@ 2004-02-04 19:10 ` Patrick Gefre
  2004-02-04 19:50 ` Bjorn Helgaas
  2004-02-05 17:11 ` Patrick Gefre
  9 siblings, 0 replies; 11+ messages in thread
From: Patrick Gefre @ 2004-02-04 19:10 UTC (permalink / raw)
  To: linux-ia64

Grant Grundler wrote:

>On Wed, Feb 04, 2004 at 11:04:42AM -0600, Patrick Gefre wrote:
>  
>
>>I think the 2.4 definition will be fine - at least for now. Was there a 
>>reason it was changed in 2.6 ?
>>    
>>
>
>Because no one was using it?
>
>Pat,
>two (three?) people have asked you to state what you want to add.
>Can you state the basic problem additional data fields would solve?
>
>It might be easier to just add those fields directly to pci_controller
>instead of messing with platform_data.
>
>grant
>  
>
We keep track of several things that are specific to our system:

struct sn_device_sysdata {
        vertex_hdl_t            vhdl;
        pciio_provider_t        *pci_provider;
        pciio_intr_t            intr_handle;
        struct sn_flush_device_list *dma_flush_list;
        pciio_piomap_t          pio_map[PCI_ROM_RESOURCE];
};

The platform_data element is what we use in 2.4 and seems like the way 
to go for 2.6.

-- Pat


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PCI question
  2004-02-03 22:35 PCI question Pat Gefre
                   ` (7 preceding siblings ...)
  2004-02-04 19:10 ` Patrick Gefre
@ 2004-02-04 19:50 ` Bjorn Helgaas
  2004-02-05 17:11 ` Patrick Gefre
  9 siblings, 0 replies; 11+ messages in thread
From: Bjorn Helgaas @ 2004-02-04 19:50 UTC (permalink / raw)
  To: linux-ia64

On Wednesday 04 February 2004 12:10 pm, Patrick Gefre wrote:
> We keep track of several things that are specific to our system:
> 
> struct sn_device_sysdata {
>         vertex_hdl_t            vhdl;
>         pciio_provider_t        *pci_provider;
>         pciio_intr_t            intr_handle;
>         struct sn_flush_device_list *dma_flush_list;
>         pciio_piomap_t          pio_map[PCI_ROM_RESOURCE];
> };
> 
> The platform_data element is what we use in 2.4 and seems like the way 
> to go for 2.6.

If you make yourself a macro to go from a pci_dev to sn_device_sysdata,
you can make your code independent of where the SGI-specific stuff
actually lives.  Probably you already do that.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PCI question
  2004-02-03 22:35 PCI question Pat Gefre
                   ` (8 preceding siblings ...)
  2004-02-04 19:50 ` Bjorn Helgaas
@ 2004-02-05 17:11 ` Patrick Gefre
  9 siblings, 0 replies; 11+ messages in thread
From: Patrick Gefre @ 2004-02-05 17:11 UTC (permalink / raw)
  To: linux-ia64

Greg KH wrote:

>On Tue, Feb 03, 2004 at 04:27:09PM -0600, Patrick Gefre wrote:
>  
>
>>The usage of pci_dev.sysdata is a bit confusing to me. I had initially
>>thought that this was available for any system specific use,  but then
>>in pcibios_fixup_device_resources() it is specifically cast as a
>>struct pci_controller *:
>>
>>#define PCI_CONTROLLER(busdev) ((struct pci_controller *) busdev->sysdata)
>>
>>void __init
>>pcibios_fixup_device_resources (struct pci_dev *dev, struct pci_bus *bus)
>>    
>>
>
>What kernel are you looking at?  I don't see either of the above in the
>2.6.2 kernel tree.
>
>thanks,
>
>greg k-h
>  
>
In my bitkeeper tree : (bk parent: http://linux.bkbits.net/linux-2.5)

include/asm-ia64/pci.h:
#define PCI_CONTROLLER(busdev) ((struct pci_controller *) busdev->sysdata)

arch/ia64/pci/pci.c:
void __init
pcibios_fixup_device_resources (struct pci_dev *dev, struct pci_bus *bus)

Is there some ia64 patch I'm missing that removes this ?

-- Pat



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-02-05 17:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-03 22:35 PCI question Pat Gefre
2004-02-03 22:56 ` Matthew Wilcox
2004-02-03 23:15 ` Patrick Gefre
2004-02-03 23:29 ` Jesse Barnes
2004-02-03 23:36 ` Patrick Gefre
2004-02-04  3:28 ` Jesse Barnes
2004-02-04 17:04 ` Patrick Gefre
2004-02-04 17:48 ` Grant Grundler
2004-02-04 19:10 ` Patrick Gefre
2004-02-04 19:50 ` Bjorn Helgaas
2004-02-05 17:11 ` Patrick Gefre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox