From nobody Thu Oct 2 19:03:40 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36DB2274B23 for ; Fri, 12 Sep 2025 09:33:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757669624; cv=none; b=ZaSkQwxS2vy4gBIeaptnWDved0Nwu8Eh82G5Ch+zLEGyeNgGLWpi76R9mLb5D/XGbIUsa/bLSCgivmrTpBzyK64K9/5W/K84XUzC6sXNk2yTYDifhpIImKgFIxsm1GdLqjmd9WOW7v8BLwYo31WzzNPABsnX4l/dRIJNbHUWH4M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757669624; c=relaxed/simple; bh=ThV2GDf+/LOv1NEDMdhRUL9t0UR+uadCjoaNIrPg7vE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=KxqcW/jGZmRm9+RyEHFlTtJDZ5d6xZLQBfk0s+gGHm7V4S3s02wVFXtgj7P0rJeaefIK/0FVoZUUpcfiIt9hh3kxRAkzIdp52aXH4fZUDlHZneOMv1maO0pgfROl0TSsaDCIT50lY4xxulxgLQk7wczDUmxTq2+FRoMYKbEESFs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=DCmoRrsB; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="DCmoRrsB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1757669622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=kQVDDKQgSTG1ruil2Wq7UaDisPfJegPx5xURSkhlJks=; b=DCmoRrsBIY4WAHYvBIEij0OMZa3pf/WsKXBtDXFNI3g930nF2wRYic8tXpFVc+CJ3M1ZID 57gQAnzEoJRzv7qxevFYC1QN4bsD1qxH5ZT7FkZ2FRwmQx7xPJ6HPy+u8ZK4RX+uotx02N KbjWKiTq7P4IMogm42/cWskmjRcuzWU= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-541-OPgyGCHJMXqYrl47SGXYdQ-1; Fri, 12 Sep 2025 05:33:36 -0400 X-MC-Unique: OPgyGCHJMXqYrl47SGXYdQ-1 X-Mimecast-MFC-AGG-ID: OPgyGCHJMXqYrl47SGXYdQ_1757669615 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 60DB11956096; Fri, 12 Sep 2025 09:33:35 +0000 (UTC) Received: from p16v.luc.cera.cz (unknown [10.45.224.175]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AF8D830002CA; Fri, 12 Sep 2025 09:33:32 +0000 (UTC) From: Ivan Vecera To: netdev@vger.kernel.org Cc: Vadim Fedorenko , Arkadiusz Kubalewski , Jiri Pirko , Jakub Kicinski , linux-kernel@vger.kernel.org (open list) Subject: [PATCH net] dpll: fix clock quality level reporting Date: Fri, 12 Sep 2025 11:33:31 +0200 Message-ID: <20250912093331.862333-1-ivecera@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Arkadiusz Kubalewski --- 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) =3D { 0 }; const struct dpll_device_ops *ops =3D dpll_device_ops(dpll); - DECLARE_BITMAP(qls, DPLL_CLOCK_QUALITY_LEVEL_MAX) =3D { 0 }; enum dpll_clock_quality_level ql; int ret; =20 @@ -221,7 +221,7 @@ dpll_msg_add_clock_quality_level(struct sk_buff *msg, s= truct dpll_device *dpll, ret =3D 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; =20 --=20 2.49.1