Valmer Huhn c6b9e95dde serial: 8250_exar: Fix number of ports for Commtech PCIe cards
The following in 8250_exar.c line 589 is used to determine the number
of ports for each Exar board:

nr_ports = board->num_ports ? board->num_ports : pcidev->device & 0x0f;

If the number of ports a card has is not explicitly specified, it defaults
to the rightmost 4 bits of the PCI device ID. This is prone to error since
not all PCI device IDs contain a number which corresponds to the number of
ports that card provides.

This particular case involves COMMTECH_4222PCIE, COMMTECH_4224PCIE and
COMMTECH_4228PCIE cards with device IDs 0x0022, 0x0020 and 0x0021.
Currently the multiport cards receive 2, 0 and 1 port instead of 2, 4 and
8 ports respectively.

To fix this, each Commtech Fastcom PCIe card is given a struct where the
number of ports is explicitly specified. This ensures 'board->num_ports'
is used instead of the default 'pcidev->device & 0x0f'.

Fixes: d0aeaa83f0b0 ("serial: exar: split out the exar code from 8250_pci")
Signed-off-by: Valmer Huhn <valmer.huhn@concurrent-rt.com>
Tested-by: Valmer Huhn <valmer.huhn@concurrent-rt.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200813165255.GC345440@icarus.concurrent-rt.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-18 13:27:26 +02:00
..
2020-08-15 08:18:22 -07:00
2020-08-06 18:09:34 -07:00
2020-08-02 18:26:51 +03:00
2020-08-15 20:36:42 -07:00
2020-08-06 10:54:07 -07:00
2020-08-11 11:58:31 +10:00
2020-08-15 08:18:22 -07:00
2020-08-15 08:09:38 -07:00
2020-08-07 10:33:50 -07:00
2020-08-11 14:34:17 -07:00
2020-08-11 10:59:19 -07:00
2020-07-27 11:49:37 +02:00
2020-08-14 16:00:09 -07:00
2020-08-14 13:31:25 -07:00
2020-08-14 16:00:09 -07:00
2020-08-15 08:18:22 -07:00
2020-08-05 19:24:27 -07:00
2020-08-07 10:33:50 -07:00
2020-08-15 20:36:42 -07:00
2020-08-11 14:13:24 -07:00
2020-08-11 14:13:24 -07:00
2020-08-05 13:23:24 -07:00
2020-08-15 08:09:38 -07:00
2020-08-14 19:56:56 -07:00
2020-08-05 11:12:34 -07:00
2020-08-06 10:54:07 -07:00
2020-08-07 18:48:15 -07:00
2020-08-12 12:13:44 -07:00
2020-08-14 16:00:09 -07:00
2020-08-11 11:17:45 -07:00
2020-08-12 17:17:00 -07:00
2020-08-14 16:01:59 -07:00
2020-08-06 14:27:31 -07:00
2020-08-07 18:48:15 -07:00
2020-08-14 16:01:59 -07:00
2020-08-15 08:09:38 -07:00
2020-08-07 13:00:53 -07:00
2020-08-11 14:34:17 -07:00
2020-08-12 12:09:36 -07:00
2020-08-11 14:34:17 -07:00
2020-08-12 12:13:44 -07:00
2020-08-14 13:34:37 -07:00