Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3412926imm; Fri, 20 Jul 2018 16:39:35 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf7ICXD5ema2g9qdIIA/VUba8hHGndItcJmGKmbDecS9Rh/U7Q1TMAQ8ALIXiYgpWDQbg/6 X-Received: by 2002:a62:398c:: with SMTP id u12-v6mr4071768pfj.9.1532129974982; Fri, 20 Jul 2018 16:39:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532129974; cv=none; d=google.com; s=arc-20160816; b=CgyV3uUHx8Yc2IF2c1zc1U3+0SJcXqw5Zrvz3hWDPnAQVdhvlhWZRFeIpZMDR5N/vN JUpC0DllvXDBVXf6Kfp3yaUDGyvQdoR5Pn4wYZz6lkn/yKdjBQFRKdg+xR9Mt4zdE6lQ t29taZ6tu4f7pfGuW34y804XJorAP785oI/bNuLaZB/+2fBCz9ujJNWmfHlsY0R+OOoW D0k4CdeWG3VvLhLrcqNDRRnRQgQu7EFrF80Jf3rOh8gsxRQEJcbdpWk/iA0z/WdaD10G 0GdbAPoFN7qafloBI/PVUxIXl1okmNTVRjCTfqQOrxxf/snQ163iFHf72J9veLApalVd CDpQ== 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=5rESa4qzW1m0TrJmYgKHoDFTi0zK3Dsu4UYI5QUDlxY=; b=acMJsilN6jxUkIj/pf+zSPZ2giQD0U1hvr7n/RjmQPrdYgdcJA0jtdLRZ5ckDVWqN+ yMfQ3wxz73hdcjwiHaKvCnSqt8la8UI5pJOkswyapMOkAG2GZVpPSAhaUrrhNyiYPBwB oHkGmDgMv651lyH69vJo4viPycBZzhvU1ZdLTJKf1b5S5jV0E3VWtvldO4ilY2jgqCiX eIX9gbnbX20kYDYrm73Vf6xYBwCv252NQvan+8nd7534UU9s0T3jvlSXhWAv2nJYgbAh movXlyzwH+JcLVtOysEf0mmwpl7VV01WxWPHfWk/psKh86vyXqUSl/shvKps1YO/3+s1 w4fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="VxUDIM/1"; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d127-v6si2960244pfa.189.2018.07.20.16.39.19; Fri, 20 Jul 2018 16:39:34 -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=@chromium.org header.s=google header.b="VxUDIM/1"; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728396AbeGUA27 (ORCPT + 99 others); Fri, 20 Jul 2018 20:28:59 -0400 Received: from mail-ua0-f194.google.com ([209.85.217.194]:33726 "EHLO mail-ua0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728170AbeGUA26 (ORCPT ); Fri, 20 Jul 2018 20:28:58 -0400 Received: by mail-ua0-f194.google.com with SMTP id i4-v6so8464016uak.0 for ; Fri, 20 Jul 2018 16:38:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5rESa4qzW1m0TrJmYgKHoDFTi0zK3Dsu4UYI5QUDlxY=; b=VxUDIM/1hP4PxPtAxrd9tLyDlhZzOhZCuD8dJNa7bl4yPUIW+FFnVULtv8Y1eKy+NO BQRVc5F1VzvKBdjdBOcZ8jbHh6VfabvyOoyfiQ9sS8yVBLl02Ro/O7sjAEfQDAjlMNut a6kA/Y/gf/Tb4lzYuXEsqUahqOfbXiOxjsbEE= 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=5rESa4qzW1m0TrJmYgKHoDFTi0zK3Dsu4UYI5QUDlxY=; b=YGsANYLfCJ5hatzEbo1YVYG1nknPxKxmZd8nsbNEGg2o/7mxP9dNbGinfPU5+3sR09 q8sspKq8UNqYPHRoYSnB6sgQh9coDJRTagYf0eaigkplK1hzNgE0oV/60jwjTyGUy+qZ iAcX6itaDg57/EyJKoF7EilifauXDrmemYCAiAw6f9g4bDGBSf3TiT4R1OxXNQgWXnBn bW4AQNrQz1BH7zTACOGZo6zwr05ixmO4PJGXIhxQgub7WROtLOKjSrVdbHy+Mrgz6miI dPBoizzgaxeSffBkF2ZsrOjmEZolsYUmWOl+njRDQSiQhZnbKqRhOMesCESCRPsQcgDs piNg== X-Gm-Message-State: AOUpUlFa3U6KISpl+11UycgxDFhHEbCbplmWP+w62ykMixte4oiKZUwY IqCXp+wQSJCbGNe/cHBs1PmEjZzfQVD20kOejgWfbQ== X-Received: by 2002:ab0:1163:: with SMTP id g35-v6mr2742356uac.135.1532129908608; Fri, 20 Jul 2018 16:38:28 -0700 (PDT) MIME-Version: 1.0 References: <20180717005719.258905-1-djkurtz@chromium.org> <20180717005719.258905-2-djkurtz@chromium.org> In-Reply-To: From: Daniel Kurtz Date: Fri, 20 Jul 2018 17:38:17 -0600 Message-ID: Subject: Re: [PATCH 2/2] pinctrl/amd: use byte access to clear irq/wake status bits To: Daniel Drake Cc: Shyam-sundar.S-k@amd.com, Nehal-bakulchandra.Shah@amd.com, Ken.Xue@amd.com, Thomas Gleixner , Linus Walleij , "open list:PIN CONTROL 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 Hi Daniel, On Tue, Jul 17, 2018 at 6:30 AM Daniel Drake wrote: > > On Mon, Jul 16, 2018 at 7:57 PM, Daniel Kurtz wrote: > > Commit 6afb10267c1692 ("pinctrl/amd: fix masking of GPIO interrupts") > > changed to the clearing of interrupt status bits to a RMW in a critical > > section. This works, but is a bit overkill. > > > > The relevant interrupt/wake status bits are in the Most Significant Byte > > of a 32-bit word. These two are the only write-able bits in this byte. > > I don't have the hardware to test this any more, and I also don't have > any docs to double if those are really the only writable bits, but > looking at the existing driver code it does seem to be the case. > > I think you should retain the comment noting that the value of the > register may have changed since it was read just a few lines above > (and hence explaining more precisely why we make the special effort > just to modify the MSB), just in case there is further rework of this > code in future and we end up walking into the same trap. It was one of > those issues that took a frustratingly long time to figure out... Sounds reasonable. How about: - /* Clear interrupt. - * We must read the pin register again, in case the - * value was changed while executing - * generic_handle_irq() above. + /* + * Write-1-to-clear irq/wake status bits in MSByte. + * All other bits in this byte are read-only. + * This avoids modifying the lower 24-bits because they may have + * changed while executing generic_handle_irq() above. */ > > Thanks > Daniel