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 F32C8421A02 for ; Wed, 1 Jul 2026 10:40: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=1782902452; cv=none; b=YJ2D45/vLk5s0nwXYeUQYLJ+yh5Nxa4DKu9dspnACPKmXgwnLPM7iE8maKcFYYHYYoNwPiq0fZvyeaJNWvpjYzEwI//Pv9cnSLE/BanN+j60Usti6iaCZrphkjxOrTIDOVF3uWlqkit4wy065O61XHwPCzriFdZCD92IpNhTH7M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782902452; c=relaxed/simple; bh=HOn0CaCePfNgAAG9q0s3jJIiPvvFTH5KrOgQqhOkSqw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=YG0c5GT+e6K/z1gNLypEFNIXSLL2Zxan35q5f02RIx6+vI2h4OnyA/jdR11lb2G8SOMsybXcw3Ddy8USgduYm9dxuHDXapbYYb1Hht8EvFyzfSvoHvcvGhzGXpVHIDFm3dX1qtkBWQE3T/fgKf/o2KOsHpDTsmGGsLm7vFXOkHo= 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=nsg+7PGS; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=GyL4FosQ; 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="nsg+7PGS"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="GyL4FosQ" 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 661A8l8L681875 for ; Wed, 1 Jul 2026 10:40:49 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= m/6nkzPv+WrZ0PcEEcEQEu660EWyt8TZ3LWKgMKw0Bc=; b=nsg+7PGSN9LMaaHb vP7qwVAt0LvmfNhpwCNGGrHCO3fVvstLF7mT3Di+sWTZork4SslT9bHt26h9Mi92 IaYhXfMfqJWclBMkqxErZVX/sXvQ1vvohbsCRngPa0TuPp5VB+JOzvndmxfZnSkJ ieUI1piKVL7WKls80+Aju0hIxcycUnroOorlyO/9M8hEMVrMg9Pyrww7Lxd0qWPN ZqzULmqFpA7/z9kemgHxgGkpVUbrJUSJzUqeFMWkqUtdHdrWDrwwRvgol4kD4Mps FMcvtl/2AdFVVCEzWSJDZwHSG2iEjIVD+UGCQ4/eUewg5ouFQT6h713Po8G7SAkB +O7xfA== Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f4k3skqhb-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 01 Jul 2026 10:40:49 +0000 (GMT) Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-51c267931ebso1500381cf.2 for ; Wed, 01 Jul 2026 03:40:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1782902448; x=1783507248; darn=vger.kernel.org; h=content-transfer-encoding:content-type: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 :content-type; bh=m/6nkzPv+WrZ0PcEEcEQEu660EWyt8TZ3LWKgMKw0Bc=; b=GyL4FosQWSFeMIENYzn5k8JSIEfI2ZrGYNpC1fKjjmS6BTMlrw4rxicSfTG4qjXnIS 9+CZ3gwlOkhoeRZcwnQ0b6/iEy4VFcwtGAfWMcCC6SddQdXl7UZc862VOOwZn/5Y34Mw FA59JJ+0GbiFvCry5GBqdGRKHBNyXTjoCEPdFTN7jrt7Tp1GF/CsiBad/vFQWNmP2Q8U +6JzkSpZsT3BOUv9RqiZzOYkPZcdR0S+7Odk37PqsVEGPqI1rCzZfz6VT5Don0LtgZen rSOTEplzWuWhvChXWd4lm9B0fx0lROoKOZLkV5qzDxDiADLi6Fy0zCPvHzltp3aRKxnt rscQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782902448; x=1783507248; h=content-transfer-encoding:content-type: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:content-type; bh=m/6nkzPv+WrZ0PcEEcEQEu660EWyt8TZ3LWKgMKw0Bc=; b=p2va34r5bg31mPHnUpirfj1LhwK689OB9fv27f356LXBJBfYf0AZUbCXvWojsDkJ/q zPi4gFmTofVQ8I0WIxSoUvAMFxwHfLWk5jEC879muzFlhwbJntG6gfv0rb+QHQQFnQxl 6mtzg8zOkzRfYDKoKO69qb3ViCjYaJ46cUljPKfTHkqkDQ9yxMe3OD02KA+Vv8iFcDDC XPGu9mWjXRSiNKCTxhqcKrCxW9OvU2b0mz9WyDI+Fnwjn0TwlFDbvS9J9OLb9188DlOu hg2IyQzzSw64mRtqT799FDvP4rPadgWkbeu5dAse/+bUKjHltwryDB4/GMndo3fw/QDy Xd+g== X-Forwarded-Encrypted: i=1; AFNElJ/DnGWuhVf4KDoH52QcQ7G672TPrXdKoJpVfqMobcwWposwlPqo4hzuw9uPCHhQaAqgMK4kAOxN+jB2@vger.kernel.org X-Gm-Message-State: AOJu0YyveR2l8o+k+eGQWYBGX/rkkFJoZj0jDiIlWBjJ/da1wpVPTq+h LzuKAh/rMpOZAMYHn5Xoihu7jjEMrpunYsFiTmbCLOF6JkorvpldFEGEk+//Xns1VvgijhqjwWQ iUGQLcvNVgO4Xd7sZTVvwzQp/nq7UMqTrf0e+CgMEPkjNwHy72AUqriEJmtRvnBEe X-Gm-Gg: AfdE7cmLY85kq3Cl5yTJ9IyOxvR7MhBWd9FjbDd/UTFPrju4TcBFrYsj7EEUOD8RH7R iPxo6WdZDy636adKv9Andn4w/PichyeKHS+YcUyaOfR11H9XlkikUvAuy4iFM8MbAp+j8NT2G3c opZQRv30Aii0mcRPIJ9R+jBQGbNJy49rLXDAcEITRk5aG5qV+JZW62mS8ygp7iRuDmEE5HV7TrU 5BX3didT/dlEGvPhDpqrrCSxorxAXwSLd9o1S1RDcqR/1iv7bwzvkd/kFyQgHQuddFnpVmINxcf VQcqM4MX+jnjLZ+D05h9fJCwsrsPYe8MJJ/ct32xmNHbtmPjyqYTHRJH1mJateCb3FY1cFIKAs9 Ke2SHwOp5h3f9vjMs+PLSjd+kNWQWPtmEGO4= X-Received: by 2002:ac8:590d:0:b0:51a:8c9b:6492 with SMTP id d75a77b69052e-51c26b25d63mr7031611cf.9.1782902447977; Wed, 01 Jul 2026 03:40:47 -0700 (PDT) X-Received: by 2002:ac8:590d:0:b0:51a:8c9b:6492 with SMTP id d75a77b69052e-51c26b25d63mr7031251cf.9.1782902447419; Wed, 01 Jul 2026 03:40:47 -0700 (PDT) Received: from [192.168.120.170] ([178.235.128.140]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c1296b1f9cesm165809466b.16.2026.07.01.03.40.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Jul 2026 03:40:45 -0700 (PDT) Message-ID: <175f7835-df18-4bc6-8267-ceef35696af8@oss.qualcomm.com> Date: Wed, 1 Jul 2026 12:40:42 +0200 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/6] firmware: qcom: scm: Add support for setting Bluetooth power modes To: george.moussalem@outlook.com, Jens Axboe , Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Johannes Berg , Jeff Johnson , Bartosz Golaszewski , Marcel Holtmann , Luiz Augusto von Dentz , Balakrishna Godavarthi , Rocky Liao , Saravana Kannan , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Bjorn Andersson , Konrad Dybcio , Mathieu Poirier , Philipp Zabel Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, linux-remoteproc@vger.kernel.org References: <20260629-ipq5018-bluetooth-v2-0-02770f03b6bb@outlook.com> <20260629-ipq5018-bluetooth-v2-3-02770f03b6bb@outlook.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: <20260629-ipq5018-bluetooth-v2-3-02770f03b6bb@outlook.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: I9WExeXIcuX3mNwkZ0AEpfKGH4ylAmIP X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzAxMDExMSBTYWx0ZWRfX3SUzaHXti0Wc 903hKMUQdeVVbSBVT8Y/TuuXkZov+sssHnOjLSpFmcaDeBzmBoQuSS4AeYyRSIWsJVz3OzMiO7Z MszT0Jeszo/zq9zGURXfmxTMrQ7fXTtzOqVS8t6SDUwW7cbaO3+QVSEucbviRJqz+lQ/Ahfpt7a +5rp6Hvl40GLa5q57cL84H8+I3/zZiAzsxDYidojQW3/E44WkuOtRErpxpI8trEX7yQzNc3lha6 vFPcsHu+QzTmHOtgHTjMbWx9ojkuR9rK1CyRidNUnGm2dl9xA8udZHaQvXtlz8cCYB1jY+LTLDj okd4qNMw0ocmfyRQ0DYZGtQM3wXNV3YcS43mnyGVcrqlP8bCQlDO+7Aqo7R0HnGFXGoEMygPIfk 46kRgB6tzvwdhekeglu9mGQAnDiBnRJRQVEDVXiP7DuxYHlFYPxsF5GmDxcqpFmq7m99yjJJ5XV WDONtqHNOB4zs//8Ulg== X-Proofpoint-ORIG-GUID: I9WExeXIcuX3mNwkZ0AEpfKGH4ylAmIP X-Authority-Analysis: v=2.4 cv=Ff4HAp+6 c=1 sm=1 tr=0 ts=6a44eeb1 cx=c_pps a=mPf7EqFMSY9/WdsSgAYMbA==:117 a=PRfkaYvzSr8QmIIGAkY2Sg==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=UqCG9HQmAAAA:8 a=506_Lbxh6H-Y4vAdgPkA:9 a=QEXdDO2ut3YA:10 a=dawVfQjAaf238kedN5IG:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzAxMDExMSBTYWx0ZWRfXy7HqV6WeE0+h nrAdHLq1h0RMuX2LQqvi/vOpsWd/IPvrFoTG1FMnGvCggIeEoXlaUt169xKS7CVoQJLDfjDgJiS pLQT0z0O62+agQ12C0iLa7FVGmPbajw= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-07-01_03,2026-06-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 priorityscore=1501 impostorscore=0 phishscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 spamscore=0 adultscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607010111 On 6/29/26 3:01 PM, George Moussalem via B4 Relay wrote: > From: George Moussalem > > The Bluetooth subsystem (BTSS) on the IPQ5018 SoC supports setting power > modes which are required to be configured through a Secure Channel > Manager (SCM) call to TrustZone. However, not all Trusted Execution > Environment (QSEE) images support this call, so first check if the call > is available. > > Signed-off-by: George Moussalem > --- I'm amazed changing this setting is a secure operation [...] > +/** > + * qcom_scm_pas_set_bluetooth_power_mode() - Configure power optimization mode > + * for the Bluetooth subsystem (BTSS) > + * @pas_id: peripheral authentication service id > + * @val: 0x0 for normal operation, 0x4 for ECO mode If there's just two values, maybe we should make this take a `bool eco_mode`? > + * > + * Return: 0 on success, negative errno on failure. > + * Returns -EOPNOTSUPP if the firmware configuration call is unavailable. > + */ > +int qcom_scm_pas_set_bluetooth_power_mode(u32 pas_id, u32 val) > +{ > + if (!__qcom_scm_is_call_available(__scm->dev, QCOM_SCM_SVC_PIL, > + QCOM_SCM_PIL_PAS_BT_PWR_MODE)) > + return -EOPNOTSUPP; > + > + return __qcom_scm_pas_set_bluetooth_power_mode(pas_id, val); Let's just inline the whole definition here - it's single-use anyway Konrad