From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 25497392C23 for ; Thu, 8 Jan 2026 09:43:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767865435; cv=none; b=VGJI0vSiPVf/vASoR7Gyxhy6CogCLpEpAWaozkHhy6vZQwF2DCOKWGdJSfzH5txZvWpvttxlCm5Jei0/4/KVLr8KoDnm9n8eZ5N5BVzFeh9l23s2ALVh6ym2ol5FgO0EYaCy5vJThEVBIdUhhVnq2ht0OkWKZgWa0xhQvIMSfoo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767865435; c=relaxed/simple; bh=xb2t9fuqAN32eAfCtivOT4VGyRoKb0T7I3TThBH2kjk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=j+vyIY3kLMGn5bYSJY28md6t/qph9sF79VGXvzeMtEQfCZixiqR/IhBFiegfaW6okrKd2DJnqcqmCmfukZXplwwVnk+KYXx/Zx84zDt3Nm86JNTW62SRs3x5pKdBQFRABTOrWO++UBnDkfoGeeRqxG/HXjWS7RmqfHAmTOjnvjA= 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=EiFxQghD; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=HA5u+DVR; arc=none smtp.client-ip=205.220.168.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="EiFxQghD"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="HA5u+DVR" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6087VSLw1838190 for ; Thu, 8 Jan 2026 09:43:45 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= 1S/SJSualiLHoog7gYmMZjK2UQzHLZG/FAAg4TnXAIY=; b=EiFxQghDNnuz631c mncQ5/2qHOjjbLpYSVKwRShGtdjjej3zFDHKb0psMjfD7LS3TnzCZhjqiSw8GLbV 58C1+DHOR/31RXnhFK6nq97RzZQStfz6UY/VtWaudI85xXZSb3B5h/IsEnM2zIeN a/81dNXZHMP4T+10iTuXVMbf5XeGTF88cec4IqpaYcX7wnv1nYAwnXILCClGEjE2 6r+SrhuRsd5kLUfY3BEcxOOSnia7HOh9z9wdPe7RVQT64slDwUGJ112Tt61z7EP9 b0d3Xup9qTiHWFWtCA5oOoWy6sUSRSg15cXoZ0U4kutUc3a3DkWW1HpzPQxu/OOv Xaowqg== Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bj8920dev-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 08 Jan 2026 09:43:45 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-8bedacab1e0so101103085a.1 for ; Thu, 08 Jan 2026 01:43:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1767865424; x=1768470224; 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=1S/SJSualiLHoog7gYmMZjK2UQzHLZG/FAAg4TnXAIY=; b=HA5u+DVRZW6V+qCMOScu2s2qTMvhhmLyJI0kDTH2n/0VYXhCSuNFGTAYBJ2of8O03p O4s2PRkvz/WO6ceiw+UPXM3sCNOyewwVKvr0D4VA8nE8HxP5mBZg90IBhOdOHRqO4qS8 HMT5i5geX67u4LslrnAaGeXz0BcdUELiDa8Z0ruCrUgAyWtGj2lSIRqUd418PaL5zska PY1DabZRZf+D1uwMZQhN/ldgWJdxyR31S0vkuYlzZCvuULTovBQTYESN0/GQRz5r4f6X mjWEgUuIU6dOGDW4/jxlvYxOunXuga63bNkQcmsmaK9B9kSzOqiNnJ7ANF3quBnWr1/G SDrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767865424; x=1768470224; 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=1S/SJSualiLHoog7gYmMZjK2UQzHLZG/FAAg4TnXAIY=; b=u7Drf6fRn+rAjUbrlg0zzsJx/hINDiiGIOY5AYoCPEAjRdiQBSD7i+SdrZvZLhBFrk 16Tm6o3kBsooVdosI0Fxyvg9rmijPswBFEiz/10X+y9+Z5mbxLTPg2wmMEy5LU50yOk3 Tehaq07RbNKz+KPjWPPFP8OzyzdEWkgCCo3KSnS5hdapPG2N5ywsHCwJNgDt9f93Xhd9 94K6UIS7A+S/5GYCRo9d6h3AoXE0DD8G38uG8iC130QK8LOKUdFIFPHFWIyZNezVw1Ox cM8ZemjkfawxQkDr5PbXs0YaByM0vMc6iDePJrb8NFcnouQiZNxM/hhjEny+f3gRVTa7 qoHA== X-Forwarded-Encrypted: i=1; AJvYcCVnu2/KlV24VeEUVITX/6VKnqsqrgMTzKWAU2RgbanYyaAcaXWYqmA/thvRTW1DCgkeb2yCQp7A8sWI+Es=@vger.kernel.org X-Gm-Message-State: AOJu0Yxjc7SHqhaYg/75ItbUAprWSqW75H0m9fmXBa1Z3+XpFJwEJcGN u/nNUUx9FAM3dFD7wVa7RKt73nxiQdWLo3loqB5kIACCTWCRgrR2tkDFF81/3+refMJbm1NGwVn GVdwz00oXqnIpQ9sWeakEY2YQYL7FPN7NB6R3h8whKBsukj7uwNAL0hAFY1lpwWZgrz0= X-Gm-Gg: AY/fxX5JGp7Q0/MA385IRgeUBcC7K1vVwYZAXGA5HZ23uEfLrc9XDNQDJJA8LuMx4K9 E7ubi7b1dnXlYNMltXMYMo+ltDPfFSPu40iFvMJ9IOSVZRekfKHXySs8a/A5bfTAFjnaRCnrv8I R2AVtjX3Pz5gr6/jCJWbZiIxMD/X3qyYwv4g0yESI1oygkncZQ/GDjmKMU3I1qHYOZqXjTU2bi3 OoBOTp4Kwo+2mme9FFRVSIOYMPTiT4y5+asaGCsbJqv2aDswJeQQcETmv04V3+ztJQjAGyg/6qf UIL+sXFBo79VjnWhShJNa9rH0hSVufZHsrtdtibNxAIkqBNkjUs3snRjwuGhwdAfjbY8P78wLQI dYQbKCkQlR+nWdz2qogSTBNnPezMb0qlwM+cj8EHSlZ2AhIKnV9JfoXk7hIhrgpuEwqo= X-Received: by 2002:a05:622a:1391:b0:4ed:a574:64cb with SMTP id d75a77b69052e-4ffb48348afmr59372271cf.3.1767865424263; Thu, 08 Jan 2026 01:43:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IH0KmtDjEhwCNfMambL7JRj0tCsjfjIbX0aoZ/QvSSwV8dIawI6CqtwPZ0+wspQDlKN5Z2YAg== X-Received: by 2002:a05:622a:1391:b0:4ed:a574:64cb with SMTP id d75a77b69052e-4ffb48348afmr59372061cf.3.1767865423758; Thu, 08 Jan 2026 01:43:43 -0800 (PST) Received: from [192.168.119.254] (078088045245.garwolin.vectranet.pl. [78.88.45.245]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b842a51183asm774258666b.49.2026.01.08.01.43.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Jan 2026 01:43:42 -0800 (PST) Message-ID: <9a07d235-d1be-447b-ae89-75aa418cb69c@oss.qualcomm.com> Date: Thu, 8 Jan 2026 10:43:39 +0100 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 v3] mmc: Avoid reprogram all keys to Inline Crypto Engine for MMC runtime suspend resume To: Neeraj Soni , 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> Content-Language: en-US From: Konrad Dybcio In-Reply-To: <42797330-868a-bfcd-e0bb-b5f0dd3eeb16@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Authority-Analysis: v=2.4 cv=M45A6iws c=1 sm=1 tr=0 ts=695f7c51 cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=FpWmc02/iXfjRdCD7H54yg==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=COk6AnOGAAAA:8 a=woFbFkuD7df9m7ThD7QA:9 a=QEXdDO2ut3YA:10 a=IoWCM6iH3mJn3m4BftBB:22 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-ORIG-GUID: 27CvydSQWlK7bItREXaiwqejEHhUx8kp X-Proofpoint-GUID: 27CvydSQWlK7bItREXaiwqejEHhUx8kp X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTA4MDA2NCBTYWx0ZWRfX1bdPYWrwyUQY vXo7yRq4IyJQKCS/uyrnHTLewp1BJhrG5tVU6KrJoQRDzlV4hTonBsRBdjEMwBdhKIuRAs/w0h7 gg7p0j/jq8Rg2DsuoS81PcvqnXtWA07vBrt4zbD2af7wpcnPHtAc1I5oH/XI/7EtiqKwpqDGVTs 03Q7Q/5B3Lz7wgrbOSg1Eh206xdDSqD0X17b0VoU/0ZfA1VWPIRTm/VmrgGv6yTaf26Qee7YDb6 czfx6SI3Tu7hXF0uBaF6j9glNXr0w3wdpgEUvdtgwnoMWVs78VG9hxD4sqnV36p3QogfZMLZT5p YK31l4+DAOfbpRn8cYJ6SR66xYV9TnUxzzvGKZfh1sqlEcSza1mFonsbNpTfFTpec77mSDnEZ3P 3ivHdduhpTv6n7rC0+9TNaTUnkx8mdD2et5QcaY/RhzQP3q7Y4msawRQqIQjxKjyyR9cFpsSLML fo5OPYapk/cRFc4Unww== 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-08_02,2026-01-07_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 bulkscore=0 phishscore=0 suspectscore=0 clxscore=1015 spamscore=0 malwarescore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2601080064 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 Konrad