From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795998146; b=4gugEPQQLy0xBqJN+3eHyt9u/zlE7UHgNsfNq79AnZ8hyumHE7CY7NRzgzfoxshr1DfN ZSKssVcuiue+esDw16CxFEaplqnrJ3/yHhB2956u41y1e7CbSaDJOJ+hCu5n3IPwcKMdB Yj8/NMWdL4q3GEfmOGx0zowRdIYj+/Feg0Mw5hZ0AE3QjbOmMcEGZzbsrY9j0VHMmvugJ wtIVfNrMxGA+44FEgmDPyun36QmZu9DW4P4xd6vVvazPBLUF8JzpoWDwQmiVV/PFFe/PK mZXitrx2iSB16RuxT1XRRRXFr/nBIOVkRVcBAugypJrtls88bhJWySC2k2G/uZ7/mYg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795998146; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To: User-Agent; bh=+Icmp7UjmtmuNmUypxTj7Hy7BMvXLyS+ZSW9ONSmoHA=; b=39mLobgoBru2SqhdZqb6L8Y50+EPTCTRatB8HwYAoYu76ZBhltc7YFEs15eHfUgJj+Qu lvx/YxCb/sVVw0FnKimHFtmiqTfTIZhKsr9tZaOw1Goh+PXgLJfRrnwjeY5J9r5ryYhqA CLtooVaGyUzt15zp0ESu2RsfOlvmQnA7xIogcibap+wQrsrhAybRbvyscIwq6kQYUTwAF L+S4Swwt8NZbscugkFeUOcA6XLEpj+89MU1ogLz7lKzCBlfORIUn5MChu6rZtMhwKA7Ex z+PoU+KOARsPMSzLz0fAlNzx8tjCRb19x+Rn1W0pGAewHLOPu7xWruyORqkM5KA5QMQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="b/j9S3YR"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DFAE606A31C for ; Mon, 30 Nov 2026 00:22:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=b/j9S3YR Received: by smtp.kernel.org (Postfix) with ESMTPSA id 597FC1F008A0; Mon, 30 Nov 2026 00:22:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795998146; bh=+Icmp7UjmtmuNmUypxTj7Hy7BMvXLyS+ZSW9ONSmoHA=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=b/j9S3YRjkehefcXuGVt24sW5pmRanwZSTdGlCLi924eeHMU9fJuVxkVlWHk5Rd8j cRJphkuFiWBkGB8UWOqTPuB5m+PpW4qWbfNpOZkXgVfgm9pUM4EPcMyT51W4d+TQ9A fY8CJaZItvc1eXqSuJoHMUGdg5ybsLJ48ySpfCRDuThFk4TIjGd93HyUkyguTnRiE6 ThEKUwpmCDilcGBuVIkUu+7FjqWKiqcOs8KhfBP/iAIMX2IKxG03GyAHC9BLhbks9O xeMcesS0hbrn+lO2ZAir+eIalRxYl7YV8PCqlfuEuhWJwGtrQKdertxzmYnMRLZzoC 4zhdgIFUr9cUA== Date: Sun, 29 Nov 2026 19:22:24 -0500 From: Brian Masney To: Christian Marangi Cc: Stephen Boyd , Brian Masney , Jerome Brunet , linux-clk@vger.kernel.org Subject: Re: [PATCH v8 2/2] clk: en7523: add support for .set_rate for en7581 Message-ID: References: <20261121215918.183705-1-ansuelsmth@gmail.com> <20261121215918.183705-3-ansuelsmth@gmail.com> <179599743683.206543.380687323566580404.b4-review@b4> <6b0cc0a2.202ed97a.2b44d3.211f@mx.google.com> X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6b0cc0a2.202ed97a.2b44d3.211f@mx.google.com> User-Agent: Mutt/2.4.3 (2026-10-09) On Mon, Nov 30, 2026 at 01:17:36AM +0100, Christian Marangi wrote: > On Sun, Nov 29, 2026 at 07:10:36PM -0500, Brian Masney wrote: > > Is there a case where the register can be 0? Should there be this entry > > as well? > > > > { .val = 0, .div = 1 } > > > > BUS is special. val 0 is invalid and rejected by the HW. This was already > handled by the pre-div-api implementation. OK makes sense. Thanks for confirming. > > > static int en7523_pci_is_enabled(struct clk_hw *hw) > > > @@ -710,10 +775,18 @@ static void en7523_register_clocks(struct device *dev, struct clk_hw_onecell_dat > > > const struct en_clk_desc *desc = &en7523_base_clks[i]; > > > u32 reg = desc->div_reg ? desc->div_reg : desc->base_reg; > > > u32 val = readl(base + desc->base_reg); > > > + u32 div; > > > > > > rate = en7523_get_base_rate(desc, val); > > > + > > > val = readl(base + reg); > > > - rate /= en7523_get_div(desc, val); > > > + if (desc->div_bits) { > > > + div = en7523_get_div(desc, val); > > > + if (!div) > > > + continue; > > > > Should there be some kind of log message here? > > > > dbg or err? Since this is called in the setup via probe, dev_err. > > > +static void en7581_find_best_rate(struct clk_hw *hw, > > > + struct clk_rate_request *req, > > > + const struct en_clk_desc *desc, > > > + unsigned long parent_rate, > > > + unsigned long requested_rate, > > > + unsigned long *best_diff) > > > +{ > > > + struct clk_rate_request div_req = *req; > > > + int ret; > > > + > > > + if (!desc->div_bits) { > > > + en7581_update_best_rate(req, requested_rate, parent_rate, > > > + best_diff); > > > + return; > > > + } > > > + > > > + /* Treat each internal base rate as a fixed parent for the divider. */ > > > + div_req.rate = clamp(requested_rate, req->min_rate, req->max_rate); > > > + div_req.rate = min(div_req.rate, parent_rate); > > > > The min() here shouldn't be needed. When rate >= parent_rate, the > > smallest table divider is returned. > > > > Also just a heads up that I posted a guidelines file for the Common Clk > > Subsystem to the review prompts repo. It's not merged as of this > > writing, but Sashiko will start using this once it's merged. You can > > download the clk.md file and point your favorite $AI_AGENT at this > > review file before posting your next version. > > > > https://github.com/masoncl/review-prompts/pull/123 > > > > This was something that sashiko pointed out... the min is needed to prevent > a div by zero. The previous revision pointed out this. OK that's fine. It's harmless. > Since you requested these changes, I should merge these changes with the > 7583 series correct? Yes please since it depends on the set_rate() changes. Brian