Skip to contentSkip to conversation

x86, serial: always probe for legacy COM ports

PATCH In review Bjorn Helgaas 3 participants 7 messages Jul 27, 2007 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86, serial: always probe for legacy COM ports

Andrew, if you drop
revert-x86-serial-convert-legacy-com-ports-to-platform-devices.patch
and apply this, we should have the previous behavior. I think the conversion to platform devices is still worthwhile. Obviously, I intend this as 2.6.23 material.

Always probe for serial ports at legacy addresses, even if we have PNPBIOS or ACPI that should tell us about those ports.

We have no reports yet of defective firmware that completely omits ports. However, Sébastien Dugué <[email protected]> reported that the NEC Express5800/120Lh with Phoenix BIOS 6.0.5N52, released 7/12/2005, reports COM2 first, then COM1 in the ACPI namespace.

8250_pnp currently registers devices in namespace order. On this machine, that makes ttyS0=COM2 and ttyS1=COM1, the reverse of what we want.

arch/i386/kernel/legacy_serial.c +0 -8
Index: w/arch/i386/kernel/legacy_serial.c
===================================================================
@@ -11,7 +11,6 @@
  */
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/pnp.h>
 #include <linux/serial_8250.h>
 
 /* Standard COM flags (except for COM4, because of the 8514 problem) */
@@ -48,15 +47,8 @@
 	},
 };
 
-static int force_legacy_probe;
-module_param_named(force, force_legacy_probe, bool, 0);
-MODULE_PARM_DESC(force, "Force legacy serial port probe");
-
 static int __init serial8250_x86_com_init(void)
 {
-	if (pnp_platform_devices && !force_legacy_probe)
-		return -ENODEV;
-
 	return platform_device_register(&x86_com_device);
 }
 
Documentation/kernel-parameters.txt +0 -5
Index: w/Documentation/kernel-parameters.txt
===================================================================
@@ -859,11 +859,6 @@
 	lasi=		[HW,SCSI] PARISC LASI driver for the 53c700 chip
 			Format: addr:<io>,irq:<irq>
 
-	legacy_serial.force [HW,IA-32,X86-64]
-			Probe for COM ports at legacy addresses even
-			if PNPBIOS or ACPI should describe them.  This
-			is for working around firmware defects.
-
 	llsc*=		[IA64] See function print_params() in
 			arch/ia64/sn/kernel/llsc4.c.
 
#1 lore raw
Quoted 15 lines · Bjorn Helgaas

Andrew, if you drop
revert-x86-serial-convert-legacy-com-ports-to-platform-devices.patch
and apply this, we should have the previous behavior. I think the conversion to platform devices is still worthwhile. Obviously, I intend this as 2.6.23 material.

Always probe for serial ports at legacy addresses, even if we have PNPBIOS or ACPI that should tell us about those ports.

We have no reports yet of defective firmware that completely omits ports. However, Sébastien Dugué <[email protected]> reported that the NEC Express5800/120Lh with Phoenix BIOS 6.0.5N52, released 7/12/2005, reports COM2 first, then COM1 in the ACPI namespace.

Quoted 4 lines

8250_pnp currently registers devices in namespace order. On this machine, that makes ttyS0=COM2 and ttyS1=COM1, the reverse of what we want.

This is still incomplete, as repeatedly stated. Here is the email, again.

Jeff

Quoted 3 lines · Russell King

So we shouldn't even try to remove the legacy "legacy port" probing in the serial driver like other platforms have done, which this patch minus those bits I mentioned actually achieves?

Move [to a new driver / location in tree]? Sure. As long as there are no probe order issues, module naming issues (I note distinct lack of MODULE_ALIAS for example) or other transitions issues.

Remove? Definitely not.

Even if we apply your suggested solution, updates are still needed:
* fix kernel-parameters.txt

* address transition issues related to module naming. other transition issues? has anybody even given this any thought?

* no apparent module unload support (regression or just a bug?)

* add docs for x86/x86-64 users (or point to docs in the source). Overall this was a highly "stealthy" change over to the new platform driver, without much notice at all. Not optimum, for a popular device on Linux's most popular platform.

I have no complaints about platform_device direction, certainly. But this particular commit was incomplete, poorly described, and broke decade+ behavior.

Jeff

#2 lore raw
Quoted 16 lines · Jeff Garzik
Quoted 15 lines · Bjorn Helgaas

Andrew, if you drop
revert-x86-serial-convert-legacy-com-ports-to-platform-devices.patch
and apply this, we should have the previous behavior. I think the conversion to platform devices is still worthwhile. Obviously, I intend this as 2.6.23 material.

Always probe for serial ports at legacy addresses, even if we have PNPBIOS or ACPI that should tell us about those ports.

We have no reports yet of defective firmware that completely omits ports. However, Sébastien Dugué <[email protected]> reported that the NEC Express5800/120Lh with Phoenix BIOS 6.0.5N52, released 7/12/2005, reports COM2 first, then COM1 in the ACPI namespace.

Quoted 6 lines
Quoted 4 lines

8250_pnp currently registers devices in namespace order. On this machine, that makes ttyS0=COM2 and ttyS1=COM1, the reverse of what we want.

This is still incomplete, as repeatedly stated. Here is the email, again.

OK, uncle! I'll work on your helpful advice (thanks for that), but it feels too risky for this stage of 2.6.23. Maybe I can come up with something for a future release.

Bjorn

#3 lore raw
Quoted 6 lines · Bjorn Helgaas
Quoted 1 line · Jeff Garzik

This is still incomplete, as repeatedly stated. Here is the email, again.

OK, uncle! I'll work on your helpful advice (thanks for that), but it feels too risky for this stage of 2.6.23. Maybe I can come up with something for a future release.

The changeset in the kernel is too risky _without_ the changes I described.

Hence the repeated use of the word "incomplete."

* The patch has transition issues, when you shuffle users from one device driver to another. Existing change should not be deployed without ensuring breakage is unlikely.

* The new driver is missing module unload support. Existing change should not be deployed without this.

* DOCUMENT the user visible changes. Existing change should not be deployed without this.

Jeff

#4 lore raw
Quoted 9 lines · Jeff Garzik
Quoted 6 lines · Bjorn Helgaas
Quoted 1 line · Jeff Garzik

This is still incomplete, as repeatedly stated. Here is the email, again.

OK, uncle! I'll work on your helpful advice (thanks for that), but it feels too risky for this stage of 2.6.23. Maybe I can come up with something for a future release.

The changeset in the kernel is too risky _without_ the changes I described.

That's what I meant. Andrew already has a revert patch in -mm, and the safest path seems like putting the reversion in 2.6.23 and working on your advice post-2.6.23.

Bjorn

#5 lore raw
Quoted 9 lines · On Fri, 27 Jul 2007 14:26:30 -0600 Bjorn Helgaas <[email protected]> wrote:
Quoted 8 lines · Jeff Garzik
Quoted 6 lines · Bjorn Helgaas
Quoted 1 line · Jeff Garzik

This is still incomplete, as repeatedly stated. Here is the email, again.

OK, uncle! I'll work on your helpful advice (thanks for that), but it feels too risky for this stage of 2.6.23. Maybe I can come up with something for a future release.

Quoted 6 lines
Quoted 1 line

The changeset in the kernel is too risky _without_ the changes I described.

That's what I meant. Andrew already has a revert patch in -mm, and the safest path seems like putting the reversion in 2.6.23 and working on your advice post-2.6.23.

ok, thanks, I'll pull that trigger.

#6 lore raw
In reply to Bjorn Helgaas
Quoted 9 lines · Bjorn Helgaas
Quoted 7 lines · Jeff Garzik
Quoted 6 lines · Bjorn Helgaas
Quoted 1 line · Jeff Garzik

This is still incomplete, as repeatedly stated. Here is the email, again.

OK, uncle! I'll work on your helpful advice (thanks for that), but it feels too risky for this stage of 2.6.23. Maybe I can come up with something for a future release.

Quoted 5 lines
Quoted 1 line

The changeset in the kernel is too risky _without_ the changes I described.

That's what I meant. Andrew already has a revert patch in -mm, and the safest path seems like putting the reversion in 2.6.23 and working on your advice post-2.6.23.

Ah, my apologies!

I read "I'll work on your advice, but it feels too risky" as describing my advice as too risky, rather than the changeset currently in the kernel.

IMO the changeset should be resubmitted as two changes, separating the probe behavior changes from the platform driver conversion. They are two distinct changes, and that would allow git-bisect to identify the culprit easily if future breakage occurs.

Jeff