i.mx6 gpio_set_value correct locking
Hello,
Is it allowed/save to call the function "gpio_set_value" from a primary domain task ?
This is the function called from gpio_set_value.
static void mxc_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
{
struct mxc_gpio_port *port =
container_of(chip, struct mxc_gpio_port, chip);
void __iomem *reg = port->base + GPIO_DR;
u32 l;
unsigned long flags;
spin_lock_irqsave(&port->lock, flags);
l = (__raw_readl(reg) & (~(1 << offset))) | (!!value << offset);
__raw_writel(l, reg);
spin_unlock_irqrestore(&port->lock, flags);
}and port->lock is a ipipe_spinlock_t
Thanks
Regards
Johann Obermayr
Quoted 22 lines · Johann Obermayr
Hello,
Is it allowed/save to call the function "
gpio_set_value" from a primary domain task ?This is the function called from
gpio_set_value.static void
mxc_gpio_set(struct gpio_chip *chip, unsigned offset, int value){ struct mxc_gpio_port *port = container_of(chip, struct mxc_gpio_port, chip); void __iomem *reg = port->base + GPIO_DR; u32 l; unsigned long flags; spin_lock_irqsave(&port->lock, flags); l = (__raw_readl(reg) & (~(1 << offset))) | (!!value << offset); __raw_writel(l, reg); spin_unlock_irqrestore(&port->lock, flags); }
Quoted 2 lines
and
port->lockis aipipe_spinlock_t
Looks ok.
Signature · 1 line
Philippe.