Re: [PATCH] spi: pxa2xx: Fix cs_change management

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 20, 2016 at 8:30 PM, Christophe Ricard
<christophe.ricard@xxxxxxxxx> 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@xxxxxx>
> ---
>  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@xxxxxxxxxxxxxxx
> 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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux