# lirc_serial not working with new udev [SOLVED]

## glowwormy

Hi,

It seems like the upgrade to udev-103 made my lirc setup stop working. I'm using the lirc_serial driver which occupies a serial port. Normally the lirc_serial kernel module would be loaded before the serial driver (8250 & 8250_pnp) via modules.autoload, occupy the right serial port and then coldplug loaded the serial driver itself. But now udev discovers the serial port _before_ the modules from modules.autoload are loaded. This means it occupies all serial ports and the lirc_serial module won't load any more:

```

 * Skipping root filesystem check (fstab's passno == 0) ...  [ ok ]

 * Remounting root filesystem read/write ...  [ ok ]

 * Using /etc/modules.autoload.d/kernel-2.6 as config:

 *   Loading module lirc_serial ...

Failed to load lirc_serial  [ !! ]

 *   Loading module dm-mod ...  [ ok ]

 *   Loading module via-rhine ... [ ok ]

 *   Loading module nvidia ...   [ ok ]

 *   Loading module pcspkr ...  [ ok ]

 *   Loading module ide-cd ...   [ ok ]

 *   Loading module ide-floppy ... [ ok ]

 *   Loading module rtc ...  [ ok ]

```

dmesg show the following error:

```

parport: PnPBIOS parport detected.

parport0: PC-style at 0x378 (0x778), irq 7, dma 3 [PCSPP,TRISTATE,COMPAT,ECP,DMA]

Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled

serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

flexcop-pci: will use the HW PID filter.

flexcop-pci: card revision 2

ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 10

PCI: setting IRQ 10 as level-triggered

ACPI: PCI Interrupt 0000:00:0e.0[A] -> Link [LNKB] -> GSI 10 (level, low) -> IRQ 10

DVB: registering new adapter (FlexCop Digital TV device).

b2c2-flexcop: MAC address = 00:d0:d7:0a:a7:8e

b2c2-flexcop: i2c master_xfer failed

usb 2-2: new full speed USB device using uhci_hcd and address 2

00:0a: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

b2c2-flexcop: i2c master_xfer failed

b2c2-flexcop: found the mt352 at i2c address: 0x0f

DVB: registering frontend 0 (Zarlink MT352 DVB-T)...

b2c2-flexcop: initialization of 'Air2PC/AirStar 2 DVB-T' at the 'PCI' bus controlled by a 'FlexCopIIb' complete

ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 11

PCI: setting IRQ 11 as level-triggered

ACPI: PCI Interrupt 0000:00:0a.0[A] -> Link [LNKA] -> GSI 11 (level, low) -> IRQ 11

usb 2-2: configuration #1 chosen from 1 choice

nvidia: module license 'NVIDIA' taints kernel.

usb 3-1: new low speed USB device using uhci_hcd and address 2

hdc: ATAPI 40X CD-ROM CD-R/RW drive, 1456kB Cache, UDMA(33)

Uniform CD-ROM driver Revision: 3.20

hdd: ATAPI 40X DVD-ROM drive, 256kB Cache, UDMA(33)

usb 3-1: configuration #1 chosen from 1 choice

ACPI: PCI Interrupt Link [LNKG] enabled at IRQ 11

ACPI: PCI Interrupt 0000:00:12.0[A] -> Link [LNKG] -> GSI 11 (level, low) -> IRQ 11

eth0: VIA Rhine II at 0xe4800000, 00:11:2f:ae:5e:2d, IRQ 11.

eth0: MII PHY found at address 1, status 0x786d advertising 01e1 Link 41e1.

ACPI: PCI Interrupt 0000:01:00.0[A] -> Link [LNKA] -> GSI 11 (level, low) -> IRQ 11

NVRM: loading NVIDIA UNIX x86 Kernel Module  1.0-9742  Tue Nov  7 09:47:54 PST 2006

Bluetooth: Core ver 2.10

NET: Registered protocol family 31

Bluetooth: HCI device and connection manager initialized

Bluetooth: HCI socket layer initialized

Bluetooth: HCI USB driver ver 2.9

usbcore: registered new driver hci_usb

input: Microsoft Microsoft Wheel Mouse Optical as /class/input/input2

input: USB HID v1.00 Mouse [Microsoft Microsoft Wheel Mouse Optical] on usb-0000:00:10.1-1

usbcore: registered new driver usbhid

drivers/usb/input/hid-core.c: v2.6:USB HID core driver

lirc_dev: IR Remote Control driver registered, at major 61

lirc_serial: port 03f8 already in use

lirc_serial: use 'setserial /dev/ttySX uart none'

lirc_serial: or compile the serial port driver as module and

lirc_serial: make sure this module is loaded first

```

After booting lirc_serial works again if I do

```

rmmod 8250_pnp

rmmod 8250

modprobe lirc_serial

modprobe 8250_pnp

```

So how can I prevent the serial module from being loaded first?Last edited by glowwormy on Thu Nov 30, 2006 3:36 pm; edited 1 time in total

----------

## koan

Have a look in

/etc/modules.d/lirc

There is a "preload" section you can use to setserial the uirt of the serial port you have reserved for lirc to "none".

Alternatively, reconfigure the kernel to only load a single serial port (assuming your real serial comes first) or even zero if you don't need one.

----------

## stuffi

Hello,

I experienced the same problem and came to the following solution:

- remove lirc-serial from /etc/modules.autoload.d/kernel-2.6

- edit /etc/init.d/lircd:

```

depend() {

        need serial

}

start() {

        ebegin "Starting lircd"

        einfo "modprobe lirc_serial"

        /sbin/modprobe lirc_serial

        einfo "lircd"

        start-stop-daemon --start --quiet --exec /usr/sbin/lircd -- ${LIRCD_OPTS}

        eend $?

}

stop() {

        ebegin "Stopping lircd"

        einfo "lircd"

        start-stop-daemon --stop --quiet --exec /usr/sbin/lircd

        einfo "rmmod lirc_serial"

        /sbin/rmmod lirc_serial

        eend $?

}

```

That will let lircd wait until serial finishes (the settings in /etc/serial.conf coming into effect) and load the module immediately before the demon.

For me it works.

I found this at http://www.vdr-wiki.de/wiki/index.php/Gentoo_LIRC (german).

----------

## glowwormy

Thanks for your answers. For me the following solution works:

emerge setserial

And then uncomment the line

```
pre-install lirc_serial setserial /dev/ttyS0 uart none
```

in /etc/modules.d/lirc

I did't have to change anything in /etc/init.d/lirc nor did I have to remove lirc_serial from modules.autoload.de

Best Regards

----------

