All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Young <sean@mess.org>
To: Nathan Zimmer <nzimmer@sgi.com>
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	gregkh@linuxfoundation.org, alan@linux.intel.com,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Subject: Re: console issue since 3.6, console=ttyS1 hangs
Date: Thu, 27 Oct 2016 21:19:16 +0100	[thread overview]
Message-ID: <20161027201916.GA7718@gofer.mess.org> (raw)
In-Reply-To: <fb8f3b77-6095-c14b-02e8-deb595777f23@sgi.com>

On Wed, Oct 26, 2016 at 01:16:16PM -0500, Nathan Zimmer wrote:
> On 10/25/2016 03:41 PM, Sean Young wrote:
> >On Mon, Oct 24, 2016 at 04:49:25PM -0500, Nathan Zimmer wrote:
> >>[    1.565062] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
> >The isa probe driver find the serial port.
> >
> >>[    1.566453] serial 00:04: pnp_assign_resources, try dependent set 0
> >>[    1.567383] serial 00:04:   couldn't assign io 0 (min 0x2f8 max 0x2f8)
> >But then decides that the port is already in use (the existing serial driver).
> >>[    1.568366] serial 00:04: pnp_assign_resources failed (-16)
> >>[    1.569188] serial 00:04: unable to assign resources
> >>[    1.569924] serial: probe of 00:04 failed with error -16
> >Please try and boot 3.7.0 with "8250.share_irqs=1", maybe it will pick
> >irq 3 and it will be happy again, but that is just a guess.
> >
> >I think I have not fully understood what the failure is. Does the serial
> >port not work or does the boot hang? What are the symptoms?
> With console=ttyS1 the boot will "hang", sometimes it makes it all the way
> through but may take 30 minutes, instead of the 2-4 minutes this box

Where does it hang? Any error messages?

> >We might be able to fix the problem with a pnp quirk but 3.7 is has not had
> >any releases for a long time. We will need a reproduction on a concurrent
> >kernel so a patch can be written for that.
> Yes it still happens with 4.8+
> I had only started dwelling on 3.6/3.7 since that is where it first appears
> and don't have any attachment to those.

Ok. Please try to following patch. I'm not sure it is good enough to be
merged as-is, but should provide a start for testing. Output with
CONFIG_PNP_DEBUG_MESSAGES should show only irq 3 is available for the 
serial port now.

Sean

>From 3a1705a2e28f4385b778ad96d7c517b82ea860e2 Mon Sep 17 00:00:00 2001
From: Sean Young <sean@mess.org>
Date: Thu, 27 Oct 2016 20:13:50 +0100
Subject: [PATCH] PNP: Add quirk for BIOS advertising wrong irqs for serial
 port

Signed-off-by: Sean Young <sean@mess.org>
---
 drivers/pnp/quirks.c | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c
index d28e3ab..8712161 100644
--- a/drivers/pnp/quirks.c
+++ b/drivers/pnp/quirks.c
@@ -66,6 +66,48 @@ static void quirk_awe32_resources(struct pnp_dev *dev)
 	}
 }
 
+static void quirk_serial_port(struct pnp_dev *dev)
+{
+	struct pnp_option *option;
+	struct pnp_irq *irq;
+	struct pnp_port *port;
+
+	list_for_each_entry(option, &dev->options, list) {
+		if (!pnp_option_is_dependent(option))
+			continue;
+
+		if (option->type == IORESOURCE_IO) {
+			port = &option->u.port;
+
+			if (port->min != 0x2f8 || port->max != 0x2f8 ||
+				port->size != 8 || port->align != 1)
+				return;
+		} else if (option->type == IORESOURCE_IRQ) {
+			pnp_irq_mask_t map;
+
+			irq = &option->u.irq;
+
+			bitmap_zero(map.bits, PNP_IRQ_NR);
+			__set_bit(3, map.bits);
+			__set_bit(4, map.bits);
+			__set_bit(5, map.bits);
+			__set_bit(6, map.bits);
+			__set_bit(7, map.bits);
+			__set_bit(10, map.bits);
+			__set_bit(11, map.bits);
+			__set_bit(12, map.bits);
+
+			if (!bitmap_equal(map.bits, irq->map.bits, PNP_IRQ_NR))
+				return;
+		}
+	}
+
+	if (irq && port) {
+		bitmap_zero(irq->map.bits, PNP_IRQ_NR);
+		__set_bit(3, irq->map.bits);
+	}
+}
+
 static void quirk_cmi8330_resources(struct pnp_dev *dev)
 {
 	struct pnp_option *option;
@@ -448,6 +490,7 @@ static struct pnp_fixup pnp_fixups[] = {
 #ifdef CONFIG_PCI
 	{"PNP0c02", quirk_intel_mch},
 #endif
+	{"PNP0c02", quirk_serial_port},
 	{""}
 };
 
-- 
2.7.4

  reply	other threads:[~2016-10-27 20:19 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17 14:49 console issue since 3.6, console=ttyS1 hangs Nathan Zimmer
2016-10-17 15:19 ` Sean Young
2016-10-17 16:41   ` Nathan Zimmer
2016-10-18 16:40     ` Nathan Zimmer
2016-10-18 18:05       ` Sean Young
2016-10-18 19:29         ` Nathan Zimmer
2016-10-19  9:07           ` Sean Young
2016-10-19 22:13             ` Nathan Zimmer
2016-10-19 22:13               ` Nathan Zimmer
2016-10-20 20:10               ` Sean Young
2016-10-21 15:55                 ` Nathan Zimmer
2016-10-21 15:55                   ` Nathan Zimmer
2016-10-24 13:52                   ` Sean Young
2016-10-24 21:49                     ` Nathan Zimmer
2016-10-25 20:41                       ` Sean Young
2016-10-26 18:16                         ` Nathan Zimmer
2016-10-26 18:16                           ` Nathan Zimmer
2016-10-27 20:19                           ` Sean Young [this message]
2016-10-28 19:42                             ` Nathan Zimmer
2016-10-29 21:16                               ` Sean Young
2016-10-30 16:01                                 ` Nathan
2016-10-30 16:01                                   ` Nathan
2016-10-28 19:55                             ` Nathan
2016-10-28 19:55                               ` Nathan
2016-10-30 15:33                             ` Nathan
2016-10-30 15:33                               ` Nathan
2016-10-31 20:27                               ` Sean Young
2016-11-01  2:55                                 ` Peter Hurley
2016-11-02 15:29                                   ` Nathan Zimmer
2016-11-04  0:25                                     ` Peter Hurley
2016-11-04 21:33                                       ` Nathan Zimmer
2016-11-04 22:18                                         ` Peter Hurley
2016-11-05 23:44                                           ` Maciej W. Rozycki
2016-11-07 15:40                                             ` Nathan Zimmer
2016-11-22 15:30                                             ` Nathan Zimmer

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=20161027201916.GA7718@gofer.mess.org \
    --to=sean@mess.org \
    --cc=alan@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=nzimmer@sgi.com \
    --cc=rafael.j.wysocki@intel.com \
    /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.