Received: by 10.223.185.116 with SMTP id b49csp4855276wrg; Wed, 7 Mar 2018 02:06:32 -0800 (PST) X-Google-Smtp-Source: AG47ELu3ddZpCkQHlGfU4ynWb8kDrHRruA0r63ioTEa0pWBw0rNc5itsWyL7N87TvI1edvvhQjG/ X-Received: by 10.99.156.17 with SMTP id f17mr17983236pge.12.1520417192500; Wed, 07 Mar 2018 02:06:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520417192; cv=none; d=google.com; s=arc-20160816; b=EI2mm8F+0wzIR9Fo18s97azqeFkoJzu2fxtfBPKN0gWqTkM1iKViV8c0quJjEUzofT PlYI4L+zR4TVvlRJ9LCHh2XxPwybC5HH0IXuu6yZhdDNAzjb7cKRiOmoZnIGsIqaTYmf pyGGcAsNj+SG/1tTbhehbQ8PagUDszKnslJmRpCgu3ZCf+Lav6L42M79DV9FDhLxBBt+ 0u6BbGg2/qeKY8gJPF8z3OEAE33c24JkJResSZlb02XlNdq5bnq/+HdXPeugqCAHx+/Z aD6FZIMSam5mXx6qVfeoEhdfKci8A5BfShJHOjMsxxv+4yp7YABbNB5W9M0vSkQsP9aK vrvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=4/csotsMzxMtkf4KT1WyLemK8tB4tLDNTVhkGubUeHs=; b=peZ4byh6tT5oHZkdBIKXqv4PtcQd8UozLCZW8Q6cYKxV1X6CsA+zVL6Navrg7TM2JP jLR2CQACGh65xiYhvos4wLUM0ItlKQBplCoDn4qB7S4U9aMWT271IDLYlOKhF60QC2ba FeNs0JRjrz/PUFER0QvKKglhkiwWXjAPtxsxTobL7SXsgGaVoY1R4n4HJ2C/mR/JbbIp rCpjKWs9SeG1pNXsxKLu6Gp9m0mJqZ51UYu/HX2v3c624OTmJymZtPDUWnvoX8+jsP+2 husWDUAgSPrqEiB+DiKqrS1zRf3tMDbBs/qlRRjJHJ5/vA4zbneFfHEwil1CNeWJas93 ogNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=IcLQS5+d; 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 u83si610299pfj.360.2018.03.07.02.06.18; Wed, 07 Mar 2018 02:06:32 -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=IcLQS5+d; 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 S1754251AbeCGKEm (ORCPT + 99 others); Wed, 7 Mar 2018 05:04:42 -0500 Received: from mail-co1nam03on0056.outbound.protection.outlook.com ([104.47.40.56]:19795 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751127AbeCGKEj (ORCPT ); Wed, 7 Mar 2018 05:04:39 -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=4/csotsMzxMtkf4KT1WyLemK8tB4tLDNTVhkGubUeHs=; b=IcLQS5+dTDjDRG32M9bYBKvVbf7auBtukt26WmgoJXfKPKgZijQ1oeFyXMGfMMH4gcq67NCdF46f0srE14N/KWnKCwd/yEIUCzSyXftHtTGhQo1/QUM09isM6AiTjjZY4QNntZaHoMFoQam88dd6F7H7HfTmr/UDIoE55SdSnOo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; Received: from rric.localdomain (80.171.203.19) by CO2PR0701MB0999.namprd07.prod.outlook.com (10.141.248.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Wed, 7 Mar 2018 10:04:35 +0000 Date: Wed, 7 Mar 2018 11:04:04 +0100 From: Robert Richter To: Jayachandran C Cc: Wim Van Sebroeck , Guenter Roeck , linux-watchdog@vger.kernel.org, Fu Wei , linux-kernel@vger.kernel.org Subject: Re: [PATCH] watchdog: sbsa: use 32-bit read for WCV Message-ID: <20180307100403.GB14432@rric.localdomain> References: <1519815140-5336-1-git-send-email-jnair@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1519815140-5336-1-git-send-email-jnair@caviumnetworks.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [80.171.203.19] X-ClientProxiedBy: AM6PR0202CA0013.eurprd02.prod.outlook.com (52.133.26.154) To CO2PR0701MB0999.namprd07.prod.outlook.com (10.141.248.23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 872df057-9f8c-4ec1-ef94-08d58412d5a2 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603328)(7153060)(7193020);SRVR:CO2PR0701MB0999; X-Microsoft-Exchange-Diagnostics: 1;CO2PR0701MB0999;3:FsZCqYDDRjy2eACCBPl+0lqIPYdbzsOQYDj+bVSNa+3cSdpicqH4yY8SKcjbgEqSUkOdoy1Jl5qicgiXn0IjNEMatOKSkdjXkQ/sOhAOwvBPtY+wWok0LnHB9LIgossIFTJ6IkfraN1+x20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jd0Q3NmPCsk+NVa3so8EnHZEzi1TovyVQkG/b80eVEauW6gxqdih/P8SMI8Su+/4eNayg4cvIawyJsIe9MVmJygSDXFw0O3ED/fr9ePj9Ud7QZI1fZLfqcXRuVz71/ZCffK88QSUA4ngDEFB43s21LzEAz4zG0tpU6bO3QYGd0OqoF1lyw4utBD8Owql;4:ZxgGDGnt5Xh3Ch37V0Yg3yNw0qcznjVI36Y+6tWuziVAHdLFlWDOpKc6JhWA4OAljc5s0Z0FmKe5ZctiFFat+fglo678t7szJgjWxTIwL+KLBmVoNU1EWK7d8o1BNYAwqa61ZvIken7w9NJU1nduTAkL5uzcq6X5uapcEFYRIriRzsAAS7cr4qs1gJph/Q13w5Nk8B6tqWFCWdA/4OXq0dcNBlnX+ak+2NO4zNWWZ4hD/8aGbhuKoBO+tSEe2hTNMtKqZnu1tyuj8AWew9j83g== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231220)(944501244)(52105095)(3002001)(6041288)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011);SRVR:CO2PR0701MB0999;BCL:0;PCL:0;RULEID:;SRVR:CO2PR0701MB0999; X-Forefront-PRVS: 0604AFA86B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(376002)(396003)(39850400004)(39380400002)(346002)(366004)(189003)(199004)(3846002)(23726003)(68736007)(6116002)(50466002)(1076002)(5660300001)(72206003)(478600001)(33656002)(106356001)(7736002)(229853002)(6666003)(9686003)(55016002)(2950100002)(305945005)(54906003)(66066001)(58126008)(16586007)(47776003)(105586002)(97736004)(26005)(4326008)(76176011)(33896004)(6862004)(16526019)(52116002)(7696005)(25786009)(2906002)(86362001)(81156014)(8936002)(8676002)(81166006)(316002)(386003)(6506007)(59450400001)(53546011)(6246003)(53936002)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:CO2PR0701MB0999;H:rric.localdomain;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;CO2PR0701MB0999;23:wtWLMw+y6j5hck4sqmy+uX8dUuW7A33HRAcdvd9?= =?us-ascii?Q?6tvFbtfyZ/cQ5Vb4xBDMjX+hd/CQ4/JdEvW/m3LZdcvVDY1COratT3FepcK4?= =?us-ascii?Q?CV9WP/ZNqeGvyeLLGjDkbNuVzN9rbqgqz9cw459/+E5OZUPN7skU2PyGrzyw?= =?us-ascii?Q?wGDC3Nw/nsB3bJKA8aUOzzZhdXqqr89ImGUW589/+30eksAzMs4iIFFS3L+Z?= =?us-ascii?Q?RrFhaoH89t42trK/Y9iOY/N4mvlmVWqFBKojXvPI03PMtpndMhi5/+OFL9ho?= =?us-ascii?Q?6NfIYHz0CGXBscVKd3B0iIrUdUnkrQcFuFANZ1fyQrEQqGN4ZLGVyeyKyMrM?= =?us-ascii?Q?arXYB0o+pX5rDglRCoQDFcEvL+G+NwLJR7ticjM+xp8/1B+HIPrdjEGXmAUk?= =?us-ascii?Q?2gZV25RLLkIChWeD2EuRFP/Hd6fGvY6ysIHDEv1zsDMHoLzi43DY3OK1S+uM?= =?us-ascii?Q?nSoR4pBhTQjYSo4l4MGvKsoq1sNKxmWmRJet9KhPh4b2QyRHi0MTIQGE0u7D?= =?us-ascii?Q?qlDLiGbXgHfWxH1LJZ70G32oYlumKNrEx6iszuFjwH0tof1ZKJy8Y0Bl34mA?= =?us-ascii?Q?W5kt1SCJg4wvm6uwzDb36XsjaQVk97yaILbKa/U51sSm4bJ/SIGJdqDc1lOP?= =?us-ascii?Q?nn22SzvTcaelaiGHVMgqTWeC+0ojdi5HH7k0iREhI9UqHce1dRmRXJ55KH8I?= =?us-ascii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d53smLw8GBhjnj07+SytD55WMdae1tONaI3TBlkmoybFqPdWuPu3CFYg3gObF1tagsoy4ukuF68iCuWe18aQzc4AWjh9/deqW9P+154k1bBtikhrzKPQWry1QsQ+Qw0+KXFIC4dajpGd7mnPvAoS7Pdi3FoxkZ5+A12LVkkCr/itWnfgogmjbSmMsjGTHGZML2TeuBWxcrETFJdfxuslztSq3s2HUyeGZoziwJvEOqSUsoXh4K9yGAQKhjvIRefdT57b/7bic7sgglnM+UtRis4Dd78FAs+w9cFl5qn8Y=;5:YrQf1GjSjexMMz8kqHye12HTNqKQET0rwYn8QY3dt4niRc5IP7gUpniKvExODn1QsuQLZdQunwDF8FBfyOMwiRT3zBJ9R0zg7Cn7X0rT1Ksy1X2yR69ds+EZdvJ9pOk5tODa8RiVGz2olJ7y6Atl4Zh+K4hV8Ow3N+bJifHvoLI=;24:db3Jhn/kVw/m84uig3Q4gOu9M086jJwzS7jSqqkwHZ/cSALVtwzGiEwzhOT5aJtsqyWMKUl8ayPMj4dFRdMzO47O97YLClqgFvJhIqjzq+g=;7:TQkh2Ni7MQjPasZtlCb/qIhBDjXlaScAJBKhxx9SJM+jlfQMPRPas1W//oimcst5bFgACpgX/6HZq5y5/+o8VSMLuD6S0kV+h8QdXgxKdLcJnpgvfthmjCgu5BoGBlRpjZpA/we6mnzQJGFJAwmOZy5BWe0Gmygk8vAQBd0PhEB3n6WI+R5cwG+RxMB5xtRiexmtPM1uNNH26cAyJ9VkEYkrjmLzma8+kCsr7nHXMxyk+PdB76Lcl2cz1eFvl++i SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2018 10:04:35.6608 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 872df057-9f8c-4ec1-ef94-08d58412d5a2 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR0701MB0999 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28.02.18 02:52:20, Jayachandran C wrote: > 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 Reviewed-by: Robert Richter I have looked into the non-atomic use of the register access and it looks sane as the WCV register is only incremented by hardware. There is no concurrent (write) access from the kernel. -Robert