Message ID | 20231211111441.3910083-1-andriy.shevchenko@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp6969037vqy; Mon, 11 Dec 2023 03:14:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IGy7lU5POfYQAtqTQysoByLfBOv9ogioKRDNYQMDx6JACY9HCse6Uk0s9ePiEdOwXVPNnUE X-Received: by 2002:a05:6a20:918b:b0:18b:6192:f91a with SMTP id v11-20020a056a20918b00b0018b6192f91amr1764743pzd.9.1702293296488; Mon, 11 Dec 2023 03:14:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702293296; cv=none; d=google.com; s=arc-20160816; b=1CGSJMl+MHpioVS9q+xQox7ugZEjFrzNtBV6XP4JAKy2oMf7GP5VslF5mGRlOWPrBw ZVQK3PvEJTQxanVUuNtMfSolHSDgLp5g9hquFW8FpjMd1TRyJz3uaYjiw2966c12gpF0 0KZIVMS6fn4VaLRbz1zVEGLkCaO5Q5NIUdlG96ZXVD/Vy9jBVaM+2w8ewqYXlZwdK1tE H1eCvrSV1udxrXlK0aNPDcHTHco+ZuXwzw89uJET1FLqGCQTAavdoX1IAsUcz77+ED9h WYcQagTeFdoUsAhnHRnvGuoJjyUWvuz3WKU3N+xn2pp/fdph39blT/4pqJSAvJ9oxwUs 4kxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Bq8mLpv41UgMR+UAdYZyeIFLIfMoqNR0nv3+aXB/hw4=; fh=fZQysClHm6iaxz5ruB5zgxcdW0EKzgo1z2MbxDg9Na4=; b=cjPI2rBVx9MRIekYatyVWwgjmdGeoctbtn4Nr9WR02TG1bGQjaF0twLwjt9Bhnupza CU5+TCe0sZndPl7HIyibiriFnoSvcG1gpVaravx3D//bcrpn6uYZjjYrQuO1cQgMxDoi EmE+q/+VTiVLG/4aNC453z38pODp4aGQF+p2Fx3CzB7h4I+ntNSVIZ6TUM35rgPWhRQH Z89g2TnMI+foRTXTtmECBkcb4IICtTWoZYjdFAQon0vLmyskD6mIaxWepCpaa3y4SPIh r9RSy2GR9U30Yx5WkyTgw/YuG74Qjc9Nabelzml5om4hQ/Wn8XZf5F5r13YSLH6ttWov bkcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kaGP9cs4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id c12-20020a056a000acc00b006ce66363ce0si5938100pfl.285.2023.12.11.03.14.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 03:14:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kaGP9cs4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 0A8B680A3086; Mon, 11 Dec 2023 03:14:54 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234701AbjLKLOo (ORCPT <rfc822;dexuan.linux@gmail.com> + 99 others); Mon, 11 Dec 2023 06:14:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234684AbjLKLOm (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 11 Dec 2023 06:14:42 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB4C9C5 for <linux-kernel@vger.kernel.org>; Mon, 11 Dec 2023 03:14:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702293289; x=1733829289; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=eR1sOFajwOwvIeX/GA/4ZbcY1VT8jr6eTmCY9IFcwD0=; b=kaGP9cs4yCUoY5shqJvKgQoFYlw4jwTK/bzSQPXQXQbn77adThBFMn3D NA5Lbqsd6rPdrPDCvIT5bXZUcStETJWQoIIcjdFFoDW3opyVUcWuwWXUr KIxuzfaIROaNuUMl6vHyoAxvwwX1J8U8TDs3Y9L9BAW4MpF1x44cDQXUT Yr1ML4UIFGwk01+pQGuQDEgro1QX5BxhjrL+gqYi/Lqn+P/4lWc4pgVhc 3apXTfSJnGyPkWDFRqEJGMG7AynmeEjTvCjWobEQ+VzNEkXjSU50e1IyW K1n2uIp1G8QdP5Cc8KRm1ev5Oy5DaW4/13GLx1l+1xVyAPp3QESXkZ4gq A==; X-IronPort-AV: E=McAfee;i="6600,9927,10920"; a="16184494" X-IronPort-AV: E=Sophos;i="6.04,267,1695711600"; d="scan'208";a="16184494" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 03:14:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10920"; a="863731670" X-IronPort-AV: E=Sophos;i="6.04,267,1695711600"; d="scan'208";a="863731670" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 11 Dec 2023 03:14:47 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 627E530D; Mon, 11 Dec 2023 13:14:46 +0200 (EET) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Lee Jones <lee@kernel.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, linux-kernel@vger.kernel.org Cc: Alex Vinarskis <alex.vinarskis@gmail.com> Subject: [PATCH v1 1/1] mfd: intel-lpss: Fix the fractional clock divider flags Date: Mon, 11 Dec 2023 13:14:41 +0200 Message-ID: <20231211111441.3910083-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 11 Dec 2023 03:14:54 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784983895795914720 X-GMAIL-MSGID: 1784983895795914720 |
Series |
[v1,1/1] mfd: intel-lpss: Fix the fractional clock divider flags
|
|
Commit Message
Andy Shevchenko
Dec. 11, 2023, 11:14 a.m. UTC
The conversion to CLK_FRAC_DIVIDER_POWER_OF_TWO_PS uses wrong flags
in the parameters and hence miscalculates the values in the clock
divider. Fix this by applying the flag to the proper parameter.
Fixes: 82f53f9ee577 ("clk: fractional-divider: Introduce POWER_OF_TWO_PS flag")
Reported-by: Alex Vinarskis <alex.vinarskis@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/mfd/intel-lpss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, 11 Dec 2023, Andy Shevchenko wrote: > The conversion to CLK_FRAC_DIVIDER_POWER_OF_TWO_PS uses wrong flags > in the parameters and hence miscalculates the values in the clock > divider. Fix this by applying the flag to the proper parameter. > > Fixes: 82f53f9ee577 ("clk: fractional-divider: Introduce POWER_OF_TWO_PS flag") > Reported-by: Alex Vinarskis <alex.vinarskis@gmail.com> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > --- > drivers/mfd/intel-lpss.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c > index 177915845ba2..eff423f7dd28 100644 > --- a/drivers/mfd/intel-lpss.c > +++ b/drivers/mfd/intel-lpss.c > @@ -309,8 +309,8 @@ static int intel_lpss_register_clock_divider(struct intel_lpss *lpss, > > snprintf(name, sizeof(name), "%s-div", devname); > tmp = clk_register_fractional_divider(NULL, name, __clk_get_name(tmp), > + 0, lpss->priv, 1, 15, 16, 15, > CLK_FRAC_DIVIDER_POWER_OF_TWO_PS, > - lpss->priv, 1, 15, 16, 15, 0, > NULL); What an ugly interface. Intel-only too, right? Have you also fixed this in: drivers/acpi/acpi_lpss.c > if (IS_ERR(tmp)) > return PTR_ERR(tmp); > -- > 2.43.0.rc1.1.gbec44491f096 >
On Wed, Dec 13, 2023 at 04:13:52PM +0000, Lee Jones wrote: > On Mon, 11 Dec 2023, Andy Shevchenko wrote: ... > > tmp = clk_register_fractional_divider(NULL, name, __clk_get_name(tmp), > > + 0, lpss->priv, 1, 15, 16, 15, > > CLK_FRAC_DIVIDER_POWER_OF_TWO_PS, > > - lpss->priv, 1, 15, 16, 15, 0, > > NULL); > > What an ugly interface. Intel-only too, right? Nope, de facto way how custom clocks are being introduced. See clk-provider.h for several similar APIs (that require an additional, custom, flags to be supplied). ... > Have you also fixed this in: drivers/acpi/acpi_lpss.c Already pending in Rafael's tree, yes.
On Wed, 13 Dec 2023, Andy Shevchenko wrote: > On Wed, Dec 13, 2023 at 04:13:52PM +0000, Lee Jones wrote: > > On Mon, 11 Dec 2023, Andy Shevchenko wrote: > > ... > > > > tmp = clk_register_fractional_divider(NULL, name, __clk_get_name(tmp), > > > + 0, lpss->priv, 1, 15, 16, 15, > > > CLK_FRAC_DIVIDER_POWER_OF_TWO_PS, > > > - lpss->priv, 1, 15, 16, 15, 0, > > > NULL); > > > > What an ugly interface. Intel-only too, right? > > Nope, de facto way how custom clocks are being introduced. > See clk-provider.h for several similar APIs (that require an > additional, custom, flags to be supplied). This call only has 2 call-sites, both Intel. Anyway, just checking to ensure both are being fixed-up.
On Mon, 11 Dec 2023 13:14:41 +0200, Andy Shevchenko wrote: > The conversion to CLK_FRAC_DIVIDER_POWER_OF_TWO_PS uses wrong flags > in the parameters and hence miscalculates the values in the clock > divider. Fix this by applying the flag to the proper parameter. > > Applied, thanks! [1/1] mfd: intel-lpss: Fix the fractional clock divider flags commit: 03d790f04fb2507173913cad9c213272ac983a60 -- Lee Jones [李琼斯]
On Wed, Dec 13, 2023 at 04:18:54PM +0000, Lee Jones wrote: > On Wed, 13 Dec 2023, Andy Shevchenko wrote: > > On Wed, Dec 13, 2023 at 04:13:52PM +0000, Lee Jones wrote: > > > On Mon, 11 Dec 2023, Andy Shevchenko wrote: ... > > > > tmp = clk_register_fractional_divider(NULL, name, __clk_get_name(tmp), > > > > + 0, lpss->priv, 1, 15, 16, 15, > > > > CLK_FRAC_DIVIDER_POWER_OF_TWO_PS, > > > > - lpss->priv, 1, 15, 16, 15, 0, > > > > NULL); > > > > > > What an ugly interface. Intel-only too, right? > > > > Nope, de facto way how custom clocks are being introduced. > > See clk-provider.h for several similar APIs (that require an > > additional, custom, flags to be supplied). > > This call only has 2 call-sites, both Intel. Yes, but the clock fractional divider is used wider. And again, it's not related to Intel, as this how clock framework does the custom clocks. I don't know how to say this clearer. Whatever, thank you for review and applying this fix!
On Wed, 13 Dec 2023, Andy Shevchenko wrote: > On Wed, Dec 13, 2023 at 04:18:54PM +0000, Lee Jones wrote: > > On Wed, 13 Dec 2023, Andy Shevchenko wrote: > > > On Wed, Dec 13, 2023 at 04:13:52PM +0000, Lee Jones wrote: > > > > On Mon, 11 Dec 2023, Andy Shevchenko wrote: > > ... > > > > > > tmp = clk_register_fractional_divider(NULL, name, __clk_get_name(tmp), > > > > > + 0, lpss->priv, 1, 15, 16, 15, > > > > > CLK_FRAC_DIVIDER_POWER_OF_TWO_PS, > > > > > - lpss->priv, 1, 15, 16, 15, 0, > > > > > NULL); > > > > > > > > What an ugly interface. Intel-only too, right? > > > > > > Nope, de facto way how custom clocks are being introduced. > > > See clk-provider.h for several similar APIs (that require an > > > additional, custom, flags to be supplied). > > > > This call only has 2 call-sites, both Intel. > > Yes, but the clock fractional divider is used wider. > > And again, it's not related to Intel, as this how clock framework > does the custom clocks. I don't know how to say this clearer. I'm not sure how you can say that. Intel were the authors, hold the _only_ copyright and are the _only_ users. If it were to be removed, there is only a single entity that would even notice. Anyway, it was just a passing comment. Not positive, not negative.
On Wed, Dec 13, 2023 at 05:46:05PM +0000, Lee Jones wrote: > On Wed, 13 Dec 2023, Andy Shevchenko wrote: > > On Wed, Dec 13, 2023 at 04:18:54PM +0000, Lee Jones wrote: > > > On Wed, 13 Dec 2023, Andy Shevchenko wrote: > > > > On Wed, Dec 13, 2023 at 04:13:52PM +0000, Lee Jones wrote: > > > > > On Mon, 11 Dec 2023, Andy Shevchenko wrote: ... > > > > > > tmp = clk_register_fractional_divider(NULL, name, __clk_get_name(tmp), > > > > > > + 0, lpss->priv, 1, 15, 16, 15, > > > > > > CLK_FRAC_DIVIDER_POWER_OF_TWO_PS, > > > > > > - lpss->priv, 1, 15, 16, 15, 0, > > > > > > NULL); > > > > > > > > > > What an ugly interface. Intel-only too, right? > > > > > > > > Nope, de facto way how custom clocks are being introduced. > > > > See clk-provider.h for several similar APIs (that require an > > > > additional, custom, flags to be supplied). > > > > > > This call only has 2 call-sites, both Intel. > > > > Yes, but the clock fractional divider is used wider. > > > > And again, it's not related to Intel, as this how clock framework > > does the custom clocks. I don't know how to say this clearer. > > I'm not sure how you can say that. Intel were the authors, hold the > _only_ copyright and are the _only_ users. If it were to be removed, > there is only a single entity that would even notice. _This_ API is indeed used by only Intel code right now, but the _design_ of the API is dictated by CCF, and not anyhow related to Intel. > Anyway, it was just a passing comment. Not positive, not negative. Okay!
diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c index 177915845ba2..eff423f7dd28 100644 --- a/drivers/mfd/intel-lpss.c +++ b/drivers/mfd/intel-lpss.c @@ -309,8 +309,8 @@ static int intel_lpss_register_clock_divider(struct intel_lpss *lpss, snprintf(name, sizeof(name), "%s-div", devname); tmp = clk_register_fractional_divider(NULL, name, __clk_get_name(tmp), + 0, lpss->priv, 1, 15, 16, 15, CLK_FRAC_DIVIDER_POWER_OF_TWO_PS, - lpss->priv, 1, 15, 16, 15, 0, NULL); if (IS_ERR(tmp)) return PTR_ERR(tmp);