From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 796F43AB29F for ; Mon, 13 Apr 2026 09:04:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776071059; cv=none; b=SQCpecJJUEsluQz6YNORr1+QV/Le3RJfZtyd1QXkgv5ocWIHoQzzvfKwKrZK+RJzkLbMxV0g92DOvH3p4AkF7sMBNWWBFaAnz+k3hYjvnX8CbEH3s8sgSi1xkK6xAr4x7RI28VAxoWV3zyzinhhvMBq+sUwdY4k7o5UBYPIrTsg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776071059; c=relaxed/simple; bh=DheMOtEnz8CCLQRfzaHndZpq+VdNdR/xkOKuGmrv+M4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=NqrvqCx5Ci/5whIy/56TGjJrrd+appFqdxgHgf5IrU82x1PUV6XGbpPpE5rC9sPm7dWccCrlSo0A1lswRyeR+C0qJEPP3j74M6MOEMeFuFPhf5b7BEEuomqJjWRZVAn9wozvx/SQIaokSqGhpH5viSFZn/J2p3rK4jjTTc3fv54= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=pZMspvhN; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=CmW7OhFV; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="pZMspvhN"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="CmW7OhFV" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63D7aUDo2043988 for ; Mon, 13 Apr 2026 09:04:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= fjIwuH9N8gy+uzkST9nRyvef7/HrlTethb8JNWRqYeY=; b=pZMspvhN85wQE4e2 qMTGU4v+MJdrmp2Rto/aNsP99siJM8Gz5/mhyyo2vLNoYFamgiKW4fZS+hJA21Cm zG6KrMoKNxYdlL1AjCSoT5d4CmTsNYqBWUAxyDyUsJwHjU9MjMAzUwgPjSXL06t0 1QvP5xhVPZJbp8r3zYmu8t4JpH9GnOif1l90/b8SUbyuG75p+4mAx9ZAZgI8dTKy 6Vf27Bb+ZJkwxbF9kLnJXgeXJkJj/9P0ED+BvNdZgSgZePLP0JUtnYLwcBkEw1KW IYRMsS+TEb9iwXj6Ns2uLd+YYhpx4fJKsBkF7gFWlsjE6VPHj8a1HEUYp0+3mxTb UngZQg== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dff0jvgxh-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 13 Apr 2026 09:04:17 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2b24cd2e2b3so41328065ad.0 for ; Mon, 13 Apr 2026 02:04:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776071056; x=1776675856; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=fjIwuH9N8gy+uzkST9nRyvef7/HrlTethb8JNWRqYeY=; b=CmW7OhFV7R7tL0pKEcRi5sos3Jk2PUjctn8bD+rAFqrOIDAZWvYh5zZBfzURawqlIA jqBUbG6kg+xPFF1MzzeB0JN5JxyYGv+I/i0blkmGeAx0K/oSA7wnq81Q1CfOGyEPOmwt 9l1YwAPVzHh9HG4w/MWNPF1elZp/MifRnqA0NStPAhAIyVs/qs0AxQnTnQ2egLK0PGHf /tl5NZ63ekPfZ7wFGTITQ9UyBfPRsgGfwsGGpasC2NHZ1lgppI2J15Zp5VWh/4lp40kV kdDxaAZq1jCejm78a4JlV9zgGBgMdllZ+usOicXmGWjvpaneZgaJa+w8DjJuXw4U8Zy+ uVrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776071056; x=1776675856; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fjIwuH9N8gy+uzkST9nRyvef7/HrlTethb8JNWRqYeY=; b=IZl8/Ar3a10NTRqAvCFy30wDLV012BxUn4tZw3N1qenT1tcTJxN4YEmQPl8wFYWfBg VMZLmuWLod5izFQ2+fqjj84JwgGB0YscMUIZCdNsQY2ZDGsXZxG6R8FLajd9EnWGfi8d fsv/r0HkXMk/gcItIyIOZe3EBp4YUUb/XqFCTn5VyMadcUX01xXXzS5loUXZObRCQ+DE wntidJdRACN0/WqXUqvTypVmFHvuAPNCX456b+ANej/R9fiVSRaY4p7qj/Akjk9w4s6Z gpLHfTPBpbxHZGvYogCQzJJ2LW+ORURWrBYPhOqJXYkmbBEhkiOWeuU/qR9W2eFMUU+s LsTw== X-Forwarded-Encrypted: i=1; AFNElJ9svlDInrYj8bX7jNjmAjWibugdf0hNH8p/pEISdpfktNCZb7puQlaQpV+/xeRUkaXl0wUccyrbVUwtEjk=@vger.kernel.org X-Gm-Message-State: AOJu0YxHq6M/2BkFDm+5i5duIkSpEXjuZ2mQhyNN0B80W9vjJDRwE3OS pdgYDJ/oqPxbalSJzs6hfHvv2r38tqlMAkSokfS1lSGyt+UI8cSGj7koGdufjSzhNc2ODykew4W lFmneMJNa/0sYxZDnDWj7OA0RVXlOZ+llAy//m+WnvMHlF1QKBJLxQxtK0zl1SdxiMvY= X-Gm-Gg: AeBDiets+M2/VeSUNWrz1qOoR3IUEwWpM+t668RKU5hrlyAgZtkP/rD/1jSYGnRBrTS j+rHB4RkRlWRi5Mis81eWbH501eY3pN4ZjnS6PpgS+VfyhIbzthg0iIxhD1e8bcO3ikEplEbh2K xiiu/aps+aXp2OpWIKYksk6Quz5zrfAMFN1csOBWOfoWuHRF5WsmYMKhREC3QxljBLpVy/SmClw wTY6vuE7YkVzqVniEQ8TNKeOTC2arGd6JYkNlHhCmuZH85zIV6SHh+KrJTm68GMXkal1fep0ftz Vmx1pyhlAv8p+RYPtF80pYPiK5y5gM0lFQKXa+nexD/hVR47l11ltKfguaN7Nj3PWe7mL6cURdA c4DPx/lsC7xsC+cIpOWrjKihEMzEweQBXvv1FVfl9NEhMTq8//iumyME= X-Received: by 2002:a17:903:4405:b0:2ae:5629:ac55 with SMTP id d9443c01a7336-2b2d5a30ae9mr127536965ad.21.1776071055947; Mon, 13 Apr 2026 02:04:15 -0700 (PDT) X-Received: by 2002:a17:903:4405:b0:2ae:5629:ac55 with SMTP id d9443c01a7336-2b2d5a30ae9mr127536505ad.21.1776071055320; Mon, 13 Apr 2026 02:04:15 -0700 (PDT) Received: from [192.168.0.215] ([49.205.244.213]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b2d4f0a39fsm106272495ad.48.2026.04.13.02.04.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Apr 2026 02:04:15 -0700 (PDT) Message-ID: Date: Mon, 13 Apr 2026 14:34:10 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 4/9] bus: mhi: Centralize firmware image table selection at probe time To: Jeff Hugo , Jonathan Corbet , Shuah Khan , Carl Vanderlip , Oded Gabbay , Manivannan Sadhasivam , andersson@kernel.org 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 References: <20260319-sahara_protocol_new_v2-v4-0-47ad79308762@oss.qualcomm.com> <20260319-sahara_protocol_new_v2-v4-4-47ad79308762@oss.qualcomm.com> <2eda7d10-e4a9-4ca7-ae73-bf9c0ca8fa33@oss.qualcomm.com> Content-Language: en-US From: Kishore Batta In-Reply-To: <2eda7d10-e4a9-4ca7-ae73-bf9c0ca8fa33@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDEzMDA4OCBTYWx0ZWRfXxjeT1zkUQ43A sBWGc8cxrO7m4jLmwbokSQv/i2yDX73mmI56RxJ8tSDZ1MjHvhPxfK2cZxJPFfFKbL0bSsptWgP GX0ROqc3mHmqMOfkbC/mBpLDTVQ6iLRP1Nx65gFzo5kfcAPzlfwMdxOcem/O0q51eyagatNwk3g xSrTMoyHTxJtGCA2BqMsicjQGVb9PCO5YC5cIXG97RnC3ms/JwwsBthhf9Poarf5OYyCWICV18z 8aCwXXGmeld6hobDq9Rz1eL9CfWrek1hTFsssPjX0UGEnZCqlbPlZ/g0a3w5enJKzhRka/n32q0 222BlVJjtgU48x785br2i9UfMyeuqIi26apNkUQLD5sxAvnRjpgqndktX/yaOIdJndiOMhRqjnX e5LPqzoJywIfiU5PaSYyS1DQcFrE9o2Ejr5TKnyJ9GS/YFk0uTklhDZHcJZSrV9EEHhd33qoRG6 O+brvXEw9ltwBg/GtSg== X-Proofpoint-ORIG-GUID: JjWDP0QJPOT-XfTq3E4_xE20huie3vU1 X-Proofpoint-GUID: JjWDP0QJPOT-XfTq3E4_xE20huie3vU1 X-Authority-Analysis: v=2.4 cv=d/LFDxjE c=1 sm=1 tr=0 ts=69dcb191 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=KtsNJ/6bKgz7QsArn2OSsQ==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=LJiLoplfShnj9_vHJaQA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 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-04-13_02,2026-04-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 impostorscore=0 malwarescore=0 phishscore=0 priorityscore=1501 bulkscore=0 suspectscore=0 adultscore=0 lowpriorityscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604010000 definitions=main-2604130088 On 4/10/2026 2:22 AM, Jeff Hugo wrote: > On 3/19/2026 12:31 AM, Kishore Batta wrote: >> The Sahara driver currently selects firmware image tables using >> scattered, device specific conditionals in the probe path, making the >> logic harder to  follow and extend. > > "to follow" (remove extra space) ACK. > >> Refactor firmware image table selection into a single, explicit >> probe-time >> mechanism by introducing a variant table that captures device matching, >> firmware image tables, firmware folder names, and streaming behavior in >> one place. >> >> This centralizes device specific decisions, simplifies the probe logic, >> and avoids ad-hoc conditionals while preserving the existing behavior >> for >> all supported AIC devices. > > It would probably be useful to mention this is in preparation for > adding QDU100 support, otherwise this reads like it is just change for > the sake of change. Sure. I will mention in next version. > >> Signed-off-by: Kishore Batta >> --- >>   drivers/bus/mhi/sahara/sahara.c | 66 >> ++++++++++++++++++++++++++++++++++++----- >>   1 file changed, 58 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/bus/mhi/sahara/sahara.c >> b/drivers/bus/mhi/sahara/sahara.c >> index >> e3499977e7c6b53bc624a8eb00d0636f2ea63307..8f1c0d72066c0cf80c09d78bfc51df2e482133b9 >> 100644 >> --- a/drivers/bus/mhi/sahara/sahara.c >> +++ b/drivers/bus/mhi/sahara/sahara.c >> @@ -180,6 +180,16 @@ struct sahara_context { >>       u32                read_data_length; >>       bool                is_mem_dump_mode; >>       bool                non_streaming; >> +    const char            *fw_folder; >> +}; >> + >> +struct sahara_variant { >> +    const char *match; >> +    bool match_is_chan; > > This is dead code, add it later on when it gets used. ACK. > >> +    const char * const *image_table; >> +    size_t table_size; >> +    const char *fw_folder; > > This is dead code, add it later on when it gets used. ACK. > >> +    bool non_streaming; > > Please run pahole on this structure. With the interleaving of types > for every other member, I'm expecting there would be quite a bit of > compiler added padding. Sure. I had ran pahole on this structure and 8 bytes can be saved. I will rearrange the members of the structure in the next version. > >