From: Pratyush Yadav <p.yadav@ti.com>
To: Niklas Cassel <Niklas.Cassel@wdc.com>
Cc: Jagan Teki <jagan@amarulasolutions.com>,
"damien.lemoal@opensource.wdc.com"
<damien.lemoal@opensource.wdc.com>,
Sean Anderson <seanga2@gmail.com>,
"u-boot@lists.denx.de" <u-boot@lists.denx.de>
Subject: Re: [PATCH] spi: dw: Fix broken dw_spi_mem_ops()
Date: Wed, 9 Feb 2022 17:01:00 +0530 [thread overview]
Message-ID: <20220209113100.qs65sdqj4tzt7pan@ti.com> (raw)
In-Reply-To: <20220208225236.1058824-1-Niklas.Cassel@wdc.com>
On 08/02/22 10:52PM, Niklas Cassel wrote:
> From: Niklas Cassel <niklas.cassel@wdc.com>
>
> The driver is currently using sizeof(op->cmd.opcode) in the op_len
> calculation. Commit d15de623013c ("spi: spi-mem: allow specifying a
> command's extension") changed op->cmd.opcode from one byte to two.
>
> Instead, a new struct member op->cmd.nbytes is supposed to be used.
> For regular commands op->cmd.nbytes will be one.
>
> Commit d15de623013c ("spi: spi-mem: allow specifying a command's
> extension") did update some drivers that overload the generic mem_ops()
> implementation, but forgot to update dw_spi_mem_ops().
>
> Calculating op_len incorrectly causes dw_spi_mem_ops() to misbehave, since
> op_len is used to determine how many bytes that should be read/written.
>
> On the canaan k210 board, this causes the probe of the SPI flash to fail.
>
> Fix the op_len calculation in dw_spi_mem_ops(). Doing so results in
> working SPI flash on the canaan k210 board.
>
> Fixes: d15de623013c ("spi: spi-mem: allow specifying a command's extension")
> Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
--
Regards,
Pratyush Yadav
Texas Instruments Inc.
next prev parent reply other threads:[~2022-02-09 11:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-08 22:52 [PATCH] spi: dw: Fix broken dw_spi_mem_ops() Niklas Cassel
2022-02-09 11:31 ` Pratyush Yadav [this message]
2022-02-09 23:18 ` Damien Le Moal
2022-02-24 8:11 ` Jagan Teki
2022-03-01 11:33 ` Niklas Cassel
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=20220209113100.qs65sdqj4tzt7pan@ti.com \
--to=p.yadav@ti.com \
--cc=Niklas.Cassel@wdc.com \
--cc=damien.lemoal@opensource.wdc.com \
--cc=jagan@amarulasolutions.com \
--cc=seanga2@gmail.com \
--cc=u-boot@lists.denx.de \
/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