From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f226.google.com (mail-pg1-f226.google.com [209.85.215.226]) (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 043692D3231 for ; Fri, 30 Jan 2026 16:48:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.226 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769791727; cv=none; b=C/Yw4nhl3W/REzaSflVyCdN8lUSJuldHELVsufumy9XjBbEQjDw5pQ5z0qipr/cev2TEsN36SuvWTUQ3t7GuUTIUhk2tb5b1coN4xx6IONPHsUF/i7tG5K3d6ULN4Y2mxGf9zgEjuROvgG2MlE39Dko5/mv8ZR2vSa4kUxHsLLs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769791727; c=relaxed/simple; bh=rXe2eBUdh+vAI1IAYFJUoPtpzqYwBj4j5bp2NLD5wf8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=PSwgJ8nbncLyjgFaaTPp2tOqN7D4OSXVULuQBbB9ir56Zbjz399EOf8aEXv4XVfWjW3cUo9jOrlv4GOkLgCSEdprIaTNmvNouZPT0qRpigvhzWl043mDjCRd64neRXBrG1vfB/hvSya05hFeNcFrgeauiOtQLND0TPdA/6wnZVw= 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=ed59hcJo; arc=none smtp.client-ip=209.85.215.226 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="ed59hcJo" Received: by mail-pg1-f226.google.com with SMTP id 41be03b00d2f7-c61343f82d7so935730a12.1 for ; Fri, 30 Jan 2026 08:48:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769791725; x=1770396525; 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=WAB2vGYYcGI/iThpiENh4ZZXQ46tKjFrMSS6zVARo1Q=; b=YtaXHlNXlu4ru6xF0zFzrJSSG37QMj0F9Pvdaj4LoCZZUhIW38iPoOhZN3Gu5vFDDp BYiUNJd77x56NFflQuKrQPLcx/mqgR8W9zPtFtwkQdDlIi0ycVgSD5KEjJ5dXBM4MCCh Jp9sZTvjMM4girh7jIyo8+KU1CECwPqCo6R3nJigzWpEIsd+3C7Up+K4ZpIBQcVjv0Dp fuG7iwL0vLma+xJHE1zvG3WKLkcmxeFXBI3A29y11tl9E9gXmEoSur9BbSdtSH7F0Fdn 38Z/pj4/1pP+2nVuprrTWngdYvUt5kI7hJRgaI4cLuftCMYSB0/KuFiEMg+BWM+Q3haS qj5A== X-Gm-Message-State: AOJu0Yxjjj0em5LOLvMpV5XjyStjmO/TfYYdc3XFfdUbkx92U0T22hDW PgGTVu+A7B9iOH0ZWbL847VvOYI+fS1IQ1RBbijNOpl2fhLfnyYNOQGPJAhEohXN3mkZjVOeizE rckAlLCzls7DSDol/8ZI8aXYntsURQ9DOTFqHez17/RC1XtZopNTYY8MGqWVY37C1ZDwt0z/WL7 sSxxz6quDicnDQWRsG9sraKPhR+2JRsOVgWnbu44wODI57FYQ3OyAwwuGpcErkOY2p35neIoBMM X20C6HQ7DPmCWoAfH0= X-Gm-Gg: AZuq6aIxWKJ4jG+xEcuMa1O7T1zaNY1S3XFimfM4AuaRYLWijlQ4xZB34DfFJj7xiCF RiVz7pUvVIQngQ0dIUTKl0Uytu0bIxKD2wWHynoYUcggX6nxrdK8sMJy69QVxcWFqPFfuF/R1mb U+ubG16j/rSZNN8T0xLmBff8573CHXJNGaxnXb4vYLrhzKnW9AAJ2HQTvYhO604X1t/c81UPVjZ 3MCUc108FF7RZEMpwQWcx81Bq/WnggzKXi/Y1f5FzPwim0ymgdGE4RVmJ2l+BWXhoaXdlBnur8T zxNUuZcS7QYz3fpfkBFfnIa921Zz8pkMSWBPei6ARYGJF+cOoNpDgrFjXASTaphQMmxreQ95Fod WNDR3uLQhrTx+CrMmYQYbbwUTDeOIHE0tF79OnsE43IrkvcQ3m+rFi/6isFCWEQqQ7u6TiYc7Ei TmINaqH9R+GaIAIpu3U8UhNTVDs6VeotteAG+9vRXc1VQp X-Received: by 2002:a17:903:b48:b0:2a8:7814:47d0 with SMTP id d9443c01a7336-2a8d7ed6d32mr33968645ad.22.1769791725315; Fri, 30 Jan 2026 08:48:45 -0800 (PST) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-17.dlp.protect.broadcom.com. [144.49.247.17]) by smtp-relay.gmail.com with ESMTPS id d9443c01a7336-2a88b413275sm11340305ad.14.2026.01.30.08.48.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Jan 2026 08:48:45 -0800 (PST) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2a7701b6353so24679805ad.3 for ; Fri, 30 Jan 2026 08:48:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1769791723; x=1770396523; 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=WAB2vGYYcGI/iThpiENh4ZZXQ46tKjFrMSS6zVARo1Q=; b=ed59hcJoPK9ecBP5je+X+BG182v2K85KZ5Mz5yRg0Z5rm5DQd1WWREqRKaG47qdqGS njY6S6O6G68uu1VlQh/UnGoBfg06alzDGF5JNJKADt6VhVWPL8s9cuOds9UTJyaqrImU xmQAsmpCGCzWjyisQMQsDfsWzDTb5ReQmQiiI= X-Received: by 2002:a17:902:ce06:b0:2a7:cf3e:506d with SMTP id d9443c01a7336-2a8d81bb80fmr36737725ad.60.1769791723425; Fri, 30 Jan 2026 08:48:43 -0800 (PST) X-Received: by 2002:a17:902:ce06:b0:2a7:cf3e:506d with SMTP id d9443c01a7336-2a8d81bb80fmr36737485ad.60.1769791722977; Fri, 30 Jan 2026 08:48:42 -0800 (PST) Received: from PC-MID-R740.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a88b5d9a7bsm80193085ad.79.2026.01.30.08.48.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jan 2026 08:48:42 -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 v4 fwctl 0/5] fwctl/bnxt_fwctl: fwctl for Broadcom Netxtreme devices Date: Fri, 30 Jan 2026 08:41:41 -0800 Message-Id: <20260130164146.3752166-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. 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 4d310797262f0ddf129e76c2aad2b950adaf1fda Merge tag 'pm-6.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm and are available in the git repository at: https://github.com/pavanchebbi/linux/tree/fwctl-bnxt-v4 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