[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f3fd9ac0-3bcb-4281-94fa-cadfdc2b26af@sirena.org.uk>
Date: Fri, 28 Jun 2024 14:52:36 +0100
From: Mark Brown <broonie@...nel.org>
To: Witold Sadowski <wsadowski@...vell.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-spi@...r.kernel.org" <linux-spi@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"robh@...nel.org" <robh@...nel.org>,
"krzysztof.kozlowski+dt@...aro.org" <krzysztof.kozlowski+dt@...aro.org>,
"conor+dt@...nel.org" <conor+dt@...nel.org>,
"pthombar@...ence.com" <pthombar@...ence.com>
Subject: Re: [EXTERNAL] Re: [PATCH v9 4/9] spi: cadence: Add Marvell SDMA
operations
On Fri, Jun 28, 2024 at 01:45:13PM +0000, Witold Sadowski wrote:
> Hi Mark
> > > + while (len) {
> > > + tmp_buf = readq(addr);
> > > + memcpy(buf, &tmp_buf, len > 8 ? 8 : len);
> > > + len = len > 8 ? len - 8 : 0;
> > > + buf += 8;
> > > + }
> > > +}
> > Wouldn't it be more efficient and readable to only do the memcpy() for the
> > trailing bytes and just do this memcpy() for the final word?
> The whole problem is with SDMA end - addr in that case. If code will try to
> Read it in non 64b mode, all remaining bits, will be lost.
> For example - doing 1B read on that register, will return 1B, but SDMA will
> transfer 8B, dropping remaining 7B.
> I have tried memcpy approach, and it was not stable.
That's not what I'm suggesting, like I said above I'm suggesting to
*only* do the memcpy() for the trailing word.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists