From patchwork Fri Jul 29 11:47:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 594621 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06703C19F2B for ; Fri, 29 Jul 2022 11:48:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235603AbiG2LsB (ORCPT ); Fri, 29 Jul 2022 07:48:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235355AbiG2Lr7 (ORCPT ); Fri, 29 Jul 2022 07:47:59 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2064.outbound.protection.outlook.com [40.107.243.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FCC57E303 for ; Fri, 29 Jul 2022 04:47:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OYJt/PPockCmbXWgGc8DbJWf9Ve4O7+xd7SAOdkBCXl0bfR/tAyL+DHbCKK6QB5nVWOZoauH+BxrsoKXwQXHik0CT/YuSvBy0CFLPPXOpijvoJco+rLvbtctmPVT/At0ZmjF0f4mdeq1F+z+HyaKUWSEcVB5G2VXdORy94hNVT2jneZjcef43/yvpNtPLVCr+iFBsP1cvqUPR2thM1QL3W/2k5zFASWFm5MVjOK7+8IMTgG+dJgi3coZ9Pd4avKFNw+oQlDF75kU8OT8EbEKrJn4OCzHC7dfzR73MvuJNtVNBT10B2dH0DqWAzaJYsSJXyeNwQ3Qt6Dx4cigv/NLaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7xFCCt9TPyjqA1DDUknywUqbPS1dp1bUQ/7tcJ7LK6s=; b=PtnOF6P8rkTPVOPYsQbb/h4B5FiABplbzgTCekG0cMQnWFpSwW61KDuXTGYpVURMDqG2hYp5iGDcjuv3F5UVe5XJDHrWIMNDmLInVEHc8EozISFBaYpaeX0Jb/8KCs1WTO0hm+NIN46mvGRczSBZH2+KzUDvftbaHVPboYkqKyakzMD9lIKQhMUuYFUSXpNjO4RN7JM1Gd6hOdRcZ/js8KfLsk0yGhBxMCz9+sHGfb1kD6cZLisi+J2Xd9OUG1X2RhFNYVs8sKSd18ucW/lwaHiGTRnqYwp/s+4OKYJq5ltdnU6/HXKy2haP8SBVnqjmMyah7IyhrZU03RaP4J8pZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7xFCCt9TPyjqA1DDUknywUqbPS1dp1bUQ/7tcJ7LK6s=; b=BqCZQD4dPTf/CG6svkY382Q7sknZwb5kl17gfQCCueYmZP0mX4tkKFJYbjP9m7FqfxHlKNKMJyQ7l1jK/nnHlYzyHTJfMaz5ia4L8D8Zge4qojFTr4sGEMeWNDvr3i5YCmdCXaGkIBXKFOxaBxhYndfp0YHRwujWeoiEX7L7Ifk= Received: from SA0PR11CA0200.namprd11.prod.outlook.com (2603:10b6:806:1bc::25) by SN6PR02MB5678.namprd02.prod.outlook.com (2603:10b6:805:e8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.23; Fri, 29 Jul 2022 11:47:57 +0000 Received: from SN1NAM02FT0047.eop-nam02.prod.protection.outlook.com (2603:10b6:806:1bc:cafe::c) by SA0PR11CA0200.outlook.office365.com (2603:10b6:806:1bc::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.10 via Frontend Transport; Fri, 29 Jul 2022 11:47:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; pr=C Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0047.mail.protection.outlook.com (10.97.5.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5458.17 via Frontend Transport; Fri, 29 Jul 2022 11:47:57 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Fri, 29 Jul 2022 04:47:56 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Fri, 29 Jul 2022 04:47:56 -0700 Envelope-to: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, shubhrajyoti.datta@gmail.com, git@amd.com Received: from [10.140.6.18] (port=57946 helo=xhdlakshmis40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1oHOTE-000DJo-6N; Fri, 29 Jul 2022 04:47:56 -0700 From: Shubhrajyoti Datta To: CC: , , , , Shubhrajyoti Datta Subject: [PATCH v2 1/7] tty: xilinx_uartps: Check clk_enable return value Date: Fri, 29 Jul 2022 17:17:42 +0530 Message-ID: <20220729114748.18332-2-shubhrajyoti.datta@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220729114748.18332-1-shubhrajyoti.datta@xilinx.com> References: <20220729114748.18332-1-shubhrajyoti.datta@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a542e605-3469-4c0b-8bfb-08da71582e39 X-MS-TrafficTypeDiagnostic: SN6PR02MB5678:EE_ X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u0lBIkVwqmxmW4EzjDdvGnwSbqO6FyH3awK9CQjmd7NlzfOkGiJXGpARBUCh2ehl8fZy9sH+uzEeeg4+0f2HLLEtWSLbo7Nxs9XpkMlXW98aswM0xomY3axBVJ+BS/MPSz7TfY3rLcIdwbd1FRt7PtyytjsVgLTtxAU0nh+Rq6wn697qFehKtPTjibClGBIDjegoJgwrDPf88uuR9GvL8HTB65n4Xtf1pEISgwVqXCgoft9XWz2w+Wc+WrLt+JwMp9fcj2AgaS11C0AbtPy4h5Uegf4KQd8Iso3f+aQDBY8QsYeoAhDl6Q5aRckZNFd7TzwrH6v7EzxoaXvtgumXoLrnLLEavUKJ5q9eKmSrukHey9ALfckFaCX5H0YLAPTTeVUkk2IRWD2viauJdCzDkDSQshnlkckEnC7Z6vrnbv9qVKGv9l5T1ob2lGrI3iB9Mz32lmbffU1pIAKsSlAwtpM30mRL83LyNW+Y9HRrymxsgq2d/bID9Hd6agtwElc6TuaEeJbStgYTJnP5kjxWpPSK27mEc3iu4Cfv3leuZC7S0X9YplAuELD3/gNBEB0/k3bzt5YoIktAKj03iJD9SLHS71B0n/iRIVRIPlI1uAzNjL6kdmbfn55hvvnGnnsqT0FpP2WtRW2dkIzDDXnSSYock911vP8PCecf4aGx025UOQnlUSQOX25OjReQIEIpQN2ZSTSUHOHTZSm6lYINfVlr1So6+FKcFvhBKFahf2sFYPcfCvRLlrmxt9IbTOYeGWPzAbZ+DcUFdvWuvFTwQ2My2CWpVllVficY/kDZPqKrJST3xJw13RGyUJdxpmRx5BGmmfiMP3/O4/9O9LUYBQ== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(13230016)(4636009)(346002)(376002)(39860400002)(396003)(136003)(40470700004)(46966006)(36840700001)(6666004)(83380400001)(316002)(54906003)(47076005)(6916009)(82740400003)(36860700001)(40460700003)(7696005)(41300700001)(7636003)(44832011)(9786002)(356005)(426003)(70206006)(2616005)(1076003)(2906002)(8676002)(186003)(8936002)(5660300002)(70586007)(107886003)(336012)(36756003)(478600001)(4326008)(26005)(82310400005)(40480700001)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2022 11:47:57.2149 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a542e605-3469-4c0b-8bfb-08da71582e39 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0047.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB5678 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org If clocks are not enabled the register access may hang the system. Check for the clock enable return value and bail out if not enabled. Signed-off-by: Shubhrajyoti Datta --- v2: Add clock disable in the error path. drivers/tty/serial/xilinx_uartps.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 9e01fe6c0ab8..51fd09e14eda 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1329,12 +1329,20 @@ static int cdns_uart_resume(struct device *device) unsigned long flags; u32 ctrl_reg; int may_wake; + int ret; may_wake = device_may_wakeup(device); if (console_suspend_enabled && uart_console(port) && !may_wake) { - clk_enable(cdns_uart->pclk); - clk_enable(cdns_uart->uartclk); + ret = clk_enable(cdns_uart->pclk); + if (ret) + return ret; + + ret = clk_enable(cdns_uart->uartclk); + if (ret) { + clk_disable(cdns_uart->pclk); + return ret; + } spin_lock_irqsave(&port->lock, flags); From patchwork Fri Jul 29 11:47:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 594619 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B63C2C19F29 for ; Fri, 29 Jul 2022 11:48:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235355AbiG2LsS (ORCPT ); Fri, 29 Jul 2022 07:48:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235560AbiG2LsP (ORCPT ); Fri, 29 Jul 2022 07:48:15 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5644887F50 for ; Fri, 29 Jul 2022 04:48:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Came900xPZfworgZztO2UX/qUQBZxHm2/tX/bLVwRxkPar2xujSMSayDqLgha9x3L0KYCC1g4OngWYoBZ/LEOlOPWAVV836A/YZBlnJ6qrdN0o3YJ803q75AaFluzI/v2V4UKM3/Hvxl7YGm11Ibn4/y4nshb4ZnxxIOjPuHI5SYcIzGjLyCvzqyR3AaJSOfgGM94puQEfXFxiLyyRZOmEm12z597EbwCdRFszw2TuA/rJg3yNPDfD5m+/BAyohca1wGsbD1LIJ/6aox9EFbbfvtMbgX5r9NJD+H6sUq708zSwqzbukGrE8QKjCfMPfVCndC9DGpLuiuxdUlhXa//g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JUtb0QZ9zq2RY8DbP+9SPGORnzgtT4ZMKE8RGjl8+sc=; b=Wi7DBDprikMD9B5i/xPUTY2YsFj1H4BTz/plRwNaExYFM9JpVVh7jXGs0aCkRnXwGAU4POhpXFxm+uvZg+E6pE4upJS+OeU3U6zpfaJ3+lxKyh9m4XBq87mmNCfECNeUgpXMs9yFQ5Qzb/CUEj+iQwN5+dFG5jWCXYgiAsD1UVF9bDaDQRxhgasCQ2P+BvD/RMQupN+wDggwF9BUWhepSKIckWqydQP2Y3smkOTO+ocODoznpSOLaJIEVmQHezsK9fhDewBWj1p0FIcXeJXpQgppLaUb0hPLWI0vOTfjxScvz/k9V8pGp5a1TvF4SJSKmWpl+8TObojr1eT3mkIs8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JUtb0QZ9zq2RY8DbP+9SPGORnzgtT4ZMKE8RGjl8+sc=; b=bmFKscSoW0EpOYV6ReVS+Bg2byS3qZfpR7s0UURvyyifYzUyByE9gyJJHqdrDyY7f+sk2Q11JZZINOdjrTV7QAkHNdoUB1DR1yxAe9Ac7MBZuI7ckt8z0iMZMaNxyH4eDP7L1E3fX1rF7qKWOCV8q1aUoes2b1rHBJnv4GzYwOU= Received: from SN6PR01CA0029.prod.exchangelabs.com (2603:10b6:805:b6::42) by CO6PR02MB8788.namprd02.prod.outlook.com (2603:10b6:303:143::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.19; Fri, 29 Jul 2022 11:48:01 +0000 Received: from SN1NAM02FT0041.eop-nam02.prod.protection.outlook.com (2603:10b6:805:b6:cafe::48) by SN6PR01CA0029.outlook.office365.com (2603:10b6:805:b6::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.12 via Frontend Transport; Fri, 29 Jul 2022 11:48:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; pr=C Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0041.mail.protection.outlook.com (10.97.5.44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5458.17 via Frontend Transport; Fri, 29 Jul 2022 11:48:01 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Fri, 29 Jul 2022 04:47:59 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Fri, 29 Jul 2022 04:47:59 -0700 Envelope-to: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, shubhrajyoti.datta@gmail.com, git@amd.com Received: from [10.140.6.18] (port=57946 helo=xhdlakshmis40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1oHOTG-000DJo-Pf; Fri, 29 Jul 2022 04:47:59 -0700 From: Shubhrajyoti Datta To: CC: , , , , Shubhrajyoti Datta Subject: [PATCH v2 2/7] tty: xilinx_uartps: Update copyright text to correct format Date: Fri, 29 Jul 2022 17:17:43 +0530 Message-ID: <20220729114748.18332-3-shubhrajyoti.datta@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220729114748.18332-1-shubhrajyoti.datta@xilinx.com> References: <20220729114748.18332-1-shubhrajyoti.datta@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2e60d2ed-c3e3-4c17-9a23-08da715830ab X-MS-TrafficTypeDiagnostic: CO6PR02MB8788:EE_ X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /+nSGZXVRT4lXSLRjn3yKVjjqw96jlqEQTu1rCiGY1WWKVTDo1QsWj5JYDNsDh3FsnJvGjCClO/vgjza6TAlof3eVXtDT6SCIR4squC7obSM8uxjunKIPRmhLYlaQby8gdKqcTFEu9lBC5qbtGJWo3T4fLTSdkBzVvG2isGhuk92/13YZtF8T2Sy4G+IoVKuZFKk86vsJxXp6gwlYYPDVaZOimb1N+W/Q9xsU6EU4vtEftVxtoWe5oHc5j2NQp+7LUWouszXT81wRPUNe1A7YDemPcJTHJxpdIea4WcBwi6tZO8ns5gdsD05ghVxwvVa6cPUW/mBeFeS+QSDSZRYXigpI7TLOEvbC5XV6vW5RzbP1vZ4lg+pGc3uYp/L8FGGktJcOQtNSq5CHVPsyqIovNotQiF+kg2ZHHeUlkKdICGQ2lXk5RX3EC9ll0mdKwRE6qc9iwS7x/81VjXQiP9CjNSlQWSAnxv54Ge5A2hZXPphOifQfXlCDeaamNqSmhYLgUc8+WNRZnfUHDXd1qnNOrv1N2ushEL+6l8JR0doTv+J2L88tgRXNCKX5H2L3jdu9mNtzhxBugFO7DK5t4EZP9w7EdFXSQRIYP/f6p1Lf3nsHbHBrCRkHSH7gBxN5ffPB+mgO679smzjoZB7MU61dD7enpPrhDjEijBXnvHYlXknvkk2ND9ruujJR37SLsMUptqiC1hvMnI7iBvrFvXkQRDJBWzpsqmSj5V33A3K00pp6dS+wAoEmtbNaviZTEPKr8DcyZxEnAy2AVJRzDlMmFbLfqdg8l8HVTePpw81CDO8ZgQcGbfwtucb/qtEtRqEiMYoCWAHze12Y+O4W4iHYQ== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(13230016)(4636009)(376002)(39860400002)(346002)(136003)(396003)(36840700001)(40470700004)(46966006)(47076005)(2616005)(7696005)(107886003)(186003)(54906003)(83380400001)(40480700001)(6916009)(41300700001)(6666004)(316002)(336012)(2906002)(9786002)(5660300002)(8936002)(356005)(4744005)(36756003)(44832011)(478600001)(26005)(40460700003)(1076003)(4326008)(426003)(7636003)(8676002)(70586007)(70206006)(36860700001)(82740400003)(82310400005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2022 11:48:01.2866 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2e60d2ed-c3e3-4c17-9a23-08da715830ab X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0041.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR02MB8788 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org From: Michal Simek Based on recommended guidance Copyright term should be also present in front of (c). That's why aligned drivers to match this pattern. It helps automated tools with source code scanning. Signed-off-by: Michal Simek Signed-off-by: Shubhrajyoti Datta --- drivers/tty/serial/xilinx_uartps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 51fd09e14eda..8d2c21718869 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -2,7 +2,7 @@ /* * Cadence UART driver (found in Xilinx Zynq) * - * 2011 - 2014 (C) Xilinx Inc. + * Copyright (c) 2011 - 2014 Xilinx, Inc. * * This driver has originally been pushed by Xilinx using a Zynq-branding. This * still shows in the naming of this file, the kconfig symbols and some symbols From patchwork Fri Jul 29 11:47:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 594463 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38718C00144 for ; Fri, 29 Jul 2022 11:48:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231454AbiG2LsI (ORCPT ); Fri, 29 Jul 2022 07:48:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234644AbiG2LsG (ORCPT ); Fri, 29 Jul 2022 07:48:06 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2084.outbound.protection.outlook.com [40.107.223.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C7307E303 for ; Fri, 29 Jul 2022 04:48:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YXGh0FB80L1m4Nt3M4TZy5sY4/8GJAIPodvGiTSYS8a1lALXs2fed5lMKjTdc+nrrQ07vguslWnDnOzpzEx3asx/k9XNIReWQm7WTJf4CBNOGhWMC4M+ZgOv4yqO8rT4MGstXH3rpvhaC6sTaCwIfgIdltyg15FjYynbfxDeKJvYgO3HxUE//Eqk/gD4jam3zcBgrLbiIcXfALW+8g9E8CsGue/Z5QecfKtpChoYhgvSQOyismAPYi5Y5b26aROCHzZFtT2XstcmsMrAK5VW5R02l0Bm8e6Y97aPSJ3CyvIGkCHkhPmf1g6bsvmwxNWpskjQijEDP2qryCH5jNH7sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iSn262ivQ/yhDBv1Kaj/LLFYFPVXX78d9KGdEKOYLDQ=; b=F2LW1yAs0h87/jQpuKfiU3eTHUQPkyKmRU7Gzlp1NFH3HXgGaVyWLa5h60nncdkjS6HXCBf5wKAwo9tAt9LZuZPl6Yq5hM0kINN64tUHstfYqOFTX6w9DxTev1dtB+3Wa/9uc+RZ/eb6aqwNoj4QMPsvkr9IEiwOone0fyWL2Kq5zsA0uUSY/j0Sdc7gzOjiEP3xZQuAazVljP3+nvAuf7fR5b3pL4M8NF3XvfCD3pDDX0UIpboqw6qBDJ7xUPaGZprWl+q6myMZKs8SmuaTuPpUjK/smcDmAXqMBidKvqhAIju9kAo2HndiMYtCOmusBXXTglP8OsnGVt9s2gCVBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iSn262ivQ/yhDBv1Kaj/LLFYFPVXX78d9KGdEKOYLDQ=; b=gssvqo5D2so4tgSC6X2hxAbvvroOzCMAs+w2arQYudnchurtcSS8w1pAMaRm7jEis+/OCoiTSCI7YGFTgHa1v4WTk+97i8i/izw2RhxRhE39iGkCd3EEE9BgT1eWY6nA6e0WSCr5YY3dlyJ+KhdGHlG0feKobv9TchO+IEKoSXQ= Received: from SN6PR01CA0010.prod.exchangelabs.com (2603:10b6:805:b6::23) by MN2PR02MB6623.namprd02.prod.outlook.com (2603:10b6:208:1dd::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.6; Fri, 29 Jul 2022 11:48:03 +0000 Received: from SN1NAM02FT0041.eop-nam02.prod.protection.outlook.com (2603:10b6:805:b6:cafe::bc) by SN6PR01CA0010.outlook.office365.com (2603:10b6:805:b6::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.7 via Frontend Transport; Fri, 29 Jul 2022 11:48:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; pr=C Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0041.mail.protection.outlook.com (10.97.5.44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5458.17 via Frontend Transport; Fri, 29 Jul 2022 11:48:02 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Fri, 29 Jul 2022 04:48:01 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Fri, 29 Jul 2022 04:48:01 -0700 Envelope-to: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, shubhrajyoti.datta@gmail.com, git@amd.com Received: from [10.140.6.18] (port=57946 helo=xhdlakshmis40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1oHOTJ-000DJo-Cu; Fri, 29 Jul 2022 04:48:01 -0700 From: Shubhrajyoti Datta To: CC: , , , , Shubhrajyoti Datta Subject: [PATCH v2 3/7] tty: xilinx_uartps: Initialise the read_status_mask Date: Fri, 29 Jul 2022 17:17:44 +0530 Message-ID: <20220729114748.18332-4-shubhrajyoti.datta@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220729114748.18332-1-shubhrajyoti.datta@xilinx.com> References: <20220729114748.18332-1-shubhrajyoti.datta@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a10621cc-abc3-4f86-005b-08da7158319a X-MS-TrafficTypeDiagnostic: MN2PR02MB6623:EE_ X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T0XZJVqTJorc8cjmwuRlzQUOvOj6qQIuml3hcR9s6GdknBdufoeJaaNpLkQB/7Bi7LoDEOh20Sy5JufYEIdSTuSu/NslqJyDJd5rhApGSFPxP25CxVdowfR+wBWTGBCjZcs/n22WTg/qZ5GBhsjvSIXWzCFFmZarqP45MQo4mlB31JuKmBjcRdK+ohmIT97JXUeIErJa5mY36/ovSSUTrupxs1hhxG7AGOMGL9J/IO3IMJKNmXZz06IK0Q6cBQGqY0x+qlHugCa8C6WV0MZOsv/UtccZdha26baGOfuKr4BP0OI8moyAGjR2JsQJTDDeBbvYT+YtHTbG7ZgnuvGhTtj31fSbIP2L/U9CBtToUBBWvdwaAZjW8io0kN+S0yHWrp5VCUSWtR4VhH9Ugek2iQ75RNGkpXLnAfNMIsxiQX4zrCT27dnjpe/sA8GTtT2E6c742TRHzYskucBxPQC3CIu9ocax/j5dOm8qt/JNpaRR2FpI/0AbSEayaNI/aLX7VhtK+7dIpC9aK276449JjxmSWoyp4Gx2g2x7a3kbZD55efuJ93TMSFJfzVCo0/Jb5hJ3oaON5/coe65A8bKrIBeboL06DIUG1VbFjCDHTl/p9NTBqV1yeReIkFyYoOdYYAS/NN1+pwXopScG3jdgRB8Z8RM/uuyIhx+VEOzSDU9Ho26mMH73s0m3q3H4M9QnU6CQKjTcOnbX8hpjMLFy+yNeoeMzTl2tfV/2UI/4wv+sZxvcdZmDaHHORx47EN+0a/4NvgcAkRkMihO3ENX2ndYEnpZkVZMfPNA+BwfUN+IJ2UO6uNVoolMGkgTLRfzMBmf7Fzt7+AlFe5KTBQfECw== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(13230016)(4636009)(376002)(136003)(346002)(39860400002)(396003)(46966006)(40470700004)(36840700001)(426003)(2906002)(82740400003)(9786002)(44832011)(5660300002)(7636003)(107886003)(186003)(336012)(1076003)(356005)(36860700001)(47076005)(8676002)(36756003)(7696005)(26005)(6666004)(41300700001)(8936002)(316002)(478600001)(40460700003)(82310400005)(70586007)(4744005)(4326008)(40480700001)(2616005)(54906003)(6916009)(70206006)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2022 11:48:02.8802 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a10621cc-abc3-4f86-005b-08da7158319a X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0041.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6623 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Initialise the read status in probe. It will be checked in the isr so to have the default values lets initialise in probe. Signed-off-by: Shubhrajyoti Datta --- v2: Split the patch. 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 8d2c21718869..94e1bc694457 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1559,6 +1559,8 @@ static int cdns_uart_probe(struct platform_device *pdev) port->dev = &pdev->dev; port->uartclk = clk_get_rate(cdns_uart_data->uartclk); port->private_data = cdns_uart_data; + port->read_status_mask = CDNS_UART_IXR_TXEMPTY | CDNS_UART_IXR_RXTRIG | + CDNS_UART_IXR_OVERRUN | CDNS_UART_IXR_TOUT; cdns_uart_data->port = port; platform_set_drvdata(pdev, port); From patchwork Fri Jul 29 11:47:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 594462 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8300C00144 for ; Fri, 29 Jul 2022 11:48:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234874AbiG2LsS (ORCPT ); Fri, 29 Jul 2022 07:48:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235143AbiG2LsO (ORCPT ); Fri, 29 Jul 2022 07:48:14 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2065.outbound.protection.outlook.com [40.107.92.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3E6D87F4F for ; Fri, 29 Jul 2022 04:48:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DvCggTfjiDCXX9dcnYQkcoyV0THhgT8q1adLHx0LRkdm9IvoVBcXJQKUzvYO0KYivspnJPCoNskbgxDOi3pDYbDmSFMy4N2eefeu3g2xoAoe+ebyNVAbsjkp25NwBgO+UAF4bi1kpLdeF4pxLZmGDlCBAFA4fofpQLeEqNYbD574uA32OaxH/8nXSfmVMjA1lHUQy/S2wMZIzo/s4JkTucpz0i3cWifKFESfxevvYF9fEXTkXkjlyt97wamNwTl+L+q+mr6o8nRIzTQ1vRRbGMs/eLVrkExo+4nLlLCc7f55absiRXA9ht0HO+hz3N60sOlIC2uNbYDo5pT+7BqKOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Y1tGCJQOjdjzQoTHoDaLHma027MZX0sVuh7BdRxnJow=; b=AApxCTNEGE+8/Ex5zdi6wylaMpa6hmhW2wBxuCbmZVjsuUk3sImnJaDIBjzKFPtXPVntXqW5KMBw8m0K939KCYsGr4PRV76cg+kkh+Dgr6cScol+fD0rNfQTYvV0FYyaWyO5Im1pLrsKo2IwwFHmpb/LIzaU1fRe6SgS05I+cF3amv/DMYJTzYpsI/EndZXyc3noAyI2wFL0GFMmtukHUJxkod/4Fs4Dynv+aGtSdTeVM+v+GjL2ijht4UCSCNhCuF+1h+OourZLBvMPjb6YqHJk3IWsPiCISSWEv+HGW4YgHgNLOpdRonTOqShBz4iofuGLF004ArO0oreSrlI9fw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y1tGCJQOjdjzQoTHoDaLHma027MZX0sVuh7BdRxnJow=; b=lRxRJsC9QQOI/4MAUQ0v9hgY3h4Zb5GtmLKdf+gePj6F9Qt1vYwEKihDUePIyyG/1+PgRmGQCg/dM7XXNvDbfmH8W+X4UAV3Q4Acccovq0NSVdOIayHpTP8GWmKXdyQfrbuSkCTeeURKOKL7shN8qnKt8JQM2FIrnVBo16Bb74Y= Received: from SN6PR01CA0004.prod.exchangelabs.com (2603:10b6:805:b6::17) by BN6PR02MB2500.namprd02.prod.outlook.com (2603:10b6:404:54::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.6; Fri, 29 Jul 2022 11:48:11 +0000 Received: from SN1NAM02FT0041.eop-nam02.prod.protection.outlook.com (2603:10b6:805:b6:cafe::c5) by SN6PR01CA0004.outlook.office365.com (2603:10b6:805:b6::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.10 via Frontend Transport; Fri, 29 Jul 2022 11:48:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; pr=C Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0041.mail.protection.outlook.com (10.97.5.44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5458.17 via Frontend Transport; Fri, 29 Jul 2022 11:48:10 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Fri, 29 Jul 2022 04:48:04 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Fri, 29 Jul 2022 04:48:04 -0700 Envelope-to: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, shubhrajyoti.datta@gmail.com, git@amd.com Received: from [10.140.6.18] (port=57946 helo=xhdlakshmis40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1oHOTL-000DJo-VQ; Fri, 29 Jul 2022 04:48:04 -0700 From: Shubhrajyoti Datta To: CC: , , , , Shubhrajyoti Datta Subject: [PATCH v2 4/7] tty: xilinx_uartps: Fix the ignore_status Date: Fri, 29 Jul 2022 17:17:45 +0530 Message-ID: <20220729114748.18332-5-shubhrajyoti.datta@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220729114748.18332-1-shubhrajyoti.datta@xilinx.com> References: <20220729114748.18332-1-shubhrajyoti.datta@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 36462786-ae2d-40f1-d883-08da7158363a X-MS-TrafficTypeDiagnostic: BN6PR02MB2500:EE_ X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m/mqbe58d5iNUshasP22uuXbr6gNPcZpQPfi4tJTNsoRICh+YIm/biMxiV7mP7+mrC0qWWtL3ff19FoOhN35E7KkZUt4WTcvHgnuEnXE38dJ4EX0czX/eI6q3eqlPBQO9Qz2/KFHLxpnT57h/+8NqJXLrhXgpdbjR+DgX3Qi2owM8RpVLV5CBuJqntQfLECjjwlXR4N8TIvii8J2Sjo1jgqytZow6hcNUugPNjup3KG58m4HRjNFOrL6Gcv3wM4mUZBIxyXhtdY1s4FW82C4SZo+Mzry2llTkyGFTL7Hjo2FpVFzXoE7Hg9wDbgGwdVMOfSbqp323psn36hVEb5+JB3huDOGgM+1zDMVMmab4xAPi2cLzSjvYIbuB3WZlhdLFKwpaynsYjRjdBOVIreTWDtdy7Tw0xBE0IM3s0/qXrToxmJAnBcVwRWzCSlzPpiLninirA2Q3G7h/pROel5O8NkIkEDVUG7wbZauq0BDnm4m5WrrxT+D7NauVpfkgn3VUp/WFlnj9c4Ms64Oe7losue1D+nQ8k+cSuSsx2r+X+y2wuKxZbCgJPf66JTdOAAUyzdp5c5r7Z2z+2TxQKCM9rQBC3Oq5KJJYfQVzjgQp4LxoSt3eqYBIbGWbZCIIMwfjedty2zzQ/e6ZwdSS0LZqW8rifwcV2IwDzilvX9QqgqWKHPvfkCwlSnks9VPSJKZyMexGwzRRs/ilcY6XBLtS/yD8FsuFZLOSFyYRryrgySR7AGEv7gPJbujZ7Syyh6nthgPyCCKRpDbli9OHb/+DFXa4RCmoRBF6N3BusOG/qmYkkzDgySL1auAw7qecrtPdc8RkufKUxU5NSjSCOa6FQ== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(13230016)(4636009)(346002)(376002)(396003)(136003)(39860400002)(36840700001)(46966006)(40470700004)(40480700001)(40460700003)(36860700001)(7636003)(82740400003)(356005)(7696005)(82310400005)(70206006)(70586007)(478600001)(9786002)(5660300002)(4326008)(8936002)(8676002)(316002)(6916009)(54906003)(186003)(107886003)(336012)(2616005)(47076005)(1076003)(426003)(83380400001)(41300700001)(2906002)(6666004)(4744005)(44832011)(26005)(36756003)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2022 11:48:10.6452 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36462786-ae2d-40f1-d883-08da7158363a X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0041.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR02MB2500 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Currently the ignore_status is not considered in the isr. Add a check to add the ignore_status. Fixes: 61ec9016988f ("tty/serial: add support for Xilinx PS UART) Signed-off-by: Shubhrajyoti Datta --- 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 94e1bc694457..ae99e1164f0c 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -361,6 +361,8 @@ static irqreturn_t cdns_uart_isr(int irq, void *dev_id) isrstatus &= ~CDNS_UART_IXR_TXEMPTY; } + isrstatus &= port->read_status_mask; + isrstatus &= ~port->ignore_status_mask; /* * Skip RX processing if RX is disabled as RXEMPTY will never be set * as read bytes will not be removed from the FIFO. From patchwork Fri Jul 29 11:47:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 594620 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 705E6C00144 for ; Fri, 29 Jul 2022 11:48:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234644AbiG2LsM (ORCPT ); Fri, 29 Jul 2022 07:48:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234874AbiG2LsL (ORCPT ); Fri, 29 Jul 2022 07:48:11 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2048.outbound.protection.outlook.com [40.107.243.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A2AE74787 for ; Fri, 29 Jul 2022 04:48:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bARtszk/xXYIuOVP/pIvkLxOAHrUNRtHUldHsVExgqRBOmHWypvYlCySYTzcs4TawOUKG+17t59gOkn2FVBlbIMTLFwGIyxKklQDkr0L87qqwCgMkvrA/E1JMLk7HTs3rjX8P/HA+Mu8TfIZJw1ZKMvz/5tgBUPgdy2YqZWDX7Is9nWvQpkYCgMqBVmEC3E/3tuLMN9m1xJT+a59Tt8t/gZkPDPYne68DhjnJ544jvdwhSzWwjbTAAf2GnyDGMTc5gPqsNDy7znhaBrc8Ry29/QkxdSRFtcJJmagaVWYPookGrHR9Y+MROqZCxuA0NHKEIufcMiIVLPeGyi2D6UtcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3KMFHFQHY2SDs+LqxCOfEMhB5rOovpZ5xZsr7WYKp3k=; b=QUxQk3rSs+cTGIEOcjaD4PyAvVaUjKnsgrb6wsT8+y9s+IPMA1o5Gr1y44h0OGpLbTEYzmInDYDDyY+pgyQPkMh0eljnafgXxPW1MJwd1rI6FbFSiHHyJDqRJ//YUDNKg7GAsV4pjnbUrRttrHfqWBkcEeCz1zdjGJcbk9qpzdpSjDP/V7QBHNqWY28yeiiOMkIilG1+cMFIrWkaBpG06Ezs/xPmYKqFjk9medxqMYhlL3oagOp4P/q39Yfjf54p8NLy6XWoF62ww5R4ptxE5u6VOnSiylRQfBunBkWM3Qq/XuwSNXVkbUotj17SBj67HCGnsVpIURCAn/8yj5EPtw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3KMFHFQHY2SDs+LqxCOfEMhB5rOovpZ5xZsr7WYKp3k=; b=oLjrcdO5jzem5GjL26lg42dWKL99vlYfsfRnsyDdH4VnpihJTtOV/kEuvBJUPE8TDm3w/WxMTe2ayXnLQWLEdy7Duga7IlXzOvAdNykru3jlt/h2dshO/zzi9bEOjwDdPPFULC8IG66nAOZLKjyO4agvfiGtK7DzMl2o6oHMTio= Received: from DM6PR11CA0051.namprd11.prod.outlook.com (2603:10b6:5:14c::28) by SJ0PR02MB7120.namprd02.prod.outlook.com (2603:10b6:a03:290::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.11; Fri, 29 Jul 2022 11:48:08 +0000 Received: from DM3NAM02FT056.eop-nam02.prod.protection.outlook.com (2603:10b6:5:14c:cafe::6b) by DM6PR11CA0051.outlook.office365.com (2603:10b6:5:14c::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.20 via Frontend Transport; Fri, 29 Jul 2022 11:48:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; pr=C Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT056.mail.protection.outlook.com (10.13.4.177) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5482.10 via Frontend Transport; Fri, 29 Jul 2022 11:48:08 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Fri, 29 Jul 2022 04:48:07 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Fri, 29 Jul 2022 04:48:07 -0700 Envelope-to: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, shubhrajyoti.datta@gmail.com, git@amd.com Received: from [10.140.6.18] (port=57946 helo=xhdlakshmis40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1oHOTO-000DJo-HK; Fri, 29 Jul 2022 04:48:06 -0700 From: Shubhrajyoti Datta To: CC: , , , , Shubhrajyoti Datta Subject: [PATCH v2 5/7] tty: xilinx_uartps: Prevent writes when the controller is disabled Date: Fri, 29 Jul 2022 17:17:46 +0530 Message-ID: <20220729114748.18332-6-shubhrajyoti.datta@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220729114748.18332-1-shubhrajyoti.datta@xilinx.com> References: <20220729114748.18332-1-shubhrajyoti.datta@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a9b57b2f-b95e-4c08-b44d-08da715834b6 X-MS-TrafficTypeDiagnostic: SJ0PR02MB7120:EE_ X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +lEcNdzpC94E4UAhfFN5U3QWtyKXfw57gxainxycxM/WNJ8BoJW4HRt3abiE9jNpDvTHzCydRifLfsJdCOrQfUe/go6HI+gfg5lnIkuVVHPRzO9C57A4UVoglBASwt1HG2wm9m9ZZLfukTi1k0tfM2sGg47HrA2Dj80Sl3j3V55bW0sJ77FqXc//OUV0ji5g+jxrsHs8cZh3vqVJLdvmVRg2B1r7OPiTKcgpOR4K547yDHf4A1yK9xMV4zg6EPsAcjPs/Qg7C166uSB7KX5i4fLGqNPBVijLGheRXNbKTwWuKw55zNAkYJ/qRQDtOh9ibkcUm0VuX3Sj9hmJbzaxieOQLe3Xe2hzl+B6SQ7m5ETdxSOblYT6HF1H1QrlqrrI4WtiWv1D44JnUV5RtkyjrSbWAvDovWb6JzArDqoS3SmGmN/tNDhyuMKvhsum/Rz6tC1JTJ1GsvNH8phZpMIFoECGS+mBpRTaXoZhAY0Hq15gED+UjzHX1jn29leaW3DTb8nuv0HigiyJhGCqg5h0bJAPlg6wu0SvACh/DGZdrCoDtwpuGYa7Y/C6+XX0+Egbc+vUuZtRZS+1+hPQzrEC1kHICQJyRvld0OTdlpXHbh2Zla5NB6EAvOo3L/89cpJV1a4CY49OnOPt3JMpOjMvc4tO2axoPowJ8Y27GAzU+Cvrh1v62/CxDgtbyTPLq4FhEC+7uD3EO8jaInJPvYUDH+VGl7zbYWP64tNo3TuYhWU3S7XjyITYr1/8rOIqMnvFURcl2b+m33xVaj2zQSji0igVoE6N34chrHEn6blM/uO8f3yxN3UjqGqPJ48iyCJ7xBcmhhJgp8dlmeiTnWLU6A== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(13230016)(4636009)(346002)(376002)(136003)(396003)(39860400002)(36840700001)(46966006)(40470700004)(82740400003)(6666004)(186003)(41300700001)(47076005)(8676002)(70206006)(70586007)(26005)(4326008)(107886003)(1076003)(7696005)(356005)(2616005)(40460700003)(6916009)(54906003)(426003)(478600001)(336012)(7636003)(316002)(40480700001)(36860700001)(2906002)(36756003)(8936002)(5660300002)(9786002)(83380400001)(44832011)(82310400005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2022 11:48:08.0858 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a9b57b2f-b95e-4c08-b44d-08da715834b6 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT056.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR02MB7120 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Prevent writing to the fifo if the controller is disabled. Signed-off-by: Shubhrajyoti Datta --- v2: Add atimeout drivers/tty/serial/xilinx_uartps.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index ae99e1164f0c..e119da69e190 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1132,6 +1132,21 @@ static struct uart_driver cdns_uart_uart_driver; */ static void cdns_uart_console_putchar(struct uart_port *port, unsigned char ch) { + unsigned int ctrl_reg; + unsigned long timeout; + + timeout = jiffies + msecs_to_jiffies(1000); + while (1) { + ctrl_reg = readl(port->membase + CDNS_UART_CR); + if (!(ctrl_reg & CDNS_UART_CR_TX_DIS)) + break; + if (time_after(jiffies, timeout)) { + dev_warn(port->dev, + "timeout waiting for Enable\n"); + return; + } + cpu_relax(); + } while (readl(port->membase + CDNS_UART_SR) & CDNS_UART_SR_TXFULL) cpu_relax(); writel(ch, port->membase + CDNS_UART_FIFO); From patchwork Fri Jul 29 11:47:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 594461 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7419C19F2B for ; Fri, 29 Jul 2022 11:48:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235143AbiG2LsT (ORCPT ); Fri, 29 Jul 2022 07:48:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235460AbiG2LsO (ORCPT ); Fri, 29 Jul 2022 07:48:14 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2072.outbound.protection.outlook.com [40.107.92.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CFC27E303 for ; Fri, 29 Jul 2022 04:48:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iQHFNCXhFnqxffHMMRYcqSwxbQLtEq3o6HGtaq8oXijxH7R29q7iRi9qAXMV7iZnuzhFkhTTftEfFUNJ0Cd4zqHVvnrRo8lG2MK4FyASwQ/jW74BgrzsQL6yL4tyVYRSu+n4JpZOyGyCSYgB8vUT1pxqc79g+3VAHpxI0Xxv/ApoMx9bni9Y7NHqkmWoEKxnuNKmpgVT1ES5eq4SpnYAz7l6mMEVYhLtYhLBkWSEoGcvXyUBqYLeyI21gArTqx3plQeJw6H0I5MpP6PRkgNJHPYL+7xNfvJbEZadFCpxG+YbPoDangGvgmTc1pZB+X/xdPZaTgukJl16zQSWg/J27Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=T71jb1ykbDEOg/3WtiDYhD/Z7WSaAegD9j/XE38qa0w=; b=JjPnbrj72lW+n2BbnN56XZ5R5Z7PZ7ZQWPRiGKe0hGyT/utVrhjcmcyiDJbGEGjSzoHDPaTp5ZRc28rejuO+ACh0T42SNX9PID6Uzmhn9TwMhTj4fyWjpkGbkJDgeEsbUy8TgkYz5mttgBSUdxpu09GYeH5b1UZpiEVJr849YwJ2kRiJNYni2Wx5GEEqBSYq//8ea1ls2GUE4Q9BpgrzUr53y9jbSuEpHqqQeNb7SWULTSPiLj2SGy3WxxNtZ2pkMX/2Dd8ar2FFKnnO6+64aiB8IANb061QFYc1yseariK8k1nTOIjrB0mYR4YqlMeUWLBLIkzgG/OahxB6Y31yUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=T71jb1ykbDEOg/3WtiDYhD/Z7WSaAegD9j/XE38qa0w=; b=idbkPdfFmrZ6EHhCUZIy1/7hGe4Kx86jlGaiKa2FKTelmSIfVWSXiN9BZAa/3VhDKOywGPJT/W2t1LGOo7RRAdMrfRDeBAB/4o6AAyTG93vdAKx4oINn8/wR+5dlJSjTmRXeYkXHRNz9qtmf0kVH/fT5lkp0ULIx9fjRl6DeolY= Received: from SA0PR11CA0042.namprd11.prod.outlook.com (2603:10b6:806:d0::17) by BN7PR02MB3988.namprd02.prod.outlook.com (2603:10b6:406:fe::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.11; Fri, 29 Jul 2022 11:48:12 +0000 Received: from SN1NAM02FT0042.eop-nam02.prod.protection.outlook.com (2603:10b6:806:d0:cafe::1e) by SA0PR11CA0042.outlook.office365.com (2603:10b6:806:d0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.21 via Frontend Transport; Fri, 29 Jul 2022 11:48:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; pr=C Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0042.mail.protection.outlook.com (10.97.4.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5458.17 via Frontend Transport; Fri, 29 Jul 2022 11:48:11 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Fri, 29 Jul 2022 04:48:09 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Fri, 29 Jul 2022 04:48:09 -0700 Envelope-to: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, shubhrajyoti.datta@gmail.com, git@amd.com Received: from [10.140.6.18] (port=57946 helo=xhdlakshmis40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1oHOTR-000DJo-3a; Fri, 29 Jul 2022 04:48:09 -0700 From: Shubhrajyoti Datta To: CC: , , , , Shubhrajyoti Datta Subject: [PATCH v2 6/7] tty: xilinx_uartps: Add timeout waiting for loop Date: Fri, 29 Jul 2022 17:17:47 +0530 Message-ID: <20220729114748.18332-7-shubhrajyoti.datta@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220729114748.18332-1-shubhrajyoti.datta@xilinx.com> References: <20220729114748.18332-1-shubhrajyoti.datta@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4f5d3f6d-53aa-4350-12ff-08da7158370a X-MS-TrafficTypeDiagnostic: BN7PR02MB3988:EE_ X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QpjNEF46qkr44kCX8l6TWO9reT2QZzfzZmCTpkdXA1dTQa9rjEPzJWF7T+8WpRJA0i+gd+itMSWq5AE1w8Dd39vK+yTdZ15lL8e2sd6VhY9df7BdS7B89At3QyoBrPS7TCNgkw6/uTteGJUNnycbAiLAvdURKsb5oLFjES3BVSIYONs+7YrIS0vEHqyW9pdY9vzkDaBhawkv/GKgbh1Bhein6dQq/koI/1TGJMMgijeOT3wXwL+1I6iaAXCqUswvTYGT5okVt5KrrJ+Gg4G6GgNSRYrqPULPmgaq9gFsQaaK9GDm6knlVP5UVNLLzgjG3P0WyZgqHxyFLOjFX8ssdFHWiwRlj2C2jbjzQIVPeZ6XQ+bCmb75BX6stguy4laio8tlpm35Wwzfn14no6wcbe6wRyooLCxY9LjatVDWTARewTorWbnfOw4OJgjaFVon4jGnelQ4+VFFGsHqXGYy0nrzqqEjvaNTDVaUaLy34U3RUznEjzizSOYlmZhzUToL/8qc99/Z5ipb4oM2l5GreREiBluEuiapJV6CuWzcWVkSV8/NX+4/n7gliZcL3k9z6WW4ITm1J1aqWQJ5rQy2tNmxumqlz/2/iCMgha8N8IigNIMgxX+lmCflWDitOqMVrR6vXuNwVjisCpwkK3ZWZEUxloSmbIsauAYLmY1aOj6yoU7GNl2YVYUxv/8Jdvk8gUSl5j+gKJrYvDsVrmRfBw+o6chPhSF9/XADTsi3DfdH+EfwGFXWNsvcGJAmbWY4Zxy1QxzogI2I0Y4Xc0vlz2YyQFhNz4AB/5BnfMBePDksicTVn1/n8AltRouO3e1GwfS2ZjpQM1sql9ZI7rzsfg== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(13230016)(4636009)(376002)(346002)(39860400002)(396003)(136003)(40470700004)(36840700001)(46966006)(6916009)(426003)(186003)(2616005)(83380400001)(7636003)(336012)(356005)(70586007)(70206006)(8676002)(4326008)(5660300002)(36756003)(9786002)(44832011)(1076003)(2906002)(316002)(40480700001)(7696005)(47076005)(82740400003)(40460700003)(36860700001)(41300700001)(107886003)(54906003)(26005)(82310400005)(478600001)(6666004)(8936002)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2022 11:48:11.9876 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f5d3f6d-53aa-4350-12ff-08da7158370a X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0042.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR02MB3988 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org There is a potential infinite loop while waiting for the the TXFULL to deassert. Adds the error message and timeout to avoid infinite loop if it fails to get the TX fifo not full. Signed-off-by: Shubhrajyoti Datta --- drivers/tty/serial/xilinx_uartps.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index e119da69e190..a1ff03f24f51 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1147,8 +1147,20 @@ static void cdns_uart_console_putchar(struct uart_port *port, unsigned char ch) } cpu_relax(); } - while (readl(port->membase + CDNS_UART_SR) & CDNS_UART_SR_TXFULL) + + timeout = jiffies + msecs_to_jiffies(1000); + while (1) { + ctrl_reg = readl(port->membase + CDNS_UART_SR); + + if (!(ctrl_reg & CDNS_UART_SR_TXFULL)) + break; + if (time_after(jiffies, timeout)) { + dev_warn(port->dev, + "timeout waiting for TX fifo\n"); + return; + } cpu_relax(); + } writel(ch, port->membase + CDNS_UART_FIFO); } From patchwork Fri Jul 29 11:47:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 594618 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 724FCC00144 for ; Fri, 29 Jul 2022 11:48:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235560AbiG2LsV (ORCPT ); Fri, 29 Jul 2022 07:48:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235460AbiG2LsU (ORCPT ); Fri, 29 Jul 2022 07:48:20 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1798A74787 for ; Fri, 29 Jul 2022 04:48:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OUNr7HGyugRCzEtFqnYLxc4zVlaRSfYGvTNsEHFQUce0AhSxg5drZmIomS6V3cNkvuOKKO5jOeqFDYnz+eDFoOlLtQ9qa/HVy3bx1/klpEwQnvfCdJaMMUomrGJgjS1LD8wRv7uECcYk6nnNVgu6y0m/JD0ghZmTL9J4NbSLGuPx3iB/9Vn2jBanNXkUb07ic/txtTPWj7W0Xx8X+BSdY6lllEFlFtHAEe9Dj5T/ntS3YZXuy4wQf1Lus8y//gC/DGjrs0XumN/jR/mFbd1B/esRnWEMlzvCvOpWNw/JfiJ0OanUJyJarhXh/Bf2e/FrtpXrAx3cMtbYqCi63CphcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/1Sk+2WqL7TLYvL0w+umQhiAMZRbQWcWfSzyKzm6JCA=; b=WBIDU38PkUy4Dy3WcMzhxANxAmwGReYwjtd8nzQ1frsYFHK9vhwd9An7HYKyJAWpdPQ8vwpkPi6qwvi+ah5EW9eI1IHa8ZH0+F0mJAFU8quSS+2+a09GvwxPdTCgEmTqCPsN2S4z3/JWMrp9sKnwz85p4ojWA4PQqqxvlZO1egr214IkbGc8mWNzRTbDu/l/PDzNnphx6fqnWO6G2UaF17oKuXnB0+K+y5DMrVowLTDcTFW8eHyvSyD3+tgksLc+jD52gCTKeYZjjdbTUG1Mj6GpA+IhcflXaGexIhz3M/2+UX18c3+JhbcQ0VeTdt33uD3P1TpCxxqxLCRDnBR78A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/1Sk+2WqL7TLYvL0w+umQhiAMZRbQWcWfSzyKzm6JCA=; b=pmkZ7ojbJ9xsrJa2MGmAzg9ce71o1vZ2NgQ101ZrUeaePrlBrigeJFRo/ls6I/roKngXFam/dhCVF6NKSn5baUijtD+pMJBd8T0FucUJopYKEqeOG4HvUBjKCM3bJhvQVis4wNmsG4DLlDYZwDCEzI12m/H2bw9+kr4dy477iWM= Received: from DS7PR03CA0206.namprd03.prod.outlook.com (2603:10b6:5:3b6::31) by SN6PR02MB5246.namprd02.prod.outlook.com (2603:10b6:805:6c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.21; Fri, 29 Jul 2022 11:48:17 +0000 Received: from DM3NAM02FT025.eop-nam02.prod.protection.outlook.com (2603:10b6:5:3b6:cafe::b) by DS7PR03CA0206.outlook.office365.com (2603:10b6:5:3b6::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.20 via Frontend Transport; Fri, 29 Jul 2022 11:48:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; pr=C Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT025.mail.protection.outlook.com (10.13.4.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5482.10 via Frontend Transport; Fri, 29 Jul 2022 11:48:17 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Fri, 29 Jul 2022 04:48:12 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Fri, 29 Jul 2022 04:48:12 -0700 Envelope-to: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, shubhrajyoti.datta@gmail.com, git@amd.com Received: from [10.140.6.18] (port=57946 helo=xhdlakshmis40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1oHOTT-000DJo-L4; Fri, 29 Jul 2022 04:48:12 -0700 From: Shubhrajyoti Datta To: CC: , , , , Shubhrajyoti Datta Subject: [PATCH v2 7/7] tty: xilinx_uartps: Check the clk_enable return value Date: Fri, 29 Jul 2022 17:17:48 +0530 Message-ID: <20220729114748.18332-8-shubhrajyoti.datta@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220729114748.18332-1-shubhrajyoti.datta@xilinx.com> References: <20220729114748.18332-1-shubhrajyoti.datta@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 174d1abd-dd0c-4560-ee0a-08da71583a4e X-MS-TrafficTypeDiagnostic: SN6PR02MB5246:EE_ X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: alZ2FuZKcybOicrMCd6jXT5qbR9hq9vKI8FcRe9vvPe+AOBMO007fEd0JM6CfMUYIr1ZaAITdGmioJoniU4yp2u8IkPrRiK29mc2ImK23uuFNdfAZPcz3l6xqdoE6bkoG5rkI5YDOPBb1tC6tVK0o7nHf/nFbAt/IAjYjsCDGAjvO8juUshP33M+pgc02EPZ+xzsQNAM9tlRqK7gpmnh919sSBXoKc9oFM07n6kCTiazfm155BH4awzGhRvqsKDL+OO7XNpKHxXm/dX5iLpP3b2J57y3YXfI61J/C6b/HiRf221+MhFTgqNc1aRDAFT5vVMU2zVcaWI3cwnPDTy0wR3r4DZ3NImtwt+d8+ZZFOMlXUNQzrxHFcu6jb3r3WjbHfeitwS+NocJrU6dxqC+tTMlYD7xUXwi4sLEM716GVHYWeP4RYIIlqfLqmZQy5bZDFYysuKD2ZqntAFstM6frOMnIMvJfYtVlaiqr1FDCwoxndK7V69ONGbu31S/twluG8gKNItwOgVcfbooYpAc6iIjwTOCuSVb58Dqx3O0OCMEUltGY7XEgCeO58EvOuUCGgidFj/6J25L9YtSfCYssiDUobsBjquSAGT+6RU9YNagPK2NhzCwPw4V4/A232qtF+xveAqYXJ2PVeXa5xjjy4GQSQKdLmJoKiSoUVaksR+CQouQed5oCVb1e3KM0RHbTavVc37p9xmi46AGLJR9iZJaaPJxstYvD9hzvFNcI4ezMRu1SZcV5/KbJVmiD7Jp6PCQEeYv54eDztPzEjSRP3bmWFART8VkPv0dbQUEaNESKcTVTXcscN5J/NYf6DMHVASS817nJG7wAGZbtE/92g== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(13230016)(4636009)(396003)(39860400002)(346002)(376002)(136003)(40470700004)(46966006)(36840700001)(6916009)(4744005)(40460700003)(70206006)(70586007)(82310400005)(186003)(44832011)(54906003)(478600001)(8676002)(107886003)(6666004)(26005)(4326008)(1076003)(336012)(316002)(7636003)(7696005)(36860700001)(2616005)(40480700001)(82740400003)(2906002)(8936002)(356005)(36756003)(5660300002)(83380400001)(41300700001)(426003)(47076005)(9786002)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2022 11:48:17.4721 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 174d1abd-dd0c-4560-ee0a-08da71583a4e X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT025.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB5246 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Check the clk_enable return value. If clocks are not enabled the register accesses could hang the system so error out instead. Signed-off-by: Shubhrajyoti Datta --- drivers/tty/serial/xilinx_uartps.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index a1ff03f24f51..1dab870aa585 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1420,9 +1420,17 @@ static int __maybe_unused cdns_runtime_resume(struct device *dev) { struct uart_port *port = dev_get_drvdata(dev); struct cdns_uart *cdns_uart = port->private_data; + int ret; + + ret = clk_enable(cdns_uart->pclk); + if (ret) + return ret; - clk_enable(cdns_uart->pclk); - clk_enable(cdns_uart->uartclk); + ret = clk_enable(cdns_uart->uartclk); + if (ret) { + clk_disable(cdns_uart->pclk); + return ret; + } return 0; };