From: Heiner Kallweit <hkallweit1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Brian Norris
<computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
MTD Maling List
<linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
Cyrille Pitchen
<cyrille.pitchen-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>,
Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>,
Han Xu <han.xu-3arQi8VN3Tc@public.gmane.org>,
linux-spi <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 2/2] mtd: m25p80: consider max_transfer_size when reading
Date: Mon, 6 Jun 2016 23:02:22 +0200 [thread overview]
Message-ID: <094596dc-ad0f-1962-ebcc-91cc59fda44d@gmail.com> (raw)
In-Reply-To: <CAOMqctRH9a0QmubdAvbyk=AC10MSa=nsNRkSURU+JOwKrN9HCA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Am 06.06.2016 um 21:40 schrieb Michal Suchanek:
> On 6 June 2016 at 20:53, Heiner Kallweit <hkallweit1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> Am 06.06.2016 um 19:40 schrieb Mark Brown:
>>> On Sat, Jun 04, 2016 at 12:22:37AM +0200, Heiner Kallweit wrote:
>>>
>>> Please fix your mail client to word wrap within paragraphs at
>>> something substantially less than 80 columns. Doing this makes your
>>> messages much easier to read and reply to.
>>>
>>>> Am 06.05.2016 um 14:14 schrieb Mark Brown:
>>>
>>>>> Yes, it's called the maximum transfer size because it is the
>>>>> maximum size of a transfer, not because it's the maximum size of
>>>>> a message.
>>>
>>>> I'd like to come back to this discussion. You said best would be
>>>> to fix the chip driver. To do this and calculate an appropriate
>>>> value for max_transfer_size the chip driver would have to know that
>>>> the spi_device is a spi-nor device.
>>>
>>> That doesn't make any sense, the controller hardware doesn't
>>> magically change based on what is connected to it.
>>>
>> The issue with fsl-espi is that the controller deactivates CS after
>> each physical transfer. And a lot of HW designs use the hardware CS,
>> therefore the advise to use a GPIO instead doesn't really help.
>>
>> If deactivating and reactivating CS between two transfers doesn't
>> affect the functionality of a spi device then we can go with the
>> full max transfer size.
>>
>> In case of SPI NOR CS needs to stay active between command and data
>> read. Therefore the two transfers in the m25p80 read SPI message need
>> to be combined to one physical transfer by the controller driver.
>> Result is that the max read size is effectively reduced by the length
>> of the m25p80 read command.
>
> Which is what the dummy bytes are used for AFAIK.
> They are received while you are sending the command and white the
> flash is getting ready to send data and after the transfer are deducted
> from the received data in m25p80.
>
Thanks for the feedback.
The dummy bytes are inserted *after* the read command.
Therefore in the low speed modes usually no dummy bytes are needed.
> If this does not work for fsl-espi for some reason it should be corrected.
> I am working with a controller that can transfer 63 bytes at once and
> I am quite positive it does not do any magic transfer coalescing.
> Still it can read a 4Mbyte flash chip.
>
> However, spi-sun4 implements transfer_one and fsl-espi implements
> transfer_one_message so the different interface may work out differently.
>
> Indeed, the spi.c transfer_one_message calls set_cs and then calls
> transfer_one repeatedly which is exactly what fsl-espi cannot do due to
> automagic CS handling. So the fsl-espi limit is probably on message size.
>
> Maybe adding another quirk the m25p80 driver can query to know to deduct
> the command size from the maximum data size would resolve both cases.
>
> Thanks
>
> Michal
>
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-06-06 21:02 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <56D22823.7090005@gmail.com>
[not found] ` <20160405193952.GA5243@localhost>
[not found] ` <57041B43.2000109@gmail.com>
[not found] ` <20160405210727.GB5243@localhost>
[not found] ` <5706B084.2070909@gmail.com>
[not found] ` <5706B084.2070909-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-05-05 23:57 ` [PATCH 2/2] mtd: m25p80: consider max_transfer_size when reading Brian Norris
[not found] ` <20160505235700.GA99474-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2016-05-06 12:14 ` Mark Brown
[not found] ` <20160506121431.GQ6292-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2016-06-03 22:22 ` Heiner Kallweit
[not found] ` <77a22258-95ca-031a-825d-a9e98e30a162-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-06-06 17:40 ` Mark Brown
[not found] ` <20160606174003.GE7510-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2016-06-06 18:28 ` Brian Norris
[not found] ` <20160606182803.GA128439-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2016-06-06 18:34 ` Mark Brown
[not found] ` <20160606183426.GJ7510-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2016-06-06 18:43 ` Brian Norris
[not found] ` <20160606184348.GA135086-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2016-06-06 18:48 ` Mark Brown
2016-06-06 18:53 ` Heiner Kallweit
[not found] ` <a57adb90-0d80-186f-17d3-6fdf106bfb4a-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-06-06 19:40 ` Michal Suchanek
[not found] ` <CAOMqctRH9a0QmubdAvbyk=AC10MSa=nsNRkSURU+JOwKrN9HCA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-06 21:02 ` Heiner Kallweit [this message]
2016-06-06 19:46 ` Geert Uytterhoeven
2016-06-06 21:20 ` Heiner Kallweit
[not found] ` <971ad721-5644-e5f9-2918-65db0e6b1996-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-06-06 22:28 ` Marek Vasut
[not found] ` <5755F8FB.2070409-ynQEQJNshbs@public.gmane.org>
2016-06-07 4:52 ` Heiner Kallweit
2016-06-06 23:07 ` Mark Brown
[not found] ` <20160606230752.GM7510-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2016-06-07 6:03 ` Heiner Kallweit
[not found] ` <fe0042f9-66c9-51fd-ca91-641c5cc25c40-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-06-07 8:10 ` Michal Suchanek
[not found] ` <CAOMqctRmtCXurb8A05m2kw+9EjU+AWB8Uj0z1FPO792kGG=36Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-07 20:42 ` Heiner Kallweit
2016-06-08 19:51 ` Heiner Kallweit
[not found] ` <20977e07-6354-2753-8286-e992c32454d1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-06-09 7:12 ` Michal Suchanek
[not found] ` <CAOMqctQfsN4OoXN59yH13n-UJiEUJVOkxzMTMAndmBc8Dq+ANA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-17 20:13 ` Heiner Kallweit
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=094596dc-ad0f-1962-ebcc-91cc59fda44d@gmail.com \
--to=hkallweit1-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=cyrille.pitchen-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org \
--cc=han.xu-3arQi8VN3Tc@public.gmane.org \
--cc=hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=marex-ynQEQJNshbs@public.gmane.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;
as well as URLs for NNTP newsgroup(s).