Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1182043lql; Tue, 12 Mar 2024 09:25:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXwuhRDsVKgJDV8zob+EfsVbzYZaZlZDO/1NDE+aZaeKbMJgEgE7g2U4/AlRvpVLuQAyKHdz4fAEY8c+r7/oH+lTncwhfbXzot+S7pRpA== X-Google-Smtp-Source: AGHT+IERSFQP0P9pu7gMretuVZV5AvEeOfTxzzAlAiwOSnEPsXr7eb+cHuXs7pluMnEAuIASnLg+ X-Received: by 2002:a05:6214:19e1:b0:690:d5ad:2b88 with SMTP id q1-20020a05621419e100b00690d5ad2b88mr7103687qvc.19.1710260732706; Tue, 12 Mar 2024 09:25:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710260732; cv=pass; d=google.com; s=arc-20160816; b=N0I5fX2qYzoFw5uLQuS+std/zG2NCuH8CP4M4gfWScguyAQMlyE0p+GBx3zl5gg4MQ BPMu6VPekvLoWAVWV1KUwkCLGBCvFbMiR5ky5KhK2aVXxVsairpPvi+sMtBEJvIEU9tS SIEtpVzuXzLrXySNi+iDtyjcfZRUIHg7FuboYtWbRkXzNrZOb+u39221biNCMljAnTGw gID976S+xIC7U49NdP2fSudHOs2AUBBzOChYQOgUUo8MzfvnpQBZZWtXnRzI3LAtDXbq MHEOLz8pEpELrAZutCTv2hTSNzxuOImA6tzKuvWzERNeEhp9Wod3w0IeWZQSHtZ/HX2e 8QAg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=rnquy9/lu+MkzRCfqfD7IRHO13mqattlw1+Mkjnu3uU=; fh=P9qF9/wa78rIXzDGxwjVuVWYFlXPjyR1tnCNdEg8Aog=; b=XbCM6A7kh/rdz94R4hx+bjwY2bDR6jNwhGMo4s6LRQFR1X1bKJLqiGhafsovxw9AbY sAsRr9M4xRuisD/vE8QajwM/Is0jOKaNm77mIEh3MpO+OqgfpOIYYz9/RB4vVmK7C+2R KO135y1rK88mzmwTpaWoOSbs1C6nfExkqh7WFG1EJ3EgDgygPdD2ksh8IJTn236cpXPd Bcq7ZzjRNwzhJ6zdyYK8v9g2ZpDpm0XBKbpy34rG5fkAT0t+bHswWL1XgDDNWRLas7vR k76EfNOnCipicl+lMXZhzeKrf545ZxJqojV55UdHfIUQlENUSXall65MMu7BDfDljXS3 x3FA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=LfIwvXW6; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-100511-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100511-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id fn5-20020ad45d65000000b0068fe583c0bbsi7736725qvb.314.2024.03.12.09.25.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 09:25:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100511-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=LfIwvXW6; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-100511-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100511-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6E86B1C21CC0 for ; Tue, 12 Mar 2024 16:25:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A48B77E0E3; Tue, 12 Mar 2024 16:25:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="LfIwvXW6" 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 4F68CAD5C; Tue, 12 Mar 2024 16:25:24 +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=1710260725; cv=none; b=XxNp9JC+wI8YUYay0wqACHkTT/JpZPrEy4p1+Wgkh7n/RVwDw3CTICwhnDJaARUPlnpfWGSiJcsjDwa/SqXyMj3wNbvjwiMkKRxWdiRgEIcEX63PREZVIRlX/05rikQa/IUZsvKE+dTZ3FtpV5/Lx9csrnHIDtB0uMBSFR3JAuE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710260725; c=relaxed/simple; bh=FKqPwv8fmZYtCQqlF7LSJcgqG/Bdfs+UfdZdl9iIowo=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=lCA0p99vMfSyVV45tYZ36i/3XlPjpxcdQYDdgzq2JYBAwRaGC9UFoBL+2QYjfzPHwG1UjLKSfQp+hnV1KWg4bRl3uajYfrF4b06uqdtbYrkqWgYEz1sAgcXt+3zzqJpAFdM1kwb0Tvn0+9zVvBUsGFDs1sv148SBvN1JJbCuFMY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=LfIwvXW6; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 42CBwfBK019350; Tue, 12 Mar 2024 16:25:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=rnquy9/lu+MkzRCfqfD7IRHO13mqattlw1+Mkjnu3uU=; b=Lf IwvXW6pg97ldTNpumYS2MXd/eRIt7Zgy5AziQwh+QnfseTWkkFxkkWBwmFf0+WfT lUJOoLr6pOGRPTSwvEH8DGfw0mycyVpY2TE5sVtu1cn46iqtIQBlEQqlH7WAOca2 5WdHHF3qliiMrL5JEOvmD9Kr0loDatNMzLPN1RglnkitV6ZVUN9a/sq0eWxi47ZS IKu4FbFvWxp/BseXliEMQLT/u4pl7roX5l81WK0BSzPvDbcRl0qbL5ef1y2Kc0Om YpC4mCFc3Z3eUFMK4zKrO3/FVjqXRm4tXGwjApEhqueiA/rRLfvjZ7uvqR3GjF1o Qb63XHuX7QRq+AARdUuQ== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wtjef15hx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Mar 2024 16:25:19 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 42CGPHwd010651 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Mar 2024 16:25:17 GMT Received: from [10.216.60.182] (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 12 Mar 2024 09:25:14 -0700 Message-ID: Date: Tue, 12 Mar 2024 21:55:08 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] soc: qcom: llcc: Add llcc device availability check Content-Language: en-US To: Krzysztof Kozlowski , , CC: , References: <20240220122805.9084-1-quic_mojha@quicinc.com> <20332b6f-e0cc-4356-83ec-0c9771481083@kernel.org> From: Mukesh Ojha In-Reply-To: <20332b6f-e0cc-4356-83ec-0c9771481083@kernel.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: Rti3HYmDwVgeZxDqx1QZmjDjjBglBIu6 X-Proofpoint-GUID: Rti3HYmDwVgeZxDqx1QZmjDjjBglBIu6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-12_10,2024-03-12_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 impostorscore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 priorityscore=1501 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403120123 On 3/7/2024 3:51 PM, Krzysztof Kozlowski wrote: > On 20/02/2024 13:28, Mukesh Ojha wrote: >> When llcc driver is enabled and llcc device is not >> physically there on the SoC, client can get >> -EPROBE_DEFER on calling llcc_slice_getd() and it >> is possible they defer forever. > > Please wrap commit message according to Linux coding style / submission > process (neither too early nor over the limit): > https://elixir.bootlin.com/linux/v6.4-rc1/source/Documentation/process/submitting-patches.rst#L597 Noted. > >> >> Let's add a check device availabilty and set the >> appropriate applicable error in drv_data. >> >> Signed-off-by: Mukesh Ojha >> --- >> drivers/soc/qcom/llcc-qcom.c | 23 ++++++++++++++++++++++- >> 1 file changed, 22 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c >> index 4ca88eaebf06..cb336b183bba 100644 >> --- a/drivers/soc/qcom/llcc-qcom.c >> +++ b/drivers/soc/qcom/llcc-qcom.c >> @@ -769,6 +769,27 @@ static const struct qcom_sct_config x1e80100_cfgs = { >> }; >> >> static struct llcc_drv_data *drv_data = (void *) -EPROBE_DEFER; >> +static DEFINE_MUTEX(dev_avail); >> + >> +static bool is_llcc_device_available(void) >> +{ >> + static struct llcc_drv_data *ptr; >> + >> + mutex_lock(&dev_avail); >> + if (!ptr) { >> + struct device_node *node; >> + >> + node = of_find_node_by_name(NULL, "system-cache-controller"); > > Why do you look names by name? This create undocumented ABI. > > NAK (also for any future uses of such of_find_node_by_name()). I agree, what if we add a common compatible string like qcom,llcc to all llcc supported SoCs. -Mukesh > > Best regards, > Krzysztof >