* [PATCH RFC 1/2] ARM : OMAP : serial : Make context_loss_cnt signed
@ 2012-01-12 14:03 Shubhrajyoti D
2012-01-12 14:03 ` [PATCH RFC 2/2] OMAP : serial : Check for error in get_context_loss_count Shubhrajyoti D
0 siblings, 1 reply; 4+ messages in thread
From: Shubhrajyoti D @ 2012-01-12 14:03 UTC (permalink / raw)
To: linux-serial; +Cc: linux-omap, linux-kernel, linux-arm-kernel, Shubhrajyoti D
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.
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
applies on Tony's uart branch
arch/arm/plat-omap/include/plat/omap-serial.h | 2 +-
1 files changed, 1 insertions(+), 1 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;
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH RFC 2/2] OMAP : serial : Check for error in get_context_loss_count
2012-01-12 14:03 [PATCH RFC 1/2] ARM : OMAP : serial : Make context_loss_cnt signed Shubhrajyoti D
@ 2012-01-12 14:03 ` Shubhrajyoti D
2012-01-19 22:59 ` Kevin Hilman
0 siblings, 1 reply; 4+ messages in thread
From: Shubhrajyoti D @ 2012-01-12 14:03 UTC (permalink / raw)
To: linux-serial; +Cc: linux-omap, linux-kernel, linux-arm-kernel, Shubhrajyoti D
In serial_omap_runtime_resume in case of errors returned by
get_context_loss_count print a warning and do a restore.
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
applies on Tony's uart branch
drivers/tty/serial/omap-serial.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 29fe6fd..6008612 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1602,10 +1602,16 @@ static int serial_omap_runtime_resume(struct device *dev)
if (up) {
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.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH RFC 2/2] OMAP : serial : Check for error in get_context_loss_count
2012-01-12 14:03 ` [PATCH RFC 2/2] OMAP : serial : Check for error in get_context_loss_count Shubhrajyoti D
@ 2012-01-19 22:59 ` Kevin Hilman
2012-01-20 5:59 ` Shubhrajyoti
0 siblings, 1 reply; 4+ messages in thread
From: Kevin Hilman @ 2012-01-19 22:59 UTC (permalink / raw)
To: Shubhrajyoti D; +Cc: linux-serial, linux-omap, linux-kernel, linux-arm-kernel
Shubhrajyoti D <shubhrajyoti@ti.com> writes:
> In serial_omap_runtime_resume in case of errors returned by
> get_context_loss_count print a warning and do a restore.
>
> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
These two patches should be combined into a single patch.
Also, please Cc Govindraj since he's the maintainer of this driver and
should Ack.
Thanks,
Kevin
> ---
> applies on Tony's uart branch
>
> drivers/tty/serial/omap-serial.c | 10 ++++++++--
> 1 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
> index 29fe6fd..6008612 100644
> --- a/drivers/tty/serial/omap-serial.c
> +++ b/drivers/tty/serial/omap-serial.c
> @@ -1602,10 +1602,16 @@ static int serial_omap_runtime_resume(struct device *dev)
>
> if (up) {
> 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 */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH RFC 2/2] OMAP : serial : Check for error in get_context_loss_count
2012-01-19 22:59 ` Kevin Hilman
@ 2012-01-20 5:59 ` Shubhrajyoti
0 siblings, 0 replies; 4+ messages in thread
From: Shubhrajyoti @ 2012-01-20 5:59 UTC (permalink / raw)
To: Kevin Hilman; +Cc: linux-serial, linux-omap, linux-kernel, linux-arm-kernel
On Friday 20 January 2012 04:29 AM, Kevin Hilman wrote:
> Shubhrajyoti D <shubhrajyoti@ti.com> writes:
>
>> In serial_omap_runtime_resume in case of errors returned by
>> get_context_loss_count print a warning and do a restore.
>>
>> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
> These two patches should be combined into a single patch.
>
OK I will combine. I had split as the one was a serial driver and one
for omap
maintainer.
However I agree that they should be combined.
> Also, please Cc Govindraj since he's the maintainer of this driver and
> should Ack.
will do that
> Thanks,
>
> Kevin
>
>> ---
>> applies on Tony's uart branch
>>
>> drivers/tty/serial/omap-serial.c | 10 ++++++++--
>> 1 files changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
>> index 29fe6fd..6008612 100644
>> --- a/drivers/tty/serial/omap-serial.c
>> +++ b/drivers/tty/serial/omap-serial.c
>> @@ -1602,10 +1602,16 @@ static int serial_omap_runtime_resume(struct device *dev)
>>
>> if (up) {
>> 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 */
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-01-20 5:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-12 14:03 [PATCH RFC 1/2] ARM : OMAP : serial : Make context_loss_cnt signed Shubhrajyoti D
2012-01-12 14:03 ` [PATCH RFC 2/2] OMAP : serial : Check for error in get_context_loss_count Shubhrajyoti D
2012-01-19 22:59 ` Kevin Hilman
2012-01-20 5:59 ` Shubhrajyoti
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).