* PATCH to fix bug: "serial" does not show up in /proc/interrupts
@ 2001-08-02 3:20 Thomas Hood
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Hood @ 2001-08-02 3:20 UTC (permalink / raw)
To: linux-serial, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2415 bytes --]
Here is a patch to fix the serial driver so that its name
appears in /proc/interrupts. The bug was caused by code
that was overwriting the string literal "serial" with "".
gcc merges all the "serial" strings together into one, so
the "serial" sent to irq_request() was being ""ed as a
side-effect.
Here is the patch to 2.4.7-ac3 both inline and attached.
// Thomas Hood <jdthood_AT_yahoo.co.uk>
--- serial.c_ORIG Wed Aug 1 23:02:09 2001
+++ serial.c Wed Aug 1 23:11:01 2001
@@ -4852,10 +4852,13 @@
MODULE_DEVICE_TABLE(pci, serial_pci_tbl);
+/* serial_pci_driver_name[] gets truncated to "" if the pci probe fails */
+static char serial_pci_driver_name[] = "serial";
+
static struct pci_driver serial_pci_driver = {
- name: "serial",
+ name: serial_pci_driver_name,
probe: serial_init_one,
- remove: serial_remove_one,
+ remove: serial_remove_one,
id_table: serial_pci_tbl,
};
I wrote:
> I noticed the following anomaly. I am using a modular serial
> driver for /dev/ttyS0 and /dev/ttyS1 (actually /dev/tts/0 and
> /dev/tts/1 under devfs). See the listing of my /proc/interrupts
> below. I have /dev/ttyS1 open; it uses IRQ3; but note that the
> name of the serial driver is not printed in the list.
>
> root@thanatos:~# cat /proc/interrupts
> CPU0
> 0: 65078 XT-PIC timer
> 1: 1546 XT-PIC keyboard
> 2: 0 XT-PIC cascade
> 3: 1979 XT-PIC
> 5: 3324 XT-PIC CS4231
> 8: 1 XT-PIC rtc
> 10: 27 XT-PIC mwave_3780i
> 11: 5021 XT-PIC usb-uhci, Texas Instruments PCI1250, Texas Instruments PCI1250 (#2)
> 12: 3268 XT-PIC PS/2 Mouse
> 14: 8807 XT-PIC ide0
> 15: 4 XT-PIC ide1
> NMI: 0
> ERR: 0
>
> Strange. But it gets stranger. I insert a combination modem/
> ethernet pcmcia card and I get:
>
> 7: 9 XT-PIC xirc2ps_cs,
>
> In the past, there was something printed after the comma,
> but now there's just a space. Bizarre.
>
> I was not able to find any silly bugs in the serial driver
> or irq routines that would account for this, so I am worried
> that something is very wrong somewhere.
>
> --
> Thomas Hood
> jdthood_AT_yahoo.co.uk
>
[-- Attachment #2: toms-serial-patch-20010801-1 --]
[-- Type: text/plain, Size: 583 bytes --]
--- serial.c_ORIG Wed Aug 1 23:02:09 2001
+++ serial.c Wed Aug 1 23:11:01 2001
@@ -4852,10 +4852,13 @@
MODULE_DEVICE_TABLE(pci, serial_pci_tbl);
+/* serial_pci_driver_name[] gets truncated to "" if the pci probe fails */
+static char serial_pci_driver_name[] = "serial";
+
static struct pci_driver serial_pci_driver = {
- name: "serial",
+ name: serial_pci_driver_name,
probe: serial_init_one,
- remove: serial_remove_one,
+ remove: serial_remove_one,
id_table: serial_pci_tbl,
};
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: PATCH to fix bug: "serial" does not show up in /proc/interrupts
@ 2001-08-02 3:46 Thomas Hood
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Hood @ 2001-08-02 3:46 UTC (permalink / raw)
To: linux-serial, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]
Sorry ... here is the same patch but with the diff done
from the parent of the code hierarchy.
---------------------------------------------------
--- linux-2.4.7-ac3/drivers/char/serial.c_ORIG Wed Aug 1 23:02:09 2001
+++ linux-2.4.7-ac3/drivers/char/serial.c Wed Aug 1 23:11:01 2001
@@ -4852,10 +4852,13 @@
MODULE_DEVICE_TABLE(pci, serial_pci_tbl);
+/* serial_pci_driver_name[] gets truncated to "" if the pci probe fails */
+static char serial_pci_driver_name[] = "serial";
+
static struct pci_driver serial_pci_driver = {
- name: "serial",
+ name: serial_pci_driver_name,
probe: serial_init_one,
- remove: serial_remove_one,
+ remove: serial_remove_one,
id_table: serial_pci_tbl,
};
---------------------------------------------------
> Here is a patch to fix the serial driver so that its name
> appears in /proc/interrupts. The bug was caused by code
> that was overwriting the string literal "serial" with "".
> gcc merges all the "serial" strings together into one, so
> the "serial" sent to irq_request() was being ""ed as a
> side-effect.
>
> Here is the patch to 2.4.7-ac3 both inline and attached.
> // Thomas Hood <jdthood_AT_yahoo.co.uk>
[-- Attachment #2: toms-serial-patch-20010801-2 --]
[-- Type: text/plain, Size: 641 bytes --]
--- linux-2.4.7-ac3/drivers/char/serial.c_ORIG Wed Aug 1 23:02:09 2001
+++ linux-2.4.7-ac3/drivers/char/serial.c Wed Aug 1 23:11:01 2001
@@ -4852,10 +4852,13 @@
MODULE_DEVICE_TABLE(pci, serial_pci_tbl);
+/* serial_pci_driver_name[] gets truncated to "" if the pci probe fails */
+static char serial_pci_driver_name[] = "serial";
+
static struct pci_driver serial_pci_driver = {
- name: "serial",
+ name: serial_pci_driver_name,
probe: serial_init_one,
- remove: serial_remove_one,
+ remove: serial_remove_one,
id_table: serial_pci_tbl,
};
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-08-02 3:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-02 3:20 PATCH to fix bug: "serial" does not show up in /proc/interrupts Thomas Hood
2001-08-02 3:46 Thomas Hood
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).