From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
Sergio Paracuellos <sergio.paracuellos@gmail.com>
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: [PATCH v2 3/4] MIPS: PCI: Return PCIBIOS_* from tx4927_pci_config_read/write()
Date: Thu, 8 Feb 2024 14:09:58 +0200 [thread overview]
Message-ID: <20240208120959.2513-4-ilpo.jarvinen@linux.intel.com> (raw)
In-Reply-To: <20240208120959.2513-1-ilpo.jarvinen@linux.intel.com>
pci_ops .read/.write must return PCIBIOS_* codes but
tx4927_pci_config_read/write() return -1 when mkaddr() cannot find
devfn from the root bus. Return PCIBIOS_DEVICE_NOT_FOUND instead and
pass that onward in the call chain instead of overwriting the return
value.
Also converts 0 -> PCIBIOS_SUCCESSFUL which has only cosmetic impact.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
arch/mips/pci/ops-tx4927.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/arch/mips/pci/ops-tx4927.c b/arch/mips/pci/ops-tx4927.c
index f7802f100401..670efbc5c585 100644
--- a/arch/mips/pci/ops-tx4927.c
+++ b/arch/mips/pci/ops-tx4927.c
@@ -60,7 +60,7 @@ static int mkaddr(struct pci_bus *bus, unsigned int devfn, int where,
{
if (bus->parent == NULL &&
devfn >= PCI_DEVFN(TX4927_PCIC_MAX_DEVNU, 0))
- return -1;
+ return PCIBIOS_DEVICE_NOT_FOUND;
__raw_writel(((bus->number & 0xff) << 0x10)
| ((devfn & 0xff) << 0x08) | (where & 0xfc)
| (bus->parent ? 1 : 0),
@@ -69,7 +69,7 @@ static int mkaddr(struct pci_bus *bus, unsigned int devfn, int where,
__raw_writel((__raw_readl(&pcicptr->pcistatus) & 0x0000ffff)
| (PCI_STATUS_REC_MASTER_ABORT << 16),
&pcicptr->pcistatus);
- return 0;
+ return PCIBIOS_SUCCESSFUL;
}
static int check_abort(struct tx4927_pcic_reg __iomem *pcicptr)
@@ -140,10 +140,12 @@ static int tx4927_pci_config_read(struct pci_bus *bus, unsigned int devfn,
int where, int size, u32 *val)
{
struct tx4927_pcic_reg __iomem *pcicptr = pci_bus_to_pcicptr(bus);
+ int ret;
- if (mkaddr(bus, devfn, where, pcicptr)) {
+ ret = mkaddr(bus, devfn, where, pcicptr);
+ if (ret != PCIBIOS_SUCCESSFUL) {
*val = 0xffffffff;
- return -1;
+ return ret;
}
switch (size) {
case 1:
@@ -162,9 +164,11 @@ static int tx4927_pci_config_write(struct pci_bus *bus, unsigned int devfn,
int where, int size, u32 val)
{
struct tx4927_pcic_reg __iomem *pcicptr = pci_bus_to_pcicptr(bus);
+ int ret;
- if (mkaddr(bus, devfn, where, pcicptr))
- return -1;
+ ret = mkaddr(bus, devfn, where, pcicptr);
+ if (ret != PCIBIOS_SUCCESSFUL)
+ return ret;
switch (size) {
case 1:
icd_writeb(val, where & 3, pcicptr);
--
2.39.2
next prev parent reply other threads:[~2024-02-08 12:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-08 12:09 [PATCH v2 0/4] MIPS: Cleanups to PCI related code Ilpo Järvinen
2024-02-08 12:09 ` [PATCH v2 1/4] MIPS: lantiq: Remove unused function pointer variables Ilpo Järvinen
2024-02-08 12:09 ` [PATCH v2 2/4] MIPS: ath79: Don't return PCIBIOS_* code from pcibios_enable_device() Ilpo Järvinen
2024-02-08 12:09 ` Ilpo Järvinen [this message]
2024-02-08 12:09 ` [PATCH v2 4/4] MIPS: TXx9: Use PCI_SET_ERROR_RESPONSE() Ilpo Järvinen
2024-02-08 12:21 ` [PATCH v2 0/4] MIPS: Cleanups to PCI related code Sergio Paracuellos
2024-02-20 13:39 ` Thomas Bogendoerfer
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=20240208120959.2513-4-ilpo.jarvinen@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=sergio.paracuellos@gmail.com \
--cc=tsbogend@alpha.franken.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®