mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Cercueil <paul.cercueil@bootlin.com>
To: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Thomas Petazzoni	 <thomas.petazzoni@bootlin.com>,
	Bharat Bhushan <bbhushan2@marvell.com>,
	 Sunil Kovvuri Goutham	 <sgoutham@marvell.com>,
	Tanmay Jagdale <tanmay@marvell.com>,
	Jisheng Zhang	 <jszhang@kernel.org>,
	George Cherian <gcherian@marvell.com>,
	Witold Sadowski	 <wsadowski@marvell.com>
Subject: Re: [PATCH v5 6/7] spi: cadence-xspi: Rework resource discovery
Date: Fri, 27 Nov 2026 16:29:17 +0100	[thread overview]
Message-ID: <fd408d339b9a21a94649276c156ff3ab18a9b9e8.camel@bootlin.com> (raw)
In-Reply-To: <179574292141.838304.9533014529156283849.b4-review@b4>

Hi Mark,

Le vendredi 27 novembre 2026 à 01:28 +0000, Mark Brown a écrit :
> > The previous code worked, but calling
> > devm_platform_ioremap_resource_byname() on ACPI where resources aren't
> > named causes warnings to be printed, one per call:
> > 
> > cadence-xspi PRP0001:02: error -EINVAL: invalid resource (null)
> > cadence-xspi PRP0001:02: error -EINVAL: invalid resource (null)
> > cadence-xspi PRP0001:02: error -EINVAL: invalid resource (null)
> > cadence-xspi PRP0001:02: error -EINVAL: invalid resource (null)
> 
> >  #ifdef CONFIG_64BIT
> >  	if (cdns_xspi->driver_data->mrvl_hw_overlay) {
> > -		cdns_xspi->xferbase =
> > devm_platform_ioremap_resource_byname(pdev, "xfer");
> > +		res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
> > "xfer");
> > +		if (!res)
> > +			res = platform_get_resource(pdev, IORESOURCE_MEM,
> > 3);
> > +
> > +		cdns_xspi->xferbase = devm_ioremap_resource(dev, res);
> >  		if (IS_ERR(cdns_xspi->xferbase)) {
> > -			cdns_xspi->xferbase =
> > devm_platform_ioremap_resource(pdev, 3);
> > -			if (IS_ERR(cdns_xspi->xferbase)) {
> > -				dev_info(dev, "XFER register base not
> > found, set it\n");
> > -				// For compatibility with older firmware
> > -				cdns_xspi->xferbase = cdns_xspi->iobase +
> > 0x8000;
> > -			}
> > +			dev_info(dev, "XFER register base not found, set
> > it\n");
> > +			// For compatibility with older firmware
> > +			cdns_xspi->xferbase = cdns_xspi->iobase + 0x8000;
> 
> Shouldn't we go directly here if res is NULL instead of trying to do the
> ioremap, otherwise we'll continue to get errors?  OTOH if we *do* have
> the resource then we know we're supposed to use it instead of the legacy
> one so we should propagate the error instead of guessing.

ACK. I'll send a new version.

Cheers,
-Paul

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

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 11:59 [PATCH v5 0/7] spi: cadence-xspi: Fixes and ACPI changes Paul Cercueil
2026-11-20 11:59 ` [PATCH v5 1/7] spi: cadence-xspi: Properly handle errors in .transfer_one_message Paul Cercueil
2026-11-20 11:59 ` [PATCH v5 2/7] spi: cadence-xspi: Reconfigure to STIG mode before SPI message Paul Cercueil
2026-11-20 11:59 ` [PATCH v5 3/7] spi: cadence-xspi: Inform SPI core about size transferred Paul Cercueil
2026-11-20 11:59 ` [PATCH v5 4/7] spi: cadence-xspi: Clear "SDMA ready" IRQ flag after polling Paul Cercueil
2026-11-20 11:59 ` [PATCH v5 5/7] spi: cadence-xspi: Drop useless cdns_xspi->cur_cs Paul Cercueil
2026-11-20 11:59 ` [PATCH v5 6/7] spi: cadence-xspi: Rework resource discovery Paul Cercueil
2026-11-27  1:28   ` Mark Brown
2026-11-27 15:29     ` Paul Cercueil [this message]
2026-11-20 11:59 ` [PATCH v5 7/7] spi: cadence-xspi: Add workaround for old Marvell firmwares Paul Cercueil
2026-11-27  1:31 ` (subset) [PATCH v5 0/7] spi: cadence-xspi: Fixes and ACPI changes Mark Brown

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=fd408d339b9a21a94649276c156ff3ab18a9b9e8.camel@bootlin.com \
    --to=paul.cercueil@bootlin.com \
    --cc=bbhushan2@marvell.com \
    --cc=broonie@kernel.org \
    --cc=gcherian@marvell.com \
    --cc=jszhang@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=sgoutham@marvell.com \
    --cc=tanmay@marvell.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wsadowski@marvell.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

all inboxes | Powered by JetHome®