From patchwork Thu Sep 7 17:17:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dhruva Gole X-Patchwork-Id: 13376702 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 427DEEC8743 for ; Thu, 7 Sep 2023 17:17:58 +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: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:In-Reply-To:References: List-Owner; bh=ZKtsbC6wfIm6JLXXkSfn7qYLD09s1ZiC+wfdO+KHn6E=; b=DbVnOKpBpD4wny WwK4cF7zipc3L3LUAXp6wE4GKqmEdcr3jT7zP0OrJ6rx7qws2MefqDOIaX1oCyqnLmlRfhW/hj1Zl Hr3BLQSwYL9+0ODVL2jrIBkYWbXMEj4AEJErnpp7quOfy0VoF5uQn4dtn3DmKsQe8+c1aHwkdurOg qJ7/3xtj+Hh2/iww2dEfOsWkDsyyvIOSiECPO1tWTYhhmusdyRXqd2+UU4jhf726asIoxwr2E3myw Py4Jduc82Ma27B32PszwDujuJWVLNkE6sVzi84cl39GFrkj7FGNV87VVCD2NFj6tHcDbnApoTBHXb zj/jjb8EK3ZbqAfAipUA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qeIdD-00CSc6-0O; Thu, 07 Sep 2023 17:17:27 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qeIdA-00CSbD-1N for linux-arm-kernel@lists.infradead.org; Thu, 07 Sep 2023 17:17:26 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 387HHIuV057569; Thu, 7 Sep 2023 12:17:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1694107038; bh=vq7So6xb27BfuWlAt3oT5BbUy0TQs3s+9Xai7gTKSeg=; h=From:To:CC:Subject:Date; b=n27lVO45CyeCM0m+BoLgrpDhLHYSVPo2Z37QNlGYyG5TAB7CROM74G1paRD48WgKb BWes6L0HEomGFzfk9amXP0/vFKVQeNKgPlysi2hZzWwtxCGFJesWyOXlJFP8oolFdI Pvqetsv2erwKWWoRRIafuqVO6fCkMSCt0djxKb7c= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 387HHIFW016247 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 7 Sep 2023 12:17:18 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 7 Sep 2023 12:17:18 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 7 Sep 2023 12:17:18 -0500 Received: from dhruva.dhcp.ti.com (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 387HHF8s018421; Thu, 7 Sep 2023 12:17:15 -0500 From: Dhruva Gole To: Nishanth Menon CC: , , , Tero Kristo , Santosh Shilimkar , Vignesh Raghavendra , , Dhruva Gole Subject: [PATCH] firmware: ti_sci: Mark driver as non removable Date: Thu, 7 Sep 2023 22:47:00 +0530 Message-ID: <20230907171700.1922453-1-d-gole@ti.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230907_101724_541383_6712090A X-CRM114-Status: GOOD ( 20.14 ) 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 TI-SCI message protocol provides a way to communicate between various compute processors with a central system controller entity. It provides the fundamental device management capability and clock control in the SOCs that it's used in. Ensure that the driver isn't unbound by suppressing its bind and unbind sysfs attributes. As the driver is built-in there is no way to remove device once bound. We can also remove the ti_sci_remove call along with the ti_sci_debugfs_destroy as there are no callers for it any longer. Fixes: aa276781a64a ("firmware: Add basic support for TI System Control Interface (TI-SCI) protocol") Suggested-by: Uwe Kleine-König Signed-off-by: Dhruva Gole Acked-by: Uwe Kleine-König --- Cc: Nishanth Menon Cc: Tero Kristo Cc: Santosh Shilimkar Cc: Vibhore Vardhan Cc: Vignesh Raghavendra Thanks for bringing up the potential issue Uwe, sharing link below for context: https://lore.kernel.org/all/20230216083908.mvmydic5lpi3ogo7@pengutronix.de/ This patch is also inspired from the commit bbfa509d632946578d4f ("powerpc/ep8248e: Mark driver as non removable") base: cd04b2fab5ee (tag: next-20230907) Add linux-next specific files for 20230907 drivers/firmware/ti_sci.c | 46 +-------------------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 26a37f47f4ca..66c3846c9147 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -190,19 +190,6 @@ static int ti_sci_debugfs_create(struct platform_device *pdev, return 0; } -/** - * ti_sci_debugfs_destroy() - clean up log debug file - * @pdev: platform device pointer - * @info: Pointer to SCI entity information - */ -static void ti_sci_debugfs_destroy(struct platform_device *pdev, - struct ti_sci_info *info) -{ - if (IS_ERR(info->debug_region)) - return; - - debugfs_remove(info->d); -} #else /* CONFIG_DEBUG_FS */ static inline int ti_sci_debugfs_create(struct platform_device *dev, struct ti_sci_info *info) @@ -3449,43 +3436,12 @@ static int ti_sci_probe(struct platform_device *pdev) return ret; } -static int ti_sci_remove(struct platform_device *pdev) -{ - struct ti_sci_info *info; - struct device *dev = &pdev->dev; - int ret = 0; - - of_platform_depopulate(dev); - - info = platform_get_drvdata(pdev); - - if (info->nb.notifier_call) - unregister_restart_handler(&info->nb); - - mutex_lock(&ti_sci_list_mutex); - if (info->users) - ret = -EBUSY; - else - list_del(&info->node); - mutex_unlock(&ti_sci_list_mutex); - - if (!ret) { - ti_sci_debugfs_destroy(pdev, info); - - /* Safe to free channels since no more users */ - mbox_free_channel(info->chan_tx); - mbox_free_channel(info->chan_rx); - } - - return ret; -} - static struct platform_driver ti_sci_driver = { .probe = ti_sci_probe, - .remove = ti_sci_remove, .driver = { .name = "ti-sci", .of_match_table = of_match_ptr(ti_sci_of_match), + .suppress_bind_attrs = true, }, }; module_platform_driver(ti_sci_driver);