Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2297494rdb; Thu, 21 Sep 2023 14:32:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHWhj45wuMgHghBpcfAqk0h0ug5retzH0IYTypdIUgRjNeR222THXjVQSBJL1dVLwzncwOm X-Received: by 2002:a05:6870:e389:b0:1d5:bda7:1337 with SMTP id x9-20020a056870e38900b001d5bda71337mr7211425oad.52.1695331941207; Thu, 21 Sep 2023 14:32:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695331941; cv=none; d=google.com; s=arc-20160816; b=mAvC4LWf3KUDR1pYt3l4BaPAaDQK0VxyhdmuX/9N7T9FMkV20Hq6KEWLfFki7fjPCP /8dsXpEqS852SPx/TnYPWVhJ3+bsLf8i6Zf/IrM/JD0i9RhwDh531kbcFUxqkIcBjNXe KK2bIWyQ+O2ffISG7WiXc4BVJeBNTRVCVmhnnOAZejepZAOBWEnYytNhJn2CwONlCc0o MIwn4vw5yDQYLN9WNzygPCyEx5yQ1qCLG8+7omK8V8RWmI+joWJhNfCGOXu4XFDkNCyD DD4vA0t+BqfSmP9Iu1EMJ02n64V1VvCVItOHDBy2DqBsFLOECastzA2DiunPg+WIJyrT f0yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Dm1e+plwHNwqQ1PDB+fSI8pFST4Rseh0QLTTgk3amws=; fh=mqGSOwPhRZjqawYzFr+PDB/2TOIdcd0LtRtQDLK5NQg=; b=gU0FxATgtHUp5PQPWk2aIRHHMCUjlAmY4MCy/MUM762Q27PNWoak8R1nx7Zhx33tue Fwj6+Mn6UgRjymDXrtc37o3QkXEW+cuCNH7l8kagjiIpmafxkud+3X702GjGpuUxirsy ESWIghuhukRmdlCzkjltLlLPr2cZ/DJiOYZgGbu8kurhnK3tesbNtNoYeFownd8N3Sbt PuzWQNisqfAlOD739W3uPO06tW6eFS+x9Lm9M+oHPZY5CwWlwBE3P9hKAjkEvgB3FABu GISdUybEY/S3KxA+F3sw6X3ju1vA8bGs3XTZRXf++Fnl44VX/Cdo1aTuB1R/x5Yioc62 IaHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mJDEJkkx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id k24-20020a6568d8000000b0056569ee3ae7si2198722pgt.540.2023.09.21.14.32.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 14:32:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mJDEJkkx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id CEF18822D57C; Thu, 21 Sep 2023 11:47:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229572AbjIUSrZ (ORCPT + 99 others); Thu, 21 Sep 2023 14:47:25 -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: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Thu, 21 Sep 2023 11:47:36 -0700 (PDT) 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 Interface (TI-SCI) protocol") Reported-by: Uwe Kleine-König Closes: https://lore.kernel.org/linux-arm-kernel/20230216083908.mvmydic5lpi3ogo7@pengutronix.de/ Suggested-by: Uwe Kleine-König Acked-by: Uwe Kleine-König 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_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) @@ -3445,43 +3432,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); base-commit: 940fcc189c51032dd0282cbee4497542c982ac59 -- 2.34.1