All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] pci: pass bridge update to secondary bus
@ 2010-07-06 11:23 Michael S. Tsirkin
  2010-07-07  2:04 ` [Qemu-devel] " Isaku Yamahata
  2010-07-07 17:31 ` [Qemu-devel] " Blue Swirl
  0 siblings, 2 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2010-07-06 11:23 UTC (permalink / raw)
  To: yamahata, qemu-devel

bridge config write should trigger updates
on the secondary bus. never on the primary bus.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---

Compile-tested only.
Isaku Yamahata, could you review this please?
You wrote the code, and you seem to have some bridged setups.

 hw/pci.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/hw/pci.c b/hw/pci.c
index 926cf63..011d83e 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -1513,7 +1513,9 @@ static void pci_bridge_write_config(PCIDevice *d,
         /* memory base/limit, prefetchable base/limit and
            io base/limit upper 16 */
         ranges_overlap(address, len, PCI_MEMORY_BASE, 20)) {
-        pci_bridge_update_mappings(d->bus);
+        PCIBridge *s = container_of(d, PCIBridge, dev);
+        PCIBus *secondary_bus = &s->bus;
+        pci_bridge_update_mappings(secondary_bus);
     }
 }
 
-- 
1.7.2.rc0.14.g41c1c

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

* [Qemu-devel] Re: [PATCH] pci: pass bridge update to secondary bus
  2010-07-06 11:23 [Qemu-devel] [PATCH] pci: pass bridge update to secondary bus Michael S. Tsirkin
@ 2010-07-07  2:04 ` Isaku Yamahata
  2010-07-08 13:25   ` Michael S. Tsirkin
  2010-07-07 17:31 ` [Qemu-devel] " Blue Swirl
  1 sibling, 1 reply; 5+ messages in thread
From: Isaku Yamahata @ 2010-07-07  2:04 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: qemu-devel

On Tue, Jul 06, 2010 at 02:23:27PM +0300, Michael S. Tsirkin wrote:
> bridge config write should trigger updates
> on the secondary bus. never on the primary bus.
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> 
> Compile-tested only.
> Isaku Yamahata, could you review this please?
> You wrote the code, and you seem to have some bridged setups.

The code looks good.

Should PCIBridge::bus be renamed to something like
PCIBridge::secondary_bus (or sec_bus for short) in order
to avoid confusion?
The redundant local variable, secondary_bus, was deliberately
introduced to emphasize that it's a secondary bus.
And I was confused by that.
Anyway such a change should be done by another patch.

> 
>  hw/pci.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/pci.c b/hw/pci.c
> index 926cf63..011d83e 100644
> --- a/hw/pci.c
> +++ b/hw/pci.c
> @@ -1513,7 +1513,9 @@ static void pci_bridge_write_config(PCIDevice *d,
>          /* memory base/limit, prefetchable base/limit and
>             io base/limit upper 16 */
>          ranges_overlap(address, len, PCI_MEMORY_BASE, 20)) {
> -        pci_bridge_update_mappings(d->bus);
> +        PCIBridge *s = container_of(d, PCIBridge, dev);
> +        PCIBus *secondary_bus = &s->bus;
> +        pci_bridge_update_mappings(secondary_bus);
>      }
>  }
>  
> -- 
> 1.7.2.rc0.14.g41c1c
> 

-- 
yamahata

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

* Re: [Qemu-devel] [PATCH] pci: pass bridge update to secondary bus
  2010-07-06 11:23 [Qemu-devel] [PATCH] pci: pass bridge update to secondary bus Michael S. Tsirkin
  2010-07-07  2:04 ` [Qemu-devel] " Isaku Yamahata
@ 2010-07-07 17:31 ` Blue Swirl
  2010-07-07 17:36   ` Michael S. Tsirkin
  1 sibling, 1 reply; 5+ messages in thread
From: Blue Swirl @ 2010-07-07 17:31 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: yamahata, qemu-devel

On Tue, Jul 6, 2010 at 11:23 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> bridge config write should trigger updates
> on the secondary bus. never on the primary bus.

If this is true, shouldn't updates happen on all buses from secondary
to subordinate? Do we know which of these are immediately below
primary bus?

>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>
> Compile-tested only.
> Isaku Yamahata, could you review this please?
> You wrote the code, and you seem to have some bridged setups.
>
>  hw/pci.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/hw/pci.c b/hw/pci.c
> index 926cf63..011d83e 100644
> --- a/hw/pci.c
> +++ b/hw/pci.c
> @@ -1513,7 +1513,9 @@ static void pci_bridge_write_config(PCIDevice *d,
>         /* memory base/limit, prefetchable base/limit and
>            io base/limit upper 16 */
>         ranges_overlap(address, len, PCI_MEMORY_BASE, 20)) {
> -        pci_bridge_update_mappings(d->bus);
> +        PCIBridge *s = container_of(d, PCIBridge, dev);
> +        PCIBus *secondary_bus = &s->bus;
> +        pci_bridge_update_mappings(secondary_bus);
>     }
>  }
>
> --
> 1.7.2.rc0.14.g41c1c
>
>

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

* Re: [Qemu-devel] [PATCH] pci: pass bridge update to secondary bus
  2010-07-07 17:31 ` [Qemu-devel] " Blue Swirl
@ 2010-07-07 17:36   ` Michael S. Tsirkin
  0 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2010-07-07 17:36 UTC (permalink / raw)
  To: Blue Swirl; +Cc: yamahata, qemu-devel

On Wed, Jul 07, 2010 at 05:31:39PM +0000, Blue Swirl wrote:
> On Tue, Jul 6, 2010 at 11:23 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> > bridge config write should trigger updates
> > on the secondary bus. never on the primary bus.
> 
> If this is true, shouldn't updates happen on all buses from secondary
> to subordinate? Do we know which of these are immediately below
> primary bus?

pci_bridge_update_mappings does this already.

> >
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> >
> > Compile-tested only.
> > Isaku Yamahata, could you review this please?
> > You wrote the code, and you seem to have some bridged setups.
> >
> >  hw/pci.c |    4 +++-
> >  1 files changed, 3 insertions(+), 1 deletions(-)
> >
> > diff --git a/hw/pci.c b/hw/pci.c
> > index 926cf63..011d83e 100644
> > --- a/hw/pci.c
> > +++ b/hw/pci.c
> > @@ -1513,7 +1513,9 @@ static void pci_bridge_write_config(PCIDevice *d,
> >         /* memory base/limit, prefetchable base/limit and
> >            io base/limit upper 16 */
> >         ranges_overlap(address, len, PCI_MEMORY_BASE, 20)) {
> > -        pci_bridge_update_mappings(d->bus);
> > +        PCIBridge *s = container_of(d, PCIBridge, dev);
> > +        PCIBus *secondary_bus = &s->bus;
> > +        pci_bridge_update_mappings(secondary_bus);
> >     }
> >  }
> >
> > --
> > 1.7.2.rc0.14.g41c1c
> >
> >

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

* [Qemu-devel] Re: [PATCH] pci: pass bridge update to secondary bus
  2010-07-07  2:04 ` [Qemu-devel] " Isaku Yamahata
@ 2010-07-08 13:25   ` Michael S. Tsirkin
  0 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2010-07-08 13:25 UTC (permalink / raw)
  To: Isaku Yamahata; +Cc: qemu-devel

On Wed, Jul 07, 2010 at 11:04:51AM +0900, Isaku Yamahata wrote:
> On Tue, Jul 06, 2010 at 02:23:27PM +0300, Michael S. Tsirkin wrote:
> > bridge config write should trigger updates
> > on the secondary bus. never on the primary bus.
> > 
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> > 
> > Compile-tested only.
> > Isaku Yamahata, could you review this please?
> > You wrote the code, and you seem to have some bridged setups.
> 
> The code looks good.
> 
> Should PCIBridge::bus be renamed to something like
> PCIBridge::secondary_bus (or sec_bus for short) in order
> to avoid confusion?
> The redundant local variable, secondary_bus, was deliberately
> introduced to emphasize that it's a secondary bus.
> And I was confused by that.
> Anyway such a change should be done by another patch.

Sure. Send a patch.

> > 
> >  hw/pci.c |    4 +++-
> >  1 files changed, 3 insertions(+), 1 deletions(-)
> > 
> > diff --git a/hw/pci.c b/hw/pci.c
> > index 926cf63..011d83e 100644
> > --- a/hw/pci.c
> > +++ b/hw/pci.c
> > @@ -1513,7 +1513,9 @@ static void pci_bridge_write_config(PCIDevice *d,
> >          /* memory base/limit, prefetchable base/limit and
> >             io base/limit upper 16 */
> >          ranges_overlap(address, len, PCI_MEMORY_BASE, 20)) {
> > -        pci_bridge_update_mappings(d->bus);
> > +        PCIBridge *s = container_of(d, PCIBridge, dev);
> > +        PCIBus *secondary_bus = &s->bus;
> > +        pci_bridge_update_mappings(secondary_bus);
> >      }
> >  }
> >  
> > -- 
> > 1.7.2.rc0.14.g41c1c
> > 
> 
> -- 
> yamahata

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

end of thread, other threads:[~2010-07-08 13:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-06 11:23 [Qemu-devel] [PATCH] pci: pass bridge update to secondary bus Michael S. Tsirkin
2010-07-07  2:04 ` [Qemu-devel] " Isaku Yamahata
2010-07-08 13:25   ` Michael S. Tsirkin
2010-07-07 17:31 ` [Qemu-devel] " Blue Swirl
2010-07-07 17:36   ` Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.