On Mon, Aug 1, 2016, at 12:04 PM, Charles Steinkuehler wrote:
> On 7/31/2016 10:12 PM, John Kasunich wrote:
> > 
> > What is the bug?  "claimed" fields retaining their value
> > over an unloadrt/loadrt cycle?  Since they are arrays and
> > are initialized as part of the declaration, I don't see how 
> > it can be a bug in the driver code.
> 
> IMHO, if you get different behavior between loading a driver the first
> time vs unloading/reloading it, that's a bug (or at the very least
> curious behavior that needs to be documented).

In a user-space program, initialized variables like those bb_gpio_pin
structure arrays get set by the C library after the program is loaded
into memory but before control is transferred to main().  Failure to 
initialize/re-initialize would indicate a bug in the C library.

I have no idea how initialized variables are handled in kernel
modules.

> 
> > What about the 0x803 as a control_offset value instead of
> > a multiple of 4?  That sounds like a typo to me, I've never
> > seen a chip that had such a break in the pattern of I/O 
> > addresses.
> 
> Looks like that's supposed to be 0x80C, assuming you're referring to
> this line:
> 
> https://github.com/machinekit/machinekit/blob/master/src/hal/drivers/beaglebone_gpio.h#L80
> 
Yep, that's the line.

> ...probably hasn't shown up until now because most folks don't disable
> the on-board eMMC, so wouldn't be using that pin.

Is it device tree that determines whether pins are used for MMC or GPIO, etc?

Seems like in the ideal world the "claimed" field in the bb_gpio_pin
structures would be set using data from device tree, so that if the MMC
is enabled you can't tell the HAL driver to use that pin.

As written, it looks like the only thing the "claimed" field does is keeps
you from using the same pin as a HAL input and HAL output at the
same time.  It does nothing to convey "claims" on the pin by other
things like the MMC.

I guess I want to learn more about device tree.


-- 
  John Kasunich
  [email protected]

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to