Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp221539pxv; Wed, 30 Jun 2021 04:11:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQTkbo8+c0EQcomP72GlP9vOe8pl8kuHcNg31z2CsvJ/qaQ7kjxlSK/zgCRMZkCysSjtUc X-Received: by 2002:aa7:d74d:: with SMTP id a13mr46660166eds.43.1625051489168; Wed, 30 Jun 2021 04:11:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625051489; cv=none; d=google.com; s=arc-20160816; b=pwx6xkctEc5LsZ8ExThA1tdgBrcrWMNUrWkzR0wEmZND0AGbpIFCz/QP1YTFRIirdl TRSkGbEbq+j5/kJsNORmAsVa2rOBAoikShxdNDeIgGikF2h6vEaA/jIwg/UztLIr4zl4 zzRnJVYz9N/1CFuckiFuX9NF0BtNvrdKEdJTgS95IOYqPl23CJkAv8QmjaATxwnYVH8C D1vMOKbwkdZkE5I8qHzPToSwoWnCoDZxAojwl43Feh+5sI0GaD+W37Mf/DA9nKqRkLXW xhF2TsrQ7ObD5AW6rAJVs0EDYhYaWq31As12+vR6BHoVMDtavaVPsmS12ehr/H7q8dSf PTwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Rm4+AwW3LWH2YQHGgTfNo9gJL+afdzfJtfRIoJfvAJc=; b=qwP3gkktmJkSuM4ZyW5L/ehaWCiiiuroog/wGVYOPGCoJgtwnvfHyffBwQ9sgTBBqd MuogP4AtD+Sj4uXY6HqE24fpQ1KPQIfABxxrHCInvab886NnRp5hBIyS8u5vjBmN+dCa Ftz5Em6ETJXvPRa3SNWTlg8PPfp49JOvNl4Eo2RSbOrOelYMMP3DpZBp9KMraRZ1Ybo6 eFiWU88YBbbeGoWmt9X8TpNK351h2x+fZrumCcBo4GEtLRppAE3eGiThP+kUm0ioDLV1 Ovdjq5jDa009rfe+xRybgapt4cdNKuUJPpgJbsx6MJFgVSYqTe76BjghJbgRopNRaCM0 qXsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IE4nSEae; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p12si20470412ejn.260.2021.06.30.04.11.03; Wed, 30 Jun 2021 04:11:29 -0700 (PDT) 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=@chromium.org header.s=google header.b=IE4nSEae; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229882AbhF3LMX (ORCPT + 99 others); Wed, 30 Jun 2021 07:12:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234148AbhF3LMW (ORCPT ); Wed, 30 Jun 2021 07:12:22 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65BB2C061767 for ; Wed, 30 Jun 2021 04:09:53 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id q4so2685315ljp.13 for ; Wed, 30 Jun 2021 04:09:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Rm4+AwW3LWH2YQHGgTfNo9gJL+afdzfJtfRIoJfvAJc=; b=IE4nSEae0+ZNPzwJoKlwld0IYMdDWkixjHhLI3tUBqdFmS+a6KK5cYvjzyrNiwZmdF Z0m6eXqZtwFMVuQd3GrlSzs2UcjhKOZHgP0a2+UvPrLvGf6REbtdTFZU1RZeiK+YMpi+ XfOkbN6NpLc+GUcqYnxdCqJta/t/pBzt1xKP0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Rm4+AwW3LWH2YQHGgTfNo9gJL+afdzfJtfRIoJfvAJc=; b=iWv3hPvJ/KK/AvaRwlGiHPkmtPD3PSbIP9QuOBdHhUBHmuQH6SVyUNkUI0v6S/JQwQ yRCiurX9isPncTI0sAbd8JXB71Av553P71hykAwSaa3Yii93dg8sq8U35XIVUO0xh67s 5D7oRXF/pUnO3WjOq0ojaPD1agqN7/GaICvvehdis3WmTBGPW3EWXbm8Fb7ty17zW9Fr xm1gXZMKzw8pWRfk8NCNIcN1EDmA8tMcJ1VtQ7dXGbEqcV/UIU4dFy0Q9n7nJ5SArnJi Nc8gzmEcvXAJtYlr64Cy8P7SqHuEVMW/Yb2KB1Pr2qP/e6/sOl8PBzRUNDLw8XgaR9rY Z7Lg== X-Gm-Message-State: AOAM533sSblxv7gjZAss7Uw7EWu9qvT7IcAJt+fJQRvl1ac/W8LqtqKq +539HwIOnt5R13XQp7EcJ49fZe4avsDbZ8mtBvwcAQ== X-Received: by 2002:a05:651c:32e:: with SMTP id b14mr7332089ljp.251.1625051391558; Wed, 30 Jun 2021 04:09:51 -0700 (PDT) MIME-Version: 1.0 References: <20210616224743.5109-1-chun-jie.chen@mediatek.com> <20210616224743.5109-4-chun-jie.chen@mediatek.com> In-Reply-To: From: Chen-Yu Tsai Date: Wed, 30 Jun 2021 19:09:40 +0800 Message-ID: Subject: Re: [PATCH 03/22] clk: mediatek: Fix corner case of tuner_en_reg To: Matthias Brugger Cc: Chun-Jie Chen , Stephen Boyd , Nicolas Boichat , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, srv_heupstream@mediatek.com, Project_Global_Chrome_Upstream_Group@mediatek.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 30, 2021 at 6:53 PM Matthias Brugger wrote: > > > > On 30/06/2021 09:31, Chen-Yu Tsai wrote: > > On Thu, Jun 17, 2021 at 7:01 AM Chun-Jie Chen > > wrote: > >> > >> On MT8195, tuner_en_reg is moved to register offest 0x0. > >> If we only judge by tuner_en_reg, it may lead to wrong address. > >> Add tuner_en_bit to the check condition. And it has been confirmed, > >> on all the MediaTek SoCs, bit0 of offset 0x0 is always occupied by > >> clock square control. > >> > >> Signed-off-by: Chun-Jie Chen > > > > Reviewed-by: Chen-Yu Tsai > > > > Though you might want to consider converting these types of checks into feature > > flags. > > > > Yes I think adding a feature flag is the way to go. Luckily there are only a few > SoCs that will need updates at the same time. I also see that the different clock modules are tied together using only clock names written in the drivers, instead of clock references in the device tree. Unfortunately reworking this would likely require a lot more work. I previously did a bit of internal reworking for the sunxi drivers. While not the same, I think the plumbing required is comparable. ChenYu