From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f97.google.com (mail-ot1-f97.google.com [209.85.210.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 7BF11225775 for ; Mon, 26 Jan 2026 05:43:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.97 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769406218; cv=none; b=fgnWvJdOnOMJPclTxJdu30yHsJKVQOC4Xhk8nqniorejousPh8HAF05dd/cy8H6G6cTWVEBHMSUm0QmVBmfOaJyM0lKisRy2yd9bjID7REqCnq4IHcMBKYPtA6kEcrFI/T3yzKGdcfuwCq1vwco/BPecj/4B74ACqj2A0V3+k2A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769406218; c=relaxed/simple; bh=zOBF5IHl/6A5HCRPJDRgXOOu39ew8l4onsxxWycMKko=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=WjXDC7QF20ls3+WUlnxhJrThavR7wFAPuqwf9QSeGUXnvEGCrwCK5KZis2O5eQD6op4iLTWuj1KjeGVFoly/GVZRVKqwzErj8v8U8usAi0kL8WuWD0CqjzEi5lpAtJ3mZFBgu4NOuLJo15sarh7Dg0pXQXgcM12vQQpiuduUJwQ= 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=CQpNys6v; arc=none smtp.client-ip=209.85.210.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="CQpNys6v" Received: by mail-ot1-f97.google.com with SMTP id 46e09a7af769-7cfd9b4e3f8so1300959a34.3 for ; Sun, 25 Jan 2026 21:43:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769406215; x=1770011015; 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=NNnitb995EWFHh8V+fxFQO7lPQ7OsafpUpNOiYxMlaA=; b=NpUsNd7jwsGM6a5ikE0/+J35Oyx7t/UlnzgjnUS7SnHVrMFIOnAn6+Wg9IFp4dCIoZ HkpPHlBEnadnUAjNz7rfOYdwVULDU/78Gz63cotpSg6h9BiRqb0+Sd5snf8/TJjDRGXx /J3Z6L3r/4OVpbdtUsnMtmG+mCVcCEUkFJTG9ih0N18K2dLYPpzObOAd1Hnab8B6BQfQ 4R1eMGj6Wvq2NAVQ404SD435ydZKxxxcA3Eyx2zE+ApEKRAos7/j4/If1V/B2fEPYtv5 i1tV7uU4qhVmIUFtGZBoZIP+lKMiDR7RwyfeYBpX1UTdyPZuYI6u78Wrb4jA1R7WpJ48 0wBA== X-Gm-Message-State: AOJu0YzwlEPInw/qQiSTheDQ2G4lxNdvSpPYF7b8Y6bovKsn6WLyE3a5 hpP121dNEP0GyyRvg563ObLT0XKFOqkBYHibsPm/ijrERYbWlDrvQSTwcw62dM1Ovm5C3MwUhQd 2mWGl70dcNtOygetY+BbeGBfRVAUvy6PlsgNeU96dfcxPDAgKGe65MWIRyM1iqnEA36assYOZUx lqrd7RtYV5DY8CpTOa3A8D13HiQH0VljKikiyA4aiXyVo8bilzFwQoci3tx6a0/6tx7Rzv8ri9p tpuz4s8zC4Hwpzfa/I= X-Gm-Gg: AZuq6aL5pdUmvxbZYMIIMUp7eiJZMNBqQVBri2M9G3zwlNcv05OxzMoLMOP6zvZDMaw 1m0EpiPvlsH1b/7mF3y9kDfcKja6OTWcPPQpRZTlpNku6eVO5CtLPvLhbgY8rLrcB9pE5Vdz/dp CJTK82laD6GHoPtTRHtnW/x6SeKg+Y1SQI0yJMdCaKgSyfqiSDdxeipMeemALn88Fu4NdUZ8R8P VbTwin/51JkNMo3xW+TrtnE4s7YxFhMK2gF+xthNyabeacix0xKicRnnQlMeJH9fdui7l74O4z3 /Tw0BY31ek8WWtmFJTdNj/vL8fzryk8CBEDe0mU1iezQhi4OGLdL37MzVBtzQmcRYv2ArveHNPY dytS4ce8+k9FCNL6mVRqnFdLNIW+vdHRhzvvDFZdjeZ62vxTItsn7uovavUqbI1+/6Xao3gWory Ayqgdj7FSCZ9cKlq97rhlOJed6k6yxyPzoh/vTEy6T7enQ X-Received: by 2002:a05:6830:2b11:b0:7ca:c803:f539 with SMTP id 46e09a7af769-7d1701bfb48mr2123911a34.5.1769406215272; Sun, 25 Jan 2026 21:43:35 -0800 (PST) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-77.dlp.protect.broadcom.com. [144.49.247.77]) by smtp-relay.gmail.com with ESMTPS id 46e09a7af769-7d15b3bf80fsm1562711a34.7.2026.01.25.21.43.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Jan 2026 21:43:35 -0800 (PST) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-pg1-f198.google.com with SMTP id 41be03b00d2f7-c6133262e4eso2336181a12.2 for ; Sun, 25 Jan 2026 21:43:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1769406214; x=1770011014; 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=NNnitb995EWFHh8V+fxFQO7lPQ7OsafpUpNOiYxMlaA=; b=CQpNys6vKeOhbKtiDpsH7wWhUPIBPYvtXw3HonTa9YIf28WIZGQmmg2n6fUMofdhOK nk0DQjGpClqQMIExq9lM19k8CucsN8R6tWPDfWQxpyovZC5B3Cp07rbFxEW97x0vodwy pXeXzBFYeO/Vwqm3Thdz/2nXOEbusYf4YCQRw= X-Received: by 2002:a05:6a20:72a8:b0:366:5bda:1e87 with SMTP id adf61e73a8af0-38e9f2a5531mr2883580637.80.1769406213886; Sun, 25 Jan 2026 21:43:33 -0800 (PST) X-Received: by 2002:a05:6a20:72a8:b0:366:5bda:1e87 with SMTP id adf61e73a8af0-38e9f2a5531mr2883567637.80.1769406213454; Sun, 25 Jan 2026 21:43:33 -0800 (PST) Received: from PC-MID-R740.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c635a3f2ddcsm7427213a12.17.2026.01.25.21.43.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Jan 2026 21:43:32 -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 v2 fwctl 0/5] fwctl/bnxt_fwctl: fwctl for Broadcom Netxtreme devices Date: Sun, 25 Jan 2026 21:37:05 -0800 Message-Id: <20260126053710.3474483-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. 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 63804fed149a6750ffd28610c5c1c98cce6bd377: Linux 6.19-rc7 and are available in the git repository at: https://github.com/pavanchebbi/linux/tree/fwctl-bnxt-v2 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 | 344 +++++++++------ .../bnxt_ulp.h => include/linux/bnxt/ulp.h | 26 +- include/uapi/fwctl/bnxt.h | 64 +++ include/uapi/fwctl/fwctl.h | 1 + 21 files changed, 877 insertions(+), 173 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