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


Groups > linux.kernel > #1417684 > unrolled thread

Re: [PATCH] serial_core: Change UART PM state to OFF on failure

Started byPeter Hurley <peter@hurleysoftware.com>
First post2016-06-08 18:50 +0200
Last post2016-06-10 08:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] serial_core: Change UART PM state to OFF on failure Peter Hurley <peter@hurleysoftware.com> - 2016-06-08 18:50 +0200
    Re: [PATCH] serial_core: Change UART PM state to OFF on failure Pramod Gurav <pramod.gurav@linaro.org> - 2016-06-10 08:00 +0200

#1417684 — Re: [PATCH] serial_core: Change UART PM state to OFF on failure

FromPeter Hurley <peter@hurleysoftware.com>
Date2016-06-08 18:50 +0200
SubjectRe: [PATCH] serial_core: Change UART PM state to OFF on failure
Message-ID<rHOQ2-2Bc-31@gated-at.bofh.it>
Hi Pramod,

On 05/06/2016 02:46 AM, Pramod Gurav wrote:
> uart_change_pm is used to turn on the UART controller resources and
> change UART's PM status. On failure to allocate pages the controller
> be left in ON state. This will change the state to OFF on failure.
> 
> Signed-off-by: Pramod Gurav <pramod.gurav@linaro.org>
> ---
>  drivers/tty/serial/serial_core.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> index 62fe368..58af2e9 100644
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -156,9 +156,10 @@ static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,
>  	if (!state->xmit.buf) {
>  		/* This is protected by the per port mutex */
>  		page = get_zeroed_page(GFP_KERNEL);
> -		if (!page)
> +		if (!page) {

	if (!uart_console(uport))

Otherwise, you'll be powering off the console.

Just out of curiosity, did you actually hit this error?

Regards,
Peter Hurley

> +			uart_change_pm(state, UART_PM_STATE_OFF);
>  			return -ENOMEM;
> -
> +		}
>  		state->xmit.buf = (unsigned char *) page;
>  		uart_circ_clear(&state->xmit);
>  	}
> 

[toc] | [next] | [standalone]


#1419045

FromPramod Gurav <pramod.gurav@linaro.org>
Date2016-06-10 08:00 +0200
Message-ID<rInE5-Cy-15@gated-at.bofh.it>
In reply to#1417684
Hi Peter,

On 8 June 2016 at 22:17, Peter Hurley <peter@hurleysoftware.com> wrote:
> Hi Pramod,
>
> On 05/06/2016 02:46 AM, Pramod Gurav wrote:
>> uart_change_pm is used to turn on the UART controller resources and
>> change UART's PM status. On failure to allocate pages the controller
>> be left in ON state. This will change the state to OFF on failure.
>>
>> Signed-off-by: Pramod Gurav <pramod.gurav@linaro.org>
>> ---
>>  drivers/tty/serial/serial_core.c | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
>> index 62fe368..58af2e9 100644
>> --- a/drivers/tty/serial/serial_core.c
>> +++ b/drivers/tty/serial/serial_core.c
>> @@ -156,9 +156,10 @@ static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,
>>       if (!state->xmit.buf) {
>>               /* This is protected by the per port mutex */
>>               page = get_zeroed_page(GFP_KERNEL);
>> -             if (!page)
>> +             if (!page) {
>
>         if (!uart_console(uport))
>
> Otherwise, you'll be powering off the console.
>

Agree. Should take care console is not disabled.
> Just out of curiosity, did you actually hit this error?
No, I did not. I thought we should not be leaving port power enabled
in error case.

Thanks for review and comments.

Regards,
Pramod

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web