* [PATCH] serial: 8250_pci: unbreak last serial ports on NetMos 9865 cards
@ 2014-02-11 10:18 Dmitry Eremin-Solenikov
2014-02-18 11:00 ` Dmitry Eremin-Solenikov
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-02-11 10:18 UTC (permalink / raw)
To: linux-kernel, linux-serial, Greg Kroah-Hartman
Aparently 9865 uses standard BAR encoding scheme (unlike 99xx cards).
Current pci_netmos_9900_setup() uses wrong BAR indices for the 9865 PCI
device, function 2. Using standard BAR indices makes all 6 ports work
for me. Thus disable the NetMos 9900 quirk for NetMos 9865 pci device.
For the reference, here is the relevant part of lspci for my device:
02:07.0 Serial controller: MosChip Semiconductor Technology Ltd. PCI
9865 Multi-I/O Controller (prog-if 02 [16550])
Subsystem: Device a000:1000
Flags: bus master, medium devsel, latency 32, IRQ 17
I/O ports at ac00 [size=8]
Memory at fcfff000 (32-bit, non-prefetchable) [size=4K]
Memory at fcffe000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [48] Power Management version 2
Kernel driver in use: serial
02:07.1 Serial controller: MosChip Semiconductor Technology Ltd. PCI
9865 Multi-I/O Controller (prog-if 02 [16550])
Subsystem: Device a000:1000
Flags: bus master, medium devsel, latency 32, IRQ 18
I/O ports at a800 [size=8]
Memory at fcffd000 (32-bit, non-prefetchable) [size=4K]
Memory at fcffc000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [48] Power Management version 2
Kernel driver in use: serial
02:07.2 Communication controller: MosChip Semiconductor Technology Ltd.
PCI 9865 Multi-I/O Controller
Subsystem: Device a000:3004
Flags: bus master, medium devsel, latency 32, IRQ 19
I/O ports at a400 [size=8]
I/O ports at a000 [size=8]
I/O ports at 9c00 [size=8]
I/O ports at 9800 [size=8]
Memory at fcffb000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [48] Power Management version 2
Kernel driver in use: serial
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
drivers/tty/serial/8250/8250_pci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 4697a51..143a381 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -784,7 +784,8 @@ static int pci_netmos_9900_setup(struct serial_private *priv,
{
unsigned int bar;
- if ((priv->dev->subsystem_device & 0xff00) == 0x3000) {
+ if ((priv->dev->device != PCI_DEVICE_ID_NETMOS_9865) &&
+ (priv->dev->subsystem_device & 0xff00) == 0x3000) {
/* netmos apparently orders BARs by datasheet layout, so serial
* ports get BARs 0 and 3 (or 1 and 4 for memmapped)
*/
--
1.8.5.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] serial: 8250_pci: unbreak last serial ports on NetMos 9865 cards
2014-02-11 10:18 [PATCH] serial: 8250_pci: unbreak last serial ports on NetMos 9865 cards Dmitry Eremin-Solenikov
@ 2014-02-18 11:00 ` Dmitry Eremin-Solenikov
2014-02-18 11:05 ` Dmitry Eremin-Solenikov
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-02-18 11:00 UTC (permalink / raw)
To: kernel list, linux-serial, Greg Kroah-Hartman
Hello,
On Tue, Feb 11, 2014 at 2:18 PM, Dmitry Eremin-Solenikov
<dbaryshkov@gmail.com> wrote:
> Aparently 9865 uses standard BAR encoding scheme (unlike 99xx cards).
> Current pci_netmos_9900_setup() uses wrong BAR indices for the 9865 PCI
> device, function 2. Using standard BAR indices makes all 6 ports work
> for me. Thus disable the NetMos 9900 quirk for NetMos 9865 pci device.
Do you need any additional details for the patch?
[skipped lspci]
>
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
> drivers/tty/serial/8250/8250_pci.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
> index 4697a51..143a381 100644
> --- a/drivers/tty/serial/8250/8250_pci.c
> +++ b/drivers/tty/serial/8250/8250_pci.c
> @@ -784,7 +784,8 @@ static int pci_netmos_9900_setup(struct serial_private *priv,
> {
> unsigned int bar;
>
> - if ((priv->dev->subsystem_device & 0xff00) == 0x3000) {
> + if ((priv->dev->device != PCI_DEVICE_ID_NETMOS_9865) &&
> + (priv->dev->subsystem_device & 0xff00) == 0x3000) {
> /* netmos apparently orders BARs by datasheet layout, so serial
> * ports get BARs 0 and 3 (or 1 and 4 for memmapped)
> */
> --
> 1.8.5.2
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] serial: 8250_pci: unbreak last serial ports on NetMos 9865 cards
2014-02-18 11:00 ` Dmitry Eremin-Solenikov
@ 2014-02-18 11:05 ` Dmitry Eremin-Solenikov
0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-02-18 11:05 UTC (permalink / raw)
To: kernel list, linux-serial, Greg Kroah-Hartman
On Tue, Feb 18, 2014 at 3:00 PM, Dmitry Eremin-Solenikov
<dbaryshkov@gmail.com> wrote:
> Hello,
>
> On Tue, Feb 11, 2014 at 2:18 PM, Dmitry Eremin-Solenikov
> <dbaryshkov@gmail.com> wrote:
>> Aparently 9865 uses standard BAR encoding scheme (unlike 99xx cards).
>> Current pci_netmos_9900_setup() uses wrong BAR indices for the 9865 PCI
>> device, function 2. Using standard BAR indices makes all 6 ports work
>> for me. Thus disable the NetMos 9900 quirk for NetMos 9865 pci device.
>
> Do you need any additional details for the patch?
Sorry for the noise, I missed that you have it in -fixes. Please excuse me.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-18 11:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-11 10:18 [PATCH] serial: 8250_pci: unbreak last serial ports on NetMos 9865 cards Dmitry Eremin-Solenikov
2014-02-18 11:00 ` Dmitry Eremin-Solenikov
2014-02-18 11:05 ` Dmitry Eremin-Solenikov
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).