Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1789136imm; Thu, 19 Jul 2018 07:55:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfgVsm/k5lR0ShAk7jb229JN7heZlKqNVxhuaipLwpR9ZiVj4bPZ/FUxoXAY2Y93ZGb+wDW X-Received: by 2002:a63:81c3:: with SMTP id t186-v6mr10526763pgd.413.1532012157488; Thu, 19 Jul 2018 07:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532012157; cv=none; d=google.com; s=arc-20160816; b=vHT3EQ6D7YfzXj3/U6XYpzf1fiAMP1r68FgZfi1G9LFt2CdRLCZm/KV6Cfz04g5rn4 kmyQ+LQ8/u+wosoJPxYM42MaA+/rvXB4hB8ExgFiBPT/K5hxsrcv0+xPHeKCKDaBfTEU zDAdBbmHx2w59FKmt2fwKDSE8kSkIj8XOxvDB4tM2Lhae5nvO1bq4/WQQi8InB/IhcfR TMKQHerDSgvqMwhC3HE8XCBqDr6E5Q2SApM1z54N9qEwROhtbxnLRWhj/H/ptg8NINne 1yjyJ5Zg6yMZlZRKNh+/VEEPRqJMrU5Z1PgAEWlgPT5Rcs2sRxumOgg010iz7kWBwMuQ XlZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=NfkxM2/kxm/rMoiDPLC+3juue5WV/5iMBff3IqaY9DA=; b=ycTJvWEnWLY5y6bD+HzJ8HoscbDtk6aZ1MU8AR16k8sWiJIaxmbx1Kj4n5NlV/WEtG KXI+foRBnfkm8dgC9rj6D81KiGHKDv9nZ7GAqNy53DUDEifYDR9nTnwaqEDCui5jTEF6 YFzZBpCcvod7bI86hqAQWPLcAzN76JoXGNxnyz16GhiY87V9c71laZYMohWZPfKWfz1l wQfuDEP70do4SThrcTNdVqKrnp6uxoVJb0JVssMuJr5abVV0EC/5C7bhkPfzOgQ/kIWn /6U4D1ZTlh1qgD8gVqU+st3RgowGrDJ7lU0smpBq892iO6BiS96MVf07J0TgY5J/jRSQ ZqhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si5874206plt.342.2018.07.19.07.55.42; Thu, 19 Jul 2018 07:55:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731850AbeGSPi2 (ORCPT + 99 others); Thu, 19 Jul 2018 11:38:28 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:33322 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730521AbeGSPi2 (ORCPT ); Thu, 19 Jul 2018 11:38:28 -0400 Received: from p4fea5a5a.dip0.t-ipconnect.de ([79.234.90.90] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fgAKR-0001SA-LY; Thu, 19 Jul 2018 16:54:51 +0200 Date: Thu, 19 Jul 2018 16:54:48 +0200 (CEST) From: Thomas Gleixner To: Daniel Kurtz cc: Shyam Sundar S K , Nehal Shah , Ken Xue , Daniel Drake , Linus Walleij , "open list:PIN CONTROL SUBSYSTEM" , open list Subject: Re: [PATCH 1/2] pinctrl/amd: only handle irq if it is pending and unmasked In-Reply-To: <20180717005719.258905-1-djkurtz@chromium.org> Message-ID: References: <20180717005719.258905-1-djkurtz@chromium.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 16 Jul 2018, Daniel Kurtz wrote: > The AMD pinctrl driver demultiplexes GPIO interrupts and fires off their > individual handlers. > > If one of these GPIO irqs is configured as a level interrupt, and its > downstream handler is a threaded ONESHOT interrupt, the GPIO interrupt > source is masked by handle_level_irq() until the eventual return of the > threaded irq handler. During this time the level GPIO interrupt status > will still report as high until the actual gpio source is cleared - both > in the individual GPIO interrupt status bit (INTERRUPT_STS_OFF) and in > its corresponding "WAKE_INT_STATUS_REG" bit. > > Thus, if another GPIO interrupt occurs during this time, > amd_gpio_irq_handler() will see that the (masked-and-not-yet-cleared) > level irq is still pending and incorrectly call its handler again. > > To fix this, have amd_gpio_irq_handler() check for both interrupts status > and mask before calling generic_handle_irq(). > > Note: Is it possible that this bug was the source of the interrupt storm > on Ryzen when using chained interrupts before commit ba714a9c1dea85 > ("pinctrl/amd: Use regular interrupt instead of chained")? > > Signed-off-by: Daniel Kurtz Acked-by: Thomas Gleixner