Linux SPI subsystem development
 help / color / mirror / Atom feed
From: "Jonathan Lemon" <jonathan.lemon@gmail.com>
To: "Ricardo Ribalda Delgado" <ribalda@kernel.org>
Cc: "Mark Brown" <broonie@kernel.org>,
	linux-spi <linux-spi@vger.kernel.org>,
	kernel-team@fb.com
Subject: Re: [PATCH] spi: xilinx: Inhibit transmitter while filling TX FIFO
Date: Fri, 07 May 2021 19:44:58 -0700	[thread overview]
Message-ID: <0B4232D1-E80F-404A-B388-C53EFDF70DDA@gmail.com> (raw)
In-Reply-To: <3E382801-224D-4B11-961D-4822F51F5496@gmail.com>

On 7 May 2021, at 17:46, Jonathan Lemon wrote:

> On 7 May 2021, at 16:02, Ricardo Ribalda Delgado wrote:
>
>> Hi Jonathan
>>
>> Thanks for your patch.
>>
>> On Fri, May 7, 2021 at 11:53 PM Jonathan Lemon 
>> <jonathan.lemon@gmail.com> wrote:
>>>
>>> Contrary to the comment in xilinx_spi_txrx_bufs(), the transmitter
>>> was not disabled on entry.  On my particular board, when sending a 
>>> PP
>>> sequence, the first address byte was clocked out 3 times, writing 
>>> data
>>> into the wrong location, and generally locking up the chip.
>>
>> Sorry, what do you mean by PP sequence?
>>
>> By clocked out 3 times you mean that the sequence is sent like
>> B0........B1.........B2
>> instead of:
>> B0B1B2
>
> PP: Page program.  When I’m trying to write to the flash, the 
> sequence
> [opcode 02][A1 A2 A3][D1 D2 ..] is sent.  The result is a flash write
> at location [A1 A1 A1] = [A2 A3 D1 D2 ...]
>
> In other words, the first byte of the address appears to have been
> sent to the chip 3x.
>
>
>> If your hardware supports IRQ. can you try forcing use_irq to true?
>
> Will try this in a bit.  The hw does have an irq registered, but it
> it isn't always set, as it depends on how many how many bytes the
> spi_transfer sets.  So sometimes it will set use_irq, and sometimes 
> not.

So I tried the following change:

-       if (xspi->irq >= 0 &&  remaining_words > xspi->buffer_size) {
+       if (xspi->irq >= 0) {

And that also allows writes to to through successfully.   Perhaps
this is a simpler change that would work?
-- 
Jonathan

  parent reply	other threads:[~2021-05-08  2:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-07 21:53 [PATCH] spi: xilinx: Inhibit transmitter while filling TX FIFO Jonathan Lemon
2021-05-07 23:02 ` Ricardo Ribalda Delgado
     [not found]   ` <3E382801-224D-4B11-961D-4822F51F5496@gmail.com>
2021-05-08  2:44     ` Jonathan Lemon [this message]
2021-05-08 10:02       ` Ricardo Ribalda Delgado
2021-05-08 10:01     ` Ricardo Ribalda Delgado

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=0B4232D1-E80F-404A-B388-C53EFDF70DDA@gmail.com \
    --to=jonathan.lemon@gmail.com \
    --cc=broonie@kernel.org \
    --cc=kernel-team@fb.com \
    --cc=linux-spi@vger.kernel.org \
    --cc=ribalda@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