From patchwork Tue Sep 20 11:41:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shravan Kumar Ramani X-Patchwork-Id: 1680005 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MX05P1znQz1yqC for ; Tue, 20 Sep 2022 21:42:17 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oabdj-0008A5-GZ; Tue, 20 Sep 2022 11:42:11 +0000 Received: from mail-il-dmz.mellanox.com ([193.47.165.129] helo=mellanox.co.il) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oabdh-00089E-MR for kernel-team@lists.ubuntu.com; Tue, 20 Sep 2022 11:42:09 +0000 Received: from Internal Mail-Server by MTLPINE1 (envelope-from shravankr@mellanox.com) with SMTP; 20 Sep 2022 14:42:00 +0300 Received: from bu-vnc02.mtbu.labs.mlnx (bu-vnc02.mtbu.labs.mlnx [10.15.2.65]) by mtbu-labmailer.labs.mlnx (8.14.4/8.14.4) with ESMTP id 28KBfwqw007934; Tue, 20 Sep 2022 07:41:59 -0400 Received: (from shravankr@localhost) by bu-vnc02.mtbu.labs.mlnx (8.14.7/8.13.8/Submit) id 28KBfweV027690; Tue, 20 Sep 2022 07:41:58 -0400 From: Shravan Kumar Ramani To: kernel-team@lists.ubuntu.com Subject: [SRU][F:linux-bluefield][PATCH v2 0/1] Bug fix for mlxbf-pmc Date: Tue, 20 Sep 2022 07:41:53 -0400 Message-Id: X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Shravan Kumar Ramani Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1989172 SRU Justification: [Impact] When the counters are not programmed to monitor any events, reading the "event" file results in the following error: cat: /sys/class/hwmon/hwmon0/smmu0/event0: Invalid argument This is misleading and instead needs to indicate that the counter is currently not enabled. [Fix] * First, skip the check for whether the counter is enabled when reading the event info. If the counter is not enabled, it should return 0, which is the default value when coming out of reset. * 0 is not a valid event in most blocks as per the respective event lists, so add a "Disable" event to all the event lists. [Test Case] Without the fix, reading any "event" file right after reset when the counters are not programmed should result in the following error: cat: /sys/class/hwmon/hwmon0/smmu0/event0: Invalid argument With the fix, it should instead print: 0x0: DISABLE [Regression Potential] Can be considered minimal Shravan Kumar Ramani (1): UBUNTU: SAUCE: mlxbf-pmc: Fix error when reading unprogrammed events drivers/platform/mellanox/mlxbf-pmc.c | 24 ++---------------------- drivers/platform/mellanox/mlxbf-pmc.h | 6 ++++++ 2 files changed, 8 insertions(+), 22 deletions(-) Acked-by: Tim Gardner Acked-by: Bartlomiej Zolnierkiewicz