Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp709656oof; Tue, 25 Sep 2018 03:42:10 -0700 (PDT) X-Google-Smtp-Source: ACcGV61hLCm3QO1gFKxtze/JyboFFCN0NPgQUoBQEkeIfvj2EMyMRwKt1Jp0aESxRuN/i+9VPRDl X-Received: by 2002:a62:6cc4:: with SMTP id h187-v6mr472795pfc.158.1537872130511; Tue, 25 Sep 2018 03:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537872130; cv=none; d=google.com; s=arc-20160816; b=IB/txdPr1VEpRZlmbhhLe2l36/xxDih3saZgt6CDQ5fRo/xPBNslBdpvnvcjbUO0jd 51W/MkBlp+1gJW4g/sB26GrQXS26Yh3c+cEUteLAEBw5fgRBDZ7RnbYjX04m/6LP0jPy c3Wmr/U4Lvtj00Gp3pyohZsBH3yBG/sfIl+WBuS8QD+wsNAfUsxp3tqmXwPjOal556YF q0SaszUajEcCgpFxdwg/NoyqHGhhCOHlHS5AG3NXoX+4twd97xB+lp0qu4u81qEzTj5a 2MjPQa+Ijl7lb2uAjO8e+AY/iXDtYaHLLjHAKyqKCkKGDBpbQThhA+hV1EXgjsgXl2Ul MoEA== 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; bh=WAFOoiqw4OgimMrYaEbs1bv1Pp17vjcrwvuFbvmomNQ=; b=VMJKMiiOmIbZjFMMF8NlihNJayl49kUKIthxB4hCoBwlIQMtGaJ0HXXcwlFdaeVHN8 q+xi961sWqnzyGJ2dQYfIUpTnMRtuy+MZNnLfLcw1Lt5wj6myjIXvZtOZUWQgaNADUTO cCOUzXpBbDStDedIUOIXGhuINWgadwhqI6Lw71L9l4SyFtB6fPKfEzrnEbwHhyj7tKXp 0xbZ0H4RqecywnbsLPuIgwIBdjSy8oofZ5hjjeNowCzE01mfy1Vb2POq22mZrZIkXPqa tIe5i5MN6fM6Az5nmLhOdKaI/Oqg2kkM4FOmoBw57lcN5EcyhxsHROikHQVgvYpIhegw GXTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=igH4TD2h; 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 c20-v6si2063450pfc.18.2018.09.25.03.41.54; Tue, 25 Sep 2018 03:42:10 -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=igH4TD2h; 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 S1727507AbeIYQso (ORCPT + 99 others); Tue, 25 Sep 2018 12:48:44 -0400 Received: from mail-it1-f196.google.com ([209.85.166.196]:53284 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726660AbeIYQsn (ORCPT ); Tue, 25 Sep 2018 12:48:43 -0400 Received: by mail-it1-f196.google.com with SMTP id q70-v6so6140235itb.3 for ; Tue, 25 Sep 2018 03:41:48 -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=WAFOoiqw4OgimMrYaEbs1bv1Pp17vjcrwvuFbvmomNQ=; b=igH4TD2h3NqUJn87vG46qrHa8fyYBi1u/rvuocwvBr7+G/O+PZDJMmUqkHmY9C1ZJt gEJQQe8Qt0/JsxHNpcGa6/oDjdYkr0JyY+IFUtC1NxVNT8mdz4KVA+/B0XMNLbwWjjPZ H4wRPxhSZQgG1mfWTsBD/E4DrYNY/FyLGRiYQ= 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=WAFOoiqw4OgimMrYaEbs1bv1Pp17vjcrwvuFbvmomNQ=; b=a9ffx7izlq3okM6+kzLqf5RTzdCI85HrOlg5Cu8BZk53c3NDQZhl7D33HmJvZ7Un1u sTm4ZWiv820HPJe5Q6uRGwRtk6WdQ8BwevDSmj0ghMv5nlHwzatE0Yf3JjSojdFDaSxF JRBooVSp6gzAAsDWkeyZ/h1jj24YK6hw/WPzRwRxhE45dlm85XLvyLYNpesafwphMSRJ vXTofzTw90WGGE2+x5kNQ1lDDIzRxNsgL6uqATOxkpe8AeeWZgagg6OAg6L+NRQcUCia BKlegVztgWNgx6vw5U6qHyYss81UGpXwwMWzfgv3gsP29MJJUn/OM6dDtagFw3oFSjRO 8iUw== X-Gm-Message-State: ABuFfoiOrL19OHOQkrOvVz7r9smUeLRCzAhtx7AOK8TNmkq6Y7GpMhCl E9XyBK6ckGihQ0USeBUix6UZm1IDNSVrgGRVRrJow6/+ X-Received: by 2002:a24:83c1:: with SMTP id d184-v6mr144770ite.16.1537872108039; Tue, 25 Sep 2018 03:41:48 -0700 (PDT) MIME-Version: 1.0 References: <20180922195826.175628-1-djkurtz@chromium.org> In-Reply-To: <20180922195826.175628-1-djkurtz@chromium.org> From: Linus Walleij Date: Tue, 25 Sep 2018 12:41:34 +0200 Message-ID: Subject: Re: [PATCH] pinctrl/amd: poll InterruptEnable bits in amd_gpio_irq_set_type To: Daniel Kurtz Cc: Daniel Drake , "S-k, Shyam-sundar" , "Shah, Nehal-bakulchandra" , Ken Xue , "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 Sat, Sep 22, 2018 at 9:58 PM Daniel Kurtz wrote: > From the AMD BKDG, if WAKE_INT_MASTER_REG.MaskStsEn is set, a software > write to the debounce registers of *any* gpio will block wake/interrupt > status generation for *all* gpios for a length of time that depends on > WAKE_INT_MASTER_REG.MaskStsLength[11:0]. During this period the Interrupt > Delivery bit (INTERRUPT_ENABLE) will read as 0. > > In commit 4c1de0414a1340 ("pinctrl/amd: poll InterruptEnable bits in > enable_irq") we tried to fix this same "gpio Interrupts are blocked > immediately after writing debounce registers" problem, but incorrectly > assumed it only affected the gpio whose debounce was being configured > and not ALL gpios. > > To solve this for all gpios, we move the polling loop from > amd_gpio_irq_enable() to amd_gpio_irq_set_type(), while holding the gpio > spinlock. This ensures that another gpio operation (e.g. > amd_gpio_irq_unmask()) can read a temporarily disabled IRQ and > incorrectly disable it while trying to modify some other register bits. > > Fixes: 4c1de0414a1340 pinctrl/amd: poll InterruptEnable bits in enable_irq > Signed-off-by: Daniel Kurtz Patch applied for fixes. Thanks! Linus Walleij