From patchwork Sat Jan 1 15:52:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12702099 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D2303C433F5 for ; Sat, 1 Jan 2022 15:55:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ee8lBWJ0FFH5a7VWxk9gDUyt0Fuzh9ttETX+TQMbgg0=; b=ooPU3a/OW1Jblb aMv/5kXIsNFZ5SuqNiOzbdfVLiHCYVYP26ADP2fehuV/pzMN+feMcI0OutFEDO12Ocv7E2ybO0JMi uFfOE029OdtgJRftZqYDBNoUVDbi/xrTEuCsRkv/Rqb356Ii/kb2qtDkLTQcOaxtZN8NSi8fhPKk5 G+EePhhoNYLBh4QbFxMWdrkWNoISXTILTsWDnr7GVcSows6r9ED9lvG5e+JtMiok4nY6bHr1hjW01 CX/jKSjQDSbbUDhdy2aFrqzvzuX4UfOaFtKi77ym6fmecysUZYRFXVe8YPTfzhdWiw1VuG42kwGwu TiNZrVYs1TbtR6pAyRPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n3ghA-0079du-JL; Sat, 01 Jan 2022 15:53:24 +0000 Received: from mail-eopbgr00084.outbound.protection.outlook.com ([40.107.0.84] helo=EUR02-AM5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n3ggy-0079ax-GV for linux-arm-kernel@lists.infradead.org; Sat, 01 Jan 2022 15:53:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SlwEpSK8ut59c7K3HTD75K5j2i/j4Pe/ONtcWysUiZxxdW8i0dDR0GIC2smG1WGkwxItUWGoqecT0UUNjgrpyoldxpHNoG2dxKe5NQo2QuBWxe+PwEc9P9aO0p03RMfIVwDQsxbM9WJT7EhgGYL+iKrV+CRzTI3lmgczv/85reBvT2l81vzjXfKkR4+oTMBJqhmT1wtgDUCezgX+PS/kJgDAtUanLw3Y1juu7oy4vQQH3WpJGvsMjfa3eg4kDMk6pVdEfyNnSk8fODSvgU6Rz7bIJFW03e9xWVYC70uMWmX21qsJ8+heflqubrGv/jcieRME3r+/hV5W+jtzZKaIcw== 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=mw7yRVtMw8ImJtrMwJWiIkn1XlzYpi4UXJ2tVA4J7Zg=; b=PpCTegxCbJXxhlVYRm6ecUlp1BOwcWZ4GC/LJNtKbzTVskdvsMeGh+maGh8EN+wzFRy8V7TSp/BKAObYxxyzqR8lx2fg+cVn9oCWWC/+GI9AIRJrFiL6kc+ySe08fv8pGPjiy+4mJYejOl7SqWMM4Jd0PZACHPIwpxCGMJUxVnoBBNFSqdOjHXHlf3YPfJedaNdysjdrRVqLWQwKlWsgToChENLSb0YAUktOUpfZaH4aa0GIYnWptULQoYQhYs8CZiPd4EHmkSSNk9npT+qXjA1EMZcFn7MXREmDed+0NPvR92GmJh3qfvsOeX9/DlHUl+KNnD6Kq1sr20f9fWD3Aw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mw7yRVtMw8ImJtrMwJWiIkn1XlzYpi4UXJ2tVA4J7Zg=; b=UyAMpf8g1Q1qOoUz3i1VytmpahMJ/i950AoqbR6PvgwGQeG9aIlvE9T6CPpvwpZnwVgDxLOAKDyblHl+6B5MrTlXd1YiNh6H7OqnPezyqTGWK3QoYZcBYJFvCQUnzNxoYZHH/AuWb2Ikwkflowc7FAmtbR8LZvWtdcuD5IXSX/g= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB4688.eurprd04.prod.outlook.com (2603:10a6:803:6a::30) by VE1PR04MB7471.eurprd04.prod.outlook.com (2603:10a6:800:1a7::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.14; Sat, 1 Jan 2022 15:53:02 +0000 Received: from VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::4c4c:f2b2:addb:841]) by VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::4c4c:f2b2:addb:841%6]) with mapi id 15.20.4844.015; Sat, 1 Jan 2022 15:53:02 +0000 From: Abel Vesa To: Georgi Djakov , Shawn Guo , Sascha Hauer , Fabio Estevam Cc: Pengutronix Kernel Team , NXP Linux Team , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linux Kernel Mailing List Subject: [PATCH 2/3] interconnect: imx: Add imx_icc_get_bw and imx_icc_aggregate functions Date: Sat, 1 Jan 2022 17:52:44 +0200 Message-Id: <20220101155245.3139667-2-abel.vesa@nxp.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220101155245.3139667-1-abel.vesa@nxp.com> References: <20220101155245.3139667-1-abel.vesa@nxp.com> X-ClientProxiedBy: VI1PR09CA0084.eurprd09.prod.outlook.com (2603:10a6:802:29::28) To VI1PR04MB4688.eurprd04.prod.outlook.com (2603:10a6:803:6a::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e2404160-fdc1-417e-c241-08d9cd3eca60 X-MS-TrafficTypeDiagnostic: VE1PR04MB7471:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Wd866x90x12QLAI/2rdoMb7x/KTk43/SrxvSjFRkNy2pbjyX/laD/YxYeNohyYl1/bvt6Xf/ynNjMBDd5oTtp9IzxoVDoqfsZnOyKiSMixLFFsDvc6M+0LdNtgc8PKdyAJgh/WRTTyz/X/YjuxSDDKhRFGE3xFFD29S7xAqDGqZiXZnf1xLSC1SEhutuNfb12LFhMtiKj+Y0iKb7DLrG4wQcY4mPCPm7z9NobGQeF75cSH9dSEPbqwv/O8iEil/vZ0EInCJEUd3a1vi877uxUy6qLtksxYmL4LQNijCv9IV/mo0Q9QBKOJRtAMMKanupAFCqZxoROw4kZvc5VsNxEDutZxYRfUnY7f1QtOjMtAXJW2uppb1EWkkXz739ja9XI8tnrh0gaABp79KeYDU3mnY7v/00HFyvo2ZuyavPZvCbZdWQNdZX7FrqU8VHmGTaoL2YwhyeUnz12u7AIoYu300GcsxQGnukvLeO57Sa9zOLMqy+5OjaPYY3hnp1lvKkZ7jcXSEKyvYHqgic/2PwKvHp143p17FDjJWsUpwd4bDfrRYUkntQH0RMCqyD10iHmMrLwt7AYP+3kAtbBCg9QM4PhNkNGjNVJ20LMMg8QveUy3kfpQdcan6iCgb0k9wJBZ+ZVtqhuv29MFVzGu0lRKzeFm2sdC/V+dLqdLVB5UTnb29kMijjUYul5Hr+a3eXSruqeKHooHywT3Z+Ob2r/A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB4688.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(66476007)(4326008)(66946007)(2616005)(52116002)(316002)(186003)(26005)(83380400001)(38350700002)(66556008)(38100700002)(5660300002)(1076003)(6666004)(110136005)(2906002)(36756003)(44832011)(8936002)(54906003)(508600001)(8676002)(86362001)(6506007)(6486002)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +W5qBoW+rBEtbWVrydUPPQA0sSyYdBobER9uBydZvnhyd/OZjaOSYWdTHDr1gxVRRBjesF3yIb033psefSj8IkwwDbjAQF8MzIVS7DInle+tp0EtJ8OiYPVaUrEbEfkW4QrmvOFm15nOMvV9QbVJPHiSnzXLgdv8UP+zWTHF2gjYLrk1ywfawVRw2JrYX45dZzUJeCbti3QI3q007RypQiyZrX8umivB+M9V8uHiBmwhUz7nIZxIzEQII3ysRvprOe/Nc08bVmpeJ1Ny/DZlBeBZ0kaFBbtUm6PHrxZJJxTf9gJk0prf58pwOi634o5lKCGlv6EnlkZNG4w5o1D9qCg1h7VaToz4rQ2TiVDhkdGUIErNZaRMijxp/pPm6F8JLaaQr1Mis2Yxh7/4ELGhXRncs+a3XP0S9L9bFJYZFGp5UeZ3BljUd6ARvMGyAdu8CwslBJNorkN0L8dfB1lU5p6LsFYiqYSWztA7lTVEgd/ChdyigEZ9355A3HiPBxnz65KggL1l/ENuZDf4eKrzovDZFlNymKMn+6hqO0Wmou+93/voTnasPgw/fYab7SQpsVRiT49EWdkcRoKIq2DaAKqBXBV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-CrossTenant-Network-Message-Id: e2404160-fdc1-417e-c241-08d9cd3eca60 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB4688.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jan 2022 15:53:02.0628 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZZ/l6eOi3nxF7K3/3k5sSPNaX8ed4KuEgxVx3Lk8BdxVWIpzMQHHNXVQHQfSxw8KW9aDnFY208+qWyg092r35Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7471 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220101_075312_573315_AE0730A7 X-CRM114-Status: GOOD ( 13.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The aggregate function will return whatever is the highest rate for that specific node. The imx_icc_get_bw sets the initial avg and peak to 0 in order to avoid setting them to INT_MAX by the interconnect core. Signed-off-by: Abel Vesa --- drivers/interconnect/imx/imx.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/interconnect/imx/imx.c b/drivers/interconnect/imx/imx.c index 34bfc7936387..4d8a2a2d2608 100644 --- a/drivers/interconnect/imx/imx.c +++ b/drivers/interconnect/imx/imx.c @@ -25,6 +25,23 @@ struct imx_icc_node { struct dev_pm_qos_request qos_req; }; +static int imx_icc_get_bw(struct icc_node *node, u32 *avg, u32 *peak) +{ + *avg = 0; + *peak = 0; + + return 0; +} + +static int imx_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw, + u32 peak_bw, u32 *agg_avg, u32 *agg_peak) +{ + *agg_avg = max(*agg_avg, avg_bw); + *agg_peak = max(*agg_peak, peak_bw); + + return 0; +} + static int imx_icc_node_set(struct icc_node *node) { struct device *dev = node->provider->dev; @@ -233,7 +250,8 @@ int imx_icc_register(struct platform_device *pdev, if (!provider) return -ENOMEM; provider->set = imx_icc_set; - provider->aggregate = icc_std_aggregate; + provider->get_bw = imx_icc_get_bw; + provider->aggregate = imx_icc_aggregate; provider->xlate = of_icc_xlate_onecell; provider->data = data; provider->dev = dev;