[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <11fbd6f4-0cab-48cb-83e8-f62adc0ed493@redhat.com>
Date: Sat, 13 Sep 2025 13:09:03 +0200
From: Ivan Vecera <ivecera@...hat.com>
To: Vadim Fedorenko <vadim.fedorenko@...ux.dev>, netdev@...r.kernel.org
Cc: Arkadiusz Kubalewski <arkadiusz.kubalewski@...el.com>,
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
On 12. 09. 25 9:37 odp., Vadim Fedorenko wrote:
> On 12.09.2025 10:33, Ivan Vecera wrote:
>> 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>
>> ---
>> 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 };
>
> I believe __DPLL_CLOCK_QUALITY_LEVEL_MAX should be used in both places
I don't think so. I consider __DPLL_CLOCK_QUALITY_LEVEL_MAX to be an
auxiliary value that should not be used directly.
But it would be possible to rename it to DPLL_CLOCK_QUALITY_LEVEL_COUNT
and use this.
Thoughts?
Ivan
Powered by blists - more mailing lists