From nobody Fri Dec 19 04:52:37 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6C90E7D0A2 for ; Thu, 21 Sep 2023 18:47:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229684AbjIUSr0 (ORCPT ); Thu, 21 Sep 2023 14:47:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbjIUSrS (ORCPT ); Thu, 21 Sep 2023 14:47:18 -0400 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 64493EE849 for ; Thu, 21 Sep 2023 11:47:10 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 38L9I5iK122575; Thu, 21 Sep 2023 04:18:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1695287885; bh=Dm1e+plwHNwqQ1PDB+fSI8pFST4Rseh0QLTTgk3amws=; h=From:To:CC:Subject:Date; b=mJDEJkkxDqWwUogPca0RSQOUUPPqKrXZiLVU9iqVAqOSdKXueqfByTY1ZJmcvh9QE 853SEgVdDUzP1gqzW9Bfmep0NKjzYOGccuigffBKF++kmmKApg38uqKcf+4ESEoWor Gi8xVGAgKicvUXJ0sXOv3pfqMcJCHIcqgwaogOx0= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 38L9I5cS030231 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 21 Sep 2023 04:18:05 -0500 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 21 Sep 2023 04:18:05 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE110.ent.ti.com (10.64.6.31) 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, 21 Sep 2023 04:18:05 -0500 Received: from dhruva.dhcp.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 38L9I1AP079306; Thu, 21 Sep 2023 04:18:02 -0500 From: Dhruva Gole To: Nishanth Menon CC: , , Dhruva Gole , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Tero Kristo , Santosh Shilimkar , Vibhore Vardhan , Vignesh Raghavendra Subject: [PATCH V2] firmware: ti_sci: Mark driver as non removable Date: Thu, 21 Sep 2023 14:40:26 +0530 Message-ID: <20230921091025.133130-1-d-gole@ti.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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. The remove function failed to do all the necessary cleanup if there are registered users. Some things are freed however which likely results in an oops later on. 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 Int= erface (TI-SCI) protocol") Reported-by: Uwe Kleine-K=C3=B6nig Closes: https://lore.kernel.org/linux-arm-kernel/20230216083908.mvmydic5lpi= 3ogo7@pengutronix.de/ Suggested-by: Uwe Kleine-K=C3=B6nig Acked-by: Uwe Kleine-K=C3=B6nig Signed-off-by: Dhruva Gole --- Link to v1: https://lore.kernel.org/linux-arm-kernel/20230907171700.1922453-1-d-gole@ti= .com/ Changelog: Rebased, updated the commit message and added Reported and Closes tag. Cc: Tero Kristo Cc: Santosh Shilimkar Cc: Vibhore Vardhan Cc: Vignesh Raghavendra --- 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 c288ae49f91c..ffca636cc13f 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_devic= e *pdev, return 0; } =20 -/** - * 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) @@ -3445,43 +3432,12 @@ static int ti_sci_probe(struct platform_device *pde= v) return ret; } =20 -static int ti_sci_remove(struct platform_device *pdev) -{ - struct ti_sci_info *info; - struct device *dev =3D &pdev->dev; - int ret =3D 0; - - of_platform_depopulate(dev); - - info =3D platform_get_drvdata(pdev); - - if (info->nb.notifier_call) - unregister_restart_handler(&info->nb); - - mutex_lock(&ti_sci_list_mutex); - if (info->users) - ret =3D -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 =3D { .probe =3D ti_sci_probe, - .remove =3D ti_sci_remove, .driver =3D { .name =3D "ti-sci", .of_match_table =3D of_match_ptr(ti_sci_of_match), + .suppress_bind_attrs =3D true, }, }; module_platform_driver(ti_sci_driver); base-commit: 940fcc189c51032dd0282cbee4497542c982ac59 --=20 2.34.1