{"id":2219762,"url":"http://patchwork.ozlabs.org/api/patches/2219762/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/patch/20260404-t_power_on_fux-v4-1-2891391177f4@oss.qualcomm.com/","project":{"id":28,"url":"http://patchwork.ozlabs.org/api/projects/28/?format=json","name":"Linux PCI development","link_name":"linux-pci","list_id":"linux-pci.vger.kernel.org","list_email":"linux-pci@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260404-t_power_on_fux-v4-1-2891391177f4@oss.qualcomm.com>","list_archive_url":null,"date":"2026-04-04T08:17:18","name":"[v4,1/3] PCI/ASPM: Add helper to encode L1SS T_POWER_ON fields","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"b57d9589a1938046141ad4f702044dcbf06a3d4d","submitter":{"id":89908,"url":"http://patchwork.ozlabs.org/api/people/89908/?format=json","name":"Krishna Chaitanya Chundru","email":"krishna.chundru@oss.qualcomm.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-pci/patch/20260404-t_power_on_fux-v4-1-2891391177f4@oss.qualcomm.com/mbox/","series":[{"id":498705,"url":"http://patchwork.ozlabs.org/api/series/498705/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/list/?series=498705","date":"2026-04-04T08:17:17","name":"PCI: qcom: Program T_POWER_ON value for L1.2 exit timing","version":4,"mbox":"http://patchwork.ozlabs.org/series/498705/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2219762/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2219762/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-pci+bounces-51865-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pci@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=hWZawlGM;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.a=rsa-sha256 header.s=google header.b=D2TnIY9j;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-51865-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com\n header.b=\"hWZawlGM\";\n\tdkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.b=\"D2TnIY9j\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=205.220.168.131","smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=oss.qualcomm.com"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fnpQr5zc3z1yCs\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 04 Apr 2026 19:19:16 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 41F2F30428B1\n\tfor <incoming@patchwork.ozlabs.org>; Sat,  4 Apr 2026 08:17:35 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id BA9F53A4537;\n\tSat,  4 Apr 2026 08:17:34 +0000 (UTC)","from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com\n [205.220.168.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 59F033A5443\n\tfor <linux-pci@vger.kernel.org>; Sat,  4 Apr 2026 08:17:32 +0000 (UTC)","from pps.filterd (m0279867.ppops.net [127.0.0.1])\n\tby mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 6340gfTl1344722\n\tfor <linux-pci@vger.kernel.org>; Sat, 4 Apr 2026 08:17:31 GMT","from mail-pg1-f197.google.com (mail-pg1-f197.google.com\n [209.85.215.197])\n\tby mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4darbfgpv5-1\n\t(version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)\n\tfor <linux-pci@vger.kernel.org>; Sat, 04 Apr 2026 08:17:31 +0000 (GMT)","by mail-pg1-f197.google.com with SMTP id\n 41be03b00d2f7-c76b06f37a7so936396a12.0\n        for <linux-pci@vger.kernel.org>; Sat, 04 Apr 2026 01:17:31 -0700 (PDT)","from hu-krichai-hyd.qualcomm.com ([202.46.23.25])\n        by smtp.gmail.com with ESMTPSA id\n 41be03b00d2f7-c76c657dfb7sm6786408a12.24.2026.04.04.01.17.26\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Sat, 04 Apr 2026 01:17:30 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775290654; cv=none;\n b=lA/Zdp+SARd+t+pQ2HiivY7+qHsJ6OmaCNuBoFFugGjNK0oeGO4knVR6m3baHvYQcnwKWn/AAI9Q2xNXATISi4CHBv6tT+KNlm6U/DDQVWueHSA5tkdn7R6K5Ch30HYL6Yi9xOC6tNg19MCcQI2jK9Gk3p8khINW2umJGCTqBLo=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775290654; c=relaxed/simple;\n\tbh=dN9KuR0kzkXGKzvIaarHHedGIsZ1F9GAhzyZs0HPCMY=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:\n\t In-Reply-To:To:Cc;\n b=JUIx5fcFag2Y13XGgA/WXrcfRSOouN6wdABObbcAohnl5k82L4tVx+0R3VcM8677ThdlpkY6f5Z9fPW65xrh2y5LBFXcDBgo/fFualy/xOLnazKAjoK1tUHCH+oxJqAT/ilzTJgTKneY7Fi1AhsM1WrsMCVS+QP95ETJgh6OMuU=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com;\n spf=pass smtp.mailfrom=oss.qualcomm.com;\n dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com\n header.b=hWZawlGM;\n dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.b=D2TnIY9j; arc=none smtp.client-ip=205.220.168.131","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=\n\tcc:content-transfer-encoding:content-type:date:from:in-reply-to\n\t:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=\n\tPJUj5wDjCbISRf/zsTVoScRbxX787wYkVxELuxMLk/o=; b=hWZawlGMP3uWHyLA\n\t8jPEuUx5XYwqzDvCDAsjFsMtp9aKOFvyFawIn1V/zT7PgZBQvmaL0ycWSiUOuhRl\n\tkTRPJaUWLylWP7AIVUQgjTB9pmPythSviftz78yWre4uUWc057oh9Jnd6vB032fu\n\tU/hVYKP2xxkVXW+fbkSLOD7zeHiImfapY69omRCoUT2Obvh6hbM4qcPYGFav9fkj\n\tHKNUKeBgZ8sKWjZIkWk9aSvwhjbejz4yCNkc7s3QQQcZ6TCvqh3qlfnv3H0CuIoa\n\tKrbMhohkdT2559/xtywXbBPGgWYFNM5+MatH9rS1lScyhd1Ic008dU3Clo3R+uGM\n\t4qPcEA==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=oss.qualcomm.com; s=google; t=1775290651; x=1775895451;\n darn=vger.kernel.org;\n        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n         :mime-version:subject:date:from:from:to:cc:subject:date:message-id\n         :reply-to;\n        bh=PJUj5wDjCbISRf/zsTVoScRbxX787wYkVxELuxMLk/o=;\n        b=D2TnIY9j5DUurgwtCrkMXZiQN7LIjZwusoalD/vDkHOzYmqFzbQI+AYq0+mVRgIyGV\n         czj0Qp+k4imWj/f5+p2Wr7LyyGQ85uzvwxfFaAfwTxmXFh2Fs8+UNGMWxBygA301RnCc\n         vTVjvvlEBQct0V7o2oEC+NENIIK8ex4Nk++Enx1PrCgSzRiBzw6ma+JlLyqTNV6k516L\n         Fjkyh7M8hKEomLZ32AQDBWcdMikKSdcLZUmzOjMpXXaKu6PTDNpEb4lpXUXqLHNfVRWt\n         2hhlX5BOJyOB0kmWcrlLmNr28/Ql5ZOhOXk8pOXUsUwpY2ArS060124Eqq9yih2RhrcV\n         +IiA=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1775290651; x=1775895451;\n        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n         :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to\n         :cc:subject:date:message-id:reply-to;\n        bh=PJUj5wDjCbISRf/zsTVoScRbxX787wYkVxELuxMLk/o=;\n        b=gc8dJiWS4YUtHDUd5SvYnEl16kO8vl7KD0mYb6Pz8ONIOoOKYTCU967CxBJ8kfQ9B0\n         FkZNkuAeATZgU5yler2WJaYItxjK4/b/HoZcHSQGrrYrkc/FUhSt+E65Ta7pkCHMJ70/\n         bFFz2RGqaGHz5IVloWHgTu70cjWLDdXzTRsfYfus0wQ+hIx7ZRVx+znnqCJtdN4wfbqV\n         MmgSMemUnsG6jgT4dwJE6qWlcJ5YLOgxVD4ehWkCG6NWzF2ty2Ms0TuJdpNkhPh3/7Lw\n         mgzpJRrbQo7xe9bvCsaL1k9Nsn+q8gKf9Cjb5V41BOTJXBM3UzrX50ByXP/Vu5nOg6c3\n         nr3Q==","X-Gm-Message-State":"AOJu0Yy9KUSUKcf6tVXUHzmjqRkZWXklhWBLyu4G8EN91pPpIsPNFYmQ\n\tXmF1qoJljWWcbbpaF/FH6fzfKtyn7cbBgHDo+VUum1l+vtXyXv7OevUEHR5TKLbP4BS1jQISx94\n\tdJmeRAo4RQ/Or5Aq7YNi3RjaspDcoEYRxVWe9a72ph13oO7hd8wgCJvCpTYj4JNc=","X-Gm-Gg":"AeBDietAFRCS8+ErLa7r193V6X+PHzR4w/n+E4cJ+sgTxZkG9XWu9wGXbW2fuGKu2Xw\n\tBJG1Itp6olLbOLvCAXMa7qlwHasJTBvEduuUkGt9t25RyiByNV8uTgRXq36myhvojO9FDce2O0q\n\tRvbzSGkkNGw6R7A8U/v9EqS4a3uotVAKV0+xH8dEQ02X5sHx4V5F/ZA3GhujsxF2z6TdiE3x36d\n\tTeBN3YUQmwPt842W5ErRpxfVZ9JyUqL2etkMYaB0g8Gcohon9n7HQUzHcMX/9QYVEEa2ckkgnHw\n\tVX/kbWnm6bdO2dxJjov+77zJkj0Va3eQdm4KqAmioSaRArq7H/sW0mNyd+rbfrIkue4VjgICS0q\n\tVKISd06q2QYr9rDXlz3aRBgTdPwP+S1UvbINf7+A87iPtBmEQ1M1VJZYC","X-Received":["by 2002:a05:6a20:a11d:b0:398:b346:b13 with SMTP id\n adf61e73a8af0-39f2ed81e9cmr5661638637.16.1775290650921;\n        Sat, 04 Apr 2026 01:17:30 -0700 (PDT)","by 2002:a05:6a20:a11d:b0:398:b346:b13 with SMTP id\n adf61e73a8af0-39f2ed81e9cmr5661616637.16.1775290650438;\n        Sat, 04 Apr 2026 01:17:30 -0700 (PDT)"],"From":"Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>","Date":"Sat, 04 Apr 2026 13:47:18 +0530","Subject":"[PATCH v4 1/3] PCI/ASPM: Add helper to encode L1SS T_POWER_ON\n fields","Precedence":"bulk","X-Mailing-List":"linux-pci@vger.kernel.org","List-Id":"<linux-pci.vger.kernel.org>","List-Subscribe":"<mailto:linux-pci+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pci+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","Message-Id":"<20260404-t_power_on_fux-v4-1-2891391177f4@oss.qualcomm.com>","References":"<20260404-t_power_on_fux-v4-0-2891391177f4@oss.qualcomm.com>","In-Reply-To":"<20260404-t_power_on_fux-v4-0-2891391177f4@oss.qualcomm.com>","To":"Manivannan Sadhasivam <mani@kernel.org>,\n Lorenzo Pieralisi <lpieralisi@kernel.org>, =?utf-8?q?Krzysztof_Wilczy=C5=84?=\n\t=?utf-8?q?ski?= <kwilczynski@kernel.org>, Rob Herring <robh@kernel.org>,\n Bjorn Helgaas <bhelgaas@google.com>, Jingoo Han <jingoohan1@gmail.com>","Cc":"linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org,\n        linux-kernel@vger.kernel.org, mayank.rana@oss.qualcomm.com,\n        quic_vbadigan@quicinc.com,\n        Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>,\n        Shawn Lin <shawn.lin@rock-chips.com>","X-Mailer":"b4 0.14.2","X-Developer-Signature":"v=1; a=ed25519-sha256; t=1775290641; l=3804;\n i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id;\n bh=dN9KuR0kzkXGKzvIaarHHedGIsZ1F9GAhzyZs0HPCMY=;\n b=W2NXnHDHFweweqMbY5/CM39de3U6WWWxKMRBY3t7odo7sqwmMVkUW0GNJ+pJxjUMQF1yoEda2\n n4BYSzEGocmCl3uxvUy1zO029yix+lo9h4GYegcnkX1HNE3JJYe+WTh","X-Developer-Key":"i=krishna.chundru@oss.qualcomm.com; a=ed25519;\n pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg=","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwNDA0MDA3MiBTYWx0ZWRfX6afaBM5osaaI\n 3jPkHviRUe0ZRk/wioXDgCz8Hhg8UXqwageJr92jK9wd7vBOFu9KSnOTe749Y4sdc4uiArP37T4\n KpO1+jKEivGGjzetr/bBHedKzIEMyHDC6pgVCIMgbiXV0n1CuoTNN8df4jIysBr6uoPhopbqYhF\n ZOF5RTfmrv4RIIAN1pic9nOjGBPTGgjYKUoqsg3sHRQlRECiLS4UtPatu+Fx6fgUXtjc7PPHk+C\n ufPC0UKDtk7iH6mP2UQVKFSybjtzCEzu2x3urKuVSlv4ralDr7vksV9eduTxJvofmcp2AjzzIz8\n akq8p3ES+jX6mIrMXswX+H917KN58RKIie0llo3JyDQ2JqPCoeYmzNljOva6HvWSwkeigN9zr3o\n 5A8pzilqRw1WFglV2XYHE6TCYTS8DwMLv0qnPYMAUEBW9uN9is378ChZ9+O+Jy2k374l0Q8PDFN\n XcqlYUhPH30g760uyag==","X-Proofpoint-ORIG-GUID":"jI5lTwcrruc5BILJYfv2zMh27BLAX7HI","X-Proofpoint-GUID":"jI5lTwcrruc5BILJYfv2zMh27BLAX7HI","X-Authority-Analysis":"v=2.4 cv=I6Zohdgg c=1 sm=1 tr=0 ts=69d0c91b cx=c_pps\n a=rz3CxIlbcmazkYymdCej/Q==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17\n a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10\n a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22\n a=s8YR1HE3AAAA:8 a=EUspDBNiAAAA:8 a=j3416i00YO8nPnzCGbIA:9 a=QEXdDO2ut3YA:10\n a=bFCP_H2QrGi7Okbo017w:22 a=jGH_LyMDp9YhSvY-UuyI:22","X-Proofpoint-Virus-Version":"vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-03_07,2026-04-03_01,2025-10-01_01","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n adultscore=0 impostorscore=0 suspectscore=0 spamscore=0 priorityscore=1501\n malwarescore=0 bulkscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2604040072"},"content":"Add a shared helper to encode the PCIe L1 PM Substates T_POWER_ON\nparameter into the T_POWER_ON Scale and T_POWER_ON Value fields.\n\nThis helper can be used by the controller drivers to change the\ndefault/wrong value of T_POWER_ON in L1ss capability register to\navoid incorrect calculation of LTR_L1.2_THRESHOLD value.\n\nThe helper converts a T_POWER_ON time specified in microseconds into\nthe appropriate scale/value encoding defined by the PCIe spec r7.0,\nsec 7.8.3.2. Values that exceed the maximum encodable range are clamped\nto the largest representable encoding.\n\nTested-by: Shawn Lin <shawn.lin@rock-chips.com>\nReviewed-by: Shawn Lin <shawn.lin@rock-chips.com>\nSigned-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>\n---\n drivers/pci/pci.h       |  2 ++\n drivers/pci/pcie/aspm.c | 40 ++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 42 insertions(+)","diff":"diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h\nindex 13d998fbacce6698514d92500dfea03cc562cdc2..48964602d802e114a6a2481df3fb75d9e178a31b 100644\n--- a/drivers/pci/pci.h\n+++ b/drivers/pci/pci.h\n@@ -1105,6 +1105,7 @@ void pcie_aspm_pm_state_change(struct pci_dev *pdev, bool locked);\n void pcie_aspm_powersave_config_link(struct pci_dev *pdev);\n void pci_configure_ltr(struct pci_dev *pdev);\n void pci_bridge_reconfigure_ltr(struct pci_dev *pdev);\n+void pcie_encode_t_power_on(u16 t_power_on_us, u8 *scale, u8 *value);\n #else\n static inline void pcie_aspm_remove_cap(struct pci_dev *pdev, u32 lnkcap) { }\n static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) { }\n@@ -1113,6 +1114,7 @@ static inline void pcie_aspm_pm_state_change(struct pci_dev *pdev, bool locked)\n static inline void pcie_aspm_powersave_config_link(struct pci_dev *pdev) { }\n static inline void pci_configure_ltr(struct pci_dev *pdev) { }\n static inline void pci_bridge_reconfigure_ltr(struct pci_dev *pdev) { }\n+static inline void pcie_encode_t_power_on(u16 t_power_on_us, u8 *scale, u8 *value) { }\n #endif\n \n #ifdef CONFIG_PCIE_ECRC\ndiff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c\nindex 21f5d23e0b61bd7e1163cc869fe9356d1ab87b34..879d7ecddf8d6430c49f31c88a75d5c6e74015d6 100644\n--- a/drivers/pci/pcie/aspm.c\n+++ b/drivers/pci/pcie/aspm.c\n@@ -525,6 +525,46 @@ static u32 calc_l12_pwron(struct pci_dev *pdev, u32 scale, u32 val)\n \treturn 0;\n }\n \n+/**\n+ * pcie_encode_t_power_on - Encode T_POWER_ON into scale and value fields\n+ * @t_power_on_us: T_POWER_ON time in microseconds\n+ * @scale: Encoded T_POWER_ON Scale (0..2)\n+ * @value: Encoded T_POWER_ON Value\n+ *\n+ * T_POWER_ON is encoded as:\n+ *   T_POWER_ON(us) = scale_unit(us) * value\n+ *\n+ * where scale_unit is selected by @scale:\n+ *   0: 2us\n+ *   1: 10us\n+ *   2: 100us\n+ *\n+ * If @t_power_on_us exceeds the maximum representable value, the result\n+ * is clamped to the largest encodable T_POWER_ON.\n+ *\n+ * See PCIe r7.0, sec 7.8.3.2.\n+ */\n+void pcie_encode_t_power_on(u16 t_power_on_us, u8 *scale, u8 *value)\n+{\n+\tu8 maxv = FIELD_MAX(PCI_L1SS_CAP_P_PWR_ON_VALUE);\n+\n+\t/* T_POWER_ON_Value (\"value\") is a 5-bit field with max value of 31. */\n+\tif (t_power_on_us <= 2 * maxv) {\n+\t\t*scale = 0; /* Value times 2us */\n+\t\t*value = DIV_ROUND_UP(t_power_on_us, 2);\n+\t} else if (t_power_on_us <= 10 * maxv) {\n+\t\t*scale = 1; /* Value times 10us */\n+\t\t*value = DIV_ROUND_UP(t_power_on_us, 10);\n+\t} else if (t_power_on_us <= 100 * maxv) {\n+\t\t*scale = 2; /* value times 100us */\n+\t\t*value = DIV_ROUND_UP(t_power_on_us, 100);\n+\t} else {\n+\t\t*scale = 2;\n+\t\t*value = maxv;\n+\t}\n+}\n+EXPORT_SYMBOL(pcie_encode_t_power_on);\n+\n /*\n  * Encode an LTR_L1.2_THRESHOLD value for the L1 PM Substates Control 1\n  * register.  Ports enter L1.2 when the most recent LTR value is greater\n","prefixes":["v4","1/3"]}