* [PATCH] serial/8250_pci: add a quirk for the kt serial controller
@ 2011-10-23 22:27 Dan Williams
2011-10-25 2:28 ` Greg KH
0 siblings, 1 reply; 7+ messages in thread
From: Dan Williams @ 2011-10-23 22:27 UTC (permalink / raw)
To: gregkh; +Cc: Nhan H Mai, linux-kernel, linux-serial, alan
Workaround dropped notifications in the iir register. Prevent reads
coincident with new interrupt notifications by reading the iir at most
once per interrupt.
Reported-by: Nhan H Mai <nhan.h.mai@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
drivers/tty/serial/8250.c | 6 +++++-
drivers/tty/serial/8250_pci.c | 15 +++++++++++++++
include/linux/pci_ids.h | 1 +
include/linux/serial_core.h | 1 +
4 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index 7f50999..513e728 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -1652,7 +1652,11 @@ static irqreturn_t serial8250_interrupt(int irq, void *dev_id)
up = list_entry(l, struct uart_8250_port, list);
- iir = serial_in(up, UART_IIR);
+ if (pass_counter && up->port.flags & UPF_IIR_ONCE)
+ iir = UART_IIR_NO_INT;
+ else
+ iir = serial_in(up, UART_IIR);
+
if (!(iir & UART_IIR_NO_INT)) {
serial8250_handle_port(up);
diff --git a/drivers/tty/serial/8250_pci.c b/drivers/tty/serial/8250_pci.c
index 3abeca2..4ad2fb4 100644
--- a/drivers/tty/serial/8250_pci.c
+++ b/drivers/tty/serial/8250_pci.c
@@ -1092,6 +1092,14 @@ static int skip_tx_en_setup(struct serial_private *priv,
return pci_default_setup(priv, board, port, idx);
}
+static int kt_serial_setup(struct serial_private *priv,
+ const struct pciserial_board *board,
+ struct uart_port *port, int idx)
+{
+ port->flags |= UPF_IIR_ONCE;
+ return skip_tx_en_setup(priv, board, port, idx);
+}
+
static int pci_eg20t_init(struct pci_dev *dev)
{
#if defined(CONFIG_SERIAL_PCH_UART) || defined(CONFIG_SERIAL_PCH_UART_MODULE)
@@ -1211,6 +1219,13 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
.subdevice = PCI_ANY_ID,
.setup = ce4100_serial_setup,
},
+ {
+ .vendor = PCI_VENDOR_ID_INTEL,
+ .device = PCI_DEVICE_ID_INTEL_PATSBURG_KT,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ .setup = kt_serial_setup,
+ },
/*
* ITE
*/
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index ae96bbe..ed80d75 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2492,6 +2492,7 @@
#define PCI_DEVICE_ID_INTEL_IOAT 0x1a38
#define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MIN 0x1c41
#define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX 0x1c5f
+#define PCI_DEVICE_ID_INTEL_PATSBURG_KT 0x1d3d
#define PCI_DEVICE_ID_INTEL_PATSBURG_LPC_0 0x1d40
#define PCI_DEVICE_ID_INTEL_PATSBURG_LPC_1 0x1d41
#define PCI_DEVICE_ID_INTEL_PANTHERPOINT_XHCI 0x1e31
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index a5c3114..a66484b3 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -350,6 +350,7 @@ struct uart_port {
#define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16))
#define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))
+#define UPF_IIR_ONCE ((__force upf_t) (1 << 25))
/* The exact UART type is known and should not be probed. */
#define UPF_FIXED_TYPE ((__force upf_t) (1 << 27))
#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28))
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] serial/8250_pci: add a quirk for the kt serial controller
2011-10-23 22:27 [PATCH] serial/8250_pci: add a quirk for the kt serial controller Dan Williams
@ 2011-10-25 2:28 ` Greg KH
2011-10-25 20:16 ` Dan Williams
0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2011-10-25 2:28 UTC (permalink / raw)
To: Dan Williams; +Cc: gregkh, Nhan H Mai, linux-kernel, linux-serial, alan
On Sun, Oct 23, 2011 at 03:27:16PM -0700, Dan Williams wrote:
> --- a/include/linux/pci_ids.h
> +++ b/include/linux/pci_ids.h
> @@ -2492,6 +2492,7 @@
> #define PCI_DEVICE_ID_INTEL_IOAT 0x1a38
> #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MIN 0x1c41
> #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX 0x1c5f
> +#define PCI_DEVICE_ID_INTEL_PATSBURG_KT 0x1d3d
> #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC_0 0x1d40
> #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC_1 0x1d41
> #define PCI_DEVICE_ID_INTEL_PANTHERPOINT_XHCI 0x1e31
Based on the comment at the top of this file, you shouldn't add this
entry to it.
Care to redo the patch without that change?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] serial/8250_pci: add a quirk for the kt serial controller
2011-10-25 2:28 ` Greg KH
@ 2011-10-25 20:16 ` Dan Williams
2011-10-25 20:51 ` Greg KH
2011-11-15 19:18 ` Greg KH
0 siblings, 2 replies; 7+ messages in thread
From: Dan Williams @ 2011-10-25 20:16 UTC (permalink / raw)
To: Greg KH; +Cc: gregkh, Nhan H Mai, linux-kernel, linux-serial, alan,
Dan Williams
From: Dan Williams <dan.j.williams@intel.com>
Date: Sun, 23 Oct 2011 15:06:24 -0700
Subject: [PATCH v2] serial/8250_pci: add a quirk for the kt serial controller
Workaround dropped notifications in the iir register. Prevent reads
coincident with new interrupt notifications by reading the iir at most
once per interrupt.
Reported-by: Nhan H Mai <nhan.h.mai@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
On Tue, 2011-10-25 at 04:28 +0200, Greg KH wrote:
On Sun, Oct 23, 2011 at 03:27:16PM -0700, Dan Williams wrote:
> > --- a/include/linux/pci_ids.h
> > +++ b/include/linux/pci_ids.h
[..]
> Based on the comment at the top of this file, you shouldn't add this
> entry to it.
>
> Care to redo the patch without that change?
Ok, moved it to drivers/tty/serial/8250_pci.c and cleaned up the
conflicting "/* This should be in linux/pci_ids.h */" comment.
Thanks,
Dan
drivers/tty/serial/8250.c | 6 +++++-
drivers/tty/serial/8250_pci.c | 17 ++++++++++++++++-
include/linux/serial_core.h | 1 +
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index 7f50999..513e728 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -1652,7 +1652,11 @@ static irqreturn_t serial8250_interrupt(int irq, void *dev_id)
up = list_entry(l, struct uart_8250_port, list);
- iir = serial_in(up, UART_IIR);
+ if (pass_counter && up->port.flags & UPF_IIR_ONCE)
+ iir = UART_IIR_NO_INT;
+ else
+ iir = serial_in(up, UART_IIR);
+
if (!(iir & UART_IIR_NO_INT)) {
serial8250_handle_port(up);
diff --git a/drivers/tty/serial/8250_pci.c b/drivers/tty/serial/8250_pci.c
index 3abeca2..d8fd94a 100644
--- a/drivers/tty/serial/8250_pci.c
+++ b/drivers/tty/serial/8250_pci.c
@@ -1092,6 +1092,14 @@ static int skip_tx_en_setup(struct serial_private *priv,
return pci_default_setup(priv, board, port, idx);
}
+static int kt_serial_setup(struct serial_private *priv,
+ const struct pciserial_board *board,
+ struct uart_port *port, int idx)
+{
+ port->flags |= UPF_IIR_ONCE;
+ return skip_tx_en_setup(priv, board, port, idx);
+}
+
static int pci_eg20t_init(struct pci_dev *dev)
{
#if defined(CONFIG_SERIAL_PCH_UART) || defined(CONFIG_SERIAL_PCH_UART_MODULE)
@@ -1101,7 +1109,6 @@ static int pci_eg20t_init(struct pci_dev *dev)
#endif
}
-/* This should be in linux/pci_ids.h */
#define PCI_VENDOR_ID_SBSMODULARIO 0x124B
#define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B
#define PCI_DEVICE_ID_OCTPRO 0x0001
@@ -1127,6 +1134,7 @@ static int pci_eg20t_init(struct pci_dev *dev)
#define PCI_DEVICE_ID_OXSEMI_16PCI958 0x9538
#define PCIE_DEVICE_ID_NEO_2_OX_IBM 0x00F6
#define PCI_DEVICE_ID_PLX_CRONYX_OMEGA 0xc001
+#define PCI_DEVICE_ID_INTEL_PATSBURG_KT 0x1d3d
/* Unknown vendors/cards - this should not be in linux/pci_ids.h */
#define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584
@@ -1211,6 +1219,13 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
.subdevice = PCI_ANY_ID,
.setup = ce4100_serial_setup,
},
+ {
+ .vendor = PCI_VENDOR_ID_INTEL,
+ .device = PCI_DEVICE_ID_INTEL_PATSBURG_KT,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ .setup = kt_serial_setup,
+ },
/*
* ITE
*/
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index a5c3114..a66484b3 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -350,6 +350,7 @@ struct uart_port {
#define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16))
#define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))
+#define UPF_IIR_ONCE ((__force upf_t) (1 << 25))
/* The exact UART type is known and should not be probed. */
#define UPF_FIXED_TYPE ((__force upf_t) (1 << 27))
#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28))
--
1.7.6
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] serial/8250_pci: add a quirk for the kt serial controller
2011-10-25 20:16 ` Dan Williams
@ 2011-10-25 20:51 ` Greg KH
2011-10-25 22:52 ` Williams, Dan J
2011-11-15 19:18 ` Greg KH
1 sibling, 1 reply; 7+ messages in thread
From: Greg KH @ 2011-10-25 20:51 UTC (permalink / raw)
To: Dan Williams; +Cc: Greg KH, Nhan H Mai, linux-kernel, linux-serial, alan
On Tue, Oct 25, 2011 at 01:16:34PM -0700, Dan Williams wrote:
> From: Dan Williams <dan.j.williams@intel.com>
> Date: Sun, 23 Oct 2011 15:06:24 -0700
> Subject: [PATCH v2] serial/8250_pci: add a quirk for the kt serial controller
>
> Workaround dropped notifications in the iir register. Prevent reads
> coincident with new interrupt notifications by reading the iir at most
> once per interrupt.
>
> Reported-by: Nhan H Mai <nhan.h.mai@intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Much better.
But.
Do you really think I can apply a patch that looks like this above? I
have to edit the text of the email before I apply it.
Now I'm a bit grumpy about this at the moment as Linus yelled at me for
patches where I missed this on a few for the 3.2 merge window, so I'm
going to push back on people now very hard.
Please send this in a format that I can run 'git am' on the email you
send me. I could not do that here, otherwise we would end up with a
duplicate header in the changelog message.
Yes, it makes you do a bit more work, but when you are handling
thousands of patches like me, you scale better than I do :)
Actually, it's just making you do it properly, along with everyone else,
which is a good thing, right?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] serial/8250_pci: add a quirk for the kt serial controller
2011-10-25 20:51 ` Greg KH
@ 2011-10-25 22:52 ` Williams, Dan J
2011-11-03 16:34 ` Williams, Dan J
0 siblings, 1 reply; 7+ messages in thread
From: Williams, Dan J @ 2011-10-25 22:52 UTC (permalink / raw)
To: Greg KH; +Cc: Greg KH, Nhan H Mai, linux-kernel, linux-serial, alan
On Tue, Oct 25, 2011 at 1:51 PM, Greg KH <gregkh@suse.de> wrote:
> On Tue, Oct 25, 2011 at 01:16:34PM -0700, Dan Williams wrote:
>> From: Dan Williams <dan.j.williams@intel.com>
>> Date: Sun, 23 Oct 2011 15:06:24 -0700
>> Subject: [PATCH v2] serial/8250_pci: add a quirk for the kt serial controller
>>
>> Workaround dropped notifications in the iir register. Prevent reads
>> coincident with new interrupt notifications by reading the iir at most
>> once per interrupt.
>>
>> Reported-by: Nhan H Mai <nhan.h.mai@intel.com>
>> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
>
> Much better.
>
> But.
>
> Do you really think I can apply a patch that looks like this above? I
> have to edit the text of the email before I apply it.
I don't doubt you get busted patches all the time, this isn't one.
Double checked before and now triple checked that git am takes the
last occurrence of the From: Date: and Subject: headers and that my
mailer is not corrupting the patch.
I have no problem resending to fit into your workflow, but I expect
"git am" will do the right thing with this mail.
--
Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] serial/8250_pci: add a quirk for the kt serial controller
2011-10-25 22:52 ` Williams, Dan J
@ 2011-11-03 16:34 ` Williams, Dan J
0 siblings, 0 replies; 7+ messages in thread
From: Williams, Dan J @ 2011-11-03 16:34 UTC (permalink / raw)
To: Greg KH; +Cc: Greg KH, Nhan H Mai, linux-kernel, linux-serial, alan
On Tue, Oct 25, 2011 at 3:52 PM, Williams, Dan J
<dan.j.williams@intel.com> wrote:
> On Tue, Oct 25, 2011 at 1:51 PM, Greg KH <gregkh@suse.de> wrote:
>> On Tue, Oct 25, 2011 at 01:16:34PM -0700, Dan Williams wrote:
>>> From: Dan Williams <dan.j.williams@intel.com>
>>> Date: Sun, 23 Oct 2011 15:06:24 -0700
>>> Subject: [PATCH v2] serial/8250_pci: add a quirk for the kt serial controller
>>>
>>> Workaround dropped notifications in the iir register. Prevent reads
>>> coincident with new interrupt notifications by reading the iir at most
>>> once per interrupt.
>>>
>>> Reported-by: Nhan H Mai <nhan.h.mai@intel.com>
>>> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
>>
>> Much better.
>>
>> But.
>>
>> Do you really think I can apply a patch that looks like this above? I
>> have to edit the text of the email before I apply it.
>
> I don't doubt you get busted patches all the time, this isn't one.
...except for the fact that it would have collided spectacularly with
the contents of tty.git staged for 3.2. Sorry for the noise, will
resend.
--
Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] serial/8250_pci: add a quirk for the kt serial controller
2011-10-25 20:16 ` Dan Williams
2011-10-25 20:51 ` Greg KH
@ 2011-11-15 19:18 ` Greg KH
1 sibling, 0 replies; 7+ messages in thread
From: Greg KH @ 2011-11-15 19:18 UTC (permalink / raw)
To: Dan Williams; +Cc: gregkh, Nhan H Mai, linux-kernel, linux-serial, alan
On Tue, Oct 25, 2011 at 01:16:34PM -0700, Dan Williams wrote:
> From: Dan Williams <dan.j.williams@intel.com>
> Date: Sun, 23 Oct 2011 15:06:24 -0700
> Subject: [PATCH v2] serial/8250_pci: add a quirk for the kt serial controller
>
> Workaround dropped notifications in the iir register. Prevent reads
> coincident with new interrupt notifications by reading the iir at most
> once per interrupt.
>
> Reported-by: Nhan H Mai <nhan.h.mai@intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> Cc: stable <stable@vger.kernel.org>
> ---
> On Tue, 2011-10-25 at 04:28 +0200, Greg KH wrote:
> On Sun, Oct 23, 2011 at 03:27:16PM -0700, Dan Williams wrote:
> > > --- a/include/linux/pci_ids.h
> > > +++ b/include/linux/pci_ids.h
> [..]
> > Based on the comment at the top of this file, you shouldn't add this
> > entry to it.
> >
> > Care to redo the patch without that change?
>
> Ok, moved it to drivers/tty/serial/8250_pci.c and cleaned up the
> conflicting "/* This should be in linux/pci_ids.h */" comment.
This doesn't apply to the 3.2-rc1 kernel at all:
patching file drivers/tty/serial/8250.c
Hunk #1 FAILED at 1652.
1 out of 1 hunk FAILED -- saving rejects to file drivers/tty/serial/8250.c.rej
patching file drivers/tty/serial/8250_pci.c
Hunk #2 succeeded at 1118 with fuzz 1 (offset 9 lines).
Hunk #3 succeeded at 1143 (offset 9 lines).
Hunk #4 succeeded at 1228 (offset 9 lines).
patching file include/linux/serial_core.h
Hunk #1 FAILED at 350.
1 out of 1 hunk FAILED -- saving rejects to file include/linux/serial_core.h.rej
patching file drivers/tty/serial/8250.c
Hunk #1 FAILED at 1652.
1 out of 1 hunk FAILED -- saving rejects to file drivers/tty/serial/8250.c.rej
patching file drivers/tty/serial/8250_pci.c
Hunk #2 succeeded at 1118 with fuzz 1 (offset 9 lines).
Hunk #3 succeeded at 1143 (offset 9 lines).
Hunk #4 succeeded at 1228 (offset 9 lines).
patching file include/linux/serial_core.h
Hunk #1 FAILED at 350.
1 out of 1 hunk FAILED -- saving rejects to file include/linux/serial_core.h.rej
Care to fix it up and resend it?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-11-15 19:20 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-23 22:27 [PATCH] serial/8250_pci: add a quirk for the kt serial controller Dan Williams
2011-10-25 2:28 ` Greg KH
2011-10-25 20:16 ` Dan Williams
2011-10-25 20:51 ` Greg KH
2011-10-25 22:52 ` Williams, Dan J
2011-11-03 16:34 ` Williams, Dan J
2011-11-15 19:18 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).