Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1315549

[PATCH] Revert "Staging: panel: usleep_range is preferred over udelay"

From Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] Revert "Staging: panel: usleep_range is preferred over udelay"
Date 2016-01-23 10:30 +0100
Message-ID <qU2G5-CL-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


This reverts commit ebd43516d3879f882a403836bba8bc5791f26a28.

We should not be sleeping inside spin_lock.

Fixes: ebd43516d387 ("Staging: panel: usleep_range is preferred over udelay")
Cc: Sirnam Swetha <theonly.ultimate@gmail.com>
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/staging/panel/panel.c | 34 +++++++++++++++-------------------
 1 file changed, 15 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index 79ac192..70b8f4f 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -825,8 +825,7 @@ static void lcd_write_cmd_s(int cmd)
 	lcd_send_serial(0x1F);	/* R/W=W, RS=0 */
 	lcd_send_serial(cmd & 0x0F);
 	lcd_send_serial((cmd >> 4) & 0x0F);
-	/* the shortest command takes at least 40 us */
-	usleep_range(40, 100);
+	udelay(40);		/* the shortest command takes at least 40 us */
 	spin_unlock_irq(&pprt_lock);
 }
 
@@ -837,8 +836,7 @@ static void lcd_write_data_s(int data)
 	lcd_send_serial(0x5F);	/* R/W=W, RS=1 */
 	lcd_send_serial(data & 0x0F);
 	lcd_send_serial((data >> 4) & 0x0F);
-	/* the shortest data takes at least 40 us */
-	usleep_range(40, 100);
+	udelay(40);		/* the shortest data takes at least 40 us */
 	spin_unlock_irq(&pprt_lock);
 }
 
@@ -848,20 +846,19 @@ static void lcd_write_cmd_p8(int cmd)
 	spin_lock_irq(&pprt_lock);
 	/* present the data to the data port */
 	w_dtr(pprt, cmd);
-	/* maintain the data during 20 us before the strobe */
-	usleep_range(20, 100);
+	udelay(20);	/* maintain the data during 20 us before the strobe */
 
 	bits.e = BIT_SET;
 	bits.rs = BIT_CLR;
 	bits.rw = BIT_CLR;
 	set_ctrl_bits();
 
-	usleep_range(40, 100);	/* maintain the strobe during 40 us */
+	udelay(40);	/* maintain the strobe during 40 us */
 
 	bits.e = BIT_CLR;
 	set_ctrl_bits();
 
-	usleep_range(120, 500);	/* the shortest command takes at least 120 us */
+	udelay(120);	/* the shortest command takes at least 120 us */
 	spin_unlock_irq(&pprt_lock);
 }
 
@@ -871,20 +868,19 @@ static void lcd_write_data_p8(int data)
 	spin_lock_irq(&pprt_lock);
 	/* present the data to the data port */
 	w_dtr(pprt, data);
-	/* maintain the data during 20 us before the strobe */
-	usleep_range(20, 100);
+	udelay(20);	/* maintain the data during 20 us before the strobe */
 
 	bits.e = BIT_SET;
 	bits.rs = BIT_SET;
 	bits.rw = BIT_CLR;
 	set_ctrl_bits();
 
-	usleep_range(40, 100);	/* maintain the strobe during 40 us */
+	udelay(40);	/* maintain the strobe during 40 us */
 
 	bits.e = BIT_CLR;
 	set_ctrl_bits();
 
-	usleep_range(45, 100);	/* the shortest data takes at least 45 us */
+	udelay(45);	/* the shortest data takes at least 45 us */
 	spin_unlock_irq(&pprt_lock);
 }
 
@@ -894,7 +890,7 @@ static void lcd_write_cmd_tilcd(int cmd)
 	spin_lock_irq(&pprt_lock);
 	/* present the data to the control port */
 	w_ctr(pprt, cmd);
-	usleep_range(60, 120);
+	udelay(60);
 	spin_unlock_irq(&pprt_lock);
 }
 
@@ -904,7 +900,7 @@ static void lcd_write_data_tilcd(int data)
 	spin_lock_irq(&pprt_lock);
 	/* present the data to the data port */
 	w_dtr(pprt, data);
-	usleep_range(60, 120);
+	udelay(60);
 	spin_unlock_irq(&pprt_lock);
 }
 
@@ -947,7 +943,7 @@ static void lcd_clear_fast_s(void)
 		lcd_send_serial(0x5F);	/* R/W=W, RS=1 */
 		lcd_send_serial(' ' & 0x0F);
 		lcd_send_serial((' ' >> 4) & 0x0F);
-		usleep_range(40, 100);	/* the shortest data takes at least 40 us */
+		udelay(40);	/* the shortest data takes at least 40 us */
 	}
 	spin_unlock_irq(&pprt_lock);
 
@@ -971,7 +967,7 @@ static void lcd_clear_fast_p8(void)
 		w_dtr(pprt, ' ');
 
 		/* maintain the data during 20 us before the strobe */
-		usleep_range(20, 100);
+		udelay(20);
 
 		bits.e = BIT_SET;
 		bits.rs = BIT_SET;
@@ -979,13 +975,13 @@ static void lcd_clear_fast_p8(void)
 		set_ctrl_bits();
 
 		/* maintain the strobe during 40 us */
-		usleep_range(40, 100);
+		udelay(40);
 
 		bits.e = BIT_CLR;
 		set_ctrl_bits();
 
 		/* the shortest data takes at least 45 us */
-		usleep_range(45, 100);
+		udelay(45);
 	}
 	spin_unlock_irq(&pprt_lock);
 
@@ -1007,7 +1003,7 @@ static void lcd_clear_fast_tilcd(void)
 	for (pos = 0; pos < lcd.height * lcd.hwidth; pos++) {
 		/* present the data to the data port */
 		w_dtr(pprt, ' ');
-		usleep_range(60, 120);
+		udelay(60);
 	}
 
 	spin_unlock_irq(&pprt_lock);
-- 
1.9.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] Revert "Staging: panel: usleep_range is preferred over udelay" Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2016-01-23 10:30 +0100
  Re: [PATCH] Revert "Staging: panel: usleep_range is preferred over  udelay" Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2016-01-25 05:40 +0100
  Re: [PATCH] Revert "Staging: panel: usleep_range is preferred over  udelay" Dan Carpenter <dan.carpenter@oracle.com> - 2016-01-25 10:20 +0100
    Re: [PATCH] Revert "Staging: panel: usleep_range is preferred over  udelay" Dan Carpenter <dan.carpenter@oracle.com> - 2016-01-25 10:40 +0100
    Re: [PATCH] Revert "Staging: panel: usleep_range is preferred over  udelay" Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2016-01-25 10:50 +0100
      Re: [PATCH] Revert "Staging: panel: usleep_range is preferred over  udelay" Dan Carpenter <dan.carpenter@oracle.com> - 2016-01-25 12:10 +0100
      Re: [PATCH] Revert "Staging: panel: usleep_range is preferred over  udelay" Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2016-01-25 14:00 +0100
        Re: [PATCH] Revert "Staging: panel: usleep_range is preferred over udelay" Willy Tarreau <w@1wt.eu> - 2016-01-25 21:50 +0100
      Re: [PATCH] Revert "Staging: panel: usleep_range is preferred over udelay" "Huang\, Ying" <ying.huang@intel.com> - 2016-01-26 01:40 +0100
        Re: [PATCH] Revert "Staging: panel: usleep_range is preferred over  udelay" Dan Carpenter <dan.carpenter@oracle.com> - 2016-01-26 02:40 +0100
          Re: [PATCH] Revert "Staging: panel: usleep_range is preferred over udelay" "Huang\, Ying" <ying.huang@intel.com> - 2016-01-26 03:10 +0100
      Re: [PATCH] Revert "Staging: panel: usleep_range is preferred over  udelay" Dan Carpenter <dan.carpenter@oracle.com> - 2016-01-26 18:50 +0100
    Re: [PATCH] Revert "Staging: panel: usleep_range is preferred over  udelay" Joe Perches <joe@perches.com> - 2016-01-25 13:50 +0100
      Re: [PATCH] Revert "Staging: panel: usleep_range is preferred over  udelay" Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2016-01-25 14:00 +0100
        Re: [PATCH] Revert "Staging: panel: usleep_range is preferred over  udelay" Joe Perches <joe@perches.com> - 2016-01-25 14:00 +0100

csiph-web