Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5062758pxb; Mon, 15 Feb 2021 08:32:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhPCCE99tQEyCJk6dENK7lquGizJoU5FaHRy641xrejblF+OxzwOE01QNXVaAF7RqzX+fV X-Received: by 2002:a17:907:d21:: with SMTP id gn33mr5228725ejc.242.1613406729029; Mon, 15 Feb 2021 08:32:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613406729; cv=none; d=google.com; s=arc-20160816; b=aVwvPn44SWMiDR1u3YVkmOpbEQbhZ8ON2/Hhj03HBOTR2uKjBxyU3cpI5mYlH669bq KU5LwNjhp3zsQ6xfV1UXzs2O0yWvGVaYWZgukWi5NEAkSCtWwhh5YjuPo94Z4bQMqjM0 L2ouf5BRBz5k6gshHxDtkOCUrOP9jAAGEg0bD2djrGRkBZODGVO5v4FriI1bAO4QgrjF GkMgNfecfkXUo2sSW6oiO7T1mh3lrk6y19QIxb6ewB6pMM74YhJXc/t1Rj9uOUJNf3M8 KEFX9ieLq+ZDPKbFUggbFixAWGogtelU/IDATyhs1jnJQf1Xuus24RK/+XpXXIA6uXnZ NHQw== 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=2wUmV2j6PHKxTceB49XqrUliP+7ZUI4Ej935xdUJMoQ=; b=lkcUQay5QNdM3X/nKtoo3wf7rvfx0TQEnVM8IMMqd9KNSScQiAmqvUz9qellHelNe9 flP/JwGOrQO1A9xFanRCJbSUM3MGTjwcCzY5ZODdW1VwaeXL0c+QnaulXiCbGA3MEvbM AMRP3RhrD6A3tyZFSsw8Veebnk+NjsjTs37/dgQOgd4pkIRtY8R1r6qfUCWC/6jGjnMC 7zEYHOpWqyefkVjL4tsCOcJRRahrmWpbU41oJAd2v4TOEGQo8fI5MZ6vEyBqP8w4Bl8m eayCvUPe9+nh0jvM7BGr7o/uEqbRo/W4d/c3hhCnG3XCYhKRBPU6+X3ifwBCfcFRlJnN RJ2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ExFxECLe; 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 s22si3070654eja.338.2021.02.15.08.31.46; Mon, 15 Feb 2021 08:32:09 -0800 (PST) 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=ExFxECLe; 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 S232076AbhBOQ2R (ORCPT + 99 others); Mon, 15 Feb 2021 11:28:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:50182 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230003AbhBOPhK (ORCPT ); Mon, 15 Feb 2021 10:37:10 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3057764ED3; Mon, 15 Feb 2021 15:32:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613403128; bh=X7wy2ezr0jlJfmnwzBG6RnKatBfbh3Fb17dTcH/L8KI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ExFxECLeWnrOw6fWls+zOlqXY7Ohi7zq9AGE/k0rdvmRItwuk3vwMtLAadDGb26EW uzgI0v6prMyESvY6huG6AqnqHSztIGE5/5dhjXiKI5HiXRUQpv+hRohWSKE1dgkM6t 2XoJrzprYvohxhCPilaz2npo3yf4g/NaxkguHj+o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nikita Shubin , Alexander Sverdlin , Bartosz Golaszewski Subject: [PATCH 5.10 005/104] gpio: ep93xx: Fix single irqchip with multi gpiochips Date: Mon, 15 Feb 2021 16:26:18 +0100 Message-Id: <20210215152719.643118977@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210215152719.459796636@linuxfoundation.org> References: <20210215152719.459796636@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: Nikita Shubin commit 28dc10eb77a2db7681b08e3b109764bbe469e347 upstream. Fixes the following warnings which results in interrupts disabled on port B/F: gpio gpiochip1: (B): detected irqchip that is shared with multiple gpiochips: please fix the driver. gpio gpiochip5: (F): detected irqchip that is shared with multiple gpiochips: please fix the driver. - added separate irqchip for each interrupt capable gpiochip - provided unique names for each irqchip Fixes: d2b091961510 ("gpio: ep93xx: Pass irqchip when adding gpiochip") Cc: Signed-off-by: Nikita Shubin Tested-by: Alexander Sverdlin Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman --- drivers/gpio/gpio-ep93xx.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) --- a/drivers/gpio/gpio-ep93xx.c +++ b/drivers/gpio/gpio-ep93xx.c @@ -38,6 +38,7 @@ #define EP93XX_GPIO_F_IRQ_BASE 80 struct ep93xx_gpio_irq_chip { + struct irq_chip ic; u8 irq_offset; u8 int_unmasked; u8 int_enabled; @@ -263,15 +264,6 @@ static int ep93xx_gpio_irq_type(struct i return 0; } -static struct irq_chip ep93xx_gpio_irq_chip = { - .name = "GPIO", - .irq_ack = ep93xx_gpio_irq_ack, - .irq_mask_ack = ep93xx_gpio_irq_mask_ack, - .irq_mask = ep93xx_gpio_irq_mask, - .irq_unmask = ep93xx_gpio_irq_unmask, - .irq_set_type = ep93xx_gpio_irq_type, -}; - /************************************************************************* * gpiolib interface for EP93xx on-chip GPIOs *************************************************************************/ @@ -331,6 +323,15 @@ static int ep93xx_gpio_f_to_irq(struct g return EP93XX_GPIO_F_IRQ_BASE + offset; } +static void ep93xx_init_irq_chip(struct device *dev, struct irq_chip *ic) +{ + ic->irq_ack = ep93xx_gpio_irq_ack; + ic->irq_mask_ack = ep93xx_gpio_irq_mask_ack; + ic->irq_mask = ep93xx_gpio_irq_mask; + ic->irq_unmask = ep93xx_gpio_irq_unmask; + ic->irq_set_type = ep93xx_gpio_irq_type; +} + static int ep93xx_gpio_add_bank(struct ep93xx_gpio_chip *egc, struct platform_device *pdev, struct ep93xx_gpio *epg, @@ -352,6 +353,8 @@ static int ep93xx_gpio_add_bank(struct e girq = &gc->irq; if (bank->has_irq || bank->has_hierarchical_irq) { + struct irq_chip *ic; + gc->set_config = ep93xx_gpio_set_config; egc->eic = devm_kcalloc(dev, 1, sizeof(*egc->eic), @@ -359,7 +362,12 @@ static int ep93xx_gpio_add_bank(struct e if (!egc->eic) return -ENOMEM; egc->eic->irq_offset = bank->irq; - girq->chip = &ep93xx_gpio_irq_chip; + ic = &egc->eic->ic; + ic->name = devm_kasprintf(dev, GFP_KERNEL, "gpio-irq-%s", bank->label); + if (!ic->name) + return -ENOMEM; + ep93xx_init_irq_chip(dev, ic); + girq->chip = ic; } if (bank->has_irq) { @@ -401,7 +409,7 @@ static int ep93xx_gpio_add_bank(struct e gpio_irq = EP93XX_GPIO_F_IRQ_BASE + i; irq_set_chip_data(gpio_irq, &epg->gc[5]); irq_set_chip_and_handler(gpio_irq, - &ep93xx_gpio_irq_chip, + girq->chip, handle_level_irq); irq_clear_status_flags(gpio_irq, IRQ_NOREQUEST); }