lkml.org 
[lkml]   [2020]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] spi: fix cs_change for last transfer
On Sun, Mar 15, 2020 at 06:08:53PM +0100, Michał Mirosław wrote:

> Generic spi_transfer_one_message() implementation introduced in
> commit b158935f70b9 has a bug in cs_change handling: it keeps CS
> asserted when cs_change is set. Fix it.

> struct spi_transfer *xfer;
> - bool keep_cs = false;
> + bool keep_cs = true;
> int ret = 0;
> struct spi_statistics *statm = &ctlr->statistics;
> struct spi_statistics *stats = &msg->spi->statistics;
> @@ -1268,7 +1268,7 @@ static int spi_transfer_one_message(struct spi_controller *ctlr,
> if (xfer->cs_change) {
> if (list_is_last(&xfer->transfer_list,
> &msg->transfers)) {
> - keep_cs = true;
> + keep_cs = false;
> } else {

This is the opposite of the intended behaviour - we want to deassert
chip select at the end of the message unless cs_change is set on the
last transfer. If this were broken I would expect to see widespread
problems being reported.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2020-03-16 13:19    [W:0.040 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site