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 73A1537267F for ; Wed, 1 Jul 2026 10:40:50 +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=1782902454; cv=none; b=NmVHBK5zPisWfi4yIMsKPB1LNPMwNbp1frNWtukEX/eGTV/p5+wtKXlmjnAG/Si95FaOlc5JIsZ5NJL993QqvhASxCl8ClL9wgh8T4KPSXSL/opx9mTLqvmow6qejeqe04BaP/VEWlajjtF/RQx/dHt2HzGqozS3VbV7x7s5zYg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782902454; c=relaxed/simple; bh=HOn0CaCePfNgAAG9q0s3jJIiPvvFTH5KrOgQqhOkSqw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=LevFB8QH9CyrZP+R3LMhlibvCxEj2U52IiuVaDtFqQG06L2s1l6Q3FwHBenqplguP69pXqgA7QSLkJd/ulpE8ebQaYEw7THLBmIvC5l8rOg5kh4SCBwln+I+8Cs5CtZe41ZYWyABbZekosfguxYa5REa3pOu/4OxXa2WpVMn9kk= 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.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="nsg+7PGS"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="GyL4FosQ" 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 661A8pb2673819 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-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f502urc2s-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 01 Jul 2026 10:40:48 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-51c267931ebso1500441cf.2 for ; Wed, 01 Jul 2026 03:40:48 -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=qI1gynl20LHkTWld36K0pKFYabfMrjqeQLK2IyZ1m5SljWSL5tKkOZitznHmyX5HbM aosHpPRRlSjy5dIXw1nRcmQOJVNCtNe3eRwamxpk7ZXz2s/bm7G2raxISvo1yTJclT+e /94O3RXngWXBmF0hncRBjG2bl9lGlLzbtcPgZ1JHmjFMkcTKyOqiijAE0k0mp/S/PmiU 1lp2L1LNQqBecM51ix1tohrrhpfDoLA+W6qSnbZHslv8F0Qlm2kObVvwGk+FjuNSmgM3 LSwVizDwM437QonH8li3z0wP7Vrr2flfZ6CSSKwqiUCZebHS9/Gyx81fKtcePKlQxMCu mNXw== X-Forwarded-Encrypted: i=1; AFNElJ+pYpUriZcb2Z9+jqke3In49TuLM1do3z/636eJJw7wnklQaQMI2F7aWlDjFIEVc7P4OxxpkUZGvQ1mROc=@vger.kernel.org X-Gm-Message-State: AOJu0YxKbdGQtDTDxSDPhSgirRykLW/eO/fTsQ1/NE8+651q9LhFv9ub ovYO8wLgZrP61en5Sy+RNQ/6o/FS0Jq37c8sWhPNvv9OLhykOtBI993JK6Yh4PLpcYximIqH811 NjvtaNEWJEDgHUqwfdWyWC7rF0kVTKHmToSsCpOJZBydpwZHlehhiD3KdLf43eiLG078= X-Gm-Gg: AfdE7clrKkTLNaLqcSADjC3BRUAoJDeWoJdxmkMtGV6sEsF5PxS+3buOvRmiCZVqr7m 2VXTJlSgLnmPcFqbT5tKf+jHUlDFtqkmM9odYC3+HjOIYXZE1mIt5jLzp+b69pG1pSxMa46rJrE SpL0BQRqAiYucXPqrzQuEfqYO8cZQLcoElVyJVVvsgwqwrUaSR84EicG2iY5lRKCDe/lPkjvdEg MkiP6AAHLNxXe5pyADp4ySzDmz5ITuTH9GQijlzPHAHJzXswYtNmxMi8E04pZ9SiGjjzSGqWsUs M1NdvyYnzucDVOOBGPX5M1OSMi6r0XurvRgIqa2j2mrM+iDt8s2Rv6Ymd/qKG9TggURE0lMLOT7 Ixrshw4bGg/IKwmvsjUr80oKx/niVtEWvzb0= X-Received: by 2002:ac8:590d:0:b0:51a:8c9b:6492 with SMTP id d75a77b69052e-51c26b25d63mr7031801cf.9.1782902448016; Wed, 01 Jul 2026 03:40:48 -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: linux-kernel@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-Spam-Info: AW1haW4tMjYwNzAxMDExMSBTYWx0ZWRfX0rjnpA8XpEOM h3i3fWU9pr8/owMkz8dLmjw5SkwPlAbKF578D9fY7d3L17CH44Nn2iUGAelpJrsO+3aRp1tsqe0 WCMQy/vwvzeB/vMFPzPwWERYkkxO/AY= X-Proofpoint-GUID: FdoVXFk2EBihh-Onp5tVapeTqw0e8i6F X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzAxMDExMSBTYWx0ZWRfX7tbHK5Seoh89 TwKHLNLPhifKqDiFYuOHMOpwpZ1iiX6sIyIEmAXiBG2MBOlhYiUYSIWyXU+OPmGuanRT+jFiB6n DiuX/69W0/IlK5T3Za0KZFUx19Sdk4pa8dqmqLrB1+p/U2vhSN2fgJIUQ3gQCQwYl/xlcTWUTIa eLJYjn6cIZhUog75avxfnKKqJZG3Mn2KeGvXuYSCI6N6MxOUYafiXdntatcmY7/TV9XKQxE69XJ JeCfndGILFbgFNkz9w4uWiBVros8InsRxjO9oTsqO+JMzg2KaT04KuT7YU1QZ5fihUzGq0LirTB CEwBoudMX18O0myxHG8y1ZKttWe7/4z4GQO8vYGVB+i4tAUYuZBKsN2OqItmZicYTb6rUdPTS2k 3SWzT5GlKWN91pIwK+jlvuA1G1f4ASinWfmgoaq5V0lpkWtlioulvz5avhtALOe3/xwsssGA33p 1pSiloi2//FtYekVnSA== X-Proofpoint-ORIG-GUID: FdoVXFk2EBihh-Onp5tVapeTqw0e8i6F X-Authority-Analysis: v=2.4 cv=PbLPQChd c=1 sm=1 tr=0 ts=6a44eeb0 cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=PRfkaYvzSr8QmIIGAkY2Sg==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=UqCG9HQmAAAA:8 a=506_Lbxh6H-Y4vAdgPkA:9 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22 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 clxscore=1015 impostorscore=0 spamscore=0 lowpriorityscore=0 suspectscore=0 phishscore=0 malwarescore=0 adultscore=0 priorityscore=1501 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