[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200225123802.88984-3-mika.westerberg@linux.intel.com>
Date: Tue, 25 Feb 2020 15:38:01 +0300
From: Mika Westerberg <mika.westerberg@...ux.intel.com>
To: Guenter Roeck <linux@...ck-us.net>,
Jean Delvare <jdelvare@...e.com>,
Wim Van Sebroeck <wim@...ux-watchdog.org>,
Wolfram Sang <wsa@...-dreams.de>
Cc: Martin Volf <martin.volf.42@...il.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Jarkko Nikula <jarkko.nikula@...ux.intel.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
linux-i2c@...r.kernel.org, linux-hwmon@...r.kernel.org,
linux-watchdog@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 2/3] watchdog: iTCO_wdt: Make ICH_RES_IO_SMI optional
The iTCO_wdt driver only needs ICH_RES_IO_SMI I/O resource when either
turn_SMI_watchdog_clear_off module parameter is set to match ->iTCO_version
(or higher), and when legacy iTCO_vendorsupport is set. Modify the driver
so that ICH_RES_IO_SMI is optional if the two conditions are not met.
Signed-off-by: Mika Westerberg <mika.westerberg@...ux.intel.com>
---
drivers/watchdog/iTCO_wdt.c | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c
index 156360e37714..f1692452bc25 100644
--- a/drivers/watchdog/iTCO_wdt.c
+++ b/drivers/watchdog/iTCO_wdt.c
@@ -460,7 +460,7 @@ static int iTCO_wdt_probe(struct platform_device *pdev)
return -ENODEV;
p->smi_res = platform_get_resource(pdev, IORESOURCE_IO, ICH_RES_IO_SMI);
- if (!p->smi_res)
+ if (!p->smi_res && iTCO_vendorsupport)
return -ENODEV;
p->iTCO_version = pdata->version;
@@ -492,15 +492,19 @@ static int iTCO_wdt_probe(struct platform_device *pdev)
/* Set the NO_REBOOT bit to prevent later reboots, just for sure */
p->update_no_reboot_bit(p->no_reboot_priv, true);
- /* The TCO logic uses the TCO_EN bit in the SMI_EN register */
- if (!devm_request_region(dev, p->smi_res->start,
- resource_size(p->smi_res),
- pdev->name)) {
- pr_err("I/O address 0x%04llx already in use, device disabled\n",
- (u64)SMI_EN(p));
- return -EBUSY;
- }
if (turn_SMI_watchdog_clear_off >= p->iTCO_version) {
+ if (!p->smi_res) {
+ pr_err("SMI I/O resource is missing\n");
+ return -EINVAL;
+ }
+ /* The TCO logic uses the TCO_EN bit in the SMI_EN register */
+ if (!devm_request_region(dev, p->smi_res->start,
+ resource_size(p->smi_res),
+ pdev->name)) {
+ pr_err("I/O address 0x%04llx already in use, device disabled\n",
+ (u64)SMI_EN(p));
+ return -EBUSY;
+ }
/*
* Bit 13: TCO_EN -> 0
* Disables TCO logic generating an SMI#
--
2.25.0
Powered by blists - more mailing lists