From: "DATACOM - Jonatas.Rech" <jonatas.rech@datacom.ind.br>
To: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] spi: fsl-espi: fix behaviour for full-duplex xfers
Date: Wed, 22 Apr 2015 12:09:03 -0300 (BRT) [thread overview]
Message-ID: <363371145.339730.1429715343024.JavaMail.zimbra@datacom.ind.br> (raw)
In-Reply-To: <20150418125556.GR26185@sirena.org.uk>
That's right.
The m25p80 driver can send down a message that's bigger than the amount the spi-fsl-espi driver can handle in a single espi_transfer (64KiB), when the application wants to read the whole memory content, for instance. In this case, the Freescale driver splits the message in 64KiB chunks, adding a "Read the next 64KiB" command in the TX buffer so the flash memory can output data from the expected offset. In the end, the m25p80 driver sees all the data as one big rx_buf, as it expected in the first place.
I don't think a controller driver should make this kind of assumption on how protocol (slave device) drivers intend to use it. Instead, I think this kind of intelligence (about fragmentation and replaying of TX commands) should be in the protocol drivers themselves, aware of the maximum message length the hardware can handle.
Unfortunately, I don't know how many protocol drivers currently rely on this, or even how other controller drivers deal with this expected behavior.
----- Original Message -----
From: "Mark Brown" <broonie@kernel.org>
To: "DATACOM" <jonatas.rech@datacom.ind.br>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Sent: Saturday, April 18, 2015 9:55:56 AM
Subject: Re: [PATCH] spi: fsl-espi: fix behaviour for full-duplex xfers
On Wed, Apr 15, 2015 at 12:23:18PM -0300, Jonatas Rech wrote:
> Furthermore, this correction has exposed an inconsistency in the
> protocol driver <-> controller driver interaction. The spi-fsl-espi
> driver artificially inserts TX bytes when message fragmentation is
> necessary (due to SPCOM_TRANLEN_MAX) instead of informing the
> protocol driver of the hardware limitation. This was tested with the
> m25p80 NOR flash protocol driver. Since fixing this issue may cause
> other client drivers to malfunction, it was left as is.
Sorry, you're saying that the driver is sending more data than it's
being asked to in some situations? That is a *very* serious bug in both
this driver and any other driver which relies on (as opposed to merely
tolerates) this behaviour. If that is the case it really needs to be
fixed fairly urgently.
next prev parent reply other threads:[~2015-04-22 15:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-15 15:23 Jonatas Rech
2015-04-18 12:55 ` Mark Brown
2015-04-22 15:09 ` DATACOM - Jonatas.Rech [this message]
2015-04-22 19:57 ` Mark Brown
2015-04-23 18:06 ` Jonatas Rech
2015-04-24 18:17 ` Mark Brown
2015-04-24 20:03 ` Jonatas Rech
2015-04-25 13:01 ` 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=363371145.339730.1429715343024.JavaMail.zimbra@datacom.ind.br \
--to=jonatas.rech@datacom.ind.br \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.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
Powered by JetHome