* [PATCH] spi: pxa2xx: Fix cs_change management @ 2016-03-20 18:30 Christophe Ricard [not found] ` <1458498617-11566-1-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: Christophe Ricard @ 2016-03-20 18:30 UTC (permalink / raw) To: broonie-DgEjT+Ai2ygdnm+yROfE0A Cc: mika.westerberg-VuQAYsv1563Yd54FQh9/CA, linux-spi-u79uwXL29TY76Z2rM5mHXA, christophe.ricard-Re5JQEeQqe8AvxtiuMwx3w, christophe-h.ricard-qxv4g6HH51o, benoit.houyere-qxv4g6HH51o, jean-luc.blanc-qxv4g6HH51o 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. 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 ^ permalink raw reply related [flat|nested] 4+ messages in thread
[parent not found: <1458498617-11566-1-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>]
* Re: [PATCH] spi: pxa2xx: Fix cs_change management [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-29 7:42 ` Applied "spi: pxa2xx: Fix cs_change management" to the spi tree Mark Brown 1 sibling, 1 reply; 4+ messages in thread From: Andy Shevchenko @ 2016-03-20 19:42 UTC (permalink / raw) To: Christophe Ricard Cc: Mark Brown, Mika Westerberg, linux-spi, Christophe RICARD, benoit.houyere-qxv4g6HH51o, Jean-Luc Blanc 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 -- With Best Regards, Andy Shevchenko -- 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <CAHp75VdJ3Rgvrh5=7tCUs8it_7G=POhNiKWLcK=55=i3HRtCgA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] spi: pxa2xx: Fix cs_change management [not found] ` <CAHp75VdJ3Rgvrh5=7tCUs8it_7G=POhNiKWLcK=55=i3HRtCgA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2016-03-21 22:12 ` Christophe Ricard 0 siblings, 0 replies; 4+ messages in thread From: Christophe Ricard @ 2016-03-21 22:12 UTC (permalink / raw) To: Andy Shevchenko Cc: Mark Brown, Mika Westerberg, linux-spi, Christophe RICARD, benoit.houyere-qxv4g6HH51o, Jean-Luc Blanc 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Applied "spi: pxa2xx: Fix cs_change management" to the spi tree [not found] ` <1458498617-11566-1-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org> 2016-03-20 19:42 ` Andy Shevchenko @ 2016-03-29 7:42 ` Mark Brown 1 sibling, 0 replies; 4+ messages in thread From: Mark Brown @ 2016-03-29 7:42 UTC (permalink / raw) To: Christophe Ricard, Mark Brown; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA The patch spi: pxa2xx: Fix cs_change management has been applied to the spi tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From a52db659c79ceede44e2d5ca63ca058d49df8dea Mon Sep 17 00:00:00 2001 From: Christophe Ricard <christophe.ricard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Date: Sun, 20 Mar 2016 19:30:17 +0100 Subject: [PATCH] spi: pxa2xx: Fix cs_change management 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. Signed-off-by: Christophe Ricard <christophe-h.ricard-qxv4g6HH51o@public.gmane.org> Signed-off-by: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@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 86c155aea0cf..0ce82db8e484 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -570,9 +570,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.8.0.rc3 -- 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 ^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-03-29 7:42 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 2016-03-29 7:42 ` Applied "spi: pxa2xx: Fix cs_change management" to the spi tree Mark Brown
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).