Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp75933lql; Fri, 12 Apr 2024 04:26:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXiGg9J/PYQ24keVKf0GYTBkmdGRGBjJWqjYR9TYZY0mmo7Ym4sfNGvzw/MPwk/XyCI4RBkMljYHEiO+L6B2u9e5CsRbTbIFbH0y5FP+g== X-Google-Smtp-Source: AGHT+IHHXl/0m8rwrAdMMQHuWJhD0nizWsgq17Od0Oqu51X8d1S9qj2R5CT0EeQujeQy4oah3kZ+ X-Received: by 2002:a05:6a20:5603:b0:1a7:52fa:7d6b with SMTP id ir3-20020a056a20560300b001a752fa7d6bmr2278103pzc.43.1712921190846; Fri, 12 Apr 2024 04:26:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712921190; cv=pass; d=google.com; s=arc-20160816; b=J8bOHyL3G59m1diUatKxw73V+QLl1WpIJqby1TkUP5zLy0GSLiJfzl583pTqlyaPax lse5beGkCbAq5b/2eEDTgvidE83KGWcWukFmDPdwt1XFJPzk8YhrKB8q8BESbmjiYkeu RADDEQX0p5VPPiZcFZkOsQ5FzqpXwXMfONIBE4auJ3W6d/2YxV/xwG5MlEo7APM0LKSB rCN6teC04zBy892gQGoZLOImntwD1yzPk8lJwj2fsML6leDJdu628A7PHd0AYvKDSiOo DEZzVGmuWzKx55gYQPP4P6jS7SyNj0mlU+qRpmv4xh0Itar/XB9wfXJUScde4Kbk40kA LctQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=B8x1mMVVI9PcQsuM8qk6tlPjC+7DznnV8LIIjmKt3nI=; fh=L0DVHFtSKAxUTlJoibFouD8tmeMhm0dDCEAMf9GahXI=; b=UhxB5m9dDUmdvrtbNH49khkNAAgTHFEfkj9jHUPNuCMf3ToHJu5ih8lVnns3Hz8Zgc Jvj3f8TR6/oCWFLtEM1dqfcruDNZhjiJO6ulWpuKL3HDcESeexcY8YJjKdDoWACmYez1 qaaNd5GjJ03W7Y9W//bnYjth0+QEGRaOimR99Qkl50PCJyMPyga8PE1qVxmQ8ZG1iUT6 3I+mGXKR6xSSqJv5r1CuHdVn4e6kWSlNEfjfDk28L3WHyOkeykdDymsEB0bJ8uogVOgj 9hcDECpJ90ABXq0c99IoYie2dykhNzigsaRMlLw4sGvrJDAggNdMwRS0Z3iyUOzbS82P 3ogw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qraH0DXp; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-142575-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142575-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id g5-20020a170902f74500b001e2a3ff7b93si3105110plw.111.2024.04.12.04.26.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 04:26:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142575-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qraH0DXp; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-142575-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142575-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 10DF8282F41 for ; Fri, 12 Apr 2024 11:26:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A15B154BD3; Fri, 12 Apr 2024 11:26:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qraH0DXp" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBD0553818; Fri, 12 Apr 2024 11:26:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712921179; cv=none; b=VLca2hBwQ5WCmVrMyNzRuonurYr7cbaJC2/OWm1OdS84uD8eT1ufmiRAhChE2YAEIlb0VzvT2DgzLvrCWYut0JEMXbTcx0RQRkdkFLklsSPmR8EAfTqESl9jgYKgxjU65iMBlMyuHu55bzEago5Ddj38Xdsvai/FoT15Rd3m9Yc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712921179; c=relaxed/simple; bh=HwD2cmce3NrbLnH+gh+y4+5Qxd5czNVQgs4oY/n2RFo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=NpC/Xir0xnU+DXxp7GuxDC7FcR2q8Di2PlWE99KruwTE9jIzLyxufP5bJOsleqSy3KprDgcGW0c95U70TzGpBPAtQWmWOXnxWH1fJkc0qsucxcG/Y4WlpTvwVY2wM30NTfgAu4Fg6o36UD1+uEAi09XTj4mywCTMhohboXNFN3s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qraH0DXp; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4BEDFC113CC; Fri, 12 Apr 2024 11:26:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712921179; bh=HwD2cmce3NrbLnH+gh+y4+5Qxd5czNVQgs4oY/n2RFo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=qraH0DXp447IJJjOEs9hwwAb/UqjD0BNZmFj53CfqwXmO63OYF3xZg/e8i1R2ih7Q Ii5kRRgUEOqCZfnniRaLVsLilFZhgfZvKQn8lnPO9EjUI3YCQf+aYPvHE7oJ2J+QvV QPnR7Kz4jcG3PimTAdMUhE68zekUE3IqouIoRpv6/RZ5BVACzYeXG1/yjIuuJCpOnc FUqdwAl5oFSUXk3NO4QI1YgNNXIK1ttbjpt1It9VJ8hcFczzo06Prq2IgFWN2t1Hy5 c3GWG5zAU1YMydLtLxgsyyrQEA4z2JdG/I3YPFhimk1eqOlT9CfZ7mMdow5rUijjdK C5WU0g/DELF+g== Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-3c60bb16e44so241391b6e.0; Fri, 12 Apr 2024 04:26:19 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCXdnbmxoSy/KvNhVbgSrkxwZ1P2bdYauDVaBxrsHq0W0XsAqsIFIrFCkjcKuSJOBDHuh56vUiXb1wrHtLiEzGiZ+39Ss8VYRwwrSwaGMLznO6ynIG3/8blwUCfDlGmpUIL/MebOjr8= X-Gm-Message-State: AOJu0YwHu/TjuEf4D93B1dgjTh1q1l8cGMyhyok/zWlzTI4cJRo4pxPL hLAvv7IrVF+STy7ru4BuNwPDsgDPDbydaqrV/x2rQPHUQ/U3Yjztj/+87uXFaWa5MwLP5ddls9H HBVLDQySRIxKjwQdsITJe4y72CCw= X-Received: by 2002:a05:6870:5b9b:b0:22e:161b:7682 with SMTP id em27-20020a0568705b9b00b0022e161b7682mr2540091oab.4.1712921178607; Fri, 12 Apr 2024 04:26:18 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240411231818.2471-1-sensor1010@163.com> In-Reply-To: <20240411231818.2471-1-sensor1010@163.com> From: "Rafael J. Wysocki" Date: Fri, 12 Apr 2024 13:26:07 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] cpufreq: Fixed kernel crash caused by cpufreq issues To: Lizhe Cc: rafael@kernel.org, viresh.kumar@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Apr 12, 2024 at 1:19=E2=80=AFAM Lizhe wrote: > > When the cpufreq_driver does not provide an exit() function. > cpufreq offline operations can result in a kernel crash. > > Signed-off-by: Lizhe > --- > drivers/cpufreq/cpufreq.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > index 04d349372de3..e8660bc7d232 100644 > --- a/drivers/cpufreq/cpufreq.c > +++ b/drivers/cpufreq/cpufreq.c > @@ -1739,7 +1739,7 @@ static void cpufreq_remove_dev(struct device *dev, = struct subsys_interface *sif) > } > > /* We did light-weight exit earlier, do full tear down now */ > - if (cpufreq_driver->offline) > + if (cpufreq_driver->offline && cpufreq_driver->exit) > cpufreq_driver->exit(policy); > > up_write(&policy->rwsem); > -- I've applied the patch from Viresh that addresses both issues with missing ->exit() driver callback checks and therefore is more complete. Also I'm not going to apply any other patches you have sent because there were obvious mistakes in some of them and you sent updates without version numbering and without any information regarding what changed with respect to the previous version(s). Also some patches were sent in multiple copies (I think) without telling me which one to look at. All of that is too confusing to be treated seriously and quite disrespectful to the prospective reviewers (who might allocate their time to more productive things). If you want to send the changes once again, it is fine because they generally do some nice cleanups, but please follow the patch submission and kernel development process documentation as Greg has already advised you. Thanks!