From patchwork Mon Mar 15 10:46:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Neeli X-Patchwork-Id: 12138891 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D14EC433E0 for ; Mon, 15 Mar 2021 10:51:59 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 86D5E64E76 for ; Mon, 15 Mar 2021 10:51:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 86D5E64E76 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pLq0k0stdHw1i2bYExRfweWmFZRcEg/t2NJtkiLIk80=; b=KDyOaRY7U9aLaCpjcYSCg8Dmu P2CfSL+Sj0XY3MCywDNNZQoVp+mlLJ8KuxQVL6Cwq94Dx7UUCMmcoIO8X8Vi4K6ot1KVYW5p7EZlC zOWTLJ8jo4bMvNwzHPtqUPyXwt8inSTa9YfZKn+nGsBss0Uj6NU9jWBkCtUMC/4uOugb+A5d6WvNa Pkt5e2+yXHFF30qOboV1rEgoUfCnMWaYrg3MBkyB73CTe8KKzC/lTlw5xUs1x8tWtB+S57DkLC0m6 vUfUo1nd0phdgs20Oom7ifkNwMjgz2glTEBpsbZTSWKopBGNjDT6PoIrQzPHbUkP3c47D19wJg/wg 9JcrhzKXg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lLkmZ-00FYi6-0i; Mon, 15 Mar 2021 10:49:07 +0000 Received: from mail-bn8nam12on2049.outbound.protection.outlook.com ([40.107.237.49] helo=NAM12-BN8-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lLkkw-00FYR0-0c for linux-arm-kernel@lists.infradead.org; Mon, 15 Mar 2021 10:47:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SiQp7IWMwYRclMVAVRSismVFFX+ajLLz/pTVnwX9ukzHMdfP+A6nMifov3thuv1KVFB1RdDAXUXwKKP9Z8MteIAciwy9BUzWg2INFvze5spGmCNl57IGKWlKBhk0rd42IYSY5PaUHHBocCEHNMDLWFlJzsWsuO0ftXRjPR4W9ADpZLbOi/tnCP8c0152vcz9kjEO5wGETpyUbBMQRXDmZCrp/1TNOxHdcdgorjyi9FfucQtbMYsOnMbwubqz2GUn+rejn0JMhc4cRZHc/LhNJMOrWa6xkJHayr+K3XlJ916ZPWyAXx1HmUafdGLjCzSwqff3r0uic0PNFazoi6R/HA== 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-SenderADCheck; bh=+St41h16lx3eOLcbriBkxDc2LwEYg1dz45xs2HifVWc=; b=cFbgAqXboFGdtuAW3E0PiEmAMktT6xeXFQzlud6jt/qLrBe+Lzwtk9qnEo65g9gWx7usljkXLoPLlEzxFEVKExXy8WfUqdOpcolKGU7iIy2j1qsl5X0qSSh0EHWGDyHY6/yzNHcHU6puiPyc4DIR0hefl6A02z8omMQT2AdqnAc8463Ks40hO9/BnYjmKxHbrlK8UyyM0GQAQVqg2WBsH1rTo/duT0uSjNZdxl3f6i2lMY6lkRamHeMV4rhNebaGE2/OVbmWsuPHHs0CIE4EdtqhFQ/zoywRlRIecsqCfexPK4LqtiCpaqGXiYGLYhNru3ubIAtGdXI8CxT4lkinSA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=roeck-us.net 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=+St41h16lx3eOLcbriBkxDc2LwEYg1dz45xs2HifVWc=; b=hV3Fnwg7TXcaXsyJguh94CRKoMY6RzEjtmhNT7wjV4/sPU3CSMFQVME13T15WwPJ8d+HF2xqOSwiBwdp1LxGAvCcRg7hQ44isb+jmLMcPxfC6CCJcpNFlOsRTDaj6s56BqS3cm3mQaPpBm9Bh8AR6nlQZARkm/J2F7aTztyrrm0= Received: from CY4PR14CA0035.namprd14.prod.outlook.com (2603:10b6:903:101::21) by BYAPR02MB4583.namprd02.prod.outlook.com (2603:10b6:a03:12::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32; Mon, 15 Mar 2021 10:47:22 +0000 Received: from CY1NAM02FT027.eop-nam02.prod.protection.outlook.com (2603:10b6:903:101:cafe::9f) by CY4PR14CA0035.outlook.office365.com (2603:10b6:903:101::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31 via Frontend Transport; Mon, 15 Mar 2021 10:47:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; roeck-us.net; dkim=none (message not signed) header.d=none;roeck-us.net; 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; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT027.mail.protection.outlook.com (10.152.75.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3933.32 via Frontend Transport; Mon, 15 Mar 2021 10:47:21 +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.2106.2; Mon, 15 Mar 2021 03:47:15 -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.2106.2 via Frontend Transport; Mon, 15 Mar 2021 03:47:15 -0700 Received: from [10.140.6.40] (port=50876 helo=xhdsivadur40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lLkkk-00055N-Ih; Mon, 15 Mar 2021 03:47:15 -0700 From: Srinivas Neeli To: , , , CC: , , , , , Srinivas Goud , Srinivas Neeli Subject: [PATCH 1/9] watchdog: of_xilinx_wdt: Add comment to spinlock Date: Mon, 15 Mar 2021 16:16:46 +0530 Message-ID: <1615805214-24857-2-git-send-email-srinivas.neeli@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615805214-24857-1-git-send-email-srinivas.neeli@xilinx.com> References: <1615805214-24857-1-git-send-email-srinivas.neeli@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 67ec6a80-a737-4599-cdd8-08d8e79fb662 X-MS-TrafficTypeDiagnostic: BYAPR02MB4583: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:2733; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ROconV9d2zhrhUnpNE+ppEfeytlT9uLBxuLyAa83nHf/HZUWVFUEleKRyaCOlYEfcJn+gh3oiKHC1Nmbk21h56Y8qzNjYeXb77wzfDLfYsLnu850YJX4HJDdX+MqcCBUBLKpJsDh5zFn9aYPluM1q7XZA6KXlbnwaGFKF+myWZmK1qJ9XRL56IxO3rga03ELxMe4PDpq6/+MbFksYLWNWPxHirmSOKg/h8GHuUCEU3+n5iSP7SsIm+0Tk6uee61bLiZlBUbpL+oP6uV4/kDEhoBQpVXq7egbMgNQjhMMDonzlrpcEmTFbXM2dPHHQz6Q6UOqzAwGu22j5AsVOhy8XqQjpPJFN6O+8barHMdscOPvdCKiH1GQdgZ/5tgXSLnR0cgB9Ysj4037hD3FuVkIF8wnOSdrdhET93SrqDcud3iJI8Y0bz8e0YYezbv43Uh8sRL0WQjimIfetOYD/sjZD52pWPDZe/rQUjuMOV6oIq9f5OGvpOOGasmGLRNbnVw/ZMT48q9cdl1CqAnd1SoqDfLVfmge3OoTkS/RHJSANDeEznh6BA07ZYbHF7EhM3LkWTnok3ULyF8GfqFjog3EqxHGIpByZghe6UmZHABH10maG38zZJbNjGI9T0rkMn2H6quzNMbIOXZR1xZmC+DY78HINwygvlsiyjFoT3Mw1XnNIhiNIMOmTMYFZcS+D3EW 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:(4636009)(39860400002)(136003)(346002)(376002)(396003)(36840700001)(46966006)(110136005)(82310400003)(54906003)(186003)(36756003)(70586007)(70206006)(82740400003)(9786002)(4744005)(47076005)(2616005)(107886003)(2906002)(44832011)(316002)(36906005)(36860700001)(356005)(7696005)(5660300002)(426003)(83380400001)(4326008)(26005)(8676002)(8936002)(6636002)(336012)(6666004)(478600001)(7636003)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2021 10:47:21.8020 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 67ec6a80-a737-4599-cdd8-08d8e79fb662 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: CY1NAM02FT027.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB4583 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210315_104729_633681_F938F969 X-CRM114-Status: GOOD ( 10.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Srinivas Goud Based on checkpatch every spinlock should be documented. The patch is fixing this issue: ./scripts/checkpatch.pl --strict -f drivers/watchdog/of_xilinx_wdt.c CHECK: spinlock_t definition without comment + spinlock_t spinlock; Signed-off-by: Srinivas Goud Signed-off-by: Michal Simek Signed-off-by: Srinivas Neeli Reviewed-by: Guenter Roeck --- drivers/watchdog/of_xilinx_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c index 7fe4f7c3f7ce..00549164b3d7 100644 --- a/drivers/watchdog/of_xilinx_wdt.c +++ b/drivers/watchdog/of_xilinx_wdt.c @@ -40,7 +40,7 @@ struct xwdt_device { void __iomem *base; u32 wdt_interval; - spinlock_t spinlock; + spinlock_t spinlock; /* spinlock for register handling */ struct watchdog_device xilinx_wdt_wdd; struct clk *clk; }; From patchwork Mon Mar 15 10:46:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Neeli X-Patchwork-Id: 12138883 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0E2CC433DB for ; Mon, 15 Mar 2021 10:50:24 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 29E4964E21 for ; Mon, 15 Mar 2021 10:50:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 29E4964E21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0KtqFPNj4OGOY67xhVK9Rh4g5/TsgAnItL+T0SXMuXI=; b=T4NwTu4zfaox1ulzTf/RNo8m5 g60ZLJ3SITYIJPli61pRLj9BVCOiUK8vjMh+GckyhBBsvvow6ZizQanwsOqgBWoO9+t/03aWjwiqb bYUhhNTuCXhF4DuCuJkuQy22D8edUx7oZUYZFfEoVEZtG3T49NPdAmfy0zfeSBPcpyPclsJFYBzsR flYiJZ0tV243c6aBNb6IRCzrif3ohYu2QKGExackmUP3ew2atbl7Cs54lNWt3hdrucVP04WQfHu9I qvcZwVrsuyJDAnmg9Rry52qSZLAbbUYQkQWsPxCc8d0Y04l7znT6cwULgjUato/9Bb6uCh4LF6618 5elth5UPA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lLklD-00FYU0-ER; Mon, 15 Mar 2021 10:47:43 +0000 Received: from mail-dm6nam11on2078.outbound.protection.outlook.com ([40.107.223.78] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lLkkw-00FYR3-29 for linux-arm-kernel@lists.infradead.org; Mon, 15 Mar 2021 10:47:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VP9xLJ/vjLjiIPRVMajIW/XeGv+V0CJBhGsjh5H4Ay2oynRksupUSCK+bn7j3fYXXUnylTJ12+nzxAKfg5pNp+khjhsYxAaDvAVhKRyI1YQ3Xbjw0o4YAjhv9LbD+k7mexZy/TxsOUfR9lTVlAoTj43dmSoWPUOfFQ6+utEVmmsiVYf/SrN57lsxm3CfmgqWXh1tF1IDQ/gtoWtGNAe8a7OJUAbVA8dIZgr7z4glz+1AioEAyneVk837o+3cdpLOVwYNTED9rDuGnsCtbG6YkVvz2zw9dJVDABESOs1kgbYqX/BpSRbmucH/PYGMyWS81lSvjRSbFPOr+dLp00RmWw== 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-SenderADCheck; bh=S/mBarU007hWExIircirtxwR9PahK/xaH4jnUcpjS6U=; b=SI+5DcJVs0aXQ1xlHtiO5t34n2sb5kYqMnloV6mPK0IJxyA5zI6b45eqpcSfzihRs7HlsFOvMK+/z6kdAvJ5j8WnZJVII7TDNQkLhEnjGzhasu412l9jZLhGDGC56GZa3okoCbcu8sUNfx0FOdPL7aQSUdtKYGcZFOfAZ3NgREOqZwan7uE/TS3AbmnMw+EM6sooZYQY4mizE37+kse9ZN5EDSh44KpmbDyp243nFAfZS/ckQmB3wM3WPvFonvuIXufqd5IHpcWG6407wyTlZ7WskW8SsXEsJOXVc4L6+KRZ98ML3DiIW2KFB5uzl1gZ87sKkYtuVLp5UqTyAf5Hqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=roeck-us.net 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=S/mBarU007hWExIircirtxwR9PahK/xaH4jnUcpjS6U=; b=ebZGoqwb+TIlIV9vcNeR8XLsrQdQEefUox5gqxPV7OOlZVJlms/10wmGeqZhR1VWIBPoVmrNa6tryruluFGWOHQ5mKAcGwDHcLhEV0MfLmSHJALW9ULDE6y+JszUKREq8lNGFLsGVM0MtuYrfzgEQqthqFAzoYk05D7Dqf1f9dE= Received: from CY4PR14CA0045.namprd14.prod.outlook.com (2603:10b6:903:101::31) by DM5PR02MB2188.namprd02.prod.outlook.com (2603:10b6:3:51::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32; Mon, 15 Mar 2021 10:47:23 +0000 Received: from CY1NAM02FT027.eop-nam02.prod.protection.outlook.com (2603:10b6:903:101:cafe::95) by CY4PR14CA0045.outlook.office365.com (2603:10b6:903:101::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31 via Frontend Transport; Mon, 15 Mar 2021 10:47:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; roeck-us.net; dkim=none (message not signed) header.d=none;roeck-us.net; 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; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT027.mail.protection.outlook.com (10.152.75.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3933.32 via Frontend Transport; Mon, 15 Mar 2021 10:47:23 +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.2106.2; Mon, 15 Mar 2021 03:47:18 -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.2106.2 via Frontend Transport; Mon, 15 Mar 2021 03:47:18 -0700 Received: from [10.140.6.40] (port=50876 helo=xhdsivadur40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lLkkn-00055N-Nt; Mon, 15 Mar 2021 03:47:18 -0700 From: Srinivas Neeli To: , , , CC: , , , , , Srinivas Goud , Srinivas Neeli Subject: [PATCH 2/9] watchdog: of_xilinx_wdt: Used BIT macro Date: Mon, 15 Mar 2021 16:16:47 +0530 Message-ID: <1615805214-24857-3-git-send-email-srinivas.neeli@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615805214-24857-1-git-send-email-srinivas.neeli@xilinx.com> References: <1615805214-24857-1-git-send-email-srinivas.neeli@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0cd74a4e-b3db-4974-e9f4-08d8e79fb76a X-MS-TrafficTypeDiagnostic: DM5PR02MB2188: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:324; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +vURGVF2vkVda1czP9Hz1jqbSi2musnsrtWGhsFOPrWIkoUd14II46kJ62zL+SAMGhA/Bnre8OHHG5TS8JkGewesoe1apBlQoE7ao4aFaUWB4QDEhXq+4hjEM8PYA2qdxRER7RLhuelHGgez6qy4Unlwv1GvN7LyG1VJVjLPhOY65HiKlTKvVEfymnfVB1GeyZFCOyk+/z0lHTTACiibAxCgf5RMM0hU4Tawi4QAfZIFq1ZLT0Nl6BoQ7S5JnxZ51cWEHQIYkGC2+DGJT7OdsK1OjFnsMl8k4fn0D7erfRKTVQaCeDUb6zLbyZICBEDSZZqzjYNibXRywND+Kxa/f6DpparH2sauvavHNpMmg0cgNg0jlhM5HfdxlNDrnvQv4iFjekH4buDD1rsTldTa4M8ewONZAZFGuBvydmFTdZC4yLy8MRhKrE//rorXkYG+O9dFwKEHpnUFb8ibAykFqhNtNfxyj80wrale6cL1p9TEGUokxoJSrTt3fxPzzrtEBBjJdOO7W99exocUrmefb66oOgAwfJC2G5/qe7yPYd5DDqZFE5EclXouzbDUA7sc3S/Oeo+Id+C56BC53OTcdTOgl00A3/uitsxLfdVtiih1tnAouDSATBwXjCPnCrwNx8BrlBugQGD6/EdMKIiAq3+VeW132Vu9l+HrC4WZEIT1EyU2B3pjuP9uIP96NkLr 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:(4636009)(376002)(396003)(39860400002)(136003)(346002)(46966006)(36840700001)(110136005)(70206006)(186003)(82310400003)(9786002)(2616005)(70586007)(36756003)(47076005)(82740400003)(7696005)(54906003)(6666004)(8676002)(107886003)(6636002)(2906002)(5660300002)(356005)(83380400001)(478600001)(426003)(4326008)(26005)(8936002)(336012)(7636003)(316002)(44832011)(36860700001)(36906005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2021 10:47:23.5339 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0cd74a4e-b3db-4974-e9f4-08d8e79fb76a 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: CY1NAM02FT027.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR02MB2188 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210315_104729_625414_B18F9214 X-CRM114-Status: UNSURE ( 8.79 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Srinivas Goud Used BIT macro instead of mask value. Signed-off-by: Srinivas Goud Signed-off-by: Michal Simek Signed-off-by: Srinivas Neeli --- drivers/watchdog/of_xilinx_wdt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c index 00549164b3d7..0d7df2370db7 100644 --- a/drivers/watchdog/of_xilinx_wdt.c +++ b/drivers/watchdog/of_xilinx_wdt.c @@ -24,12 +24,12 @@ #define XWT_TBR_OFFSET 0x8 /* Timebase Register Offset */ /* Control/Status Register Masks */ -#define XWT_CSR0_WRS_MASK 0x00000008 /* Reset status */ -#define XWT_CSR0_WDS_MASK 0x00000004 /* Timer state */ -#define XWT_CSR0_EWDT1_MASK 0x00000002 /* Enable bit 1 */ +#define XWT_CSR0_WRS_MASK BIT(3) /* Reset status */ +#define XWT_CSR0_WDS_MASK BIT(2) /* Timer state */ +#define XWT_CSR0_EWDT1_MASK BIT(1) /* Enable bit 1 */ /* Control/Status Register 0/1 bits */ -#define XWT_CSRX_EWDT2_MASK 0x00000001 /* Enable bit 2 */ +#define XWT_CSRX_EWDT2_MASK BIT(0) /* Enable bit 2 */ /* SelfTest constants */ #define XWT_MAX_SELFTEST_LOOP_COUNT 0x00010000 From patchwork Mon Mar 15 10:46:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Neeli X-Patchwork-Id: 12138889 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E73ADC433DB for ; Mon, 15 Mar 2021 10:51:58 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BA0F864E21 for ; Mon, 15 Mar 2021 10:51:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BA0F864E21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=huaavCRanb4sGuHnuj0dJGc/9pi4iH7bsN0cROu2UPc=; b=I21mSM0Rg+4Et0/vowNdthbmJ 5PZanLmlSe7eV6JrIvmRSGRx0vJgqk829AFYbt5xIjLeIQXVoE/MVmiccZ55aXw6XvjCLDPQpsf3j zU7fwHCZKDQ+FZ0GZPLlh/u3PRcyalMO0luZPUIZXw0ijiy9MfysuhXMuMD7pikoRUAj4XaqgptK2 upFqhuW4rxxdGZ5nwjrJ2G3oBJGJX55ImbuxmgGml0NPpDa9WAcNJ5RikLgDopIUooFJuosgErncw LrM00+qYuakZ98tlntW+4zP+zm5+Sc+NUzSeyTSCJqPls9R6DikhbeJDEf1vtJml5tZNsHW5OR0ST XEbYqbUoQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lLkmO-00FYfE-6f; Mon, 15 Mar 2021 10:48:56 +0000 Received: from mail-dm6nam11on2053.outbound.protection.outlook.com ([40.107.223.53] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lLkkz-00FYR5-82 for linux-arm-kernel@lists.infradead.org; Mon, 15 Mar 2021 10:47:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JZ1L8fADi9umN2eVt0Zm9ZiWsUO2PG68pcnbjVu882nuFPpgcTW5YO9Ovn4kZxta1Ag6+1aaV18plZk9CvRO91UPZ1HrOxRCzXJSCF8WCsPcm/8uFytGiDMfwXO8yYg3xN3WW564Dr9tjL8P6vcGPDvdPXm93/MWKWvV9n3NF7ltTzpjSxXhquCokK07U1Ot2VoWPMY2c/HOENT2ka9KSsZ4QYH/M5zmOEUsw7+at8fvMHcX9RTGd4yitSKO3YDIEU7v0b5W7cJ6+5oJk7cz3XPXyJPpMmJ16gsANod/+caKBbfzWuW/+Fvx5VESkwDdCKIFC0c6pJOmfmmOooARFg== 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-SenderADCheck; bh=uyhwFbQA81kAFJXqZWwZcUJbGIKTfkzIYsByU7MYtDE=; b=fRs64mhJ9jImJciOHgA3QOjR273PiWudW8zmbXHQpMaawJLUv3o514vsl+T64U445yJLTHqxJq8ZArwT/VTBZeJ8diLrSFQtu9UFq+dwaK3yjv6CwQserVOzwAxRrGvM5QkCQSODHArqqkjyo4QKioMR6GEpNOedMigxj/GPZOeYF2OKceqbB0+HdZlExafwVkK1nnwJqIDN+O1cSzwI2E76Z0xQRhbPwMrjeBXwwvJs9ZjNX8shGyOPvkS+ThcKgclKnAfjsoOztUS5Y1QC/4BkIYQiqfDmaAzHdMIRad30dfEW+I5qr8cGhlcprFHaE/pFPutmCEDGt63PC3nWJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=roeck-us.net 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=uyhwFbQA81kAFJXqZWwZcUJbGIKTfkzIYsByU7MYtDE=; b=Qhu/JYbwmFqwOym/S58dizYtQnpxZ5B9a2bz41ZO8ikvWgb36OALG57xzpbgnN3uEuBRs4D4YZA2cLjDDsamWMmKJdIcM2TsuMvXkFhfl7KerJ+KCGxMKpJd2zGZwaCRBmArU+yJjE0SUtI3gKxu2jQUFlkSHGpBsw7wAF9gkVw= Received: from DM6PR08CA0033.namprd08.prod.outlook.com (2603:10b6:5:80::46) by SN6PR02MB5613.namprd02.prod.outlook.com (2603:10b6:805:e5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32; Mon, 15 Mar 2021 10:47:24 +0000 Received: from CY1NAM02FT006.eop-nam02.prod.protection.outlook.com (2603:10b6:5:80:cafe::b4) by DM6PR08CA0033.outlook.office365.com (2603:10b6:5:80::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31 via Frontend Transport; Mon, 15 Mar 2021 10:47:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; roeck-us.net; dkim=none (message not signed) header.d=none;roeck-us.net; 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; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT006.mail.protection.outlook.com (10.152.74.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3933.32 via Frontend Transport; Mon, 15 Mar 2021 10:47:24 +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.2106.2; Mon, 15 Mar 2021 03:47:22 -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.2106.2 via Frontend Transport; Mon, 15 Mar 2021 03:47:22 -0700 Received: from [10.140.6.40] (port=50876 helo=xhdsivadur40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lLkkq-00055N-T5; Mon, 15 Mar 2021 03:47:21 -0700 From: Srinivas Neeli To: , , , CC: , , , , , Srinivas Goud , Srinivas Neeli Subject: [PATCH 3/9] watchdog: of_xilinx_wdt: Used dev_dbg() Date: Mon, 15 Mar 2021 16:16:48 +0530 Message-ID: <1615805214-24857-4-git-send-email-srinivas.neeli@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615805214-24857-1-git-send-email-srinivas.neeli@xilinx.com> References: <1615805214-24857-1-git-send-email-srinivas.neeli@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3293cdb2-7cf2-4b75-588f-08d8e79fb7fc X-MS-TrafficTypeDiagnostic: SN6PR02MB5613: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:1284; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: umTXFQAGf+dK0tyv1uX/dYVAK8sEG9tUWuhNCA3SPH4hJYFEYQaOrtCLB2S3cAqPAQktDro7ocC7WUSQu1N+7WzD3meJbeuKALdBIm4sTdWZHmFZ0SGSXDdStyvPiuHm4rFPTjTHxfJxzUgZy10VDsglCEkDcOQfSY05uT2FZQ7ABHsJzfG137pIA9reWKsL8vSopKKmdXHRijdAua6W1BnFEDH1irMux5lFho20syUOVrtYBMcmRkUoTxtDFP6Zj/GBtY6/HskIH+tbeEXe8ogKN9tQvOlXtfDbQgv+VeElrQFj9yinGMZFJekILJp9CjaL/Jz1QA0RmbQf1QOHgqR9+boOrlmFRCT58pKf+n9HgFbqdEVX+tsyZJ5gZt2XSro1MNxu4smOBHefPs9Y4ixPLkeJoYwSN67Bhj6dSmfPx9rLFuly9/3YU5zQnKr+Y2hdyy5db6Ui2RKjNu340fPlXNjJkgHY96gdkHRMy+rn8xSO7P3s1D83/JEy8MsW3zgJgwDDYcqmGEDDib6yskLhw9uO1G+FHBm2SDjhujrKfx9p/s6Kw/D2t6BvZb7AgwX4G1SzWdo3b+davGp5QUAjsqurZNGjWLkzBuzmEjPgSxZ2QDUIuZqmbHBMk18p2YwxgzfvFk0GkyCkWlRd4v3+NbruJ+RSYHSXnzxx9XlWXMlwkzJvxORXQQJ8qY8H 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:(4636009)(346002)(376002)(136003)(396003)(39860400002)(36840700001)(46966006)(110136005)(426003)(8936002)(8676002)(7636003)(82310400003)(36906005)(316002)(54906003)(356005)(5660300002)(107886003)(44832011)(26005)(47076005)(9786002)(2616005)(82740400003)(186003)(83380400001)(70586007)(478600001)(2906002)(4326008)(70206006)(6636002)(6666004)(36860700001)(7696005)(336012)(36756003)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2021 10:47:24.4880 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3293cdb2-7cf2-4b75-588f-08d8e79fb7fc 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: CY1NAM02FT006.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB5613 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210315_104730_728363_9B6FDD7E X-CRM114-Status: GOOD ( 10.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Srinivas Goud This patch removes pr_info in stop function and adds dev_dbg() in start/stop function to display device specific debug info. Signed-off-by: Srinivas Goud Signed-off-by: Michal Simek Signed-off-by: Srinivas Neeli --- drivers/watchdog/of_xilinx_wdt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c index 0d7df2370db7..9e67b598907e 100644 --- a/drivers/watchdog/of_xilinx_wdt.c +++ b/drivers/watchdog/of_xilinx_wdt.c @@ -50,6 +50,7 @@ static int xilinx_wdt_start(struct watchdog_device *wdd) int ret; u32 control_status_reg; struct xwdt_device *xdev = watchdog_get_drvdata(wdd); + struct watchdog_device *xilinx_wdt_wdd = &xdev->xilinx_wdt_wdd; ret = clk_enable(xdev->clk); if (ret) { @@ -70,6 +71,8 @@ static int xilinx_wdt_start(struct watchdog_device *wdd) spin_unlock(&xdev->spinlock); + dev_dbg(xilinx_wdt_wdd->parent, "Watchdog Started!\n"); + return 0; } @@ -77,6 +80,7 @@ static int xilinx_wdt_stop(struct watchdog_device *wdd) { u32 control_status_reg; struct xwdt_device *xdev = watchdog_get_drvdata(wdd); + struct watchdog_device *xilinx_wdt_wdd = &xdev->xilinx_wdt_wdd; spin_lock(&xdev->spinlock); @@ -91,7 +95,7 @@ static int xilinx_wdt_stop(struct watchdog_device *wdd) clk_disable(xdev->clk); - pr_info("Stopped!\n"); + dev_dbg(xilinx_wdt_wdd->parent, "Watchdog Stopped!\n"); return 0; } From patchwork Mon Mar 15 10:46:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Neeli X-Patchwork-Id: 12138887 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F638C433DB for ; Mon, 15 Mar 2021 10:50:58 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E6A4F64E76 for ; Mon, 15 Mar 2021 10:50:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6A4F64E76 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qUBqmHXzdyTCzt5vRexD6jd6E8fTS6VcuNjTjZkz15M=; b=j2lhuNw6NhHGsEAfaMg7Eq/sx naphqOVldSLxwgBdIywSIlTYBFCRWXYcEw+cnFTO1n6o0dbwyjRaiNopTur5jpeBjkTvpeeiQBhK4 oloMQ0RWPunVzFRJbOOj5t6YFyjTu/nk3jKmI9YBpdywz54xW4N+rUMl01JB21PgjKIBUd/komtEc KavsGNt20Du746hFI8CrA/iqNWrdwFod5n/TGYEzg1rOLPxa8h5WvTGnNlTYf6oWvvsbP+31w+viC bv5LiZaI87mAgtfr6jD3MkL6+mn3aoR933ahfLzIUCcmtxmCVCe2AdKxvrEw98l7ZBe00SoNGEd9O 2MvVUtBXA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lLkli-00FYYu-3B; Mon, 15 Mar 2021 10:48:20 +0000 Received: from mail-mw2nam12on2083.outbound.protection.outlook.com ([40.107.244.83] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lLkl1-00FYRE-E2 for linux-arm-kernel@lists.infradead.org; Mon, 15 Mar 2021 10:47:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hqbsnUMTGRY0y5/oHjVJK47YtGBbV961h9TxZH6rDycdZnvdpYYBmdXbsPaB5nAHse7YvD9CdrZROkzXC5ob3xhGPyofUWL77eG08xJuccM+6w6JHA54zUvDawy90Y52JgwT3SHjnUOkr40OMSC41bPa0ENboEwIjVBGAsj8El316d2b0dDOJ+ZCEVyqNZtyNrs4dp4rOGED3pZujglLItFaw9Aj6i2BbWeIVM6PWWxLHsHBwsreG+IKPwoiSZ0Fjd6OI5IYqB8KJwoXueDAvTEeATzPVkJUYbbQTVbPID3rQQMW5VAF8WSY2Q7nsZREIRkE/uCQ7//CnUSBJxaiOw== 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-SenderADCheck; bh=JLSX4lqAHRVVZ7wS8+l5IRJMy0gApdNzhJ68ZMJIFSU=; b=kvJ8GJlx2VhGvwOyz9/xsQnHl26CdsZqpGuR/yn2c49KgLpfcOaLJbrok20NBCkBAJZOfm4U1EbTo5en07fIzBv+2irOHthgk2tZ4yqEjdkOI9C2HRL2X5Ma05aZxm6ZRwXTx7U+oeKmKGgYZWa+jDz+aW1ezU+iaYE0ZWg5d0xqO+bm/qh1rxfHsLN9GaWPIy4fLFyO9UKds3RERdoSS7Ji11ll0RoM4kl7hvS2UAvnKy1KfwnCC458e7UlD2/FpxE90xOgh/YkzDrqnDOhChMIDf6/Wf6KH4kEWIMJD+Pe9tUGFyOqLSL3Es/faC9GIpt8a0NrFYDXDF1NqtmRTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=roeck-us.net 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=JLSX4lqAHRVVZ7wS8+l5IRJMy0gApdNzhJ68ZMJIFSU=; b=lWSvHBJOHnI3jT2ljW79KsV4b61cv43eoJLm3HDQlERJqMgraLtEvUbA0v0QiyYI/+LrffrnPxxLkLHcjMPcXmhYVbyWw8q4J/sG9+p1bYxX5QryiJmBKIL7KWcblwSNu1CLG6JnKhWWyvIAa8t9RN4dciicZMgO9JC4QuDp860= Received: from CY4PR22CA0044.namprd22.prod.outlook.com (2603:10b6:903:ed::30) by BL0PR02MB6497.namprd02.prod.outlook.com (2603:10b6:208:1c2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32; Mon, 15 Mar 2021 10:47:27 +0000 Received: from CY1NAM02FT023.eop-nam02.prod.protection.outlook.com (2603:10b6:903:ed:cafe::7c) by CY4PR22CA0044.outlook.office365.com (2603:10b6:903:ed::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31 via Frontend Transport; Mon, 15 Mar 2021 10:47:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; roeck-us.net; dkim=none (message not signed) header.d=none;roeck-us.net; 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; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT023.mail.protection.outlook.com (10.152.74.237) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3933.32 via Frontend Transport; Mon, 15 Mar 2021 10:47:27 +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.2106.2; Mon, 15 Mar 2021 03:47:25 -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.2106.2 via Frontend Transport; Mon, 15 Mar 2021 03:47:25 -0700 Received: from [10.140.6.40] (port=50876 helo=xhdsivadur40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lLkku-00055N-1x; Mon, 15 Mar 2021 03:47:24 -0700 From: Srinivas Neeli To: , , , CC: , , , , , Srinivas Neeli , Srinivas Goud Subject: [PATCH 4/9] watchdog: of_xilinx_wdt: Initialize watchdog via data structure Date: Mon, 15 Mar 2021 16:16:49 +0530 Message-ID: <1615805214-24857-5-git-send-email-srinivas.neeli@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615805214-24857-1-git-send-email-srinivas.neeli@xilinx.com> References: <1615805214-24857-1-git-send-email-srinivas.neeli@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 443f8470-4c83-4d3c-9af9-08d8e79fb9a1 X-MS-TrafficTypeDiagnostic: BL0PR02MB6497: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:2043; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bNlJ6VWjR3kD5CHPsaCE9K6OxPNlGqyGPR5joMM1U668llN6KeFKoV7Xkxgg4Nt91R/jKRvFafbMNxKIDRNl0gp12M8XMHDrPyRgF3ec39//hvB6xj9dkOVQi3sK2hqNFkRBLy0HPOux/tyypAk3dh5gUvxAz1NAFrg9PxEqWvXtz+RHLDMuNS5lqGu9rde/h4LpfLj7dy3Ok2mIgMKD+80fr5Fl4ajEpAwJOf+eBu+JaMHaiDyq2VFG/f9BXT9avsQ4WUs+2cNnhkdOcMNReAVK/JsGEcIZeJ+Q3Kftw1BaY4kmS5MRyO7fT3I+3uIa8XM/2HV62jheQiVqKdCxacqOk5tWAd+xWYxbEMAY2ElXQ81T9kgTpYcwtSTro7fkGc6+E724TB3NlR6GObDmppxVfmkBNIi94N5r44eNHShjP/mgr1oHzeTUfTdybatt4qiuFvRxI+IvmAHOFCG9RNROh9hBzoWq5qjQRrBeYXwH6YsekovGhLvu7t2n7kDE7T0aEPhPyAoq3cUVw20bDoWMyG82l2KyLtBg0FoY7/VZod+NpNfyDvgnR2ahwWMY6SKsZbX3uAMchlwF+EjM3rNTuSFSjx8xJicbhYjLqs5b50icTQaVxn1HRxitpeUioSygW7m5Sks9gJQG6a2Gu5yE0J9pImQqSxbppG2bxTs0+NUj0m/YwmEFyzVVnSz4 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:(4636009)(136003)(346002)(376002)(396003)(39860400002)(36840700001)(46966006)(316002)(7636003)(110136005)(54906003)(426003)(478600001)(82310400003)(186003)(356005)(8676002)(36906005)(36756003)(6666004)(9786002)(4326008)(82740400003)(36860700001)(70206006)(83380400001)(2616005)(336012)(8936002)(5660300002)(70586007)(47076005)(44832011)(6636002)(7696005)(107886003)(2906002)(26005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2021 10:47:27.2487 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 443f8470-4c83-4d3c-9af9-08d8e79fb9a1 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: CY1NAM02FT023.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR02MB6497 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210315_104731_668272_27DC2CBD X-CRM114-Status: GOOD ( 16.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch is preparation for adding new watchdog based on this driver. of_id->data is storing link xwdt_devtype_data which stores watchdog info and ops pointers to structures. Signed-off-by: Srinivas Goud Signed-off-by: Michal Simek Signed-off-by: Srinivas Neeli --- drivers/watchdog/of_xilinx_wdt.c | 50 +++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c index 9e67b598907e..b2ce1b90237e 100644 --- a/drivers/watchdog/of_xilinx_wdt.c +++ b/drivers/watchdog/of_xilinx_wdt.c @@ -37,6 +37,11 @@ #define WATCHDOG_NAME "Xilinx Watchdog" +struct xwdt_devtype_data { + const struct watchdog_ops *xwdt_ops; + const struct watchdog_info *xwdt_info; +}; + struct xwdt_device { void __iomem *base; u32 wdt_interval; @@ -160,6 +165,20 @@ static void xwdt_clk_disable_unprepare(void *data) clk_disable_unprepare(data); } +static const struct xwdt_devtype_data xwdt_wdt_data = { + .xwdt_info = &xilinx_wdt_ident, + .xwdt_ops = &xilinx_wdt_ops, +}; + +static const struct of_device_id xwdt_of_match[] = { + { .compatible = "xlnx,xps-timebase-wdt-1.00.a", + .data = &xwdt_wdt_data }, + { .compatible = "xlnx,xps-timebase-wdt-1.01.a", + .data = &xwdt_wdt_data }, + {}, +}; +MODULE_DEVICE_TABLE(of, xwdt_of_match); + static int xwdt_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -167,14 +186,23 @@ static int xwdt_probe(struct platform_device *pdev) u32 pfreq = 0, enable_once = 0; struct xwdt_device *xdev; struct watchdog_device *xilinx_wdt_wdd; + const struct of_device_id *of_id; + const struct xwdt_devtype_data *devtype; xdev = devm_kzalloc(dev, sizeof(*xdev), GFP_KERNEL); if (!xdev) return -ENOMEM; xilinx_wdt_wdd = &xdev->xilinx_wdt_wdd; - xilinx_wdt_wdd->info = &xilinx_wdt_ident; - xilinx_wdt_wdd->ops = &xilinx_wdt_ops; + + of_id = of_match_device(xwdt_of_match, &pdev->dev); + if (!of_id) + return -EINVAL; + + devtype = of_id->data; + + xilinx_wdt_wdd->info = devtype->xwdt_info; + xilinx_wdt_wdd->ops = devtype->xwdt_ops; xilinx_wdt_wdd->parent = dev; xdev->base = devm_platform_ioremap_resource(pdev, 0); @@ -264,9 +292,10 @@ static int xwdt_probe(struct platform_device *pdev) static int __maybe_unused xwdt_suspend(struct device *dev) { struct xwdt_device *xdev = dev_get_drvdata(dev); + struct watchdog_device *xilinx_wdt_wdd = &xdev->xilinx_wdt_wdd; - if (watchdog_active(&xdev->xilinx_wdt_wdd)) - xilinx_wdt_stop(&xdev->xilinx_wdt_wdd); + if (watchdog_active(xilinx_wdt_wdd)) + xilinx_wdt_wdd->ops->stop(xilinx_wdt_wdd); return 0; } @@ -280,24 +309,17 @@ static int __maybe_unused xwdt_suspend(struct device *dev) static int __maybe_unused xwdt_resume(struct device *dev) { struct xwdt_device *xdev = dev_get_drvdata(dev); + struct watchdog_device *xilinx_wdt_wdd = &xdev->xilinx_wdt_wdd; int ret = 0; - if (watchdog_active(&xdev->xilinx_wdt_wdd)) - ret = xilinx_wdt_start(&xdev->xilinx_wdt_wdd); + if (watchdog_active(xilinx_wdt_wdd)) + ret = xilinx_wdt_wdd->ops->start(xilinx_wdt_wdd); return ret; } static SIMPLE_DEV_PM_OPS(xwdt_pm_ops, xwdt_suspend, xwdt_resume); -/* Match table for of_platform binding */ -static const struct of_device_id xwdt_of_match[] = { - { .compatible = "xlnx,xps-timebase-wdt-1.00.a", }, - { .compatible = "xlnx,xps-timebase-wdt-1.01.a", }, - {}, -}; -MODULE_DEVICE_TABLE(of, xwdt_of_match); - static struct platform_driver xwdt_driver = { .probe = xwdt_probe, .driver = { From patchwork Mon Mar 15 10:46:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Neeli X-Patchwork-Id: 12138895 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7603C433E0 for ; Mon, 15 Mar 2021 10:52:25 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 54A8C64E76 for ; Mon, 15 Mar 2021 10:52:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 54A8C64E76 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=z5byc5ePUgeB35YQZx/yXNoroUhEiLzVAdrsTNSYMKI=; b=UKaTNmvUF8lB50Zi4mJCUkm6l EbBBXS57gLA3JxihatBnaSNHbyxaF84HqCGIIXYn16IoI55Z9yUCPuVYqnsMKn5Pnpfqv/lctt4lR /gu2ejyEdhyg05mR9Lf2/GGe+5Ulwo0IuX/DUZhUj5QR2glWqhgaQ+XnMJL7q8VRICx58/9yrxJ/G SBnntSCvhPTwHv/E3RYLOjRl4Xi+2A/9iWqHP7J60MxJVYZjxMCdGn5zquENQ1+tmHbTwlLo30muE U+FaK6epuux5YisT36s29GQVm0pqUc6TfAYBYkNM6965MtkN6sXohedrYvNsJXB0MUpGIXzZMI8rr RC6/IGPnQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lLkn4-00FYmC-Lp; Mon, 15 Mar 2021 10:49:39 +0000 Received: from mail-co1nam11on2065.outbound.protection.outlook.com ([40.107.220.65] helo=NAM11-CO1-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lLkl9-00FYTf-Bq for linux-arm-kernel@lists.infradead.org; Mon, 15 Mar 2021 10:47:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bezgp0FxcG44DglPNnYaaD6KIzyNl3Jf6WF/S+1MKeo0iar6mXrQTRyUxxi5btaKeZioBBZnePTblm/xpc71GemGqwcIDFfIduGWLqlezqSa/+0IygcZT4U6FvLaso0j5oDIwdzxT0foFTxoSkkvtY4NkMtHzMxX8TCo9my9lkc6i2FHUTQjY8dkkB4zTwmDfgR7QnDDkgPdS0cHJc6jo8tXscfXh1s+CZHKa/ailAoWDOku9hXtP4K5efPDdHOLZ8vBKt6iVLOf132EeoguqCumlqQ9OPcM8Js+4LNPmrF9n+mlMppuG45/W7cIecHX8eNg4p6UJRZ7xmVdF2eH6g== 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-SenderADCheck; bh=HOp3IYe7EGQb8A3JI35dveDYqbkTKZs9bHvKTu25EWk=; b=P2Ka2QdWhn/1JigyEDzcAKzhTLEWLDYmEbnjIQk9vjBKjbCCLiK4JPBJ0bG0wcV6Ob5aFP9xnC5Sf+AytzgoMdIATZPqyX3ETcaSHjAK0JLyadwGT765voYxmy5r5xSF5oO+mfd2j61NN5ydoGZ67t5zILzxeLEfeb5RtgBn8tYcdbGSJn6VWyP2TcECljRrlAro9aw9K1euyT5PxMOwWrmSaRN6RtPFN3JPGRwlKSg00i60QDTFeGt9rI7EGBi6TVDxV8EJ1bYLYvuw0T24ypDI2+T8+Nc7ocW6vONcndSXz02kzI8343KRcg1GnYR4i0N2EOoUgZr7Ip/oAbk/ug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=roeck-us.net 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=HOp3IYe7EGQb8A3JI35dveDYqbkTKZs9bHvKTu25EWk=; b=FuSwvgEZcVMz6/hiTQ2H6PmFqqC/gF2E/qt4xXnigB9o7Zq9chCnMiexhBnd2scKTOMKjUx+5zKWdbUk3vWubhua0NYFk4CtHTe6sHcZgy/7P687VE1cZeCBAtAMo/fKplV1Jki6Zi/jqXMge0QuRisvkLQziZIp4INnh3W3OKc= Received: from CY4PR22CA0066.namprd22.prod.outlook.com (2603:10b6:903:ae::28) by MN2PR02MB6192.namprd02.prod.outlook.com (2603:10b6:208:181::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32; Mon, 15 Mar 2021 10:47:31 +0000 Received: from CY1NAM02FT050.eop-nam02.prod.protection.outlook.com (2603:10b6:903:ae:cafe::cd) by CY4PR22CA0066.outlook.office365.com (2603:10b6:903:ae::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31 via Frontend Transport; Mon, 15 Mar 2021 10:47:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; roeck-us.net; dkim=none (message not signed) header.d=none;roeck-us.net; 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; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT050.mail.protection.outlook.com (10.152.75.65) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3933.32 via Frontend Transport; Mon, 15 Mar 2021 10:47:30 +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.2106.2; Mon, 15 Mar 2021 03:47:28 -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.2106.2 via Frontend Transport; Mon, 15 Mar 2021 03:47:28 -0700 Received: from [10.140.6.40] (port=50876 helo=xhdsivadur40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lLkkx-00055N-7E; Mon, 15 Mar 2021 03:47:27 -0700 From: Srinivas Neeli To: , , , CC: , , , , , Srinivas Neeli , Srinivas Goud Subject: [PATCH 5/9] watchdog: of_xilinx_wdt: Introduce wdttype enum for identification Date: Mon, 15 Mar 2021 16:16:50 +0530 Message-ID: <1615805214-24857-6-git-send-email-srinivas.neeli@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615805214-24857-1-git-send-email-srinivas.neeli@xilinx.com> References: <1615805214-24857-1-git-send-email-srinivas.neeli@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 16523573-06ed-4d5b-7124-08d8e79fbbe1 X-MS-TrafficTypeDiagnostic: MN2PR02MB6192: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uGzm5B/UptU+Gc6pPftHP1i5DVLZfVZhx6CBCIMF5pkengNrSyDGl3rdl20z0SdANVH92A3959KDPqfK7RIuZWmjY62XuNF28rjK5HhtAuU3JRv3krdsgczk1/U3OAT10ZDXVupE+87XiJIO0odFxdOz4+I/oxRpM42kDjnDMtGHBxQ4Fw9iF57dSsXyKvtb/bCtA+zt2pWdPDaALF+H8K2vvRxkaqaEaMUNwq1izgPMuC11ufuF+mtkkE8yQGDoc6v3DDFGtSEEn4enTZj1wExTHwbbUFNWt1IKw7F8HxCxPropwNzcMfnJgsa/jKCRFuLB8BQT45Tmc4QmxioW/EL3o9yOMDsKtWo0Al3G8KUyRXKvfdZpXhRNhU9uUBVrfSYCnbiAUGmwN3n1zfFhyJHrPzaUNRN/Wq9nFl6FeSahP5puK2rf3lks9SAV09xBJZVp9UrS1WSHP7d/KxuF2oMsbZMitLnh57Bo/EaZLZ4fO2O3PUuDp5RErsTc53HEllQEF8Pje/0FgUiPrBaIiuUkYAGnZdPJ/kp5J23HH93wJK/WSGtogEG3tV3AbLG2+cu14ouN95o27ZhtyrW3FSvSufeh4K10Z/Bfw4RkFHLT9T7HJg5x4Gb5T17zDUneh1P4nQC2/URHDsoC8PbLU7I5T4vSh95IMggJgXuTJRhNHp0rNoGi/IIpQ6AmSSfl 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:(4636009)(376002)(396003)(39860400002)(346002)(136003)(36840700001)(46966006)(478600001)(426003)(4326008)(2616005)(336012)(54906003)(107886003)(186003)(36756003)(316002)(44832011)(83380400001)(26005)(7636003)(356005)(82310400003)(82740400003)(36906005)(47076005)(6636002)(6666004)(8936002)(2906002)(9786002)(70586007)(7696005)(8676002)(5660300002)(36860700001)(70206006)(110136005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2021 10:47:30.7716 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 16523573-06ed-4d5b-7124-08d8e79fbbe1 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: CY1NAM02FT050.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6192 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210315_104742_493962_E3BD1EE0 X-CRM114-Status: GOOD ( 15.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There is a need to identify watchdog type that's why new enum was was introduced to cover it. Move functionality valid only for this watchdog type if statement. Signed-off-by: Srinivas Goud Signed-off-by: Michal Simek Signed-off-by: Srinivas Neeli --- drivers/watchdog/of_xilinx_wdt.c | 64 +++++++++++++++++++++++++++------------- 1 file changed, 43 insertions(+), 21 deletions(-) diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c index b2ce1b90237e..3b93b60f1a00 100644 --- a/drivers/watchdog/of_xilinx_wdt.c +++ b/drivers/watchdog/of_xilinx_wdt.c @@ -37,7 +37,17 @@ #define WATCHDOG_NAME "Xilinx Watchdog" +/** + * enum xwdt_ip_type - WDT IP type. + * + * @XWDT_WDT: Soft wdt ip. + */ +enum xwdt_ip_type { + XWDT_WDT = 0, +}; + struct xwdt_devtype_data { + enum xwdt_ip_type wdttype; const struct watchdog_ops *xwdt_ops; const struct watchdog_info *xwdt_info; }; @@ -166,6 +176,7 @@ static void xwdt_clk_disable_unprepare(void *data) } static const struct xwdt_devtype_data xwdt_wdt_data = { + .wdttype = XWDT_WDT, .xwdt_info = &xilinx_wdt_ident, .xwdt_ops = &xilinx_wdt_ops, }; @@ -188,6 +199,7 @@ static int xwdt_probe(struct platform_device *pdev) struct watchdog_device *xilinx_wdt_wdd; const struct of_device_id *of_id; const struct xwdt_devtype_data *devtype; + enum xwdt_ip_type wdttype; xdev = devm_kzalloc(dev, sizeof(*xdev), GFP_KERNEL); if (!xdev) @@ -201,6 +213,8 @@ static int xwdt_probe(struct platform_device *pdev) devtype = of_id->data; + wdttype = devtype->wdttype; + xilinx_wdt_wdd->info = devtype->xwdt_info; xilinx_wdt_wdd->ops = devtype->xwdt_ops; xilinx_wdt_wdd->parent = dev; @@ -209,18 +223,20 @@ static int xwdt_probe(struct platform_device *pdev) if (IS_ERR(xdev->base)) return PTR_ERR(xdev->base); - rc = of_property_read_u32(dev->of_node, "xlnx,wdt-interval", - &xdev->wdt_interval); - if (rc) - dev_warn(dev, "Parameter \"xlnx,wdt-interval\" not found\n"); + if (wdttype == XWDT_WDT) { + rc = of_property_read_u32(dev->of_node, "xlnx,wdt-interval", + &xdev->wdt_interval); + if (rc) + dev_warn(dev, "Parameter \"xlnx,wdt-interval\" not found\n"); - rc = of_property_read_u32(dev->of_node, "xlnx,wdt-enable-once", - &enable_once); - if (rc) - dev_warn(dev, - "Parameter \"xlnx,wdt-enable-once\" not found\n"); + rc = of_property_read_u32(dev->of_node, "xlnx,wdt-enable-once", + &enable_once); + if (rc) + dev_warn(dev, + "Parameter \"xlnx,wdt-enable-once\" not found\n"); - watchdog_set_nowayout(xilinx_wdt_wdd, enable_once); + watchdog_set_nowayout(xilinx_wdt_wdd, enable_once); + } xdev->clk = devm_clk_get(dev, NULL); if (IS_ERR(xdev->clk)) { @@ -242,13 +258,17 @@ static int xwdt_probe(struct platform_device *pdev) pfreq = clk_get_rate(xdev->clk); } - /* - * Twice of the 2^wdt_interval / freq because the first wdt overflow is - * ignored (interrupt), reset is only generated at second wdt overflow - */ - if (pfreq && xdev->wdt_interval) - xilinx_wdt_wdd->timeout = 2 * ((1 << xdev->wdt_interval) / - pfreq); + if (wdttype == XWDT_WDT) { + /* + * Twice of the 2^wdt_interval / freq because + * the first wdt overflow is ignored (interrupt), + * reset is only generated at second wdt overflow + */ + if (pfreq && xdev->wdt_interval) + xilinx_wdt_wdd->timeout = + 2 * ((1 << xdev->wdt_interval) / + pfreq); + } spin_lock_init(&xdev->spinlock); watchdog_set_drvdata(xilinx_wdt_wdd, xdev); @@ -263,10 +283,12 @@ static int xwdt_probe(struct platform_device *pdev) if (rc) return rc; - rc = xwdt_selftest(xdev); - if (rc == XWT_TIMER_FAILED) { - dev_err(dev, "SelfTest routine error\n"); - return rc; + if (wdttype == XWDT_WDT) { + rc = xwdt_selftest(xdev); + if (rc == XWT_TIMER_FAILED) { + dev_err(dev, "SelfTest routine error\n"); + return rc; + } } rc = devm_watchdog_register_device(dev, xilinx_wdt_wdd); From patchwork Mon Mar 15 10:46:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Neeli X-Patchwork-Id: 12138897 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58403C433E0 for ; Mon, 15 Mar 2021 10:52:34 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5572964E76 for ; Mon, 15 Mar 2021 10:52:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5572964E76 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1SWnLgSdvM+BGCuAS+6GnGwurwYiEkqt1/y/ughQfZw=; b=G/CXJKrgBqdH8IZyPPVnpEDMc x6iqf3jCJRuygbE3WjOA2XPbUMXgqhN/snVg2l+tY/gyoOl/LP20m9vJUoVwAazmTxSHiPiaY+ZZh fDe2vq8fbAY2NLNt0021kmZCB6GcSLtfWQveDrXyjcMB7GJ5ArWD1ScJ9gVPRUAcrQjjmNNklMS4F PVH5xbYHFewbB2aWk4IyvDC378sndQFD8m56UMSP0t6EmeNilcoHqj+k9fErBGDLKub2sxnyhAthA jvIjY6yKop4HJ+HHMCFrei82gkSliV6A8uPYIQIlXlZDv9eX5BqdMFMSS8gsRLjUPxSWbGmJ4iUY8 ASKiUPCfw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lLknS-00FYrJ-Lq; Mon, 15 Mar 2021 10:50:03 +0000 Received: from mail-dm6nam11on2040.outbound.protection.outlook.com ([40.107.223.40] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lLkl9-00FYTr-QD for linux-arm-kernel@lists.infradead.org; Mon, 15 Mar 2021 10:47:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S6linc1WSL5bshJWOxhMMM69jGzBmY8lN1ZVQJQ03McveB/RVobcRkSHlPVcSAm/BEkanv6BOITt1SA8oXrZH8wG/6JpaTq0wCzhEOhZwR56ZRS8sjda2rqGHFoc97TPACK1O2e8Jn3eMvVC3uRZaUFyXy9+WCJ+2F+VJA5hHv9SQOMOnsPvVVll2o3a3d4p9K6fPE3yfs6q3jDWwxMsrsdma2zRBxJfa3CgwxbbiKK7NgWlJou8cH30UEgLGw68lr3mnjNs+8dLQRPydQFcNY6aOGazy/VlhLT2x+s1eK0uKajUg0lakey1Asu0XsmPXWT2Kv8DnfMkPgYE38doRg== 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-SenderADCheck; bh=KS3N8TmZ8GRcYaQz8hSAvP/Z/uTEjFXok+04Im5d258=; b=WKBzNlQYoZmSTyrzDLxbV+yJdBVHZTDGC7F80rBfHldZoFPE63/ZVhiLUaIYfwTBg/OOL2dX3jlLAdtKfbrRMzK7O6VWvpAaOkbQZwq4c9eklJUhIMUWxMEm+RyMvRTixg3xcvLif/NsAFgdUIKUd1u5e1VgGv+7xYTCe/GzLdl3WYtAS1VI0l4Po2qnQdFWvpjuICRTX08lJbt26jJ6KEZ8tPDDOEcimBpPmG9f0a+C9zICh7R9zwwu1+gxW5aCKgvVWI+UFVD9Hsq8gzowUWd7iWbHMYs/VmUj6GeNJUwFZh0TpdkMy18sDDFe4OKYrhHWZ/5o0feXGQaippqz1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=roeck-us.net 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=KS3N8TmZ8GRcYaQz8hSAvP/Z/uTEjFXok+04Im5d258=; b=ddw5YsiTqM+dRu0HmwhREOZWoNcpWVrCPiDCn+zB2QirTAw3+qAsXFMZ+DlUX3OpcR0+NIvKQbv7EGxg04gzhH9Ux6LuVOFpyNSgB43R7tEfact/N+8Ji+5aFfGRzuTGhHFqHx5H969bXDQbulBEWKQdlwssE38AZRQHY++3gnY= Received: from DM6PR08CA0017.namprd08.prod.outlook.com (2603:10b6:5:80::30) by MN2PR02MB6861.namprd02.prod.outlook.com (2603:10b6:208:15f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32; Mon, 15 Mar 2021 10:47:36 +0000 Received: from CY1NAM02FT006.eop-nam02.prod.protection.outlook.com (2603:10b6:5:80:cafe::61) by DM6PR08CA0017.outlook.office365.com (2603:10b6:5:80::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32 via Frontend Transport; Mon, 15 Mar 2021 10:47:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; roeck-us.net; dkim=none (message not signed) header.d=none;roeck-us.net; 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; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT006.mail.protection.outlook.com (10.152.74.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3933.32 via Frontend Transport; Mon, 15 Mar 2021 10:47:35 +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.2106.2; Mon, 15 Mar 2021 03:47:34 -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.2106.2 via Frontend Transport; Mon, 15 Mar 2021 03:47:34 -0700 Received: from [10.140.6.40] (port=50876 helo=xhdsivadur40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lLkl3-00055N-5c; Mon, 15 Mar 2021 03:47:33 -0700 From: Srinivas Neeli To: , , , CC: , , , , , Srinivas Neeli Subject: [PATCH 6/9] dt-bindings: watchdog: xilinx: Add binding for Versal watchdog Date: Mon, 15 Mar 2021 16:16:51 +0530 Message-ID: <1615805214-24857-7-git-send-email-srinivas.neeli@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615805214-24857-1-git-send-email-srinivas.neeli@xilinx.com> References: <1615805214-24857-1-git-send-email-srinivas.neeli@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eacaefb0-6699-47d0-a55c-08d8e79fbed5 X-MS-TrafficTypeDiagnostic: MN2PR02MB6861: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: etD+h/PJLOCvIIpWVJn4Y3v+F+XZj7tVY1V5R6dRDorNGeQ52ZqGipTfVHTYu5Om3WRc0NljVzCAS54eQlhZDemcmEQo+qym07PR/N9DmtlFGXOy+qxayE9n4GqhAkS5vVB5vR0zrz7LWs8yXrlkO/aXEvd+vEufYJ6/6ni+eoqBnsmVRcU9UyG8KSaBrgGEEdHo2NdDfy60rZHnFjYlPHLnVThF+H/3mpJsKu8XWCx3Vq5tEER3E5hVur63ELQUUXgizveEh1ENf0gQ3pjbMHFhd32w3Hf8wGE3DNNCtrLLWnUDeLlsf5UCmbeU2JBOvO2iAmzWBigEuSxz+03CehpmyRhxaMHg6vPAnzLkXOC9MQkteko5WDF09O/bCsMJYcKsiIZniblMfFyX4u8JV4HD8130roXVU+82KTtMmL0NzNpjlULSxLi4A7Cvv/zGfBaLhDXH8UJZQ4kjC+Pr2U/BO3LqB+ZvxryEFnWftVi4rpB7YnBdd5g0CDipUN9zncxg9QJeMyBAxbgLz0ZHAWa0FgBRxM0HNu5dZhtd8RhAajn8yiwcR+cwePUhS8zJPl34pVT6UExTNo2l3yjUdmg4vDRVWsIXILEcgA9AW5FQrk+oR53XRBrJSfmiSDu/EQ1YuwAcyb/r4LpNAASEPFah8l7R3Xh5r6ro4t12QbXqTtYtSiD6Gif0ZyT2LtoX 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:(4636009)(39860400002)(396003)(376002)(346002)(136003)(46966006)(36840700001)(2616005)(5660300002)(36860700001)(82310400003)(70586007)(7696005)(6636002)(336012)(107886003)(8676002)(2906002)(83380400001)(47076005)(54906003)(70206006)(8936002)(426003)(7636003)(186003)(316002)(36906005)(110136005)(6666004)(82740400003)(9786002)(4326008)(36756003)(26005)(44832011)(478600001)(356005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2021 10:47:35.9774 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eacaefb0-6699-47d0-a55c-08d8e79fbed5 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: CY1NAM02FT006.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6861 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210315_104742_678539_D25F5B27 X-CRM114-Status: GOOD ( 11.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Updated watchdog binding for Versal window watchdog. Signed-off-by: Srinivas Neeli --- .../devicetree/bindings/watchdog/of-xilinx-wdt.txt | 33 ++++++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/watchdog/of-xilinx-wdt.txt b/Documentation/devicetree/bindings/watchdog/of-xilinx-wdt.txt index c6ae9c9d5e3e..57903645d685 100644 --- a/Documentation/devicetree/bindings/watchdog/of-xilinx-wdt.txt +++ b/Documentation/devicetree/bindings/watchdog/of-xilinx-wdt.txt @@ -1,21 +1,37 @@ -Xilinx AXI/PLB soft-core watchdog Device Tree Bindings ---------------------------------------------------------- +Xilinx AXI/PLB soft-core watchdog and window watchdog Device Tree Bindings +-------------------------------------------------------------------------- Required properties: - compatible : Should be "xlnx,xps-timebase-wdt-1.00.a" or - "xlnx,xps-timebase-wdt-1.01.a". + "xlnx,xps-timebase-wdt-1.01.a" or + "xlnx,versal-wwdt-1.0". - reg : Physical base address and size Optional properties: - clocks : Input clock specifier. Refer to common clock bindings. - clock-frequency : Frequency of clock in Hz + +Optional properties for AXI/PLB soft-core watchdog: - xlnx,wdt-enable-once : 0 - Watchdog can be restarted 1 - Watchdog can be enabled just once - xlnx,wdt-interval : Watchdog timeout interval in 2^ clock cycles, is integer from 8 to 31. +Optional properties for window watchdog: +- timeout-sec : Watchdog timeout value (in seconds). + if unset, the default timeout is 10 seconds. +- pretimeout-sec : Watchdog pretimeout value in seconds. +- interrupts : IRQ line for the WWDT. +- interrupt-names : Interrupt line names "wdt" or "wwdt_reset_pending". + wdt - will assert high after first (closed) window + timer expires. wwdt_reset_pending - will assert high + after second (open) window timer expires if WRP + (Watchdog Reset pending) is configured with third + (SST) timer. + Example: +Xilinx AXI/PLB soft-core watchdog: axi-timebase-wdt@40100000 { clock-frequency = <50000000>; compatible = "xlnx,xps-timebase-wdt-1.00.a"; @@ -24,3 +40,14 @@ axi-timebase-wdt@40100000 { xlnx,wdt-enable-once = <0x0>; xlnx,wdt-interval = <0x1b>; } ; + +Xilinx Versal window watchdog: +watchdog@fd4d0000 { + compatible = "xlnx,versal-wwdt-1.0"; + reg = <0x0 0xfd4d0000 0x0 0x10000>; + clocks = <&clk25>; + timeout-sec = <10>; + interrupt-names = "wdt", "wwdt_reset_pending"; + interrupts = <0x0 0x64 0x1>, <0x0 0x6D 0x1>; + pretimeout-sec = <5>; +} ; From patchwork Mon Mar 15 10:46:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Neeli X-Patchwork-Id: 12138899 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A9B0C433DB for ; Mon, 15 Mar 2021 10:53:25 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B26464E21 for ; Mon, 15 Mar 2021 10:53:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B26464E21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5XV16H/s91U7m1E+gNxxAZLt5GLCCPM+rEH0Pz73DA0=; b=K3TciyHntArPutjN/HAMfScks F1coNzLjReBlqiFFOvgH29Mh+OHXh/ZnqgFMPiR/EhaGPUM1gR1OdJC69pe8HHGStiXy+ZeGyURoA f3T6jxgNZuADTteqfBAvaKLKxrl/zhjI7hJqmj4xd6ygioLBpFjFflELBSEuBoETLgwgB6PuDyVFV EzKt3ICihpCjtV+5eGGMOUyyVgNahoenYXWKOB2v9+pKcuifNa+r8MwRzAXeJrjKCsWR5XjMWVS09 vfZUXERlvrtPC7rosnpekqDBSUNrHvAH3faB1MKI88Zhpe1TbQLKXtARI5JlsTYpDZobjF8ikqQzn 7LUC3u9uA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lLknp-00FYy3-BA; Mon, 15 Mar 2021 10:50:25 +0000 Received: from mail-dm6nam10on2080.outbound.protection.outlook.com ([40.107.93.80] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lLklC-00FYU6-GO for linux-arm-kernel@lists.infradead.org; Mon, 15 Mar 2021 10:47:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WXU4eOhKjEEkN+eMqZNUV08x2NO5EW93T49qUXMmRLzbbcf4pP06aIw8VmHIQ7YW8Yim2kULfHmahl2riVZeu3IROuZBW0feWPJEuB07sduqxP0i+YWXGAOJOxmuGeIfZWzuGfV8vloW2cfyecxvn9Iwz5wYweMnYMMY1CfvbVfh6ExL8/CLK4Y48PQkRAtReOzENMcQTBuVX1kFLFCwN6bDE9gFUyAV2kKaYiwu+pXVJgzoTxn6EK+nmfAVaiR/NPPDFC4STk0wwI3rOnpRCJPRjHg9wy6VuZc+2ISmCN0mnDX+WJFtHUUsWxTBg0/x3ZgyGaSBAcCx4udTvoXF6g== 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-SenderADCheck; bh=6rWlee/N981L8R/FIkHzNkMapvUxZLYDnv+/PWstzpg=; b=KVYx2wck2SJ68hkxIota/Vumr+XXirD3w9nlC4jDhnYNW0MRM2/wSf/pkHnsyMfpWnhol0LiA3E6xAjIAqkXu94fmgurafV66ok858rbTjFU1LcFasQNeAIsCmLmQ90ki4J5B3QsJhqe2tI/CmQaEYvrKArg/sdVCMIhcwAwC196BBcW5UF+O5eU5z1MZWAuHVs+0HL5rtkL9+jKKdgW99IzCrJA7poBKeOVpJ9TniBbsH/jCnD5eGWS0DGv70PXso6qvLeMqufpGJpqoNQIXREJosxl2r5+bitY54DtXsJU+RM32b8qx5rbo0IKL+Vm3/hodrun00Z6rWMe2PqNiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=roeck-us.net 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=6rWlee/N981L8R/FIkHzNkMapvUxZLYDnv+/PWstzpg=; b=BR056tDl5XgSuj7lf6T8n38wz44U9CXXozcR/ugnWbXaxBycpB4B7juJ9VmtTdvi3KbbpHv8/C27R1TnN0+D0S10D8wnPInshTi+fzG0O/M8H9wpYbIu5CjSgnNuiw7e1TOJ9/f1AqTHcDrdRaqnTl6uV4FwP24xIfOUioWnWBg= Received: from CY4PR2201CA0011.namprd22.prod.outlook.com (2603:10b6:910:5f::21) by BN7PR02MB4145.namprd02.prod.outlook.com (2603:10b6:406:fd::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31; Mon, 15 Mar 2021 10:47:39 +0000 Received: from CY1NAM02FT021.eop-nam02.prod.protection.outlook.com (2603:10b6:910:5f:cafe::13) by CY4PR2201CA0011.outlook.office365.com (2603:10b6:910:5f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32 via Frontend Transport; Mon, 15 Mar 2021 10:47:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; roeck-us.net; dkim=none (message not signed) header.d=none;roeck-us.net; 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; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT021.mail.protection.outlook.com (10.152.75.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3933.32 via Frontend Transport; Mon, 15 Mar 2021 10:47:38 +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.2106.2; Mon, 15 Mar 2021 03:47:37 -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.2106.2 via Frontend Transport; Mon, 15 Mar 2021 03:47:37 -0700 Received: from [10.140.6.40] (port=50876 helo=xhdsivadur40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lLkl6-00055N-49; Mon, 15 Mar 2021 03:47:36 -0700 From: Srinivas Neeli To: , , , CC: , , , , , Srinivas Neeli Subject: [PATCH 7/9] watchdog: of_xilinx_wdt: Add Versal Window watchdog support Date: Mon, 15 Mar 2021 16:16:52 +0530 Message-ID: <1615805214-24857-8-git-send-email-srinivas.neeli@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615805214-24857-1-git-send-email-srinivas.neeli@xilinx.com> References: <1615805214-24857-1-git-send-email-srinivas.neeli@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 68ed7fe9-5eee-4dfb-0cec-08d8e79fc08e X-MS-TrafficTypeDiagnostic: BN7PR02MB4145: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:3383; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zhwvBiNhPXhZRkR0QmjJ1MtMh7tVSPlrczUDoqZO6Ljbn5ArDA15raCL+kYhkF+5F5xAM9jD/qPaf4+44a8CIgiVAzCjViuZjJFFIdc2cbMSiqrfAGIbpyWdLd6lVsQIbW4Bv4O4zBiym/RlVZmWO7rzqP91Hp39TDCy3R0pbWoLBa2+QvWfSfOkCTZ9oZwXo0+bYNaIQiJdJzMFb6a6AmcnC1jEl9Sz0ToCYLE1yB8TJu9AhH+rbi1MeKdeA9aZGvGs/Ap1xUUVxr1KfP7omotdxI+jAKBZD9LjBZuUk2HPhUFHSBR2UudsVm2ZKsEwOxCUS7yVzRfEF2ZQhW5lorMjKs98WgS2ek4RTHaqdySxJ7xG8o4zJo8P3Y++a0yHRYcA79tiIKmwlWGzPq/SYjbMkO6e9wBohF1UY+8bs11zTbPnVy8VlhoIJ2AlbrXDM/ScMq8fHDkCg+XokqBhnjrwuJSOxCgoHcxUeXU6wWW6THx0g1hU1hNidP8SrYTeV1M3g7dNjq0XT3nfzA7SNcPbbG9439RpN6gEDk02B6tYpZvoG2u++KYLMGTyWZ7QHYnhyzKausLm/ZOQv/6vYDhEWvg9OZ4nQNqUyHnUdhdQfSdHHUi/kpXxmnGr4PHRm3uTDgugQvmQDQqBvCTaWWR3cM9pWRc+yQzG3D2UoyMYNE3eUaPozWs/vWvEHvFe 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:(4636009)(136003)(376002)(39850400004)(396003)(346002)(46966006)(36840700001)(7636003)(70206006)(44832011)(5660300002)(47076005)(70586007)(316002)(356005)(478600001)(8936002)(4326008)(336012)(110136005)(6666004)(82310400003)(7696005)(36756003)(54906003)(426003)(6636002)(82740400003)(2616005)(186003)(8676002)(107886003)(36906005)(2906002)(26005)(36860700001)(30864003)(83380400001)(9786002)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2021 10:47:38.8646 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 68ed7fe9-5eee-4dfb-0cec-08d8e79fc08e 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: CY1NAM02FT021.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR02MB4145 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210315_104743_735450_C0D8E3FC X-CRM114-Status: GOOD ( 19.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Versal watchdog driver uses Window watchdog mode. Window watchdog timer(WWDT) contains closed(first) and open(second) window with 32 bit width. WWDT will generate an interrupt after the first window timeout and reset signal after the second window timeout. Timeout and Pre-timeout configuration, Stop and Refresh trigger only in open window. Signed-off-by: Srinivas Neeli --- drivers/watchdog/of_xilinx_wdt.c | 285 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 283 insertions(+), 2 deletions(-) diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c index 3b93b60f1a00..3656e716b4f7 100644 --- a/drivers/watchdog/of_xilinx_wdt.c +++ b/drivers/watchdog/of_xilinx_wdt.c @@ -2,10 +2,11 @@ /* * Watchdog Device Driver for Xilinx axi/xps_timebase_wdt * - * (C) Copyright 2013 - 2014 Xilinx, Inc. + * (C) Copyright 2013 - 2021 Xilinx, Inc. * (C) Copyright 2011 (Alejandro Cabrera ) */ +#include #include #include #include @@ -17,6 +18,11 @@ #include #include #include +#include + +#define XWT_WWDT_DEFAULT_TIMEOUT 10 +#define XWT_WWDT_MIN_TIMEOUT 1 +#define XWT_WWDT_MAX_TIMEOUT 42 /* Register offsets for the Wdt device */ #define XWT_TWCSR0_OFFSET 0x0 /* Control/Status Register0 */ @@ -35,15 +41,44 @@ #define XWT_MAX_SELFTEST_LOOP_COUNT 0x00010000 #define XWT_TIMER_FAILED 0xFFFFFFFF +/* Register offsets for the WWdt device */ +#define XWT_WWDT_MWR_OFFSET 0x00 +#define XWT_WWDT_ESR_OFFSET 0x04 +#define XWT_WWDT_FCR_OFFSET 0x08 +#define XWT_WWDT_FWR_OFFSET 0x0c +#define XWT_WWDT_SWR_OFFSET 0x10 + +/* Master Write Control Register Masks */ +#define XWT_WWDT_MWR_MASK BIT(0) + +/* Enable and Status Register Masks */ +#define XWT_WWDT_ESR_WINT_MASK BIT(16) +#define XWT_WWDT_ESR_WSW_MASK BIT(8) +#define XWT_WWDT_ESR_WEN_MASK BIT(0) + +/* Function control Register Masks */ +#define XWT_WWDT_SBC_MASK 0xFF00 +#define XWT_WWDT_SBC_SHIFT 16 +#define XWT_WWDT_BSS_MASK 0xC0 + #define WATCHDOG_NAME "Xilinx Watchdog" +static int wdt_timeout; + +module_param(wdt_timeout, int, 0644); +MODULE_PARM_DESC(wdt_timeout, + "Watchdog time in seconds. (default=" + __MODULE_STRING(XWT_WWDT_DEFAULT_TIMEOUT) ")"); + /** * enum xwdt_ip_type - WDT IP type. * * @XWDT_WDT: Soft wdt ip. + * @XWDT_WWDT: Window wdt ip. */ enum xwdt_ip_type { XWDT_WDT = 0, + XWDT_WWDT = 1, }; struct xwdt_devtype_data { @@ -58,6 +93,7 @@ struct xwdt_device { spinlock_t spinlock; /* spinlock for register handling */ struct watchdog_device xilinx_wdt_wdd; struct clk *clk; + int irq; }; static int xilinx_wdt_start(struct watchdog_device *wdd) @@ -145,6 +181,220 @@ static const struct watchdog_ops xilinx_wdt_ops = { .ping = xilinx_wdt_keepalive, }; +static int is_wwdt_in_closed_window(struct watchdog_device *wdd) +{ + u32 control_status_reg; + struct xwdt_device *xdev = watchdog_get_drvdata(wdd); + + control_status_reg = ioread32(xdev->base + XWT_WWDT_ESR_OFFSET); + if (control_status_reg & XWT_WWDT_ESR_WEN_MASK) + if (!(control_status_reg & XWT_WWDT_ESR_WSW_MASK)) + return 0; + + return 1; +} + +static int xilinx_wwdt_start(struct watchdog_device *wdd) +{ + int ret; + u32 control_status_reg, fcr; + u64 time_out, pre_timeout, count; + struct xwdt_device *xdev = watchdog_get_drvdata(wdd); + struct watchdog_device *xilinx_wdt_wdd = &xdev->xilinx_wdt_wdd; + + count = clk_get_rate(xdev->clk); + if (!count) + return -EINVAL; + + /* Calculate timeout count */ + pre_timeout = count * wdd->pretimeout; + time_out = count * wdd->timeout; + if (!watchdog_active(xilinx_wdt_wdd)) { + ret = clk_enable(xdev->clk); + if (ret) { + dev_err(wdd->parent, "Failed to enable clock\n"); + return ret; + } + } + + spin_lock(&xdev->spinlock); + iowrite32(XWT_WWDT_MWR_MASK, xdev->base + XWT_WWDT_MWR_OFFSET); + iowrite32(~(u32)XWT_WWDT_ESR_WEN_MASK, + xdev->base + XWT_WWDT_ESR_OFFSET); + + if (pre_timeout) { + iowrite32((u32)(time_out - pre_timeout), + xdev->base + XWT_WWDT_FWR_OFFSET); + iowrite32((u32)pre_timeout, xdev->base + XWT_WWDT_SWR_OFFSET); + fcr = ioread32(xdev->base + XWT_WWDT_SWR_OFFSET); + fcr = (fcr >> XWT_WWDT_SBC_SHIFT) & XWT_WWDT_SBC_MASK; + fcr = fcr | XWT_WWDT_BSS_MASK; + iowrite32(fcr, xdev->base + XWT_WWDT_FCR_OFFSET); + } else { + iowrite32((u32)pre_timeout, + xdev->base + XWT_WWDT_FWR_OFFSET); + iowrite32((u32)time_out, xdev->base + XWT_WWDT_SWR_OFFSET); + iowrite32(0x0, xdev->base + XWT_WWDT_FCR_OFFSET); + } + + /* Enable the window watchdog timer */ + control_status_reg = ioread32(xdev->base + XWT_WWDT_ESR_OFFSET); + control_status_reg |= XWT_WWDT_ESR_WEN_MASK; + iowrite32(control_status_reg, xdev->base + XWT_WWDT_ESR_OFFSET); + + spin_unlock(&xdev->spinlock); + + dev_dbg(xilinx_wdt_wdd->parent, "Watchdog Started!\n"); + + return 0; +} + +static int xilinx_wwdt_stop(struct watchdog_device *wdd) +{ + struct xwdt_device *xdev = watchdog_get_drvdata(wdd); + struct watchdog_device *xilinx_wdt_wdd = &xdev->xilinx_wdt_wdd; + + if (!is_wwdt_in_closed_window(wdd)) { + dev_warn(xilinx_wdt_wdd->parent, "timer in closed window"); + return -EINVAL; + } + + spin_lock(&xdev->spinlock); + + iowrite32(XWT_WWDT_MWR_MASK, xdev->base + XWT_WWDT_MWR_OFFSET); + /* Disable the Window watchdog timer */ + iowrite32(~(u32)XWT_WWDT_ESR_WEN_MASK, + xdev->base + XWT_WWDT_ESR_OFFSET); + + spin_unlock(&xdev->spinlock); + + if (watchdog_active(xilinx_wdt_wdd)) + clk_disable(xdev->clk); + + dev_dbg(xilinx_wdt_wdd->parent, "Watchdog Stopped!\n"); + + return 0; +} + +static int xilinx_wwdt_keepalive(struct watchdog_device *wdd) +{ + u32 control_status_reg; + struct xwdt_device *xdev = watchdog_get_drvdata(wdd); + + /* Refresh in open window is ignored */ + if (!is_wwdt_in_closed_window(wdd)) + return 0; + + spin_lock(&xdev->spinlock); + + iowrite32(XWT_WWDT_MWR_MASK, xdev->base + XWT_WWDT_MWR_OFFSET); + control_status_reg = ioread32(xdev->base + XWT_WWDT_ESR_OFFSET); + control_status_reg |= XWT_WWDT_ESR_WINT_MASK; + control_status_reg &= ~XWT_WWDT_ESR_WSW_MASK; + iowrite32(control_status_reg, xdev->base + XWT_WWDT_ESR_OFFSET); + control_status_reg = ioread32(xdev->base + XWT_WWDT_ESR_OFFSET); + control_status_reg |= XWT_WWDT_ESR_WSW_MASK; + iowrite32(control_status_reg, xdev->base + XWT_WWDT_ESR_OFFSET); + + spin_unlock(&xdev->spinlock); + + return 0; +} + +static int xilinx_wwdt_set_timeout(struct watchdog_device *wdd, + unsigned int new_time) +{ + u32 ret = 0; + struct xwdt_device *xdev = watchdog_get_drvdata(wdd); + struct watchdog_device *xilinx_wdt_wdd = &xdev->xilinx_wdt_wdd; + + if (!is_wwdt_in_closed_window(wdd)) { + dev_warn(xilinx_wdt_wdd->parent, "timer in closed window"); + return -EINVAL; + } + + if (new_time < XWT_WWDT_MIN_TIMEOUT || + new_time > XWT_WWDT_MAX_TIMEOUT) { + dev_warn(xilinx_wdt_wdd->parent, + "timeout value must be %d<=x<=%d, using %d\n", + XWT_WWDT_MIN_TIMEOUT, + XWT_WWDT_MAX_TIMEOUT, new_time); + return -EINVAL; + } + + wdd->timeout = new_time; + wdd->pretimeout = 0; + + if (watchdog_active(xilinx_wdt_wdd)) { + ret = xilinx_wwdt_start(wdd); + if (ret) + dev_dbg(xilinx_wdt_wdd->parent, "timer start failed"); + } + + return 0; +} + +static int xilinx_wwdt_set_pretimeout(struct watchdog_device *wdd, + u32 new_pretimeout) +{ + u32 ret = 0; + struct xwdt_device *xdev = watchdog_get_drvdata(wdd); + struct watchdog_device *xilinx_wdt_wdd = &xdev->xilinx_wdt_wdd; + + if (!is_wwdt_in_closed_window(wdd)) { + dev_warn(xilinx_wdt_wdd->parent, "timer in closed window"); + return -EINVAL; + } + + if (new_pretimeout < wdd->min_timeout || + new_pretimeout >= wdd->timeout) + return -EINVAL; + + wdd->pretimeout = new_pretimeout; + + if (watchdog_active(xilinx_wdt_wdd)) { + ret = xilinx_wwdt_start(wdd); + if (ret) + dev_dbg(xilinx_wdt_wdd->parent, "timer start failed"); + } + + return 0; +} + +static irqreturn_t xilinx_wwdt_isr(int irq, void *wdog_arg) +{ + struct xwdt_device *xdev = wdog_arg; + + watchdog_notify_pretimeout(&xdev->xilinx_wdt_wdd); + return IRQ_HANDLED; +} + +static const struct watchdog_info xilinx_wwdt_ident = { + .options = WDIOF_MAGICCLOSE | + WDIOF_KEEPALIVEPING | + WDIOF_SETTIMEOUT, + .firmware_version = 1, + .identity = "xlnx_wwdt watchdog", +}; + +static const struct watchdog_info xilinx_wwdt_pretimeout_ident = { + .options = WDIOF_MAGICCLOSE | + WDIOF_KEEPALIVEPING | + WDIOF_PRETIMEOUT | + WDIOF_SETTIMEOUT, + .firmware_version = 1, + .identity = "xlnx_wwdt watchdog", +}; + +static const struct watchdog_ops xilinx_wwdt_ops = { + .owner = THIS_MODULE, + .start = xilinx_wwdt_start, + .stop = xilinx_wwdt_stop, + .ping = xilinx_wwdt_keepalive, + .set_timeout = xilinx_wwdt_set_timeout, + .set_pretimeout = xilinx_wwdt_set_pretimeout, +}; + static u32 xwdt_selftest(struct xwdt_device *xdev) { int i; @@ -181,11 +431,19 @@ static const struct xwdt_devtype_data xwdt_wdt_data = { .xwdt_ops = &xilinx_wdt_ops, }; +static const struct xwdt_devtype_data xwdt_wwdt_data = { + .wdttype = XWDT_WWDT, + .xwdt_info = &xilinx_wwdt_ident, + .xwdt_ops = &xilinx_wwdt_ops, +}; + static const struct of_device_id xwdt_of_match[] = { { .compatible = "xlnx,xps-timebase-wdt-1.00.a", .data = &xwdt_wdt_data }, { .compatible = "xlnx,xps-timebase-wdt-1.01.a", .data = &xwdt_wdt_data }, + { .compatible = "xlnx,versal-wwdt-1.0", + .data = &xwdt_wwdt_data }, {}, }; MODULE_DEVICE_TABLE(of, xwdt_of_match); @@ -194,7 +452,7 @@ static int xwdt_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; int rc; - u32 pfreq = 0, enable_once = 0; + u32 pfreq = 0, enable_once = 0, pre_timeout = 0; struct xwdt_device *xdev; struct watchdog_device *xilinx_wdt_wdd; const struct of_device_id *of_id; @@ -236,6 +494,12 @@ static int xwdt_probe(struct platform_device *pdev) "Parameter \"xlnx,wdt-enable-once\" not found\n"); watchdog_set_nowayout(xilinx_wdt_wdd, enable_once); + } else { + rc = of_property_read_u32(dev->of_node, "pretimeout-sec", + &pre_timeout); + if (rc) + dev_dbg(dev, + "Parameter \"pretimeout-sec\" not found\n"); } xdev->clk = devm_clk_get(dev, NULL); @@ -268,6 +532,23 @@ static int xwdt_probe(struct platform_device *pdev) xilinx_wdt_wdd->timeout = 2 * ((1 << xdev->wdt_interval) / pfreq); + } else { + xilinx_wdt_wdd->pretimeout = pre_timeout; + xilinx_wdt_wdd->timeout = XWT_WWDT_DEFAULT_TIMEOUT; + xilinx_wdt_wdd->min_timeout = XWT_WWDT_MIN_TIMEOUT; + xilinx_wdt_wdd->max_timeout = XWT_WWDT_MAX_TIMEOUT; + xdev->irq = platform_get_irq_byname(pdev, "wdt"); + if (xdev->irq > 0) { + if (!devm_request_irq(dev, xdev->irq, xilinx_wwdt_isr, + 0, dev_name(dev), xdev)) { + xilinx_wdt_wdd->info = + &xilinx_wwdt_pretimeout_ident; + } + } + rc = watchdog_init_timeout(xilinx_wdt_wdd, + wdt_timeout, &pdev->dev); + if (rc) + dev_warn(&pdev->dev, "unable to set timeout value\n"); } spin_lock_init(&xdev->spinlock); From patchwork Mon Mar 15 10:46:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Neeli X-Patchwork-Id: 12138901 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BEF1C433DB for ; Mon, 15 Mar 2021 10:54:05 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 097C364E21 for ; Mon, 15 Mar 2021 10:54:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 097C364E21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bew1WPP216qqw4OxnGpP3+vpK9Q6kRCXoT23Ctg8rIw=; b=oOsqxikdEbkiWatRbDhmaouap NNssXMS8KZJKkNUHOLhw0YrgUxHH5hFaQngvFxmXyzn+AARAlLEFeGbTPl9RunYISpMuAvoBjR+8z CM3lG9w7ZbRRn1h7G84UcYIl594SQRlayfE8E3Nx5o6dFKjFAqvYbZqdYK9A4uigjqayrdz1f55vK efupYrCI5B0dOVhDV50GG5GpNMdbH3Wpz0K9M1zO2EYIgM+VRXBwDgcFQQ8ZaZnj9VcDUP+ESm/Ut iS7tZgPlUNNksM5/QYmidfONp6hoo/s/wZmzSC80QqXZ+4qNarDW5Fs3l1MQpTb0nAcCxheCzBUQF E4fkG/uaA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lLkoK-00FZ79-Q6; Mon, 15 Mar 2021 10:50:57 +0000 Received: from mail-dm6nam10on2060.outbound.protection.outlook.com ([40.107.93.60] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lLklJ-00FYVu-AN for linux-arm-kernel@lists.infradead.org; Mon, 15 Mar 2021 10:47:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ob1IM4tda1ex5Q5Awb0zy37ECM98oehX36EwugkXlowTBcHbhE4Jgx5ANXeIQa1nBSrEomZSFua4vrTUXtlsGOpJkeUotVcE8imNCAgYlKm/E3idkEyA+J9wNOlPHd2419OyvxVj93kmm758IaQB4xEbrFfL8pyO3iBfbtnDml8x4C11GP33Z8bY/l4VImZwErsTXoI2GIKg32y1WYjQmml1ttVq4CigNgF+l8LLZDb+eLiy6nmS4WGWkFmcW37dblO3UUu3p+q5489+3YHlAdQUSGBPeUJYuSjp2U2UUBCPmT23A0V3Cl/P/t9m1ugVS4lf1IVaY9qcfmw2wps0VQ== 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-SenderADCheck; bh=pdsY9hka6qUPc+TwWvuLFBdy/7CJ6hYdhlepGwGPJYQ=; b=HW96BW8gsZGBsBJtS05ITHzvy2a4lTETp61meINbw9Ra1w37oITuKaLl+SlNwqNrAxQ+xVTGhNjbTM5ANSj5LTOTaVEcHcuo57lRzirThx7/sobEP7B8AalDnYKLmFvmTVNNHWPez9Q6BrV5H3QB/LD2SFAL90RIjJCFSxKlxcXFv3hdCAO7Wz5pq+mm8/tRyTXt7Jf58CYGEiyEVZe+YgHNK6ZE68oJp4aG/AOcPW/CVd5x6AbFDg4rIGLcS9dCOqmKVBIXxC5vZhk8DVAxS5c2CVpk3sy9wJZ5OrwwtC8HN3mshf4BxDH3JSuT6fClpjfw7HDU0NkWV3Cqxu8WDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=roeck-us.net 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=pdsY9hka6qUPc+TwWvuLFBdy/7CJ6hYdhlepGwGPJYQ=; b=ku+J16zwiI2o85oEBkDm1j+t1LGQEAC3lKJ9cB1Oluv2aRENseSJgtEg1qXhVW+Zb37LdQB7BBgVQu0/xhV8vcaGWp8c9CR95W4qF7WWdDp8aLclrgYao1TuXxLgY879V/++rxx7UkOeUchMiBB+HNnn9sFUsoQ6F/GTa9AysDc= Received: from CY4PR04CA0044.namprd04.prod.outlook.com (2603:10b6:903:c6::30) by BL0PR02MB4929.namprd02.prod.outlook.com (2603:10b6:208:54::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32; Mon, 15 Mar 2021 10:47:44 +0000 Received: from CY1NAM02FT049.eop-nam02.prod.protection.outlook.com (2603:10b6:903:c6:cafe::87) by CY4PR04CA0044.outlook.office365.com (2603:10b6:903:c6::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32 via Frontend Transport; Mon, 15 Mar 2021 10:47:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; roeck-us.net; dkim=none (message not signed) header.d=none;roeck-us.net; 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; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT049.mail.protection.outlook.com (10.152.75.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3933.32 via Frontend Transport; Mon, 15 Mar 2021 10:47:43 +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.2106.2; Mon, 15 Mar 2021 03:47:40 -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.2106.2 via Frontend Transport; Mon, 15 Mar 2021 03:47:40 -0700 Received: from [10.140.6.40] (port=50876 helo=xhdsivadur40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lLkl9-00055N-2j; Mon, 15 Mar 2021 03:47:39 -0700 From: Srinivas Neeli To: , , , CC: , , , , , Srinivas Neeli Subject: [PATCH 8/9] watchdog: of_xilinx_wdt: Remove passing null pointer Date: Mon, 15 Mar 2021 16:16:53 +0530 Message-ID: <1615805214-24857-9-git-send-email-srinivas.neeli@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615805214-24857-1-git-send-email-srinivas.neeli@xilinx.com> References: <1615805214-24857-1-git-send-email-srinivas.neeli@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 50658cf3-fc3c-4e18-be3b-08d8e79fc37a X-MS-TrafficTypeDiagnostic: BL0PR02MB4929: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:1332; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Cfwi1DBxu6OicpnuaoBl6kp5QEE0bf21UIZEuFF09rcKSoH2peUz9IvPOtjfs+7I0zpD8lVa51kIfpTqT38XrrkjzX7/iHWPn80jDrgZ4f3hlf+TFCvGOCZrPYOwUvxEtHjM32KSjCHiF2LBjSocjDc+TwBxTTDJRrHYHe0WWBzWNBIR4M8+nOSUl5hkFbi7gGIh6OTdpG6D/73bTwKx5ijcFHrsDvW5TxkA55Ah0q43jp6ZTMA+epLiI8uvnTGz8pNc/RmvbtRvKiNxwmobr8uWqxv+Pjss73oxn+gWRaiD3KB05v4mhpAAiovIV40mTJ5HvqO0NH2WClXh5CXfbgpuXO7+ppjFZontlXSDhzIKro+HsSGooliDLt/zI2uTo1fynmqOjoRzWhHfABnp4WW6MdBh/dq84w791eGNwVeWgxemF4Qx3rzXsf6B0ha8xyjEmvhSvFeo5CJ807LtHJU+0bmTj79tePvFcMDL5Fb9dePp0UpWFCAeLs0TVVag+6qOHNJsL7jTev6eGXAJBw1m+Zt4LvF8eRG/3NPg8oAKIc7HiU9NSPw8jfZS3jB+FLsPIrbUNilo2MMXlb2YLIWbifm5X5PWbo5N16ktLvHqY7XFf4y1Kh2FtoPR98fm/iduc1i9FMCe6baceoksYdMB7L1VUDaVMPIoEyrluqZ1+lD09+TFWdiEZnc39dnB 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:(4636009)(346002)(39860400002)(136003)(376002)(396003)(46966006)(36840700001)(8936002)(6666004)(2906002)(7636003)(82310400003)(83380400001)(36756003)(356005)(44832011)(9786002)(2616005)(70206006)(8676002)(70586007)(47076005)(6636002)(54906003)(5660300002)(36860700001)(426003)(82740400003)(36906005)(186003)(110136005)(26005)(107886003)(336012)(316002)(478600001)(7696005)(4326008)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2021 10:47:43.7713 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 50658cf3-fc3c-4e18-be3b-08d8e79fc37a 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: CY1NAM02FT049.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR02MB4929 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210315_104749_624082_E95579F4 X-CRM114-Status: GOOD ( 11.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org clk is an optional property, if clock not defined, calling clk_prepare_enable() and devm_add_action_or_reset() are not useful. so calling these two apis only when clock is present. Addresses-Coverity:"FORWARD_NULL" Signed-off-by: Srinivas Neeli Reviewed-by: Guenter Roeck --- drivers/watchdog/of_xilinx_wdt.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c index 3656e716b4f7..ad35c93b7684 100644 --- a/drivers/watchdog/of_xilinx_wdt.c +++ b/drivers/watchdog/of_xilinx_wdt.c @@ -520,6 +520,16 @@ static int xwdt_probe(struct platform_device *pdev) "The watchdog clock freq cannot be obtained\n"); } else { pfreq = clk_get_rate(xdev->clk); + rc = clk_prepare_enable(xdev->clk); + + if (rc) { + dev_err(dev, "unable to enable clock\n"); + return rc; + } + rc = devm_add_action_or_reset(dev, xwdt_clk_disable_unprepare, + xdev->clk); + if (rc) + return rc; } if (wdttype == XWDT_WDT) { @@ -554,16 +564,6 @@ static int xwdt_probe(struct platform_device *pdev) spin_lock_init(&xdev->spinlock); watchdog_set_drvdata(xilinx_wdt_wdd, xdev); - rc = clk_prepare_enable(xdev->clk); - if (rc) { - dev_err(dev, "unable to enable clock\n"); - return rc; - } - rc = devm_add_action_or_reset(dev, xwdt_clk_disable_unprepare, - xdev->clk); - if (rc) - return rc; - if (wdttype == XWDT_WDT) { rc = xwdt_selftest(xdev); if (rc == XWT_TIMER_FAILED) { From patchwork Mon Mar 15 10:46:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Neeli X-Patchwork-Id: 12138903 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DFADC433DB for ; Mon, 15 Mar 2021 10:54:13 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E4E0C64E21 for ; Mon, 15 Mar 2021 10:54:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E4E0C64E21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=snm8VnI8eLjXGTEglDharpp9Z7CniI4X42rI9T6p5uE=; b=U4szEbXEiVj6VdP0Ld6YQpESg mu/W1iaNMShkI2Kip/KB7J6ziExMbxkzLyqhgCoNwTgR7BYKul6GgVOSioXu6/y5lonv9fT2Te4kG Rx3YXpaULwm2vr1YlnVpQE36Ws/RYSrZrNYha/3xWZoP+LPjgZt5E+aVwo1JvNVJoLsEX3BlSpaSH adidtDpEYg9M+Z0taSCxNkRGCGys3J3shVsLJO5JNP8SnFqvgkgexrDu6t1QKFcX9cEhF49BzQ0B0 kqUN0sAllfa9t22q+pB6eMV40u5GA9+irqUyjtq57HclX4Zbd/P+7rbvy/n78i7pi0HAOUjWUfEFL 36p9Rd5ow==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lLkol-00FZD8-EH; Mon, 15 Mar 2021 10:51:33 +0000 Received: from mail-mw2nam12on2043.outbound.protection.outlook.com ([40.107.244.43] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lLklK-00FYVx-9A for linux-arm-kernel@lists.infradead.org; Mon, 15 Mar 2021 10:47:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FNSMcBJ3taDKAkS1Ag5APAzx6Hpau9KerV7+UTTqMKAMOIv3SronLPGzMwToxEuPnphOF0nLRlWhJ/lRrLPqdfkoH5J3jL0F0O4N4Qwth7qg73Sj/rFRnTPh0122r0k2udSeG6L3GKoqBtbdzjGpvfx3viN5YC7Mr+U8HkRSZYq+B6v8mItXrXyLCIQEeaJyd9Hc3QktYRdNmG3briW+ncnjyotF8vZBzzxAYbul/vPTXcgSETN2JN9F3l4030l3zhiqt67QDc1GRQx+qPraBNzlgIt16UlIbtoXw2FTPjzW0bWdD92/37hdzif/+D/gOtDebm6Ib7bcc5N1S8XayA== 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-SenderADCheck; bh=EfZvIvygELIpyD3Y6TV5MSep40e5DYmsoi6Z/Ufld1Q=; b=WeWEJsMqjB+c4WaZGxBS7/YMhaY0wzprLijtN7S1L6WuQwiekCq4IuP/6qxPJC49ZfsuieVfnTzLKPvgA1necpGCUPiLav7Yr7xNSZJky+oQXu/+5d8m6xHe+G7XWAHH4z5rGGifW2UWqCpdfARnMLQ636i3XaISDt/vIInJkq9SmCjyWzPhbPE8jUvjJObGRiRl6P8CNvZs7iTYEMpMCMIAnKO/4Kd4UZvkaoaalQBR7jhj30MrHe6InGo7j+VbKEUj0MyR5vRTslyzk34C+L21Q7YB/epcQhzTptiSNCio0xjGYqjSXKadDZ9DWy+fE6rO3EIAyc/JyiGrG2iNLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=roeck-us.net 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=EfZvIvygELIpyD3Y6TV5MSep40e5DYmsoi6Z/Ufld1Q=; b=c6foquGW+fqFhY0NP38CY9GY2TYEvVtjn25fXe9gLfd7ZJrjCnHDEgSdkZ28ITArZed9rTYx6Hkeh3MbjJ9WBDrqCIB5DtUGTt5bJFaAzbN1TyzLxKljHvsEiKGVelAAZwv9RJtaunTLJ9HqfLJ2jOITcDPJovebhbcoBjgjf+A= Received: from CY4PR04CA0045.namprd04.prod.outlook.com (2603:10b6:903:c6::31) by BY5PR02MB6387.namprd02.prod.outlook.com (2603:10b6:a03:1b5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32; Mon, 15 Mar 2021 10:47:45 +0000 Received: from CY1NAM02FT049.eop-nam02.prod.protection.outlook.com (2603:10b6:903:c6:cafe::1e) by CY4PR04CA0045.outlook.office365.com (2603:10b6:903:c6::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32 via Frontend Transport; Mon, 15 Mar 2021 10:47:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; roeck-us.net; dkim=none (message not signed) header.d=none;roeck-us.net; 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; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT049.mail.protection.outlook.com (10.152.75.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3933.32 via Frontend Transport; Mon, 15 Mar 2021 10:47:45 +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.2106.2; Mon, 15 Mar 2021 03:47:43 -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.2106.2 via Frontend Transport; Mon, 15 Mar 2021 03:47:43 -0700 Received: from [10.140.6.40] (port=50876 helo=xhdsivadur40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lLklC-00055N-16; Mon, 15 Mar 2021 03:47:42 -0700 From: Srinivas Neeli To: , , , CC: , , , , , Srinivas Neeli Subject: [PATCH 9/9] watchdog: of_xilinx_wdt: Skip printing pointer value Date: Mon, 15 Mar 2021 16:16:54 +0530 Message-ID: <1615805214-24857-10-git-send-email-srinivas.neeli@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615805214-24857-1-git-send-email-srinivas.neeli@xilinx.com> References: <1615805214-24857-1-git-send-email-srinivas.neeli@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7caf91c4-bc3e-4f95-3773-08d8e79fc44d X-MS-TrafficTypeDiagnostic: BY5PR02MB6387: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:1388; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Fpz4ur1LgoNXNOPlDdTaU4b3NneunAiAHpob5h1yAiZaaemdhLXwoRlguvsSTSSBlcDBiMPaRiQ7rC2U26HRGcYpLorjxJsd58AzXubsEHXQfsbWfDvYCGWxCRh32e2Bl5D3KGQHlym2EGNSAKd7pG+FFougD/KegvK9Ki/mFDT6SDinPPBJV74lkTwIyq2mSJ3zBEjOFRdRwMCl9h1BgnYddICdZAfjFVpED3CrGLKCbuWN6oQ88SdILzkR2GvLnfVGxE6B9uU48TP3GFZpJ3fnbISXlGuGODgboDz6cdtMVtWItuENSHb+JunrJMTxqf3eCRDjFOuaKc5HBYITIW8K/GxfKOefMvApI7XmTRb8wR30sk1elwiQKAN+1Wl1l/QJCmDn6PRDdVgw3HoD2ClrrqB/Pnj5sq068i3ZC7CWQhc94hvVyhAUAa5d2K5DyPG2XcypBUKea0sfvAeutx9PyDezweXrP695oVPRSFLMNX1sv7VTmGo9NyhTR3ZWSL7z11o3zosNP0bR+QT1x3TSjOIh5I0H+CRU+jmrXuvpzSUymxun/uwBSqKu7jUSym1Zgz3tK7waMcOTBCbaDIyL3isusUPzXBganN0jrjpZkcOjjZqDKnnn82UrWXoqhJJcjC8MRoLVskBMuhCc1GgHOgqUFif2v3ilt2WcD1KW73Dx57tHk2qHS4VzcZXf 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:(4636009)(136003)(346002)(376002)(396003)(39850400004)(46966006)(36840700001)(82310400003)(110136005)(2616005)(478600001)(54906003)(44832011)(47076005)(70206006)(186003)(356005)(8936002)(8676002)(426003)(7636003)(36906005)(316002)(7696005)(4744005)(9786002)(26005)(82740400003)(2906002)(70586007)(5660300002)(107886003)(336012)(83380400001)(4326008)(36860700001)(36756003)(6636002)(6666004)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2021 10:47:45.1506 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7caf91c4-bc3e-4f95-3773-08d8e79fc44d 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: CY1NAM02FT049.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR02MB6387 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210315_104750_441231_068BA1BD X-CRM114-Status: UNSURE ( 9.66 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org "%p" is not printing the pointer value. In driver, printing pointer value is not useful so avoiding print. Signed-off-by: Srinivas Neeli Reviewed-by: Guenter Roeck --- drivers/watchdog/of_xilinx_wdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c index ad35c93b7684..df84734eba68 100644 --- a/drivers/watchdog/of_xilinx_wdt.c +++ b/drivers/watchdog/of_xilinx_wdt.c @@ -578,8 +578,8 @@ static int xwdt_probe(struct platform_device *pdev) clk_disable(xdev->clk); - dev_info(dev, "Xilinx Watchdog Timer at %p with timeout %ds\n", - xdev->base, xilinx_wdt_wdd->timeout); + dev_info(dev, "Xilinx Watchdog Timer with timeout %ds\n", + xilinx_wdt_wdd->timeout); platform_set_drvdata(pdev, xdev);