From patchwork Sat Oct 16 10:50:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 12563579 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75BF3C433F5 for ; Sat, 16 Oct 2021 10:52:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 381506023F for ; Sat, 16 Oct 2021 10:52:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 381506023F Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=l67iBk9DWQIDD5/b94sx1JLo9bkO2mlalk55aez/5cI=; b=gF1ehNqFh5boLD gTfQqhMr3AGRGGzjiXQ82HZ1PBMTRhIAcTcix62LyEcHb2B/aXul4BXJ+Ru7Q9xAme87CfJRRkwn+ qY29tGTYpKN4ZZmmnRvbO9qrXDr80Y7ouujpKZ4DIBIz9rTtBglnX7Y8pIFf73HV1kZPJ4/sgkQgh jKyZ0x5ecz73CUSiNLuG8WZdTiBtDJOskSbMBaBz2Tlv531M2+9yzRjQRpQ96fbIHtWqhd9xwUC/V tfPbwQ9NPpXKhevbczI/7qq6WkXmG4xdsLwv/sLea21zNBjvBzSyOcJ9c1gJ5xmB6azfaIGmluBM9 HWM4ktm5srtPjdXjbgeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbhHH-00ANoa-Rn; Sat, 16 Oct 2021 10:51:00 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbhH4-00ANk5-7Y for linux-arm-kernel@lists.infradead.org; Sat, 16 Oct 2021 10:50:48 +0000 Received: by mail-wr1-x434.google.com with SMTP id e3so30700559wrc.11 for ; Sat, 16 Oct 2021 03:50:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mSTXmeX4sFrog+3nTR6inAdAdU/+pQPl/AxORL6OElA=; b=ip81vhs46kUsPTF1X/uzvoPnllvQY4CGnhpICvG9xvNO0HEyJt5O5c7pThjkqay2pf 0G1wBoMhUD4TwnlI91DD9DZfZCnmdphvAyObwm7YAH4Re2gboH5vOOvkBoC/8+DpE0fM VfWkQZvX7A9cmQ8xpy12x+vZNTwjvbKEP5ysldUUpSCfWvQ3ZlhmMdm2rdU3omANAySR MY3kl+QMHXtO625cZ1ebhoISMd1iVy2rlE0umeCxf6I6cdFfh76X7F3fVw9e56phhg3h jrQVCYCjQ8++NTV3u2cUsH5pJlW0E6OVVfsjjXxrrdPJsfqUtkFVqJbC+HqOI5Gp8KlB suRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mSTXmeX4sFrog+3nTR6inAdAdU/+pQPl/AxORL6OElA=; b=XaJJOOeX9SFDUnKNLY7THKLgaav2/AKCbf/tSW4M7/YmGxpGmnozWhzUAkKcMdb1zz 2PGRntlNsu2TgBsNEY8PnOlyW3PdTP3rtNdS34YQz9NI/NTYenQdMzzC0xnQxSV2OKNc dVjQsbjRFgfHiPK1u87woNbj2UopwnVu8zD/V8v/RGs9+w9IBcRXOSbPcytkW6vDXrMV P7I0VWWvT53cVtQVetnBczb6g7dHrpiEWtov+I2DnYfgkc7H2UFiE5EfIDBe5bY/1xCe nOnzOP59Wcu6NXORVL7q+d4bLWuRCeqYvM/7vIwdz6zIKHUx1FhUn4VyYwvhuSRnlQq6 yjEQ== X-Gm-Message-State: AOAM532Elq6pqM8MG9Ba03mmFgCY2PdCs9r67SSUgkGpFivwoAMHzOZB K8HWJjanqYa36F/q243m1uShzoqhPpg= X-Google-Smtp-Source: ABdhPJwQ+2KaoYY2Wd3UdDLl/jkJ9ImDKPLj7xga2DvjHIpZE8WohAHYurxp1GBBC/8rCS7Ul7yQrQ== X-Received: by 2002:a5d:6dae:: with SMTP id u14mr7848763wrs.46.1634381443635; Sat, 16 Oct 2021 03:50:43 -0700 (PDT) Received: from localhost.localdomain (dynamic-2a01-0c22-7b82-9800-f22f-74ff-fe21-0725.c22.pool.telefonica.de. [2a01:c22:7b82:9800:f22f:74ff:fe21:725]) by smtp.googlemail.com with ESMTPSA id d8sm7415796wrv.80.2021.10.16.03.50.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 03:50:43 -0700 (PDT) From: Martin Blumenstingl To: linux-clk@vger.kernel.org, sboyd@kernel.org Cc: linux-arm-kernel@lists.infradead.org, knaerzche@gmail.com, mturquette@baylibre.com, Martin Blumenstingl Subject: [PATCH clk-fixes v1 0/2] Fix clk-composite to support .determine_rate Date: Sat, 16 Oct 2021 12:50:20 +0200 Message-Id: <20211016105022.303413-1-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211016_035046_314326_E635F963 X-CRM114-Status: GOOD ( 11.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Alex reports [0] that commit 69a00fb3d69706 ("clk: divider: Implement and wire up .determine_rate by default") breaks Rockchip platforms because the parent is not considered anymore. This is because clk-composite skips the "best parent" selection when rate_ops.determine_rate is set. Above commit does this by adding clk_divider_ops.determine_rate by default (then the Rockchip platform drivers are using clk_divider_ops as rate_ops in clk-composite). With these two patches a revert of above commit is not needed anymore (which would result in a revert of five follow-up commits as well). Instead the first patch changes the order so clk_divider_ops which has both, .determine_rate and .round_rate are supported by clk-divider (again). The second patch makes clk-composite use (and even prefer) rate_ops.determine_rate when available. Special thanks to Alex for his patience and helping test these patches off-list (since I don't have any board with Rockchip SoC). At least the first patch should go into -fixes. [0] https://lore.kernel.org/linux-clk/4eb964ac-4fff-b59d-2660-2f84d8af5901@gmail.com/ Martin Blumenstingl (2): clk: composite: Also consider .determine_rate for rate + mux composites clk: composite: Use rate_ops.determine_rate when also a mux is available drivers/clk/clk-composite.c | 76 +++++++++++++++++++++++++------------ 1 file changed, 52 insertions(+), 24 deletions(-) Tested-by: Chen-Yu Tsai # on NanoPi M4B and M4V2