All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boszormenyi Zoltan <zboszor@pr.hu>
To: linux-kernel@vger.kernel.org
Cc: linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org,
	linux-i2c@vger.kernel.org,
	Paul Menzel <paulepanter@users.sourceforge.net>,
	Christian Fetzer <fetzer.ch@gmail.com>,
	Jean Delvare <jdelvare@suse.com>,
	Nehal Shah <nehal-bakulchandra.shah@amd.com>,
	Tim Small <tim@seoss.co.uk>, Guenter Roeck <linux@roeck-us.net>,
	kernel@ekass.net, wim@iguana.be, jlayton@poochiereds.net,
	marc.2377@gmail.com, cshorler@googlemail.com, wsa@the-dreams.de,
	regressions@leemhuis.info,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 0/5 v4] Fix sp5100_tco watchdog driver regression
Date: Thu, 6 Jul 2017 09:50:33 +0200	[thread overview]
Message-ID: <21338590-400b-e1b3-1787-bd275a30c17c@pr.hu> (raw)
In-Reply-To: <20170622132134.7200-1-zboszor@pr.hu>

Hi,

ping for the series.

Adding Greg Kroah-Hartman to the cc: list, both for the USB core
and stable series maintainership.

2017-06-22 15:21 keltezéssel, Zoltán Böszörményi írta:
> This patch series fixes a regression introduced by:
> 
> commit 2fee61d22e606fc99ade9079fda15fdee83ec33e
> Author: Christian Fetzer <fetzer.ch@gmail.com>
> Date:   Thu Nov 19 20:13:48 2015 +0100
> 
>      i2c: piix4: Add support for multiplexed main adapter in SB800
> 
> The regression caused sp5100_tco fail to load:
> 
> sp5100_tco: SP5100/SB800 TCO WatchDog Timer Driver v0.05
> sp5100_tco: PCI Vendor ID: 0x1002, Device ID: 0x4385, Revision ID: 0x42
> sp5100_tco: I/O address 0x0cd6 already in use
> 
> Notable bugzilla links about this issue:
> https://bugzilla.kernel.org/show_bug.cgi?id=170741
> https://bugzilla.redhat.com/show_bug.cgi?id=1369269
> https://bugzilla.redhat.com/show_bug.cgi?id=1406844
> 
> The previous two versions of this patch series introduced
> a common mutex to synchronize access to the I/O port pair
> 0xcd6 / 0xcd7 used by the AMD SB800 USB PCI quirk code and
> the i2c-piix and sp5100_tco drivers. The common mutex was
> criticized because it introduces an inter-dependency between
> drivers.
> 
> This approach modifies the request_muxed_region() semantics and
> modifies the possible use cases.
> 
> The first patch in the series adds a new IORESOURCE_ALLOCATED
> flag that alloc_resource() sets and free_resource() considers.
> The core of __request_region() is factored out into a new function
> that doesn't allocate. With this change, drivers can use the
> pre-existing DEFINE_RES_IO_NAMED() static initialized macro
> to declare struct resource statically (e.g. on the stack)
> and pass the address of it to the new __request_declared_region()
> function. A new macro called request_declared_muxed_region()
> was added to exploit this functionality. Because of the new
> IORESOURCE_ALLOCATED resource flag, release_region() can still
> be called with the old interface (the port region start and
> end values) and it won't attempt to free a non-allocated resource.
> This eliminated one failure case that can come from allocation
> errors.
> 
> The second patch modifies the behaviour of IORESOURCE_MUXED,
> a.k.a. the request_*muxed_region() macros. When these macros
> are called, the caller goes to sleep when there is any conflicting
> regions, even if the conflicting region did not use the
> IORESOURCE_MUXED flag. The kernel logs this inconsistent
> flag usage with KERN_ERR. This change eliminates the second
> failure case for IORESOURCE_MUXED and request_muxed_region()
> can be used like mutex_lock(), i.e. it returns only in case it
> could successfully request the region.
> 
> The last three patches adds proper synchronization between the
> USB PCI quirks code and the i2c-piix and sp5100_tco drivers.
> 
> The result is that the sp5100_tco driver can load and works again:
> 
> sp5100_tco: SP5100/SB800 TCO WatchDog Timer Driver v0.05
> sp5100_tco: PCI Vendor ID: 0x1002, Device ID: 0x4385, Revision ID: 0x42
> sp5100_tco: Using 0xfed80b00 for watchdog MMIO address
> sp5100_tco: Last reboot was not triggered by watchdog.
> sp5100_tco: initialized (0xffffba2f4192db00). heartbeat=60 sec (nowayout=0)
> 
> Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
> ---
>   drivers/i2c/busses/i2c-piix4.c | 41 ++++++++++++-------------------------
>   drivers/usb/host/pci-quirks.c  |  4 ++++
>   drivers/watchdog/sp5100_tco.c  | 28 +++++++++++++------------
>   include/linux/ioport.h         | 14 +++++++++++++
>   kernel/resource.c              | 46 ++++++++++++++++++++++++++++++++++++++----
>   5 files changed, 88 insertions(+), 45 deletions(-)
> 
> 

The synchronized access to the SB800 I/O ports seems to also have made a rare
"disabled by hub (EMI?), re-enabling..." report from the kernel disappear.

Can someone review the series?

Thanks in advance,
Zoltán Böszörményi

WARNING: multiple messages have this Message-ID (diff)
From: Boszormenyi Zoltan <zboszor-v1d7l9VOqKc@public.gmane.org>
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Paul Menzel
	<paulepanter-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	Christian Fetzer
	<fetzer.ch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Jean Delvare <jdelvare-IBi9RG/b67k@public.gmane.org>,
	Nehal Shah <nehal-bakulchandra.shah-5C7GfCeVMHo@public.gmane.org>,
	Tim Small <tim-v0yPK6tSSg/10XsdtD+oqA@public.gmane.org>,
	Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>,
	kernel-i2qG/+7/Q79eoWH0uzbU5w@public.gmane.org,
	wim-IQzOog9fTRqzQB+pC5nmwQ@public.gmane.org,
	jlayton-vpEMnDpepFuMZCB2o+C8xQ@public.gmane.org,
	marc.2377-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	cshorler-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org,
	wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org,
	regressions-rCxcAJFjeRkk+I/owrrOrA@public.gmane.org,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH 0/5 v4] Fix sp5100_tco watchdog driver regression
Date: Thu, 6 Jul 2017 09:50:33 +0200	[thread overview]
Message-ID: <21338590-400b-e1b3-1787-bd275a30c17c@pr.hu> (raw)
In-Reply-To: <20170622132134.7200-1-zboszor-v1d7l9VOqKc@public.gmane.org>

Hi,

ping for the series.

Adding Greg Kroah-Hartman to the cc: list, both for the USB core
and stable series maintainership.

2017-06-22 15:21 keltezéssel, Zoltán Böszörményi írta:
> This patch series fixes a regression introduced by:
> 
> commit 2fee61d22e606fc99ade9079fda15fdee83ec33e
> Author: Christian Fetzer <fetzer.ch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Date:   Thu Nov 19 20:13:48 2015 +0100
> 
>      i2c: piix4: Add support for multiplexed main adapter in SB800
> 
> The regression caused sp5100_tco fail to load:
> 
> sp5100_tco: SP5100/SB800 TCO WatchDog Timer Driver v0.05
> sp5100_tco: PCI Vendor ID: 0x1002, Device ID: 0x4385, Revision ID: 0x42
> sp5100_tco: I/O address 0x0cd6 already in use
> 
> Notable bugzilla links about this issue:
> https://bugzilla.kernel.org/show_bug.cgi?id=170741
> https://bugzilla.redhat.com/show_bug.cgi?id=1369269
> https://bugzilla.redhat.com/show_bug.cgi?id=1406844
> 
> The previous two versions of this patch series introduced
> a common mutex to synchronize access to the I/O port pair
> 0xcd6 / 0xcd7 used by the AMD SB800 USB PCI quirk code and
> the i2c-piix and sp5100_tco drivers. The common mutex was
> criticized because it introduces an inter-dependency between
> drivers.
> 
> This approach modifies the request_muxed_region() semantics and
> modifies the possible use cases.
> 
> The first patch in the series adds a new IORESOURCE_ALLOCATED
> flag that alloc_resource() sets and free_resource() considers.
> The core of __request_region() is factored out into a new function
> that doesn't allocate. With this change, drivers can use the
> pre-existing DEFINE_RES_IO_NAMED() static initialized macro
> to declare struct resource statically (e.g. on the stack)
> and pass the address of it to the new __request_declared_region()
> function. A new macro called request_declared_muxed_region()
> was added to exploit this functionality. Because of the new
> IORESOURCE_ALLOCATED resource flag, release_region() can still
> be called with the old interface (the port region start and
> end values) and it won't attempt to free a non-allocated resource.
> This eliminated one failure case that can come from allocation
> errors.
> 
> The second patch modifies the behaviour of IORESOURCE_MUXED,
> a.k.a. the request_*muxed_region() macros. When these macros
> are called, the caller goes to sleep when there is any conflicting
> regions, even if the conflicting region did not use the
> IORESOURCE_MUXED flag. The kernel logs this inconsistent
> flag usage with KERN_ERR. This change eliminates the second
> failure case for IORESOURCE_MUXED and request_muxed_region()
> can be used like mutex_lock(), i.e. it returns only in case it
> could successfully request the region.
> 
> The last three patches adds proper synchronization between the
> USB PCI quirks code and the i2c-piix and sp5100_tco drivers.
> 
> The result is that the sp5100_tco driver can load and works again:
> 
> sp5100_tco: SP5100/SB800 TCO WatchDog Timer Driver v0.05
> sp5100_tco: PCI Vendor ID: 0x1002, Device ID: 0x4385, Revision ID: 0x42
> sp5100_tco: Using 0xfed80b00 for watchdog MMIO address
> sp5100_tco: Last reboot was not triggered by watchdog.
> sp5100_tco: initialized (0xffffba2f4192db00). heartbeat=60 sec (nowayout=0)
> 
> Signed-off-by: Zoltán Böszörményi <zboszor-v1d7l9VOqKc@public.gmane.org>
> ---
>   drivers/i2c/busses/i2c-piix4.c | 41 ++++++++++++-------------------------
>   drivers/usb/host/pci-quirks.c  |  4 ++++
>   drivers/watchdog/sp5100_tco.c  | 28 +++++++++++++------------
>   include/linux/ioport.h         | 14 +++++++++++++
>   kernel/resource.c              | 46 ++++++++++++++++++++++++++++++++++++++----
>   5 files changed, 88 insertions(+), 45 deletions(-)
> 
> 

The synchronized access to the SB800 I/O ports seems to also have made a rare
"disabled by hub (EMI?), re-enabling..." report from the kernel disappear.

Can someone review the series?

Thanks in advance,
Zoltán Böszörményi
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-07-06  7:51 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <<20170401110223.12056-1-zboszor@pr.hu>
2017-04-03  7:51 ` [PATCH 0/3 v2] Fix regression in the sp5100_tco driver Zoltan Boszormenyi
2017-04-03  7:51   ` [PATCH 1/3 v2] usb: pci-quirks: Add a common mutex for the I/O port pair of SB800 Zoltan Boszormenyi
2017-06-20 14:12     ` [1/3, " Guenter Roeck
2017-04-03  7:51   ` [PATCH 2/3 v2] i2c: i2c-piix4: Use the common mutex Zoltan Boszormenyi
2017-04-03  7:51     ` Zoltan Boszormenyi
2017-04-19 18:43     ` Wolfram Sang
2017-04-03  7:51   ` [PATCH 3/3 v2] watchdog: sp5100_tco: " Zoltan Boszormenyi
2017-04-03  7:51     ` Zoltan Boszormenyi
2017-06-21  3:53   ` [PATCH 0/5 v3] Fix sp5100_tco watchdog driver regression Zoltán Böszörményi
2017-06-21  3:53     ` [PATCH 1/5] Extend the request_region() infrastructure Zoltán Böszörményi
2017-06-21  3:53     ` [PATCH 2/5] Modify behaviour of request_*muxed_region() Zoltán Böszörményi
2017-06-21  3:53     ` [PATCH 3/5] usb: pci-quirks: Protect the I/O port pair of SB800 Zoltán Böszörményi
2017-06-21  3:53     ` [PATCH 4/5] i2c: i2c-piix4: Use request_declared_muxed_region() Zoltán Böszörményi
2017-06-21  3:53     ` [PATCH 5/5] watchdog: sp5100_tco: " Zoltán Böszörményi
2017-06-21  3:53       ` Zoltán Böszörményi
2017-06-21 15:09       ` Guenter Roeck
2017-06-22 13:21     ` [PATCH 0/5 v4] Fix sp5100_tco watchdog driver regression Zoltán Böszörményi
2017-06-22 13:21       ` [PATCH 1/5 v2] Extend the request_region() infrastructure Zoltán Böszörményi
2017-07-14  8:33         ` Boszormenyi Zoltan
2017-07-14  8:33           ` Boszormenyi Zoltan
2017-07-14  8:33           ` Boszormenyi Zoltan
2017-06-22 13:21       ` [PATCH 2/5 v2] Modify behaviour of request_*muxed_region() Zoltán Böszörményi
2017-07-08 15:37         ` [2/5,v2] " Guenter Roeck
2017-07-08 15:37           ` Guenter Roeck
2017-06-22 13:21       ` [PATCH 3/5 v4] usb: pci-quirks: Protect the I/O port pair of SB800 Zoltán Böszörményi
2017-06-22 13:21         ` Zoltán Böszörményi
2017-07-14  8:34         ` Boszormenyi Zoltan
2017-07-14  8:34           ` Boszormenyi Zoltan
2017-07-14  8:34           ` Boszormenyi Zoltan
2017-07-14 11:36           ` Greg Kroah-Hartman
2017-07-14 11:36             ` Greg Kroah-Hartman
2017-07-14 11:36             ` Greg Kroah-Hartman
2017-06-22 13:21       ` [PATCH 4/5 v4] i2c: i2c-piix4: Use request_declared_muxed_region() Zoltán Böszörményi
2017-06-22 13:21       ` [PATCH 5/5 v4] watchdog: sp5100_tco: " Zoltán Böszörményi
2017-07-14  8:34         ` Boszormenyi Zoltan
2017-07-14  8:34           ` Boszormenyi Zoltan
2017-07-14  8:34           ` Boszormenyi Zoltan
2017-07-06  7:50       ` Boszormenyi Zoltan [this message]
2017-07-06  7:50         ` [PATCH 0/5 v4] Fix sp5100_tco watchdog driver regression Boszormenyi Zoltan
2017-07-07  2:09         ` Marcelo "Marc" Ranolfi
     [not found]           ` <CAETC-g_YF7TWv+LNrNQrX9AY_-iepCeE0EmCKWYF4VyQzRY+UQ@mail.gmail.com>
2017-07-07  2:26             ` Marcelo "Marc" Ranolfi
2017-04-01 10:06 [PATCH 0/3] " Zoltán Böszörményi
2017-04-01 10:06 ` [PATCH 1/3] usb: pci-quirks: Add a header for SB800 I/O ports and mutex for locking Zoltán Böszörményi
2017-04-01 10:06 ` [PATCH 3/3] watchdog: sp5100_tco: Synchronize I/O port accesses Zoltán Böszörményi
2017-04-01 11:02 ` [PATCH 0/3, resend] Fix sp5100_tco watchdog driver regression Zoltan Boszormenyi
2017-04-01 11:02   ` [PATCH 1/3] usb: pci-quirks: Add a header for SB800 I/O ports and mutex for locking Zoltan Boszormenyi
2017-04-01 13:59     ` Greg KH
2017-04-01 14:40       ` Alan Stern
2017-04-01 14:40         ` Alan Stern
2017-04-01 15:09         ` Boszormenyi Zoltan
2017-04-01 15:09           ` Boszormenyi Zoltan
2017-04-01 15:07       ` Boszormenyi Zoltan
2017-04-01 15:07         ` Boszormenyi Zoltan
2017-04-01 11:02   ` [PATCH 3/3] watchdog: sp5100_tco: Synchronize I/O port accesses Zoltan Boszormenyi
2017-04-01 11:08 ` [PATCH 2/3] i2c: i2c-piix4: Synchronize I/O port accesses with the SB800 USB quirk Zoltan Boszormenyi
2017-04-01 11:08   ` Zoltan Boszormenyi

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=21338590-400b-e1b3-1787-bd275a30c17c@pr.hu \
    --to=zboszor@pr.hu \
    --cc=cshorler@googlemail.com \
    --cc=fetzer.ch@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jdelvare@suse.com \
    --cc=jlayton@poochiereds.net \
    --cc=kernel@ekass.net \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=marc.2377@gmail.com \
    --cc=nehal-bakulchandra.shah@amd.com \
    --cc=paulepanter@users.sourceforge.net \
    --cc=regressions@leemhuis.info \
    --cc=tim@seoss.co.uk \
    --cc=wim@iguana.be \
    --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: 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.