Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Inochi Amaoto" <inochiama@gmail.com>
Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v8 2/6] PCI: spacemit-k1: Add multiple PHY handles support
Date: Wed, 25 Nov 2026 04:26:02 +0000	[thread overview]
Message-ID: <sashiko-outbox-232574@kernel.org> (raw)
In-Reply-To: <20261125041523.242588-3-inochiama@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] PCI: spacemit-k1: build failure due to undeclared phy_bulk APIs
--

commit 0e939e698b5ba47d963ad632ba592ec50b9439b0
Author: Inochi Amaoto <inochiama@gmail.com>

PCI: spacemit-k1: Add multiple PHY handles support

This commit converts the SpacemiT K1 PCIe driver from handling a single
PHY to supporting multiple PHY handles via the phy_bulk API.

> diff --git a/drivers/pci/controller/dwc/pcie-spacemit-k1.c b/drivers/pci/controller/dwc/pcie-spacemit-k1.c
> index 658ad2fa87b26..8a3cae32609f7 100644
> --- a/drivers/pci/controller/dwc/pcie-spacemit-k1.c
> +++ b/drivers/pci/controller/dwc/pcie-spacemit-k1.c
> @@ -54,12 +54,14 @@ struct k1_pcie_device_data {
>  	const struct dw_pcie_host_ops *host_ops;
>  	const struct dw_pcie_ops *ops;
>  	int (*parse_port)(struct k1_pcie *k1);
> +	unsigned int max_phy_count;
>  };
>  
>  struct k1_pcie {
>  	struct dw_pcie pci;
>  	const struct k1_pcie_device_data *data;
> -	struct phy *phy;
> +	struct phy_bulk_data *phys;
> +	unsigned int phy_count;
>  	void __iomem *link;
>  	struct regmap *pmu;	/* Errors ignored; MMIO-backed regmap */
>  	u32 pmu_off;
> @@ -118,6 +120,25 @@ static void k1_pcie_disable_resources(struct k1_pcie *k1)
>  	clk_bulk_disable_unprepare(ARRAY_SIZE(pci->app_clks), pci->app_clks);
>  }
>  
> +static int k1_pcie_get_phy_handle(struct k1_pcie *k1, struct device_node *node)
> +{
> +	const struct k1_pcie_device_data *data = k1->data;
> +	struct device *dev = k1->pci.dev;
> +	int count;
> +
> +	count = devm_of_phy_bulk_get_all(dev, node, &k1->phys);
> +	if (count < 0)
> +		return count;
> +	if (!count)
> +		return -ENOENT;
> +	if (count > data->max_phy_count)
> +		return -EINVAL;
> +
> +	k1->phy_count = count;
> +
> +	return 0;
> +}
> +
>  /* FIXME: Disable ASPM L1 to avoid errors reported on some NVMe drives */
>  static void k1_pcie_disable_aspm_l1(struct k1_pcie *k1)
>  {
> @@ -173,12 +194,13 @@ static int k1_pcie_init(struct dw_pcie_rp *pp)
>  	 */
>  	regmap_set_bits(k1->pmu, reset_ctrl, DEVICE_TYPE_RC | PCIE_AUX_PWR_DET);
>  
> -	ret = phy_init(k1->phy);
> -	if (ret) {
> -		k1_pcie_disable_resources(k1);
> +	ret = phy_bulk_init(k1->phy_count, k1->phys);
> +	if (ret)
> +		goto failed_phy_init;
>  
> -		return ret;
> -	}
> +	ret = phy_bulk_power_on(k1->phy_count, k1->phys);
> +	if (ret)
> +		goto failed_phy_power_on;
>  
>  	/* Deassert fundamental reset (drive PERST# high) */
>  	regmap_clear_bits(k1->pmu, reset_ctrl, PCIE_RC_PERST);
> @@ -187,6 +209,14 @@ static int k1_pcie_init(struct dw_pcie_rp *pp)
>  	k1_pcie_disable_aspm_l1(k1);
>  
>  	return 0;
> +
> +failed_phy_power_on:
> +	phy_bulk_exit(k1->phy_count, k1->phys);
> +failed_phy_init:
> +	k1_pcie_disable_resources(k1);
> +
> +	return ret;
> +
>  }
>  
>  static void k1_pcie_deinit(struct dw_pcie_rp *pp)
> @@ -198,7 +228,8 @@ static void k1_pcie_deinit(struct dw_pcie_rp *pp)
>  	regmap_set_bits(k1->pmu, k1->pmu_off + PCIE_CLK_RESET_CONTROL,
>  			PCIE_RC_PERST);
>  
> -	phy_exit(k1->phy);
> +	phy_bulk_power_off(k1->phy_count, k1->phys);
> +	phy_bulk_exit(k1->phy_count, k1->phys);

[Severity: Low]
Does this fail to build when CONFIG_PCIE_SPACEMIT_K1 is enabled?  Neither
include/linux/phy/phy.h nor drivers/phy/ defines struct phy_bulk_data or
declares devm_of_phy_bulk_get_all(), phy_bulk_init(), phy_bulk_power_on(),
phy_bulk_power_off(), and phy_bulk_exit().

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125041523.242588-1-inochiama@gmail.com?part=2

  reply	other threads:[~2026-11-25  4:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  4:15 [PATCH v8 0/6] riscv: spacemit: Add PCIe RC controller support for K3 Inochi Amaoto
2026-11-25  4:15 ` [PATCH v8 1/6] PCI: spacemit-k1: Add device data support Inochi Amaoto
2026-11-25  4:15 ` [PATCH v8 2/6] PCI: spacemit-k1: Add multiple PHY handles support Inochi Amaoto
2026-11-25  4:26   ` sashiko-bot [this message]
2026-11-25  4:15 ` [PATCH v8 3/6] PCI: spacemit-k1: Add device id update helper Inochi Amaoto
2026-11-25  4:15 ` [PATCH v8 4/6] dt-bindings: PCI: snps,dw-pcie: Add msi-parent for MSI handle check Inochi Amaoto
2026-11-25  4:15 ` [PATCH v8 5/6] dt-bindings: PCI: spacemit: Introduce Spacemit K3 PCIe host controller Inochi Amaoto
2026-11-25  4:15 ` [PATCH v8 6/6] PCI: spacemit-k1: Add Spacemit K3 PCIe host controller support Inochi Amaoto
2026-11-25  4:30   ` 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-232574@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=inochiama@gmail.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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