From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vs1-f97.google.com (mail-vs1-f97.google.com [209.85.217.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F1D3B2DC355 for ; Thu, 29 Jan 2026 16:01:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.97 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769702506; cv=none; b=kauXNQzh7mBFSIjS6rLdfkKcC1jpHkyHtZOnLu3F9rw+lVbMAi6b/RI4nIdkfnxwusEzWj2ODVWLUYO03oLp6lVGaeUGNrUjjoI6RMAdzZ0Zp6sX0s6gMJp3Bo1sAezC0mZdfVYVE6tbcboVP79fcu24kTZ/ZfmTjzcjrTXhlEo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769702506; c=relaxed/simple; bh=hH5728uDk8AXkc3UpLs4+JWmWFxzxsiblhBAQIayRyY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Xu33a2KBZaBBdOjg0XTknWfIkKbRwGzvTYEpzEpb/byGAdvZ5+iiP9FoJBxebcb8QrkmOyN0qDF2DiKkuKc9EAJQKKGzV741zRrwy0NkgntWMIkfy8sczLVCBi+br/H7qRV5klACO+CyEK97i9iHN/N9p/Y4GIuGXjbbk/StINI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=ePxOA9Tc; arc=none smtp.client-ip=209.85.217.97 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="ePxOA9Tc" Received: by mail-vs1-f97.google.com with SMTP id ada2fe7eead31-5eae7bb8018so376113137.2 for ; Thu, 29 Jan 2026 08:01:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769702504; x=1770307304; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LKfl+myRIcjPIki/NHpbIDaluN05BXy50P3zELtmiFs=; b=gb01lGprS+GFytLa+uPnP1WJQMC3PL50blYDkMZdP6HMUd1LIc8R8j8lIx5rWmVt9H DAQEYGKl/gmm8TgsQ42zizxdvqbpFWEZTJA4ODLGksot2n4UJNOJpCXxmLH2tYk39LU3 vmYJJZwg3f25Xpccy/dk3fzP8UNIRiorTWV79mqeV78UAtbSwXlwzEnSZ6uSo02+7OyI Oy5qz4pGfhdjcT4vnu5eiKU9uQiVEttbnH1WsqldznUFWYzlqXA0rTBpH56yRJ9JD4IK tNtQcoJSI4GViD08IJCZDpDyJExic9U+cV8gWbjvyT5lYvS4U0bpiDgQVoGmkYcXDr4E VfVQ== X-Gm-Message-State: AOJu0Yz4mIYWejT3StebMGU/SrAePzDmuwL6xp1dpF91cWfNidAFJHbS LiukojfYxgGM93fLkx4X8z7DCronM9dQG3jNW9/Lslo21wIs6AEXB3m9quVqNkRGW2AhWIM3iIb s1qp0e/5gtPdcvUNB+vMI5Hn+Tpf/9YsPABq1GCYah7wlFWPrhcyqoK3TIBROQNsBOlJzIh7trI ru8W0qudc3PEFK4Goy8TdR/yEBlVUM1O4vFXElTYzj5VOv8PSKEKhFVO/p0WfiSHLpaZM39DHxN 5wOOvJaFjgr2Kdkm2A= X-Gm-Gg: AZuq6aJvk9BOsybcswunzxvk5d0biPZkvF81nx0dv8erxKl7i0/Q4RhFg9MHwHOIhvO hSIqQYRo6rFs/7LzlZ6rPwR6UcsA5RZJe1EKnE4P/0M4gRcdP6T+8oQbD/9OG6T3tBvpy/FkdJ+ emUPC7JVRU0bwJrh5WiuX3trfCe7fBtk25X+1ASpov7CIEnWm3NQcSHE+jPU4cFR1iY6qGn3TiE 4qCOV43aTIivfC6Sec3tEpKYtqGD6cHlzjJcpJGpt9J/ZQMprV99boLi/g2rK9NNp5oYplk/iNO qob/VfDaoLQ3VxvXbURlNccxNkoLQSq7sm83/uqtQIPZnSwazNkH0zX2gCTvrnVHQjmGIYLO8LS X2xz7ErxzjTjBXbms7Yd7OILuuFDxm97hqsHpo8JB+KCwthbynlwDBqupHc9DaeL7xT4cyyaFDp RFJ/MiT74Yf82qdjS5A52i5Z0IH4Lxyv+Z5E9hw/ilZQ== X-Received: by 2002:a05:6102:290e:b0:5ef:5387:ca85 with SMTP id ada2fe7eead31-5f7237d2386mr2630292137.39.1769702500421; Thu, 29 Jan 2026 08:01:40 -0800 (PST) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-0.dlp.protect.broadcom.com. [144.49.247.0]) by smtp-relay.gmail.com with ESMTPS id 6a1803df08f44-894d372eb64sm7258476d6.16.2026.01.29.08.01.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jan 2026 08:01:40 -0800 (PST) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2a0b7eb0a56so9549865ad.1 for ; Thu, 29 Jan 2026 08:01:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1769702499; x=1770307299; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=LKfl+myRIcjPIki/NHpbIDaluN05BXy50P3zELtmiFs=; b=ePxOA9TcDezI/z/DWKPeWxesioq9xYwS3HKAJOM0qkeAVm6+lzX89tS+Uvta5FOt4z o7tM/XCU/c4FRAidr2EXxFruJLQ0/Ikp719GPH8BU/vymNRah2f4EUr2315QjgtBCP9D t0rO6IuAm6zNE2dHgw/wAGQtdln4/5JPFCFYU= X-Received: by 2002:a17:903:2a8d:b0:2a7:bd4e:db92 with SMTP id d9443c01a7336-2a870e8bb9amr81192845ad.53.1769702498636; Thu, 29 Jan 2026 08:01:38 -0800 (PST) X-Received: by 2002:a17:903:2a8d:b0:2a7:bd4e:db92 with SMTP id d9443c01a7336-2a870e8bb9amr81192435ad.53.1769702497934; Thu, 29 Jan 2026 08:01:37 -0800 (PST) Received: from PC-MID-R740.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a88b4153efsm50354855ad.38.2026.01.29.08.01.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jan 2026 08:01:37 -0800 (PST) From: Pavan Chebbi To: jgg@ziepe.ca, michael.chan@broadcom.com Cc: linux-kernel@vger.kernel.org, dave.jiang@intel.com, saeedm@nvidia.com, Jonathan.Cameron@huawei.com, gospo@broadcom.com, selvin.xavier@broadcom.com, leon@kernel.org, kalesh-anakkur.purayil@broadcom.com, Pavan Chebbi Subject: [PATCH v3 fwctl 0/5] fwctl/bnxt_fwctl: fwctl for Broadcom Netxtreme devices Date: Thu, 29 Jan 2026 07:54:48 -0800 Message-Id: <20260129155453.3626544-1-pavan.chebbi@broadcom.com> X-Mailer: git-send-email 2.39.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-DetectorID-Processed: b00c1d49-9d2e-4205-b15f-d015386d3d5e Introducing bnxt_fwctl which follows along Jason's work [1]. It is an aux bus driver that enables fwctl for Broadcom NetXtreme 574xx, 575xx and 576xx series chipsets by using bnxt driver's capability to talk to devices' firmware. The first patch moves the ULP definitions to a common place inside include/linux/bnxt/. The second and third patches refactor and extend the existing bnxt aux bus functions to be able to add more than one auxiliary device. The last three patches create an additional bnxt aux device, add bnxt_fwctl, and the documentation. v3: Addressed Leon's comment on patch#2 to have the lock cover entire lifespan of the auxdevice, so that it is 100pc synchronized with auxdev removing. v2: Addressed Leon's comments as below: Patch #2: Converted atomic_t based aux device state handling to lock based functions. Drop passing 'err' to bnxt_ulp_start() Patch #4: Zero-initialized the fw rpc variable making unwind safer v1: Based on the feedback received on v5 here: https://lore.kernel.org/netdev/20251014081033.1175053-1-pavan.chebbi@broadcom.com/ , posting this series to fwctl tree. This series has the below changes from v5 that was posted to netdev: Patch #2: Addressed Leon's comment for defensive prograaming style for aux dev functions Patch #4: Removed support for commands that don't comply with fwctl guidelines. Also addressed additional comments from Jonathan Patch #5: Added info for example python3 program v5: Addressed the v4's review comments as below: Patch #2 and #3: Simplified aux bus device creation logic by having the core maintain arrays of pointers to aux devices and their contexts, thereby avoiding function calls from aux dev. [thanks Leon] Patch #4: Used memdup_user() as suggested by cocci. Addressed additional review comments from Jonathon and Dave. Collected Rb tags from Dave. v4: In patch #4, added the missing kfree on error for response buffer. Improved documentation in patch #5 based on comments from Dave. v3: Addressed the review comments as below Patch #1: Removed redundant common.h [thanks Saeed] Patch #2 and #3 merged into a single patch [thanks Jonathan] Patch #3: Addressed comments from Jonathan Patch #4 and #5: Addressed comments from Jonathan and Dave v2: In patch #5, fixed a sparse warning where a __le16 was degraded to an integer. Also addressed kdoc warnings for include/uapi/fwctl/bnxt.h in the same patch. [1] https://lore.kernel.org/netdev/0-v5-642aa0c94070+4447f-fwctl_jgg@nvidia.com/ The following are changes since commit 8dfce8991b95d8625d0a1d2896e42f93b9d7f68d: Merge tag 'pinctrl-v6.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl and are available in the git repository at: https://github.com/pavanchebbi/linux/tree/fwctl-bnxt-v3 Pavan Chebbi (5): fwctl/bnxt_en: Move common definitions to include/linux/bnxt/ fwctl/bnxt_en: Refactor aux bus functions to be more generic fwctl/bnxt_en: Create an aux device for fwctl fwctl/bnxt_fwctl: Add bnxt fwctl device fwctl/bnxt_fwctl: Add documentation entries .../userspace-api/fwctl/bnxt_fwctl.rst | 83 ++++ Documentation/userspace-api/fwctl/fwctl.rst | 1 + Documentation/userspace-api/fwctl/index.rst | 1 + MAINTAINERS | 6 + drivers/fwctl/Kconfig | 11 + drivers/fwctl/Makefile | 1 + drivers/fwctl/bnxt/Makefile | 4 + drivers/fwctl/bnxt/main.c | 416 ++++++++++++++++++ drivers/infiniband/hw/bnxt_re/debugfs.c | 2 +- drivers/infiniband/hw/bnxt_re/main.c | 2 +- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 2 +- drivers/infiniband/hw/bnxt_re/qplib_res.h | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 49 ++- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 19 +- .../net/ethernet/broadcom/bnxt/bnxt_devlink.c | 10 +- .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 4 +- .../net/ethernet/broadcom/bnxt/bnxt_sriov.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 349 +++++++++------ .../bnxt_ulp.h => include/linux/bnxt/ulp.h | 26 +- include/uapi/fwctl/bnxt.h | 64 +++ include/uapi/fwctl/fwctl.h | 1 + 21 files changed, 879 insertions(+), 176 deletions(-) create mode 100644 Documentation/userspace-api/fwctl/bnxt_fwctl.rst create mode 100644 drivers/fwctl/bnxt/Makefile create mode 100644 drivers/fwctl/bnxt/main.c rename drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h => include/linux/bnxt/ulp.h (86%) create mode 100644 include/uapi/fwctl/bnxt.h -- 2.39.1