lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <95b2ac7b-c9c9-4f05-a1d2-3e70fe388dd9@ti.com>
Date: Fri, 5 Dec 2025 18:24:51 +0530
From: "Dutta, Anurag" <a-dutta@...com>
To: Mark Brown <broonie@...nel.org>, Nishanth Menon <nm@...com>
CC: Francesco Dolcini <francesco@...cini.it>, Siddharth Vadapalli
	<s-vadapalli@...com>, <linux-spi@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <stable@...r.kernel.org>, "Gujulan Elango,
 Hari Prasath" <gehariprasath@...com>, "Kumar, Udit" <u-kumar1@...com>
Subject: Re: [PATCH] spi: cadence-quadspi: Fix clock enable underflows due to
 runtime PM

Hi Mark and Nishanth The below seems to work for me on j721e. Let me 
know your thoughts. Apply over 6987d58a9cbc5bd57c983baa514474a86c945d56. 
Also, the error actually comes from : if (cqspi->use_direct_mode) { ret 
= cqspi_request_mmap_dma(cqspi); if (ret == -EPROBE_DEFER) goto 
probe_setup_failed; } And not from flash_setup().

diff --git a/drivers/spi/spi-cadence-quadspi.c 
b/drivers/spi/spi-cadence-quadspi.c index af6d050da1c8..492b44976e52 
100644 --- a/drivers/spi/spi-cadence-quadspi.c +++ 
b/drivers/spi/spi-cadence-quadspi.c @@ -2024,7 +2024,7 @@ static int 
cqspi_probe(struct platform_device *pdev) probe_reset_failed: if 
(cqspi->is_jh7110) cqspi_jh7110_disable_clk(pdev, cqspi); - 
clk_disable_unprepare(cqspi->clk); + pm_runtime_force_suspend(dev); 
probe_clk_failed: return ret; }

Regards Anurag

On 04-12-2025 22:35, Mark Brown wrote:
> On Thu, Dec 04, 2025 at 03:11:26PM +0000, Mark Brown wrote:
>> On Thu, Dec 04, 2025 at 08:05:30AM -0600, Nishanth Menon wrote:
>>> The clock is already turned off by the runtime-PM suspend callback, so an
>>> extra clk_disable*_unprepare() is only correct when runtime-PM support is
>>> not in use.
>> Right, I'm pretty sure that's where the extra disable is coming from.
>> The pm_runtime_set_active() further up the function is looking rather
>> suspect here.
> qspi_setup_flash() is just reading DT data, it's not actually
> interacting with the hardware at all, so I think we can sidestep the
> immediate issue by just moving it to where we parse the DT for the
> controller.  It's not fixing the actual issue with the missing/extra
> clock reference but it does get us back to where we were:
>
> diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
> index af6d050da1c8..bdbeef05cd72 100644
> --- a/drivers/spi/spi-cadence-quadspi.c
> +++ b/drivers/spi/spi-cadence-quadspi.c
> @@ -1845,6 +1845,12 @@ static int cqspi_probe(struct platform_device *pdev)
>   		return -ENODEV;
>   	}
>   
> +	ret = cqspi_setup_flash(cqspi);
> +	if (ret) {
> +		dev_err(dev, "failed to setup flash parameters %d\n", ret);
> +		return ret;
> +	}
> +
>   	/* Obtain QSPI clock. */
>   	cqspi->clk = devm_clk_get(dev, NULL);
>   	if (IS_ERR(cqspi->clk)) {
> @@ -1988,12 +1994,6 @@ static int cqspi_probe(struct platform_device *pdev)
>   		pm_runtime_get_noresume(dev);
>   	}
>   
> -	ret = cqspi_setup_flash(cqspi);
> -	if (ret) {
> -		dev_err(dev, "failed to setup flash parameters %d\n", ret);
> -		goto probe_setup_failed;
> -	}
> -
>   	host->num_chipselect = cqspi->num_chipselect;
>   
>   	if (ddata && (ddata->quirks & CQSPI_SUPPORT_DEVICE_RESET))
>
> I'll send this out later assuming nothing blows up in my CI and nobody
> else notices an issue.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ