Received: by 2002:ab2:7407:0:b0:1f4:b336:87c4 with SMTP id e7csp121395lqn; Thu, 11 Apr 2024 16:26:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXBXcezdcbx/N96yE3j8NPTYuQQAh/ZBryS584uM9XlXn/UcB8p4GjkMedgr9jiLeLhX4XF6HZi/SnV4SzBt63L7XXlBnnPyt38bQdzHA== X-Google-Smtp-Source: AGHT+IE3Q7S1sRD69lHnjilPpmoaY8xaqPrWTO9vW156fxFux/RJ3saHHGgL0ST4HfOBKBXi1n6v X-Received: by 2002:a17:90a:cb09:b0:2a4:833f:2c1b with SMTP id z9-20020a17090acb0900b002a4833f2c1bmr1097100pjt.9.1712878006710; Thu, 11 Apr 2024 16:26:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712878006; cv=pass; d=google.com; s=arc-20160816; b=gHv+jp8DqIHYX9bkjWORMmQxxx5bWji8rjNrH6UfxZ5Yx2BSAIm4iyyz551XrMoLNQ BC4WlVGdSH93cFZ2kRouk/CHa6uhpveT/uOHt14OJ1hQXfG3g2p+kqRxQCngSJPqc3lH 9YzDZwbdg7engnjpRx/xIF5snc+OEsXI1qaePArl0p4MjZ6cIU0gsFU5oHyZmDy0j7PZ pXahf3xDXDD181GlwJU1gzkpDS9OW5AHvc3QKySYAunZZw79mwKG+3MuO3l4Y0R8rhT4 ZU/iBVu9YsQQccP/j7yFF/lG7r/3Y57YBhOpE3RxQ30mTs2tqOGeNSZAn/wmYUJ9OTgt /bYA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=c5Pzom9ggE+lnrPwITXXUuzreNabMc9C3d5zN36J6+c=; fh=vpydNWIJsmfhvcJJRVeVVSAq2GB26NNyMde+EqlvA7I=; b=Mddp0nTfuq9ac5i5lI3TI7hW+kfyFjFIAHk2EbRMxP+k/koMQG4H8t2rGERKWTPTY3 6UpGyWEDmDI7KwRhRaiK2XXHhb7qWa8xhMYRh6YDLSv82CUnnJOmhglmscEPdcmkDDFw WwVYhsg4gHu0t3j9uH6UDACauZYr3Hm0gxNngdxXDTf99F82P+RKFfFrdASkheFl0dGS kCI+FEaWonIk0aSIPw3/EUlW49QDKUFDh50EK3fTzzMN9DCpjA64SX+M4F7t/ezuCOij df2/Jdarz6xVYblYxUPHMis5AlqSJciT2P+psVZBDgcuVdRPDOk8WCXO5KVvRK1je2gk enlA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=amFCXyaU; arc=pass (i=1 spf=pass spfdomain=163.com dkim=pass dkdomain=163.com dmarc=pass fromdomain=163.com); spf=pass (google.com: domain of linux-kernel+bounces-141706-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141706-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id qc2-20020a17090b288200b002a5056532dfsi2185229pjb.189.2024.04.11.16.26.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 16:26:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141706-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=amFCXyaU; arc=pass (i=1 spf=pass spfdomain=163.com dkim=pass dkdomain=163.com dmarc=pass fromdomain=163.com); spf=pass (google.com: domain of linux-kernel+bounces-141706-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141706-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com 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 511A32898FE for ; Thu, 11 Apr 2024 23:19:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2653E47F6F; Thu, 11 Apr 2024 23:19:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="amFCXyaU" Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.3]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 844584AED1; Thu, 11 Apr 2024 23:19:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.3 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712877560; cv=none; b=NTOaNRr5R6WYaIiWauFv9EMDINRk2Hrte6BsAe4NA3d6G59LjTHaWE78eBsZ9SDN58/rXMS/5lFJrIA/fCZgxr0jTzIgrPKeNRKvtv6UEZ/ydompn7/7eojsnVHOn4NNX9sYeCbmcCy1Zi5/As1PsLVDjFKmmvaQdCuN6f7/V+g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712877560; c=relaxed/simple; bh=aNmoCty2E2taxbJGZXgC0zkBJXRsGV5eZ6MA4fcTBgM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=p9nZgl3cDmnOJEfT0RjjCheF9oPAS1WjqAvn2UbITGa1jlJg/KNddZS0Uy1MEI9Om8cnoPRHF27OHYjbT0dhyw5GfuxwNKMXHL4GKg0TXJC5QymbSlxRORqIskVDkbqrqTNjKjLnCKzJvbsqkqYyWc2Tv0N0NoODY4z9ivqjYWA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=amFCXyaU; arc=none smtp.client-ip=117.135.210.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=c5Pzo m9ggE+lnrPwITXXUuzreNabMc9C3d5zN36J6+c=; b=amFCXyaUffXBkkMLeLToV JsIFN/Qm4MymU9dGml6IAyca4lHTkUtHFbzhsGjv1wSWHmjoQbGkRdQhdfN2L2J9 uHNOntu12Fg3/vXXR8spzqbXE2tNbH4Xkjfi0r3/B+sF+/pkRxre47zBbsiEWH75 AM+fIY9fJOOryPQUIJv234= Received: from localhost.localdomain (unknown [101.86.127.38]) by gzga-smtp-mta-g3-3 (Coremail) with SMTP id _____wD3H47CbxhmuzOoAA--.32437S4; Fri, 12 Apr 2024 07:18:51 +0800 (CST) From: Lizhe To: rafael@kernel.org, viresh.kumar@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Lizhe Subject: [PATCH] cpufreq: Fixed kernel crash caused by cpufreq issues Date: Thu, 11 Apr 2024 16:18:18 -0700 Message-Id: <20240411231818.2471-1-sensor1010@163.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:_____wD3H47CbxhmuzOoAA--.32437S4 X-Coremail-Antispam: 1Uf129KBjvdXoW7GF1UAr1xWw1fKr4rJrW3trb_yoW3Crg_ur 1rWr1xXr4Duw10vF17Cr4Svr1Yy3W3WrnavF18t39xJa4UAr9Yyw18Xrn3Xa4rX3yxGFZr XrWUtF1UCr1kGjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRXyCLJUUUUU== X-CM-SenderInfo: 5vhq20jurqiii6rwjhhfrp/1tbiSBy9q2XAk244cQAAsT 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); -- 2.25.1