Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2564544lkm; Mon, 20 Sep 2021 18:50:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYla9rOVkE6HZTWk7+kRQLk60IkjwZf2ACTsKiqhUNVqmcgTiKWvz+nuIsRIJNkno53VWn X-Received: by 2002:a05:6e02:c88:: with SMTP id b8mr19650426ile.300.1632189021404; Mon, 20 Sep 2021 18:50:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632189021; cv=none; d=google.com; s=arc-20160816; b=pg4lEQhZUahIjDmvbPFNz7MP1VMINOpx2d9V449KCjdzBx/6u6lOATAecfMC8YhY6b cTc9lPJkno8kDdexX15cgNY1gp5aQhGAo/+TCteifMyLlRo6ijxFwcmCHZs0Roztkxo+ wPQaUO/I463PGmMy69z+K6eY71kK0uZ0V291ZJ841uJJ+gL2KDzCMu35rQ1JdOOvm80G WI1Xz9yV9k8fXZBbdjjGT8g4oxC+p0kVjSZPVjTlXmcwgAg3LVnbnAUHNXZ4VZ/HE554 P+I+3RXTKJhz/Ne/zg5WxRyjdxUEEmmxFURGYslnLuc18YLNSolTQTeSmzq3KLvXfyls d6VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=R3VePBftmWzpv6Y2Jv2hqSx0nSjugyjxrJEqUh1MrxQ=; b=g0uhqLHWy+0IXtj3/RxzzAtiA1GgnE/ajKcmY9dyQVViXYG/GktnrYAJChtZRbKe6m lwi8qfaY4m+GRhkq3RkGVI27ZnTJk2r3eqD0NoRqBJ5Di/UeAIpJAu5hh+IgFODVXl/4 d7O6ypbJ5qFmBe1u+YfxmrWr68QgkKhrQ7ZksogDX3hFyt7z/DaG5jGhv5u8ON6rkmAN psDx8061a7oQnsvys4ai+fdQxVYzSh2/nGwP1e6GSCZLdtMwo0VO70WgCXphCS0P5akL l8BI/Dx1kApm+P86qBwSzB8qxldIX6w+fzMaBR1dIN/IP4opkUq8nBHGEhwYxQewuc36 Yz2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OTRc3nAm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i4si15222778ilj.162.2021.09.20.18.50.10; Mon, 20 Sep 2021 18:50:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OTRc3nAm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357780AbhITSE7 (ORCPT + 99 others); Mon, 20 Sep 2021 14:04:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:58284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356129AbhITR6n (ORCPT ); Mon, 20 Sep 2021 13:58:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id ABD62613AB; Mon, 20 Sep 2021 17:15:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158115; bh=CF4znAEktDes8o/h9vI0NdXDlx+HSW6xSZRtfRzHPro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OTRc3nAmzQoo937/+0ykNSqCepR4ZqaIJLQVNr182LZ8dUpk8rN1BQzv6qq1RU92r XWGXXUu5yBkqhiuJVZhsohMDyJMITnSB0gTF6QWf9OW8w+HJz8bmknFWd/4uetzZOb uK6vxktqFAzltNuwXiDIr2B3USICpQcKaK7Cjpd0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Walleij , Lee Jones , Maxime Coquelin , Alexandre Torgue , Marc Zyngier , Sasha Levin Subject: [PATCH 4.19 276/293] mfd: Dont use irq_create_mapping() to resolve a mapping Date: Mon, 20 Sep 2021 18:43:58 +0200 Message-Id: <20210920163942.863804957@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163933.258815435@linuxfoundation.org> References: <20210920163933.258815435@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marc Zyngier [ Upstream commit 9ff80e2de36d0554e3a6da18a171719fe8663c17 ] Although irq_create_mapping() is able to deal with duplicate mappings, it really isn't supposed to be a substitute for irq_find_mapping(), and can result in allocations that take place in atomic context if the mapping didn't exist. Fix the handful of MFD drivers that use irq_create_mapping() in interrupt context by using irq_find_mapping() instead. Cc: Linus Walleij Cc: Lee Jones Cc: Maxime Coquelin Cc: Alexandre Torgue Signed-off-by: Marc Zyngier Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/mfd/ab8500-core.c | 2 +- drivers/mfd/stmpe.c | 4 ++-- drivers/mfd/tc3589x.c | 2 +- drivers/mfd/wm8994-irq.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index 11ab17f64c64..f0527e769867 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c @@ -493,7 +493,7 @@ static int ab8500_handle_hierarchical_line(struct ab8500 *ab8500, if (line == AB8540_INT_GPIO43F || line == AB8540_INT_GPIO44F) line += 1; - handle_nested_irq(irq_create_mapping(ab8500->domain, line)); + handle_nested_irq(irq_find_mapping(ab8500->domain, line)); } return 0; diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c index 566caca4efd8..722ad2c368a5 100644 --- a/drivers/mfd/stmpe.c +++ b/drivers/mfd/stmpe.c @@ -1035,7 +1035,7 @@ static irqreturn_t stmpe_irq(int irq, void *data) if (variant->id_val == STMPE801_ID || variant->id_val == STMPE1600_ID) { - int base = irq_create_mapping(stmpe->domain, 0); + int base = irq_find_mapping(stmpe->domain, 0); handle_nested_irq(base); return IRQ_HANDLED; @@ -1063,7 +1063,7 @@ static irqreturn_t stmpe_irq(int irq, void *data) while (status) { int bit = __ffs(status); int line = bank * 8 + bit; - int nestedirq = irq_create_mapping(stmpe->domain, line); + int nestedirq = irq_find_mapping(stmpe->domain, line); handle_nested_irq(nestedirq); status &= ~(1 << bit); diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c index cc9e563f23aa..7062baf60685 100644 --- a/drivers/mfd/tc3589x.c +++ b/drivers/mfd/tc3589x.c @@ -187,7 +187,7 @@ again: while (status) { int bit = __ffs(status); - int virq = irq_create_mapping(tc3589x->domain, bit); + int virq = irq_find_mapping(tc3589x->domain, bit); handle_nested_irq(virq); status &= ~(1 << bit); diff --git a/drivers/mfd/wm8994-irq.c b/drivers/mfd/wm8994-irq.c index 18710f3b5c53..2c58d9b99a39 100644 --- a/drivers/mfd/wm8994-irq.c +++ b/drivers/mfd/wm8994-irq.c @@ -159,7 +159,7 @@ static irqreturn_t wm8994_edge_irq(int irq, void *data) struct wm8994 *wm8994 = data; while (gpio_get_value_cansleep(wm8994->pdata.irq_gpio)) - handle_nested_irq(irq_create_mapping(wm8994->edge_irq, 0)); + handle_nested_irq(irq_find_mapping(wm8994->edge_irq, 0)); return IRQ_HANDLED; } -- 2.30.2