From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D3601FCC9D3 for ; Tue, 10 Mar 2026 07:22:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3D1A710E65C; Tue, 10 Mar 2026 07:22:15 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.b="CpDvCTbW"; dkim=pass (2048-bit key; unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="VNOj9r5P"; dkim-atps=neutral Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7903E10E65A for ; Tue, 10 Mar 2026 07:22:14 +0000 (UTC) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62A6VUmC2021657 for ; Tue, 10 Mar 2026 07:22:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=dol8ejvArCi8fxJhixn/pT rEdqItoDa+4yoar+GweDQ=; b=CpDvCTbWVfzzjjBdjvtU53eHfiepBYmAXeAOYL SlNq1R/EA2OsMbEXSX3wyqBsSYEnGenOYiH2PbawJoGoRajGz7rdIDbXFTbeM1q+ vwPJimy7a7hcawJWEw/mZx/yuVolH/K5EiDY99dPhloTYLkjVi9R99WLwApko6TT 9sKznzJJPt0dITRhDYqpITefatXi2YiVDN1lgWfqmavTe7pLcRJ0Rub+L7+r1eNC j7Lu0+72PYX8zf3NZK1/4mYsiDxdbDMhZf+yOA1oUIW+lWk9FEu0ejVbOEYXTcVm cRc6AA4I5fgaGfp1JPgmHlQ9D2529ha0m+ciLiMZnZuviRdA== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cte3w85c7-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 10 Mar 2026 07:22:13 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2adef9d486bso113118625ad.2 for ; Tue, 10 Mar 2026 00:22:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1773127333; x=1773732133; darn=lists.freedesktop.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=dol8ejvArCi8fxJhixn/pTrEdqItoDa+4yoar+GweDQ=; b=VNOj9r5PWfCgjeqePp5bVU4Op5PrR8Ot4aNdU4rDcm1l4gMi+sXtyeJ43KPEX3vqGV +3JMZl1nBAPmsrec6RIkW4tbNCW+W1l2sXehOCmVywz2n/MlL9AUvO4SfKDW9fhDrE8Q dpoE0TmX3MjiCl1dsVaX0bemowpgOHcbB+RC9VWwy85fEk0rCgUCUHsuIS6O7HEWLIVn bp9EeIv1P4v8sipdTy7hUxpwJEl2nl6yvmL4bJnEaN15b9z3hiyw8hX6KQKORe/WFsNg 5mvrQ9W7DWPT25rvjQWuaGv+KdOmzNDONDzqX/KNijZG4Ya3CvZCbk5IKMGeIRgDyMRZ XIRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773127333; x=1773732133; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dol8ejvArCi8fxJhixn/pTrEdqItoDa+4yoar+GweDQ=; b=SrTqZslFrY9q6q8YQCmXB25Xsfk7wKcgmpmG8s3HU7PX+7m/YDfedmBVdme4OYel9S jJeMN5emzY2he6Hk3jesykLqvgwAeuzJcmECkHkgIhq+7QnjIq+i0mYvnb8hPl8xKjcM vbtRYk7Ea6rlYgNkge7vZ8U0bwi0+9Jgp/PH6B0m5RcBzl63qNzSPd6M8wMQY0MGVvpE /q2BOPgJ9pnr5Ecj33c579w7gm215HzfbS4uZgad+a7aJPMr2xNrUnxgMwZ17ZmR42C0 xWZqof00n690FfDN0yuRwmLRnwv+iOx+mCjEVbxQKJGuaF5UBKp5G5O1czG3gKARNEIo 4YCQ== X-Forwarded-Encrypted: i=1; AJvYcCUv3JUUQ4Wb7D+jjCvlAUzpklF7bnDT6VJ+uyj1cAMQW036vVN0gFOLkBxMs6Y4GxNoSNGIkxjlRZw=@lists.freedesktop.org X-Gm-Message-State: AOJu0YxawBSOaBEQZ7wDHRkqtRBym34tm3nw0cyGkBdglsP3GH/5WqQ5 FxaiSxlsbhNMMsKMTDzxse9zCwL7UJHfHYBv7DijZe5KgV04M/VoBjy2ZG5mthWLePKLFH8uxGs GSoYOO03+q9JWwUM3+yr/iC/wZHWaY95dTzUETNe9Dt521Wd5fZvtg8Xg6rmxXGj3n4kfaPI= X-Gm-Gg: ATEYQzxIuNN5Ndht2W9mNTvLPdooZDWaCcMu7E0NG2TNKhDovZw9XMmP4leTBxUzKPF JDCmlbbNjDs8uDrNrI424kvUDnmwOyRXIDt/hPjupxb+mYP0sGpb2h0TCH+686ZxduZ9OW7vjGs K2pzKFk93PiWAmneRVgGPc0Ka2ZZ1G1oKLgFgn7ZOJf97Xbs2N/h78rSh+njTVa7DdARyEZGDU3 R0b2LiLuZfCg94Md2NNYCjNs7Q3B492xSywytBmQuR2RAXuQmP2MTbW6gePFGU/BBe9+lDbi+E5 xUDBSyHWuYNKj0EEVnn/KMmWutHbj0BCQ6xekEuoF1PLaSrEPr0hRRgxHCDROevs4Z9CeLg3GGy 5RLhncm+UNl+kJAYzucJl/PXqJRmVpYmyw/7vpQm8JTNhtUyHPmM= X-Received: by 2002:a17:902:e544:b0:2ae:7edc:91be with SMTP id d9443c01a7336-2ae824eb08dmr124767325ad.27.1773127333096; Tue, 10 Mar 2026 00:22:13 -0700 (PDT) X-Received: by 2002:a17:902:e544:b0:2ae:7edc:91be with SMTP id d9443c01a7336-2ae824eb08dmr124766975ad.27.1773127332571; Tue, 10 Mar 2026 00:22:12 -0700 (PDT) Received: from hu-batta-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ae840b2e9dsm185200325ad.85.2026.03.10.00.22.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Mar 2026 00:22:12 -0700 (PDT) From: Kishore Batta Subject: [PATCH v3 0/9] Qualcomm Sahara protocol enhancements. Date: Tue, 10 Mar 2026 12:51:57 +0530 Message-Id: <20260310-sahara_protocol_new_v2-v3-0-994ea4b0d5ad@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAJXGr2kC/32O0QqDIBSGXyW8nqGn1NrV3mOMMLMlq2zq2kb07 rNgd2Nw+OE7cL7/LMhrZ7RHx2RBTs/GGztGyA4JUp0crxqbJjICApxkRGAvO+lkNTkbrLJ9Nep nNQPmHAqWC5GpVqB4PDndmtcuPl8id8YH6957z0y37aZkpABGCS2Bp0A5YSzHFN+M76zTaS1Dk CfrfXp/yF7ZYUhjoE03w1fx96s4BEPZKJEXNdOl+mFb1/UD2azRvwYBAAA= X-Change-ID: 20260307-sahara_protocol_new_v2-662854773cf7 To: Jonathan Corbet , Shuah Khan , Jeff Hugo , Carl Vanderlip , Oded Gabbay , Manivannan Sadhasivam Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, mhi@lists.linux.dev, Kishore Batta X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1773127328; l=5595; i=kishore.batta@oss.qualcomm.com; s=20260206; h=from:subject:message-id; bh=3wPl/p7STummudz4gDu/8803TKuECDOrkGo5XhXfE5g=; b=R+X2+4O6wl1uLwElI8uYBmMvkmi1hAd9Y17iMHYN8I3mG2QBTSAitqo0MBz7M1syDKRvRkM11 bwLkwUA+HyIBLtVHaZSlIZHOcLvVHly/oznnoUyOzifKC8zILniRruO X-Developer-Key: i=kishore.batta@oss.qualcomm.com; a=ed25519; pk=vJo8RvTf+HZpRLK2oOIljmbn9l3zFkibCGh+blaqZCw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzEwMDA2MCBTYWx0ZWRfX7ZZdAvOA6wPr tBxRuOoAzn6bXlH3eu7kzjatBEC3lWIBsYzMjg8O1tv22pXV7uK+okwImg7XC9Pmc/VFt8lH6PC zzdveF5JEC2GRcyiSScktM9bSmlVzWTK4i8Y6F4+Hp5jzXeDrVoVd8H3MbCTTfPEAbXGRxldcLj Oa1NsSG9k9yqXWv6LPpoF+1To2adBkAskFKqCbv8N5m55Gtmqd7Kx/zj+PE8ZmLFoMfHhruROdC HohV6uqTcDofOpj3tQSmEVqZ9ukkBo0uFvityaDpNFI3Y4qV6vKMO1DqtFNotdhR6OnfEj0jlfZ XG5OQU9rxzHiaV4jiJ1ggZCDnPGr88sB724aJhuz8GONxqS4N0dyBVKR/gbBZJBJ+OLDyX7GK9k hJDZehrwf00NBH1Ht4WwmhBbxnVNoxGSdhQrHtrJU3d8gTTh9JV6lV3plfJdowASdYvArUIbqTd 3sp6bkRCPNqoPa1fkRA== X-Authority-Analysis: v=2.4 cv=GtFPO01C c=1 sm=1 tr=0 ts=69afc6a5 cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=lG-yCPvlEGbsawO-O7cA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-ORIG-GUID: 2uYqkCNv6BXyECahLw6bGTuAYXXmo76v X-Proofpoint-GUID: 2uYqkCNv6BXyECahLw6bGTuAYXXmo76v X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-10_01,2026-03-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 malwarescore=0 clxscore=1015 lowpriorityscore=0 spamscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2603100060 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi All, This series reworks the Sahara protocol driver to make it reusable for multiple MHI based devices and adds support for capturing, restoring and exposing DDR training data using the Sahara command mode. The Sahara protocol is transported over the MHI bus and is used by multiple flashless devices to transfer firmware images, retrieve memory dumps and exchange command mode data during early boot. However, the current implementation lives under the QAIC accelerator driver and contains device-specific assumptions that limit reuse. Some MHI devices (for example, QDU100) expose the sahara protocol directly on a "SAHARA" MHI channel and rely on command mode to exchange DDR training data with the host. The existing driver does not bind to such devices and ignores Sahara command mode packets, causing training data to be dropped. This series addresses these issues by relocating the Sahara driver to the MHI subsystem, centralizing device specific configuration and adding command mode handling for DDR training data. Overview of the changes in this series - 1. Move Sahara under the MHI subsystem: a. Relocate the sahara protocol driver from QAIC accelerator tree to drivers/bus/mhi. b. Register Sahara as an independent MHI protocol driver. 2. Generalize device matching and configuration a. Allow the driver to bind to devices exposing the protocol on a SAHARA MHI channel. b. Centralize firmware image table selection at probe time using a variant table, instead of scattered conditionals. c. Preserve existing behavior on AIC devices. 3. Add QDU100 firmware image table support a. Add a QDU100 image table and select it based on the matched MHI channel. b. No separate client driver or registration mechanism is required. 4. Add Sahara command mode support for DDR training. a. Handle command mode packets(CMD_READY, EXECUTE, EXECUTE_DATA). b. Query supported commands and retrieve DDR training data from the device. c. Allocate receive buffers based on the reported payload size and copy raw data from the MHI DL. d. Store training data in controller-scoped memory using devres so it survives sahara channel teardown. 5. Expose DDR training data to userspace a. Add a read-only binary sysfs attribute under the MHI controller device. b. The attribute reads directly from controller-scoped storage and remains available after the Sahara channel device is removed. c. Cleanup is handled automatically via device-managed resources. 6. Document the sysfs ABI a. Add ABI documentation describing the DDR training data sysfs node. Signed-off-by: Kishore Batta --- Changes in v3: - Dropped the explicit image table entry for the boot critical image ID and added a generic image ID based firmware lookup fallback. - Link to v2: https://lore.kernel.org/r/20260307-sahara_protocol_new_v2-v2-0-29dc748b5e9c@oss.qualcomm.com Changes in v2: - Rebased onto latest linux-next tip. - Reworked commit messages to clearly start with the problem being solved and end with a technical description of the change. - Moved the Sahara driver to drivers/bus/mhi instead of drivers/soc/qcom, reflecting that its an MHI protocol driver rather than a SoC specific driver. - Removed client side image table registration and consolidated firmware selection directly in the sahara driver using a probe-time variant mechanism. - Ensured each patch is self-contained and does not break the build or runtime behavior at any intermediate point. - Simplified state handling and lifetime management to avoid duplicated state tracking and ad-hoc cleanup. - Updated sysfs handling to use controller-scoped devres and avoid one-shot reads or manual teardown. - Link to v1: https://lore.kernel.org/r/20250825101926.2160554-1-kishore.batta@oss.qualcomm.com --- Kishore Batta (9): Add documentation for Sahara protocol. bus: mhi: Move sahara protocol driver under drivers/bus/mhi bus: mhi: Match devices exposing the protocol on the SAHARA channel bus: mhi: Centralize firmware image table selection at probe time bus: mhi: Add QDU100 variant and image_id firmware fallback bus: mhi: Load DDR training data using per-device serial number bus: mhi: Capture DDR training data using command mode bus: mhi: Expose DDR training data via controller sysfs Documentation: ABI: Add sysfs ABI documentation for DDR training data .../ABI/testing/sysfs-bus-mhi-ddr_training_data | 19 + Documentation/sahara/index.rst | 14 + Documentation/sahara/sahara_protocol.rst | 1241 ++++++++++++++++++++ drivers/accel/qaic/Kconfig | 1 + drivers/accel/qaic/Makefile | 3 +- drivers/accel/qaic/qaic_drv.c | 11 +- drivers/bus/mhi/Kconfig | 1 + drivers/bus/mhi/Makefile | 3 + drivers/bus/mhi/sahara/Kconfig | 18 + drivers/bus/mhi/sahara/Makefile | 2 + drivers/{accel/qaic => bus/mhi/sahara}/sahara.c | 601 +++++++++- {drivers/accel/qaic => include/linux}/sahara.h | 0 12 files changed, 1869 insertions(+), 45 deletions(-) --- base-commit: a0ae2a256046c0c5d3778d1a194ff2e171f16e5f change-id: 20260307-sahara_protocol_new_v2-662854773cf7 Best regards, -- Kishore Batta