Menu ▾ ▴

#410 Parport driver does not unload correctly

future-release
closed-fixed
nobody
None
1
2015-01-06
2015-01-03
No

The parport driver does not close down or unload correctly resulting in the system having to be restarted after each run of the RIP for 2.8.0pre or 2.7.

This was an occasional issue in the past but it seems that it has become a permanent fixture now as I have tested this on several machines with both the onboard port as well as the PCI ports

The common error is the the port is busy or unavailable. It does load on the first run though but not again without restarting the system.

Discussion

  • Sebastian Kuzminsky

    What distro are you using, ie what's the output of "lsb_release -a"?

    What kernel are you using, ie what's the output of "uname -a"?

    What arguments do you give to configure when you compile your RIP?

    What config are you loading? Please attach to this bug.

     
  • Marius Liebenberg

    Distributor ID: Ubuntu
    Description: Ubuntu 10.04.4 LTS
    Release: 10.04
    Codename: lucid

    Linux cnc-dev 2.6.32-122-rtai #rtai SMP Tue Jul 27 12:44:07 CDT 2010 i686 GNU/Linux

    No arguments given I just do
    ./autogen
    ./configure
    make
    sudo make setuid

    I did a standard stepper config from stepconf but this happens with any config I load on various machines

    NOTE:
    This does not happen on the stable/production release.

    Piece of one of the config HAL's

    loadrt trivkins
    loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
    loadrt probe_parport
    loadrt hal_parport cfg="0xef00 out"
    setp parport.0.reset-time 1000
    loadrt stepgen step_type=0,0,0
    loadrt pwmgen output_type=1

    addf parport.0.read base-thread
    addf stepgen.make-pulses base-thread
    addf pwmgen.make-pulses base-thread
    addf parport.0.write base-thread
    addf parport.0.reset base-thread

     
  • Sebastian Kuzminsky

    Oh! Also, reboot the machine, then run "dmesg -c" to clear the dmesg buffer, then start linuxcnc once to show it working, then restart linuxcnc to show it failing, then run "dmesg" to capture all the kernel messages and attach that to this bug.

     
  • Sebastian Kuzminsky

    I can't reproduce this on my Lucid/RTAI machine here.

    I built 2.7 for RTAI, for run-in-place. I have started and stopped the sample config 'by_interface/parport/stepper/stepper_inch.ini' many times, and it has worked every time.

    Attach the linuxcnc_print.txt and linuxcnc_debug.txt files after the initial, successful run and after a subsequent failed run.

    Also get your machine into the state where you can't load linuxcnc, and see what lsmod says.

     
  • Sebastian Kuzminsky

    Thanks for all that info, it's helpful.

    In the startups shown in the dmesg, you first load hal_parport with cfg="0x378" which works, then with cfg="0xef00" which works, then with cfg="0xef00" again and that fails.

    It looks like the io port resources are allocated but not returned to the system for some reason.

    What happens if you try to load with cfg="0x378" twice in a row?

    After you load with cfg="0xef00" and then quit linuxcnc, what does /proc/ioports say?

    I wonder if it's the trailing spaces in your cfg string that are confusing the parser in hal_parport, try removing them.

     
  • Marius Liebenberg

    Seb
    The 378 config was another test but I did as you asked and loaded the config with 0x378. The problem is still the same and I made sure that there was no space in the config string.
    It will load once for any parport so what you see is the 378 loaded and then I tested the ef00 and it loaded but not the second time.

    I attached the info

     
  • Marius Liebenberg

    Seb I downloaded the 2.7 as you suggested but when I was about to install it said that it will break my current installation. I have to many things I am working on at this time on my dev machine so I am reluctant to break it.

    I have another machine for a customer that will be arriving soon. I have to install and configure the XHC-HB04 and I will test the 2.7 on there. Although as I recall I had this problem on 2.7 as well.

     
  • Sebastian Kuzminsky

    I just reproduced your error, i think.

    I forced the unloading of parport_pc, which i noticed is not in your lsmod output above. Do you perhaps have a config file in /etc/modprobe.d that prevents parport_pc from being loaded? From an old linuxcnc or emc2 debian package perhaps? That's no longer needed, but apparently it's a bug in the linuxcnc hal_parport driver if the parport_pc module is not loaded.

     
  • Sebastian Kuzminsky

    I just pushed commit e1f0c96 to 2.7, which fixes the issue for me.

     
  • Marius Liebenberg

    Sorry I had to fix the formatting. Message in next post.

     

    Last edit: Marius Liebenberg 2015-01-06
  • Marius Liebenberg

    Seb
    These are the files in modprobe.d

    -rw-r--r-- 1 root root 2386 2010-01-29 02:01 alsa-base.conf
    -rw-r--r-- 1 root root 325 2010-04-14 06:26 blacklist-ath_pci.conf
    -rw-r--r-- 1 root root 1603 2010-04-14 06:26 blacklist.conf
    -rw-r--r-- 1 root root 213 2010-04-14 06:26 blacklist-firewire.conf
    -rw-r--r-- 1 root root 660 2010-04-14 06:26 blacklist-framebuffer.conf
    -rw-r--r-- 1 root root 156 2010-01-29 02:01 blacklist-modem.conf
    lrwxrwxrwx 1 root root 41 2014-04-08 14:23 blacklist-oss.conf -> /lib/linux-sound-base/noOSS.modprobe.conf
    -rw-r--r-- 1 root root 1077 2010-04-14 06:26 blacklist-watchdog.conf
    -rw-r--r-- 1 root root 249 2010-07-07 06:32 emc2
    -rw-r--r-- 1 root root 16 2010-01-06 10:12 libpisock9.conf
    -rw-r--r-- 1 root root 249 2012-11-17 19:36 linuxcnc.conf

    contents of the relevant files:

    emc2:
    # Remove the '#' before 'install' below to prevent regular Linux programs
    # from accessing the parallel port. This also means that the linux
    # parport number may not be used to identify the port in loadrt hal_parport.
    #install parport_pc /bin/true

    linuxcnc.conf:
    # Remove the '#' before 'install' below to prevent regular Linux programs
    # from accessing the parallel port. This also means that the linux
    # parport number may not be used to identify the port in loadrt hal_parport.
    #install parport_pc /bin/true

     
  • pkm

    pkm - 2015-01-06

    Guy on a russian forum just reported that serport.ko doesn't unload correctly in 2.7 or master.
    He says that serport.ko from 2.5.4 works normally.
    Might be relevant to the parport issue.

     
  • Sebastian Kuzminsky

    pkm: commit e1f0c96 in 2.7 should fix that issue too. Version v2.7.0-pre2-253-ge1f0c96 if you're using buildbot debs.

     

    Last edit: Sebastian Kuzminsky 2015-01-06
  • Marius Liebenberg

    Seb
    How about master?
    Did you have a look at my config files? Are they correct?

     
  • Sebastian Kuzminsky

    Marius: I just merged it to master, it'll be in version v2.8.0-pre1-294-g99e6bc9 from the buildbot (commit 99e6bc9).

    I did not see a link to your config files anywhere. But if you had config files that work with 2.6, i bet they'll work with 2.7 after commit e1f0c96 (at least the hal_parport parts).

     
  • Marius Liebenberg

    Seb
    The files in modprobe.d that you asked about. 5 posts up.

     
  • Sebastian Kuzminsky

    Ah, the modprobe config files, sure, those look fine. It's strange though that your parport_pc isn't getting loaded. Any idea why that is?

    Does the current tip of 2.7 or master work for you now? Start with a fresh boot and load each linuxcnc ini file twice, all should work.

     
  • Marius Liebenberg

    Seb
    If we were not separated by the world, I would insist that I get you a beer immediately.

    Thanks man this bug frustrated me for a very long time. It seems to be working just fine.

     
  • Sebastian Kuzminsky

    Yay! You're welcome :-)

    Thanks for the bug report and all the detailed debugging info. Sounds like at least one other person was affected by this issue too, so you helped them as well.

     
  • Sebastian Kuzminsky

    • status: open --> closed-fixed