From: Hans de Goede <hdegoede@redhat.com>
To: Nat Gurumoorthy <natg@google.com>
Cc: Jean Delvare <khali@linux-fr.org>,
Guenter Roeck <guenter.roeck@ericsson.com>,
Wim Van Sebroeck <wim@iguana.be>,
linux-watchdog@vger.kernel.org, lm-sensors@lm-sensors.org,
linux-kernel@vger.kernel.org, Mike Waychison <mikew@google.com>
Subject: Re: [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87 watchdog drivers
Date: Wed, 13 Apr 2011 08:50:53 +0200 [thread overview]
Message-ID: <4DA547CD.60406@redhat.com> (raw)
In-Reply-To: <1302641387-30264-1-git-send-email-natg@google.com>
Hi,
On 04/12/2011 10:49 PM, Nat Gurumoorthy wrote:
> 01 - Changes to it87 watchdog driver to use "request_muxed_region"
> Serialize access to the hardware by using "request_muxed_region" macro defined
> by Alan Cox. Call to this macro will hold off the requestor if the resource is
> currently busy.
>
> The use of the above macro makes it possible to get rid of
> spinlocks in it8712f_wdt.c and it87_wdt.c watchdog drivers.
> This also greatly simplifies the implementation of it87_wdt.c driver.
>
> Signed-off-by: Nat Gurumoorthy<natg@google.com>
> ---
>
> diff --git a/drivers/watchdog/it8712f_wdt.c b/drivers/watchdog/it8712f_wdt.c
> index 6143f52..51bfbc0 100644
> --- a/drivers/watchdog/it8712f_wdt.c
> +++ b/drivers/watchdog/it8712f_wdt.c
> @@ -51,7 +51,6 @@ MODULE_PARM_DESC(nowayout, "Disable watchdog shutdown on close");
>
> static unsigned long wdt_open;
> static unsigned expect_close;
> -static spinlock_t io_lock;
> static unsigned char revision;
>
> /* Dog Food address - We use the game port address */
> @@ -123,7 +122,11 @@ static inline void superio_select(int ldn)
>
> static inline void superio_enter(void)
> {
> - spin_lock(&io_lock);
> + /*
> + * Reserve REG and REG + 1 for exclusive access.
> + */
> + (void) request_muxed_region(REG, 2, NAME);
> +
You shouldn't (void) this, there is a reason you get a warning
otherwise! request_muxed_region can still fail if some other driver
has done a none muxed request_region on the same region, and in that
case you should not continue with accessing the io-ports.
Regards,
Hans
WARNING: multiple messages have this Message-ID (diff)
From: Hans de Goede <hdegoede@redhat.com>
To: Nat Gurumoorthy <natg@google.com>
Cc: Jean Delvare <khali@linux-fr.org>,
Guenter Roeck <guenter.roeck@ericsson.com>,
Wim Van Sebroeck <wim@iguana.be>,
linux-watchdog@vger.kernel.org, lm-sensors@lm-sensors.org,
linux-kernel@vger.kernel.org, Mike Waychison <mikew@google.com>
Subject: Re: [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87
Date: Wed, 13 Apr 2011 06:50:53 +0000 [thread overview]
Message-ID: <4DA547CD.60406@redhat.com> (raw)
In-Reply-To: <1302641387-30264-1-git-send-email-natg@google.com>
Hi,
On 04/12/2011 10:49 PM, Nat Gurumoorthy wrote:
> 01 - Changes to it87 watchdog driver to use "request_muxed_region"
> Serialize access to the hardware by using "request_muxed_region" macro defined
> by Alan Cox. Call to this macro will hold off the requestor if the resource is
> currently busy.
>
> The use of the above macro makes it possible to get rid of
> spinlocks in it8712f_wdt.c and it87_wdt.c watchdog drivers.
> This also greatly simplifies the implementation of it87_wdt.c driver.
>
> Signed-off-by: Nat Gurumoorthy<natg@google.com>
> ---
>
> diff --git a/drivers/watchdog/it8712f_wdt.c b/drivers/watchdog/it8712f_wdt.c
> index 6143f52..51bfbc0 100644
> --- a/drivers/watchdog/it8712f_wdt.c
> +++ b/drivers/watchdog/it8712f_wdt.c
> @@ -51,7 +51,6 @@ MODULE_PARM_DESC(nowayout, "Disable watchdog shutdown on close");
>
> static unsigned long wdt_open;
> static unsigned expect_close;
> -static spinlock_t io_lock;
> static unsigned char revision;
>
> /* Dog Food address - We use the game port address */
> @@ -123,7 +122,11 @@ static inline void superio_select(int ldn)
>
> static inline void superio_enter(void)
> {
> - spin_lock(&io_lock);
> + /*
> + * Reserve REG and REG + 1 for exclusive access.
> + */
> + (void) request_muxed_region(REG, 2, NAME);
> +
You shouldn't (void) this, there is a reason you get a warning
otherwise! request_muxed_region can still fail if some other driver
has done a none muxed request_region on the same region, and in that
case you should not continue with accessing the io-ports.
Regards,
Hans
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2011-04-13 6:51 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-12 20:48 [PATCH v5 0/2] Make all it87 drivers SMP safe Nat Gurumoorthy
2011-04-12 20:48 ` [lm-sensors] " Nat Gurumoorthy
2011-04-12 20:49 ` [PATCH v5 1/2] Use "request_muxed_region" in it87 watchdog drivers Nat Gurumoorthy
2011-04-12 20:49 ` [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87 Nat Gurumoorthy
2011-04-13 6:50 ` Hans de Goede [this message]
2011-04-13 6:50 ` Hans de Goede
2011-04-13 8:05 ` [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87 watchdog drivers Natarajan Gurumoorthy
2011-04-13 8:05 ` [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87 Natarajan Gurumoorthy
2011-04-13 8:34 ` [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87 watchdog drivers Jean Delvare
2011-04-13 8:34 ` [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87 Jean Delvare
2011-04-13 17:59 ` [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87 watchdog drivers Natarajan Gurumoorthy
2011-04-13 17:59 ` [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87 Natarajan Gurumoorthy
2011-04-13 20:34 ` [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87 watchdog drivers Jean Delvare
2011-04-13 20:34 ` [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87 Jean Delvare
2011-04-14 9:25 ` [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87 watchdog drivers Alan Cox
2011-04-14 9:25 ` [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87 Alan Cox
2011-04-14 17:58 ` [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87 watchdog drivers Guenter Roeck
2011-04-14 17:58 ` [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87 Guenter Roeck
2011-04-13 7:03 ` [PATCH v5 1/2] Use "request_muxed_region" in it87 watchdog drivers Wim Van Sebroeck
2011-04-13 7:03 ` [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87 Wim Van Sebroeck
2011-04-13 8:15 ` [PATCH v5 1/2] Use "request_muxed_region" in it87 watchdog drivers Natarajan Gurumoorthy
2011-04-13 8:15 ` [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87 Natarajan Gurumoorthy
2011-04-13 9:29 ` [PATCH v5 1/2] Use "request_muxed_region" in it87 watchdog drivers Alan Cox
2011-04-13 9:29 ` [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87 Alan Cox
2011-04-14 19:00 ` [PATCH v5 1/2] Use "request_muxed_region" in it87 watchdog drivers Mike Waychison
2011-04-14 19:00 ` [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87 Mike Waychison
2011-04-14 20:41 ` [PATCH v5 1/2] Use "request_muxed_region" in it87 watchdog drivers Alan Cox
2011-04-14 20:41 ` [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87 Alan Cox
2011-04-12 20:50 ` [PATCH v5 2/2] Use "request_muxed_region" in it87 hwmon drivers Nat Gurumoorthy
2011-04-12 20:50 ` [lm-sensors] [PATCH v5 2/2] Use "request_muxed_region" in it87 Nat Gurumoorthy
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=4DA547CD.60406@redhat.com \
--to=hdegoede@redhat.com \
--cc=guenter.roeck@ericsson.com \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=lm-sensors@lm-sensors.org \
--cc=mikew@google.com \
--cc=natg@google.com \
--cc=wim@iguana.be \
/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: link
Be 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.