All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] UART: OMAP: Updates
@ 2012-04-16 15:06 ` Shubhrajyoti D
  0 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti D @ 2012-04-16 15:06 UTC (permalink / raw)
  To: linux-serial; +Cc: linux-omap, linux-arm-kernel, Shubhrajyoti D

The patch series collects few previously posted patches 
and adds some clock fixes to the series.

The patch series does following.
- Makes the context_loss_cnt signed to make error handling possible.
- The clock cutting is missed in the error cases, fix it.
- Make the serial_omap_console_ports depend on the macro
 OMAP_MAX_HSUART_PORTS.
- use devinit and devexit for the probe and remove functions.
- Fixes to the software flow control.

The following changes since commit e816b57a337ea3b755de72bec38c10c864f23015:

  Linux 3.4-rc3 (2012-04-15 18:28:29 -0700)

are available in the git repository at:
  git://gitorious.org/linus-tree/linus-tree.git uart-omap-next

Shubhrajyoti D (6):
      ARM: OMAP: UART: Make context_loss_cnt signed
      UART: OMAP: Cut the clock in the error cases
      UART: OMAP: Remove the default setting of special character
      UART: OMAP: Prevent cutting of clocks if put_sync immediately follows
      UART: OMAP: Remove the hardcode serial_omap_console_ports array.
      UART: OMAP: Trivial optimisation of the probe and remove

Vikram Pandita (1):
      UART: OMAP: fix software flow control

 arch/arm/plat-omap/include/plat/omap-serial.h |    6 ++--
 drivers/tty/serial/omap-serial.c              |   47 ++++++++++++++-----------
 2 files changed, 29 insertions(+), 24 deletions(-)

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 0/7] UART: OMAP: Updates
@ 2012-04-16 15:06 ` Shubhrajyoti D
  0 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti D @ 2012-04-16 15:06 UTC (permalink / raw)
  To: linux-arm-kernel

The patch series collects few previously posted patches 
and adds some clock fixes to the series.

The patch series does following.
- Makes the context_loss_cnt signed to make error handling possible.
- The clock cutting is missed in the error cases, fix it.
- Make the serial_omap_console_ports depend on the macro
 OMAP_MAX_HSUART_PORTS.
- use devinit and devexit for the probe and remove functions.
- Fixes to the software flow control.

The following changes since commit e816b57a337ea3b755de72bec38c10c864f23015:

  Linux 3.4-rc3 (2012-04-15 18:28:29 -0700)

are available in the git repository at:
  git://gitorious.org/linus-tree/linus-tree.git uart-omap-next

Shubhrajyoti D (6):
      ARM: OMAP: UART: Make context_loss_cnt signed
      UART: OMAP: Cut the clock in the error cases
      UART: OMAP: Remove the default setting of special character
      UART: OMAP: Prevent cutting of clocks if put_sync immediately follows
      UART: OMAP: Remove the hardcode serial_omap_console_ports array.
      UART: OMAP: Trivial optimisation of the probe and remove

Vikram Pandita (1):
      UART: OMAP: fix software flow control

 arch/arm/plat-omap/include/plat/omap-serial.h |    6 ++--
 drivers/tty/serial/omap-serial.c              |   47 ++++++++++++++-----------
 2 files changed, 29 insertions(+), 24 deletions(-)

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 1/7] ARM: OMAP: UART: Make context_loss_cnt signed
  2012-04-16 15:06 ` Shubhrajyoti D
@ 2012-04-16 15:06   ` Shubhrajyoti D
  -1 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti D @ 2012-04-16 15:06 UTC (permalink / raw)
  To: linux-serial; +Cc: linux-omap, linux-arm-kernel, Shubhrajyoti D, Govindraj.R

get_context_loss_count returns an int however it is stored in
unsigned integer context_loss_cnt . This patch tries to make
context_loss_cnt int. So that in case of errors(which may be negative)
the value is not interpreted wrongly.

In serial_omap_runtime_resume in case of errors returned by
get_context_loss_count print a warning and do a restore.

Cc: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
 arch/arm/plat-omap/include/plat/omap-serial.h |    2 +-
 drivers/tty/serial/omap-serial.c              |   10 ++++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
index 9ff4444..b7fb6dc 100644
--- a/arch/arm/plat-omap/include/plat/omap-serial.h
+++ b/arch/arm/plat-omap/include/plat/omap-serial.h
@@ -128,7 +128,7 @@ struct uart_omap_port {
 	unsigned char		msr_saved_flags;
 	char			name[20];
 	unsigned long		port_activity;
-	u32			context_loss_cnt;
+	int			context_loss_cnt;
 	u32			errata;
 	u8			wakeups_enabled;
 
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index d00b38e..fe099bb 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1612,10 +1612,16 @@ static int serial_omap_runtime_resume(struct device *dev)
 
 	if (up && pdata) {
 		if (pdata->get_context_loss_count) {
-			u32 loss_cnt = pdata->get_context_loss_count(dev);
+			int loss_cnt = pdata->get_context_loss_count(dev);
 
-			if (up->context_loss_cnt != loss_cnt)
+			if (loss_cnt < 0) {
+				dev_err(dev,
+					"get_context_loss_count failed : %d\n",
+					loss_cnt);
 				serial_omap_restore_context(up);
+			} else if (up->context_loss_cnt != loss_cnt) {
+				serial_omap_restore_context(up);
+			}
 		}
 
 		/* Errata i291 */
-- 
1.7.4.1


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 1/7] ARM: OMAP: UART: Make context_loss_cnt signed
@ 2012-04-16 15:06   ` Shubhrajyoti D
  0 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti D @ 2012-04-16 15:06 UTC (permalink / raw)
  To: linux-arm-kernel

get_context_loss_count returns an int however it is stored in
unsigned integer context_loss_cnt . This patch tries to make
context_loss_cnt int. So that in case of errors(which may be negative)
the value is not interpreted wrongly.

In serial_omap_runtime_resume in case of errors returned by
get_context_loss_count print a warning and do a restore.

Cc: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
 arch/arm/plat-omap/include/plat/omap-serial.h |    2 +-
 drivers/tty/serial/omap-serial.c              |   10 ++++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
index 9ff4444..b7fb6dc 100644
--- a/arch/arm/plat-omap/include/plat/omap-serial.h
+++ b/arch/arm/plat-omap/include/plat/omap-serial.h
@@ -128,7 +128,7 @@ struct uart_omap_port {
 	unsigned char		msr_saved_flags;
 	char			name[20];
 	unsigned long		port_activity;
-	u32			context_loss_cnt;
+	int			context_loss_cnt;
 	u32			errata;
 	u8			wakeups_enabled;
 
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index d00b38e..fe099bb 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1612,10 +1612,16 @@ static int serial_omap_runtime_resume(struct device *dev)
 
 	if (up && pdata) {
 		if (pdata->get_context_loss_count) {
-			u32 loss_cnt = pdata->get_context_loss_count(dev);
+			int loss_cnt = pdata->get_context_loss_count(dev);
 
-			if (up->context_loss_cnt != loss_cnt)
+			if (loss_cnt < 0) {
+				dev_err(dev,
+					"get_context_loss_count failed : %d\n",
+					loss_cnt);
 				serial_omap_restore_context(up);
+			} else if (up->context_loss_cnt != loss_cnt) {
+				serial_omap_restore_context(up);
+			}
 		}
 
 		/* Errata i291 */
-- 
1.7.4.1

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 2/7] UART: OMAP: Cut the clock in the error cases
  2012-04-16 15:06 ` Shubhrajyoti D
@ 2012-04-16 15:06   ` Shubhrajyoti D
  -1 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti D @ 2012-04-16 15:06 UTC (permalink / raw)
  To: linux-serial
  Cc: linux-omap, linux-arm-kernel, Shubhrajyoti D, stable, Govindraj.R

In the error cases the clock cut is missed. This patch intends to fix the
same.

Cc: stable@vger.kernel.org
Cc: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
 drivers/tty/serial/omap-serial.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index fe099bb..10e80bb 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -319,6 +319,8 @@ static void serial_omap_start_tx(struct uart_port *port)
 
 		if (ret < 0) {
 			serial_omap_enable_ier_thri(up);
+			pm_runtime_mark_last_busy(&up->pdev->dev);
+			pm_runtime_put_autosuspend(&up->pdev->dev);
 			return;
 		}
 	}
@@ -1029,8 +1031,10 @@ static int serial_omap_poll_get_char(struct uart_port *port)
 
 	pm_runtime_get_sync(&up->pdev->dev);
 	status = serial_in(up, UART_LSR);
-	if (!(status & UART_LSR_DR))
+	if (!(status & UART_LSR_DR)) {
+		pm_runtime_put(&up->pdev->dev);
 		return NO_POLL_CHAR;
+	}
 
 	status = serial_in(up, UART_RX);
 	pm_runtime_put(&up->pdev->dev);
-- 
1.7.4.1


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 2/7] UART: OMAP: Cut the clock in the error cases
@ 2012-04-16 15:06   ` Shubhrajyoti D
  0 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti D @ 2012-04-16 15:06 UTC (permalink / raw)
  To: linux-arm-kernel

In the error cases the clock cut is missed. This patch intends to fix the
same.

Cc: stable at vger.kernel.org
Cc: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
 drivers/tty/serial/omap-serial.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index fe099bb..10e80bb 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -319,6 +319,8 @@ static void serial_omap_start_tx(struct uart_port *port)
 
 		if (ret < 0) {
 			serial_omap_enable_ier_thri(up);
+			pm_runtime_mark_last_busy(&up->pdev->dev);
+			pm_runtime_put_autosuspend(&up->pdev->dev);
 			return;
 		}
 	}
@@ -1029,8 +1031,10 @@ static int serial_omap_poll_get_char(struct uart_port *port)
 
 	pm_runtime_get_sync(&up->pdev->dev);
 	status = serial_in(up, UART_LSR);
-	if (!(status & UART_LSR_DR))
+	if (!(status & UART_LSR_DR)) {
+		pm_runtime_put(&up->pdev->dev);
 		return NO_POLL_CHAR;
+	}
 
 	status = serial_in(up, UART_RX);
 	pm_runtime_put(&up->pdev->dev);
-- 
1.7.4.1

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 3/7] UART: OMAP: fix software flow control
  2012-04-16 15:06 ` Shubhrajyoti D
@ 2012-04-16 15:06   ` Shubhrajyoti D
  -1 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti D @ 2012-04-16 15:06 UTC (permalink / raw)
  To: linux-serial
  Cc: linux-omap, linux-arm-kernel, Vikram Pandita, stable,
	Govindraj.R, Shubhrajyoti D

From: Vikram Pandita <vikram.pandita@ti.com>

Software flow control register bits were not defined correctly.

Also clarify the IXON and IXOFF logic to reflect what userspace wants.

Cc: stable@vger.kernel.org
Cc: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
 arch/arm/plat-omap/include/plat/omap-serial.h |    4 ++--
 drivers/tty/serial/omap-serial.c              |   12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
index b7fb6dc..6edc30a 100644
--- a/arch/arm/plat-omap/include/plat/omap-serial.h
+++ b/arch/arm/plat-omap/include/plat/omap-serial.h
@@ -42,10 +42,10 @@
 #define OMAP_UART_WER_MOD_WKUP	0X7F
 
 /* Enable XON/XOFF flow control on output */
-#define OMAP_UART_SW_TX		0x04
+#define OMAP_UART_SW_TX		0x8
 
 /* Enable XON/XOFF flow control on input */
-#define OMAP_UART_SW_RX		0x04
+#define OMAP_UART_SW_RX		0x2
 
 #define OMAP_UART_SYSC_RESET	0X07
 #define OMAP_UART_TCR_TRIG	0X0F
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 10e80bb..887d578 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -651,19 +651,19 @@ serial_omap_configure_xonxoff
 
 	/*
 	 * IXON Flag:
-	 * Enable XON/XOFF flow control on output.
-	 * Transmit XON1, XOFF1
+	 * Flow control for OMAP.TX
+	 * OMAP.RX should listen for XON/XOFF
 	 */
 	if (termios->c_iflag & IXON)
-		up->efr |= OMAP_UART_SW_TX;
+		up->efr |= OMAP_UART_SW_RX;
 
 	/*
 	 * IXOFF Flag:
-	 * Enable XON/XOFF flow control on input.
-	 * Receiver compares XON1, XOFF1.
+	 * Flow control for OMAP.RX
+	 * OMAP.TX should send XON/XOFF
 	 */
 	if (termios->c_iflag & IXOFF)
-		up->efr |= OMAP_UART_SW_RX;
+		up->efr |= OMAP_UART_SW_TX;
 
 	serial_out(up, UART_EFR, up->efr | UART_EFR_ECB);
 	serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
-- 
1.7.4.1


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 3/7] UART: OMAP: fix software flow control
@ 2012-04-16 15:06   ` Shubhrajyoti D
  0 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti D @ 2012-04-16 15:06 UTC (permalink / raw)
  To: linux-arm-kernel

From: Vikram Pandita <vikram.pandita@ti.com>

Software flow control register bits were not defined correctly.

Also clarify the IXON and IXOFF logic to reflect what userspace wants.

Cc: stable at vger.kernel.org
Cc: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
 arch/arm/plat-omap/include/plat/omap-serial.h |    4 ++--
 drivers/tty/serial/omap-serial.c              |   12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
index b7fb6dc..6edc30a 100644
--- a/arch/arm/plat-omap/include/plat/omap-serial.h
+++ b/arch/arm/plat-omap/include/plat/omap-serial.h
@@ -42,10 +42,10 @@
 #define OMAP_UART_WER_MOD_WKUP	0X7F
 
 /* Enable XON/XOFF flow control on output */
-#define OMAP_UART_SW_TX		0x04
+#define OMAP_UART_SW_TX		0x8
 
 /* Enable XON/XOFF flow control on input */
-#define OMAP_UART_SW_RX		0x04
+#define OMAP_UART_SW_RX		0x2
 
 #define OMAP_UART_SYSC_RESET	0X07
 #define OMAP_UART_TCR_TRIG	0X0F
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 10e80bb..887d578 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -651,19 +651,19 @@ serial_omap_configure_xonxoff
 
 	/*
 	 * IXON Flag:
-	 * Enable XON/XOFF flow control on output.
-	 * Transmit XON1, XOFF1
+	 * Flow control for OMAP.TX
+	 * OMAP.RX should listen for XON/XOFF
 	 */
 	if (termios->c_iflag & IXON)
-		up->efr |= OMAP_UART_SW_TX;
+		up->efr |= OMAP_UART_SW_RX;
 
 	/*
 	 * IXOFF Flag:
-	 * Enable XON/XOFF flow control on input.
-	 * Receiver compares XON1, XOFF1.
+	 * Flow control for OMAP.RX
+	 * OMAP.TX should send XON/XOFF
 	 */
 	if (termios->c_iflag & IXOFF)
-		up->efr |= OMAP_UART_SW_RX;
+		up->efr |= OMAP_UART_SW_TX;
 
 	serial_out(up, UART_EFR, up->efr | UART_EFR_ECB);
 	serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
-- 
1.7.4.1

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 4/7] UART: OMAP: Remove the default setting of special character
  2012-04-16 15:06 ` Shubhrajyoti D
@ 2012-04-16 15:06   ` Shubhrajyoti D
  -1 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti D @ 2012-04-16 15:06 UTC (permalink / raw)
  To: linux-serial; +Cc: linux-omap, linux-arm-kernel, Shubhrajyoti D, Govindraj.R

Special character detect enable if enabled by default.Received data
comparison with XOFF2 data happens by default.

tty provides only XOFF1 no X0FF2 is provided so no need
to enable check for XOFF2.

Keeping this enabled might give some slow transfers due to dummy xoff2
comparison with xoff2 reset value.

Since not all want the XOFF2 support lets not enable it by
default.

Cc: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
 drivers/tty/serial/omap-serial.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 887d578..7c69b21 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -682,11 +682,7 @@ serial_omap_configure_xonxoff
 	serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR);
 	serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
 	serial_out(up, UART_TI752_TCR, OMAP_UART_TCR_TRIG);
-	/* Enable special char function UARTi.EFR_REG[5] and
-	 * load the new software flow control mode IXON or IXOFF
-	 * and restore the UARTi.EFR_REG[4] ENHANCED_EN value.
-	 */
-	serial_out(up, UART_EFR, up->efr | UART_EFR_SCD);
+
 	serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
 
 	serial_out(up, UART_MCR, up->mcr & ~UART_MCR_TCRTLR);
-- 
1.7.4.1


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 4/7] UART: OMAP: Remove the default setting of special character
@ 2012-04-16 15:06   ` Shubhrajyoti D
  0 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti D @ 2012-04-16 15:06 UTC (permalink / raw)
  To: linux-arm-kernel

Special character detect enable if enabled by default.Received data
comparison with XOFF2 data happens by default.

tty provides only XOFF1 no X0FF2 is provided so no need
to enable check for XOFF2.

Keeping this enabled might give some slow transfers due to dummy xoff2
comparison with xoff2 reset value.

Since not all want the XOFF2 support lets not enable it by
default.

Cc: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
 drivers/tty/serial/omap-serial.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 887d578..7c69b21 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -682,11 +682,7 @@ serial_omap_configure_xonxoff
 	serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR);
 	serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
 	serial_out(up, UART_TI752_TCR, OMAP_UART_TCR_TRIG);
-	/* Enable special char function UARTi.EFR_REG[5] and
-	 * load the new software flow control mode IXON or IXOFF
-	 * and restore the UARTi.EFR_REG[4] ENHANCED_EN value.
-	 */
-	serial_out(up, UART_EFR, up->efr | UART_EFR_SCD);
+
 	serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
 
 	serial_out(up, UART_MCR, up->mcr & ~UART_MCR_TCRTLR);
-- 
1.7.4.1

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 5/7] UART: OMAP: Prevent cutting of clocks if put_sync immediately follows
  2012-04-16 15:06 ` Shubhrajyoti D
@ 2012-04-16 15:06   ` Shubhrajyoti D
  -1 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti D @ 2012-04-16 15:06 UTC (permalink / raw)
  To: linux-serial; +Cc: linux-omap, linux-arm-kernel, Shubhrajyoti D, Govindraj.R

In serial_omap_stop_tx in the dma case. We do a autosuspend and
immediately a put_sync. Prevent the call of auto suspend. The else
case is left as is.

Cc: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
 drivers/tty/serial/omap-serial.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 7c69b21..1593986 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -149,11 +149,10 @@ static void serial_omap_stop_tx(struct uart_port *port)
 		omap_stop_dma(up->uart_dma.tx_dma_channel);
 		omap_free_dma(up->uart_dma.tx_dma_channel);
 		up->uart_dma.tx_dma_channel = OMAP_UART_DMA_CH_FREE;
-		pm_runtime_mark_last_busy(&up->pdev->dev);
-		pm_runtime_put_autosuspend(&up->pdev->dev);
+	} else {
+		pm_runtime_get_sync(&up->pdev->dev);
 	}
 
-	pm_runtime_get_sync(&up->pdev->dev);
 	if (up->ier & UART_IER_THRI) {
 		up->ier &= ~UART_IER_THRI;
 		serial_out(up, UART_IER, up->ier);
-- 
1.7.4.1


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 5/7] UART: OMAP: Prevent cutting of clocks if put_sync immediately follows
@ 2012-04-16 15:06   ` Shubhrajyoti D
  0 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti D @ 2012-04-16 15:06 UTC (permalink / raw)
  To: linux-arm-kernel

In serial_omap_stop_tx in the dma case. We do a autosuspend and
immediately a put_sync. Prevent the call of auto suspend. The else
case is left as is.

Cc: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
 drivers/tty/serial/omap-serial.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 7c69b21..1593986 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -149,11 +149,10 @@ static void serial_omap_stop_tx(struct uart_port *port)
 		omap_stop_dma(up->uart_dma.tx_dma_channel);
 		omap_free_dma(up->uart_dma.tx_dma_channel);
 		up->uart_dma.tx_dma_channel = OMAP_UART_DMA_CH_FREE;
-		pm_runtime_mark_last_busy(&up->pdev->dev);
-		pm_runtime_put_autosuspend(&up->pdev->dev);
+	} else {
+		pm_runtime_get_sync(&up->pdev->dev);
 	}
 
-	pm_runtime_get_sync(&up->pdev->dev);
 	if (up->ier & UART_IER_THRI) {
 		up->ier &= ~UART_IER_THRI;
 		serial_out(up, UART_IER, up->ier);
-- 
1.7.4.1

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 6/7] UART: OMAP: Remove the hardcode serial_omap_console_ports array.
  2012-04-16 15:06 ` Shubhrajyoti D
@ 2012-04-16 15:07   ` Shubhrajyoti D
  -1 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti D @ 2012-04-16 15:07 UTC (permalink / raw)
  To: linux-serial; +Cc: linux-omap, linux-arm-kernel, Shubhrajyoti D, Govindraj.R

Currently the array serial_omap_console_ports is hard coded to 4.
Make it depend on the maximum uart count.
Also fixes OMAP5 which has 6 instances of uart.

Cc: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
 drivers/tty/serial/omap-serial.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 1593986..cbc9d64 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1040,7 +1040,7 @@ static int serial_omap_poll_get_char(struct uart_port *port)
 
 #ifdef CONFIG_SERIAL_OMAP_CONSOLE
 
-static struct uart_omap_port *serial_omap_console_ports[4];
+static struct uart_omap_port *serial_omap_console_ports[OMAP_MAX_HSUART_PORTS];
 
 static struct uart_driver serial_omap_reg;
 
-- 
1.7.4.1


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 6/7] UART: OMAP: Remove the hardcode serial_omap_console_ports array.
@ 2012-04-16 15:07   ` Shubhrajyoti D
  0 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti D @ 2012-04-16 15:07 UTC (permalink / raw)
  To: linux-arm-kernel

Currently the array serial_omap_console_ports is hard coded to 4.
Make it depend on the maximum uart count.
Also fixes OMAP5 which has 6 instances of uart.

Cc: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
 drivers/tty/serial/omap-serial.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 1593986..cbc9d64 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1040,7 +1040,7 @@ static int serial_omap_poll_get_char(struct uart_port *port)
 
 #ifdef CONFIG_SERIAL_OMAP_CONSOLE
 
-static struct uart_omap_port *serial_omap_console_ports[4];
+static struct uart_omap_port *serial_omap_console_ports[OMAP_MAX_HSUART_PORTS];
 
 static struct uart_driver serial_omap_reg;
 
-- 
1.7.4.1

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 7/7] UART: OMAP: Trivial optimisation of the probe and remove
  2012-04-16 15:06 ` Shubhrajyoti D
@ 2012-04-16 15:07   ` Shubhrajyoti D
  -1 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti D @ 2012-04-16 15:07 UTC (permalink / raw)
  To: linux-serial; +Cc: linux-omap, linux-arm-kernel, Shubhrajyoti D, Govindraj.R

The probe and remove may not be needed after initialisation and
remove the code could be be put in the devint and devexit section.

Cc: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
 drivers/tty/serial/omap-serial.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index cbc9d64..42ad500 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1358,7 +1358,7 @@ static struct omap_uart_port_info *of_get_uart_port_info(struct device *dev)
 	return omap_up_info;
 }
 
-static int serial_omap_probe(struct platform_device *pdev)
+static int __devinit serial_omap_probe(struct platform_device *pdev)
 {
 	struct uart_omap_port	*up;
 	struct resource		*mem, *irq, *dma_tx, *dma_rx;
@@ -1489,7 +1489,7 @@ err_port_line:
 	return ret;
 }
 
-static int serial_omap_remove(struct platform_device *dev)
+static int __devexit serial_omap_remove(struct platform_device *dev)
 {
 	struct uart_omap_port *up = platform_get_drvdata(dev);
 
@@ -1654,7 +1654,7 @@ MODULE_DEVICE_TABLE(of, omap_serial_of_match);
 
 static struct platform_driver serial_omap_driver = {
 	.probe          = serial_omap_probe,
-	.remove         = serial_omap_remove,
+	.remove         = __devexit_p(serial_omap_remove),
 	.driver		= {
 		.name	= DRIVER_NAME,
 		.pm	= &serial_omap_dev_pm_ops,
-- 
1.7.4.1


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 7/7] UART: OMAP: Trivial optimisation of the probe and remove
@ 2012-04-16 15:07   ` Shubhrajyoti D
  0 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti D @ 2012-04-16 15:07 UTC (permalink / raw)
  To: linux-arm-kernel

The probe and remove may not be needed after initialisation and
remove the code could be be put in the devint and devexit section.

Cc: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
 drivers/tty/serial/omap-serial.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index cbc9d64..42ad500 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1358,7 +1358,7 @@ static struct omap_uart_port_info *of_get_uart_port_info(struct device *dev)
 	return omap_up_info;
 }
 
-static int serial_omap_probe(struct platform_device *pdev)
+static int __devinit serial_omap_probe(struct platform_device *pdev)
 {
 	struct uart_omap_port	*up;
 	struct resource		*mem, *irq, *dma_tx, *dma_rx;
@@ -1489,7 +1489,7 @@ err_port_line:
 	return ret;
 }
 
-static int serial_omap_remove(struct platform_device *dev)
+static int __devexit serial_omap_remove(struct platform_device *dev)
 {
 	struct uart_omap_port *up = platform_get_drvdata(dev);
 
@@ -1654,7 +1654,7 @@ MODULE_DEVICE_TABLE(of, omap_serial_of_match);
 
 static struct platform_driver serial_omap_driver = {
 	.probe          = serial_omap_probe,
-	.remove         = serial_omap_remove,
+	.remove         = __devexit_p(serial_omap_remove),
 	.driver		= {
 		.name	= DRIVER_NAME,
 		.pm	= &serial_omap_dev_pm_ops,
-- 
1.7.4.1

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 2/7] UART: OMAP: Cut the clock in the error cases
  2012-04-16 15:06   ` Shubhrajyoti D
@ 2012-04-18  0:06     ` Kevin Hilman
  -1 siblings, 0 replies; 28+ messages in thread
From: Kevin Hilman @ 2012-04-18  0:06 UTC (permalink / raw)
  To: Shubhrajyoti D
  Cc: linux-serial, linux-omap, linux-arm-kernel, stable, Govindraj.R

Shubhrajyoti D <shubhrajyoti@ti.com> writes:

> In the error cases the clock cut is missed. This patch intends to fix the
> same.

Please change the references to 'cut clocks' in subject/changelog here
(and in other patches) to use runtime suspend instead.   First, runtime PM
calls do more than cut clocks, but they only do so when
usecounting/autosuspend timeouts permit.


> Cc: stable@vger.kernel.org

Please hold off on Cc'ing stable until your patches are reviewed and accepted.

> Cc: Govindraj.R <govindraj.raja@ti.com>
> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
> ---
>  drivers/tty/serial/omap-serial.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
> index fe099bb..10e80bb 100644
> --- a/drivers/tty/serial/omap-serial.c
> +++ b/drivers/tty/serial/omap-serial.c
> @@ -319,6 +319,8 @@ static void serial_omap_start_tx(struct uart_port *port)
>  
>  		if (ret < 0) {
>  			serial_omap_enable_ier_thri(up);
> +			pm_runtime_mark_last_busy(&up->pdev->dev);
> +			pm_runtime_put_autosuspend(&up->pdev->dev);

Why the autosuspend version here?

Kevin

>  			return;
>  		}
>  	}
> @@ -1029,8 +1031,10 @@ static int serial_omap_poll_get_char(struct uart_port *port)
>  
>  	pm_runtime_get_sync(&up->pdev->dev);
>  	status = serial_in(up, UART_LSR);
> -	if (!(status & UART_LSR_DR))
> +	if (!(status & UART_LSR_DR)) {
> +		pm_runtime_put(&up->pdev->dev);
>  		return NO_POLL_CHAR;
> +	}
>  
>  	status = serial_in(up, UART_RX);
>  	pm_runtime_put(&up->pdev->dev);

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 2/7] UART: OMAP: Cut the clock in the error cases
@ 2012-04-18  0:06     ` Kevin Hilman
  0 siblings, 0 replies; 28+ messages in thread
From: Kevin Hilman @ 2012-04-18  0:06 UTC (permalink / raw)
  To: linux-arm-kernel

Shubhrajyoti D <shubhrajyoti@ti.com> writes:

> In the error cases the clock cut is missed. This patch intends to fix the
> same.

Please change the references to 'cut clocks' in subject/changelog here
(and in other patches) to use runtime suspend instead.   First, runtime PM
calls do more than cut clocks, but they only do so when
usecounting/autosuspend timeouts permit.


> Cc: stable at vger.kernel.org

Please hold off on Cc'ing stable until your patches are reviewed and accepted.

> Cc: Govindraj.R <govindraj.raja@ti.com>
> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
> ---
>  drivers/tty/serial/omap-serial.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
> index fe099bb..10e80bb 100644
> --- a/drivers/tty/serial/omap-serial.c
> +++ b/drivers/tty/serial/omap-serial.c
> @@ -319,6 +319,8 @@ static void serial_omap_start_tx(struct uart_port *port)
>  
>  		if (ret < 0) {
>  			serial_omap_enable_ier_thri(up);
> +			pm_runtime_mark_last_busy(&up->pdev->dev);
> +			pm_runtime_put_autosuspend(&up->pdev->dev);

Why the autosuspend version here?

Kevin

>  			return;
>  		}
>  	}
> @@ -1029,8 +1031,10 @@ static int serial_omap_poll_get_char(struct uart_port *port)
>  
>  	pm_runtime_get_sync(&up->pdev->dev);
>  	status = serial_in(up, UART_LSR);
> -	if (!(status & UART_LSR_DR))
> +	if (!(status & UART_LSR_DR)) {
> +		pm_runtime_put(&up->pdev->dev);
>  		return NO_POLL_CHAR;
> +	}
>  
>  	status = serial_in(up, UART_RX);
>  	pm_runtime_put(&up->pdev->dev);

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 2/7] UART: OMAP: Cut the clock in the error cases
  2012-04-18  0:06     ` Kevin Hilman
@ 2012-04-18  6:44       ` Shubhrajyoti
  -1 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti @ 2012-04-18  6:44 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: linux-serial, linux-omap, linux-arm-kernel, stable, Govindraj.R

Hi Kevin,
Thanks for the review.

On Wednesday 18 April 2012 05:36 AM, Kevin Hilman wrote:
> Shubhrajyoti D <shubhrajyoti@ti.com> writes:
>
>> In the error cases the clock cut is missed. This patch intends to fix the
>> same.
> Please change the references to 'cut clocks' in subject/changelog here
> (and in other patches) to use runtime suspend instead.   First, runtime PM
> calls do more than cut clocks, but they only do so when
> usecounting/autosuspend timeouts permit.
Yes thanks will fix it.
>
>
>> Cc: stable@vger.kernel.org
> Please hold off on Cc'ing stable until your patches are reviewed and accepted.
OK
>> Cc: Govindraj.R <govindraj.raja@ti.com>
>> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
>> ---
>>  drivers/tty/serial/omap-serial.c |    6 +++++-
>>  1 files changed, 5 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
>> index fe099bb..10e80bb 100644
>> --- a/drivers/tty/serial/omap-serial.c
>> +++ b/drivers/tty/serial/omap-serial.c
>> @@ -319,6 +319,8 @@ static void serial_omap_start_tx(struct uart_port *port)
>>  
>>  		if (ret < 0) {
>>  			serial_omap_enable_ier_thri(up);
>> +			pm_runtime_mark_last_busy(&up->pdev->dev);
>> +			pm_runtime_put_autosuspend(&up->pdev->dev);
> Why the autosuspend version here?
>
> Kevin
>
>
In case the request_dma fails we enable the thri( effectively like intr
mode) so
I thought of using the autosuspend version here .

Do you prefer put version instead ?

With Regards,
Shubhro

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 2/7] UART: OMAP: Cut the clock in the error cases
@ 2012-04-18  6:44       ` Shubhrajyoti
  0 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti @ 2012-04-18  6:44 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Kevin,
Thanks for the review.

On Wednesday 18 April 2012 05:36 AM, Kevin Hilman wrote:
> Shubhrajyoti D <shubhrajyoti@ti.com> writes:
>
>> In the error cases the clock cut is missed. This patch intends to fix the
>> same.
> Please change the references to 'cut clocks' in subject/changelog here
> (and in other patches) to use runtime suspend instead.   First, runtime PM
> calls do more than cut clocks, but they only do so when
> usecounting/autosuspend timeouts permit.
Yes thanks will fix it.
>
>
>> Cc: stable at vger.kernel.org
> Please hold off on Cc'ing stable until your patches are reviewed and accepted.
OK
>> Cc: Govindraj.R <govindraj.raja@ti.com>
>> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
>> ---
>>  drivers/tty/serial/omap-serial.c |    6 +++++-
>>  1 files changed, 5 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
>> index fe099bb..10e80bb 100644
>> --- a/drivers/tty/serial/omap-serial.c
>> +++ b/drivers/tty/serial/omap-serial.c
>> @@ -319,6 +319,8 @@ static void serial_omap_start_tx(struct uart_port *port)
>>  
>>  		if (ret < 0) {
>>  			serial_omap_enable_ier_thri(up);
>> +			pm_runtime_mark_last_busy(&up->pdev->dev);
>> +			pm_runtime_put_autosuspend(&up->pdev->dev);
> Why the autosuspend version here?
>
> Kevin
>
>
In case the request_dma fails we enable the thri( effectively like intr
mode) so
I thought of using the autosuspend version here .

Do you prefer put version instead ?

With Regards,
Shubhro

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 2/7] UART: OMAP: Cut the clock in the error cases
  2012-04-18  6:44       ` Shubhrajyoti
@ 2012-04-18 14:00         ` Kevin Hilman
  -1 siblings, 0 replies; 28+ messages in thread
From: Kevin Hilman @ 2012-04-18 14:00 UTC (permalink / raw)
  To: Shubhrajyoti
  Cc: linux-serial, linux-omap, linux-arm-kernel, stable, Govindraj.R

Shubhrajyoti <shubhrajyoti@ti.com> writes:

> Hi Kevin,
> Thanks for the review.
>
> On Wednesday 18 April 2012 05:36 AM, Kevin Hilman wrote:
>> Shubhrajyoti D <shubhrajyoti@ti.com> writes:
>>
>>> In the error cases the clock cut is missed. This patch intends to fix the
>>> same.
>> Please change the references to 'cut clocks' in subject/changelog here
>> (and in other patches) to use runtime suspend instead.   First, runtime PM
>> calls do more than cut clocks, but they only do so when
>> usecounting/autosuspend timeouts permit.
> Yes thanks will fix it.
>>
>>
>>> Cc: stable@vger.kernel.org
>> Please hold off on Cc'ing stable until your patches are reviewed and accepted.
> OK
>>> Cc: Govindraj.R <govindraj.raja@ti.com>
>>> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
>>> ---
>>>  drivers/tty/serial/omap-serial.c |    6 +++++-
>>>  1 files changed, 5 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
>>> index fe099bb..10e80bb 100644
>>> --- a/drivers/tty/serial/omap-serial.c
>>> +++ b/drivers/tty/serial/omap-serial.c
>>> @@ -319,6 +319,8 @@ static void serial_omap_start_tx(struct uart_port *port)
>>>  
>>>  		if (ret < 0) {
>>>  			serial_omap_enable_ier_thri(up);
>>> +			pm_runtime_mark_last_busy(&up->pdev->dev);
>>> +			pm_runtime_put_autosuspend(&up->pdev->dev);
>> Why the autosuspend version here?
>>
>> Kevin
>>
>>
> In case the request_dma fails we enable the thri( effectively like intr
> mode) so
> I thought of using the autosuspend version here .
>
> Do you prefer put version instead ?

Not necessarily, it should just be well described in the changelog.

Kevin

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 2/7] UART: OMAP: Cut the clock in the error cases
@ 2012-04-18 14:00         ` Kevin Hilman
  0 siblings, 0 replies; 28+ messages in thread
From: Kevin Hilman @ 2012-04-18 14:00 UTC (permalink / raw)
  To: linux-arm-kernel

Shubhrajyoti <shubhrajyoti@ti.com> writes:

> Hi Kevin,
> Thanks for the review.
>
> On Wednesday 18 April 2012 05:36 AM, Kevin Hilman wrote:
>> Shubhrajyoti D <shubhrajyoti@ti.com> writes:
>>
>>> In the error cases the clock cut is missed. This patch intends to fix the
>>> same.
>> Please change the references to 'cut clocks' in subject/changelog here
>> (and in other patches) to use runtime suspend instead.   First, runtime PM
>> calls do more than cut clocks, but they only do so when
>> usecounting/autosuspend timeouts permit.
> Yes thanks will fix it.
>>
>>
>>> Cc: stable at vger.kernel.org
>> Please hold off on Cc'ing stable until your patches are reviewed and accepted.
> OK
>>> Cc: Govindraj.R <govindraj.raja@ti.com>
>>> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
>>> ---
>>>  drivers/tty/serial/omap-serial.c |    6 +++++-
>>>  1 files changed, 5 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
>>> index fe099bb..10e80bb 100644
>>> --- a/drivers/tty/serial/omap-serial.c
>>> +++ b/drivers/tty/serial/omap-serial.c
>>> @@ -319,6 +319,8 @@ static void serial_omap_start_tx(struct uart_port *port)
>>>  
>>>  		if (ret < 0) {
>>>  			serial_omap_enable_ier_thri(up);
>>> +			pm_runtime_mark_last_busy(&up->pdev->dev);
>>> +			pm_runtime_put_autosuspend(&up->pdev->dev);
>> Why the autosuspend version here?
>>
>> Kevin
>>
>>
> In case the request_dma fails we enable the thri( effectively like intr
> mode) so
> I thought of using the autosuspend version here .
>
> Do you prefer put version instead ?

Not necessarily, it should just be well described in the changelog.

Kevin

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 2/7] UART: OMAP: Cut the clock in the error cases
  2012-04-18 14:00         ` Kevin Hilman
@ 2012-04-18 15:13           ` Shubhrajyoti
  -1 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti @ 2012-04-18 15:13 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: linux-serial, linux-omap, linux-arm-kernel, stable, Govindraj.R

On Wednesday 18 April 2012 07:30 PM, Kevin Hilman wrote:
>>>> >>>  		if (ret < 0) {
>>>> >>>  			serial_omap_enable_ier_thri(up);
>>>> >>> +			pm_runtime_mark_last_busy(&up->pdev->dev);
>>>> >>> +			pm_runtime_put_autosuspend(&up->pdev->dev);
>>> >> Why the autosuspend version here?
>>> >>
>>> >> Kevin
>>> >>
>>> >>
>> > In case the request_dma fails we enable the thri( effectively like intr
>> > mode) so
>> > I thought of using the autosuspend version here .
>> >
>> > Do you prefer put version instead ?
> Not necessarily, it should just be well described in the changelog.
>
> Kevin
Yes agree completely. Will describe that in the changelog.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 2/7] UART: OMAP: Cut the clock in the error cases
@ 2012-04-18 15:13           ` Shubhrajyoti
  0 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti @ 2012-04-18 15:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 18 April 2012 07:30 PM, Kevin Hilman wrote:
>>>> >>>  		if (ret < 0) {
>>>> >>>  			serial_omap_enable_ier_thri(up);
>>>> >>> +			pm_runtime_mark_last_busy(&up->pdev->dev);
>>>> >>> +			pm_runtime_put_autosuspend(&up->pdev->dev);
>>> >> Why the autosuspend version here?
>>> >>
>>> >> Kevin
>>> >>
>>> >>
>> > In case the request_dma fails we enable the thri( effectively like intr
>> > mode) so
>> > I thought of using the autosuspend version here .
>> >
>> > Do you prefer put version instead ?
> Not necessarily, it should just be well described in the changelog.
>
> Kevin
Yes agree completely. Will describe that in the changelog.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 2/7] UART: OMAP: Cut the clock in the error cases
  2012-04-18 15:13           ` Shubhrajyoti
@ 2012-04-20 13:20             ` Shubhrajyoti Datta
  -1 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti Datta @ 2012-04-20 13:20 UTC (permalink / raw)
  To: Shubhrajyoti
  Cc: Kevin Hilman, linux-serial, linux-omap, linux-arm-kernel, stable,
	Govindraj.R

On Wed, Apr 18, 2012 at 8:43 PM, Shubhrajyoti <shubhrajyoti@ti.com> wrote:
>>
>> Kevin
> Yes agree completely. Will describe that in the changelog.
> --
Does the following changelog look ok?

>From 37fdc2d40c9b2b19b8c5a9a4b8f7dd547d420f55 Mon Sep 17 00:00:00 2001
From: Shubhrajyoti D <shubhrajyoti@ti.com>
Date: Wed, 4 Apr 2012 16:32:37 +0530
Subject: [PATCH] UART: OMAP: call pm_runtime_put/autosuspend in the error cases

In the error cases the runtime_put call is missed. This patch intends to fix the
same. In case dma request fails, we fall back to the nondma mode so after
enabling the threshold call put_autosuspend.

Cc: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
 drivers/tty/serial/omap-serial.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index fe099bb..10e80bb 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -319,6 +319,8 @@ static void serial_omap_start_tx(struct uart_port *port)

 		if (ret < 0) {
 			serial_omap_enable_ier_thri(up);
+			pm_runtime_mark_last_busy(&up->pdev->dev);
+			pm_runtime_put_autosuspend(&up->pdev->dev);
 			return;
 		}
 	}
@@ -1029,8 +1031,10 @@ static int serial_omap_poll_get_char(struct
uart_port *port)

 	pm_runtime_get_sync(&up->pdev->dev);
 	status = serial_in(up, UART_LSR);
-	if (!(status & UART_LSR_DR))
+	if (!(status & UART_LSR_DR)) {
+		pm_runtime_put(&up->pdev->dev);
 		return NO_POLL_CHAR;
+	}

 	status = serial_in(up, UART_RX);
 	pm_runtime_put(&up->pdev->dev);
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 2/7] UART: OMAP: Cut the clock in the error cases
@ 2012-04-20 13:20             ` Shubhrajyoti Datta
  0 siblings, 0 replies; 28+ messages in thread
From: Shubhrajyoti Datta @ 2012-04-20 13:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 18, 2012 at 8:43 PM, Shubhrajyoti <shubhrajyoti@ti.com> wrote:
>>
>> Kevin
> Yes agree completely. Will describe that in the changelog.
> --
Does the following changelog look ok?

>From 37fdc2d40c9b2b19b8c5a9a4b8f7dd547d420f55 Mon Sep 17 00:00:00 2001
From: Shubhrajyoti D <shubhrajyoti@ti.com>
Date: Wed, 4 Apr 2012 16:32:37 +0530
Subject: [PATCH] UART: OMAP: call pm_runtime_put/autosuspend in the error cases

In the error cases the runtime_put call is missed. This patch intends to fix the
same. In case dma request fails, we fall back to the nondma mode so after
enabling the threshold call put_autosuspend.

Cc: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
 drivers/tty/serial/omap-serial.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index fe099bb..10e80bb 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -319,6 +319,8 @@ static void serial_omap_start_tx(struct uart_port *port)

 		if (ret < 0) {
 			serial_omap_enable_ier_thri(up);
+			pm_runtime_mark_last_busy(&up->pdev->dev);
+			pm_runtime_put_autosuspend(&up->pdev->dev);
 			return;
 		}
 	}
@@ -1029,8 +1031,10 @@ static int serial_omap_poll_get_char(struct
uart_port *port)

 	pm_runtime_get_sync(&up->pdev->dev);
 	status = serial_in(up, UART_LSR);
-	if (!(status & UART_LSR_DR))
+	if (!(status & UART_LSR_DR)) {
+		pm_runtime_put(&up->pdev->dev);
 		return NO_POLL_CHAR;
+	}

 	status = serial_in(up, UART_RX);
 	pm_runtime_put(&up->pdev->dev);
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 2/7] UART: OMAP: Cut the clock in the error cases
  2012-04-20 13:20             ` Shubhrajyoti Datta
@ 2012-04-20 13:46               ` Kevin Hilman
  -1 siblings, 0 replies; 28+ messages in thread
From: Kevin Hilman @ 2012-04-20 13:46 UTC (permalink / raw)
  To: Shubhrajyoti Datta
  Cc: Shubhrajyoti, linux-serial, linux-omap, linux-arm-kernel, stable,
	Govindraj.R

Shubhrajyoti Datta <omaplinuxkernel@gmail.com> writes:

> On Wed, Apr 18, 2012 at 8:43 PM, Shubhrajyoti <shubhrajyoti@ti.com> wrote:
>>>
>>> Kevin
>> Yes agree completely. Will describe that in the changelog.
>> --
> Does the following changelog look ok?

A little better, but still doesn't explain things so that someone who is
not intimately familar with the driver can understand the auto-suspend
version is needed in the one case.

Possibly explaining in more detail what would happen if the normal put
is used here instead of the autosuspend version might help.

Kevin

> From 37fdc2d40c9b2b19b8c5a9a4b8f7dd547d420f55 Mon Sep 17 00:00:00 2001
> From: Shubhrajyoti D <shubhrajyoti@ti.com>
> Date: Wed, 4 Apr 2012 16:32:37 +0530
> Subject: [PATCH] UART: OMAP: call pm_runtime_put/autosuspend in the error cases
>
> In the error cases the runtime_put call is missed. This patch intends to fix the
> same. In case dma request fails, we fall back to the nondma mode so after
> enabling the threshold call put_autosuspend.
>
> Cc: Govindraj.R <govindraj.raja@ti.com>
> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
> ---
>  drivers/tty/serial/omap-serial.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
> index fe099bb..10e80bb 100644
> --- a/drivers/tty/serial/omap-serial.c
> +++ b/drivers/tty/serial/omap-serial.c
> @@ -319,6 +319,8 @@ static void serial_omap_start_tx(struct uart_port *port)
>
>  		if (ret < 0) {
>  			serial_omap_enable_ier_thri(up);
> +			pm_runtime_mark_last_busy(&up->pdev->dev);
> +			pm_runtime_put_autosuspend(&up->pdev->dev);
>  			return;
>  		}
>  	}
> @@ -1029,8 +1031,10 @@ static int serial_omap_poll_get_char(struct
> uart_port *port)
>
>  	pm_runtime_get_sync(&up->pdev->dev);
>  	status = serial_in(up, UART_LSR);
> -	if (!(status & UART_LSR_DR))
> +	if (!(status & UART_LSR_DR)) {
> +		pm_runtime_put(&up->pdev->dev);
>  		return NO_POLL_CHAR;
> +	}
>
>  	status = serial_in(up, UART_RX);
>  	pm_runtime_put(&up->pdev->dev);

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 2/7] UART: OMAP: Cut the clock in the error cases
@ 2012-04-20 13:46               ` Kevin Hilman
  0 siblings, 0 replies; 28+ messages in thread
From: Kevin Hilman @ 2012-04-20 13:46 UTC (permalink / raw)
  To: linux-arm-kernel

Shubhrajyoti Datta <omaplinuxkernel@gmail.com> writes:

> On Wed, Apr 18, 2012 at 8:43 PM, Shubhrajyoti <shubhrajyoti@ti.com> wrote:
>>>
>>> Kevin
>> Yes agree completely. Will describe that in the changelog.
>> --
> Does the following changelog look ok?

A little better, but still doesn't explain things so that someone who is
not intimately familar with the driver can understand the auto-suspend
version is needed in the one case.

Possibly explaining in more detail what would happen if the normal put
is used here instead of the autosuspend version might help.

Kevin

> From 37fdc2d40c9b2b19b8c5a9a4b8f7dd547d420f55 Mon Sep 17 00:00:00 2001
> From: Shubhrajyoti D <shubhrajyoti@ti.com>
> Date: Wed, 4 Apr 2012 16:32:37 +0530
> Subject: [PATCH] UART: OMAP: call pm_runtime_put/autosuspend in the error cases
>
> In the error cases the runtime_put call is missed. This patch intends to fix the
> same. In case dma request fails, we fall back to the nondma mode so after
> enabling the threshold call put_autosuspend.
>
> Cc: Govindraj.R <govindraj.raja@ti.com>
> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
> ---
>  drivers/tty/serial/omap-serial.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
> index fe099bb..10e80bb 100644
> --- a/drivers/tty/serial/omap-serial.c
> +++ b/drivers/tty/serial/omap-serial.c
> @@ -319,6 +319,8 @@ static void serial_omap_start_tx(struct uart_port *port)
>
>  		if (ret < 0) {
>  			serial_omap_enable_ier_thri(up);
> +			pm_runtime_mark_last_busy(&up->pdev->dev);
> +			pm_runtime_put_autosuspend(&up->pdev->dev);
>  			return;
>  		}
>  	}
> @@ -1029,8 +1031,10 @@ static int serial_omap_poll_get_char(struct
> uart_port *port)
>
>  	pm_runtime_get_sync(&up->pdev->dev);
>  	status = serial_in(up, UART_LSR);
> -	if (!(status & UART_LSR_DR))
> +	if (!(status & UART_LSR_DR)) {
> +		pm_runtime_put(&up->pdev->dev);
>  		return NO_POLL_CHAR;
> +	}
>
>  	status = serial_in(up, UART_RX);
>  	pm_runtime_put(&up->pdev->dev);

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2012-04-20 13:46 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-16 15:06 [PATCH 0/7] UART: OMAP: Updates Shubhrajyoti D
2012-04-16 15:06 ` Shubhrajyoti D
2012-04-16 15:06 ` [PATCH 1/7] ARM: OMAP: UART: Make context_loss_cnt signed Shubhrajyoti D
2012-04-16 15:06   ` Shubhrajyoti D
2012-04-16 15:06 ` [PATCH 2/7] UART: OMAP: Cut the clock in the error cases Shubhrajyoti D
2012-04-16 15:06   ` Shubhrajyoti D
2012-04-18  0:06   ` Kevin Hilman
2012-04-18  0:06     ` Kevin Hilman
2012-04-18  6:44     ` Shubhrajyoti
2012-04-18  6:44       ` Shubhrajyoti
2012-04-18 14:00       ` Kevin Hilman
2012-04-18 14:00         ` Kevin Hilman
2012-04-18 15:13         ` Shubhrajyoti
2012-04-18 15:13           ` Shubhrajyoti
2012-04-20 13:20           ` Shubhrajyoti Datta
2012-04-20 13:20             ` Shubhrajyoti Datta
2012-04-20 13:46             ` Kevin Hilman
2012-04-20 13:46               ` Kevin Hilman
2012-04-16 15:06 ` [PATCH 3/7] UART: OMAP: fix software flow control Shubhrajyoti D
2012-04-16 15:06   ` Shubhrajyoti D
2012-04-16 15:06 ` [PATCH 4/7] UART: OMAP: Remove the default setting of special character Shubhrajyoti D
2012-04-16 15:06   ` Shubhrajyoti D
2012-04-16 15:06 ` [PATCH 5/7] UART: OMAP: Prevent cutting of clocks if put_sync immediately follows Shubhrajyoti D
2012-04-16 15:06   ` Shubhrajyoti D
2012-04-16 15:07 ` [PATCH 6/7] UART: OMAP: Remove the hardcode serial_omap_console_ports array Shubhrajyoti D
2012-04-16 15:07   ` Shubhrajyoti D
2012-04-16 15:07 ` [PATCH 7/7] UART: OMAP: Trivial optimisation of the probe and remove Shubhrajyoti D
2012-04-16 15:07   ` Shubhrajyoti D

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.