From patchwork Tue Dec 18 12:18:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 10735595 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B763513B5 for ; Tue, 18 Dec 2018 12:19:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7D862A0CA for ; Tue, 18 Dec 2018 12:19:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5B292A0D4; Tue, 18 Dec 2018 12:19:17 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 49A702A104 for ; Tue, 18 Dec 2018 12:19:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Z0kApGs1K171oY8kRET4tet4gQ69LSJ+5INaWEyMOpY=; b=pbEXLKgJDEQm1w ht+PmBCF+iI49mxot1aTqiQ4ODXJy6ym0PTorlmtLyWcyuxdem86Na+AylwjG3BoQprGgki9BoOKD hB9+UZw/p/14cUug9fCV6E7qezKZAJP9gzmn+5MxeOjJST/MGgJBTu8q5h9O1cQ91mYhQ+/dvS2wz gLFW6C/TDMSzUxRRUP8MsTploY0ZEboHiYVBBK4lqgtAa5sQjgrNjxZngwJJOWLsoHb2PqHtH2o71 OUKfvkfInHJ1BwK04lRsSqw26EeVFEEXQyoCkm9kFjR/u14r+Ac2lldqQ7EqXq7StN9rHpZWnzbTf wYLQkbTet7ljv2oO1D9w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZELE-0005Hx-9Z; Tue, 18 Dec 2018 12:19:16 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZEKz-00053L-2G for linux-arm-kernel@lists.infradead.org; Tue, 18 Dec 2018 12:19:03 +0000 Received: by mail-wm1-x343.google.com with SMTP id f81so2560307wmd.4 for ; Tue, 18 Dec 2018 04:18:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references:mime-version:content-transfer-encoding; bh=SkscCEtDXpliSXHUz/cuWzh5NuHyq42x9x7Eg9phJA0=; b=Sx4TZAPnVYELEi/GgiW2vm6HLxP6N3CesPKNUruVEtOrQdV3j+sJUglwhjkcqZlcLt FM3CCZsB4QyVZ8LX+cpq/z+1XCkXMNEbX6yGwR2HeBOMote03LYZtCRB1i/0AvSwQhcS HvM/qslHbK26aBNdqbHvbzKK5fbJSlX4Q90VHlnKpj6fc9T6TfsQKQtPYk/+TeU/WrK3 5DICy+eqFo2fqf8a5JUIlCJcoTENy6ff747mQ2VNZOnIMd+Xi7ErwXXatX/Fy6pe7M8V yhHEd36TYjFL6Okln5g99tFj9Q9JzXVRw6bjxe6XOp0eVEiXvZw0GB74vuPE7BcFp02M pCFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references:mime-version :content-transfer-encoding; bh=SkscCEtDXpliSXHUz/cuWzh5NuHyq42x9x7Eg9phJA0=; b=eRDKP4HYShQI2sWz65fTMvS2qz1yvDyRRV172sa327sECf5RQsoM/gWjPixXfAFr7P L9BGNLHoKOVWNYHQTeCYzGpGCMTHw7ExBrgS29ML7+uUUa6+QjH41+RTdnFMp6k4D3Bq K3gkZO64z6kle59akW8nv0aFGqPN/WMcQqlfkgCcI8Si8dxj3wLvgunzriVMGtile9XA FGc33g8/zF1rMp9jAO+UhvkOKs7giPV9BGg0Sukws5l7qU7lk6K2gWKNiga1ePILmacb XJ5EqLiG//NQKYao5mEtXtmI3m9FxJZshdBOufcGwqGqT5LMrftyM/l+xvzoQgNbf27i Y6LA== X-Gm-Message-State: AA+aEWbktov13pjSRyOAtlknE5P1lEtQwXB6inp/enZfCgKBO1qSMeBa xb7Ctiip3Fxf3qpPc/hGJRLj50D2De4qOQ== X-Google-Smtp-Source: AFSGD/WQEIrEbaUo7eI1G29c2X+n1KtgyLsk4tqicmOf5dgboH1XY/qgCxqhmzmGHXqNTPd5hn7WcA== X-Received: by 2002:a1c:8851:: with SMTP id k78mr3047275wmd.51.1545135528993; Tue, 18 Dec 2018 04:18:48 -0800 (PST) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id s66sm2092390wmf.34.2018.12.18.04.18.48 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 18 Dec 2018 04:18:48 -0800 (PST) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu, michal.simek@xilinx.com, Greg Kroah-Hartman , Shubhrajyoti Datta Subject: [PATCH v2 1/4] serial: uartps: Add the device_init_wakeup Date: Tue, 18 Dec 2018 13:18:39 +0100 Message-Id: <439951b77da9a1d4cc0551af41c158ae5908b840.1545135519.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181218_041901_155793_B0F3E0E8 X-CRM114-Status: GOOD ( 11.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, Jiri Slaby Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Shubhrajyoti Datta Initialise the device wakeup. The device_init_wakeup is needed for the wakeup to work by default. Uart can be configured as the primary wakeup source so it is good to enable wakeup by default. The same functionality is enabled also by 8250_omap, atmel_serial, omap-serial and stm32-usart. Signed-off-by: Shubhrajyoti Datta Signed-off-by: Michal Simek --- Changes in v2: - Change description based on request from Greg drivers/tty/serial/xilinx_uartps.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 379242b96790..0140644391df 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1624,6 +1624,7 @@ static int cdns_uart_probe(struct platform_device *pdev) pm_runtime_set_autosuspend_delay(&pdev->dev, UART_AUTOSUSPEND_TIMEOUT); pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); + device_init_wakeup(port->dev, true); #ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE /* @@ -1702,6 +1703,7 @@ static int cdns_uart_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); pm_runtime_set_suspended(&pdev->dev); pm_runtime_dont_use_autosuspend(&pdev->dev); + device_init_wakeup(&pdev->dev, false); #ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE if (console_port == port) From patchwork Tue Dec 18 12:18:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 10735597 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C52FF1575 for ; Tue, 18 Dec 2018 12:19:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2B092A14B for ; Tue, 18 Dec 2018 12:19:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A653D2A1A3; Tue, 18 Dec 2018 12:19:34 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 180092A151 for ; Tue, 18 Dec 2018 12:19:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=VHoVgvuFahZiF/Bl/HsBs4A+vmjs64ZHx5wqYeH3N/c=; b=dUYNAuLhojyk+bns9UkeQYP4kV ifUlwaIu/jxWRvN4A6rQoyS1jgasMY8GOn85hdE8qp3M67IPJgFwnguV0+50QrXijjTU4UCiVh/Qj IFDZksbvpeezURZ7bcFB5rsl7ZO6BJPZhCAYY+dlXx6tTWxY2FJR9vh8GyIipyzbvtnaFvEKHTIyU g+n/g7kK+jJTU1hHztVGMnCZyJNbqMpZXMErUpMEgWCwp2fnQMU1CexQBh2ZSDTgQktQEmoWCBcMu 33Grwfel/ex4LxYe5saA/RaYRNRSFTjErEOogCJ8JlrQNDfBv5uQq48e90LIw4PbbXB7RiawHpUK1 iFZSN14A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZELP-0005T0-GH; Tue, 18 Dec 2018 12:19:27 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZEL0-00053W-2V for linux-arm-kernel@lists.infradead.org; Tue, 18 Dec 2018 12:19:03 +0000 Received: by mail-wr1-x441.google.com with SMTP id t27so15691606wra.6 for ; Tue, 18 Dec 2018 04:18:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=sr4wuOWXsEDaIHmkdgp5/mtEUfBN4wQ+UuMd8Oge7B4=; b=EqZdGbpNUKx1T/vwDwk3desDmKTHP2e28GVlgVSY4w3rfP2d5HecQH+DYwRsvXSaa4 gR3blQRULTvGOsOh6gKGHfmTg10TZ2iJpOTYymZuNyU3Q47iWOPKubvcx9voiVtyOyTe 8fyRpPsXBLXgVSFN0TKLiDPcqVegcxdYuYGv6tpxv/FiZzf2KGFEvWZ2cSsP1p/8xnOU BIDRdKUHtHP0ZCBFo6lQD2QUtMItAHlTSUmdEj1IyduV543TfP9st1nvXRTzA5ZIvSuq qrH88bYKpzBKS1dtK06lfFpALG2rdomM96qTIROEwSgVw9NxVW+QxbKC7UupZW/hW4iK 31Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=sr4wuOWXsEDaIHmkdgp5/mtEUfBN4wQ+UuMd8Oge7B4=; b=B8vJi90lttggk5Hxh3qsnuGskmzwfhteWxqFdsc9jcaN+dJ3wVgEQrohbmWKKfRaLN 4H9Fssr+C+KIYfJ7oHW6qn/Lu1Q3PnWpScWHiU9jYMkQLR4Q4UbT4PFZ8S/dCpfp+K1U zdn9doSbb7zUxSNMJrz4v5HDmIC9QIHI/lBl8kw/zwkrxqri1+fZiD+rIMNoP7+MvM8l a6WW0G9EVTzM0nkD6cuBpd09t97/6G8w+MVW+mgyij7A/9uStiw77I2G3kibonbUABRm MUvf5826g2E61Qh/fx8n8UtBr6mA8+N61u1aoxEeN+kaxrV9c9MVL9rziipKIewkVNO1 lzmQ== X-Gm-Message-State: AA+aEWathNsBzC7g2d9oXaPcY1ZJT7o1Th53eLKVHMhJj0xCfd6cFvek +OFuDNW125kLyxsfOp8AUkc4qA== X-Google-Smtp-Source: AFSGD/UCRtnbBFtHMIKnjndA6yC3das3xoHh1I4qGT2mMOH0yKDXmZ05nsOBOlnUZEpEiyBRSTBQXA== X-Received: by 2002:a5d:480d:: with SMTP id l13mr15450222wrq.175.1545135530534; Tue, 18 Dec 2018 04:18:50 -0800 (PST) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id m6sm2594800wrv.24.2018.12.18.04.18.49 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 18 Dec 2018 04:18:49 -0800 (PST) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu, michal.simek@xilinx.com, Greg Kroah-Hartman , Shubhrajyoti Datta Subject: [PATCH v2 2/4] serial: uartps: Check if the device is a console Date: Tue, 18 Dec 2018 13:18:40 +0100 Message-Id: <863488c6f6d7f3d8c53d46f442f25ec2f46ee651.1545135519.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181218_041902_113661_353B437A X-CRM114-Status: GOOD ( 12.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, Jiri Slaby MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Shubhrajyoti Datta While checking for console_suspend_enabled also check if the device is a console. Signed-off-by: Shubhrajyoti Datta Signed-off-by: Michal Simek --- Changes in v2: None drivers/tty/serial/xilinx_uartps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 0140644391df..9cdc36be5b13 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1255,7 +1255,7 @@ static int cdns_uart_suspend(struct device *device) may_wake = device_may_wakeup(device); - if (console_suspend_enabled && may_wake) { + if (console_suspend_enabled && uart_console(port) && may_wake) { unsigned long flags = 0; spin_lock_irqsave(&port->lock, flags); @@ -1293,7 +1293,7 @@ static int cdns_uart_resume(struct device *device) may_wake = device_may_wakeup(device); - if (console_suspend_enabled && !may_wake) { + if (console_suspend_enabled && uart_console(port) && !may_wake) { clk_enable(cdns_uart->pclk); clk_enable(cdns_uart->uartclk); From patchwork Tue Dec 18 12:18:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 10735601 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9F3A71850 for ; Tue, 18 Dec 2018 12:20:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EABC2A135 for ; Tue, 18 Dec 2018 12:20:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8280A29B2D; Tue, 18 Dec 2018 12:20:02 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 30DD129B2D for ; Tue, 18 Dec 2018 12:20:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=oRj8iXuc9d8aBMnGEQJektC1NtYD83Dbg0DoQ+3SwcE=; b=e1S6TCmRlqot5nTpB7DHd08N6D zpZyT9SNH1xB+xjf2ZjuEIu+d/HfHrm1azFHy2YZjJTq02hfxFHN9nGm/5eHEapbsVNAV6YTcvaF8 BOKhHuQ374QquSJHSXUwb3IScsOJZzDTatztqg8lDeGFS01GyV3KxkWvRZ/TGnY8WbohZSj+HZqjf M1uN2uNVJJE8tALKlXqAtLwEKjHYnj23AAtVwLKddJy3Z/18RSOANTlibGfoDfnvBVc0JFeXlygkK gaQJkHdvZFNwJa0W7YtUUpuo+ncjfjKAlTNS2jZebHve9QOuwS6hfsLTLiMx/jqDk7LU/2yeMwpxg 1/CZicdQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZELn-0005pC-To; Tue, 18 Dec 2018 12:19:52 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZEL2-00053Y-RU for linux-arm-kernel@lists.infradead.org; Tue, 18 Dec 2018 12:19:08 +0000 Received: by mail-wm1-x344.google.com with SMTP id b11so2388489wmj.1 for ; Tue, 18 Dec 2018 04:18:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=eSWAZ8hE+0QmxOSC1nocpx2/Vn+e5jpinCbecxT0A1U=; b=CPuj/r/i3UFd+YIrnxG0g630Kds/PAKQUZcebI8OCjummw+9fT9Cv8Q4tAn91hUzR+ j1AsMVfOWONddLGNp6Ig3rGdBPrSSWShb86H15qWzlMyPWSfAW5pxwadN9/LdnLLGvAa LXU2XAqubaXg2La+Q1FMeCM8H4Q1MzdlpPQ+aKpk1Jv/8kgip+Ql8Sb4PjHvjGhzA48P Bux30y7bSPIxQJnf8jnLsQ2vst0DMSERSxV9n74WAb1+Binw1xBPJhy4rks+JufyOimA rceETvjlvJX7Extac0QySHselFY1jKEU5mR57JRcCQp2/PGFDYiTC0GVy4fJIqtBqZEV OOOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=eSWAZ8hE+0QmxOSC1nocpx2/Vn+e5jpinCbecxT0A1U=; b=BsmWdOBvLQV5XLiL3Ixex/5JRY4/WvhLd0GzfjddPjt1fwxdJAl9xuR2JI6Z3COSii D8g7/SwHo04IKKxqWO+Bhd7aarhCbMqF6u4aS7HJFBKIkMLEacs3QWm6EU8Y2hxSUwQJ sussOCkMQBei6Belf3IWvAUwKehnBFg9YlZetqushvClBGxss/7LHnCiLZT3vW7ZduP8 kt7ar6XetfKXDMVtvrKJVJNf+FQagRGz6IaPXiESzHtK5B1wSuAjPxkjd4VNjrrBVFi3 7QsyPsBk5vXOqaMWML/kZ3HWQ3k7zxInqC4fY89wwVSljgNz9JZAmRv9Vx6Zyz9AWh4M kBLA== X-Gm-Message-State: AA+aEWalH+z1jEHioNLGhkP8NWJWFjT8YPIPfVcSS/JYL57oGlqTjKn+ dKpd9xQFao93Ff8Kw/CZhbXzjw== X-Google-Smtp-Source: AFSGD/VsDGPBBDng6W5LtjkbuBDOleG+qY9bwFQ71ITJ8/+DcG9OwXkaK+TcXJneJQBU8Ao+XuFlpg== X-Received: by 2002:a1c:6a16:: with SMTP id f22mr3014484wmc.25.1545135532031; Tue, 18 Dec 2018 04:18:52 -0800 (PST) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id e19sm4269935wrc.25.2018.12.18.04.18.51 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 18 Dec 2018 04:18:51 -0800 (PST) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu, michal.simek@xilinx.com, Greg Kroah-Hartman , Shubhrajyoti Datta Subject: [PATCH v2 3/4] serial: uartps: Fix error path when alloc failed Date: Tue, 18 Dec 2018 13:18:41 +0100 Message-Id: <2c90972b04a6f87100f6bcc4f6fa4630de025874.1545135519.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181218_041905_019217_034F64B8 X-CRM114-Status: GOOD ( 12.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, Jiri Slaby MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When cdns_uart_console allocation failed there is a need to also clear ID from ID list. Fixes: ae1cca3fa347 ("serial: uartps: Change uart ID port allocation") Signed-off-by: Michal Simek --- Changes in v2: None drivers/tty/serial/xilinx_uartps.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 9cdc36be5b13..c6d38617d622 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1508,8 +1508,10 @@ static int cdns_uart_probe(struct platform_device *pdev) #ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE cdns_uart_console = devm_kzalloc(&pdev->dev, sizeof(*cdns_uart_console), GFP_KERNEL); - if (!cdns_uart_console) - return -ENOMEM; + if (!cdns_uart_console) { + rc = -ENOMEM; + goto err_out_id; + } strncpy(cdns_uart_console->name, CDNS_UART_TTY_NAME, sizeof(cdns_uart_console->name)); From patchwork Tue Dec 18 12:18:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 10735599 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC9C213BF for ; Tue, 18 Dec 2018 12:19:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA47629884 for ; Tue, 18 Dec 2018 12:19:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD4352A1DC; Tue, 18 Dec 2018 12:19:42 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EFFDC2A1A3 for ; Tue, 18 Dec 2018 12:19:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=HDB8MZRGFai8Nh2cr1ZXbd3y7RVwWZX2OR1fzzLR5oM=; b=glI+OEUHUvi1OqsrkMX6dJcqhT 7MKycspvcSO4o7GB/Qg0b5P0qULi9JBHXoOksgsuuqMGFLYEgxtf0Ddy2cemncIa3i438gEOLICNs q8gMb2S2FbZmlh6+LSW4fH8XIC6VAT/k2SiCKEY8Bsfcx82lo6goaiU2lTiWyhrOu2w4xRlZXe4Fq /EJPGWhXKljumrroTjHAwEm+UZGfvzcLa16eKhAzdzmrqbEQCXrkEXIujlWZm5saVYjaKqeP6TtbP JAAoqe4T4i0nLwpPg3YNDfaSQ9Ng7GaHY8kNKdzcYrhjtpq6VdrpTA9wHOb2sAvReO6kojGXhC4Zd KoLF9UAA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZELX-0005dw-PD; Tue, 18 Dec 2018 12:19:35 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZEL0-00053u-2X for linux-arm-kernel@lists.infradead.org; Tue, 18 Dec 2018 12:19:03 +0000 Received: by mail-wr1-x441.google.com with SMTP id q18so15670153wrx.9 for ; Tue, 18 Dec 2018 04:18:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=gJ27nswbrpfxVG6qA2cxraDTu06pZ4WKxOLJS8Arquc=; b=GNS6SfUpxj34SU85j/K3BuxG0Zrs4chu/XCYqcWqcJyjFrMfSRSyYkfJBlmDXrIxce d59pyoiI4dIhRsI/aP0UGwBDu/N6ylueeIVmFMjox1+N3Sg1vXvBtKVT87orSTQM9lyL O1jKMyXDsRj1De5lnPreLB7QY9XBDClvjzvtBO4cgpRSzISEF5VsESjSlNr8qyPDOAGk FUVezzvflH6RoqwskrHshyXNFNe67kSJCIDkJosVYG/t2STFcZQYnieKzrrfbfKB/OlH 2WRqrPJL59ICy9FmTnOWsmbH4TxrB0iUb4xI+xR+ZyENkz9eTfwhg9oKG4YB2I2tnlow 6dcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=gJ27nswbrpfxVG6qA2cxraDTu06pZ4WKxOLJS8Arquc=; b=ZiPoUS8CEhJq1rKr/qx/+lWkpC6ZXMFd5qS7ZqEeiX/5NdZMFEKdyZmlhgZIFyaiNW yOS8MwUoq/wsQ/BucijhP1IjUiE6BoUvvTzDabJOlOrQfzlzM51paIirwTR4Wf4dFMe6 /mPAYonflX56M1Xkc2QzHS2+Y4AJmnJxh1gwpsaqrSQWGiuyXj/Cc/4NlyYOyV33oBV9 SfnVK3GEcltgewH74qRUeRuLohqBOtyWLI3lFX/lX0JCsgRmBAvUo4HDC+NrSdRH6/fo rFMsGibJpbHgw7J3PNwir4/QJRBuGQ2TaWpZP4ZKbMq9LMQK/2uzZtIDtpfnicMUA7u2 D9lA== X-Gm-Message-State: AA+aEWYotR+xQWVLNltO4SnTzs8NQJb/SsLM6TXEoePJpELq4suPOD1R t97DcGxIul4OufVPpeKuU7wSrA== X-Google-Smtp-Source: AFSGD/U+GdXHuT8ZzbO+PKI2ZZsyetLAgHnmfgmja5FkS8PJGNY/BwJgfkHs0I0m7mECgrCOalo2Cw== X-Received: by 2002:adf:f28d:: with SMTP id k13mr15173271wro.78.1545135533622; Tue, 18 Dec 2018 04:18:53 -0800 (PST) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id w80sm2290393wme.38.2018.12.18.04.18.52 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 18 Dec 2018 04:18:52 -0800 (PST) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu, michal.simek@xilinx.com, Greg Kroah-Hartman , Shubhrajyoti Datta Subject: [PATCH v2 4/4] serial: uartps: Fix interrupt mask issue to handle the RX interrupts properly Date: Tue, 18 Dec 2018 13:18:42 +0100 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181218_041902_114299_CF3E8972 X-CRM114-Status: GOOD ( 12.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nava kishore Manne , linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, Jiri Slaby MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Nava kishore Manne This patch Correct the RX interrupt mask value to handle the RX interrupts properly. Fixes: c8dbdc842d30 ("serial: xuartps: Rewrite the interrupt handling logic") Signed-off-by: Nava kishore Manne Signed-off-by: Michal Simek --- Changes in v2: - Fix Nava's email address to align with patch email address drivers/tty/serial/xilinx_uartps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index c6d38617d622..094f2958cb2b 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -123,7 +123,7 @@ #define CDNS_UART_IXR_RXTRIG 0x00000001 /* RX FIFO trigger interrupt */ #define CDNS_UART_IXR_RXFULL 0x00000004 /* RX FIFO full interrupt. */ #define CDNS_UART_IXR_RXEMPTY 0x00000002 /* RX FIFO empty interrupt. */ -#define CDNS_UART_IXR_MASK 0x00001FFF /* Valid bit mask */ +#define CDNS_UART_IXR_RXMASK 0x000021e7 /* Valid RX bit mask */ /* * Do not enable parity error interrupt for the following @@ -364,7 +364,7 @@ static irqreturn_t cdns_uart_isr(int irq, void *dev_id) cdns_uart_handle_tx(dev_id); isrstatus &= ~CDNS_UART_IXR_TXEMPTY; } - if (isrstatus & CDNS_UART_IXR_MASK) + if (isrstatus & CDNS_UART_IXR_RXMASK) cdns_uart_handle_rx(dev_id, isrstatus); spin_unlock(&port->lock);