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 5472A330B28 for ; Tue, 3 Feb 2026 11:14:19 +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=1770117260; cv=none; b=KSp3kGgjQBISDRktJqVHO+yg37KYjoGq27gXA0iF57sYQtGgS5nNHo8aGcPea+tLk4kExdyiHAcCtQTz8wI4pLbRkwhwgN0xriu3DVHodicveF6GAwtpcak5fEkY9FR+JAZ0Xu2U7YIhHKhRI+cU/CSTKhdYXadxcl5EB6ZiDak= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770117260; c=relaxed/simple; bh=hE5YmGG7iH5u2PUUIDZLVoAsmcZUgfitPft6rYLloVg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=XP2HUrmHmem7X5xJpq1kVFPyTI2ZwGGH3o6gy8gT4OCAIptp+2vxQgwnb8fwrWQiwEQ3Z9TZtReM7LiFWLVmzoColH/e6MsPGyc0hIzZaR8XPlGzEOSBvXgRy2KoA9h6uB8/0Ea+wHfvyXgAlfmOEocy7G1E5HsDzF7ogFf8uO4= 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=aE/IbWj4; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=GU5SXhUi; 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="aE/IbWj4"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="GU5SXhUi" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6137PK9U1320971 for ; Tue, 3 Feb 2026 11:14:18 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= fqIWeb7+wQWH9tXZxxrOSv9gW7UU4Zw0dIiw7RLktA0=; b=aE/IbWj48X8SyCA8 WCwZ2VvncBD6CbBGSeaveEEj3h1pNjT5j6eEemFBDbtSMqyCbkkRW9AC92O8Wmp+ O6Wk+S3v4gTSctcTfRIHNjMFEcJYBRlFhx++dMFL57LJT4+WwvvnQglwT0Bfh3nc qIx3K31w7mO3fm3aZD/Qjxy6OubSDz71wslVYJNStERCOL5eWIm2jg5HqqvVGkA6 eS0DQpvjCGN8hqJQQHeDva8p3THLyBW6Js19Y2mTeJoKnKo5KFyOjER8Vcu7YjcP P6kHfoXRSdt/iJz2iJWt5PtnCLsaJe5T7rBtEgR7Bt8JOnemSWk3LtPgbvwjc6Ts M2SnwQ== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c3cm70px5-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 03 Feb 2026 11:14:18 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8c7177d4ab4so130950685a.2 for ; Tue, 03 Feb 2026 03:14:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1770117257; x=1770722057; 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=fqIWeb7+wQWH9tXZxxrOSv9gW7UU4Zw0dIiw7RLktA0=; b=GU5SXhUiK65Dx1lZis/3lFYl20euEwqLmqBOAadcthmmWt0JNLy42MkOIzNTmsVy8O BTKye/mdf+KQQzwqq0pBJvWU9riTYGiq6+8Tx/SPpe4kYnyYtVyUW5PbvTVMRSLUtbiZ Pae3UVJ8Q8yVjtyk7keAcLeXLAfMhWuXgkA/d0sIT5nRKUco00KFIuCizJaVBU8YeGzE Ote61qnKnGOlk/HLrZVa+UXV0Uw7Bn4wzxuzeJOuj4oB1AH8TJAAZf1Gd+CABICVvtzk jrsUL/DdkrWuxqe7kqeB0/FnWFOMdXb416LQamDJwFNIsjVTVpOviH9iMEyzbBMF6xl+ 39GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770117257; x=1770722057; 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=fqIWeb7+wQWH9tXZxxrOSv9gW7UU4Zw0dIiw7RLktA0=; b=fEW0nxgZuVTr1zw3wJxzqQ380JlyZpwt2YrRlwOqd7R8eG9OnK7DT8DMc9pKVNH3QM Ries0MHsbNkJsSG4FvaC7+FhOjRuLI+6D1X4DVF2aiyUv4KFGgVoJgNbzwf6i5EqvfNB a2IPZslpKRQBlXABBDQgDB8LSqwU3SDTsHTHzwuCW6vW13HDZvhH4vqOdf2Bd3IP82y/ 3L/Lmu4+Va/3Zi4YF0qg7bosY5/3OXyX+JcaaM/HuJM0hgD+q67TY9rGkvNNLXdsdUJ2 MjVBkOwddLLdgGUsoOQAx1vlsTGbPE9Uy8yL9T3sxL1i8RrMcMyFNNB62ODl/QNRvJjJ WDKw== X-Forwarded-Encrypted: i=1; AJvYcCW5nAOidxr7IVA4Dh3Wh6aMbxV7OQdRvyromHgqPyrNAr4G9Dc6inFZ0MxZYT4/cNTUmItFpb/jo7bCjvU=@vger.kernel.org X-Gm-Message-State: AOJu0YyYTo412JorV7gZZIqclE4xKPdCeNWj9b5q8/q0WZ9yQyleWqVR meV+dlh5trBV2zmAVyn75194JXCEiHrcvLyR3Zt5hrqBiQUUx66whnOjhA/aX/AZsUrtykh8lk1 7jTBOz9eFTAxOFzHKKNXfJEDMA4WWpWDmhUpa/8F3ExSv7eAcuFgSglnjmgpUZNeHSlw= X-Gm-Gg: AZuq6aL/U/BuV7UUvQjVEkSak6Qadys5s8ASkh5IiTA8oL5yrJg++L3AcJ+9YKYLIpB f4DwInAJBgiugExhSc9tSzqOCD78+J87wWdAReUU5GKWgwCXELUwpg1zSSsQSJxt3aUCj2WChWQ /8Lo6Y9+lfpNeIX4AC5AtOC6FPCkfBdsWV6Iog8aX0p/vk+i/lpvGZaOlO3UolkfwcQackYWZRh Zp+ZM5ucKfsNf9Wm/8CbVJljLjjfclNHFSJuD/YH6vUQNFMrhwcHuZSBeYUATfzjuVvyDYEiacR IvMqPMGliLcFp2Hq7bqdFcAOC8dFPexsKOCPGAN366UBCr196v8uyv5krmRcTFWo8DvQPOnIYnC cto0htQlcj1YueyQ6uKJ8pNJbEiXppYIcNR0OJe8jo4I0ZesBRhbbAOkjYhRY4DCL0U0= X-Received: by 2002:a05:620a:19a7:b0:8be:6733:92b1 with SMTP id af79cd13be357-8c9eb139c25mr1519172185a.0.1770117257544; Tue, 03 Feb 2026 03:14:17 -0800 (PST) X-Received: by 2002:a05:620a:19a7:b0:8be:6733:92b1 with SMTP id af79cd13be357-8c9eb139c25mr1519168185a.0.1770117257008; Tue, 03 Feb 2026 03:14:17 -0800 (PST) Received: from [192.168.119.254] (078088045245.garwolin.vectranet.pl. [78.88.45.245]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8dbefca54fsm1023572666b.23.2026.02.03.03.14.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Feb 2026 03:14:16 -0800 (PST) Message-ID: <24f967b5-0f15-4aed-a81f-ad54f8e541fa@oss.qualcomm.com> Date: Tue, 3 Feb 2026 12:14:12 +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 06/12] soc: qcom: geni-se: Introduce helper APIs for performance control To: Praveen Talari , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mukesh Kumar Savaliya , Viken Dadhaniya , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, bryan.odonoghue@linaro.org, dmitry.baryshkov@oss.qualcomm.com, bjorn.andersson@oss.qualcomm.com Cc: prasad.sodagudi@oss.qualcomm.com, quic_vtanuku@quicinc.com, aniket.randive@oss.qualcomm.com, chandana.chiluveru@oss.qualcomm.com References: <20260112104722.591521-1-praveen.talari@oss.qualcomm.com> <20260112104722.591521-7-praveen.talari@oss.qualcomm.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjAzMDA4OSBTYWx0ZWRfXwZic+VoFPc1M u/xqfIww/yom8hSwzpA/K175lfRsDcm8kEOjxQkGHPEt8iOMCRmxWlpY22KC9ezOjA3dGmfRTX8 dT4QaoUx8qFV9wRgbkcjfwPRsFHoQbGFnaN8Vhe6D4qxHAFvRQRN7vLN+/C2n3G8QpFd1FQZc6q h/hNZM7b5pLRXZ0cYIK85s271B89dbjNwtEWF7StPuL349zXZ7NeQGNv5am5RfWGQjBewIhv2sN 4kRhnvZ/hCV+J+rmCrI46CBXm9rc76u0oN87YpKsgi57ZmafqOlTTdcE8UjlM7Ku6LLwMUdaLnr SOoVa3TOPFqYs4c3d9DRyGi/zkXsoKKREDSrxRcUpkC1HaPU9JDqDg2KxAa+N3ueDSMFwqgqVqG SA5W2zFQcR1KCdvUs35vuknyJSvAWaH4LJ6pByd6Hf1Rjk7kbIB3IyjDPufEV8aeZufKfw3NUX2 oR/3JQUDXzyyaPIeIDQ== X-Proofpoint-ORIG-GUID: iuctkzOZzwXf604S-faq5k6j6Te9CGfu X-Authority-Analysis: v=2.4 cv=L4sQguT8 c=1 sm=1 tr=0 ts=6981d88a cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=FpWmc02/iXfjRdCD7H54yg==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=OO4x0hjL3wxKXcLKrYEA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-GUID: iuctkzOZzwXf604S-faq5k6j6Te9CGfu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-03_03,2026-02-02_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 phishscore=0 malwarescore=0 spamscore=0 bulkscore=0 clxscore=1015 priorityscore=1501 suspectscore=0 lowpriorityscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602030089 On 1/30/26 5:54 PM, Praveen Talari wrote: > Hi Konrad > > On 1/30/2026 5:53 PM, Konrad Dybcio wrote: >> On 1/12/26 11:47 AM, Praveen Talari wrote: >>> The GENI Serial Engine (SE) drivers (I2C, SPI, and SERIAL) currently >>> manage performance levels and operating points directly. This resulting >>> in code duplication across drivers. such as configuring a specific level >>> or find and apply an OPP based on a clock frequency. >>> >>> Introduce two new helper APIs, geni_se_set_perf_level() and >>> geni_se_set_perf_opp(), addresses this issue by providing a streamlined >>> method for the GENI Serial Engine (SE) drivers to find and set the OPP >>> based on the desired performance level, thereby eliminating redundancy. >>> >>> Signed-off-by: Praveen Talari >>> --- >> >> [...] >> >>> +/** >>> + * geni_se_set_perf_level() - Set performance level for GENI SE. >>> + * @se: Pointer to the struct geni_se instance. >>> + * @level: The desired performance level. >>> + * >>> + * Sets the performance level by directly calling dev_pm_opp_set_level >>> + * on the performance device associated with the SE. >>> + * >>> + * Return: 0 on success, or a negative error code on failure. >>> + */ >>> +int geni_se_set_perf_level(struct geni_se *se, unsigned long level) >>> +{ >>> +    return dev_pm_opp_set_level(se->pd_list->pd_devs[DOMAIN_IDX_PERF], level); >>> +} >>> +EXPORT_SYMBOL_GPL(geni_se_set_perf_level); >> >> This function is never used > > it will be used by UART driver, not for I2C/SPI. Adding unused exported symbols is "eeeh".. >> >>> + >>> +/** >>> + * geni_se_set_perf_opp() - Set performance OPP for GENI SE by frequency. >>> + * @se: Pointer to the struct geni_se instance. >>> + * @clk_freq: The requested clock frequency. >>> + * >>> + * Finds the nearest operating performance point (OPP) for the given >>> + * clock frequency and applies it to the SE's performance device. >>> + * >>> + * Return: 0 on success, or a negative error code on failure. >>> + */ >>> +int geni_se_set_perf_opp(struct geni_se *se, unsigned long clk_freq) >> >> I think with the SPI driver in mind (which seems to do a simple rateset > > APIs were added as generic interfaces shared across I²C/SPI which is specific to firmware control, not Linux control. > >> for both backends) we could do: >> >>> +{ >>> +    struct device *perf_dev = se->pd_list->pd_devs[DOMAIN_IDX_PERF]; >> >> Then, we can do struct device * perf_dev = se->dev; > I don't think, it is needed since this is specific to firmware control, not Linux control. My point is that it doesn't have to be specific to the auto usecase, further commonizing the code.. Konrad