linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the vhost tree with the pci tree
@ 2019-01-31  2:40 Stephen Rothwell
  2019-01-31 14:15 ` Bjorn Helgaas
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2019-01-31  2:40 UTC (permalink / raw)
  To: Michael S. Tsirkin, Bjorn Helgaas
  Cc: Linux Next Mailing List, Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 2902 bytes --]

Hi all,

Today's linux-next merge of the vhost tree got a conflict in:

  drivers/pci/setup-bus.c

between commit:

  51c48b310183 ("PCI: Probe bridge window attributes once at enumeration-time")

from the pci tree and commit:

  955156f34e7d ("PCI: avoid bridge feature re-probing on hotplug")

from the vhost tree.

I fixed it up (hopefully - see below) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/pci/setup-bus.c
index 1941bb0a6c13,d5c25d465d97..000000000000
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@@ -735,17 -735,50 +735,26 @@@ int pci_claim_bridge_resource(struct pc
     base/limit registers must be read-only and read as 0. */
  static void pci_bridge_check_ranges(struct pci_bus *bus)
  {
 -	u16 io;
 -	u32 pmem;
  	struct pci_dev *bridge = bus->self;
 -	struct resource *b_res;
 -
 -	b_res = &bridge->resource[PCI_BRIDGE_RESOURCES];
 +	struct resource *b_res = &bridge->resource[PCI_BRIDGE_RESOURCES];
  
+ 	/*
+ 	 * Don't re-check after this was called once already:
+ 	 * important since bridge might be in use.
+ 	 * Note: this is only reliable because as per spec all PCI to PCI
+ 	 * bridges support memory unconditionally so IORESOURCE_MEM is set.
+ 	 */
+ 	if (b_res[1].flags & IORESOURCE_MEM)
+ 		return;
+ 
  	b_res[1].flags |= IORESOURCE_MEM;
  
 -	pci_read_config_word(bridge, PCI_IO_BASE, &io);
 -	if (!io) {
 -		pci_write_config_word(bridge, PCI_IO_BASE, 0xe0f0);
 -		pci_read_config_word(bridge, PCI_IO_BASE, &io);
 -		pci_write_config_word(bridge, PCI_IO_BASE, 0x0);
 -	}
 -	if (io)
 +	if (bridge->io_window)
  		b_res[0].flags |= IORESOURCE_IO;
  
 -	/*  DECchip 21050 pass 2 errata: the bridge may miss an address
 -	    disconnect boundary by one PCI data phase.
 -	    Workaround: do not use prefetching on this device. */
 -	if (bridge->vendor == PCI_VENDOR_ID_DEC && bridge->device == 0x0001)
 -		return;
 -
 -	pci_read_config_dword(bridge, PCI_PREF_MEMORY_BASE, &pmem);
 -	if (!pmem) {
 -		pci_write_config_dword(bridge, PCI_PREF_MEMORY_BASE,
 -					       0xffe0fff0);
 -		pci_read_config_dword(bridge, PCI_PREF_MEMORY_BASE, &pmem);
 -		pci_write_config_dword(bridge, PCI_PREF_MEMORY_BASE, 0x0);
 -	}
 -	if (pmem) {
 +	if (bridge->pref_window) {
  		b_res[2].flags |= IORESOURCE_MEM | IORESOURCE_PREFETCH;
 -		if ((pmem & PCI_PREF_RANGE_TYPE_MASK) ==
 -		    PCI_PREF_RANGE_TYPE_64) {
 +		if (bridge->pref_64_window) {
  			b_res[2].flags |= IORESOURCE_MEM_64;
  			b_res[2].flags |= PCI_PREF_RANGE_TYPE_64;
  		}

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: linux-next: manual merge of the vhost tree with the pci tree
  2019-01-31  2:40 linux-next: manual merge of the vhost tree with the pci tree Stephen Rothwell
@ 2019-01-31 14:15 ` Bjorn Helgaas
  2019-01-31 14:42   ` Michael S. Tsirkin
  0 siblings, 1 reply; 5+ messages in thread
From: Bjorn Helgaas @ 2019-01-31 14:15 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Michael S. Tsirkin, Linux Next Mailing List,
	Linux Kernel Mailing List, linux-pci

On Wed, Jan 30, 2019 at 8:40 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
>
> Today's linux-next merge of the vhost tree got a conflict in:
>
>   drivers/pci/setup-bus.c
>
> between commit:
>
>   51c48b310183 ("PCI: Probe bridge window attributes once at enumeration-time")
>
> from the pci tree and commit:
>
>   955156f34e7d ("PCI: avoid bridge feature re-probing on hotplug")
>
> from the vhost tree.
>
> I fixed it up (hopefully - see below) and can carry the fix as
> necessary. This is now fixed as far as linux-next is concerned, but any
> non trivial conflicts should be mentioned to your upstream maintainer
> when your tree is submitted for merging.  You may also want to consider
> cooperating with the maintainer of the conflicting tree to minimise any
> particularly complex conflicts.

51c48b310183 and 955156f34e7d are both to solve the same problem, so I
think the best resolution is to drop 955156f34e7d from the vhost tree
completely.

The remaining wrinkle to work out is that we need a stable backport.
51c48b310183 is technically a little large for a stable backport, so I
want to have a solid justification for it.  As soon as I get a
kernel.org bugzilla with those details (who's affected by the
breakage, what the failure looks like, how to reproduce it, etc), I'll
add that URL and the stable tag.

Bjorn

> diff --cc drivers/pci/setup-bus.c
> index 1941bb0a6c13,d5c25d465d97..000000000000
> --- a/drivers/pci/setup-bus.c
> +++ b/drivers/pci/setup-bus.c
> @@@ -735,17 -735,50 +735,26 @@@ int pci_claim_bridge_resource(struct pc
>      base/limit registers must be read-only and read as 0. */
>   static void pci_bridge_check_ranges(struct pci_bus *bus)
>   {
>  -      u16 io;
>  -      u32 pmem;
>         struct pci_dev *bridge = bus->self;
>  -      struct resource *b_res;
>  -
>  -      b_res = &bridge->resource[PCI_BRIDGE_RESOURCES];
>  +      struct resource *b_res = &bridge->resource[PCI_BRIDGE_RESOURCES];
>
> +       /*
> +        * Don't re-check after this was called once already:
> +        * important since bridge might be in use.
> +        * Note: this is only reliable because as per spec all PCI to PCI
> +        * bridges support memory unconditionally so IORESOURCE_MEM is set.
> +        */
> +       if (b_res[1].flags & IORESOURCE_MEM)
> +               return;
> +
>         b_res[1].flags |= IORESOURCE_MEM;
>
>  -      pci_read_config_word(bridge, PCI_IO_BASE, &io);
>  -      if (!io) {
>  -              pci_write_config_word(bridge, PCI_IO_BASE, 0xe0f0);
>  -              pci_read_config_word(bridge, PCI_IO_BASE, &io);
>  -              pci_write_config_word(bridge, PCI_IO_BASE, 0x0);
>  -      }
>  -      if (io)
>  +      if (bridge->io_window)
>                 b_res[0].flags |= IORESOURCE_IO;
>
>  -      /*  DECchip 21050 pass 2 errata: the bridge may miss an address
>  -          disconnect boundary by one PCI data phase.
>  -          Workaround: do not use prefetching on this device. */
>  -      if (bridge->vendor == PCI_VENDOR_ID_DEC && bridge->device == 0x0001)
>  -              return;
>  -
>  -      pci_read_config_dword(bridge, PCI_PREF_MEMORY_BASE, &pmem);
>  -      if (!pmem) {
>  -              pci_write_config_dword(bridge, PCI_PREF_MEMORY_BASE,
>  -                                             0xffe0fff0);
>  -              pci_read_config_dword(bridge, PCI_PREF_MEMORY_BASE, &pmem);
>  -              pci_write_config_dword(bridge, PCI_PREF_MEMORY_BASE, 0x0);
>  -      }
>  -      if (pmem) {
>  +      if (bridge->pref_window) {
>                 b_res[2].flags |= IORESOURCE_MEM | IORESOURCE_PREFETCH;
>  -              if ((pmem & PCI_PREF_RANGE_TYPE_MASK) ==
>  -                  PCI_PREF_RANGE_TYPE_64) {
>  +              if (bridge->pref_64_window) {
>                         b_res[2].flags |= IORESOURCE_MEM_64;
>                         b_res[2].flags |= PCI_PREF_RANGE_TYPE_64;
>                 }

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

* Re: linux-next: manual merge of the vhost tree with the pci tree
  2019-01-31 14:15 ` Bjorn Helgaas
@ 2019-01-31 14:42   ` Michael S. Tsirkin
  0 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2019-01-31 14:42 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Stephen Rothwell, Linux Next Mailing List,
	Linux Kernel Mailing List, linux-pci

On Thu, Jan 31, 2019 at 08:15:50AM -0600, Bjorn Helgaas wrote:
> On Wed, Jan 30, 2019 at 8:40 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > Hi all,
> >
> > Today's linux-next merge of the vhost tree got a conflict in:
> >
> >   drivers/pci/setup-bus.c
> >
> > between commit:
> >
> >   51c48b310183 ("PCI: Probe bridge window attributes once at enumeration-time")
> >
> > from the pci tree and commit:
> >
> >   955156f34e7d ("PCI: avoid bridge feature re-probing on hotplug")
> >
> > from the vhost tree.
> >
> > I fixed it up (hopefully - see below) and can carry the fix as
> > necessary. This is now fixed as far as linux-next is concerned, but any
> > non trivial conflicts should be mentioned to your upstream maintainer
> > when your tree is submitted for merging.  You may also want to consider
> > cooperating with the maintainer of the conflicting tree to minimise any
> > particularly complex conflicts.
> 
> 51c48b310183 and 955156f34e7d are both to solve the same problem, so I
> think the best resolution is to drop 955156f34e7d from the vhost tree
> completely.

Will do.

> The remaining wrinkle to work out is that we need a stable backport.
> 51c48b310183 is technically a little large for a stable backport, so I
> want to have a solid justification for it.  As soon as I get a
> kernel.org bugzilla with those details (who's affected by the
> breakage, what the failure looks like, how to reproduce it, etc), I'll
> add that URL and the stable tag.
> 
> Bjorn

OK.

> > diff --cc drivers/pci/setup-bus.c
> > index 1941bb0a6c13,d5c25d465d97..000000000000
> > --- a/drivers/pci/setup-bus.c
> > +++ b/drivers/pci/setup-bus.c
> > @@@ -735,17 -735,50 +735,26 @@@ int pci_claim_bridge_resource(struct pc
> >      base/limit registers must be read-only and read as 0. */
> >   static void pci_bridge_check_ranges(struct pci_bus *bus)
> >   {
> >  -      u16 io;
> >  -      u32 pmem;
> >         struct pci_dev *bridge = bus->self;
> >  -      struct resource *b_res;
> >  -
> >  -      b_res = &bridge->resource[PCI_BRIDGE_RESOURCES];
> >  +      struct resource *b_res = &bridge->resource[PCI_BRIDGE_RESOURCES];
> >
> > +       /*
> > +        * Don't re-check after this was called once already:
> > +        * important since bridge might be in use.
> > +        * Note: this is only reliable because as per spec all PCI to PCI
> > +        * bridges support memory unconditionally so IORESOURCE_MEM is set.
> > +        */
> > +       if (b_res[1].flags & IORESOURCE_MEM)
> > +               return;
> > +
> >         b_res[1].flags |= IORESOURCE_MEM;
> >
> >  -      pci_read_config_word(bridge, PCI_IO_BASE, &io);
> >  -      if (!io) {
> >  -              pci_write_config_word(bridge, PCI_IO_BASE, 0xe0f0);
> >  -              pci_read_config_word(bridge, PCI_IO_BASE, &io);
> >  -              pci_write_config_word(bridge, PCI_IO_BASE, 0x0);
> >  -      }
> >  -      if (io)
> >  +      if (bridge->io_window)
> >                 b_res[0].flags |= IORESOURCE_IO;
> >
> >  -      /*  DECchip 21050 pass 2 errata: the bridge may miss an address
> >  -          disconnect boundary by one PCI data phase.
> >  -          Workaround: do not use prefetching on this device. */
> >  -      if (bridge->vendor == PCI_VENDOR_ID_DEC && bridge->device == 0x0001)
> >  -              return;
> >  -
> >  -      pci_read_config_dword(bridge, PCI_PREF_MEMORY_BASE, &pmem);
> >  -      if (!pmem) {
> >  -              pci_write_config_dword(bridge, PCI_PREF_MEMORY_BASE,
> >  -                                             0xffe0fff0);
> >  -              pci_read_config_dword(bridge, PCI_PREF_MEMORY_BASE, &pmem);
> >  -              pci_write_config_dword(bridge, PCI_PREF_MEMORY_BASE, 0x0);
> >  -      }
> >  -      if (pmem) {
> >  +      if (bridge->pref_window) {
> >                 b_res[2].flags |= IORESOURCE_MEM | IORESOURCE_PREFETCH;
> >  -              if ((pmem & PCI_PREF_RANGE_TYPE_MASK) ==
> >  -                  PCI_PREF_RANGE_TYPE_64) {
> >  +              if (bridge->pref_64_window) {
> >                         b_res[2].flags |= IORESOURCE_MEM_64;
> >                         b_res[2].flags |= PCI_PREF_RANGE_TYPE_64;
> >                 }

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

* linux-next: manual merge of the vhost tree with the pci tree
@ 2019-04-15  6:07 Stephen Rothwell
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2019-04-15  6:07 UTC (permalink / raw)
  To: Michael S. Tsirkin, Bjorn Helgaas
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Jean-Philippe Brucker

[-- Attachment #1: Type: text/plain, Size: 1612 bytes --]

Hi all,

Today's linux-next merge of the vhost tree got a conflict in:

  drivers/pci/of.c

between commit:

  9cb30a71acd4 ("PCI: OF: Support "external-facing" property")

from the pci tree and commit:

  e1c326663501 ("PCI: OF: Initialize dev->fwnode appropriately")

from the vhost tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/pci/of.c
index 73d5adec0a28,9454c90980c9..000000000000
--- a/drivers/pci/of.c
+++ b/drivers/pci/of.c
@@@ -32,16 -34,13 +35,18 @@@ void pci_release_of_node(struct pci_de
  
  void pci_set_bus_of_node(struct pci_bus *bus)
  {
 -	if (bus->self == NULL)
 -		bus->dev.of_node = pcibios_get_phb_of_node(bus);
 -	else
 -		bus->dev.of_node = of_node_get(bus->self->dev.of_node);
 +	struct device_node *node;
  
 -	if (bus->dev.of_node)
 -		bus->dev.fwnode = &bus->dev.of_node->fwnode;
 +	if (bus->self == NULL) {
 +		node = pcibios_get_phb_of_node(bus);
 +	} else {
 +		node = of_node_get(bus->self->dev.of_node);
 +		if (node && of_property_read_bool(node, "external-facing"))
 +			bus->self->untrusted = true;
 +	}
 +	bus->dev.of_node = node;
++	if (node)
++		bus->dev.fwnode = &node->fwnode;
  }
  
  void pci_release_bus_of_node(struct pci_bus *bus)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 484 bytes --]

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

* linux-next: manual merge of the vhost tree with the pci tree
@ 2015-04-13  9:48 Stephen Rothwell
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2015-04-13  9:48 UTC (permalink / raw)
  To: Michael S. Tsirkin, Bjorn Helgaas; +Cc: linux-next, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 472 bytes --]

Hi Michael,

Today's linux-next merge of the vhost tree got a conflict in
Documentation/PCI/pci.txt between commit 37a9c502c0af ("PCI: Clarify
policy for vendor IDs in pci.txt") from the pci tree and commit
a708ec6790bb ("pci.txt: clarify vendor ID policy") from the vhost tree.

I fixed it up (I just used the pci tree version) and can carry the fix
as necessary (no action is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2019-04-15  6:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-31  2:40 linux-next: manual merge of the vhost tree with the pci tree Stephen Rothwell
2019-01-31 14:15 ` Bjorn Helgaas
2019-01-31 14:42   ` Michael S. Tsirkin
  -- strict thread matches above, loose matches on Subject: below --
2019-04-15  6:07 Stephen Rothwell
2015-04-13  9:48 Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).