Opened on 12/02/15 at 10:18:17
Closed on 12/13/15 at 01:22:17
#2483 closed defect (fixed)
raspberrypi: i2c driver can block task forever if compiled with #if I2C_IO_MODE == 1
Reported by: | Jan Sommer | Owned by: | Jan Sommer <soja-lists@…> |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | bsps | Version: | 5 |
Severity: | normal | Keywords: | |
Cc: | Blocked By: | ||
Blocking: |
Description
If the i2c driver is compiled with #if I2C_IO_MODE == 1 it uses a transient event send by an ISR to wait for space in the TX FIFO.
The transient event is sent to the taskid which is stored in the structure for the corresponding bus (bus->task_id).
However, this field is only set once in the rpi_i2c_register_bus-function.
That means if a task other than the one which registered the bus wants to access it, it will block forever because the event is sent to the wrong one (the one which registered the bus).
Attachments (1)
Change History (3)
Changed on 12/02/15 at 11:29:13 by Jan Sommer
Attachment: | 0001-Store-task_id-of-the-current-thread-for-the-ISR-befo.patch added |
---|
comment:1 Changed on 12/02/15 at 11:30:42 by Jan Sommer
comment:2 Changed on 12/13/15 at 01:22:17 by Jan Sommer <soja-lists@…>
Owner: | set to Jan Sommer <soja-lists@…> |
---|---|
Resolution: | → fixed |
Status: | new → closed |
In [changeset:"687463d7f3b0abb1d98e6e630fb6d47541594bd4/rtems"]:
Note: See
TracTickets for help on using
tickets.
The added patch should fix the problem.
It simply writes the task_id of the current thread to the bus structure before waiting for the transient event. Then, the ISR should send the event to the correct task.