Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a7dab08 authored by Raghavendra Kakarla's avatar Raghavendra Kakarla Committed by Gerrit - the friendly Code Review server
Browse files

drivers: pinctrl: Check whether irq mapping exists before creating it



Calling to create mapping without checking if mapping already exists
leads to loop to all available domains to get the corresponding
domain and then checks for available mapping. Client driver calling
gpio_to_irq from atomic context may get sleeping function called from
invalid context.

Add a check to see if irq mapping exist before creating it.

Change-Id: If922b06448138107d5c797f35d2835b20a490ada
Signed-off-by: default avatarRaghavendra Kakarla <rkakarla@codeaurora.org>
parent 1ea82c53
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1475,6 +1475,12 @@ static void msm_gpio_setup_dir_connects(struct msm_pinctrl *pctrl)
static int msm_gpiochip_to_irq(struct gpio_chip *chip, unsigned int offset)
{
	struct irq_fwspec fwspec;
	struct irq_domain *domain = chip->irqdomain;
	int virq;

	virq = irq_find_mapping(domain, offset);
	if (virq)
		return virq;

	fwspec.fwnode = of_node_to_fwnode(chip->of_node);
	fwspec.param[0] = offset;