Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1113659img; Tue, 26 Feb 2019 14:33:18 -0800 (PST) X-Google-Smtp-Source: AHgI3IZltZRb/8hOekhvuzdSp8Ux0DAHmDNY2niYYKtRjWbFn0SCbjKwywAkP0wGs8jqIMHkEJKF X-Received: by 2002:a63:54c:: with SMTP id 73mr26255666pgf.295.1551220398347; Tue, 26 Feb 2019 14:33:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551220398; cv=none; d=google.com; s=arc-20160816; b=WVBp1nXPAKczoT2eJQbMLyfL/sbDPYAU0ttxiEdbYUtiN5CC3ohDYvmDoY/EN4SivG PkbBmcP2mW3XbFTu19TBi1cPgiIdcA6/Cxt/LYPADYJR0SjzwQWXfZlCYh5s2Tu9U74v 4mT+cUbg9DmpX7iy8qkX0KNTGPWUTE7rxPufCcyffy99MtsaZmDG7tjDwCmiha3rM0cA FktiHUWHY57nf3NB+WJMhAWXmqCtwisp97OCw03CIqSlW2WDG9ZH2ui1lMpZwtVAGFbD Kox2P9fGfU8UC3USIOo1ulG1Rx3U8dJ2gN9DngkOMeHQu7FX0PlQ7rU9uuYvsxPZfBdm BEHQ== 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=Syx8ZkNs6xbsqFqTcYYoT2xEMErvYw1Uy1r0qmWNWd4=; b=cNIy2lW90wp87s1Gmk/hWmCcJ+VaoLGjpWSa3qxCkCtyYIPcyhDBsSxnVHJrdPP3Sl jtqQY/EZM6j884vxXOMxLcWTYLML2GYf5AluAVMQWxzH00ckxoq1k9VPvOOPgI81Eep6 +hZeHbJ2j3R6oqL6Ga19ul0hTdHU01xwKFvOGtsqOxZaX1FTnYyace3hg/HeXNFuDTGy +DIslDPTts6WIUwh2Kq7iBXgi8mp/en9RNFMz6WpMd8x/z7fGtIt1UwpGbwNR9R40z5s 2E5equ1vnzWF9dnpJR5J46KJsfEqbnikND9CXPnCf4rMMzT6lW5G8iauqyA+uWWCCnSi WF8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ZtcxbkeS; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k6si50664pla.2.2019.02.26.14.33.03; Tue, 26 Feb 2019 14:33:18 -0800 (PST) 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=@google.com header.s=20161025 header.b=ZtcxbkeS; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729233AbfBZWcg (ORCPT + 99 others); Tue, 26 Feb 2019 17:32:36 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:34722 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728766AbfBZWcg (ORCPT ); Tue, 26 Feb 2019 17:32:36 -0500 Received: by mail-pf1-f193.google.com with SMTP id u9so6937630pfn.1 for ; Tue, 26 Feb 2019 14:32:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Syx8ZkNs6xbsqFqTcYYoT2xEMErvYw1Uy1r0qmWNWd4=; b=ZtcxbkeSYtP27F/OOI0Pu+kjr63YzODu9uoJl3hFPFbF3VvFzLY5zJabn4WrfiuacV uKW5KEZsPiaWKuFQRu0aF+2OtKFucTN/1Tbd0MjjZDpLojkebfGiZTCCUMg6iXf1GDVl vAcGsKFhSHofZdoUsPSHXmdFSddQU2i05OcCVV9NwNGUI2vLaibQra6ikQwh/VKazRNN qIEBEA16ltUQLNc9zl392e4M16j4o6fYNXoYjpj7PMQMsn04hvl4NhM1F4S6Jz1v3AEq sJ8C4VhdFuXroGu+fp5MDKMqGT7wHnIgOZX2Fa8cnUFMxqvYf8IK6HIhAHZ/RCGYTaVn M/rQ== 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=Syx8ZkNs6xbsqFqTcYYoT2xEMErvYw1Uy1r0qmWNWd4=; b=bL626OjmmPo8jbB84z+nEcuJZR4+1i27zox31RyQsNYXqJclYSHxbFR6cryQKI2ctr lxX9Jmyh06doGrS8WaSfAaO1KNu4XQ5sBxUXg/q0ofVtD0Ie/ayNbWvSP1VOAvrFI9Rm IQ+sV+2UOahMNax+U9jtdxdYuMkW2zga+rd0IRu4luXej6Px+X1smHLz3PMK7+0qtbak CFssnAW5aHullJUeiL3Uf9PEpmKHOvX7MPsnL/EtQNauO1HxU82rgMhi8mnS28TM+ImC pCzWrfqByB7fL/4Mx6JMMM8BYhRxNjfQ55KyHxyxXKkPi6zRwU0a85gOk5oYERUoaYT3 1oWQ== X-Gm-Message-State: AHQUAuYidqBCoUcSBAcXg8wa2bHJGsF9W8o0ecZhcOE6b15z1d7wDYic hak56CzMXa0H2yNyOBBF14LH8WCTuU/+WucL8On17Q== X-Received: by 2002:a65:43cc:: with SMTP id n12mr25610546pgp.218.1551220355672; Tue, 26 Feb 2019 14:32:35 -0800 (PST) MIME-Version: 1.0 References: <20190221222537.137331-1-venture@google.com> <692c6c5d-9090-4e1f-9324-a03da381b003@www.fastmail.com> <578fe6cd-cc7c-4f6d-8f7e-39c9f183a8e4@www.fastmail.com> In-Reply-To: <578fe6cd-cc7c-4f6d-8f7e-39c9f183a8e4@www.fastmail.com> From: Patrick Venture Date: Tue, 26 Feb 2019 14:32:24 -0800 Message-ID: Subject: Re: [PATCH 2/2] drivers/misc: Add Aspeed P2A control driver To: Andrew Jeffery Cc: Arnd Bergmann , Greg Kroah-Hartman , Joel Stanley , Linux Kernel Mailing List , linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.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, Feb 26, 2019 at 2:20 PM Andrew Jeffery wrote: > > > > On Wed, 27 Feb 2019, at 08:26, Patrick Venture wrote: > > On Tue, Feb 26, 2019 at 1:42 PM Patrick Venture wrote: > > > > > > On Sun, Feb 24, 2019 at 5:26 PM Andrew Jeffery wrote: > > > > > > > > > > > > > > > > + > > > > > + /* Access to these needs to be locked, held via probe, mapping ioctl, > > > > > + * and release, remove. > > > > > + */ > > > > > + struct mutex tracking; > > > > > + u32 readers; > > > > > + u32 readerwriters[P2A_REGION_COUNT]; > > > > > > > > Might be better to use refcount_t here instead of u32? > > > > > > Ack > > > > refcount requires atomic, is that something we have with the ast2400, 2500? > > Ah, we do on the 2500 (armv6) but not the 2400 (armv5) Ok, so to avoid that complexity I'm not going to swap in refcounts. but good to know for future reference since it's basically what I was doing manually.