Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1689845pxb; Mon, 8 Mar 2021 04:08:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxXVixmm5EC0O1bfjsrnd0jdWi4f6G+0v3c3SR9j4tWfWzyLD0bdB7k0bb+uUT2ZBVvcO+O X-Received: by 2002:aa7:cd16:: with SMTP id b22mr2609326edw.357.1615205304691; Mon, 08 Mar 2021 04:08:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615205304; cv=none; d=google.com; s=arc-20160816; b=dmbvFTRBrovNgWb0svgqj84aSsax/C5FsngjaFsGbGcKF8djZsjNX3T1CbGjOOh1/V wVo6ZR+p+T+Fw2kdRr98kIkvWhjBkBrjPTju7zRzCb5OQAi+m58mMIRZipmahYI1HJRb vzR2M/ft64FE/051XDf2BgkXjYqErmKKpZX1+K7qv7YcG3li2LVm8oUFSZ0lIxqY0BVp qO2uNS3N6L8P8BrVLvaJ/VytH/BBu8C5b+pd4o1LPOEM8Fbx8Y3O7KQJpAQNZjqUKYVD hrrhUqvINOVaVs6hp0w04qjpTKkTjr82iZloS1w4l9ddIXbLKzboQY55tzo36EuJIEEQ o+Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=PofKU5fYnxxOMgDa7t33J+cuJBqENnTThP7WGOHCZv0=; b=XdgLPNFRlJlEzxfHztQ3iuHzsXkvkFXlmc9Urreeu//QC5jqEBFo5o1sSrfOa2T4hP +5gotf1vNbbO4DiatFmed6+pT6mkMebfY+uDDyCMn6RVQMeju52IcHqLaiA8yoYHZmwb JAKpFXTgzdgY3cunQ4m1QI0uCgfkiuIYNRyeRY1udtTuTJH8TBnqaOvv6daBLCYhD5ux wrLtMgmdPW7uKNSGJrXSmS14Mg68t0RtDR2MBeMM76Xa9Ge+GYG65zNiF0sXCgWzMCmR nVDmazTd61SaPrBTuLvflaPNnB/tpaUKgZcf7kHt7Hayieg3YiA1YaX59Jp/1GDInFPr KW2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ragnatech-se.20150623.gappssmtp.com header.s=20150623 header.b=cWKXRDEg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j11si7831778edj.481.2021.03.08.04.08.01; Mon, 08 Mar 2021 04:08:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ragnatech-se.20150623.gappssmtp.com header.s=20150623 header.b=cWKXRDEg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231735AbhCHMFF (ORCPT + 99 others); Mon, 8 Mar 2021 07:05:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231659AbhCHMEp (ORCPT ); Mon, 8 Mar 2021 07:04:45 -0500 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA3E8C06175F for ; Mon, 8 Mar 2021 04:04:44 -0800 (PST) Received: by mail-lj1-x236.google.com with SMTP id u4so15742203ljh.6 for ; Mon, 08 Mar 2021 04:04:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech-se.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=PofKU5fYnxxOMgDa7t33J+cuJBqENnTThP7WGOHCZv0=; b=cWKXRDEg9DF0vSw0nmIT+Q3dQhbsxAYl9CH/93CahPPQg3c1sF9wfhPuVbcoA+W9zN 5zLqENvPWNDHihvL5Yrn+qyIVgtABZlt13RUT0I/Bo40CqW04XCi8F44+u57qWpehevv feecPzQX/SEqFX74RLyVVwaG/xjShciCDfTnLf9yDm7jq7yeIOJCyfZkc9mjQ6/2jKDg 8uYqxeslEtmflGwBRQuob2nmKrPP2oXC6k87K5+7Ow498/lruUqduP5KTV2SKN8uP6+A lKics7ODvAzuGOQ08WwRNlY2zv4GTfxhgr1KB5VS1dKp3PC52CZhb+2DUMwtY55uzk5X DAWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=PofKU5fYnxxOMgDa7t33J+cuJBqENnTThP7WGOHCZv0=; b=gkMrJrr+hNzZnAfwxcaHVS3bvccUE3Twt9zGDoqY+s+H4yXaQdYONB67XxoCuUFRDA xaVO0iIVBlsPCd1W/CnqkxtwYol/OJI4WKNBlDLMaG9zTuDmqhvfiCw6YNTe8+cRAxCr ymijehgE6Im6mrX7/87KhCqidfob2vSxSL8/I7RwlzKgaGjs1xPzS3GfWx8SLYFcFv9+ hBb8rn0qCOK5mTamaeIEzsccnw0gajkzhfgIkB0iex1GQWBsZJr7cd6Z/rADINMidrx6 /am91NEa3uKImRwg/qUXAK8ibGJqIKVkAY1e8YnJXDnXTj97+p/Y5C1XVuqPX+uSx+nV U33g== X-Gm-Message-State: AOAM5314zdVvXcbpNGycu4plXDy0f6b389njAsrkK6s8lIazfTbAjFtr HSpz9w7+pCYLXkHRodtgsM9Haw== X-Received: by 2002:a2e:9098:: with SMTP id l24mr8532795ljg.150.1615205083214; Mon, 08 Mar 2021 04:04:43 -0800 (PST) Received: from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203]) by smtp.gmail.com with ESMTPSA id e30sm1330671lfc.261.2021.03.08.04.04.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 04:04:42 -0800 (PST) Date: Mon, 8 Mar 2021 13:04:41 +0100 From: Niklas =?iso-8859-1?Q?S=F6derlund?= To: Wolfram Sang Cc: linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Lezcano , Phong Hoang Subject: Re: [PATCH] clocksource: sh_cmt: use CMTOUT_IE only when supported Message-ID: References: <20210305132859.8208-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210305132859.8208-1-wsa+renesas@sang-engineering.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Wolfram, Thanks for your patch. On 2021-03-05 14:28:59 +0100, Wolfram Sang wrote: > CMTOUT_IE is only supported for older SoCs. Newer SoCs shall not set > this bit. So, add a version check. > > Reported-by: Phong Hoang > Signed-off-by: Wolfram Sang Reviewed-by: Niklas S?derlund > --- > > Confirmed with datasheets and could successfully repeat Niklas' CMT > tests on an R-Car M3N based Salvator-XS. > > drivers/clocksource/sh_cmt.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c > index c98f8851fd68..3b53c6cb1da9 100644 > --- a/drivers/clocksource/sh_cmt.c > +++ b/drivers/clocksource/sh_cmt.c > @@ -143,6 +143,7 @@ struct sh_cmt_device { > #define SH_CMT32_CMCSR_SSIE (1 << 10) > #define SH_CMT32_CMCSR_CMS (1 << 9) > #define SH_CMT32_CMCSR_CMM (1 << 8) > +/* CMTOUT_IE only for SH_CMT_32BIT and SH_CMT_48BIT */ > #define SH_CMT32_CMCSR_CMTOUT_IE (1 << 7) > #define SH_CMT32_CMCSR_CMR_NONE (0 << 4) > #define SH_CMT32_CMCSR_CMR_DMA (1 << 4) > @@ -339,8 +340,9 @@ static int sh_cmt_enable(struct sh_cmt_channel *ch) > sh_cmt_write_cmcsr(ch, SH_CMT16_CMCSR_CMIE | > SH_CMT16_CMCSR_CKS512); > } else { > - sh_cmt_write_cmcsr(ch, SH_CMT32_CMCSR_CMM | > - SH_CMT32_CMCSR_CMTOUT_IE | > + u32 cmtout = ch->cmt->info->model <= SH_CMT_48BIT ? > + SH_CMT32_CMCSR_CMTOUT_IE : 0; > + sh_cmt_write_cmcsr(ch, cmtout | SH_CMT32_CMCSR_CMM | > SH_CMT32_CMCSR_CMR_IRQ | > SH_CMT32_CMCSR_CKS_RCLK8); > } > -- > 2.29.2 > -- Regards, Niklas S?derlund