[PATCH] bsp/raspberrypi: Store the current taskid before waiting for the transient event in i2c-driver

Gedare Bloom gedare at rtems.org
Wed Dec 2 02:11:59 UTC 2015


can you file a ticket and describe the bug this fixes. then #close the
ticket with the commit message.

On Mon, Nov 30, 2015 at 5:16 PM, Jan Sommer
<soja-lists at aries.uberspace.de> wrote:
> Before having the i2c device as an shared resource will create a deadlock because the taskid
> for the transient_event is only stored during device registration.
> ---
>  c/src/lib/libbsp/arm/raspberrypi/i2c/i2c.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/c/src/lib/libbsp/arm/raspberrypi/i2c/i2c.c b/c/src/lib/libbsp/arm/raspberrypi/i2c/i2c.c
> index 14a2467..9bf90ec 100644
> --- a/c/src/lib/libbsp/arm/raspberrypi/i2c/i2c.c
> +++ b/c/src/lib/libbsp/arm/raspberrypi/i2c/i2c.c
> @@ -91,6 +91,7 @@ static int rpi_i2c_bus_transfer(rpi_i2c_bus *bus)
>        BCM2835_REG(BCM2835_I2C_C) |= (1 << 9);
>
>        /* Sleep until the TX FIFO has free space for a new write. */
> +      bus->task_id = rtems_task_self();
>        if (
>            rtems_event_transient_receive(RTEMS_WAIT, bus->base.timeout) !=
>            RTEMS_SUCCESSFUL
> --
> 2.5.0
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list