[PATCH 03/15] mmc: bcm2835: Fix pio_timeout handling

Stefan Wahren stefan.wahren at i2se.com
Tue Feb 7 12:45:42 PST 2017


The pio_timeout is initialized with a jiffie value, but during
pio transfer it's assumed to be a msec value. Since the timeout
never changes we better use the value directly.

Signed-off-by: Stefan Wahren <stefan.wahren at i2se.com>
---
 drivers/mmc/host/bcm2835.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c
index 7b935d6..81aa8f4 100644
--- a/drivers/mmc/host/bcm2835.c
+++ b/drivers/mmc/host/bcm2835.c
@@ -160,7 +160,6 @@ struct bcm2835_host {
 	struct mmc_host		*mmc;
 	struct platform_device	*pdev;
 
-	u32			pio_timeout;	/* In jiffies */
 	int			clock;		/* Current clock speed */
 	unsigned int		max_clk;	/* Max possible freq */
 	struct work_struct      dma_work;
@@ -397,7 +396,7 @@ static void bcm2835_transfer_block_pio(struct bcm2835_host *host,
 
 	blksize = host->data->blksz;
 
-	wait_max = jiffies + msecs_to_jiffies(host->pio_timeout);
+	wait_max = jiffies + msecs_to_jiffies(500);
 
 	local_irq_save(flags);
 
@@ -1402,7 +1401,6 @@ static int bcm2835_probe(struct platform_device *pdev)
 	host = mmc_priv(mmc);
 	host->mmc = mmc;
 	host->pdev = pdev;
-	host->pio_timeout = msecs_to_jiffies(500);
 	host->pio_limit = 1;
 	host->max_delay = 1; /* Warn if over 1ms */
 	spin_lock_init(&host->lock);
-- 
1.7.9.5




More information about the linux-rpi-kernel mailing list