[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <SJ2PR11MB8452F78722D682E12C2F4C239B08A@SJ2PR11MB8452.namprd11.prod.outlook.com>
Date: Fri, 12 Sep 2025 10:51:58 +0000
From: "Kubalewski, Arkadiusz" <arkadiusz.kubalewski@...el.com>
To: "Vecera, Ivan" <ivecera@...hat.com>, "netdev@...r.kernel.org"
<netdev@...r.kernel.org>
CC: Vadim Fedorenko <vadim.fedorenko@...ux.dev>, Jiri Pirko
<jiri@...nulli.us>, Jakub Kicinski <kuba@...nel.org>, open list
<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH net] dpll: fix clock quality level reporting
>From: Ivan Vecera <ivecera@...hat.com>
>Sent: Friday, September 12, 2025 11:34 AM
>To: netdev@...r.kernel.org
>Cc: Vadim Fedorenko <vadim.fedorenko@...ux.dev>; Kubalewski, Arkadiusz
><arkadiusz.kubalewski@...el.com>; Jiri Pirko <jiri@...nulli.us>; Jakub
>Kicinski <kuba@...nel.org>; open list <linux-kernel@...r.kernel.org>
>Subject: [PATCH net] dpll: fix clock quality level reporting
>
>The DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_EPRC is not reported via netlink due
>to bug in dpll_msg_add_clock_quality_level(). The usage of
>DPLL_CLOCK_QUALITY_LEVEL_MAX for both DECLARE_BITMAP() and
>for_each_set_bit() is not correct because these macros requires bitmap size
>and not the highest valid bit in the bitmap.
>
>Use correct bitmap size to fix this issue.
>
>Fixes: a1afb959add1 ("dpll: add clock quality level attribute and op")
>Signed-off-by: Ivan Vecera <ivecera@...hat.com>
LGTM,
Thanks!
Reviewed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@...el.com>
>---
> drivers/dpll/dpll_netlink.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/dpll/dpll_netlink.c b/drivers/dpll/dpll_netlink.c
>index 036f21cac0a9..0a852011653c 100644
>--- a/drivers/dpll/dpll_netlink.c
>+++ b/drivers/dpll/dpll_netlink.c
>@@ -211,8 +211,8 @@ static int
> dpll_msg_add_clock_quality_level(struct sk_buff *msg, struct dpll_device
>*dpll,
> struct netlink_ext_ack *extack)
> {
>+ DECLARE_BITMAP(qls, DPLL_CLOCK_QUALITY_LEVEL_MAX + 1) = { 0 };
> const struct dpll_device_ops *ops = dpll_device_ops(dpll);
>- DECLARE_BITMAP(qls, DPLL_CLOCK_QUALITY_LEVEL_MAX) = { 0 };
> enum dpll_clock_quality_level ql;
> int ret;
>
>@@ -221,7 +221,7 @@ dpll_msg_add_clock_quality_level(struct sk_buff *msg,
>struct dpll_device *dpll,
> ret = ops->clock_quality_level_get(dpll, dpll_priv(dpll), qls,
>extack);
> if (ret)
> return ret;
>- for_each_set_bit(ql, qls, DPLL_CLOCK_QUALITY_LEVEL_MAX)
>+ for_each_set_bit(ql, qls, DPLL_CLOCK_QUALITY_LEVEL_MAX + 1)
> if (nla_put_u32(msg, DPLL_A_CLOCK_QUALITY_LEVEL, ql))
> return -EMSGSIZE;
>
>--
>2.49.1
Powered by blists - more mailing lists