From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 6/8] ns16550: PCI initialization adjustments
Date: Tue, 11 Sep 2012 14:14:40 -0400 [thread overview]
Message-ID: <20120911181439.GA30767@phenom.dumpdata.com> (raw)
In-Reply-To: <504F2C54020000780009A830@nat28.tlf.novell.com>
On Tue, Sep 11, 2012 at 11:19:32AM +0100, Jan Beulich wrote:
> 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>
>
> --- a/xen/drivers/char/ns16550.c
> +++ b/xen/drivers/char/ns16550.c
> @@ -468,7 +468,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;
>
> @@ -479,9 +478,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);
> @@ -504,7 +509,9 @@ pci_uart_config (struct ns16550 *uart, i
> uart->bar = bar;
> uart->bar_idx = bar_idx;
> uart->io_base = bar & ~PCI_BASE_ADDRESS_SPACE_IO;
> - 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;
> +printk("COM%d: BAR=%04x IRQ=%d\n", bar_idx + 1, bar, uart->irq);//temp
printk ?
>
> return 0;
> }
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
next prev parent reply other threads:[~2012-09-11 18:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-11 10:19 [PATCH 6/8] ns16550: PCI initialization adjustments Jan Beulich
2012-09-11 18:14 ` Konrad Rzeszutek Wilk [this message]
2012-09-12 7:39 ` Jan Beulich
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=20120911181439.GA30767@phenom.dumpdata.com \
--to=konrad@kernel.org \
--cc=JBeulich@suse.com \
--cc=xen-devel@lists.xen.org \
/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.