Received: by 10.223.185.116 with SMTP id b49csp6035238wrg; Wed, 28 Feb 2018 02:54:58 -0800 (PST) X-Google-Smtp-Source: AH8x227477VJIzq2kdkRpXrSkpiQ61g9tZqkpCr1S2IugF+PoedIuA23urRMCX3c94vPqMHVO1Vn X-Received: by 2002:a17:902:8214:: with SMTP id x20-v6mr17325900pln.182.1519815298714; Wed, 28 Feb 2018 02:54:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519815298; cv=none; d=google.com; s=arc-20160816; b=H3I7NMBR6LrOuHzYM2eEEb/hXC870Pc2Ql8ncO4UifkVnqf1kHanEX9Upc3osLHmsG VX1DzZfc7HHOxBy1tj3VJ1oMkIW78+LCM8VyVko1uDaVLJUV91EgwPOUwHJGKfdPjnTt Oa2jJyWGfWj555vFnpfN70Gyu0nBbG/Z3XiUfKmGs81QHYl60lMu6p7+irgIJrdl2+dP SztlArVfUxrqe9MOjrcLuzXhmieUK5br7yHjbfAUq0Kws792ts6jxM93tiuQWdoDmkdc C0Mgv+DBT8/qOMkJ/542aNqYB7X54oRyhrxIR3WTwBbQMJhb+Opfci4M3OWzEUUi6Egc hPag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:message-id:date:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=K66GS9Mo0omHATNvB2Zc4XeUIgIr7WUMKP3OzyukN0c=; b=ojw941ZWtf6C/CI5FGX5l5vGWCXRPOArQA8wJG0E3espCQb227AAwA9UdHdGyHF/lm Q/AOJ+HZiYAn/r/anuRW82g/xE2w2/olA9YK0VfQAv5fLw0tVhrkNBhcRy4bMDEleQDo cEonjXnJTc6v/VW0LNjahIOiA+OANa4rE/DWuvMVmJYRBoXpqMXVBH3jkzAcTTmFfu2a 9rPtl2GTdFpw5O9Pyiuuvef8QBS9rKoNk9YP2I8Pa4HsPX86E/+6dyitkloWNYPhzfdN Lf1LXpowDmnglnlz2JPmTVKjEej6V0tpdT9DZiODdozy7nRpGue/QqoT4x4XPoH1ejE6 5SbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=QLRonFPp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w24-v6si1073982plq.553.2018.02.28.02.54.42; Wed, 28 Feb 2018 02:54:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=QLRonFPp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752689AbeB1KxJ (ORCPT + 99 others); Wed, 28 Feb 2018 05:53:09 -0500 Received: from mail-by2nam03on0060.outbound.protection.outlook.com ([104.47.42.60]:22688 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752473AbeB1KxH (ORCPT ); Wed, 28 Feb 2018 05:53:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=K66GS9Mo0omHATNvB2Zc4XeUIgIr7WUMKP3OzyukN0c=; b=QLRonFPpLQ+0fOEDHRjZqa7akhrzJKZFkHw2QkeUefR8r6qemDwIKBI6K9pjsE7uPdz+qdh1eL/IqQ164BI6XWbpP1qOre3ndjP6HUyxSVj22PQ6PpH7PUK2uIzLdrXyx0WOXBZYj4RLWoQmgu6L+4alT2iSCiKkmcC1VrIwArM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jayachandran.Nair@cavium.com; Received: from jc-sabre.caveonetworks.com (50.233.148.156) by CO2PR07MB667.namprd07.prod.outlook.com (10.141.227.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.15; Wed, 28 Feb 2018 10:53:02 +0000 From: Jayachandran C To: Wim Van Sebroeck , Guenter Roeck , linux-watchdog@vger.kernel.org Cc: Fu Wei , linux-kernel@vger.kernel.org, Jayachandran C Subject: [PATCH] watchdog: sbsa: use 32-bit read for WCV Date: Wed, 28 Feb 2018 02:52:20 -0800 Message-Id: <1519815140-5336-1-git-send-email-jnair@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: DM3PR12CA0063.namprd12.prod.outlook.com (10.161.151.31) To CO2PR07MB667.namprd07.prod.outlook.com (10.141.227.25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6483cdd7-6dd6-447c-5ffe-08d57e9970f6 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020);SRVR:CO2PR07MB667; X-Microsoft-Exchange-Diagnostics: 1;CO2PR07MB667;3:YWQX7pDqhBPUWOBW/WYpbA336UoQMuOJdh+0HOClAxzlf9B5qWDMQTFOqGCp7U75jt1jXHyS61dqq5wO50lokQ8g5LDuXzBNBFUbs7ZnTh+IQ+nrOcJUko8Zo9hmqZeZ4p+HZc+5l593ySeReLXwpWLsMeVBkPgw9E5mdWuQwButnIuoV9ew8M8XH2nG6C5VkF+COajLNi8AEN4dEALy5o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OWbWxqAM4JaoH7nAuCBaheT1aX8WNvpNVi6yNM5vSk1Q0EEggmN3xYBk2cKzq+515tznQvSjSCDOQ/IZppPUyuKfyAxEi0gfL89owXIIj4DnobcJYyyKFLtZFEqnGdiDLEpyTaM5gKsgpPUsv4iRDF2SYsK0Ai3FDK0yrCWQrsq+l/i0wQoED6+pHDdebP2k71QEhlwxeVzRxQk6gXN8ZZkVWikAa3yolejBDnoJYcA4wYWej3xSkchk=;4:2mOtierfnHz9PjvAUEyCebNuq5kSfY4klgOr2fe/u5e2uYUAUIh8zR6sE8/e2RYUE7PZsmC+0j1DoafNHKEP+xBzmHF459QRztUxMolIh5MR61YjZSYbEblEWkP4JLN2Bi3D452tBLLpMbDusHgOoj5CeI5GrzxH8w5rMuDJRW8xudf3R5OgkGHn4ozmsqBO87UyfvM9LF9/AB8Po8AvilxUrLC7N4+GzJ3oPeaNsGo+Arl+6M26DSaexigxzr0ib+N4DJVHY46H7CDp/MbljA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040501)(2401047)(5005006)(8121501046)(3231220)(944501217)(52105095)(10201501046)(3002001)(93006095)(6041288)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:CO2PR07MB667;BCL:0;PCL:0;RULEID:;SRVR:CO2PR07MB667; X-Forefront-PRVS: 0597911EE1 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(376002)(366004)(39860400002)(39380400002)(396003)(189003)(199004)(186003)(107886003)(386003)(3846002)(53936002)(16526019)(47776003)(53416004)(6666003)(66066001)(105586002)(6506007)(59450400001)(1857600001)(106356001)(26005)(52116002)(69596002)(54906003)(68736007)(8676002)(72206003)(48376002)(305945005)(51416003)(16586007)(81156014)(25786009)(4326008)(81166006)(478600001)(50466002)(50226002)(316002)(8936002)(6512007)(6486002)(2906002)(36756003)(5660300001)(110136005)(6116002)(42882007)(7736002)(97736004);DIR:OUT;SFP:1101;SCL:1;SRVR:CO2PR07MB667;H:jc-sabre.caveonetworks.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CO2PR07MB667;23:PrNKbmJv9WixPEp++a0HtUqfBr0Yr2sgTPd3bdV7Qm?= =?us-ascii?Q?/fpOYrcrtiEznnLN/Wn0NVpMHad76pVBnCD4rql+iGiPut6HYgBltB4LUt2R?= =?us-ascii?Q?vqKFPk1PS38hFghLBakBq39yV2LbOF0B/x3wDhviL+pirBiM/u2mSDU7+ZG5?= =?us-ascii?Q?2eWlpC33nX/YNg/bHrAkPlwE0u6W3SnkpB8YTaNo2JZ2OUv70VRt+9uoA1Du?= =?us-ascii?Q?x5lrXpFiHztMvuBk4rRNmPQ81PuHDHeJX9zdKGszZoUWc7+Lg4QAZGcDsgtG?= =?us-ascii?Q?NMioseAWBVQMdT8yo80DVUhfJ19BvlDO0gaoeTDKXIZFRZjnGefseWTib+LH?= =?us-ascii?Q?FvUmb2obz94ARE82Dlvq2NtghdQ64iu3kGSe78tJD0EsFwQsUS6kovW5A/Ux?= =?us-ascii?Q?RCQBINHZkU16ywJ3BNc7Ea4dqKyppnIGsml4yktUrDba0/0f9phInVQbXqFH?= =?us-ascii?Q?w+Hf7e59Ra/CiiaeEU25fBDJlLLysEA0MjNP24FJaF45Nw9id3XtPZbJE2vy?= =?us-ascii?Q?nZBKFLczVIkTKiF+aQOL5UpPitDKqi3Zp5gvsvpK/FIRqB3pgwM61jkjpT4J?= =?us-ascii?Q?S5CYeLX0cXfJhiKpmTRQoux3Wm+rsiP2MRRzUDvURXUcEoCdNRwHYE79xDXj?= =?us-ascii?Q?/zuCV4T1Nb61QAuklLU+O4EJ5mrTVcb0yy9d3Qef/fKmN5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HnKFpD+unyr2d2lfbGDGY9JH1Mcy4Z8gV56Y9DCx/69WARs3Q3GJSJBfplURKKHkcD+Bz3x/9StBW/ERNhNkKIsE/3fI37sWoIJWHmLe1cDRrPSDO+VYisAVoaRLx7fup+XhRS2rImWzoqXmDcImB6nT4=;24:rJMa19O229GavQffKdX6RwrR2dEqIM+fMPm1yOaaaXc7K1Aspj+zmcqN4js07WEPTo6s6wl9DzAIavQBOlvkPx0fB+7HIF4jIB+jsfetaes=;7:CvmNy2/bphxZUy/mXcF0lATl+gXlmsqhvwbgLOqWllGohnSO/zeTKmwZTXZwAQ12T4w530Yvd91efEHzlpLY2lavzRRW1kxew/mO+Q/C/G6HdPfZ1vcCEOICoNVky3dO9DjVun963Ikth1/AnbmirYQ0SITAPYc6yXlf/tpt2AqaHf3DPwyKOthziLWe9FLNf5HHcuRjqGH4SAOGQ9pDacQbWtzofttFFWGngJ4TySHIPaI+tFI0UtWScZjXnsNX SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2018 10:53:02.6208 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6483cdd7-6dd6-447c-5ffe-08d57e9970f6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB667 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org According to SBSA spec v3.1 section 5.3: All registers are 32 bits in size and should be accessed using 32-bit reads and writes. If an access size other than 32 bits is used then the results are IMPLEMENTATION DEFINED. [...] The Generic Watchdog is little-endian The current code uses readq to read the watchdog compare register which does a 64-bit access. This fails on ThunderX2 which does not implement 64-bit access to this register. Fix this by using lo_hi_readq() that does two 32-bit reads. Signed-off-by: Jayachandran C --- drivers/watchdog/sbsa_gwdt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/watchdog/sbsa_gwdt.c b/drivers/watchdog/sbsa_gwdt.c index 316c2eb..e8bd988 100644 --- a/drivers/watchdog/sbsa_gwdt.c +++ b/drivers/watchdog/sbsa_gwdt.c @@ -50,6 +50,7 @@ */ #include +#include #include #include #include @@ -159,7 +160,7 @@ static unsigned int sbsa_gwdt_get_timeleft(struct watchdog_device *wdd) !(readl(gwdt->control_base + SBSA_GWDT_WCS) & SBSA_GWDT_WCS_WS0)) timeleft += readl(gwdt->control_base + SBSA_GWDT_WOR); - timeleft += readq(gwdt->control_base + SBSA_GWDT_WCV) - + timeleft += lo_hi_readq(gwdt->control_base + SBSA_GWDT_WCV) - arch_counter_get_cntvct(); do_div(timeleft, gwdt->clk); -- 2.7.4