xen/25866-sercon-ns16550-pci-irq.patch
Charles Arnold 17854f1c81 - Upstream patches from Jan
25833-32on64-bogus-pt_base-adjust.patch                                                                                                                
  25835-adjust-rcu-lock-domain.patch                                                                                                                     
  25836-VT-d-S3-MSI-resume.patch                                                                                                                         
  25850-tmem-xsa-15-1.patch                                                                                                                              
  25851-tmem-xsa-15-2.patch                                                                                                                              
  25852-tmem-xsa-15-3.patch                                                                                                                              
  25853-tmem-xsa-15-4.patch                                                                                                                              
  25854-tmem-xsa-15-5.patch                                                                                                                              
  25855-tmem-xsa-15-6.patch                                                                                                                              
  25856-tmem-xsa-15-7.patch                                                                                                                              
  25857-tmem-xsa-15-8.patch                                                                                                                              
  25858-tmem-xsa-15-9.patch                                                                                                                              
  25859-tmem-missing-break.patch                                                                                                                         
  25860-tmem-cleanup.patch                                                                                                                               
  25861-x86-early-fixmap.patch                                                                                                                           
  25862-sercon-non-com.patch                                                                                                                             
  25863-sercon-ehci-dbgp.patch                                                                                                                           
  25864-sercon-unused.patch                                                                                                                              
  25866-sercon-ns16550-pci-irq.patch                                                                                                                     
  25867-sercon-ns16550-parse.patch                                                                                                                       
  25874-x86-EFI-chain-cfg.patch                                                                                                                          
  25909-xenpm-consistent.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=201
2012-09-21 14:45:08 +00:00

57 lines
2.1 KiB
Diff

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347371733 -7200
# Node ID ee12dc357fbecbb0517798f395d14bf1764c6766
# Parent 5fb5b3b70e34ef278d06aff27878b4b8e6d9145f
ns16550: PCI initialization adjustments
Besides single-port serial cards, also accept multi-port ones and such
providing mixed functionality (e.g. also having a parallel port).
Reading PCI_INTERRUPT_PIN before ACPI gets enabled generally produces
an incorrect IRQ (below 16, whereas after enabling ACPI it frequently
would end up at a higher one), so this is useful (almost) only when a
system already boots in ACPI mode.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -449,7 +449,6 @@ static int __init check_existence(struct
static int
pci_uart_config (struct ns16550 *uart, int skip_amt, int bar_idx)
{
- uint16_t class;
uint32_t bar, len;
int b, d, f;
@@ -460,9 +459,15 @@ pci_uart_config (struct ns16550 *uart, i
{
for ( f = 0; f < 0x8; f++ )
{
- class = pci_conf_read16(0, b, d, f, PCI_CLASS_DEVICE);
- if ( class != 0x700 )
+ switch ( pci_conf_read16(0, b, d, f, PCI_CLASS_DEVICE) )
+ {
+ case 0x0700: /* single port serial */
+ case 0x0702: /* multi port serial */
+ case 0x0780: /* other (e.g serial+parallel) */
+ break;
+ default:
continue;
+ }
bar = pci_conf_read32(0, b, d, f,
PCI_BASE_ADDRESS_0 + bar_idx*4);
@@ -485,7 +490,8 @@ pci_uart_config (struct ns16550 *uart, i
uart->bar = bar;
uart->bar_idx = bar_idx;
uart->io_base = bar & 0xfffe;
- uart->irq = 0;
+ uart->irq = pci_conf_read8(0, b, d, f, PCI_INTERRUPT_PIN) ?
+ pci_conf_read8(0, b, d, f, PCI_INTERRUPT_LINE) : 0;
return 0;
}