Skip to content

Parallel port write through character file fails occasionally with "write error: Operation not permitted" #5

@spinlockirqsave

Description

@spinlockirqsave

Parallel port write fails occasionally, succeeds always on next write.

root@debian1:/ldd3-samples/short# echo -n "0" > /dev/short0
bash: echo: write error: Operation not permitted
root@debian1:/ldd3-samples/short# echo -n "0" > /dev/short0
root@debian1:/ldd3-samples/short# echo -n "0" > /dev/short0

[ 3749.614133] short: init, req region OK
[ 3749.614528] short: init registered irq [7]
[ 3749.614534] short: init, irq [7] base [888] use_mem [0] major [250] probe [0] share [0]
[ 3774.100000] short: cleanup
[ 3840.883497] short: init, req region OK
[ 3840.883623] short: init registered irq [7]
[ 3840.883625] short: init, irq [7] base [53248] use_mem [0] major [250] probe [0] share [0]
[ 4145.343071] short: do_short_write value error
[ 4149.304409] short: write, val [1], port [53248]
[ 4165.372757] short: do_short_write value error
[ 4167.002722] short: write, val [2], port [53248]

Fix
if (kstrtouint(kbuf, 10, &val) != 0 || val > 255) {

  •  printk("short: do_short_write value error\n");
    
  •  return -1;
    
  • }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions