Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp900112lqs; Fri, 14 Jun 2024 08:44:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVwMeXPDA4ZC35YH9E0kkJlByKk7xNaeh7tn2OVD6EEODgWblcOkPgq7hG7mXGEzdgUSwkn5lIkwzmWINsA0nqejqbO6VhcpBAK1/9Pww== X-Google-Smtp-Source: AGHT+IEDHmQF8WkEPNhzglXaUvJXSHQKY8K8oeIQNW7lJ8EtprOfaygnlt7GswahqSOUIuXpAdcg X-Received: by 2002:a05:6a20:914e:b0:1b7:733c:d11 with SMTP id adf61e73a8af0-1bae82422b8mr3787872637.41.1718379899554; Fri, 14 Jun 2024 08:44:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718379899; cv=pass; d=google.com; s=arc-20160816; b=IH8A3F/j2bt5k7yNfDpCxL6gmjRTgXgpFvaRhpGHOJciBgk9Bp1RJONGu25TERNFy1 qLJ/M4HSO2R1yYqczEq452G/oC4Gsta32u4zZ2YJJU8LnQHAasKEsr4Nbtkaj4LRSllb fSnvv8mJAbsStvFvHbndJF9O9yAxmZDrg1JNkwAuahOFatRnbXL8qX1bYgDsE0+QRa5D GfU9FrtruogHwQKO/3KbPl2h5kcn531/bf+WuV9jxQRFbn+Oe3/mwiwdn8n7NNCV0GGq /MHNJfYRIdfs1k+umqBF0NjmUoPn2IPkgSTAT3hJ9JgI0hezDx+vq4Rz4g8fF+Fqw1J+ hmJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:feedback-id:dkim-signature:dkim-signature; bh=zzZD4RryHF6UCwpX0CVsgzXHN5hz0PrmQFEM+kEC7W8=; fh=GjMoNTfaVpXz+Lu7tm3kWS2PG4obGn28gRC5wSIdFwU=; b=XSltIYNTlx5um7lk8ElrC/Xsvgph/WDHk5c3a/TNDG/sc+4We4VgJMVFja5dK0cMHQ icbxQxdjOAXlcLFFcj+hctjP+Xk+NdjbBs11ptZQTVXi17nEiCU0Bg2sEFgv6B2G+Lnx OjgR9zU9XdRYebYsOzaJuWGSmmExmrMu6hMEcONDSAldjJUkZNyIoOwij2Sp/pHw09Tc 8PLS29Pp2Lb9NQiAA0FiUySH37Rf/uRvPYs6Re/CNrNOSAx5TFxuRICTey6FVeVosPOj eHVhx7pvzfBwfaUlyZv5vNqY7vzJtCr2NjTotz6r1hvfBL8U+sx5fEVhr6fkRsLc1Iu8 waRw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm2 header.b=Kb4kEvG3; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=QzS07UMa; arc=pass (i=1 spf=pass spfdomain=flygoat.com dkim=pass dkdomain=flygoat.com dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=flygoat.com); spf=pass (google.com: domain of linux-kernel+bounces-215172-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215172-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-705cc9619acsi3701022b3a.86.2024.06.14.08.44.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 08:44:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215172-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=@flygoat.com header.s=fm2 header.b=Kb4kEvG3; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=QzS07UMa; arc=pass (i=1 spf=pass spfdomain=flygoat.com dkim=pass dkdomain=flygoat.com dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=flygoat.com); spf=pass (google.com: domain of linux-kernel+bounces-215172-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215172-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.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 7C5C3281E0E for ; Fri, 14 Jun 2024 15:42:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E569D19E7E9; Fri, 14 Jun 2024 15:40:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=flygoat.com header.i=@flygoat.com header.b="Kb4kEvG3"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="QzS07UMa" Received: from wfhigh5-smtp.messagingengine.com (wfhigh5-smtp.messagingengine.com [64.147.123.156]) (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 792DF16C878; Fri, 14 Jun 2024 15:40:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.156 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718379644; cv=none; b=El77h8pZ2SxTwMWma6eV2mva5vOi4sUYHTbgZet139vFurFLc5uaWQgTH2DZMkqx4e15Hq5Qkj20suOcTWshN+Tuv0JlZxdQBZ5Oq916ycooGsM663XsGVqb5yeCSzHEO6ljm0VY8ETXp+fNOhPW/e/dOV+4k4iSip4rL+7sme0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718379644; c=relaxed/simple; bh=T/l/PhBAZzTKaS6mE8YPGngsZJeCG/0PihztRUkYlkM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kIk4FGH2D53dKNVCCCK+D597nzfy7kazWOxfDWxOGfpKMjG2JlG+Z3TWW8tJvqFosq/MtxwLKmBts65zcDHdPoeXYwd2FDwMKuhI5pJbVzIpROESkbiGr0T21ta3ort+PmdAXzL/RtFrxWY6ApMCKEo2JflZHrwUm9dUFfsyqv0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=flygoat.com; spf=pass smtp.mailfrom=flygoat.com; dkim=pass (2048-bit key) header.d=flygoat.com header.i=@flygoat.com header.b=Kb4kEvG3; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=QzS07UMa; arc=none smtp.client-ip=64.147.123.156 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=flygoat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flygoat.com Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfhigh.west.internal (Postfix) with ESMTP id B1DBC1800130; Fri, 14 Jun 2024 11:40:41 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 14 Jun 2024 11:40:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1718379641; x=1718466041; bh=zzZD4RryHF6UCwpX0CVsgzXHN5hz0PrmQFEM+kEC7W8=; b= Kb4kEvG3u/K2Oa8UQ5vwluPJITLbozdqTfS24twpB1+DvUkPXeBdnDU7h9UnStnr MnUygP7GIeCKMp7NysLJjU0OqiYTnBgr4exbZkyPtac4it4AmPcrgxBnT35GQpaq NegLhblgmAdkR9Dz+f+4t1Mp98fMSnzlvp6vrdh4uJcBTMwUFezdUJUuid4w0Mtt CIzdx5NYX8hpDNHnAlNU34XlI7vUyW+qLSlJsmC2vyDiAPjL6t66ASsAgYCSdyeq K5BJxIrCoeWASwrQbgaie739OGhhxbRoMlXqEh4QowB0vC9yyIQSdgoay93Q8lj+ DkOFr48eEvoIc2hoUpUxDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1718379641; x= 1718466041; bh=zzZD4RryHF6UCwpX0CVsgzXHN5hz0PrmQFEM+kEC7W8=; b=Q zS07UMaKd/WAq1L5RkzXH+DB6b0IyBgs1CwcluiJ12ILxT5ksC/I3ajBRwKBuTk+ g0syxHKkcDEo6/zZV52qp4O59yv2z/hYCufLjQMUiRw4+EwyKQkc9yO2xfr9W/U5 I0h0fWykauW4V09+DaG07N1QhMwsKdRfSKidj/DXhS1iMLbEb4tpIqV3OV+VyYPJ eSRKLvbIPkZ6BrjUDmKQdp1rgSoPopMzPiLALczo9ZOIGaYVKNM8oxHrhC2/gb4j 7qUqfzM5GNCtxhx9EIwE4vqvp5TjBlwIZ2iDYAfH6pXD+0q45Hq6RlT2Beq18Y9s USD+mHbM2Ksy0XcQoTbPw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeduledgleduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpeflihgr gihunhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomheqne cuggftrfgrthhtvghrnhepvdekiefhfeevkeeuveetfeelffekgedugefhtdduudeghfeu veegffegudekjeelnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilh hfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 14 Jun 2024 11:40:39 -0400 (EDT) From: Jiaxun Yang Date: Fri, 14 Jun 2024 16:40:15 +0100 Subject: [PATCH 07/10] platform: mips: cpu_hwmon: Disable driver on unsupported hardware Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240614-ls3k-mips-v1-7-7614340ace7d@flygoat.com> References: <20240614-ls3k-mips-v1-0-7614340ace7d@flygoat.com> In-Reply-To: <20240614-ls3k-mips-v1-0-7614340ace7d@flygoat.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thomas Bogendoerfer , Qing Zhang , Binbin Zhou , Huacai Chen Cc: devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Jiaxun Yang , stable@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=783; i=jiaxun.yang@flygoat.com; h=from:subject:message-id; bh=T/l/PhBAZzTKaS6mE8YPGngsZJeCG/0PihztRUkYlkM=; b=owGbwMvMwCXmXMhTe71c8zDjabUkhrSclDiZb++8J0V58W00s5jo9Kqx+f/Du06XCxS7//FON hX9P0myo5SFQYyLQVZMkSVEQKlvQ+PFBdcfZP2BmcPKBDKEgYtTACZyaCXDbxaeiF+3DnZ1+cx7 LOrYuKL0/YajbQk3TM2kWBrlTSYe1GH4zVo/QfEE12POv0s7kwPfP6maGvNuutK9nAnSK86l7ng exwgA X-Developer-Key: i=jiaxun.yang@flygoat.com; a=openpgp; fpr=980379BEFEBFBF477EA04EF9C111949073FC0F67 cpu_hwmon is unsupported on CPUs without loongson_chiptemp register and csr. Cc: stable@vger.kernel.org Signed-off-by: Jiaxun Yang --- drivers/platform/mips/cpu_hwmon.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/platform/mips/cpu_hwmon.c b/drivers/platform/mips/cpu_hwmon.c index d8c5f9195f85..2ac2f31090f9 100644 --- a/drivers/platform/mips/cpu_hwmon.c +++ b/drivers/platform/mips/cpu_hwmon.c @@ -139,6 +139,9 @@ static int __init loongson_hwmon_init(void) csr_temp_enable = csr_readl(LOONGSON_CSR_FEATURES) & LOONGSON_CSRF_TEMP; + if (!csr_temp_enable && !loongson_chiptemp[0]) + return -ENODEV; + nr_packages = loongson_sysconf.nr_cpus / loongson_sysconf.cores_per_package; -- 2.43.0