From patchwork Wed Oct 4 14:05:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Gupta X-Patchwork-Id: 14915 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp158198vqb; Wed, 4 Oct 2023 07:06:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEjh9V4lhXK7FVnAsD7o7bFGs043bKX+NMqnrhFI0D3Ou/feYjYjbWK5QBG+2PhniGPwbvM X-Received: by 2002:a17:903:32c6:b0:1c4:3ae6:381a with SMTP id i6-20020a17090332c600b001c43ae6381amr3187979plr.0.1696428392279; Wed, 04 Oct 2023 07:06:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696428392; cv=pass; d=google.com; s=arc-20160816; b=rWdIi0CwYMctw0igk8n1v6KTMwGx6LjuZ8R33xpFMwyjECb8Owuuz4jHw5OEPwyjte 8SdJqejJk4s+2etQoY1o3wf0ptA6QjsyN3+Do1wMhw0fZtysbM7roKdzkM1ZPhrFUNCK TmUw2wnJfEoTpn1tYzuMLWzHd7IgmmdUFdgNhN8CA/IN0iDV0Zx70EhQrC4YTYJ8ynwt qiZDIDPBViRo1/9QM9o+LtEadY84fZBBbVcPzjx5JDKfjIcb8Ju0NYO9oHWuDB4y6FVI 2ZiFG4Ahle6VW3RzsLjxs7HTeW4hY3AyFdCw8E7Uh1Y90fp9dhF0ues32UKVGqkwFSuu j4cg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=Ox70atXCa1yw/ahkFwgVYgCGINbSrJ3tXMMuQ4HFBWg=; fh=PTp2mvTrCvo/vo16l0ne4zJtbYthE/in2768K/EMwdE=; b=lpGiSPwr5HU9kHIFEtoU9hROL2CIY26TuA4QaKyj6wLW6lNVTl4qoGMzxuph/g9wWN pWjjEGmQLZ8NBloLqZv6/HJrJDswrjSQj3BByJ3CqsUETCKBq9jDU5xkuRB3hau4Nw4w xiRx8CPIxj3KeRYr5w5lFo3Kc1Fqw8RiTaSFLECT+6ZzGvxPuhS+1lsF/BwuEtvoUK2g 7RNQckmAGoOa2eHBuddbLJ/cJMceq4+2WF6trLtZ2edOpYTZ3RXgNKChtGZUDtmOpdUG TIdTBXvOGjNxTFOzd+w27Vu+9SQmfRFNDhgvpSeGEkLSMB/uTxlJ5u+V8NcohuJdNYIg meSw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=MGtZRQyB; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id j3-20020a170903028300b001befd0512ecsi4154213plr.314.2023.10.04.07.06.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 07:06:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=MGtZRQyB; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 2FDAF81ABAC6; Wed, 4 Oct 2023 07:06:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242788AbjJDOGR (ORCPT + 18 others); Wed, 4 Oct 2023 10:06:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242757AbjJDOGO (ORCPT ); Wed, 4 Oct 2023 10:06:14 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2051.outbound.protection.outlook.com [40.107.101.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 394A1AD; Wed, 4 Oct 2023 07:06:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JAFqm5oaP/IicXRveVlpI3clqwQRdVMo7evxSgWqnrUgMn5JVwVoH5RK5Ckhwbv+DpUueb099c7bNCoq1gt5k4oVnMPlh23XvIcNqUKVeZa9+BCvMYma2SCNPQ+18KlfBwAOVIuhIxWoh1bicqywjh594bS55iGp+tEoihKpoZPunnPAHzkVsDtyw8Mhkb+EkcAjUIB1tCHQtgMKaEtPIB4nLfbJdSuTfnbA12sPFuiT8NDg+7INbKJv7AhIFKZuHCHNPuasR3XCmq5xOXa8qjijJsfs57+FIK+mYsuW0ibqsnZksS91DkrB4fouYTiIAoC/kXwBvKj2Zb4fkNALJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ox70atXCa1yw/ahkFwgVYgCGINbSrJ3tXMMuQ4HFBWg=; b=duXVL9/KEBsfsKXsrBBcXBD1KIPCao4lkHS74/phg1unfkOwT/1/ibSoX8PTZp/9o5ioTR6nmOJMRYmijKwFLEQMbOmJKX+iy+gzZK/C16tZ7jBuPyhERHXrlAN1deTMpjuz22atNLYEGuQSgfSU77Vk9BiPs2AtLazg0AxLN4YRuoZr89ksv5fCpedl3Zn2onnYZFGlC0wqlB1GDUacJZblKOvAbz3swQmdvaEA1sGqpwZslqvkydW4cFlT2OeEXfm3BaaASg+l8N1+l268y75eVY6AHmDyTWoqSDL2Ny9AGUc9lb33Z9Hk7kBZ6grxIoWfXcp7isrdJ/knbrKFnA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ox70atXCa1yw/ahkFwgVYgCGINbSrJ3tXMMuQ4HFBWg=; b=MGtZRQyB8kXzmjpOJfZr8B1PV4QrM9h5gclTuc7JFUe4ATtBdA1CMA8qU6nSajsyZuTjGDmgG+ZyCL6PpqQlbblQ+MD4EAcXvh0/4p+st6CNNi6ROeXvxoaWPYUH12vL9/nRA9x2bJ3ciYP6HQiIwJKAinHHy1CLm7gLEMw9hlJVILcOKVukpsSem7FkeHEvVXBukbBJVpAqvRIPHE/vxlr+9HveJSrZG6eVwb+mhdNbvu/CAQMjeC+3QjdjYK2WB//fZD1dsGvTp8/KXhVNvfqvOki1+3nJMve2CGkaLYOOsTgij50twxUFPz+w6zbJU8lPkjJLcqBImeG2JI61Ow== Received: from DS0PR17CA0013.namprd17.prod.outlook.com (2603:10b6:8:191::11) by SN7PR12MB7106.namprd12.prod.outlook.com (2603:10b6:806:2a1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Wed, 4 Oct 2023 14:06:09 +0000 Received: from DS3PEPF000099E1.namprd04.prod.outlook.com (2603:10b6:8:191:cafe::fe) by DS0PR17CA0013.outlook.office365.com (2603:10b6:8:191::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.25 via Frontend Transport; Wed, 4 Oct 2023 14:06:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DS3PEPF000099E1.mail.protection.outlook.com (10.167.17.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.22 via Frontend Transport; Wed, 4 Oct 2023 14:06:06 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Wed, 4 Oct 2023 07:05:48 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Wed, 4 Oct 2023 07:05:47 -0700 Received: from sumitg-l4t.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Wed, 4 Oct 2023 07:05:44 -0700 From: Sumit Gupta To: , , , , CC: , , , , Subject: [Patch v3 0/2] Improvements to the Tegra CPUFREQ driver Date: Wed, 4 Oct 2023 19:35:35 +0530 Message-ID: <20231004140537.1954-1-sumitg@nvidia.com> X-Mailer: git-send-email 2.17.1 X-NVConfidentiality: public MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099E1:EE_|SN7PR12MB7106:EE_ X-MS-Office365-Filtering-Correlation-Id: f4e24e44-0e30-41c4-3dbc-08dbc4e30d73 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kEIKC32gkd+YYbeEHXsUns3w45SD1R6PNSlghKLaRVGAdzkPzjyLIhSUn6qeWlGw70RB5PEL7ulgA9+elUtlMrlXhb5qx3vs6F6gXCEmPEZxQlzzhQxWb6C6hCT+AP0jTSDWnSDtA4J/p8rFOkhAJ8LxPQIAgYIgPtuPw5TBKuzURBgOxOaWE4pM4etP9M1YwVa1Em7z/HE1zoDqr1JXdWkqQMVKZWECw+eIUIyKyfJKWnRncFV2L1OFYGr28h5TyQ3CJPHaW3LoybErKDZ/fEQCHxXwtJlQPpy4oIpltAsIMvZzZnnmSf0FYUvF328dVMpPgSL/YXa8DBkd/MoFDwdvwNShlq04WTJ2zGHUPAopdLHmlIPcP7qhahIj+bSjW2Vg4ssd57QBw7ODz5M9rHYdh7mJDc3U29KO4QR/Cl7Imb3AG2J0s1ODqGO0Okn9YpTsb6dAnZPY+Q+L1VKibfyoKEGW4VGENVnmdgaDsafucBIsybwbg7PGmcwp8aIAFTiRf1AbpwT9KWVxX2gas/sVeglXuZHnCjLAtCmjCej2eNnywXrCww7Z7OmOoLTKj9oF64Q/OtwO6ehvYDwFVaW5Ez2GKaT5p826qq5wM7DegDEKA4zIi64cFo6M5ZyxnwrXCwo1U2tHjWGNwNfYV7wfUqD/vpPMI8AMbHqWdVieGQX/iN9XCtxscy50d/r76odFOXE9dr6BhZmtSHEB5Vze4Vq1Des6qRnN76bifkyCKInnvJB/++WBMsDUh0sCIiYPZT71TiKB7qfIHBzjK8dn4RzvA3RAQNavxzP9dgRGKdPF+0U/R91iMnSN27cu X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(396003)(376002)(136003)(346002)(230922051799003)(64100799003)(451199024)(1800799009)(82310400011)(186009)(46966006)(40470700004)(36840700001)(40460700003)(40480700001)(7696005)(478600001)(6666004)(47076005)(426003)(966005)(36860700001)(86362001)(356005)(7636003)(82740400003)(83380400001)(336012)(107886003)(1076003)(26005)(2906002)(2616005)(316002)(36756003)(70206006)(70586007)(110136005)(41300700001)(8936002)(8676002)(5660300002)(4326008)(54906003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 14:06:06.3771 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f4e24e44-0e30-41c4-3dbc-08dbc4e30d73 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099E1.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7106 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 04 Oct 2023 07:06:29 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778834097820899706 X-GMAIL-MSGID: 1778834097820899706 This patch set adds below improvements to the Tegra194 CPUFREQ driver. They are applicable to all the Tegra SoC's supported by the driver. 1) Patch 1: Avoid making SMP call on every frequency request to reduce the time for frequency set and get calls. 2) Patch 2: Use reference clock count based loop instead of udelay() to improve the accuracy of re-generated CPU frequency. The patches are not related but have minor conflict. So, need to be applied in order of patch numbers. If 'Patch 2' is to be applied first then will rebase that and send separately. --- v1[2] -> v3: - Patch 1: used sizeof(*data->cpu_data) in devm_kcalloc(). v1[1] -> v2: - Patch 1: added new patch. - Patch 2: changed subject and patch order. Sumit Gupta (2): cpufreq: tegra194: save CPU data to avoid repeated SMP calls cpufreq: tegra194: use refclk delta based loop instead of udelay drivers/cpufreq/tegra194-cpufreq.c | 151 ++++++++++++++++++++--------- 1 file changed, 106 insertions(+), 45 deletions(-) [2] https://lore.kernel.org/lkml/20230901164113.29139-1-sumitg@nvidia.com/ [1] https://lore.kernel.org/lkml/20230901152046.25662-1-sumitg@nvidia.com/