From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f228.google.com (mail-pg1-f228.google.com [209.85.215.228]) (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 31FA330E0F2 for ; Thu, 26 Feb 2026 08:33:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.228 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772094831; cv=none; b=Z41/XPg6oyP6X1iUyKeJlHLAbaYsgJX139WUuryhCo6YhZeTmpH9voL9mB3xbQB6kLuJzHDaGrXk5aQkcqlhTuSreCdg4aeCljhi/rA3+f2ykICLxo3GGyNPP/Ad+6EKCXcSDSfpdPWAzz03Pj4S1sUom0S6gTdsb4HLszJKjKg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772094831; c=relaxed/simple; bh=5wxmCyO6RdiUW4n2ea2RNOl3pNkLbr50+IguidUTa8Y=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=iSShYdxSRcwqunujHqAnfFnkWkahsipiGybSY4UrJhbGo7h2CChELeuiaPU6kOEXuGhW24weuyq51p5Q1FP4CaTrftJWMRzBVs26ECH70TwtyDwH0+bgvPHuOEFLMtI9SeEk8UK9iQjS+fcwASM1NZoRfERwEgOqyRZw6uVdKM0= 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=ZiA/sDm9; arc=none smtp.client-ip=209.85.215.228 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="ZiA/sDm9" Received: by mail-pg1-f228.google.com with SMTP id 41be03b00d2f7-c6e248aa446so209279a12.1 for ; Thu, 26 Feb 2026 00:33:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772094829; x=1772699629; 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=8bSRWGAW5dqprM5hPD8QrJxmNmPDr6zZfA8QOkiTxYA=; b=FIJ9TzQrJBisap9JQtsOYR84N97m5xXERHblRJeNkqia1At3Or0q9mqHppozeWKD1j enpfllwafoQR8WRDicarLALflAJncni65ZB4frxQMxcsyY27/UjV/klZsRxtvv84RkxU S/PBZ20//CYE4HWVjsQIa0UPzBQ5yeDAlkqwt8qnmSVvziaAMYdT4jultlkfr0LTJaPH zaj3Arc6YN1U3DKT/foCnOURmKwBy7W2MSS1CNH1X1TDXWNkUFLwPeW1rmJvk0en3vsn BqIXSMFjrKgwuPcSwnV3DxFAL2rbGT1RLVA9OJjmMa45ZgCN/fKfcz3tr4ATtYrUmy+Z Yy1g== X-Gm-Message-State: AOJu0YxdRnxsFDlfjq1WABBdp/NmFWLxE+ayT6GbAKf+ox2b3yVj1aJ8 vWKfVR8lIFXK44frLfRFcEuu5HtyPST36d0ICOcx08WP9FmcoKo2UAydtP1B95NtCISp1876vDM OFqit+9DbDt5Qt0T/dABqeBMOqusRx885P2TcOdGBa94R46V/ySCW6Zl6PrG1o6v6zcebcdwxCj /c14EF0CsxmFLYHs166exCbtojjznS6BxY06IjWtWGv8/drj1z8FTP61dMd+4IDQeksfG08rtqu xjUYE5SvdNJAY0+TRcabQ== X-Gm-Gg: ATEYQzyhWuYniK6m8MO0jdkSCchBz/UkpXfxDYVcL7T7/2/exb9UALSbKeZZzLkhyVI r45JZ5wnhxSTxlKJRE/cS5MWXY4JUeLUhGXFVOVlyT51xJbC6+5d+jNPpNdvO2Vvj+M35e9n+sm 2m0OtPCILya27nZPf3Uq2wdTqLswEGAfibwZa48R2MEaJzwKVqBNHRVUytZdkQkHzbxjLRwA8/y ZSjvdRPb6WXGyTDYYPSRP++M/PfV8y1WeQe8xx44pnQy9rmXe61lN71f+NNcN9WLUBGgsy25OvN FzKZk068N/UJb/cHgImkgh59xXvZWvXogmTwFpgtMrqlV+qE4S+PoZ68/lfgjVpfBLhiAgg31qf 2U/XibtOPANoZzY5cPZwoTilqVNm3ZwreGlo0Dc34yhcDOZmk8+8rano/Qp8wOMIMv/k9VmYOq7 WuoFc80IDg9hP0MO227jFnNPVd3Hkgj4N2BPLA+IToBP9UHindqKkUU6sWSDE= X-Received: by 2002:a17:902:e943:b0:2ad:b22f:c67f with SMTP id d9443c01a7336-2adb22fc838mr68437015ad.16.1772094829039; Thu, 26 Feb 2026 00:33:49 -0800 (PST) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-118.dlp.protect.broadcom.com. [144.49.247.118]) by smtp-relay.gmail.com with ESMTPS id d9443c01a7336-2adfb16b103sm1806305ad.17.2026.02.26.00.33.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Feb 2026 00:33:49 -0800 (PST) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-824b5cae336so311404b3a.3 for ; Thu, 26 Feb 2026 00:33:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1772094827; x=1772699627; 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=8bSRWGAW5dqprM5hPD8QrJxmNmPDr6zZfA8QOkiTxYA=; b=ZiA/sDm9zFmArEXVrJSN77Krgh2HQOPDlXI2yC97T0RlwfiQwaq6ZbTGMLKcnZrSsD KdpseAA9npqgBQya/UAT8Vzj/GQXcMJFC//PSqo36elbZm5WuBtuXFPzh+wPxDG7HqcA IYMUwFWpLgsIwoVhtyDqLSjINcCeT05PjuJhY= X-Received: by 2002:a05:6a00:a20d:b0:7f1:7b2a:ab5b with SMTP id d2e1a72fcca58-826da90aef0mr12235175b3a.27.1772094827410; Thu, 26 Feb 2026 00:33:47 -0800 (PST) X-Received: by 2002:a05:6a00:a20d:b0:7f1:7b2a:ab5b with SMTP id d2e1a72fcca58-826da90aef0mr12235151b3a.27.1772094826891; Thu, 26 Feb 2026 00:33:46 -0800 (PST) Received: from PC-MID-R740.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82739d4c9b5sm1661613b3a.9.2026.02.26.00.33.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 00:33:45 -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 v5 fwctl 0/5] fwctl/bnxt_fwctl: fwctl for Broadcom Netxtreme devices Date: Thu, 26 Feb 2026 00:23:13 -0800 Message-Id: <20260226082318.525518-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. v5: In patch #4, removed support for any commands that require additional DMA buffers to be passed in the command input. Only commands that have the entire input message inlined in the request, are allowed. v4: In patch #2 fix use after free of auxdev ID in bnxt_aux_dev_release() In patch #4, added new entries of Makefile, Kconfig and MAINTAINERS in a sorted manner. 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 f4d0ec0aa20d49f09dc01d82894ce80d72de0560 Merge tag 'erofs-for-7.0-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs and are available in the git repository at: https://github.com/pavanchebbi/linux/tree/fwctl-bnxt-v5 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 | 278 ++++++++++++++ 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 | 44 +++ include/uapi/fwctl/fwctl.h | 1 + 21 files changed, 721 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