From patchwork Fri May 6 09:46:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pramod Gurav X-Patchwork-Id: 67255 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp226851qge; Fri, 6 May 2016 02:46:37 -0700 (PDT) X-Received: by 10.98.55.133 with SMTP id e127mr26740397pfa.81.1462527997484; Fri, 06 May 2016 02:46:37 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a3si15689734pfb.217.2016.05.06.02.46.37; Fri, 06 May 2016 02:46:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756087AbcEFJqg (ORCPT + 2 others); Fri, 6 May 2016 05:46:36 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:35323 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751511AbcEFJqf (ORCPT ); Fri, 6 May 2016 05:46:35 -0400 Received: by mail-pa0-f41.google.com with SMTP id iv1so45899818pac.2 for ; Fri, 06 May 2016 02:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=ZTqqHcfvKCua1M6tt3ng06zoYNChh9N1uGYANAr+gZ8=; b=epjOpOYGLwRM3MKJbPrwX+rvFxBkYW8ma9mVSXaNgsED41SeRL49bkmDMhgusjPQ8q 0JA577QArkFTLYT5vVaLe3+L9h23kbSVeDLpC/8EYusfZIdYX4RubFChzj/Ngx3pPdg+ pIhMYuZDFfKDvEIhgk3D+WX49xC7qb7WWc6Bc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZTqqHcfvKCua1M6tt3ng06zoYNChh9N1uGYANAr+gZ8=; b=SLEhGg+knYl6XlowntPzZxlxysKkTP2sR+ibMlB50ZLA6orVLREOlcQZZ1xDoMYPFS CHOvKul7SJWsBiKhuoWHz1qqzrr/rS/YuvYP8prb3m4f45JxvIyEebrJW1evbvbI3ucj nU979Ws7FMG1fpc7UWDQvTQY9nAyobvNrUPInCipYwD3vnGTwQd5nXmg3EIRtnYjuG0B CXMtPYfqraC7S3sb98hXz6Q+kMI2UFoi8OTO6bR3L08yKqtLBMefD9kh1EUw+ptf7Snf GmdhqTOTqJw5IGFmCYv1WkrVhC7eeUvgZ7WDazf3hNdaJhecEwIDW07q6ZfRkFEZh69b uXPA== X-Gm-Message-State: AOPr4FU9xYxPseOre9eg7BoMYfoqHrKS6Q6YZCQot1DsmdV3ta/Vg98/3ke0cGlTlVBZTwZ9 X-Received: by 10.66.231.73 with SMTP id te9mr27802445pac.62.1462527994917; Fri, 06 May 2016 02:46:34 -0700 (PDT) Received: from blr-ubuntu-56.ap.qualcomm.com ([202.46.23.61]) by smtp.gmail.com with ESMTPSA id bk8sm19749169pac.3.2016.05.06.02.46.31 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 May 2016 02:46:33 -0700 (PDT) From: Pramod Gurav To: gregkh@linuxfoundation.org, jslaby@suse.com Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Pramod Gurav Subject: [PATCH] serial_core: Change UART PM state to OFF on failure Date: Fri, 6 May 2016 15:16:23 +0530 Message-Id: <1462527983-32108-1-git-send-email-pramod.gurav@linaro.org> X-Mailer: git-send-email 1.8.2.1 Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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 --- drivers/tty/serial/serial_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 1.8.2.1 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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) { + uart_change_pm(state, UART_PM_STATE_OFF); return -ENOMEM; - + } state->xmit.buf = (unsigned char *) page; uart_circ_clear(&state->xmit); }