From mboxrd@z Thu Jan 1 00:00:00 1970 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 0944A79DAE; Wed, 21 Feb 2024 13:38:14 +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=1708522694; cv=none; b=rxv6KP/RRpcoFCuLTbEomnn+Uo2AfIG/ciEECvz6hh/C2waNSgXh/6ksDCiMOwuS5Tb3k9tBWS4AFBiSiYOMhM/xayxhL2j3HTssrXnpAZlYITOWGjC9RYDhOXpwkZ/mB+zxm4Cc3dpAti/Ftea94IBr+l4z6M3XnSN5uLdlBPY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708522694; c=relaxed/simple; bh=4D0EzCgq8/Ud0o0pJVDb7KJ6gukWv9aXTmD6Qvr3ZMQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hyCh/Oz+h6xyLSaSztLIEf5MYfbqWuIOIF5V1aq0mQxSoJFpkeWrsvVRfQiUpU0pHcWYvf8AmTJNTpf0drj03n8XD5NN8YRAwLsLFaXFLezfr/ykc8nj/EOY27b1jCOSJ39tI+uH9i1TZOqNRUnIvvBVmBWKCgLCxSNug1wcfTg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yHuyC0J1; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yHuyC0J1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84AC7C433F1; Wed, 21 Feb 2024 13:38:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1708522693; bh=4D0EzCgq8/Ud0o0pJVDb7KJ6gukWv9aXTmD6Qvr3ZMQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yHuyC0J1RTQYZ0ecc8N8npUWpcAnJdtCpr9M4sIcJb0nOaILBujWZHdzBCeCcHUuR a7HNpTyZ5vZwc9o5wEcJKB9FWns03ZOWUglAn1B9O0e+gO+nESPbBW+hhu0ump0dls 5muyVsTKVZK4Bd8hSy60bE4nz/MW1bGcnvyDl0pQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Werner Fischer , Guenter Roeck , Wim Van Sebroeck , Sasha Levin Subject: [PATCH 5.15 233/476] watchdog: it87_wdt: Keep WDTCTRL bit 3 unmodified for IT8784/IT8786 Date: Wed, 21 Feb 2024 14:04:44 +0100 Message-ID: <20240221130016.503400548@linuxfoundation.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240221130007.738356493@linuxfoundation.org> References: <20240221130007.738356493@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ 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 bb1122909396..843f9f8e3917 100644 --- a/drivers/watchdog/it87_wdt.c +++ b/drivers/watchdog/it87_wdt.c @@ -255,6 +255,7 @@ static struct watchdog_device wdt_dev = { static int __init it87_wdt_init(void) { u8 chip_rev; + u8 ctrl; int rc; rc = superio_enter(); @@ -313,7 +314,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