Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2283210iof; Wed, 8 Jun 2022 01:22:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYxjPjW4YlcX+WQv6SiKHuuZuz3u3KuR+ytuzrkir2QaKQDTwTjXxAymZZwcKyIM0K1tCG X-Received: by 2002:a63:86c3:0:b0:3fd:9c06:ee37 with SMTP id x186-20020a6386c3000000b003fd9c06ee37mr14590780pgd.357.1654676554214; Wed, 08 Jun 2022 01:22:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654676554; cv=none; d=google.com; s=arc-20160816; b=jc59U4uXjHrbfs6pMYkMEoB4x5wQ5Lj24BNzugeUQ5EtHHP0sUt46+/K38A5TtLTKj +2uOt4CQXsl0ik2ijFAEfRXuKdIFnn5ACfumjRMyrU0Vyf6i530pb8pGZxoP0FtQppJA r1vmEa6XIoAbpUR0PupCyCNBuRNI+GzkejphINMJpU4VIAssJspLKAswE7t9UuD5jpj6 QEJ4xHbtWn0HJil2i87EPSTsz0QpueYFsvUGPeDmlxWD8iMquowOHpfa1/yZ6ggPxyVj CZJwtyZNl5g+ILTxm1aUdGHH4sHlFDA2dq7Ig8AJoskPktE73BuPNTskZZ1ogFy6/hPB a8QA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fqb6nlXrIhIYBrrfUrouzR1C2QtBqzG61WJsijeIWHI=; b=Rcgusxkuppd0ENEZ3Q8MeITuKkQcqQseKYXlWZCXprqk668s0FbqQRF/t5HlKqkGar 702VPHHcOAN0cuekXgFQBABQUMj7qzxIIqeqM5/dwvE/IWgbD8Gq9cdke4hNcbzxocgE /kO5V5EQI5fuU2dYCpkVVKwFGADTIlLhLk1CGHH8l6/aHZyN4mx/qNeTZRgH/cYqd2Bv XYq6cex1pyo7sg+HS/27PD4GsKtMMUfNKu6WfginrXaXAu3Zgs/tQJY0FvXja5lb/ZXU 0GSUnvJHmLYqbSLZk0cSQ8mgdVBWiElBbTulBc57odfSgFQZiaTphjVzVIdfpgvk5zr5 ArsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oegktrVK; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id p1-20020a17090a868100b001e095e816c8si27602674pjn.26.2022.06.08.01.22.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 01:22:34 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oegktrVK; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A07F712D172; Wed, 8 Jun 2022 00:52:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385363AbiFGWVe (ORCPT + 99 others); Tue, 7 Jun 2022 18:21:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380568AbiFGVQd (ORCPT ); Tue, 7 Jun 2022 17:16:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D84C21E0FE; Tue, 7 Jun 2022 11:55:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A5AAE61277; Tue, 7 Jun 2022 18:55:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B51D9C385A2; Tue, 7 Jun 2022 18:55:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628130; bh=3a8gxMHCDSeL/R2EhuktrXzbJmCqXw0BGoZqVqZ6DYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oegktrVK5Y4LfJzz0SbUz90C0JidfMpupKbVuBM6gDrq1g8JSmQSy5yUf2xLsTmrL /Wtjk3dpDKoStGSTufdwbRYNiAIh9+wZkW/h4a6pndh26ld7hR27FfS1znLCD3zZ4j OBmqkNAMHNAMSk7IrPOM39qkHEW31PXrxVnDlBZg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brian Norris , Chanwoo Choi , Sasha Levin Subject: [PATCH 5.18 217/879] PM / devfreq: rk3399_dmc: Disable edev on remove() Date: Tue, 7 Jun 2022 18:55:35 +0200 Message-Id: <20220607165009.153322455@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Brian Norris [ Upstream commit 2fccf9e6050e0e3b8b4cd275d41daf7f7fa22804 ] Otherwise we hit an unablanced enable-count when unbinding the DFI device: [ 1279.659119] ------------[ cut here ]------------ [ 1279.659179] WARNING: CPU: 2 PID: 5638 at drivers/devfreq/devfreq-event.c:360 devfreq_event_remove_edev+0x84/0x8c ... [ 1279.659352] Hardware name: Google Kevin (DT) [ 1279.659363] pstate: 80400005 (Nzcv daif +PAN -UAO -TCO BTYPE=--) [ 1279.659371] pc : devfreq_event_remove_edev+0x84/0x8c [ 1279.659380] lr : devm_devfreq_event_release+0x1c/0x28 ... [ 1279.659571] Call trace: [ 1279.659582] devfreq_event_remove_edev+0x84/0x8c [ 1279.659590] devm_devfreq_event_release+0x1c/0x28 [ 1279.659602] release_nodes+0x1cc/0x244 [ 1279.659611] devres_release_all+0x44/0x60 [ 1279.659621] device_release_driver_internal+0x11c/0x1ac [ 1279.659629] device_driver_detach+0x20/0x2c [ 1279.659641] unbind_store+0x7c/0xb0 [ 1279.659650] drv_attr_store+0x2c/0x40 [ 1279.659663] sysfs_kf_write+0x44/0x58 [ 1279.659672] kernfs_fop_write_iter+0xf4/0x190 [ 1279.659684] vfs_write+0x2b0/0x2e4 [ 1279.659693] ksys_write+0x80/0xec [ 1279.659701] __arm64_sys_write+0x24/0x30 [ 1279.659714] el0_svc_common+0xf0/0x1d8 [ 1279.659724] do_el0_svc_compat+0x28/0x3c [ 1279.659738] el0_svc_compat+0x10/0x1c [ 1279.659746] el0_sync_compat_handler+0xa8/0xcc [ 1279.659758] el0_sync_compat+0x188/0x1c0 [ 1279.659768] ---[ end trace cec200e5094155b4 ]--- Signed-off-by: Brian Norris Signed-off-by: Chanwoo Choi Signed-off-by: Sasha Levin --- drivers/devfreq/rk3399_dmc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/devfreq/rk3399_dmc.c b/drivers/devfreq/rk3399_dmc.c index 293857ebfd75..538e8dc74f40 100644 --- a/drivers/devfreq/rk3399_dmc.c +++ b/drivers/devfreq/rk3399_dmc.c @@ -477,6 +477,8 @@ static int rk3399_dmcfreq_remove(struct platform_device *pdev) { struct rk3399_dmcfreq *dmcfreq = dev_get_drvdata(&pdev->dev); + devfreq_event_disable_edev(dmcfreq->edev); + /* * Before remove the opp table we need to unregister the opp notifier. */ -- 2.35.1