From patchwork Thu May 3 20:14:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karthikeyan Ramasubramanian X-Patchwork-Id: 10379143 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D2F4860159 for ; Thu, 3 May 2018 20:15:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C040C29271 for ; Thu, 3 May 2018 20:15:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B505C29275; Thu, 3 May 2018 20:15:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 507D129271 for ; Thu, 3 May 2018 20:15:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751081AbeECUPE (ORCPT ); Thu, 3 May 2018 16:15:04 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:60022 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751234AbeECUPD (ORCPT ); Thu, 3 May 2018 16:15:03 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C479860807; Thu, 3 May 2018 20:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1525378502; bh=ZUxOyICosb3gnhAIOt3LnWP8KGQobcnXm+2lHucY8y8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k1YXab2ypi2H43fgOazNSapiZ2gEwOt/VUXqTO5IkaDC2w0a7ged5EgX/q69jFvPi 0SoxjO5+Sx7RUgNJaVqOXn2CYMh4CnpNQQgpi/bs2jFQWdV9xsEGIVyKezoi9SAscW m053fPw63LhBWFbJHbUcLmrwYIeZWZTuJMzLoLZE= Received: from codeaurora.org (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kramasub@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 6839E6037B; Thu, 3 May 2018 20:15:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1525378502; bh=ZUxOyICosb3gnhAIOt3LnWP8KGQobcnXm+2lHucY8y8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k1YXab2ypi2H43fgOazNSapiZ2gEwOt/VUXqTO5IkaDC2w0a7ged5EgX/q69jFvPi 0SoxjO5+Sx7RUgNJaVqOXn2CYMh4CnpNQQgpi/bs2jFQWdV9xsEGIVyKezoi9SAscW m053fPw63LhBWFbJHbUcLmrwYIeZWZTuJMzLoLZE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6839E6037B Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kramasub@codeaurora.org From: Karthikeyan Ramasubramanian To: gregkh@linuxfoundation.org, jslaby@suse.com Cc: Karthikeyan Ramasubramanian , linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, evgreen@chromium.org, acourbot@chromium.org, swboyd@chromium.org, dianders@chromium.org, mka@chromium.org, bjorn.andersson@linaro.org Subject: [PATCH v3 1/8] tty: serial: qcom_geni_serial: Add comments for clarification Date: Thu, 3 May 2018 14:14:33 -0600 Message-Id: <1525378480-10296-2-git-send-email-kramasub@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1525378480-10296-1-git-send-email-kramasub@codeaurora.org> References: <1525378480-10296-1-git-send-email-kramasub@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP * Document reason for newline character counting in console_write * Document reason for disabling IRQ in the system resume operation Signed-off-by: Karthikeyan Ramasubramanian Reviewed-by: Matthias Kaehlcke --- drivers/tty/serial/qcom_geni_serial.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index a1b3eb0..1652b1f 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -286,6 +286,10 @@ static void qcom_geni_serial_wr_char(struct uart_port *uport, int ch) u32 bytes_to_send = count; for (i = 0; i < count; i++) { + /* + * uart_console_write() adds a carriage return for each newline. + * Account for additional bytes to be written. + */ if (s[i] == '\n') bytes_to_send++; } @@ -1103,6 +1107,14 @@ static int __maybe_unused qcom_geni_serial_sys_resume_noirq(struct device *dev) if (console_suspend_enabled && uport->suspended) { uart_resume_port(uport->private_data, uport); + /* + * uart_suspend_port() invokes port shutdown which in turn + * frees the irq. uart_resume_port invokes port startup which + * performs request_irq. The request_irq auto-enables the IRQ. + * In addition, resume_noirq implicitly enables the IRQ and + * leads to an unbalanced IRQ enable warning. Disable the IRQ + * before returning so that the warning is suppressed. + */ disable_irq(uport->irq); } return 0;