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 E444F3CCFBD for ; Thu, 25 Jun 2026 14:59:14 +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=1782399556; cv=none; b=loFYagQItiGORf8dlbT2iVIg1y7idOAfTxbT3IZGdG4OG3XzyaZmNWVaRAgRTShwD5wlaYJo9eGgtvrVNETwpjeyTkyAvi9M9hyDzIzmSwgpOF2fqWW0rNyCxewUxh7Cii1yh3AJ02wacrHLMcG7f0lo/KAbwjXvl25iO37d30w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782399556; c=relaxed/simple; bh=gnMm3WQJlNpev15bu9mc3FCVKCZx764ic1J3kbbxV2o=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=uWSi0Sz7f6FVu8Y6pYhiFffbzmMgu1VZb9xcv6vsJ0/pAtt+bh9WNJm0RcGdEej8RFJkzr0ROsyV2m4ptEe+5Qc/KLnrb4iG3kHojmPjBCNYd9jT14w6dGYbZ7fV5wVIEjpe+ocOKh2jQba7nPnMi8GV4IRtz4Drr5OJhPmI0gQ= 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=fwu5jO2E; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=DJQ22mPH; 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="fwu5jO2E"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="DJQ22mPH" 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 65P9kE9H1948562 for ; Thu, 25 Jun 2026 14:59:14 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= ERj4hIVMm3C/NLlG3rHWWiNfE6LvOTwPFfl/UgwDkeQ=; b=fwu5jO2Ewdyqmzs/ r1bI0rIr1HkRn0l9GKtU58hW0fYp9VAQv7qRv7dX7rCKkiVON6YwZoHBGn+HgFlC 72TmiL/qE68IZ5dE7rfInI2fLNKYt/vZZskFUwGet1leYhsDs8mCGxx7coDJMDqS LIgRRx6BFU/cdlaQHMrC7VzTBlWFjnbVdXPck4Xf600rp/RYmVOGF0xgpW9K02sy 380eU7J84BF3B+flAjocQM/8YKxk/KH7YOuqlPtubPmSi7DdGpKr+zJ3YuIiEyOV e1baaG9RIHmtMvKZWQjH766OEwBZnVYcAr8v5NBstoKYbJRr4S4tIE+oCTRr2I6e NVI6vw== Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f0ya8svnc-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 25 Jun 2026 14:59:13 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-51a71d34c10so10480891cf.2 for ; Thu, 25 Jun 2026 07:59:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1782399553; x=1783004353; 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=ERj4hIVMm3C/NLlG3rHWWiNfE6LvOTwPFfl/UgwDkeQ=; b=DJQ22mPHMnQsSshPTNx3GOoueG2livUiELTRZEoGWw6HLowOCalCEPaHuYiowlTu5o B9KjftlrwlSYiEXY1ZoDbyxIepCHgRzqrHlX1GwYT3m436xgWSztQKEauAtKxlrc921d 2fJPbNQHEh5WLiTjGbMD5g1lcRxH3P7GMzr9g68ukTrjGgLChZe8tLHkTjwcZo5Lw7/Y fOII/wYayaKjTfHkFN612f6jQqAyEyPUnGnCRw8Y1DeGPAXV71mps22/9QmerOr1WaOC 7gwNCH0nWBOa/oOc6Df7iWFGzCp9lW+vcK8ILnMIqm5C5luRhm4DmoH6ouFyQjsXDSjL qZJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782399553; x=1783004353; 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=ERj4hIVMm3C/NLlG3rHWWiNfE6LvOTwPFfl/UgwDkeQ=; b=MFcp+Z7L1xuTtIUANrWi2RQnCtk1YVK/0zrVSz8PThETLRbiIBVRmVBsXU+UlIznPj lspbpIgynThgdLNKXo6B5ZEn4EoELdnu+5OnJXzDeEKku+QMpG59TP3E018A/joxNgq3 vUZ/Grf7ohIgeVm7pTyfpPztDJGq64+MkrGs06ketdTTDA0xiVK1vS23g1+Ui6wG2gJG /w15rFoDKGS7XtKkfa1RkjT/8W+CFYupMXPVnaVBjiftyqdX7O6L6q183f8BnllMbY8V gmj5N9hfS6YJkOaA+uERcfO7hwKCuCD08/GeAJoNQPtzhyJ3m7emHvV3eZRgvkuWxxkE OEcQ== X-Forwarded-Encrypted: i=1; AFNElJ9fSKqx/hr7HYpF8QarsfS5qy9tR4y38GOSrbWX55ddkGWeju3atQXY8Ef0eSJI9gnr+oL4BvFuKSynEfM=@vger.kernel.org X-Gm-Message-State: AOJu0YwraCi7SEvsfAEcrblJv3nxSu1oXig2wym4TZx6JKL7qsgBq2Ty W5N2/oD1beyiUtOV0P9ANDajGd4wSSwDDwvz6GdIjHPgOaLHOXoQt5FqUsGzmsXBYTzNUApaV8F 9D10/7y6uqxEox95C2Ne/X7zbSY4Bwrd3XLiDAL8FtnZHpbWPOQFTWRcwBVg/XydkIEvsfuqOaK w= X-Gm-Gg: AfdE7cnSFaFZfG8KeXxGKiNN0WTZffYC+FSwNuVHENl9OTvtksMt/tACdsyrjpyuVYU z8seC/6Ke7yNat4jxHXhJnLVtj3H/jeTa03Ic1AVZIHbM+7qtNUDrZ3aXvokhECUz3hJnybK3w+ O8oXbD/MVWyO3yjBx1DKmT3j+7eCI4YooMcuRbcPkEdNzk1C0a/dc8vFlr+fzh2jWVt+guZyesx d2psmD6bjP3T3JmBqog8nb1T2AL4hwYjVUqBYewk+BgZx9CK0ivsminX0SmcIODRdIJhFHuf/6S DlX7GhKRrHkqadwcUTP0DfLS20q9JtnDbq/nv9YyymAz0iuueQ+royKPSEH9IghOuG9LdfayyS0 Zde907Xee3+x1WqYfIe5Ic7RR11h6Hvs7c9V4whUI X-Received: by 2002:ac8:7f51:0:b0:50e:6182:b4c with SMTP id d75a77b69052e-51a727b4fc7mr38548751cf.25.1782399553161; Thu, 25 Jun 2026 07:59:13 -0700 (PDT) X-Received: by 2002:ac8:7f51:0:b0:50e:6182:b4c with SMTP id d75a77b69052e-51a727b4fc7mr38548191cf.25.1782399552655; Thu, 25 Jun 2026 07:59:12 -0700 (PDT) Received: from [192.168.0.5] ([49.204.107.5]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-51a51ae8ee7sm73357791cf.24.2026.06.25.07.59.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Jun 2026 07:59:12 -0700 (PDT) Message-ID: <4ceb69dd-4c4f-46b4-93d2-4e4c7bf0146b@oss.qualcomm.com> Date: Thu, 25 Jun 2026 20:29:05 +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] spi: core: Abort active target transfer on controller suspend To: Mark Brown Cc: bjorn.andersson@oss.qualcomm.com, Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Mukesh Kumar Savaliya , aniket.randive@oss.qualcomm.com, chandana.chiluveru@oss.qualcomm.com References: <20260625-abort_active_transfer_duirng_s2r-v1-1-7439e3585ad7@oss.qualcomm.com> <730c2055-b29f-419d-99f2-bc4df3b6a2f7@sirena.org.uk> Content-Language: en-US From: Praveen Talari In-Reply-To: <730c2055-b29f-419d-99f2-bc4df3b6a2f7@sirena.org.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Info: AW1haW4tMjYwNjI1MDEyOCBTYWx0ZWRfX6JQxcFfp+d1N v+z7O5y8XnAuIWV4z9yFRhDccqt4tB+6lMcLUHUo8IIr/lHpreMNSKpIto1cwmk6JCFrJzOQFIY SyAqkCDmsC9sqzHeR9cFE5x85GX86ZM= X-Proofpoint-GUID: 7KEf0IJ6bfV-7VxhnNDFV0d_haTt5Koy X-Proofpoint-ORIG-GUID: 7KEf0IJ6bfV-7VxhnNDFV0d_haTt5Koy X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjI1MDEyOCBTYWx0ZWRfX//W9dB2SXUsl GrMjO5hdXxI6lqa1Axc2uJ5iOOi7nQIhcbxv0/1QE9A5XJME1RLN50GwEytTGLS/rVjXX+nttxy BcwQB4Yftqvdb/xApS4hHe1buYiOcsvvNBj0KpDN91Tqh7VDnpYZu+NuyLyPUMPL+NH4zEmGGZH MTna/pijGaC/vXLJ76oYJPOKjqtGNqEXKU+rB6mVmG8AJEEIADtig3DMiK8YvuBYAG1+X5Qy5/w /9x00O3O0GC2mgVljRb76sbaO1GF6NI+EmHa0ftVzIio3jsoiP1DJ7BuEncsG206NYZ0BSvmPpl Qu6Gf3qxxpi4HYnhPdqxXHZD/aIlgwyQ+gfHmi/Ynmh7Ktfn+Hqeh+el8fRSN1Iwo+m+HGS3Xkh xJ4nCsR+/tt4n4RyjNXFUzvJgoNj3B64pKvy4HwJpk/Zy5cUvrN8s7n+Pcwp3l4nPWTUeNGOYGm mJ1hp3ZJMrazk4qaRNA== X-Authority-Analysis: v=2.4 cv=Z+Xc2nRA c=1 sm=1 tr=0 ts=6a3d4241 cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=EzYcgOYpdvJVRNjdZ+O3HA==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=0Ud4EHsjdzI14k2cJ-sA:9 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-25_01,2026-06-24_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 bulkscore=0 suspectscore=0 phishscore=0 spamscore=0 adultscore=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606250128 Hi Mark On 25-06-2026 18:57, Mark Brown wrote: > On Thu, Jun 25, 2026 at 11:09:35AM +0530, Praveen Talari wrote: >> When an SPI controller operating in target mode has a transfer in >> progress at the time of system suspend, the suspend path proceeds >> without aborting the ongoing transfer. This can leave the hardware in >> an inconsistent state, potentially causing the system to hang or fail >> to resume cleanly. >> >> Fix this by invoking the controller's target_abort callback from >> spi_controller_suspend() when the controller is in target mode and the >> callback is registered. This ensures any active target transfer is >> cleanly terminated before the controller is suspended. >> >> + if (spi_controller_is_target(ctlr) && ctlr->target_abort) >> + ctlr->target_abort(ctlr); >> + > We need to check for an active message here, drivers are going to > assume there's an in progress operation to cancel - for example the > pxa2xx driver unconditionally sets cur_msg->status during abort which is > going to go badly without a cur_msg. Yes, i got it. Our spi driver had that check in target_abort. is it fine? if (ctrl->cur_msg && spi_controller_is_target(ctlr) && ctlr->target_abort) Thanks, Praveen Talari