Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Claudiu Beznea" <claudiu.beznea@kernel.org>
Cc: linux-pci@vger.kernel.org, wsa+renesas@sang-engineering.com
Subject: Re: [PATCH v6 4/9] PCI: rzg3s-host: Move host configuration code together
Date: Wed, 07 Oct 2026 05:47:23 +0000	[thread overview]
Message-ID: <sashiko-outbox-162648@kernel.org> (raw)
In-Reply-To: <20261007053645.1391545-5-claudiu.beznea@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] cleanup: mixing goto and __free() in rzg3s_pcie_probe
--

commit 58c1ad45841aacf58a73f4caada04798bba4e7e2
Author: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

PCI: rzg3s-host: Move host configuration code together

This commit rearranges the host configuration functions together to prepare for
hotplug support. It also adjusts the error handling paths and labels in the
probe and suspend/resume routines.

> diff --git a/drivers/pci/controller/pcie-rzg3s-host.c b/drivers/pci/controller/pcie-rzg3s-host.c
> index 077cfb0834b37..3ecada2384023 100644
> --- a/drivers/pci/controller/pcie-rzg3s-host.c
> +++ b/drivers/pci/controller/pcie-rzg3s-host.c

[ ... ]

> @@ -1902,12 +1893,16 @@ static int rzg3s_pcie_probe(struct platform_device *pdev)
>  	if (ret)
>  		goto rpm_disable;
>  
> +	ret = rzg3s_pcie_power_resets_deassert(host);
> +	if (ret)
> +		goto rpm_put;
> +

[Severity: Medium]
Does this error handling violate the cleanup subsystem requirements?

The rzg3s_pcie_probe() function declares sysc_np using __free(device_node):

    struct device_node *sysc_np __free(device_node) =
        of_parse_phandle(np, "renesas,sysc", 0);

However, the function also heavily uses manual goto rollback labels, and
this patch modifies those paths. According to include/linux/cleanup.h,
mixing goto-based cleanup labels and scope-based __free() in the same
function is not permitted due to the risk of confusing ownership semantics.

Should this function either be converted entirely to scope-based cleanups
or avoid __free() entirely?

>  	raw_spin_lock_init(&host->hw_lock);
>  
>  	ret = rzg3s_pcie_host_setup(host, rzg3s_pcie_init_irqdomain,
>  				    rzg3s_pcie_teardown_irqdomain);
>  	if (ret)
> -		goto rpm_put;
> +		goto power_resets_assert;
>  
>  	bridge->sysdata = host;
>  	bridge->ops = &rzg3s_pcie_root_ops;
> @@ -1922,12 +1917,13 @@ static int rzg3s_pcie_probe(struct platform_device *pdev)
>  	clk_disable_unprepare(host->port.refclk);
>  	rzg3s_pcie_teardown_irqdomain(host);
>  	host->data->config_deinit(host);
> +power_resets_assert:
> +	reset_control_bulk_assert(host->data->num_power_resets,
> +				  host->power_resets);
>  rpm_put:
>  	pm_runtime_put_sync(dev);
>  rpm_disable:
>  	pm_runtime_disable(dev);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261007053645.1391545-1-claudiu.beznea@kernel.org?part=4

  reply	other threads:[~2026-10-07  5:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-07  5:36 [PATCH v6 0/9] PCI: rzg3s-host: Add PCIe hotplug support Claudiu Beznea
2026-10-07  5:36 ` [PATCH v6 1/9] PCI: rzg3s-host: Follow hardware manual clock/reset initialization order Claudiu Beznea
2026-10-07  5:48   ` sashiko-bot
2026-10-07  5:36 ` [PATCH v6 2/9] PCI: rzg3s-host: Fix runtime PM handling in the NOIRQ suspend/resume phase Claudiu Beznea
2026-10-07  5:53   ` sashiko-bot
2026-10-07  5:36 ` [PATCH v6 3/9] PCI: rzg3s-host: Drop nop instructions Claudiu Beznea
2026-10-07  5:46   ` sashiko-bot
2026-10-07  5:36 ` [PATCH v6 4/9] PCI: rzg3s-host: Move host configuration code together Claudiu Beznea
2026-10-07  5:47   ` sashiko-bot [this message]
2026-10-07  5:36 ` [PATCH v6 5/9] PCI: rzg3s-host: Move suspend/resume code into dedicated functions Claudiu Beznea
2026-10-07  5:52   ` sashiko-bot
2026-10-07  5:36 ` [PATCH v6 6/9] PCI: rzg3s-host: Move IRQ domain setup code Claudiu Beznea
2026-10-07  5:47   ` sashiko-bot
2026-10-07  5:36 ` [PATCH v6 7/9] PCI: rzg3s-host: Add helper to wait for link up Claudiu Beznea
2026-10-07  5:44   ` sashiko-bot
2026-10-07  5:36 ` [PATCH v6 8/9] PCI: rzg3s-host: Re-enumerate the bus on PCIe link-state changes Claudiu Beznea
2026-10-07  5:53   ` sashiko-bot
2026-10-07  5:36 ` [PATCH v6 9/9] PCI: rzg3s-host: Add bridge::reset_root_port() Claudiu Beznea
2026-10-07  5:54   ` sashiko-bot

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=sashiko-outbox-162648@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=claudiu.beznea@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=wsa+renesas@sang-engineering.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox