Skip to content

Commit b77f5ef

Browse files
Youngmin Namkrzk
authored andcommitted
pinctrl: samsung: add irq_set_affinity() for non wake up external gpio interrupt
To support affinity setting for non wake up external gpio interrupt, add irq_set_affinity callback using irq number from pinctrl driver data. Before this patch, changing the irq affinity of gpio interrupt is not possible: # cat /proc/irq/418/smp_affinity 3ff # echo 00f > /proc/irq/418/smp_affinity # cat /proc/irq/418/smp_affinity 3ff # cat /proc/interrupts CPU0 CPU1 CPU2 CPU3 ... 418: 3631 0 0 0 ... With this patch applied, it's possible to change irq affinity of gpio interrupt: # cat /proc/irq/418/smp_affinity 3ff # echo 00f > /proc/irq/418/smp_affinity # cat /proc/irq/418/smp_affinity 00f # cat /proc/interrupts CPU0 CPU1 CPU2 CPU3 ... 418: 3893 201 181 188 ... Signed-off-by: Youngmin Nam <[email protected]> Reviewed-by: Sam Protsenko <[email protected]> Tested-by: Sam Protsenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Krzysztof Kozlowski <[email protected]>
1 parent 904140f commit b77f5ef

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/pinctrl/samsung/pinctrl-exynos.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,19 @@ static int exynos_irq_set_type(struct irq_data *irqd, unsigned int type)
147147
return 0;
148148
}
149149

150+
static int exynos_irq_set_affinity(struct irq_data *irqd,
151+
const struct cpumask *dest, bool force)
152+
{
153+
struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
154+
struct samsung_pinctrl_drv_data *d = bank->drvdata;
155+
struct irq_data *parent = irq_get_irq_data(d->irq);
156+
157+
if (parent)
158+
return parent->chip->irq_set_affinity(parent, dest, force);
159+
160+
return -EINVAL;
161+
}
162+
150163
static int exynos_irq_request_resources(struct irq_data *irqd)
151164
{
152165
struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
@@ -212,6 +225,7 @@ static const struct exynos_irq_chip exynos_gpio_irq_chip __initconst = {
212225
.irq_mask = exynos_irq_mask,
213226
.irq_ack = exynos_irq_ack,
214227
.irq_set_type = exynos_irq_set_type,
228+
.irq_set_affinity = exynos_irq_set_affinity,
215229
.irq_request_resources = exynos_irq_request_resources,
216230
.irq_release_resources = exynos_irq_release_resources,
217231
},

0 commit comments

Comments
 (0)