spi: spi-geni-qcom: Print an error when we timeout setting the CS
authorDouglas Anderson <dianders@chromium.org>
Thu, 17 Dec 2020 22:29:14 +0000 (14:29 -0800)
committerMark Brown <broonie@kernel.org>
Fri, 18 Dec 2020 17:42:17 +0000 (17:42 +0000)
If we're using geni to manage the chip select line (don't do it--use a
GPIO!) and we happen to get a timeout waiting for the chip select
command to be completed, no errors are printed even though things
might not be in the best shape.  Let's add a print.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20201217142842.v3.4.I666b37646de9652cef438ac7c2c6c2053367fc6b@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-geni-qcom.c

index 365565d3a998377f6c1cfd762bcc2966a0ebe762..881f645661cc6137fd20cc7376e90b57e265a9f1 100644 (file)
@@ -223,8 +223,10 @@ static void spi_geni_set_cs(struct spi_device *slv, bool set_flag)
        spin_unlock_irq(&mas->lock);
 
        time_left = wait_for_completion_timeout(&mas->cs_done, HZ);
-       if (!time_left)
+       if (!time_left) {
+               dev_warn(mas->dev, "Timeout setting chip select\n");
                handle_fifo_timeout(spi, NULL);
+       }
 
 exit:
        pm_runtime_put(mas->dev);