linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] [PATCH] rtc-cmos PNPBIOS module autoload broken
@ 2008-12-21 23:53 Bryan Kadzban
  2008-12-22  2:29 ` Kay Sievers
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Bryan Kadzban @ 2008-12-21 23:53 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 1523 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Upgraded to kernel 2.6.27.8 about a week ago, along with udev 135.  On
the next boot, rtc-cmos did not load automatically.  Tracked it down to
two related changes: the PNPBIOS "id" shell hack was removed from udev,
and ACPI modaliases were added to the kernel modules.

The problem here is, the kernel hardware IDs have a different case,
while the module aliases in rtc-cmos have the same case.  The PNPBIOS ID
for my RTC is "PNP0b00" (/sys/bus/pnp/devices/00:02/id).  The ACPI ID
for my RTC is "acpi:PNP0B00" (/sys/bus/acpi/devices/PNP0B00:00/modalias).

The module aliases in the rtc-cmos driver, OTOH, are "pnp:dPNP0b00*",
"acpi*:PNP0b00:*", and similar for 0b01 and 0b02.  Obviously this isn't
going to match.

I have a patch to change the kernel's file2alias.c program to convert
the ACPI alias (for PNP device IDs) to uppercase (attached), but I don't
know if this is the right approach.  Are all ACPI IDs uppercase hex
values?  (For that matter, are all PNPBIOS IDs lowercase?)  The other
option would be to change the rtc-cmos driver to match both upper and
lowercase (if both are seen in the wild).

Thoughts?

In case this is the right fix:

Signed-Off-By: Bryan Kadzban <bryan@kadzban.is-a-geek.net>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREDAAYFAklO1uoACgkQYasYN+YI5W5cpwCgnI4/3QOHcsylqrAFoGkud3zT
rJQAn0+WawDS5BcUgSXS7gUxJOWtVoPL
=VuxF
-----END PGP SIGNATURE-----

[-- Attachment #2: file2alias-uppercase-acpi-alias.patch --]
[-- Type: text/plain, Size: 1069 bytes --]

--- scripts/mod/file2alias.c	2008-12-05 12:03:02.000000000 -0800
+++ scripts/mod/file2alias-new.c	2008-12-08 23:21:56.000000000 -0800
@@ -352,11 +352,18 @@
 
 	for (i = 0; i < count; i++) {
 		const char *id = (char *)devs[i].id;
+		char *acpi_id = malloc(strlen(id));
+		int j;
+
+		for(j = 0; id[j]; j++)
+			acpi_id[j] = toupper(id[j]);
 
 		buf_printf(&mod->dev_table_buf,
 			   "MODULE_ALIAS(\"pnp:d%s*\");\n", id);
 		buf_printf(&mod->dev_table_buf,
-			   "MODULE_ALIAS(\"acpi*:%s:*\");\n", id);
+			   "MODULE_ALIAS(\"acpi*:%s:*\");\n", acpi_id);
+
+		free(acpi_id);
 	}
 }
 
@@ -402,10 +409,18 @@
 
 			/* add an individual alias for every device entry */
 			if (!dup) {
+				char *acpi_id = malloc(strlen(id));
+				int i2;
+
+				for(i2 = 0; id[i2]; i2++)
+					acpi_id[i2] = toupper(id[i2]);
+
 				buf_printf(&mod->dev_table_buf,
 					   "MODULE_ALIAS(\"pnp:d%s*\");\n", id);
 				buf_printf(&mod->dev_table_buf,
-					   "MODULE_ALIAS(\"acpi*:%s:*\");\n", id);
+					   "MODULE_ALIAS(\"acpi*:%s:*\");\n", acpi_id);
+
+				free(acpi_id);
 			}
 		}
 	}

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-12-23  4:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-21 23:53 [RFC] [PATCH] rtc-cmos PNPBIOS module autoload broken Bryan Kadzban
2008-12-22  2:29 ` Kay Sievers
2008-12-22  6:05 ` Bryan Kadzban
2008-12-22  8:38 ` Matthias Schwarzott
2008-12-22 17:16 ` Bryan Kadzban
2008-12-23  4:11 ` Kay Sievers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).