linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch V1 1/3] spi: imx: replace schedule() with cond_resched()
@ 2016-11-24 11:04 Gao Pan
       [not found] ` <1479985484-6641-1-git-send-email-pandy.gao-3arQi8VN3Tc@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Gao Pan @ 2016-11-24 11:04 UTC (permalink / raw)
  To: broonie-DgEjT+Ai2ygdnm+yROfE0A
  Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA, pandy.gao-3arQi8VN3Tc,
	frank.li-3arQi8VN3Tc, fugang.duan-3arQi8VN3Tc

It's more rational that just do the schedule when necessary
other than do it every time. Thus, it's better to replace
schedule() with cond_resched() in fsl_lpspi_txfifo_empty(),
which contributes to saving cpu time.

Signed-off-by: Gao Pan <pandy.gao-3arQi8VN3Tc@public.gmane.org>
---
 drivers/spi/spi-fsl-lpspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c
index bcb7b28..901bef4 100644
--- a/drivers/spi/spi-fsl-lpspi.c
+++ b/drivers/spi/spi-fsl-lpspi.c
@@ -178,7 +178,7 @@ static int fsl_lpspi_txfifo_empty(struct fsl_lpspi_data *fsl_lpspi)
 			dev_dbg(fsl_lpspi->dev, "txfifo empty timeout\n");
 			return -ETIMEDOUT;
 		}
-		schedule();
+		cond_resched();
 
 	} while (txcnt);
 
-- 
1.9.1

--
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] 6+ messages in thread

end of thread, other threads:[~2016-11-25 13:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-24 11:04 [Patch V1 1/3] spi: imx: replace schedule() with cond_resched() Gao Pan
     [not found] ` <1479985484-6641-1-git-send-email-pandy.gao-3arQi8VN3Tc@public.gmane.org>
2016-11-24 11:04   ` [Patch V1 2/3] spi: imx: fix potential shift truncation Gao Pan
     [not found]     ` <1479985484-6641-2-git-send-email-pandy.gao-3arQi8VN3Tc@public.gmane.org>
2016-11-25 13:10       ` Applied "spi: imx: fix potential shift truncation" to the spi tree Mark Brown
2016-11-24 11:04   ` [Patch V1 3/3] spi: imx: use prepare_transfer_hardware() for lpspi Gao Pan
     [not found]     ` <1479985484-6641-3-git-send-email-pandy.gao-3arQi8VN3Tc@public.gmane.org>
2016-11-25 13:10       ` Applied "spi: imx: use prepare_transfer_hardware() for lpspi" to the spi tree Mark Brown
2016-11-25 13:10   ` Applied "spi: imx: replace schedule() with cond_resched()" " 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).