Menu

#415 hal_parport.ko not loading in 2.7

2.7
open
nobody
None
1
2015-02-21
2015-02-16
PhillC54
No

I recently upgraded to LinuxCNC 2.7.0-pre2 and ran into the following problem:

I have an onboard parallel port @ 0x378 and a PCI parallel port @ 0xDE00.

After a boot the first run of LCNC using either port operates correctly and each subsequent run using the onboard port runs correctly, however each subsequent run using the PCI port results in the following error:
Error: could not insert module /usr/realtime-3.4-9-rtai-686-pae/modules/linuxcnc/hal_parport.ko: Device or resource busy

I found this previous post https://www.mail-archive.com/emc-users@lists.sourceforge.net/msg52880.html so I changed the script to suit my ports and found the following:

Using the onboard port no problems were encountered on either the first run after a boot or any subsequent runs.

Using the PCI port the first run after a boot was OK but each subsequent run caused the same error as above.

I removed 2.7 then installed 2.6 and no problems were encountered so I removed 2.6 and installed 2.7 and encountered the same situation as above.

contents of pp.hal:

loadrt hal_parport cfg="0xDE00 out"
loadrt threads period1=1000000
loadrt not
net x not.0.out => not.0.in parport.0.pin-01-out
addf not.0 thread1
addf parport.0.write thread1
start

machine rebooted:

phill@lcnc:~$ cd testing
phill@lcnc:~/testing$ halrun pp.hal
.
phill@lcnc:~/testing$ halrun pp.hal
.
Error: could not insert module /usr/realtime-3.4-9-rtai-686-pae/modules/linuxcnc/hal_parport.ko: Device or resource busy
pp2.hal:1: exit value: 1
pp2.hal:1: insmod failed, returned -1
See the output of 'dmesg' for more information.
phill@lcnc:~$ cd testing

phill@lcnc:~$ uname -a
Linux lcnc 3.4-9-rtai-686-pae #1 SMP PREEMPT Debian 3.4.55-4linuxcnc i686 GNU/Linux

(I forgot to copy dmesg, if it is required I can post it as this problem is consistent)

Discussion

  • Sebastian Kuzminsky

    I bet you've run in to this bug

    https://sourceforge.net/p/emc/bugs/410/
    

    It was fixed in v2.7.0-pre2-253-ge1f0c96, and the fix will be in
    2.7.0~pre3 when it comes out.

    Your options are to grab a newer 2.7 deb from the buildbot, or wait for
    the 2.7.0~pre3 release, or use the workaround.

    The workaround is to replace the I/O addresses in your "loadrt
    hal_parport" line with the linux (not linuxcnc!) parport number. You
    can find this number by looking in the dmesg. Here's what i get on one
    of my machines:

    [    9.986373] parport_pc 00:05: reported by Plug and Play ACPI
    [    9.986677] parport0: PC-style at 0x378, irq 7 [PCSPP,TRISTATE]
    [   10.085354] parport1: PC-style at 0x278 [PCSPP,TRISTATE]
    

    If i wanted to use the parport at 0x378, i would say:

    loadrt hal_parport cfg="0 out"

    If i wanted to use the parport at 0x278, i would say:

    loadrt hal_parport cfg="1 out"

    Oh, and you have to make sure the module called "parport_pc" is loaded
    (it normally is, but some people disable it out of habit because we used
    to require that, a long time ago).

     
    • PhillC54

      PhillC54 - 2015-02-16

      Thanks, unfortunately the PCI port doesn't show up as a linux parport:

      phill@lcnc:~$ lsmod | grep parport
      parport_pc 21896 1
      parport 35208 3 lp,ppdev,parport_pc

      phill@lcnc:~$ dmesg | grep parport
      [ 9.824661] parport_pc 00:08: reported by Plug and Play ACPI
      [ 9.824702] parport0: PC-style at 0x378, irq 7 [PCSPP,TRISTATE,EPP]
      [ 19.673137] lp0: using parport0 (interrupt-driven).

      I'll give the buildbot version a try.

       
  • Sebastian Kuzminsky

    PhilC54, can you confirm that this is fixed for you now?

     
MongoDB Logo MongoDB