Skip to content

Commit ff30c7e

Browse files
committed
dpll: fix clock quality level reporting
JIRA: https://issues.redhat.com/browse/RHEL-126529 Upstream commit(s): commit 70d9962 Author: Ivan Vecera <ivecera@redhat.com> Date: Fri Sep 12 11:33:31 2025 +0200 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: a1afb95 ("dpll: add clock quality level attribute and op") Signed-off-by: Ivan Vecera <ivecera@redhat.com> Reviewed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com> Link: https://patch.msgid.link/20250912093331.862333-1-ivecera@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Petr Oros <poros@redhat.com>
1 parent 590ff36 commit ff30c7e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/dpll/dpll_netlink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ static int
211211
dpll_msg_add_clock_quality_level(struct sk_buff *msg, struct dpll_device *dpll,
212212
struct netlink_ext_ack *extack)
213213
{
214+
DECLARE_BITMAP(qls, DPLL_CLOCK_QUALITY_LEVEL_MAX + 1) = { 0 };
214215
const struct dpll_device_ops *ops = dpll_device_ops(dpll);
215-
DECLARE_BITMAP(qls, DPLL_CLOCK_QUALITY_LEVEL_MAX) = { 0 };
216216
enum dpll_clock_quality_level ql;
217217
int ret;
218218

@@ -221,7 +221,7 @@ dpll_msg_add_clock_quality_level(struct sk_buff *msg, struct dpll_device *dpll,
221221
ret = ops->clock_quality_level_get(dpll, dpll_priv(dpll), qls, extack);
222222
if (ret)
223223
return ret;
224-
for_each_set_bit(ql, qls, DPLL_CLOCK_QUALITY_LEVEL_MAX)
224+
for_each_set_bit(ql, qls, DPLL_CLOCK_QUALITY_LEVEL_MAX + 1)
225225
if (nla_put_u32(msg, DPLL_A_CLOCK_QUALITY_LEVEL, ql))
226226
return -EMSGSIZE;
227227

0 commit comments

Comments
 (0)