On 04/14/2018 04:20 AM, Greg Gallagher wrote:
> Currently in the rtdm gpio drivers if the pin numbers we are trying to
> register in rtdm space are above 1024 we will fail to register the
> pins and the driver fails to load. This happens because we use
> RTDM_MAX_MINOR to limit the number of devices that can be registered.
> For the gpio case adding a pin with a high pin number doesn't mean
> that we have that many devices registered. For example on the
> raspberry pi2 the gpio pins start at 1994, but only the gpio rtdm
> driver is loaded and we don't have 1994 rtdm devices registered.
> I've tested out increasing the RTDM_MAX_MAJOR to 4096, which works
> but I'm not sure this is the best solution. Another solution could be
> to subtract RTDM_MAX_MAJOR from the pin number if it's above
> RTDM_MAX_MAJOR but we would now have pin numbers different from that
> of the Linux gpio subsystem.
> Any thoughts on the best approach?
>
RTDM only allocates a namespace with alloc_chrdev_region() for covering
0..RTDM_MAX_MINOR-1 entirely, plus one entry in its own bitmap per
minor, so raising RTDM_MAX_MINOR should be fine, i.e. that would not
lead to over consume memory uselessly. Other options look complicated
and error-prone.
--
Philippe.
___
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai