mbox series

[0/2] PCI: fix pci-mvebu after conversion to common bridge emul code

Message ID 20190220094841.11129-1-thomas.petazzoni@bootlin.com (mailing list archive)
Headers show
Series PCI: fix pci-mvebu after conversion to common bridge emul code | expand

Message

Thomas Petazzoni Feb. 20, 2019, 9:48 a.m. UTC
Hello,

This set of two patches aim at fixing some regression reported by two
users (Luis and Leigh), that were introduced by the conversion of the
pci-mvebu driver to the common PCI bridge emulation code shared
between pci-aardvark and pci-mvebu.

Due to this conversion, some registers of the PCI configuration that
used to be read-only are now read-write, making the Linux PCI core
believe that some features are implemented by the PCI bridge. Namely
in the case of pci-mvebu, the prefetchable memory base/limit registers
were read-only, while they are now read-write. Due to this, the Linux
PCI core now believes it can configure a prefetchable memory area, but
this is not supported by pci-mvebu, which does not have the logic to
create the appropriate MBUs windows.

This set of two commits allow PCI controller code to tell the PCI
bridge emulation logic about their capabilities. Because we envision
that other capabilities than prefetchable memory support might need to
be communicated from the PCI controller code to the PCI bridge
emulation code in the future, we introduce a "flags" argument, even if
for now only one flag is supported.

Lorenzo, let me know what you think about this approach. I am open to
suggestions if the proposed approach is not satisfying.

Both patches have been confirmed by Luis and Leigh to fix the
regression, but I'll let them give a formal Tested-by.

Best regards,

Thomas Petazzoni

Thomas Petazzoni (2):
  PCI: pci-bridge-emul: Create per-bridge copy of register behavior
  PCI: pci-bridge-emul: Extend pci_bridge_emul_init() with flags

 drivers/pci/controller/pci-aardvark.c |  2 +-
 drivers/pci/controller/pci-mvebu.c    |  2 +-
 drivers/pci/pci-bridge-emul.c         | 86 ++++++++++++++++++---------
 drivers/pci/pci-bridge-emul.h         | 13 +++-
 4 files changed, 73 insertions(+), 30 deletions(-)

Comments

Bjorn Helgaas Feb. 21, 2019, 11:23 p.m. UTC | #1
On Wed, Feb 20, 2019 at 10:48:39AM +0100, Thomas Petazzoni wrote:
> Hello,
> 
> This set of two patches aim at fixing some regression reported by two
> users (Luis and Leigh), that were introduced by the conversion of the
> pci-mvebu driver to the common PCI bridge emulation code shared
> between pci-aardvark and pci-mvebu.
> 
> Due to this conversion, some registers of the PCI configuration that
> used to be read-only are now read-write, making the Linux PCI core
> believe that some features are implemented by the PCI bridge. Namely
> in the case of pci-mvebu, the prefetchable memory base/limit registers
> were read-only, while they are now read-write. Due to this, the Linux
> PCI core now believes it can configure a prefetchable memory area, but
> this is not supported by pci-mvebu, which does not have the logic to
> create the appropriate MBUs windows.
> 
> This set of two commits allow PCI controller code to tell the PCI
> bridge emulation logic about their capabilities. Because we envision
> that other capabilities than prefetchable memory support might need to
> be communicated from the PCI controller code to the PCI bridge
> emulation code in the future, we introduce a "flags" argument, even if
> for now only one flag is supported.
> 
> Lorenzo, let me know what you think about this approach. I am open to
> suggestions if the proposed approach is not satisfying.
> 
> Both patches have been confirmed by Luis and Leigh to fix the
> regression, but I'll let them give a formal Tested-by.
> 
> Best regards,
> 
> Thomas Petazzoni
> 
> Thomas Petazzoni (2):
>   PCI: pci-bridge-emul: Create per-bridge copy of register behavior
>   PCI: pci-bridge-emul: Extend pci_bridge_emul_init() with flags
> 
>  drivers/pci/controller/pci-aardvark.c |  2 +-
>  drivers/pci/controller/pci-mvebu.c    |  2 +-
>  drivers/pci/pci-bridge-emul.c         | 86 ++++++++++++++++++---------
>  drivers/pci/pci-bridge-emul.h         | 13 +++-
>  4 files changed, 73 insertions(+), 30 deletions(-)

Lorenzo, I assume you'll take both of these, so for both patches,

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

Maybe we should add a stable tag (v4.20+)?
Leigh Brown Feb. 22, 2019, 8:06 a.m. UTC | #2
On 2019-02-20 09:48, Thomas Petazzoni wrote:
> Hello,
> 
> This set of two patches aim at fixing some regression reported by two
> users (Luis and Leigh), that were introduced by the conversion of the
> pci-mvebu driver to the common PCI bridge emulation code shared
> between pci-aardvark and pci-mvebu.
> 
> Due to this conversion, some registers of the PCI configuration that
> used to be read-only are now read-write, making the Linux PCI core
> believe that some features are implemented by the PCI bridge. Namely
> in the case of pci-mvebu, the prefetchable memory base/limit registers
> were read-only, while they are now read-write. Due to this, the Linux
> PCI core now believes it can configure a prefetchable memory area, but
> this is not supported by pci-mvebu, which does not have the logic to
> create the appropriate MBUs windows.
> 
> This set of two commits allow PCI controller code to tell the PCI
> bridge emulation logic about their capabilities. Because we envision
> that other capabilities than prefetchable memory support might need to
> be communicated from the PCI controller code to the PCI bridge
> emulation code in the future, we introduce a "flags" argument, even if
> for now only one flag is supported.
> 
> Lorenzo, let me know what you think about this approach. I am open to
> suggestions if the proposed approach is not satisfying.
> 
> Both patches have been confirmed by Luis and Leigh to fix the
> regression, but I'll let them give a formal Tested-by.
> 
> Best regards,
> 
> Thomas Petazzoni
> 
> Thomas Petazzoni (2):
>   PCI: pci-bridge-emul: Create per-bridge copy of register behavior
>   PCI: pci-bridge-emul: Extend pci_bridge_emul_init() with flags
> 
>  drivers/pci/controller/pci-aardvark.c |  2 +-
>  drivers/pci/controller/pci-mvebu.c    |  2 +-
>  drivers/pci/pci-bridge-emul.c         | 86 ++++++++++++++++++---------
>  drivers/pci/pci-bridge-emul.h         | 13 +++-
>  4 files changed, 73 insertions(+), 30 deletions(-)

Tested on WRT1900ACS router against 4.20.7 and 5.0.0-rc.

Tested-by: Leigh Brown <leigh@solinno.co.uk>

Regards,

Leigh.
Leigh Brown Feb. 22, 2019, 8:11 a.m. UTC | #3
On 2019-02-21 23:23, Bjorn Helgaas wrote:
> On Wed, Feb 20, 2019 at 10:48:39AM +0100, Thomas Petazzoni wrote:
>> Hello,
>> 
>> This set of two patches aim at fixing some regression reported by two
>> users (Luis and Leigh), that were introduced by the conversion of the
>> pci-mvebu driver to the common PCI bridge emulation code shared
>> between pci-aardvark and pci-mvebu.
>> 
>> Due to this conversion, some registers of the PCI configuration that
>> used to be read-only are now read-write, making the Linux PCI core
>> believe that some features are implemented by the PCI bridge. Namely
>> in the case of pci-mvebu, the prefetchable memory base/limit registers
>> were read-only, while they are now read-write. Due to this, the Linux
>> PCI core now believes it can configure a prefetchable memory area, but
>> this is not supported by pci-mvebu, which does not have the logic to
>> create the appropriate MBUs windows.
>> 
>> This set of two commits allow PCI controller code to tell the PCI
>> bridge emulation logic about their capabilities. Because we envision
>> that other capabilities than prefetchable memory support might need to
>> be communicated from the PCI controller code to the PCI bridge
>> emulation code in the future, we introduce a "flags" argument, even if
>> for now only one flag is supported.
>> 
>> Lorenzo, let me know what you think about this approach. I am open to
>> suggestions if the proposed approach is not satisfying.
>> 
>> Both patches have been confirmed by Luis and Leigh to fix the
>> regression, but I'll let them give a formal Tested-by.
>> 
>> Best regards,
>> 
>> Thomas Petazzoni
>> 
>> Thomas Petazzoni (2):
>>   PCI: pci-bridge-emul: Create per-bridge copy of register behavior
>>   PCI: pci-bridge-emul: Extend pci_bridge_emul_init() with flags
>> 
>>  drivers/pci/controller/pci-aardvark.c |  2 +-
>>  drivers/pci/controller/pci-mvebu.c    |  2 +-
>>  drivers/pci/pci-bridge-emul.c         | 86 
>> ++++++++++++++++++---------
>>  drivers/pci/pci-bridge-emul.h         | 13 +++-
>>  4 files changed, 73 insertions(+), 30 deletions(-)
> 
> Lorenzo, I assume you'll take both of these, so for both patches,
> 
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> 
> Maybe we should add a stable tag (v4.20+)?

That would be great, as it would get that kernel version working again.

Regards,

Leigh.
Thomas Petazzoni Feb. 22, 2019, 8:35 a.m. UTC | #4
Hello Bjorn,

On Thu, 21 Feb 2019 17:23:17 -0600
Bjorn Helgaas <helgaas@kernel.org> wrote:

> Lorenzo, I assume you'll take both of these, so for both patches,
> 
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>

Thanks!

> Maybe we should add a stable tag (v4.20+)?

Both patches have a Fixes: tag, so they should be automatically be
backported to the applicable stable kernels. From
Documentation/process/submitting-patches.rst.

  A Fixes: tag indicates that the patch fixes an issue in a previous
  commit. It is used to make it easy to determine where a bug
  originated, which can help review a bug fix. This tag also assists
  the stable kernel team in determining which stable kernel versions
  should receive your fix. This is the preferred method for indicating
  a bug fixed by the patch. See :ref:`describe_changes` for more
  details.

Isn't that sufficient ?

Thanks,

Thomas
Lorenzo Pieralisi Feb. 22, 2019, 11:05 a.m. UTC | #5
On Fri, Feb 22, 2019 at 09:35:54AM +0100, Thomas Petazzoni wrote:
> Hello Bjorn,
> 
> On Thu, 21 Feb 2019 17:23:17 -0600
> Bjorn Helgaas <helgaas@kernel.org> wrote:
> 
> > Lorenzo, I assume you'll take both of these, so for both patches,
> > 
> > Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> 
> Thanks!
> 
> > Maybe we should add a stable tag (v4.20+)?
> 
> Both patches have a Fixes: tag, so they should be automatically be
> backported to the applicable stable kernels. From
> Documentation/process/submitting-patches.rst.
> 
>   A Fixes: tag indicates that the patch fixes an issue in a previous
>   commit. It is used to make it easy to determine where a bug
>   originated, which can help review a bug fix. This tag also assists
>   the stable kernel team in determining which stable kernel versions
>   should receive your fix. This is the preferred method for indicating
>   a bug fixed by the patch. See :ref:`describe_changes` for more
>   details.
> 
> Isn't that sufficient ?

Adding a CC: stable won't hurt so that it is certain it will get
stable kernels attention, that's what I will do.

Thanks,
Lorenzo
Lorenzo Pieralisi Feb. 22, 2019, 11:22 a.m. UTC | #6
On Wed, Feb 20, 2019 at 10:48:39AM +0100, Thomas Petazzoni wrote:
> Hello,
> 
> This set of two patches aim at fixing some regression reported by two
> users (Luis and Leigh), that were introduced by the conversion of the
> pci-mvebu driver to the common PCI bridge emulation code shared
> between pci-aardvark and pci-mvebu.
> 
> Due to this conversion, some registers of the PCI configuration that
> used to be read-only are now read-write, making the Linux PCI core
> believe that some features are implemented by the PCI bridge. Namely
> in the case of pci-mvebu, the prefetchable memory base/limit registers
> were read-only, while they are now read-write. Due to this, the Linux
> PCI core now believes it can configure a prefetchable memory area, but
> this is not supported by pci-mvebu, which does not have the logic to
> create the appropriate MBUs windows.
> 
> This set of two commits allow PCI controller code to tell the PCI
> bridge emulation logic about their capabilities. Because we envision
> that other capabilities than prefetchable memory support might need to
> be communicated from the PCI controller code to the PCI bridge
> emulation code in the future, we introduce a "flags" argument, even if
> for now only one flag is supported.
> 
> Lorenzo, let me know what you think about this approach. I am open to
> suggestions if the proposed approach is not satisfying.
> 
> Both patches have been confirmed by Luis and Leigh to fix the
> regression, but I'll let them give a formal Tested-by.
> 
> Best regards,
> 
> Thomas Petazzoni
> 
> Thomas Petazzoni (2):
>   PCI: pci-bridge-emul: Create per-bridge copy of register behavior
>   PCI: pci-bridge-emul: Extend pci_bridge_emul_init() with flags
> 
>  drivers/pci/controller/pci-aardvark.c |  2 +-
>  drivers/pci/controller/pci-mvebu.c    |  2 +-
>  drivers/pci/pci-bridge-emul.c         | 86 ++++++++++++++++++---------
>  drivers/pci/pci-bridge-emul.h         | 13 +++-
>  4 files changed, 73 insertions(+), 30 deletions(-)

I have applied the series to pci/misc for v5.1, thanks.

Lorenzo
Thomas Petazzoni Feb. 22, 2019, 12:45 p.m. UTC | #7
Hello Lorenzo,

On Fri, 22 Feb 2019 11:05:12 +0000
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> wrote:

> > Isn't that sufficient ?  
> 
> Adding a CC: stable won't hurt so that it is certain it will get
> stable kernels attention, that's what I will do.

Ah, yes, indeed. Sorry for forgetting about these, and thanks for
applying with those Cc: stable added!

Thomas