Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp95077rdh; Wed, 22 Nov 2023 20:08:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IH8JZfLEZokXcoPxJ44MTAsAHBuggydEtWdBGodzj8BjGERt0bsZsvBOMjOwwFk5Pbic7hp X-Received: by 2002:a17:90a:53a5:b0:280:3a0c:bf73 with SMTP id y34-20020a17090a53a500b002803a0cbf73mr4450647pjh.26.1700712531619; Wed, 22 Nov 2023 20:08:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700712531; cv=none; d=google.com; s=arc-20160816; b=pP23vhjP/W5mLZ0graaaOiVVF/kPf2e9chzSfMrVKA3R3f7RUH+XqNWXxjp46GqwlJ SK36Ywvrl06n2yrtmfWkljfPPXfkWwA7JDJBlB9EVtySslL9/uH+QfbbSLzVOCfUGJia 7fA//yaDtJ3bl3Ol/xZjRk5xyn4DTvx7lhY+xLSbtqxtZ/SHss/mHys58dCwko1qmzxl hWZKAp8nstLX/48D+cAfoX+FSPkmU9kbOFtcmj/QYN+4PrBbhuNONLLjoZk7CCBeR9Bx 7D8dNk/HKA79c8G4d3PIz931TcyHm1PpTs6+FMYJn2rLAfhNh4OxwQCJQ8tQQS5XHhTh SCKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=uB5imdoPod8S9hEhNPZ14DUI1/eZZtU6LRuwv6Kh2nc=; fh=Eyp5Opbel7Qm1PsWR+D6bCeI+uGBCu7wJJ6zJCqIHLk=; b=PH8+1ozWxd4xeaIeZ6X21w+DfvA0dt/cTfzGpso6RjflqEKMvJoJAqkLnvlSQH7uc2 s3zaiZHApSjx7042vGWI7qoNkZdSzM5gbAxUWg1eddwGeVgvdljxzL2weZCnVY+LuKZl E4uvNpuIymgRP+sGp4nt0teTzYL2+f/hLMnKYGO+YSR+TV7m22qczd+5AZnvPbN/XX7K a6mYSzWUhcUV9P5nq4D/vJYsKK1kduee3ddAuvN3Nv5h7wWiiDLUPNbHMdjO7WjyyWJL ybmrJBX11sgV6p6E8/cAEcQXEShtE4D8LGFabuj4rb6wLqFlbWgvxpibuWH+8AyfUlje Gydg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=POwUu8GZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id ga5-20020a17090b038500b00273f1cd73b2si516829pjb.75.2023.11.22.20.08.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 20:08:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=POwUu8GZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 494F58342FF4; Wed, 22 Nov 2023 20:08:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234719AbjKWEIf (ORCPT + 99 others); Wed, 22 Nov 2023 23:08:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235218AbjKWEIR (ORCPT ); Wed, 22 Nov 2023 23:08:17 -0500 Received: from mail-vk1-xa35.google.com (mail-vk1-xa35.google.com [IPv6:2607:f8b0:4864:20::a35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C58891722 for ; Wed, 22 Nov 2023 20:06:00 -0800 (PST) Received: by mail-vk1-xa35.google.com with SMTP id 71dfb90a1353d-4ac4cd60370so141837e0c.3 for ; Wed, 22 Nov 2023 20:06:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1700712351; x=1701317151; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=uB5imdoPod8S9hEhNPZ14DUI1/eZZtU6LRuwv6Kh2nc=; b=POwUu8GZxKXJnLLlAm1XaQIkh9GYni4F4BzkP8ugLdCJL2QH5kwfXtQH2jHLmA4tw6 OSj7RSA/tcf1q7tQQpj8zBjm9IngVMO5FFlIgl9hPWIa8P3Vz6/cHuHAo91q8nlHf716 FuqaG4zEpUw8tWHpOpJaZ9AY9GVc8iAEB3LLE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700712351; x=1701317151; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uB5imdoPod8S9hEhNPZ14DUI1/eZZtU6LRuwv6Kh2nc=; b=kqVEyzd/eMkzAv0hUSmpUEcVhbGmNcdguzP4XQOnqiRfPMBeyXIOSI1Kaqhau2WXil UXM8P5Hlc22lOTiHmhmv3a9Klsx6d1QzV8e7YD416uyxqjT5e2VeXrCqIVdiG5zTRmje 2atqOMBQRNSDCP3/p4VlhkCZTWzrbjNevADnE3BySfSjmgtIxHxZP2/iq+oxQem6o/wz 0Cf+EiSTjIaUbbEI4JKziy+scLifCiy/TkeXUzVcHU8Oy0BUU3Z3FG94/wYIWhN4c/Du ZgR3HSWV3arxbrKs30GGq43qldD6gM+Pa7eJabZ5JapsFwNqdb7kJBr5pLaHVJ0+geUb MVFg== X-Gm-Message-State: AOJu0YyiVc9OL1eDSGSgBv/f8/3WBAt5Q0zcZUB8z22HymRHqMOOyhG+ oh3erZgDpEXoN5R/aEPOgC2ak0q1F4SR16qMv6Qisg== X-Received: by 2002:a1f:49c3:0:b0:496:2e22:29e3 with SMTP id w186-20020a1f49c3000000b004962e2229e3mr3989815vka.1.1700712351259; Wed, 22 Nov 2023 20:05:51 -0800 (PST) Received: from mail-vs1-f51.google.com (mail-vs1-f51.google.com. [209.85.217.51]) by smtp.gmail.com with ESMTPSA id j188-20020a1f6ec5000000b004a8e99b9f45sm131960vkc.45.2023.11.22.20.05.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Nov 2023 20:05:50 -0800 (PST) Received: by mail-vs1-f51.google.com with SMTP id ada2fe7eead31-45da9180517so137750137.3 for ; Wed, 22 Nov 2023 20:05:49 -0800 (PST) X-Received: by 2002:a05:6102:1285:b0:462:a479:79fd with SMTP id jc5-20020a056102128500b00462a47979fdmr4441694vsb.23.1700712349221; Wed, 22 Nov 2023 20:05:49 -0800 (PST) MIME-Version: 1.0 References: <20231103102533.69280-1-angelogioacchino.delregno@collabora.com> <20231103102533.69280-4-angelogioacchino.delregno@collabora.com> In-Reply-To: <20231103102533.69280-4-angelogioacchino.delregno@collabora.com> From: Fei Shao Date: Thu, 23 Nov 2023 12:05:13 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 3/3] clk: mediatek: mt8188-topckgen: Refactor parents for top_dp/edp muxes To: AngeloGioacchino Del Regno Cc: sboyd@kernel.org, mturquette@baylibre.com, matthias.bgg@gmail.com, wenst@chromium.org, msp@baylibre.com, amergnat@baylibre.com, yangyingliang@huawei.com, u.kleine-koenig@pengutronix.de, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Wed, 22 Nov 2023 20:08:49 -0800 (PST) On Fri, Nov 3, 2023 at 6:25=E2=80=AFPM AngeloGioacchino Del Regno wrote: > > The top_dp and top_edp muxes can be both parented to either TVDPLL1 > or TVDPLL2, two identically specced PLLs for the specific purpose of > giving out pixel clock: this becomes a problem when the MediaTek > DisplayPort Interface (DPI) driver tries to set the pixel clock rate. > > In the usecase of two simultaneous outputs (using two controllers), > it was seen that one of the displays would sometimes display garbled > output (if any at all) and this was because: > - top_edp was set to TVDPLL1, outputting X GHz > - top_dp was set to TVDPLL2, outputting Y GHz > - mtk_dpi calls clk_set_rate(top_edp, Z GHz) > - top_dp is switched to TVDPLL1 > - TVDPLL1 changes its rate, top_edp outputs the wrong rate. > - eDP display is garbled > > To solve this issue, remove all TVDPLL1 parents from `top_dp` and > all TVDPLL2 parents from `top_edp`, plus, necessarily switch both > clocks to use the new MUX_GATE_CLR_SET_UPD_INDEXED() macro to be > able to use the right bit index for the new parents list. > > Signed-off-by: AngeloGioacchino Del Regno Tested on MT8188 with a Type-C -> DP adapter to an extended display Gigabyte M32U. The DP output reacts smoothly to resolution switch and refresh rate change, and the internal eDP output also never freezes. Reviewed-by: Fei Shao Tested-by: Fei Shao