From: Christophe Ricard <christophe.ricard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Andy Shevchenko
<andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Mika Westerberg
<mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
linux-spi <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Christophe RICARD
<christophe-h.ricard-qxv4g6HH51o@public.gmane.org>,
benoit.houyere-qxv4g6HH51o@public.gmane.org,
Jean-Luc Blanc <jean-luc.blanc-qxv4g6HH51o@public.gmane.org>
Subject: Re: [PATCH] spi: pxa2xx: Fix cs_change management
Date: Mon, 21 Mar 2016 23:12:15 +0100 [thread overview]
Message-ID: <56F071BF.5040800@gmail.com> (raw)
In-Reply-To: <CAHp75VdJ3Rgvrh5=7tCUs8it_7G=POhNiKWLcK=55=i3HRtCgA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Hi Andy,
Yes i came accross this issue when working on Minnowboard Max. This is
the easiest fix i have found.
The option you are talking about would require to convert the
transfer_one_message to transfer_one which is pertinent in my opinion as
well.
Would it be acceptable to take this patch as a short term solution ?
Best Regards
Christophe
On 20/03/2016 20:42, Andy Shevchenko wrote:
> On Sun, Mar 20, 2016 at 8:30 PM, Christophe Ricard
> <christophe.ricard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> Fix cs_change management so that it is in line with other spi drivers.
>>
>> In the spi core api helpers such as spi_bus_lock/unlock and spi_sync_locked
>> or cs_change field in spi_transfer help to manage chip select from the
>> device driver.
>>
>> The driver was setting the chip select to idle if the message queue was
>> empty despite cs_change or other status field set by spi_bus_lock/unlock
>> or spi_sync_locked.
> Do you have experience the issues right now?
>
> In long term prospective I would like to see this driver converted to
> use more parts from SPI core. giveback() function will gone if that
> conversion happens.
>
>> Signed-off-by: Christophe Ricard <christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
>> ---
>> drivers/spi/spi-pxa2xx.c | 5 ++---
>> 1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
>> index ab9914a..ed034ed 100644
>> --- a/drivers/spi/spi-pxa2xx.c
>> +++ b/drivers/spi/spi-pxa2xx.c
>> @@ -532,9 +532,8 @@ static void giveback(struct driver_data *drv_data)
>> /* see if the next and current messages point
>> * to the same chip
>> */
>> - if (next_msg && next_msg->spi != msg->spi)
>> - next_msg = NULL;
>> - if (!next_msg || msg->state == ERROR_STATE)
>> + if ((next_msg && next_msg->spi != msg->spi) ||
>> + msg->state == ERROR_STATE)
>> cs_deassert(drv_data);
>> }
>>
>> --
>> 2.5.0
>>
>> --
>> 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
>
>
--
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-03-21 22:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-20 18:30 [PATCH] spi: pxa2xx: Fix cs_change management Christophe Ricard
[not found] ` <1458498617-11566-1-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2016-03-20 19:42 ` Andy Shevchenko
[not found] ` <CAHp75VdJ3Rgvrh5=7tCUs8it_7G=POhNiKWLcK=55=i3HRtCgA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-03-21 22:12 ` Christophe Ricard [this message]
2016-03-29 7:42 ` Applied "spi: pxa2xx: Fix cs_change management" to the spi tree 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=56F071BF.5040800@gmail.com \
--to=christophe.ricard-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=benoit.houyere-qxv4g6HH51o@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=christophe-h.ricard-qxv4g6HH51o@public.gmane.org \
--cc=jean-luc.blanc-qxv4g6HH51o@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mika.westerberg-VuQAYsv1563Yd54FQh9/CA@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).