Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

#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)

0001-Store-task_id-of-the-current-thread-for-the-ISR-befo.patch (1.1 KB) - added by Jan Sommer on 12/02/15 at 11:29:13.

Download all attachments as: .zip

Change History (3)

comment:1 Changed on 12/02/15 at 11:30:42 by Jan Sommer

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.

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: newclosed

In [changeset:"687463d7f3b0abb1d98e6e630fb6d47541594bd4/rtems"]:

Error: Processor CommitTicketReference failed
/data/trac/repo/rtems.git does not appear to be a Git repository.
Note: See TracTickets for help on using tickets.