From: "Nuno Sá" <nuno.sa@analog.com>
To: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
Parshuram Thombare <pthombar@cadence.com>,
devicetree@vger.kernel.org, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Jisheng Zhang <jszhang@kernel.org>,
Fei Xie <fei.xie@horizon.auto>
Subject: Re: [PATCH 3/3] spi: cadence-xspi: add ACMD mode support
Date: Fri, 30 Oct 2026 10:16:00 +0000 [thread overview]
Message-ID: <auRqTXctbxuuEfLL@nsa> (raw)
In-Reply-To: <179329269255.62540.11497211982924609522.b4-review@b4>
On Thu, Oct 29, 2026 at 04:51:32PM +0000, Mark Brown wrote:
> > So far every operation goes through STIG mode, where the CPU builds
> > each command and drains the data. The controller also has an auto
> > command (ACMD) mode where it runs a whole read sequence on its own and,
> > with the internal DMA, writes the data straight to memory.
>
> > +static int cdns_xspi_set_work_mode(struct cdns_xspi_dev *cdns_xspi, int mode)
> > +{
> > + int ret;
> > +
> > + if (cdns_xspi->cur_work_mode == mode)
> > + return 0;
>
> We need some suspend/resume handling to invalidate the configuration
> when the IP power goes so we set everything up again. I'm not seeing
> anything here.
Yeah, I did saw sashiko complain (and my local LLM also raised it
actually) but I do wonder how can that happen? So we need to assume that
in suspend we might lose power (maybe because it's regulator powers down)
and need to do redo all the important initialization bits?
>
> > @@ -677,6 +893,9 @@ static int cdns_xspi_adjust_mem_op_size(struct spi_mem *mem, struct spi_mem_op *
> > struct cdns_xspi_dev *cdns_xspi =
> > spi_controller_get_devdata(mem->spi->controller);
> >
> > + if (cdns_xspi_acmd_can_read(cdns_xspi, op))
> > + return 0;
>
> That function has a minimum size but not a maximum size...
>
> > +
> > op->data.nbytes = clamp_val(op->data.nbytes, 0, cdns_xspi->sdmasize);
>
> ...which we have here?
For ACMD, in theory we can just configure UINT32_MAX on the register so
not sure if it makes sense to clamp to that?
Unrelated question,
Conor is pushing against the new bindings and that it should be inferred
from the compatible. I tested this on [1] which is not an upstream
platform so I wonder if it's ok to add support for the complete
integration even if the SoC is not upstream?
Long term plan is definitely to upstream it but we do have a lot of debt that
needs clean up.
[1]: https://www.analog.com/en/products/adsp-sc846.html
- Nuno Sá
>
> --
> Mark Brown <broonie@kernel.org>
next prev parent reply other threads:[~2026-10-30 10:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 16:03 [PATCH 0/3] " Nuno Sá
2026-10-29 16:03 ` [PATCH 1/3] spi: cadence-xspi: rename sdma_error to xfer_error Nuno Sá
2026-10-29 16:03 ` [PATCH 2/3] spi: dt-bindings: cdns,xspi: add ACMD and internal DMA properties Nuno Sá
2026-10-29 18:31 ` Conor Dooley
2026-10-30 9:57 ` Nuno Sá
2026-10-30 18:45 ` Conor Dooley
2026-10-29 16:03 ` [PATCH 3/3] spi: cadence-xspi: add ACMD mode support Nuno Sá
2026-10-29 16:51 ` Mark Brown
2026-10-30 10:16 ` Nuno Sá [this message]
2026-10-30 11:03 ` Mark Brown
2026-10-30 16:00 ` Nuno Sá
2026-10-30 18:40 ` Conor Dooley
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=auRqTXctbxuuEfLL@nsa \
--to=nuno.sa@analog.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=fei.xie@horizon.auto \
--cc=jszhang@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=pthombar@cadence.com \
--cc=robh@kernel.org \
/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®