Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3547763pxj; Mon, 24 May 2021 09:07:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMnFWIeZ4rCknfOZteVfSqMUVmQT2rwURZfNwE1mdrS847uhHehjU8/5wfNiUFO1cHtRqT X-Received: by 2002:a50:ab5e:: with SMTP id t30mr26850893edc.50.1621872435124; Mon, 24 May 2021 09:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621872435; cv=none; d=google.com; s=arc-20160816; b=r503zTXwk1n4TCkHkiM34yXmLv2OWqSNXp7GSWNcDs/3d1FSOVqsMIFAZPXawGJiGm Tj5MGkhGXGGFNqjorzE/g9x4WArVPwhzrd0Ro7LJ6kfeejiRuNEUExdFWKrUAQhYF9gy GpQHi0W3nsD0VonBNcCw1d4M5hBn6mqigON6TN7EFcxqZLnTKueKodBHn90Bya4KJiee dg/FhYc8llbKFj5hT86jUw/7wQtyLmE0CidUPE6bQWGO7p1BiC3DcYdPSi6fDC/kHaPf RzwXnz0/VSgqKDUkOwRl6CoR1TB0ZYY6wG7G6hH1Qv2rgh1bP2E+kHBTHYak5J50qtxG HBjQ== 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=988OOvjFCem4LQwcdWIT+YWA3/Nb2plT/rQriX50GbU=; b=n+GgD5LIN4OjoYLB3Pb5mRf6vKVg45GxrEmKCEh9Me/B3kEwbMnuWLXjSfFNl+8bWp 3ljDvtoj8FCDg5U8dXqHuBNR+AhmVTum5hSfEDzXFJAy/C8eao5T3kL6ANY3b9czEH0d kX2GKWKwZu8I90+LdwR+IJZ0BUsrep8q8Ex0rVCTrRTKu9RWwb0w10ns91/9bD+kfKJ7 K8/6o0IxvKPQSeZClvwKGIqZjpTLrF1u5hSEQLdHgjULDPgGnYAvMIDBGaFSWNzRv+if RZrx954afNH3YwEeG9EN+VIOGV7b8AIsipE/BhicAZhhgC2vxmGRO+yhsgz9NM1rHyKj x+xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YaMuty5G; 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 h9si12618007ejc.653.2021.05.24.09.06.51; Mon, 24 May 2021 09:07:15 -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=YaMuty5G; 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 S236466AbhEXQGt (ORCPT + 99 others); Mon, 24 May 2021 12:06:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:40490 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235601AbhEXP7s (ORCPT ); Mon, 24 May 2021 11:59:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A14776197B; Mon, 24 May 2021 15:45:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621871131; bh=ySwN1vJxApLi8y0eY292G8HYXaeIbbwM7aDyxINP+h4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YaMuty5GFQoQB6g2OKWMMRduQMZOapDbolsTDRaEeUxW4tlTYq3qVObXCf1xtFz3k GSD0ahZUuyAJAoxsXi+UAiRpf6usg/elIzCaMFMK9xlTxn5MVfA7eCyn7FKxluFAIg EmBtrIXzF1Z9F0qAsJq2cP1OwhzmvauJ8n4arYuI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jon Hunter , Linus Walleij , Bartosz Golaszewski Subject: [PATCH 5.12 087/127] gpio: tegra186: Dont set parent IRQ affinity Date: Mon, 24 May 2021 17:26:44 +0200 Message-Id: <20210524152337.800955781@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152334.857620285@linuxfoundation.org> References: <20210524152334.857620285@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: Jon Hunter commit bdbe871ef0caa660e16461a2a94579d9f9ef7ba4 upstream. When hotplugging CPUs on Tegra186 and Tegra194 errors such as the following are seen ... IRQ63: set affinity failed(-22). IRQ65: set affinity failed(-22). IRQ66: set affinity failed(-22). IRQ67: set affinity failed(-22). Looking at the /proc/interrupts the above are all interrupts associated with GPIOs. The reason why these error messages occur is because there is no 'parent_data' associated with any of the GPIO interrupts and so tegra186_irq_set_affinity() simply returns -EINVAL. To understand why there is no 'parent_data' it is first necessary to understand that in addition to the GPIO interrupts being routed to the interrupt controller (GIC), the interrupts for some GPIOs are also routed to the Tegra Power Management Controller (PMC) to wake up the system from low power states. In order to configure GPIO events as wake events in the PMC, the PMC is configured as IRQ parent domain for the GPIO IRQ domain. Originally the GIC was the IRQ parent domain of the PMC and although this was working, this started causing issues once commit 64a267e9a41c ("irqchip/gic: Configure SGIs as standard interrupts") was added, because technically, the GIC is not a parent of the PMC. Commit c351ab7bf2a5 ("soc/tegra: pmc: Don't create fake interrupt hierarchy levels") fixed this by severing the IRQ domain hierarchy for the Tegra GPIOs and hence, there may be no IRQ parent domain for the GPIOs. The GPIO controllers on Tegra186 and Tegra194 have either one or six interrupt lines to the interrupt controller. For GPIO controllers with six interrupts, the mapping of the GPIO interrupt to the controller interrupt is configurable within the GPIO controller. Currently a default mapping is used, however, it could be possible to use the set affinity callback for the Tegra186 GPIO driver to do something a bit more interesting. Currently, because interrupts for all GPIOs are have the same mapping and any attempts to configure the affinity for a given GPIO can conflict with another that shares the same IRQ, for now it is simpler to just remove set affinity support and this avoids the above warnings being seen. Cc: Fixes: c4e1f7d92cd6 ("gpio: tegra186: Set affinity callback to parent") Signed-off-by: Jon Hunter Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman --- drivers/gpio/gpio-tegra186.c | 11 ----------- 1 file changed, 11 deletions(-) --- a/drivers/gpio/gpio-tegra186.c +++ b/drivers/gpio/gpio-tegra186.c @@ -444,16 +444,6 @@ static int tegra186_irq_set_wake(struct return 0; } -static int tegra186_irq_set_affinity(struct irq_data *data, - const struct cpumask *dest, - bool force) -{ - if (data->parent_data) - return irq_chip_set_affinity_parent(data, dest, force); - - return -EINVAL; -} - static void tegra186_gpio_irq(struct irq_desc *desc) { struct tegra_gpio *gpio = irq_desc_get_handler_data(desc); @@ -700,7 +690,6 @@ static int tegra186_gpio_probe(struct pl gpio->intc.irq_unmask = tegra186_irq_unmask; gpio->intc.irq_set_type = tegra186_irq_set_type; gpio->intc.irq_set_wake = tegra186_irq_set_wake; - gpio->intc.irq_set_affinity = tegra186_irq_set_affinity; irq = &gpio->gpio.irq; irq->chip = &gpio->intc;