Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp390592rdb; Mon, 22 Jan 2024 07:23:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IGPWiiA39D+gYlXlyw1Y4hVokEN9oxR86unAFod6T648YmSDe+vvLNUqxda9NHu9yMqIdjV X-Received: by 2002:a05:622a:d0:b0:42a:37b7:4adc with SMTP id p16-20020a05622a00d000b0042a37b74adcmr3840218qtw.27.1705937002702; Mon, 22 Jan 2024 07:23:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705937002; cv=pass; d=google.com; s=arc-20160816; b=v8QqA4ZUEBktbY4A/uEIU5XBX0OAeXwx2SHrQeSgK+mVOSK6dsVuYYu+JqSz5+k637 sQdMRTKYKsYZNfcsrXjGiO85TULX+s0gYizR7epoGfcK/p0XpcRgMLae9fPge/v+Oe9M J3rjlNtyafL76K8yMWrLqSRD+yMV2ylyEvjb5HYNDOeJA8G2KUo3gRsq4W3kyplGToxn VGXG9kPGSB/HQc/5TBtAaeiQrYQLNy3ZDqPRF1K3doV+w/Sguip3XF5hpwDrlBl7pEPy aYVgu6hR4IY7EQ+HqIbMNgZzOvm+vdgSGMP1tmIwILEz80gE8JB3JVS1vf+rqJAqOIuM LdgQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ii1bRxWmdsKlyo+KIH2S+dxZE4koxgZkljHcn9zqP/4=; fh=vayJrE12BLCHa+XW6AxOAavpdm1xddHhjEpzXkzwKcE=; b=EV6kBCkBxIByzfUhdyshKbGkqmX/ZeqKlRH8kqVex06mId1JApz8RFlueE/vHoh3XM afmPhS1vYkZjnIXKs3AleabPlFa4ojqVxIlnzq//Oi+9uktJf/7srLKqnOTnp0jYiKtF APY5xuZeEYsZ9PkFk67CMfR5gRBTTuapU/07pVVHGx32+4zkUnsA8pWCT9lEBC72Ivb0 h2akhWBpmF93fJS7r7dMPMEDj5PveBpltPO/kABmRR9tUx2aEQvRS3PH/aOMO9obQ6rp gv5X1YuGYblajPLfISEzSCL8I65kngdrFcZUhCOu8lKF4pFGZmQifX701yWZRRKAR3El KWYA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="KK32v/6y"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33284-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33284-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d17-20020ac85d91000000b0042a20a457bfsi5956462qtx.342.2024.01.22.07.23.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 07:23:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33284-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="KK32v/6y"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33284-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33284-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 75AEF1C22B21 for ; Mon, 22 Jan 2024 15:23:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04A335BACD; Mon, 22 Jan 2024 15:00:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KK32v/6y" 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 263825BAD7; Mon, 22 Jan 2024 15:00:01 +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=1705935603; cv=none; b=op1MDprOk5pwP+w6axwsJBheHPX/cZHm/tQ2p1n61dqaJMunwye+98mG4mngWYRrrGkZxcTy7grT6vmv6DBzzp6w131YHzGCrNo2ocv7lhFt3W7RgxzTmwOgiYPEWgdWsYNVv4t4Gc5Y82/GfsWLtLdQV5/cBGrs9LMvJQupjbc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705935603; c=relaxed/simple; bh=0RE9JF4bdtJLin1cvk5zIY7c1IK3vh7u91AnbM/nV3g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Vm1srcsgRI/n7y8bjVMXb6ENj0fiYtIKba7yc1ycji0yByOH+NNJs9bpXSAdyaN3H0+VuEeBqLewVHCBJ2079WRKzPQgbg7qE9B/N/wHOft+9nxcaLRh4XGJig79c8duiXpEIbKAF67uvvKYisDCqPRFNQ9XRP58rT0OCnjl6q0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KK32v/6y; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A83C0C43601; Mon, 22 Jan 2024 15:00:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705935601; bh=0RE9JF4bdtJLin1cvk5zIY7c1IK3vh7u91AnbM/nV3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KK32v/6yMKnzWe0RFx/6oCQcar/bUIyi9LkwQ1YA2aEvXuRwB+Bq7E0p2I4QdX0aS kAzQ7aqbLn1F/aW/Ftp5Bwa+diU7Xg9nqez+jVq/pKapBlyA58BeswqJWUanBhdori bIIb2aEONftxC0RC294krZHJcj55eCJ78AkSfYx2mm/8FaFUbCcte4AI0TSTfmrq31 HnEsMfAGSb2njKAlz60iULijODhU4Mm4fMpBUVr4oKILOdkAQK17fNAkWQCrDgLyh9 rfZwJc0w22Bbk0ULMIk2L7Ck6L6I3qfhRQA199fM+Y89hxDpfhtPJNRSpxN2KwO6DI eC3n04zpyHW3g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Werner Fischer , Guenter Roeck , Wim Van Sebroeck , Sasha Levin , linux-watchdog@vger.kernel.org Subject: [PATCH AUTOSEL 6.7 62/88] watchdog: it87_wdt: Keep WDTCTRL bit 3 unmodified for IT8784/IT8786 Date: Mon, 22 Jan 2024 09:51:35 -0500 Message-ID: <20240122145608.990137-62-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122145608.990137-1-sashal@kernel.org> References: <20240122145608.990137-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.7.1 Content-Transfer-Encoding: 8bit From: Werner Fischer [ Upstream commit d12971849d71781c1e4ffd1117d4878ce233d319 ] WDTCTRL bit 3 sets the mode choice for the clock input of IT8784/IT8786. Some motherboards require this bit to be set to 1 (= PCICLK mode), otherwise the watchdog functionality gets broken. The BIOS of those motherboards sets WDTCTRL bit 3 already to 1. Instead of setting all bits of WDTCTRL to 0 by writing 0x00 to it, keep bit 3 of it unchanged for IT8784/IT8786 chips. In this way, bit 3 keeps the status as set by the BIOS of the motherboard. Watchdog tests have been successful with this patch with the following systems: IT8784: Thomas-Krenn LES plus v2 (YANLING YL-KBRL2 V2) IT8786: Thomas-Krenn LES plus v3 (YANLING YL-CLU L2) IT8786: Thomas-Krenn LES network 6L v2 (YANLING YL-CLU6L) Link: https://lore.kernel.org/all/140b264d-341f-465b-8715-dacfe84b3f71@roeck-us.net/ Signed-off-by: Werner Fischer Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20231213094525.11849-4-devlists@wefi.net Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Signed-off-by: Sasha Levin --- drivers/watchdog/it87_wdt.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/watchdog/it87_wdt.c b/drivers/watchdog/it87_wdt.c index e888b1bdd1f2..8c1ee072f48b 100644 --- a/drivers/watchdog/it87_wdt.c +++ b/drivers/watchdog/it87_wdt.c @@ -256,6 +256,7 @@ static struct watchdog_device wdt_dev = { static int __init it87_wdt_init(void) { u8 chip_rev; + u8 ctrl; int rc; rc = superio_enter(); @@ -315,7 +316,18 @@ static int __init it87_wdt_init(void) superio_select(GPIO); superio_outb(WDT_TOV1, WDTCFG); - superio_outb(0x00, WDTCTRL); + + switch (chip_type) { + case IT8784_ID: + case IT8786_ID: + ctrl = superio_inb(WDTCTRL); + ctrl &= 0x08; + superio_outb(ctrl, WDTCTRL); + break; + default: + superio_outb(0x00, WDTCTRL); + } + superio_exit(); if (timeout < 1 || timeout > max_units * 60) { -- 2.43.0