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 54C9A2DB79C for ; Fri, 9 Jan 2026 06:36:48 +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=1767940609; cv=none; b=hNK7Smkm/O8w5o5t4l3U5ycjgWBMBMpmWLpKi08VOf5uLfHQQ3MJ4/RvtNHH2Rtw1HoTV8rF3gTwnxCh1BlwAnR0+xw9LO9ZS6S5vQ+PTSaSdJhnDDI1LLcFvTI4j6B5YMU584zLUbhZuNQHcp8x2ywRnFBzOQzl0mkOrmEaQco= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767940609; c=relaxed/simple; bh=Yjp1f2xBgBoP9g7qHeCglH36dHiwxKcSgZAm4VCj+WY=; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=EOXDtp39028j7vUU9TI4U+fkbyECR/iLBnt+yKxFeyp+rlFqsrwfIjFmM5FiQiUZhVYcYChCf+SmVxCiYdgPMpup50DeEmdkw1PypeVeDFP3RBMgfYgqHJGzU9NZHTM1cVtTbH4cd6Wl95zWQmjq8rD4pEYTacR+8jK0r3RB2qw= 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=fd0cdvUt; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=NYMiZ9mj; 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="fd0cdvUt"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="NYMiZ9mj" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 608MplVB3220044 for ; Fri, 9 Jan 2026 06:36:47 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= iEFLRadva6gNexYEwvb/IO34UQ3Sw4d6m5bd4ftOyJQ=; b=fd0cdvUtF1dKeFB8 f2pIVWa4iOpwoEujM2Q5vuGos/seUIdCmjr6FeBF872A7FF2DJrFsPHLqCqXwvbP /7UbNCbrc4ilgfGnY3Av5BTdcyBKRONZ9ZTT3nti7x+GlDXxwHX5vmoQebVFKE8r fCFNy8guY9GKzN/K8GH3TDK2ETw6xfxQ16Kw9voY0n4qTl/Pxtl6ReYBO3N1DVme mIkyKYL3HdXoHGfxN2RvowYva1716SZ91D4gcO1vgqSfuQiWfqICOR+IoFxqTWpO VXBrn1IgHeHlQW33RSbTu5bXJwg639Eq0uQDr0KBNLfXMDsfqUpklHdx9ZWh/IMv pX4Gfw== Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bjjt0hfbj-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 09 Jan 2026 06:36:47 +0000 (GMT) Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-81c68fef4d4so3182382b3a.2 for ; Thu, 08 Jan 2026 22:36:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1767940606; x=1768545406; darn=vger.kernel.org; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject:from:to:cc :subject:date:message-id:reply-to; bh=iEFLRadva6gNexYEwvb/IO34UQ3Sw4d6m5bd4ftOyJQ=; b=NYMiZ9mj093iq8cIzJ32kIWWcK5kSvu9fq2LkRJOz37O0jwLmJPTBPAFTS8JS3IJ9G AbfZm+8VmcwCNWFAOKlqA4fFTSkTGYWCjS1mpJNpR3kM0OToFClGsO0OZyfmJuB8EqJb x5wEbYBIZ4HpywIO7xcocYZAkk44dzQWoAtt/lCmGoVrH4CaArOMYBRMRO0lECNwC3y9 SxaQn4TPB7m1JEqWxCyObDqFZDwokidV0thZUYBj1rURNalt3mtVDNlBlJRjDe6LNsHb RacQVhQu1+hw1TsHxeSJWVVAXKxQTqx33w70Zwnyjybp02QswMo/oJKfV8vgGb4/bFaR cq8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767940606; x=1768545406; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iEFLRadva6gNexYEwvb/IO34UQ3Sw4d6m5bd4ftOyJQ=; b=Lbx6/hiyAW2Rbno5TulmXF44lKbvFucF/E21N+A/dFV24oaufYpekI3ImWeYX4ZMNe WqILOcUIIg7n3XIgNJR7zQOty0KLYeTvd/KB9zfyTvIMj2m/l0ew06YVoxRTfK2sW/Ng Jv+fq9l7T3MmA4C74HH3BidH63+Yj8c1HSf7d2q/eWudZrxRBXM68ySkGhjg2uxt5Isq unFutaUyp92UAletkslMM97Q+GWBQcKhvqZjxhwsZbWj+J0kuMCBdqCTi0zDzkcuDlBV vE5mVJqazcfNjFyV+t0vT78JqV4ZVmN6DuOTU65hPPHADBCFaKYjb4oa4WyBZWOyrVEj Do8A== X-Forwarded-Encrypted: i=1; AJvYcCUHPx0XqQ2ittUwm6XOqN/QJAHA7MxfO2RxLMdMI5Ue2/ANOGXFOEo0pzY2CBO8qFg5oBdIBso6Kfc7KIQ=@vger.kernel.org X-Gm-Message-State: AOJu0Ywx/hSgy9C5TCC67m6HcVgaWQgYra60ttIkL5QwaO+M/Gxl4k2Y zRf+z+eX37bY0ecmpRDKt/TYZEuhCLLV3oQNeWuHgts/Izntr+v5jiO1SYYQZiQHoVf/qz7Jei7 2OaykxmdbHeo8m7kxPbZHHOvVtTXIWVMwWo8zq+mii30+uEqPmVUpZBG6Q90C8FAt5yg= X-Gm-Gg: AY/fxX7tUJAMdbeTLC7uQGsRMY+ULTId1Hy5G8m4aLbdEZ7r+oFnJfwaBdwsfNEdBkm Ta7JCcD4iuKYp7CxvcEQAmAAkZKxaACzvT3wQPnvt4Vtn1HQYnlEK1U3G3zPCM/2a4T6hEhBh0a 0EGCOm9KTbKvmnPcyrgMMOckLYCXgZk3aP1ghiUdVA+PabXbWwwcM9KSc+FZA1RUlp1ar2eRLA9 qSPtyfXg8yv0dd9UHtPGTeYyY4VIK6WS/7Htu/OtkDk1hu9hqWCmPzPflPA5ypgm9oSiX+CDSs/ 94B3DGPKpskAlTILxo2ORoPe6MG76lvCLHQyQd/mVceK1Yl5ePoLQyxqVuNZ9mETU0yabfY/b93 QwNYEusRz0fLFtLfQNdNjXQ8YKUy6FPnIvnQk0vo= X-Received: by 2002:a05:6a00:1d9b:b0:7fc:da5:f84e with SMTP id d2e1a72fcca58-81b7f4ed826mr8021675b3a.41.1767940606235; Thu, 08 Jan 2026 22:36:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IGXmqeKdNgTpsm0+9SyEU6DclsUOksJFj9tPdAfgRkUb5PrdJpec6P3Gn6Rk3hGo2QSnc2vbg== X-Received: by 2002:a05:6a00:1d9b:b0:7fc:da5:f84e with SMTP id d2e1a72fcca58-81b7f4ed826mr8021644b3a.41.1767940605737; Thu, 08 Jan 2026 22:36:45 -0800 (PST) Received: from [10.217.223.198] ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-819c52fc9bdsm9345543b3a.32.2026.01.08.22.36.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Jan 2026 22:36:45 -0800 (PST) Subject: Re: [PATCH v3] mmc: Avoid reprogram all keys to Inline Crypto Engine for MMC runtime suspend resume To: Konrad Dybcio , Debraj Mukhopadhyay , Eric Biggers , Ulf Hansson , Adrian Hunter Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel@quicinc.com, Neeraj Soni , Ram Prakash Gupta , Nitin Rawat , Sachin Gupta , Bhaskar Valaboju , Gaurav Kashyap , Sarthak Garg References: <20250718110217.1929526-1-quic_dmukhopa@quicinc.com> <42797330-868a-bfcd-e0bb-b5f0dd3eeb16@oss.qualcomm.com> <9a07d235-d1be-447b-ae89-75aa418cb69c@oss.qualcomm.com> From: Neeraj Soni Message-ID: Date: Fri, 9 Jan 2026 12:06:40 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <9a07d235-d1be-447b-ae89-75aa418cb69c@oss.qualcomm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: wsb2hl9hrVkfrd2R1LDy6ce7Ifecnfwj X-Authority-Analysis: v=2.4 cv=VJzQXtPX c=1 sm=1 tr=0 ts=6960a1ff cx=c_pps a=rEQLjTOiSrHUhVqRoksmgQ==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=COk6AnOGAAAA:8 a=QbZleMWpBfZgLPXxXDQA:9 a=QEXdDO2ut3YA:10 a=2VI0MkxyNR6bbpdq8BZq:22 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-ORIG-GUID: wsb2hl9hrVkfrd2R1LDy6ce7Ifecnfwj X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTA5MDA0NCBTYWx0ZWRfX/2b/hqaI3lk7 i9rtMz21GbEJKxHrVoGX4rqqdYGRmN3Oy3vLNGfGdDaQndqAK+SjSRkYnOs9avBgSLGK0xpwzaI MOQHB0hh8oqamgDa+mamuIKecmX+ZqrjHcDQqSvbPJ7/JMMsgxGLeMrbSrRu+jdBy94ph3iB7/n +06mptxO46gTwHgdAjC1XI0LmlKQm2YpXP2adib98VxEfVUAJV8elFNduuPuKa38P2BUQc3XmBS mwbY6a4V4ivoMh3NkWFSxjagpLd+tC9MSJnFEBVJDGVwY26tEXRhaJGHQnn6Tzbw267yMI/nIqC N8+tVB5ihWr461XSJCkXxvAjf94zA0a4GR/aml2yfJAYfqXQlziU6vbCdZSpGZn2LC5yRX5T8yH cpetj9FhX9YuGvVazPyZx53ZvF0igFC8UylW2rpySlE5qsMIA49tkYx6PRY98yw18LwvzS4vP7q bkyyQOzNob9qeHpyGGA== 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=2026-01-09_02,2026-01-08_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 spamscore=0 phishscore=0 clxscore=1015 priorityscore=1501 adultscore=0 bulkscore=0 lowpriorityscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2601090044 Hi, On 1/8/2026 3:13 PM, Konrad Dybcio wrote: > On 1/6/26 7:49 AM, Neeraj Soni wrote: >> Hi, >> >> Aplogies for replying so late to the queries. >> >> On 7/18/2025 5:35 PM, Konrad Dybcio wrote: >>> On 7/18/25 1:02 PM, Debraj Mukhopadhyay wrote: >>>> Crypto reprogram all keys is called for each MMC runtime >>>> suspend/resume in current upstream design. If this is implemented >>>> as a non-interruptible call to TEE for security, the cpu core is >>>> blocked for execution while this call executes although the crypto >>>> engine already has the keys. For example, glitches in audio/video >>>> streaming applications have been observed due to this. Add the flag >>>> MMC_CAP2_CRYPTO_NO_REPROG as part of host->caps2 to control reprogramming >>>> keys to crypto engine for socs which dont require this feature. >>>> >>>> Signed-off-by: Seshu Madhavi Puppala >>>> Co-developed-by: Ram Prakash Gupta >>>> Signed-off-by: Ram Prakash Gupta >>>> Co-developed-by: Sarthak Garg >>>> Signed-off-by: Sarthak Garg >>>> Signed-off-by: Debraj Mukhopadhyay >>>> >>>> --- > > [...] > >>>> @@ -459,6 +459,11 @@ struct mmc_host { >>>> #define MMC_CAP2_CRYPTO 0 >>>> #endif >>>> #define MMC_CAP2_ALT_GPT_TEGRA (1 << 28) /* Host with eMMC that has GPT entry at a non-standard location */ >>>> +#ifdef CONFIG_MMC_CRYPTO >>>> +#define MMC_CAP2_CRYPTO_NO_REPROG (1 << 29) /* Host handles inline crypto key reprogramming */ >>>> +#else >>>> +#define MMC_CAP2_CRYPTO_NO_REPROG 0 >>>> +#endif >>> This (and the crypto ifdef for MMC_CAP2_CRYPTO) looks like unnecessary >>> churn - crypto functions should never be called if the config is disabled >>> in the first place >> Do you suggest to remove #ifdef? I am not sure why #ifdef is used with MMC_CAP2_CRYPTO >> (may be to reuse the bits if config is not defined) but for MMC_CAP2_CRYPTO_NO_REPROG we >> followed the approach used for MMC_CAP2_CRYPTO. > > We got plenty of bits, let's not waste the time of a programmer trying > to figure out whether his particular combination of configs is going to > collide with the reuse, I'd argue the ifdef is unnecessary > Sure. I will remove the #ifdef from MMC_CAP2_CRYPTO and MMC_CAP2_CRYPTO_NO_REPROG in next patch. > Konrad > Regards Neeraj