From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: serial legacy ports and ACPI
Date: Wed, 30 Jul 2003 23:09:20 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105960674707701@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105761215001812@msgid-missing>
On Monday 07 July 2003 3:05 pm, Jes Sorensen wrote:
> I am trying to come up with a solution to tell the serial driver to not
> try and probe for serial ports on legacy IO addresses. While the current
> code seems to work on SN2 it's a bit of a pain on systems which do not
> come with a stack of 16550's glued to the motherboard.
>
> Looking at the ACPI spec, it seems reasonable to me to disable this
> probe if the FADT doesn't have the BAF_LEGACY_DEVICES bit set. Anyone
> having oppinions on this?
I like the idea of this, but
1) You might pass it by the ACPI folks to make sure this is the
intent of the spec (sure looks reasonable to me, though).
2) I don't really like the implementation in the sense that
a) The spec suggests that LEGACY_DEVICES might also cover
things other than serial ports, i.e., a legacy LPT port,
so:
b) I think the check should go in arch/.../acpi.c. We did
something similar for keyboard detection (see acpi_kbd_controller_present),
and I think it worked out pretty well.
Bjorn
> I am proposing the below patch to solve the problem (relative to
> 2.4.20). It works for me on SN2, but I don't know what other platforms
> set in their FADT.
>
> Cheers,
> Jes
>
> --- ../old/drivers/char/serial.c Fri Jul 4 16:10:30 2003
> +++ drivers/char/serial.c Mon Jul 7 13:07:29 2003
> @@ -230,6 +230,9 @@
> #ifdef CONFIG_MAGIC_SYSRQ
> #include <linux/sysrq.h>
> #endif
> +#ifdef CONFIG_ACPI
> +#include <linux/acpi.h>
> +#endif
>
> /*
> * All of the compatibilty code so we can compile serial.c against
> @@ -5524,6 +5527,10 @@
> {
> int i;
> struct serial_state * state;
> +#ifdef CONFIG_ACPI
> + acpi_buffer acpi_buf;
> + unsigned int acpi_status;
> +#endif
>
> init_bh(SERIAL_BH, do_serial_bh);
> init_timer(&serial_timer);
> @@ -5624,7 +5631,24 @@
> panic("Couldn't register serial driver\n");
> if (tty_register_driver(&callout_driver))
> panic("Couldn't register callout driver\n");
> -
> +
> +#ifdef CONFIG_ACPI
> + acpi_buf.pointer = NULL;
> + acpi_buf.length = ACPI_ALLOCATE_BUFFER;
> +
> + acpi_status = acpi_get_table(ACPI_TABLE_FADT, 1, &acpi_buf);
> + if (!acpi_status) {
> + fadt_descriptor_rev2 *fadt;
> + u16 iapc_boot_arch;
> +
> + fadt = acpi_buf.pointer;
> + iapc_boot_arch = fadt->iapc_boot_arch;
> + kfree(acpi_buf.pointer);
> +
> + if (!iapc_boot_arch & BAF_LEGACY_DEVICES)
> + goto skip_legacy_probe;
> + }
> +#endif
> for (i = 0, state = rs_table; i < NR_PORTS; i++,state++) {
> state->magic = SSTATE_MAGIC;
> state->line = i;
> @@ -5677,6 +5701,9 @@
> tty_register_devfs(&callout_driver, 0,
> callout_driver.minor_start + state->line);
> }
> +#ifdef CONFIG_ACPI
> + skip_legacy_probe:
> +#endif
> #ifdef CONFIG_SERIAL_GSC
> probe_serial_gsc();
> #endif
> -
next prev parent reply other threads:[~2003-07-30 23:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-07 21:05 serial legacy ports and ACPI Jes Sorensen
2003-07-30 23:09 ` Bjorn Helgaas [this message]
2003-07-31 3:54 ` Jes Sorensen
2003-08-26 16:24 ` Alex Williamson
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=marc-linux-ia64-105960674707701@msgid-missing \
--to=bjorn.helgaas@hp.com \
--cc=linux-ia64@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox