All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksandr Tyshchenko <olekstysh@gmail.com>
To: Mykyta Poturai <Mykyta_Poturai@epam.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "Oleksandr Tyshchenko" <Oleksandr_Tyshchenko@epam.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Julien Grall" <julien@xen.org>,
	"Bertrand Marquis" <bertrand.marquis@arm.com>,
	"Michal Orzel" <michal.orzel@amd.com>,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Anthony PERARD" <anthony.perard@vates.tech>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Roger Pau Monné" <roger@xenproject.org>,
	"Oleksii Kurochko" <oleksii.kurochko@gmail.com>,
	"Community Manager" <community.manager@xenproject.org>
Subject: Re: [PATCH v2 1/3] pci/rcar: Check dw_pcie_host_probe() return value
Date: Mon, 30 Nov 2026 17:15:28 +0200	[thread overview]
Message-ID: <33e27785-3e6e-44ca-b212-b71be1d22981@gmail.com> (raw)
In-Reply-To: <20261130-rcar-gen5-pci-host-v2-1-f012dfbee7ec@epam.com>



30.11.2026 13:50, Mykyta Poturai пишет:

Hello Mykyta


> dw_pcie_host_probe() returns an ERR_PTR on failure, which was then
> passed on to dw_pcie_set_priv().
> 
> Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>


Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

I assume we need a "Fixes:" tag.



Also ...

> ---
> v1->v2:
> * new patch
> ---
>   xen/arch/arm/pci/pci-host-rcar4.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/xen/arch/arm/pci/pci-host-rcar4.c b/xen/arch/arm/pci/pci-host-rcar4.c
> index e1e8eb0ee1..611342f98e 100644
> --- a/xen/arch/arm/pci/pci-host-rcar4.c
> +++ b/xen/arch/arm/pci/pci-host-rcar4.c
> @@ -193,6 +193,11 @@ static int __init pci_host_rcar4_probe(struct dt_device_node *dev,
>   
>       bridge = dw_pcie_host_probe(dev, data, &rcar4_pcie_ops,
>                                   &rcar4_pcie_child_ops);
> +    if ( IS_ERR(bridge) )

  ... when looking more closely into what the underlying code can 
return, I noticed a couple of issues:

1. In dw_pcie_host_probe(), pci_host_common_probe() can return NULL. 
Since IS_ERR(NULL) is false, dw_pcie_host_probe() misses the failure and 
dereferences bridge->priv = priv.

2. When ioremap_nocache() fails, dw_pcie_host_probe() returns 
ERR_PTR(ENXIO) instead of ERR_PTR(-ENXIO). Since IS_ERR(ERR_PTR(ENXIO)) 
is false, pci_host_rcar4_probe() misses the failure and passes the 
invalid pointer to dw_pcie_set_priv().

Would you be able to fix those as well, please (ideally in a separate 
commit on pci-designware.c)? If you would prefer to keep this series 
focused on R-Car, the pci-designware.c fix could be handled separately.

> +    {
> +        ret = PTR_ERR(bridge);
> +        goto err;
> +    }
>   
>       app_idx = dt_property_match_string(dev, "reg-names", "app");
>       if ( app_idx < 0 )
> 



  reply	other threads:[~2026-11-30 15:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 11:50 [PATCH v2 0/3] Add R-Car Gen5 PCI host support Mykyta Poturai
2026-11-30 11:50 ` [PATCH v2 1/3] pci/rcar: Check dw_pcie_host_probe() return value Mykyta Poturai
2026-11-30 15:15   ` Oleksandr Tyshchenko [this message]
2026-11-30 11:50 ` [PATCH v2 3/3] pci/rcar: Add support for Gen5 PCI host Mykyta Poturai
2026-11-30 11:50 ` [PATCH v2 2/3] pci/rcar: Rename PCI host rcar4 to rcar Mykyta Poturai
2026-12-02 23:47 ` [PATCH v2 0/3] Add R-Car Gen5 PCI host support Stefano Stabellini

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=33e27785-3e6e-44ca-b212-b71be1d22981@gmail.com \
    --to=olekstysh@gmail.com \
    --cc=Mykyta_Poturai@epam.com \
    --cc=Oleksandr_Tyshchenko@epam.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=bertrand.marquis@arm.com \
    --cc=community.manager@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=oleksii.kurochko@gmail.com \
    --cc=roger@xenproject.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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.