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 5E72A1DC997 for ; Mon, 29 Dec 2025 20:20:10 +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=1767039612; cv=none; b=uc09T3Oux/WFBfPzEZF8SNyvkrN2s37dcWSpC0AIYYQJfz1BjGXY26O+rKQiBGx0qW+s0t78dkP97Z4YjREnHnt/0lO7+6tScV0EY7DddRKrrjQSn0VzAj7NEa04D8BzTJpZm8HEmz0ixWnMBVOsdw92Q62jMZw+CwqjfOkKLUc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767039612; c=relaxed/simple; bh=BwsOeiT9u3rzrRz11E8mkHEqiVBgJs18hfyrJTOTuh0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=mX3leONUuFBKYWvQocwfrjVuZ3QnfKKam061NkInlH3wXFgZlmwEmj/lTX0TI710bZA5N+BDQHLVM3+T6JP4ErRXbmpWGBBug4p6iRdxJUIL6XEk4Wcd8tarK3/Zs+o9xNSAp4YIRAfamVeGd+pPoNxmYjl1uL+OQ2lNUop8msI= 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=DRwYQYc6; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ByFV6TeC; 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="DRwYQYc6"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ByFV6TeC" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BT9Xfpk3754970 for ; Mon, 29 Dec 2025 20:20:09 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= 7MozNexHgJw4PP86LYlmpf5GcfoVsuHBu4VnE8EoW0g=; b=DRwYQYc6xXrnDYfr 4zRQWdR3gjE1qZXQA0FLzBPH7KkA61L1rU+1UwsFW2KeVAg4ylPLhHzsLwcVreoX RBdj6tQj9QdRrgeLzrsl9GpeAnO+WoQdhvIEUBuimZ9l/doWI6ATiXrc9yweeazI 0WGbiS69rwFLUA6BPpDQDeXEmw4d/qGbTHIsUTwP9aVSSxNsunYUOzvw1gSlvW27 Z+BdYghv3ZbMC269yXSZDBdNq0HrXwcTmJebFHgnbGo9qXqrwliIMQNXSlZGqjrQ U2VvdGIzyWc78GnzV4TFHUmOHt54ps1lb6YANvyCvR1MDQXnnDmUngnPDhMu9DR+ OcPABA== Received: from mail-dl1-f70.google.com (mail-dl1-f70.google.com [74.125.82.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ba71ww9v2-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 29 Dec 2025 20:20:08 +0000 (GMT) Received: by mail-dl1-f70.google.com with SMTP id a92af1059eb24-11bd7a827fdso17718500c88.1 for ; Mon, 29 Dec 2025 12:20:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1767039608; x=1767644408; 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=7MozNexHgJw4PP86LYlmpf5GcfoVsuHBu4VnE8EoW0g=; b=ByFV6TeCwejM9c00g1m657kaLjF+tU6LuWF2ToVTI4euAP82wg7cbSedeHIsyVvfy2 agaLvGol5K0YtXtI6yaGn3uXKWMKQMPtwizXVVLBwIRgP8PELlCglXliRZIvOk5dJTKG 5vGaIIUMzZmUa7Nar5owsg6Ap9sDiH2FcNu5xhy73vgQWvFgdnzxgbMyJTyetDh2/fS8 qXjrsE4jLahYIuipKrLqcw3NURMEi81VtQ44Blk7RuvR8xSGg3lhozeCDpf8eHJjCt8Y Y/en/m/uoIsHgNFDofXV8is5MhhV4he0R6PiI4XrHRVS7jBzlB67D/m6iDXGtz0Sp7Mt J+fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767039608; x=1767644408; 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=7MozNexHgJw4PP86LYlmpf5GcfoVsuHBu4VnE8EoW0g=; b=TA0eC28PJcjKlrWpawaYW+YkNnIAR8yPmCeQPNIlYnZj67XFRtv5mu7gY+a8PFk6M0 rRT11DTbvZyK9z4OIPLrZuEUpRCGJAP2S8tm/+NjKMuUxBUEXMginpyGD/wiA4iMLQgf YKQrIK1KWvwA4lsq2OqOtmmsRYFkyQ1uf0+NkPQMAycYmwmLOjTxVIcOkq4LIFnLI0dq 1cf8ADZ5exyo6M6osF2n9halPiYWIVzqujSBERwf0WRHiskRXdOgFLTQJwXGHvIM4wRi n7psf+56JknmsG5J+fmXUFa7pMoqO867N4EtduvB8L5zBkYloP8K6ZMRvQKJfdttQxxm OvTw== X-Forwarded-Encrypted: i=1; AJvYcCXf1RjZt4bw4Yz8qmdFNOlF9jq6WDxQ4Y9SgoWAD5kgovvjRZKvy0p9tiMSnTF/syPjyqaO7JBMpon7t+8=@vger.kernel.org X-Gm-Message-State: AOJu0YxOTwlUu+YMv/nDcN3PIHRGdx4o7ljwsconzNbG+47MYDYeiA8y oQXbTYbbz/N/QRaPp0eyQkO/AO9Y56Q0X713KDD56AMLiS/d+G53v8vt5HgFPrQ4u+Tyx4o5em6 TY/LIMvEkX3UzjZEfyvCYG/GRGi2cSBh26u1rCdWgP+RgdH/lgrTtTWxzOLyhMGeDA+E= X-Gm-Gg: AY/fxX4h11lD1ZmsbozeVSItGZvnMEU3BTC4W7E87ad/+mfG5h3faehAhhHUOQQScq7 mJ9CRyiWyP+LpAdx4O8smtAw0UHcscU7NJy4cV8ZVOKrOIwM+oyqZ4YUR4eFrrwn2EU9LQQQ7Ew YtKhAwRQkbeU1BOoQXbOVa2wOoXf63wrfJHuoVtuINHLeSBZ7VFlL4nHOzzDeQu6OrtFDkl3Okr fbmy45eGtsg890/qYQlJw/eL9hJlSQCOj2t7Tqg1RrIeLQp3ufbCHrRkqdMgYacZLwFHZKxKk9V Ef/xlRp8mYxmCgejfUJIUvtGxW8+cUNGsoiUL9HH0pgLtynsTt1aYoMMybhmVxd2tCokqZ/sn8y pq4abjobA+vSIrFy3rqlRX+Mv7m4wLxseHMAnVOMRUznEiOUVtTzi7CKapIvd53c= X-Received: by 2002:a05:7022:e1a:b0:11e:3e9:3e8e with SMTP id a92af1059eb24-12171afd95bmr24941777c88.23.1767039607755; Mon, 29 Dec 2025 12:20:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/lwK2wTaR4697pd1i+xemc7zfhrLFxVX/r/0pN47IvpGex944GuH8FMyKdtpVLY3DVSOxHw== X-Received: by 2002:a05:7022:e1a:b0:11e:3e9:3e8e with SMTP id a92af1059eb24-12171afd95bmr24941750c88.23.1767039607116; Mon, 29 Dec 2025 12:20:07 -0800 (PST) Received: from [10.226.59.182] (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1217253c23csm117915702c88.9.2025.12.29.12.20.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Dec 2025 12:20:06 -0800 (PST) Message-ID: <60aea371-915f-431d-88dd-3be633dc2bcf@oss.qualcomm.com> Date: Mon, 29 Dec 2025 13:20:04 -0700 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 v2 1/2] net: qrtr: Drop the MHI auto_queue feature for IPCR DL channels To: manivannan.sadhasivam@oss.qualcomm.com, Carl Vanderlip , Oded Gabbay , Manivannan Sadhasivam , Jeff Johnson , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Greg Kroah-Hartman , Loic Poulain , Maxim Kochetkov Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, mhi@lists.linux.dev, linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, ath12k@lists.infradead.org, netdev@vger.kernel.org, Bjorn Andersson , Johan Hovold , Chris Lew , stable@vger.kernel.org References: <20251218-qrtr-fix-v2-0-c7499bfcfbe0@oss.qualcomm.com> <20251218-qrtr-fix-v2-1-c7499bfcfbe0@oss.qualcomm.com> Content-Language: en-US From: Jeff Hugo In-Reply-To: <20251218-qrtr-fix-v2-1-c7499bfcfbe0@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjI5MDE4NSBTYWx0ZWRfX8MCfIJ2NeXEq SO4ZI8/Ioo2OffX8s5rNGkfCxlpV+8nI6E7cyFABUfaSHUIk0lPUTj1XbhWTaw0mIuyyS8xLiMw tIWXgT29mP+o2LkEY/A3mcTuH1T8XOLaJfyxhrunMypgP2CDNtdEyeaX0myRCYCekgQF31C+wii nlP+DVRNgCcyB0aPXBEyDKZLPQgjr57T3fJX4/DbFcL1sT8obORvSoRli6dLAy4jDEzJ9leKHFa B2Gja5DP3cef7gbVOx7B/vO1D/1dIcoON5FrV8w52E/Tu2y8ed5rEP76Ydz+tKB49B9hvLWqVRH yohLl+4NMlwlWPDv/1Hp994NwreUaeCr2VX/fmNWszVDfDoQ5cQi7ZTfG+SjOTTRcE2FREWYT8j RNEAFcTY6AFkPk7fEzn4/rvecdpdSLhplpD+3wTqzb51lwZES1SoFloLTEXMdwyDSyNt1nbHxkG x34uPF39yc6kXx0ii7Q== X-Proofpoint-ORIG-GUID: ULZnObmP6SgnPE_8jGrHLpLWmxAhz7ih X-Proofpoint-GUID: ULZnObmP6SgnPE_8jGrHLpLWmxAhz7ih X-Authority-Analysis: v=2.4 cv=CK4nnBrD c=1 sm=1 tr=0 ts=6952e278 cx=c_pps a=SvEPeNj+VMjHSW//kvnxuw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=zitRP-D0AAAA:8 a=EUspDBNiAAAA:8 a=COk6AnOGAAAA:8 a=isMaZ9OHK7bkWVW8W2QA:9 a=QEXdDO2ut3YA:10 a=Kq8ClHjjuc5pcCNDwlU0:22 a=xwnAI6pc5liRhupp6brZ:22 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-29_06,2025-12-29_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 clxscore=1011 spamscore=0 adultscore=0 suspectscore=0 priorityscore=1501 phishscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2512290185 On 12/18/2025 9:51 AM, Manivannan Sadhasivam via B4 Relay wrote: > From: Manivannan Sadhasivam > > MHI stack offers the 'auto_queue' feature, which allows the MHI stack to > auto queue the buffers for the RX path (DL channel). Though this feature > simplifies the client driver design, it introduces race between the client > drivers and the MHI stack. For instance, with auto_queue, the 'dl_callback' > for the DL channel may get called before the client driver is fully probed. > This means, by the time the dl_callback gets called, the client driver's > structures might not be initialized, leading to NULL ptr dereference. > > Currently, the drivers have to workaround this issue by initializing the > internal structures before calling mhi_prepare_for_transfer_autoqueue(). > But even so, there is a chance that the client driver's internal code path > may call the MHI queue APIs before mhi_prepare_for_transfer_autoqueue() is > called, leading to similar NULL ptr dereference. This issue has been > reported on the Qcom X1E80100 CRD machines affecting boot. > > So to properly fix all these races, drop the MHI 'auto_queue' feature > altogether and let the client driver (QRTR) manage the RX buffers manually. > In the QRTR driver, queue the RX buffers based on the ring length during > probe and recycle the buffers in 'dl_callback' once they are consumed. This > also warrants removing the setting of 'auto_queue' flag from controller > drivers. > > Currently, this 'auto_queue' feature is only enabled for IPCR DL channel. > So only the QRTR client driver requires the modification. > > Fixes: 227fee5fc99e ("bus: mhi: core: Add an API for auto queueing buffers for DL channel") > Fixes: 68a838b84eff ("net: qrtr: start MHI channel after endpoit creation") > Reported-by: Johan Hovold > Closes: https://lore.kernel.org/linux-arm-msm/ZyTtVdkCCES0lkl4@hovoldconsulting.com > Suggested-by: Chris Lew > Acked-by: Jeff Johnson # drivers/net/wireless/ath/... > Cc: stable@vger.kernel.org > Signed-off-by: Manivannan Sadhasivam Reviewed-by: Jeff Hugo For the qaic bits Acked-by: Jeff Hugo