Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Bruno Banelli" <bbanelli@gmail.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [BUG] PCI: spacemit-k1: port C probe hard-hangs a CPU with one endpoint on Milk-V Jupiter
Date: Tue, 25 Aug 2026 05:28:29 +0000	[thread overview]
Message-ID: <20260825052829.957911F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260825052249.66921-1-bbanelli@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [High] The patch consists entirely of temporary debugging instrumentation and is explicitly marked as 'not for merging'.

Pre-existing issues:
- [High] DBI register accesses before full Root Complex configuration cause dropped writes and a hard CPU hang with certain endpoints.
--

--- Patch [1]: [BUG] PCI: spacemit-k1: port C probe hard-hangs a CPU with one endpoint on Milk-V Jupiter ---
commit f0ecce23df303a660d238225801529617e3ee9df
Author: Bruno Banelli <bbanelli@gmail.com>

PCI: spacemit-k1: port C probe hard-hangs a CPU with one endpoint on Milk-V Jupiter

This patch adds debug instrumentation to k1_pcie_init() in the spacemit-k1
PCIe driver to localize a hard CPU hang during probe on the Milk-V Jupiter
board. The commit message details extensive testing and indicates the hang
occurs on the first DBI write. The diff itself consists of temporary
dev_info calls to trace the execution flow.

> diff --git a/drivers/pci/controller/dwc/pcie-spacemit-k1.c b/drivers/pci/controller/dwc/pcie-spacemit-k1.c
> index 0564c46e2f484..e35307d693360 100644
> --- a/drivers/pci/controller/dwc/pcie-spacemit-k1.c
> +++ b/drivers/pci/controller/dwc/pcie-spacemit-k1.c
> @@ -127,17 +127,21 @@ static int k1_pcie_init(struct dw_pcie_rp *pp)
>  {
>  	struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
>  	struct k1_pcie *k1 = to_k1_pcie(pci);
> +	struct device *dev = pci->dev;
>  	u32 reset_ctrl;
>  	u32 val;
>  	int ret;
>  
> +	dev_info(dev, "K1DBG 1 toggle_soft_reset\n");

[Severity: High]
Since this patch consists entirely of temporary debugging instrumentation and
the commit message explicitly mentions it is "not for merging", should this
patch be dropped from the merge queue?

>  	k1_pcie_toggle_soft_reset(k1);
>  
> +	dev_info(dev, "K1DBG 2 enable_resources\n");
>  	ret = k1_pcie_enable_resources(k1);
>  	if (ret)
>  		return ret;
>  
>  	/* Set the PCI vendor and device ID */
> +	dev_info(dev, "K1DBG 3 first DBI write (vendor/device ID)\n");
>  	dw_pcie_dbi_ro_wr_en(pci);
>  	dw_pcie_writew_dbi(pci, PCI_VENDOR_ID, PCI_VENDOR_ID_SPACEMIT);
>  	dw_pcie_writew_dbi(pci, PCI_DEVICE_ID, PCI_DEVICE_ID_SPACEMIT_K1);
>  	dw_pcie_dbi_ro_wr_dis(pci);

[Severity: High]
This is a pre-existing issue, but does performing early DBI writes (such as
the Vendor/Device ID here) before asserting PERST#, configuring Root Complex
mode, and completing PHY initialization cause the CPU to hard-hang waiting
for an unanswered completion on certain endpoints?

Is it possible to defer these DBI register accesses until after the full Root
Complex configuration is completed to prevent the CPU from wedging?

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

      reply	other threads:[~2026-08-25  5:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-25  5:22 [BUG] PCI: spacemit-k1: port C probe hard-hangs a CPU with one endpoint on Milk-V Jupiter Bruno Banelli
2026-08-25  5:28 ` sashiko-bot [this message]

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=20260825052829.957911F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bbanelli@gmail.com \
    --cc=linux-pci@vger.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