Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751656AbdFINrm (ORCPT ); Fri, 9 Jun 2017 09:47:42 -0400 Received: from foss.arm.com ([217.140.101.70]:40994 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751527AbdFINrk (ORCPT ); Fri, 9 Jun 2017 09:47:40 -0400 Date: Fri, 9 Jun 2017 14:47:48 +0100 From: Will Deacon To: Marc Zyngier Cc: Palmer Dabbelt , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , olof@lixom.net, albert@sifive.com, patches@groups.riscv.org, Peter Zijlstra Subject: Re: [PATCH 10/17] irqchip: New RISC-V PLIC Driver Message-ID: <20170609134748.GL13955@arm.com> References: <20170523004107.536-1-palmer@dabbelt.com> <20170606230007.19101-1-palmer@dabbelt.com> <20170606230007.19101-11-palmer@dabbelt.com> <34ebb0fd-8d8b-3ec7-ecf1-f296e878bd5d@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <34ebb0fd-8d8b-3ec7-ecf1-f296e878bd5d@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 851 Lines: 20 On Wed, Jun 07, 2017 at 11:52:10AM +0100, Marc Zyngier wrote: > On 07/06/17 00:00, Palmer Dabbelt wrote: > > +static void plic_disable(struct plic_data *data, int i, int hwirq) > > +{ > > + struct plic_enable_context *enable = plic_enable_context(data, i); > > + > > + atomic_and(~(1 << (hwirq % 32)), &enable->mask[hwirq / 32]); > > This is still a device access, right? What does it mean to use the > atomic primitives on that? What are you racing against? I thought the > various context were private to an execution context... > > Adding Will and PeterZ to the CC list because they will probably have > their own views on this... atomic_* accesses to MMIO is almost certainly a bad idea. Is this atomic because you want to allow the function to run concurrently, or is it atomic because you want some guarantees from the endpoint's view? Will