lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160329162501.GP2350@sirena.org.uk>
Date:	Tue, 29 Mar 2016 09:25:01 -0700
From:	Mark Brown <broonie@...nel.org>
To:	Purna Chandra Mandal <purna.mandal@...rochip.com>
Cc:	linux-kernel@...r.kernel.org, linux-spi@...r.kernel.org,
	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
	Joshua Henderson <digitalpeer@...italpeer.com>,
	Ulf Hansson <ulf.hansson@...aro.org>
Subject: Re: [PATCH v4 2/2] spi: spi-pic32: Add PIC32 SPI master driver

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.

Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ