From: Mark Brown <broonie@kernel.org>
To: Purna Chandra Mandal <purna.mandal@microchip.com>
Cc: linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org,
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
Joshua Henderson <digitalpeer@digitalpeer.com>,
Ulf Hansson <ulf.hansson@linaro.org>
Subject: Re: [PATCH v4 2/2] spi: spi-pic32: Add PIC32 SPI master driver
Date: Tue, 29 Mar 2016 09:25:01 -0700 [thread overview]
Message-ID: <20160329162501.GP2350@sirena.org.uk> (raw)
In-Reply-To: <56FA6EE1.3000405@microchip.com>
[-- Attachment #1: Type: text/plain, Size: 1375 bytes --]
On Tue, Mar 29, 2016 at 05:32:41PM +0530, Purna Chandra Mandal wrote:
> It is required for MMC-over-SPI support. Linux MMC_SPI driver sometimes
> (depending on some logic) want chip-select to be kept enabled (using
> transfer.cs_change) even at the end of SPI message so that following
> message(s) can also be made part of the running MMC transaction.
> In this case if there is any error (and in some other cases as well)
If your hardware doesn't support per-/CS setup then your driver needs to
record whatever is configured via setup() and apply it later.
> MMC_SPI will have to terminate on-going MMC transactions and it is
> done by calling setup(). It is assumed that setup() will always leave
> the chip-select deactivated.
No, this is just completely broken - that's quite simply not what
setup() does. See spi-summary. There is *no* code in the core that
terminates ongoing transfers as a result of calling setup(), if that's
happening it's a result of triggering error handling.
> Best thing I can add is wait for unprepare_message() before calling
> cleanup().
The cleanup() function is for deallocating dynamically allocated data,
it will be called by the core.
> If you could suggest better alternative that will be great.
If you want to change the chip select you need to use the normal
interfaces for changing the chip select via message processing.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2016-03-29 16:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-23 13:42 [PATCH v4 1/2] dt/bindings: Add bindings for PIC32 SPI peripheral Purna Chandra Mandal
2016-03-23 13:42 ` [PATCH v4 2/2] spi: spi-pic32: Add PIC32 SPI master driver Purna Chandra Mandal
2016-03-28 19:26 ` Mark Brown
2016-03-29 12:02 ` Purna Chandra Mandal
2016-03-29 16:25 ` Mark Brown [this message]
2016-03-30 10:49 ` Purna Chandra Mandal
2016-03-30 15:48 ` Mark Brown
2016-03-31 11:09 ` Purna Chandra Mandal
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=20160329162501.GP2350@sirena.org.uk \
--to=broonie@kernel.org \
--cc=digitalpeer@digitalpeer.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=purna.mandal@microchip.com \
--cc=sergei.shtylyov@cogentembedded.com \
--cc=ulf.hansson@linaro.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