From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: "Antoine Tenart" <antoine.tenart@bootlin.com>,
linux-pci@vger.kernel.org,
"Gregory Clement" <gregory.clement@bootlin.com>,
"Maxime Chevallier" <maxime.chevallier@bootlin.com>,
"Nadav Haklai" <nadavh@marvell.com>,
"Victor Gu" <xigu@marvell.com>,
"Miquèl Raynal" <miquel.raynal@bootlin.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Wilson Ding" <dingwei@marvell.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v4 5/6] PCI: aardvark: Introduce an advk_pcie_valid_device() helper
Date: Wed, 27 Jun 2018 17:51:24 +0100 [thread overview]
Message-ID: <20180627165124.GA8243@red-moon> (raw)
In-Reply-To: <20180406145536.19637-6-thomas.petazzoni@bootlin.com>
On Fri, Apr 06, 2018 at 04:55:35PM +0200, Thomas Petazzoni wrote:
> In other to mimic other PCIe host controller drivers, introduce an
> advk_pcie_valid_device() helper, used in the configuration read/write
> functions.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
> Changes since v4:
> - Move later into the series, so that it doesn't need to be pushed as
> a fix for stable.
> Changes since v3:
> - Make the new helper return a bool instead of int
> Changes since v2:
> - New patch
> ---
> drivers/pci/host/pci-aardvark.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
Hi Thomas,
please rebase patch 5 (this patch) and 6 and resend, I will apply them
straight away, sorry for the delay.
Thanks,
Lorenzo
> diff --git a/drivers/pci/host/pci-aardvark.c b/drivers/pci/host/pci-aardvark.c
> index 9abf549631b4..69c4fd50947e 100644
> --- a/drivers/pci/host/pci-aardvark.c
> +++ b/drivers/pci/host/pci-aardvark.c
> @@ -431,6 +431,15 @@ static int advk_pcie_wait_pio(struct advk_pcie *pcie)
> return -ETIMEDOUT;
> }
>
> +static bool advk_pcie_valid_device(struct advk_pcie *pcie, struct pci_bus *bus,
> + int devfn)
> +{
> + if ((bus->number == pcie->root_bus_nr) && PCI_SLOT(devfn) != 0)
> + return false;
> +
> + return true;
> +}
> +
> static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn,
> int where, int size, u32 *val)
> {
> @@ -438,7 +447,7 @@ static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn,
> u32 reg;
> int ret;
>
> - if ((bus->number == pcie->root_bus_nr) && PCI_SLOT(devfn) != 0) {
> + if (!advk_pcie_valid_device(pcie, bus, devfn)) {
> *val = 0xffffffff;
> return PCIBIOS_DEVICE_NOT_FOUND;
> }
> @@ -492,7 +501,7 @@ static int advk_pcie_wr_conf(struct pci_bus *bus, u32 devfn,
> int offset;
> int ret;
>
> - if ((bus->number == pcie->root_bus_nr) && PCI_SLOT(devfn) != 0)
> + if (!advk_pcie_valid_device(pcie, bus, devfn))
> return PCIBIOS_DEVICE_NOT_FOUND;
>
> if (where % size)
> --
> 2.14.3
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: lorenzo.pieralisi@arm.com (Lorenzo Pieralisi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 5/6] PCI: aardvark: Introduce an advk_pcie_valid_device() helper
Date: Wed, 27 Jun 2018 17:51:24 +0100 [thread overview]
Message-ID: <20180627165124.GA8243@red-moon> (raw)
In-Reply-To: <20180406145536.19637-6-thomas.petazzoni@bootlin.com>
On Fri, Apr 06, 2018 at 04:55:35PM +0200, Thomas Petazzoni wrote:
> In other to mimic other PCIe host controller drivers, introduce an
> advk_pcie_valid_device() helper, used in the configuration read/write
> functions.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
> Changes since v4:
> - Move later into the series, so that it doesn't need to be pushed as
> a fix for stable.
> Changes since v3:
> - Make the new helper return a bool instead of int
> Changes since v2:
> - New patch
> ---
> drivers/pci/host/pci-aardvark.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
Hi Thomas,
please rebase patch 5 (this patch) and 6 and resend, I will apply them
straight away, sorry for the delay.
Thanks,
Lorenzo
> diff --git a/drivers/pci/host/pci-aardvark.c b/drivers/pci/host/pci-aardvark.c
> index 9abf549631b4..69c4fd50947e 100644
> --- a/drivers/pci/host/pci-aardvark.c
> +++ b/drivers/pci/host/pci-aardvark.c
> @@ -431,6 +431,15 @@ static int advk_pcie_wait_pio(struct advk_pcie *pcie)
> return -ETIMEDOUT;
> }
>
> +static bool advk_pcie_valid_device(struct advk_pcie *pcie, struct pci_bus *bus,
> + int devfn)
> +{
> + if ((bus->number == pcie->root_bus_nr) && PCI_SLOT(devfn) != 0)
> + return false;
> +
> + return true;
> +}
> +
> static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn,
> int where, int size, u32 *val)
> {
> @@ -438,7 +447,7 @@ static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn,
> u32 reg;
> int ret;
>
> - if ((bus->number == pcie->root_bus_nr) && PCI_SLOT(devfn) != 0) {
> + if (!advk_pcie_valid_device(pcie, bus, devfn)) {
> *val = 0xffffffff;
> return PCIBIOS_DEVICE_NOT_FOUND;
> }
> @@ -492,7 +501,7 @@ static int advk_pcie_wr_conf(struct pci_bus *bus, u32 devfn,
> int offset;
> int ret;
>
> - if ((bus->number == pcie->root_bus_nr) && PCI_SLOT(devfn) != 0)
> + if (!advk_pcie_valid_device(pcie, bus, devfn))
> return PCIBIOS_DEVICE_NOT_FOUND;
>
> if (where % size)
> --
> 2.14.3
>
next prev parent reply other threads:[~2018-06-27 16:51 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-06 14:55 [PATCH v4 0/6] PCI: aardvark: misc fixes and improvements Thomas Petazzoni
2018-04-06 14:55 ` Thomas Petazzoni
2018-04-06 14:55 ` [PATCH v4 1/6] PCI: aardvark: Fix logic in advk_pcie_{rd,wr}_conf() Thomas Petazzoni
2018-04-06 14:55 ` Thomas Petazzoni
2018-04-06 14:55 ` [PATCH v4 2/6] PCI: aardvark: Set PIO_ADDR_LS correctly in advk_pcie_rd_conf() Thomas Petazzoni
2018-04-06 14:55 ` Thomas Petazzoni
2018-04-06 14:55 ` [PATCH v4 3/6] PCI: aardvark: Use ISR1 instead of ISR0 interrupt in legacy irq mode Thomas Petazzoni
2018-04-06 14:55 ` Thomas Petazzoni
2018-04-06 14:55 ` [PATCH v4 4/6] PCI: aardvark: Fix PCIe Max Read Request Size setting Thomas Petazzoni
2018-04-06 14:55 ` Thomas Petazzoni
2018-04-06 14:55 ` [PATCH v4 5/6] PCI: aardvark: Introduce an advk_pcie_valid_device() helper Thomas Petazzoni
2018-04-06 14:55 ` Thomas Petazzoni
2018-06-27 16:51 ` Lorenzo Pieralisi [this message]
2018-06-27 16:51 ` Lorenzo Pieralisi
2018-06-27 17:18 ` Lorenzo Pieralisi
2018-06-27 17:18 ` Lorenzo Pieralisi
2018-06-27 18:52 ` Thomas Petazzoni
2018-06-27 18:52 ` Thomas Petazzoni
2018-04-06 14:55 ` [PATCH v4 6/6] PCI: aardvark: Remove PCIe outbound window configuration Thomas Petazzoni
2018-04-06 14:55 ` Thomas Petazzoni
2018-04-09 16:23 ` [PATCH v4 0/6] PCI: aardvark: misc fixes and improvements Lorenzo Pieralisi
2018-04-09 16:23 ` Lorenzo Pieralisi
2018-04-09 18:54 ` Thomas Petazzoni
2018-04-09 18:54 ` Thomas Petazzoni
2018-04-18 13:02 ` Lorenzo Pieralisi
2018-04-18 13:02 ` Lorenzo Pieralisi
2018-04-18 13:49 ` Thomas Petazzoni
2018-04-18 13:49 ` Thomas Petazzoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180627165124.GA8243@red-moon \
--to=lorenzo.pieralisi@arm.com \
--cc=antoine.tenart@bootlin.com \
--cc=bhelgaas@google.com \
--cc=dingwei@marvell.com \
--cc=gregory.clement@bootlin.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=miquel.raynal@bootlin.com \
--cc=nadavh@marvell.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=xigu@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.