From patchwork Tue Feb 8 14:59:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurentiu Tudor X-Patchwork-Id: 12738838 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 4F52FC433EF for ; Tue, 8 Feb 2022 15:01:25 +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=2ZsknmXNp3o5O3YfbJ72/mzPgFzSDuAKb/xmm2ofCp0=; b=ZQe99G6cUSdsfy X7tbRLsC9TVKlpn4StAT52mptF0egbyfNYIzjqrTLnwbEaMv811RP2BZF17Yg3pW/P2NewUAtG/9G jH8K7K4s3cR3PnSe64riN5B85QiVIFDC7A4ZB01pFbMtX9xceW+3/0+g3s/pKP4VzdslCUEfzR8Yj pTLRYP7yZUJkNsxOss79CZ8HVRimA9jm2BumFZd2NmOum5nkcjaq9Cde63c03YYMmio0Gkgug3oG5 u/ZIfEqSKJjPqdrXwMSYD5MlgSJ1V1bGCEMl7VsaXAzVskoZxj5RFSPCLHWyk8EfjONfjPghXzxR3 DGDP4ywG5fbT5mrttTVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHRy7-00ELgK-QW; Tue, 08 Feb 2022 14:59:48 +0000 Received: from mail-vi1eur04on060f.outbound.protection.outlook.com ([2a01:111:f400:fe0e::60f] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHRy4-00ELeg-Sf for linux-arm-kernel@lists.infradead.org; Tue, 08 Feb 2022 14:59:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FKQIrKk6Ul4+E/eaPlhNHS3lvTgHuwMF9gOcBp4iatTxefqV81QpJ9fj7YJvB9jxJzYLtn87CXFcrxcA8dOLsBT0FDQNehedbNdcVkchE/lEzrqjBG8tyEqCBWHgv2l1gFHXS5TVx6k/+76eiz43/5qCK8L2ubdJkmsAWFFjkeu+CX5R4rhHXmnvl596ez+J/evJ+Y7sz660DvhUjaz52c8hOFklVwRyPaTbEo1Wuytr9RMk/3T5WTJ0bfBhiZGxb+Wc+t+vlcWm+m/frOjJ1yL9sdfh/IczpFTs86kUvaeoW9dQT+RhXhPNvcMrg8EALHDKFNp5I46wCTgMewwCmg== 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=LEuM3YgEWeSsvt0p3Fvd4aWbqb5k/DDi7+HQiqQHn9Y=; b=OdwiJ6Z5kwdnoLS8ZrYFiJZYFspDQNwLzQxHTLEzYJvdWYTNM9w2nR736qdxVOou8NNcwXh8rLRB/1x88fvBW/1Eryc82MV5IxH+D28fJ7+Q8AY7sJaOnv0jR6FMmlEKssy603I6TGzCumhWXHvfNwkC5SDjDQ3FPlrSYzszvFeVXnOa7zm56qP9LG5RJCpZYkZPk4LqAsnQDRGHEu1eSiQ93UP4grAy2ARq8OwCafNKuaOIf873cDHIhUNa5UzEron747Tbacn1bE3AfI5s4YGPA1YHESCtlOaaVR5EukziJE+GZn+eWk4+A22cmhrwYEy/TbV/a6CaF4PxYsFQRQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=LEuM3YgEWeSsvt0p3Fvd4aWbqb5k/DDi7+HQiqQHn9Y=; b=LWMtDZ9l9oYFofL5kEtUnGhwzma5g5blPGn/RT0KTognQ8p1JjpFYqZQFd9CsmNvxpxGVQANf9D9ufvb2iSf2KoU6raUUOaBtQ0RW6/axTK6MpWJuNM0/vN0yDAA6OHP4zwxnE8hzM2JiZVCmaIp+Bm2QN7ND328fb+xOxm8I0Q= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR0402MB3405.eurprd04.prod.outlook.com (2603:10a6:803:3::26) by AS1PR04MB9381.eurprd04.prod.outlook.com (2603:10a6:20b:4db::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.19; Tue, 8 Feb 2022 14:59:39 +0000 Received: from VI1PR0402MB3405.eurprd04.prod.outlook.com ([fe80::f826:3bf6:b77d:5a53]) by VI1PR0402MB3405.eurprd04.prod.outlook.com ([fe80::f826:3bf6:b77d:5a53%7]) with mapi id 15.20.4951.019; Tue, 8 Feb 2022 14:59:39 +0000 From: laurentiu.tudor@nxp.com To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: ioana.ciornei@nxp.com, diana.craciun@oss.nxp.com, jon@solid-run.com, Laurentiu Tudor Subject: [PATCH 1/6] bus: fsl-mc: drop useless cleanup Date: Tue, 8 Feb 2022 16:59:23 +0200 Message-Id: <20220208145928.12468-2-laurentiu.tudor@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220208145928.12468-1-laurentiu.tudor@nxp.com> References: <20220208145928.12468-1-laurentiu.tudor@nxp.com> X-ClientProxiedBy: AM0PR08CA0025.eurprd08.prod.outlook.com (2603:10a6:208:d2::38) To VI1PR0402MB3405.eurprd04.prod.outlook.com (2603:10a6:803:3::26) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d62104aa-dfc4-4bcf-bc6b-08d9eb13a152 X-MS-TrafficTypeDiagnostic: AS1PR04MB9381:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xiZCkghGTHu6yI4yynmWBKvj3gSD5A5t5W5TlNpM+N54scpLdNnd0DLSzvIsczf47iINUQ5vHBh4Qh1uI/EeC/7kLZrULIEe62gPZruYxcJ9QJPu+bBoxQhwLAWwTtWFvyZtPLlHUAkIQRQIwo8NbKVUQ/GFqcLP2z4jusn2rLs25gCQs+nKINRQiLr0EZNpSDq3Bqe9HtDMOwNGIxLw1U6ZpnxXmVrgY+xBQu3c7nwJGb9UHVHXKThirwlLuhm08aPK3wt0qf60h4U/4i6Pu33CGb8PtSeIPdEErxlXYlvEhlii5zowWODOftB6MsNXpfx0hWn2AqDR9g365S3f2skO2Bz/maEPj9SCB47ADJHoKwtE0ie9/6LP7bTlvZ+HP6IPq/wBvmjeXxrHFenVQFqppQW5gHZu/OIDn2EYo9DJ7DWckGBMOq8J1ziNe0oQODN+AyIxEYuQsKivrq+f5x5HCHfCu3Zqr00YKjKspdXkn62Lo8mVsi8gikoL+agBtVDrUNf5x02j//XMs76ViJkBK9CzceG0cpIh/Ld0hQWxOizyv6o7XtqVtsIj3APDGEX+GNH9oQBuWkVPPf+Kt9yEuySMOTAGic5ft0dxt56pQJxPNaU79hlpabGXvfw1rXiij8OKY+DcC+UETnVuXitSax3DIQDQ9b6fRsjpmkJVNEeRKcny+a/p2GfEbNZGSVtyq2NuGBGBFsojBkdj1w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0402MB3405.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(66476007)(6506007)(6666004)(4326008)(38100700002)(8936002)(83380400001)(66946007)(508600001)(8676002)(66556008)(2906002)(186003)(36756003)(6486002)(86362001)(2616005)(5660300002)(6512007)(9686003)(26005)(1076003)(52116002)(316002)(38350700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5vJhwT888Z7k02UTpQwYqQ1O49oiXT9ZYfRUP6i0daFCoUyMN1bVhO29M9tQXxSPgscSdQ8tttbx3c7ai9duNwrADpMJbpCSgN/ve269GU6MnfVib6XA8bhfxloxWkdRJnat0ltBglFFGTRW8UVlI4rDLhlBqZU0u1QVsS80sBiULCJvDBDdfCaU7/crpeyHdhbV7Zice+4mLF0ya8rHUenuHsrBuqD/o4dUGtUvzwEdcDPJqwukBVSm+JG75SKbpnUTimMXqB7XuCNjxBFHtuNqBbarB0wMKj1qYHswhazUPfklNz4Sb8bMSBnP92+5p21RbvK+Jc9aEWIkXfWO4YOphwgnQMmL41eGob3kc489kpGREkWGp8wCxyZ68OBB8nEb2TYLNqG7Jjf9lTMPPNHC7dlxOVHFYxhQSAheOgeYDvz1M6mTRBVoERXb7mBqxnfLI3HqJkU+vZLcvo8bI25pPUFphpsh3D2eX3J71P2gFPctrm1fL8KHv6vVoHtxC5ysTinVzR30Fccp/ndmU+Zr/h/75Wzu4xxcAzgaClxJmaROJi2fHyruR+3VYD3byI0zARM5JLaQE8JUJV044gItfTDYVIfJ0qQP9UQq5mt1iJsE1DmODm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13a152 X-MS-Exchange-CrossTenant-AuthSource: VI1PR0402MB3405.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2022 14:59:39.4814 (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: vA/dBFd8emr15TlxAyPBDaGh1K73gZHM5YxKTo5jvvv1TwgZ0gaq38SuQKlFKre/nEwt/WFxfTqHYTsgUy2Ohg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9381 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220208_065944_973447_AEE4F774 X-CRM114-Status: GOOD ( 11.88 ) 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 From: Laurentiu Tudor This cleanup is actually a no-op because the resources are freed when the device objects are removed from the allocator at driver remove time. Signed-off-by: Laurentiu Tudor --- drivers/bus/fsl-mc/dprc-driver.c | 2 -- drivers/bus/fsl-mc/fsl-mc-allocator.c | 24 ------------------------ drivers/bus/fsl-mc/fsl-mc-private.h | 2 -- 3 files changed, 28 deletions(-) diff --git a/drivers/bus/fsl-mc/dprc-driver.c b/drivers/bus/fsl-mc/dprc-driver.c index 5e70f9775a0e..36681cf7c42e 100644 --- a/drivers/bus/fsl-mc/dprc-driver.c +++ b/drivers/bus/fsl-mc/dprc-driver.c @@ -801,8 +801,6 @@ int dprc_cleanup(struct fsl_mc_device *mc_dev) dev_set_msi_domain(&mc_dev->dev, NULL); } - fsl_mc_cleanup_all_resource_pools(mc_dev); - /* if this step fails we cannot go further with cleanup as there is no way of * communicating with the firmware */ diff --git a/drivers/bus/fsl-mc/fsl-mc-allocator.c b/drivers/bus/fsl-mc/fsl-mc-allocator.c index dced427ca8ba..9fa2a8c28a2d 100644 --- a/drivers/bus/fsl-mc/fsl-mc-allocator.c +++ b/drivers/bus/fsl-mc/fsl-mc-allocator.c @@ -549,30 +549,6 @@ void fsl_mc_init_all_resource_pools(struct fsl_mc_device *mc_bus_dev) } } -static void fsl_mc_cleanup_resource_pool(struct fsl_mc_device *mc_bus_dev, - enum fsl_mc_pool_type pool_type) -{ - struct fsl_mc_resource *resource; - struct fsl_mc_resource *next; - struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_bus_dev); - struct fsl_mc_resource_pool *res_pool = - &mc_bus->resource_pools[pool_type]; - int free_count = 0; - - list_for_each_entry_safe(resource, next, &res_pool->free_list, node) { - free_count++; - devm_kfree(&mc_bus_dev->dev, resource); - } -} - -void fsl_mc_cleanup_all_resource_pools(struct fsl_mc_device *mc_bus_dev) -{ - int pool_type; - - for (pool_type = 0; pool_type < FSL_MC_NUM_POOL_TYPES; pool_type++) - fsl_mc_cleanup_resource_pool(mc_bus_dev, pool_type); -} - /* * fsl_mc_allocator_probe - callback invoked when an allocatable device is * being added to the system diff --git a/drivers/bus/fsl-mc/fsl-mc-private.h b/drivers/bus/fsl-mc/fsl-mc-private.h index b3520ea1b9f4..450af2bf7de7 100644 --- a/drivers/bus/fsl-mc/fsl-mc-private.h +++ b/drivers/bus/fsl-mc/fsl-mc-private.h @@ -635,8 +635,6 @@ void fsl_mc_allocator_driver_exit(void); void fsl_mc_init_all_resource_pools(struct fsl_mc_device *mc_bus_dev); -void fsl_mc_cleanup_all_resource_pools(struct fsl_mc_device *mc_bus_dev); - int __must_check fsl_mc_resource_allocate(struct fsl_mc_bus *mc_bus, enum fsl_mc_pool_type pool_type, struct fsl_mc_resource