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 A88A135C6AE for ; Fri, 31 Jul 2026 06:02:09 +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=1785477731; cv=none; b=JIwjf+7b6xmZ4YTyS3wGP7P174peNen2fFQQj8KlZ5YwxkhNd/z2gE4bJpYWvUAAH7Yjr5NO93A/xUbtNISoB7OTa4I6+oTHR/5WCX9AXvZE4Rr048sCt0PentDe9DMcg/eK6+o5HblrMru+JToaMLBgPk0ebEaWDDtNgOT2sdM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785477731; c=relaxed/simple; bh=YpgtRJcar+oxR5vBEAm/0t39UJXbaDoA14eKb0ck2OI=; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=PmZTYcllCMfkdh38AyhUMuX3YB/gCYcVxGIpPuj+GO9AITJnfw3FFCrPD+7SSdIrIBnbWmOHdCIkVIRw4tMAXFYe7aV26IoQ7bQJVJH2G3k1sby4WU4jqwZTkRuXTFztq7ao27znMfDqurolLEu5l6/P8rEBk7HYW75xlHQM5cw= 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=ImUqX0he; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ISEw413n; 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="ImUqX0he"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ISEw413n" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66V5tQn23130397 for ; Fri, 31 Jul 2026 06:02:08 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= tdQJ0UEZ1JX7S0mTRU+fMguZpemOSOkgdQxsHOsSU1w=; b=ImUqX0heQRkF6CCO SJHuF9iTdeUPiv6GvvgRv9AuMcXXyuGR6VsHnODelmZo3Z/lWQbtsa+3fecneOF/ l13zK/uo4hMdruoEPxYP6MYjTUZFWfLpZ5UbxyQ8NJ2mj0TR9ri2a0KgvHj7e1E8 mcOB3P3EoDuQ4fkvLciL0iDa1DKxgtaJa/d82Dkv7jp8rXtuD6TgnXbjke6hLWTU IKNwZ5dg25oXBHUY9YBejgUfF4ly3q0sjunkIu7Y+wT5qOTqqMVQbcDinzAXuXn0 CxKrWgp7v3ue32ZxMpjVVRYbTXQayEntptnFkIxMJkPNyzCbH2wf0j34SXQxxdLB J6JrAg== Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4frp0180w5-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 31 Jul 2026 06:02:08 +0000 (GMT) Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-848d21bbb55so1236919b3a.0 for ; Thu, 30 Jul 2026 23:02:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785477726; x=1786082526; darn=vger.kernel.org; h=content-transfer-encoding:content-language:content-type:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject:from:to:cc:subject:date:message-id:reply-to:content-type; bh=tdQJ0UEZ1JX7S0mTRU+fMguZpemOSOkgdQxsHOsSU1w=; b=ISEw413nZaoN9g+Ig7Mzv09K4PSC8jNt5Oc0h+V5cUTIeIT9bxphsPE9hwNIZytvFv tx5ZtnN9tEqoI+JpvSATxXAEM++1L57swiRqYkouEmHeymKLegaNLKg9W24Gt8HubD+G zn4N6XyxrP92qB/OT+gB9nsdYr9PTmXaOJa0cKk+SZRSgWaI+CCZs/F2AAwMXG0XSQ+a +G5pFjhW/dTe1eX3+4JezdqWR+FbrsB9815b5GDqVd3K5Qx2acmmXWCnNqF/KyZjkja4 irsZRh9RmC5fDV9UjkL114A2VDpwwLLUrOdk2eLXP3hgDLWZOB4wJCJS9VuaQaY1SSnr pVAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785477726; x=1786082526; h=content-transfer-encoding:content-language:content-type: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:content-type; bh=tdQJ0UEZ1JX7S0mTRU+fMguZpemOSOkgdQxsHOsSU1w=; b=N0PCmwXoaIEkEZLz2gq0gamZ4AQ2GnYy3kgdXehTk48EwS32Sor65h7cjmAMR0DXcm OUQPt0qmkSR0fxKh3VBo5x1bsMUVSdbbkeyS07wshSI6d0m1RBW/qBzKX3ELI9P3646d IFlwhoMbJ65fZLfPLQhMeM/uyb5HZ46POpnC/ethRD/XZzXn+N+4ehWlbmf1nYTdfAGM i7jOeJiMVWuxcWI0a7/AHLoEkgytH4NpyeU0SQL1QJSFu8AWbB3zDeEi/6LAmQ2sZeya M1XkjG/Kk3injC6QaL3arJrDZe4B50drcwFzQ2qtq7jdrrFmeSpBD7bCk4gErxdwh1+2 13dQ== X-Forwarded-Encrypted: i=1; AHgh+RprZUTDKLjFPD7Iufna3+BKQMJY/aJ8oFgyyCJCT9kxzQmzGDp0h5CEpjkmbl55/oWloYXFUNFog9eKSmE=@vger.kernel.org X-Gm-Message-State: AOJu0YxdxFcIYwsFSPOnG6Ql0xdHihu7wqticGr6i5AwzwIqDL4AaRyK F+0MrvrgvKcikMMw3tJKx4rthvR6q2b0PYho0L5lfteHg+Qh6XwkxupTWiM43ivdncRAI+bdflh nthmr9iZ6NZGGrkTUPYTggEDwwPiBXPotwlRjadD37xpJ1hn7+y1zrTRfcgIunmg9AAE= X-Gm-Gg: AR+sD12yRNKwvBw3RaoGZGRivuLIbX29kKZFs7HuAUFFjFtDAG1M1kTqp5FUxNuoMcA 5Ra9e7AV86jx2KQRq5sKdfFLroV5Hxles/H1+9nqMhe/K2h1RAofaVyHMQnw/a+tKqslOir6aod xSimpd2LK2iqmUawxKoOJ18lfIJ+f4h97LIThTtsGNnXnqx3m8DpcY5u1bG6u3LHseCUl8lmQu3 ca6E9veIcUhQpzRNHFhwAH13vQ47shjnZN1afaAmBGKhjS7SzepAAAskLxVmor1+HwkGGqIPUNx ilDwqDH2x8UeNtm0gRYu64HZXKMcddFtZJa7Yf6lpzj7vmgAQ4WXTA9vKDr3c/xNAG2NevBbx44 cz7vUZAP45O5BVRD4n9GKXvVlq5E= X-Received: by 2002:a05:6a00:b48:b0:848:67ca:c03 with SMTP id d2e1a72fcca58-84ed74a0850mr582732b3a.58.1785477725928; Thu, 30 Jul 2026 23:02:05 -0700 (PDT) X-Received: by 2002:a05:6a00:b48:b0:848:67ca:c03 with SMTP id d2e1a72fcca58-84ed74a0850mr582696b3a.58.1785477725431; Thu, 30 Jul 2026 23:02:05 -0700 (PDT) Received: from [10.218.4.105] ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84ed5dac651sm311587b3a.31.2026.07.30.23.02.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Jul 2026 23:02:04 -0700 (PDT) Subject: Re: [PATCH v5 4/4] mmc: mtk-sd: Protect crypto capability with crypto config To: Eric Biggers Cc: ulf.hansson@linaro.org, adrian.hunter@intel.com, quic_dmukhopa@quicinc.com, quic_rampraka@quicinc.com, quic_nitirawa@quicinc.com, quic_sachgupt@quicinc.com, quic_bhaskarv@quicinc.com, quic_gaurkash@quicinc.com, quic_sartgarg@quicinc.com, ram.gupta@oss.qualcomm.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org References: <20260730140822.1976635-1-neeraj.soni@oss.qualcomm.com> <20260730140822.1976635-5-neeraj.soni@oss.qualcomm.com> <20260730191030.GC3139@sol> From: Neeraj Soni Message-ID: <0d8f8fed-c712-91d8-7ea8-287e5ba4dc6f@oss.qualcomm.com> Date: Fri, 31 Jul 2026 11:31:58 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20260730191030.GC3139@sol> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Info: AW1haW4tMjYwNzMxMDAzOCBTYWx0ZWRfX63GPpUgiy6kV laVdSs1vurc0jC/toYYHuKkNG/vSx3IisAd/hAptmMMknOu3bmuD5fi2WchtIxqkIM5xXp2LIx0 bqUPGV36PC4V90cbVfELfojQ3EE/fo8= X-Authority-Analysis: v=2.4 cv=Q/DiJY2a c=1 sm=1 tr=0 ts=6a6c3a60 cx=c_pps a=m5Vt/hrsBiPMCU0y4gIsQw==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=8_jnBlR0WWqDQFfpqgYA:9 a=QEXdDO2ut3YA:10 a=IoOABgeZipijB_acs4fv:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzMxMDAzOCBTYWx0ZWRfXxcpH3xGmw0h5 VVoQbOMoeMPUZsmrR8iFPCIUYQFfiE8bj0Qi0lHETTYt5V1pSWFRfuDRCE089jwhASxkHJfI1Wb eWpLuJiHErLocCZ3SdtPLEh+eULqgY1mFfLqXIVC4fHRGbl5vbN6GzN7nofsKI3eadd88Bv37Sn S1B0v77dpSyXRcC4VeeQTy1BoONF1/kPJoCSJWzy7y+zf/xJ0Yb47VlnX65OyWXCwRNACK+Pcrw DqE8Xgb7iSvZYPnKV2d7/u/CCHuPssj2ue0ypBs8YjlLN5RgZ3vjcStNCTtvmUrL8VNMAWtTgt1 M2C1gRVo6BrqCwD06ILajx1Eyizv/arq4lohr906GxCYUKGnrZl3QCvb8d+yGW/DQ7YLo4TMRfM IO5FUehciPt/TSleKfQYkgzJFuobqmsZpYzo15namBxZGbOBJrYf+3r21sEgFVJDmniPq5XQsDD JpkAdSWvXjzEFtwK6Sg== X-Proofpoint-GUID: Qy1ofynKxfU6VFJjABzlIt79GkoSm_ZX X-Proofpoint-ORIG-GUID: Qy1ofynKxfU6VFJjABzlIt79GkoSm_ZX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-31_02,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 clxscore=1015 adultscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 bulkscore=0 spamscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607310038 On 7/31/2026 12:40 AM, Eric Biggers wrote: > On Thu, Jul 30, 2026 at 07:38:22PM +0530, Neeraj Soni wrote: >> Host crypto capability can not be used if CONFIG_MMC_CRYPTO=n. >> So set MMC_CAP2_CRYPTO in mmc->caps2 only if CONFIG_MMC_CRYPTO=y. >> >> Signed-off-by: Neeraj Soni >> --- >> drivers/mmc/host/mtk-sd.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c >> index 01ea3adbdf3b..c415ed97e3c2 100644 >> --- a/drivers/mmc/host/mtk-sd.c >> +++ b/drivers/mmc/host/mtk-sd.c >> @@ -3031,7 +3031,11 @@ static int msdc_drv_probe(struct platform_device *pdev) >> if (IS_ERR(host->crypto_clk)) >> return PTR_ERR(host->crypto_clk); >> else if (host->crypto_clk) >> +#ifdef CONFIG_MMC_CRYPTO >> mmc->caps2 |= MMC_CAP2_CRYPTO; >> +#else >> + dev_dbg(host->dev, "Enable necessary crypto config\n"); >> +#endif > > host->dev is still NULL at this point. So if the log message were to be > actually reached it would show '(NULL device *)'. > > But the message doesn't seem very useful anyway, especially when it's > logged only at debug level. So maybe just drop it. > > Is there a reason to even enable the crypto clock when CONFIG_MMC_CRYPTO > is disabled? If no, then the 'if' condition above could just be changed > to: > > if (IS_ENABLED(CONFIG_MMC_CRYPTO) && !(mmc->caps2 & MMC_CAP2_NO_MMC)) { > We will not need this patch if the i revert the change made around MMC_CAP2_CRYPTO here https://lore.kernel.org/linux-mmc/20260116121004.1829223-1-neeraj.soni@oss.qualcomm.com/ since that change was not related to this series anyway. Will fix this in v6. > - Eric > Regards, Neeraj