Re: [libgpiod] gpiod_line_get_value_bulk may be broken?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 6 Aug 2023 at 10:29, Kent Gibson <warthog618@xxxxxxxxx> wrote:

> You can't statically link libgpiod until it is available as a package?

Would that mean merging the gpiod code into our codebase? Or can this
be done some other way?


Anyway, I now have it working, to an extent, but feel that there might
be a problem with gpiod_line_request_bulk_input() and
gpiod_line_request_bulk_output() if the bulk contains more than 5
lines.

My current code is here (Work in progress!)

https://github.com/LinuxCNC/linuxcnc/blob/andypugh/hal_gpio/src/hal/drivers/hal_gpio.c

The test input file (
https://github.com/LinuxCNC/linuxcnc/blob/andypugh/hal_gpio/src/test.hal
) attempts to configure 8 input and 8 output lines.
However, if I change the 5 to 6 in either of lines 157 or 180 then the
output looks something like:

HAL: initializing hal_lib
/home/andypugh/linuxcnc-dev/bin/rtapi_app load hal_gpio
inputs=GPIO5,GPIO6,GPIO12,GPIO13,GPIO16,GPIO17,GPIO18,GPIO19
outputs=GPIO20,GPIO21,GPIO22,GPIO23,GPIO24,GPIO25,GPIO26,GPIO27
HAL: initializing component 'halcmd9608'
smalloc_dn: shmem available 1048284
HAL: component 'halcmd9608' initialized, ID = 02
Note: Using POSIX realtime
before request
rtapi_app: caught signal 11 - dumping core

The "before request" line was added for debugging, the "after request"
line is never printed, nor is the error message if the request fails,
so my belief is that lines 163 and/or 185 are segfaulting in the
bulk_request functions.

The driver appears to work fine if I limit the number of parsed input
strings to 5.

-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1912




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux