Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3253958imm; Sun, 29 Jul 2018 14:06:46 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe4kGgbPe7Nzsx/TyA2pVeP4mZIRjofDWgWnZKfoPDKcOGGEMONbg7IoKdchKb6q13IzQTN X-Received: by 2002:a17:902:70cc:: with SMTP id l12-v6mr14067429plt.132.1532898406829; Sun, 29 Jul 2018 14:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532898406; cv=none; d=google.com; s=arc-20160816; b=J9q/9jRhPMwTif3vyHkx9P4A/3bxss3GOC75w7yVKaoZCuwDK2mJSRsXxfgqeMVfzl UGGrBXKKaFtKXvKhAnk80Wn+6edca9z8gCpiD2ph4XqyUxfndL7+NmWr/UNeaTt8bBnC l7/4Df5nzOpKVCDT6YPu5zzUg1r4Ejg0Cr9+2pyLUX+bi0wJdI3zpcYMSoVLH+SFmwgf xIecjNEQY2+g/sTrXOLgWfvz/5Moet9qwEC1IqEKhZ1eAb7afFaWd/PjyiPey6BXROUL D0YgeDqRaFD+/HknKn30jlMsT/jsMTLQlWtY1626RCQvP+/CIiiT9/q4VW8Xh94oFqYy kgPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=3+nB2kG60q1S99d5DA0vKgpccrOIC4fcn3RuZpQMn+M=; b=AFvhf0PoBzzTFcipowDy6091dsgtVlZw5RpG1vq0IqYlFR8m2YwD0bOXz7coWE1HhI h8HNzyIawSOAdQosvI6qzYlLNGcwXLiNQUczjoVUoc+syxVFHWZZy/TBfOzsRVaP5sNM RzS4uRiB9JOaAUpPeyx6MZz0gxZk0pAYpeZbUCWlb7IaHJpUNS2vRk7kIDv29LHNsHwL CaHPEDXD/8JZ/Ib38Q1DTNMlms3up1wkwkd1LEf3bBsj/2ERsaAiLXrwO304DGrn18ff cDuvjsBToKyjm98nUJ5ZLl8fqfN2+/Bw/K7UwPqcjRUptoWOSkTSgTVexA2eXjwqAgfU SI6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k16TDRkC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v21-v6si8893939plo.397.2018.07.29.14.06.32; Sun, 29 Jul 2018 14:06:46 -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; dkim=pass header.i=@linaro.org header.s=google header.b=k16TDRkC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729093AbeG2WQP (ORCPT + 99 others); Sun, 29 Jul 2018 18:16:15 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:40011 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726835AbeG2WQO (ORCPT ); Sun, 29 Jul 2018 18:16:14 -0400 Received: by mail-it0-f66.google.com with SMTP id h23-v6so14136087ita.5 for ; Sun, 29 Jul 2018 13:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3+nB2kG60q1S99d5DA0vKgpccrOIC4fcn3RuZpQMn+M=; b=k16TDRkCMzebNyfyOe7Dd1OmIwpTcc2QiyoUZjIzWLbwHNipQr1IYCZ5Ax0BbbCk8N dO0GWHNruYfvMt/RgD4bIbRySzudgLYlDQR4H1TJtTOXOBjsAb3A+OFzUsALO6Ww3gaO pNXHr4pnTZD89YJnQNwi/yslJprgHYgP5rnX8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3+nB2kG60q1S99d5DA0vKgpccrOIC4fcn3RuZpQMn+M=; b=KJMxE5KC0epwHDMrDwxdOEGtJVNwLaSs7oRIop2iz5XjDwq2CrPapQLebGV+8+ezHP GgjB49PiKk0Bya2xbJnHvwGEx4CL2cNvYC+XuRQHOREKlqPD9l+2uRFuBS/vreEjtWN3 /WwakgDXLKXC7qT7e1+hnqi2q+TQ+5wFa4USC9iIwoO/u5h+kUVTY+Ck+WljcaeaDON1 NeIFn/CPojWhiumWeb4N501ll4WruHsDNW7RjVwDGnPXhcpJMvZ6nSvgA1Rxg34IzFuE gB7iXYLJj20tyY4mNri64/sSuQZs/DFKeAubHHttGvk9LgYLycFwxDW2jQeOltebDbvw 5ZTA== X-Gm-Message-State: AOUpUlFcClSqLcCbaB2NDQ01xQEJZjqz4jvNkZeOe/gDw8pfslVmGHIl rXN7//IaJE+tgT2ufd/aOSfnPZJSkqJanARuh0WrXg== X-Received: by 2002:a24:5004:: with SMTP id m4-v6mr12104707itb.38.1532897069127; Sun, 29 Jul 2018 13:44:29 -0700 (PDT) MIME-Version: 1.0 References: <20180717005719.258905-1-djkurtz@chromium.org> In-Reply-To: <20180717005719.258905-1-djkurtz@chromium.org> From: Linus Walleij Date: Sun, 29 Jul 2018 22:44:17 +0200 Message-ID: Subject: Re: [PATCH 1/2] pinctrl/amd: only handle irq if it is pending and unmasked To: Daniel Kurtz Cc: "S-k, Shyam-sundar" , "Shah, Nehal-bakulchandra" , Ken Xue , Daniel Drake , Thomas Gleixner , "open list:GPIO SUBSYSTEM" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 17, 2018 at 2:57 AM 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 Patch applied with TGLX ACK. Yours, Linus Walleij