Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp269828rdh; Thu, 26 Oct 2023 01:25:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1Gv46mjg3O54lF+PLmhO7nyJbnQRNAxQV2sLngy9pCv1e8dHBKew2q/7kzLYiKlZAyxuk X-Received: by 2002:a81:ab4e:0:b0:59b:cfe1:bcf1 with SMTP id d14-20020a81ab4e000000b0059bcfe1bcf1mr18079170ywk.44.1698308711487; Thu, 26 Oct 2023 01:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698308711; cv=none; d=google.com; s=arc-20160816; b=xCMnlKOBahlVjn48YMXsjcibzlx/tYxjELi0N1wFVgFIYpzJX2cskjlXkqNWMCfsNC BaeZGQ/SRTMs0aamjLMR2RXcJ4LGtr8Hp6FfDjfjRYwXanRZoervIdykAz/idfnQ3sEk cUtU0z/JRe7Q5TPznr01tvNrlSCEWfwqNIACaLE9yYBhe2GrOLxHVthDC6x7VswAhOdh i50AgFh0Nhy1Le9FtZZp8Cqn3M0qpJ67Z4TE6UoPQPfelybjJzLdAkptys2naATMxlbL HkzvOTOMOkaQAJVpKRzkE09bmQCeUB0GIipysAKPZElGEt/4F6x4WOFMtsEZ6rEfra57 qHwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Tpflp7nolFCRkF6qs8WLhfgANMxdKFrl9BlFaj/VsGA=; fh=wMvklDV4CjnfRVCoGVYHwbWu4UsSgCgY5vd8mXt4/LU=; b=PqIOXNifjWyg/K1HfXwMFXKfCCj9nCVj4tf+4O1lchIfwh1wuOZsJmhgbSjnHwbc1C 6Hl/G9B0LDkXIEId1R/a0brVhNyCPInSgxQG2EJCPxt98qn49rwZLqjPXPzYgE6QoI2n Y4I88CQJTv6Xml6YWSWkU9cWazzir0KINzx//EXBIoNQDhT/6826Lg+FO754GHMSyRRf QDUq/3qaUvRDBvwMFhuGfTqGXzSU/LtWF5Eykx7U/UWlU98bjCyU+Kw45KZedLWXOw5X 9cbD5jvbx9JNzrfusmYogEpaR1KHDplugZPDnw25cdAtY/dNei515lecXgmozuqYaVAs 1q4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=eNTBdOIM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id r4-20020a0de804000000b005a81a489448si12644150ywe.267.2023.10.26.01.25.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 01:25:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=eNTBdOIM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 5C3C181C0C0A; Thu, 26 Oct 2023 01:25:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229888AbjJZIYy (ORCPT + 99 others); Thu, 26 Oct 2023 04:24:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbjJZIYw (ORCPT ); Thu, 26 Oct 2023 04:24:52 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 803C8B8; Thu, 26 Oct 2023 01:24:50 -0700 (PDT) Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 991F6660737B; Thu, 26 Oct 2023 09:24:48 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698308689; bh=xFr+dcF//FmM0tUjLIKhS6D6UUL0Ug+PSZV1DwTl5/A=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=eNTBdOIMSW9ZNkW1K86v8hoE1kbJkzrak/LxbVXkK8x2H42pJzu0f8XO98dwr6x46 unD18Ed+z4bw+tq2jHMLrNwqyDUy4UMGl/K/yR8296Yg7NV7+LW5rZkytBYgZAengt XWYj508wsiPDvgZACKzoRJWfmtLDXAvb+HEDLSlOn6mGt3KL+3vrvF48qCmApBqqx1 ce5Q8KK4s3R58jhCcPH6kUeGGnF47uC1P3XMazItcQJwb/i+AFdk+xZMt8Xtc2AaP3 kdAdVC5lYWAkYKVJq5bXOo+lbx4Ud2mxpqq6edP5wP20RPQjFvmofUsIAXPDfDxHqP O0HK55irXi4pw== Message-ID: <32d51e40-5d9c-47dd-bb62-2ccc811ac6dc@collabora.com> Date: Thu, 26 Oct 2023 10:24:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] clk: mediatek: mt8186: Change I2C 4/5/6 ap clocks parent to infra Content-Language: en-US To: =?UTF-8?B?WXUtY2hhbmcgTGVlICjmnY7nprnnkosp?= , "wenst@chromium.org" Cc: "linux-kernel@vger.kernel.org" , "linux-mediatek@lists.infradead.org" , "mturquette@baylibre.com" , "u.kleine-koenig@pengutronix.de" , "sboyd@kernel.org" , "linux-arm-kernel@lists.infradead.org" , =?UTF-8?B?Q2h1bi1KaWUgQ2hlbiAo6Zmz5rWa5qGAKQ==?= , =?UTF-8?B?TWlsZXMgQ2hlbiAo6Zmz5rCR5qi6KQ==?= , "linux-clk@vger.kernel.org" , "matthias.bgg@gmail.com" References: <20231019124914.13545-1-angelogioacchino.delregno@collabora.com> <283d18028590d57025e5654d18b8b5b7.sboyd@kernel.org> <9c1e10b56db315e03daa3df5918cde844297c680.camel@mediatek.com> <1a734157709adc0cd85e084174bb4889301f1c1a.camel@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <1a734157709adc0cd85e084174bb4889301f1c1a.camel@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 26 Oct 2023 01:25:05 -0700 (PDT) Il 26/10/23 05:49, Yu-chang Lee (李禹璋) ha scritto: > On Wed, 2023-10-25 at 13:29 +0200, AngeloGioacchino Del Regno wrote: >> Il 25/10/23 11:50, Yu-chang Lee (李禹璋) ha scritto: >>> On Tue, 2023-10-24 at 17:20 +0800, Chen-Yu Tsai wrote: >>>> >>>> External email : Please do not click links or open attachments >>>> until >>>> you have verified the sender or the content. >>>> On Tue, Oct 24, 2023 at 3:47 PM Yu-chang Lee (李禹璋) >>>> wrote: >>>>> >>>>> On Tue, 2023-10-24 at 10:58 +0800, Chen-Yu Tsai wrote: >>>>>> On Tue, Oct 24, 2023 at 10:52 AM Stephen Boyd < >>>>>> sboyd@kernel.org> >>>>>> wrote: >>>>>>> >>>>>>> Quoting Chen-Yu Tsai (2023-10-19 22:06:35) >>>>>>>> On Thu, Oct 19, 2023 at 8:49 PM AngeloGioacchino Del >>>>>>>> Regno >>>>>>>> wrote: >>>>>>>>> >>>>>>>>> Fix the parenting of clocks >>>>>>>>> imp_iic_wrap_ap_clock_i2c{4-6}, >>>> >>>> as >>>>>>>>> those >>>>>>>>> are effectively parented to infra_ao_i2c{4-6} and not >>>>>>>>> to >>>> >>>> the >>>>>>>>> I2C_AP. >>>>>>>>> This permits the correct (and full) enablement and >>>> >>>> disablement >>>>>>>>> of the >>>>>>>>> I2C4, I2C5 and I2C6 bus clocks, satisfying the whole >>>>>>>>> clock >>>> >>>> tree >>>>>>>>> of >>>>>>>>> those. >>>>>>>>> >>>>>>>>> As an example, when requesting to enable >>>>>>>>> imp_iic_wrap_ap_clock_i2c4: >>>>>>>>> >>>>>>>>> Before: infra_ao_i2c_ap -> imp_iic_wrap_ap_clock_i2c4 >>>>>>>>> After: infra_ao_i2c_ap -> infra_ao_i2c4 -> >>>>>>>>> imp_iic_wrap_ap_clock_i2c4 >>>>>>>>> >>>>>>>>> Fixes: 66cd0b4b0ce5 ("clk: mediatek: Add MT8186 imp i2c >>>> >>>> wrapper >>>>>>>>> clock support") >>>>>>>>> Signed-off-by: AngeloGioacchino Del Regno < >>>>>>>>> angelogioacchino.delregno@collabora.com> >>>>>>>> >>>>>>>> I'm curious about what led to discovering this error? >>>>>>>> >>>>>>> >>>>>>> Is that an acked-by? >>>>>> >>>>>> MediaTek engineers are saying the original code already >>>>>> matches >>>> >>>> the >>>>>> documentation provided by their hardware engineers. I'm >>>>>> trying to >>>> >>>> get >>>>>> them to respond on the mailing list. >>>>>> >>>>>> ChenYu >>>>>> >>>>> >>>>> After checking with I2C clock hardware designer there is no >>>>> infra_ao_i2c{4-6} clock gate in between. And the clock document >>>>> at >>>> >>>> hand >>>>> aslo shows the same result. Generallly speaking, we would like >>>>> to >>>> >>>> keep >>>>> sw setting align with the hardware design document. I would >>>> >>>> recommand >>>>> not to change this part of code, but enable infra_ao_i2c{4-6} >>>>> prior >>>> >>>> to >>>>> the usage of imp_iic_wrap_ap_clock_i2c clock. >>>> >>>> Are infra_ao_i2c{4-6} actually used by the hardware? If so, for >>>> what >>>> purpose? >>> >>> According to hardware designer it servers no purpose. Just a legacy >>> of >>> previous design... >>> >>>> If it is actually needed by the hardware and it is not in the >>>> existing path, >>>> then it needs to be described in the device tree and handled by >>>> the >>>> driver. >>>> >>>> ChenYu >>> >>> After reviewing hardware design diagram, hardware designer >>> concludes >>> that the clock tree is indeed >>> >>> top_i2c -> infra_ao_i2c{4-6} >>> top_i2c -> infra_ao_i2c_ap -> imp_iic_wrap_ap_clock_i2c{4-6} >>> >>> so I think we should keep this clock relation unchanged. >>> >>> Thanks >>> YuChang >>> >> >> Can you please also expand on CLK_INFRA_AO_I2C{1,2,5}_ARBITER clocks? >> Is the I2C arbiter also legacy of previous designs? >> >> Please check [1], as I've sent a commit adding those in the >> devicetree. >> >> Thanks, >> Angelo >> >> [1]: >> > https://lore.kernel.org/all/20231020075540.15191-1-angelogioacchino.delregno@collabora.com/ > > According to Hardware designer this arbiter clock is also lagecy of > previous design and serve no function. And they are conneted to top_i2c > as well. > > top_i2c-> CLK_INFRA_AO_I2C{1,2,5}_ARBITER > > Also may I know the experiment that lead to the conclusion that you > need the ARBITER clock, and the clock tree is incorrect? I will bring > it back to discuss with our I2C owner. > I had lockups during boot and PM suspend/resume, plus, I was getting issues with losing trackpad functionality; adding the arbiter clocks fixed the issue. Regards, Angelo