Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2330532imm; Mon, 28 May 2018 06:11:34 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK8+QCc8aBqqRq/5LBE3mf61aTHREmQLpBKzz9nRTN1MUTgScAVVQyAF9oUePhI6jKDq0LE X-Received: by 2002:a65:611a:: with SMTP id z26-v6mr3773588pgu.61.1527513094714; Mon, 28 May 2018 06:11:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527513094; cv=none; d=google.com; s=arc-20160816; b=Yg4rTuazTzL16JCVugjuQ2ZcvRZURA3Gk0L3wqOfWBLE4NtC5DXCb0GAnccbtunXa7 DMQxSh9XkWdQVvpAzpINKqWsrmRy+gbk+rxHPfZVrA+TgtC7ee2Kzj+ASSJnv7kkWYfz Fj512pQcbtXOh1LZRbfv+2Jc+gRLEXopbGUPoQutU+JT8yQx727PQPc169kegPMLSHtq njU2unVDRCRjg3ZYiczHwMr/T6cPISWzJcEErD42CY6rCR+D88P3ymQcYhlPv2gmuQJm D76FvqnyhoM7ZBifFc4IX6Q5yycXs/HsKL/8nNOLZiJVELPbiknq+6oFi+Z+PKSWFhzQ 0WzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=yX1AQXbJPtpF4/jhpaFwdEMHIn+FVPOyNCHCbiAlW2A=; b=aSJJVbyv++ExVj4T+SWVNNaRCwBZYhnnR8o4Cc7bCSn5F5OiZSyLax45a6TfQmLjHL 4sovsrJXzM8NciKSDIPAYACuY2Q9az9brU8bRTFXATR1lnAVmjsi7y1/FdTzk7ExzPzu mljaHsC7RNXAaVTAFL+xCIIg5cLDhaVuVKJbXoTC47KVKm1YZPZpFImJ2EjcrNX5+Qht BgeGLSRJ1qZvOgwO0R9kIC9qXnslT3wzvwpaQDaxDkxMXN5kcFvaRK7gD6hRb6Qf2OGq tqQbyZ4dtSuQd/G1XM1EHHCe6hBU8v/pNqQ2CkQju3B4vxXhsTBC5jT9enqMNb8JeKPh EzZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BUrYgy2H; 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 j8-v6si29279919plk.0.2018.05.28.06.11.19; Mon, 28 May 2018 06:11:34 -0700 (PDT) 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=@kernel.org header.s=default header.b=BUrYgy2H; 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 S939057AbeE1NKh (ORCPT + 99 others); Mon, 28 May 2018 09:10:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:40868 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163811AbeE1KvZ (ORCPT ); Mon, 28 May 2018 06:51:25 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E11B220660; Mon, 28 May 2018 10:51:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527504685; bh=HtcqrLaJY+UYQ05G+X/MSedo1JyZ1sjf9r5WvGGOsRQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BUrYgy2H1smBWy6Yqu+mJIE8Ki9XbW+ygw0n0XOsf2OZm1ZIeOXx8Yfxjk4E+9vw/ fDiyo2rVrRjEgvsCu8xqnTd2TfYvIiQKZl5tVi1i3E7lI19tyKD79aUPsa6U/2i3ts S7AeSWOEs+HkYV2/o32IlzK1I3It1vG2RQFudtxQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jayachandran C , Guenter Roeck , Wim Van Sebroeck , Sasha Levin Subject: [PATCH 4.14 210/496] watchdog: sbsa: use 32-bit read for WCV Date: Mon, 28 May 2018 11:59:55 +0200 Message-Id: <20180528100328.783258212@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jayachandran C [ Upstream commit 93ac3deb7c220cbcec032a967220a1f109d58431 ] 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: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/watchdog/sbsa_gwdt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- 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_timele !(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);