From: Guenter Roeck <linux@roeck-us.net> To: Mika Westerberg <mika.westerberg@linux.intel.com>, Jean Delvare <jdelvare@suse.com>, Wim Van Sebroeck <wim@linux-watchdog.org>, Wolfram Sang <wsa@the-dreams.de> Cc: Martin Volf <martin.volf.42@gmail.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Jarkko Nikula <jarkko.nikula@linux.intel.com>, linux-i2c@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/3] watchdog: iTCO_wdt: Make ICH_RES_IO_SMI optional Date: Wed, 26 Feb 2020 05:33:00 -0800 [thread overview] Message-ID: <8565beae-e7b3-c683-cd39-5af869513f1a@roeck-us.net> (raw) In-Reply-To: <20200226132122.62805-3-mika.westerberg@linux.intel.com> On 2/26/20 5:21 AM, Mika Westerberg wrote: > 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@linux.intel.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> > --- > drivers/watchdog/iTCO_wdt.c | 28 ++++++++++++++++------------ > 1 file changed, 16 insertions(+), 12 deletions(-) > > diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c > index 156360e37714..e707c4797f76 100644 > --- a/drivers/watchdog/iTCO_wdt.c > +++ b/drivers/watchdog/iTCO_wdt.c > @@ -459,13 +459,25 @@ static int iTCO_wdt_probe(struct platform_device *pdev) > if (!p->tco_res) > return -ENODEV; > > - p->smi_res = platform_get_resource(pdev, IORESOURCE_IO, ICH_RES_IO_SMI); > - if (!p->smi_res) > - return -ENODEV; > - > p->iTCO_version = pdata->version; > p->pci_dev = to_pci_dev(dev->parent); > > + p->smi_res = platform_get_resource(pdev, IORESOURCE_IO, ICH_RES_IO_SMI); > + if (p->smi_res) { > + /* 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; > + } > + } else if (iTCO_vendorsupport || > + turn_SMI_watchdog_clear_off >= p->iTCO_version) { > + pr_err("SMI I/O resource is missing\n"); > + return -ENODEV; > + } > + > iTCO_wdt_no_reboot_bit_setup(p, pdata); > > /* > @@ -492,14 +504,6 @@ 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) { > /* > * Bit 13: TCO_EN -> 0 >
WARNING: multiple messages have this Message-ID (diff)
From: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org> To: Mika Westerberg <mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>, Jean Delvare <jdelvare-IBi9RG/b67k@public.gmane.org>, Wim Van Sebroeck <wim-Q8PRGTgFL9WUCWQAtAn6Ix2eb7JE58TQ@public.gmane.org>, Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> Cc: Martin Volf <martin.volf.42-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, Andy Shevchenko <andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>, Jarkko Nikula <jarkko.nikula-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>, linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-hwmon-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Subject: Re: [PATCH v2 2/3] watchdog: iTCO_wdt: Make ICH_RES_IO_SMI optional Date: Wed, 26 Feb 2020 05:33:00 -0800 [thread overview] Message-ID: <8565beae-e7b3-c683-cd39-5af869513f1a@roeck-us.net> (raw) In-Reply-To: <20200226132122.62805-3-mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> On 2/26/20 5:21 AM, Mika Westerberg wrote: > 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-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> Reviewed-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org> > --- > drivers/watchdog/iTCO_wdt.c | 28 ++++++++++++++++------------ > 1 file changed, 16 insertions(+), 12 deletions(-) > > diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c > index 156360e37714..e707c4797f76 100644 > --- a/drivers/watchdog/iTCO_wdt.c > +++ b/drivers/watchdog/iTCO_wdt.c > @@ -459,13 +459,25 @@ static int iTCO_wdt_probe(struct platform_device *pdev) > if (!p->tco_res) > return -ENODEV; > > - p->smi_res = platform_get_resource(pdev, IORESOURCE_IO, ICH_RES_IO_SMI); > - if (!p->smi_res) > - return -ENODEV; > - > p->iTCO_version = pdata->version; > p->pci_dev = to_pci_dev(dev->parent); > > + p->smi_res = platform_get_resource(pdev, IORESOURCE_IO, ICH_RES_IO_SMI); > + if (p->smi_res) { > + /* 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; > + } > + } else if (iTCO_vendorsupport || > + turn_SMI_watchdog_clear_off >= p->iTCO_version) { > + pr_err("SMI I/O resource is missing\n"); > + return -ENODEV; > + } > + > iTCO_wdt_no_reboot_bit_setup(p, pdata); > > /* > @@ -492,14 +504,6 @@ 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) { > /* > * Bit 13: TCO_EN -> 0 >
next prev parent reply other threads:[~2020-02-26 13:33 UTC|newest] Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-02-26 13:21 [PATCH v2 0/3] i2c: i801: Fix iTCO_wdt resource creation if PMC is not present Mika Westerberg 2020-02-26 13:21 ` Mika Westerberg 2020-02-26 13:21 ` [PATCH v2 1/3] watchdog: iTCO_wdt: Export vendorsupport Mika Westerberg 2020-02-26 13:32 ` Guenter Roeck 2020-02-26 13:39 ` Mika Westerberg 2020-02-26 13:39 ` Mika Westerberg 2020-03-10 9:30 ` Wolfram Sang 2020-03-10 9:30 ` Wolfram Sang 2020-02-26 13:21 ` [PATCH v2 2/3] watchdog: iTCO_wdt: Make ICH_RES_IO_SMI optional Mika Westerberg 2020-02-26 13:33 ` Guenter Roeck [this message] 2020-02-26 13:33 ` Guenter Roeck 2020-03-10 9:30 ` Wolfram Sang 2020-02-26 13:21 ` [PATCH v2 3/3] i2c: i801: Do not add ICH_RES_IO_SMI for the iTCO_wdt device Mika Westerberg 2020-02-26 13:31 ` Guenter Roeck 2020-03-10 9:31 ` Wolfram Sang 2020-03-10 9:31 ` Wolfram Sang 2020-02-28 17:03 ` [PATCH v2 0/3] i2c: i801: Fix iTCO_wdt resource creation if PMC is not present Wolfram Sang 2020-03-02 10:12 ` Mika Westerberg 2020-03-02 10:12 ` Mika Westerberg
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=8565beae-e7b3-c683-cd39-5af869513f1a@roeck-us.net \ --to=linux@roeck-us.net \ --cc=andriy.shevchenko@linux.intel.com \ --cc=jarkko.nikula@linux.intel.com \ --cc=jdelvare@suse.com \ --cc=linux-hwmon@vger.kernel.org \ --cc=linux-i2c@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-watchdog@vger.kernel.org \ --cc=martin.volf.42@gmail.com \ --cc=mika.westerberg@linux.intel.com \ --cc=wim@linux-watchdog.org \ --cc=wsa@the-dreams.de \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.