Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp646728ybc; Tue, 19 Nov 2019 07:05:34 -0800 (PST) X-Google-Smtp-Source: APXvYqxoAH+sD91C1E5OIZwhtpftfw+q64m/iBP5Xl+PByaHPeyPwCjI/cHkiiPceGQkgZrSFCqM X-Received: by 2002:a1c:b1c3:: with SMTP id a186mr6454306wmf.10.1574175934817; Tue, 19 Nov 2019 07:05:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574175934; cv=none; d=google.com; s=arc-20160816; b=zF8ND5RzH/brlc90UeUwaHeCEpLPAcW+aXyNPWgQX72zil7Jb7Bm8Ugh7R63EMakyX zhxIRiIhqnlc9mBi2CwISYIcUrdVClom97hjQFUp31UWIEpK8gXEcPn2eJ7LYri/GINv Q65Biw7W5ErgpEGYQpIWZAfHkJQFohiZ2YOPA6tAGzUTALY3R5FuhCWUs+CGnX0x16Xn gujau0Qyw2Y1KYptnxMY3GdTO4k/41wq82MUemGu+RBMrHIN3VO95p/OodONBG+1JUuU hTyJTnq3d66/QmY7mNlgTH0wLvq6STb5eQwBWl6Zp9dGQmM/QDfAnqNZctcg4W5QebJ7 wPmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=PbOCer/DbEIDkV9HM4Ua32e1t8DBngr+pDXysIFGRg8=; b=TA+gcvXxRKKiEu4LOnBEA/RhO190cVcK+wY/QI5b7g5cpMywK/Hw2xTbdOnUwZQZj3 Vru5lHNSYJFKrHf7wyGP2vTx+G7P6fyZ7RrMkH/ZIOHmzop+IjJDr9jbPS2EcjKaxut7 A22GUNvSYMzMgUBNyZ1y1OUHNotsCc4V8YG/I/071ZF1ip8PzoWl+Z2fRftmxxN/yuKz CVXGzKIWx3AciTs3cNflDCo/xXE5FvDK47z6GvsAHrFwkEmex4y5dRoH4frPzATk2Ca7 K+cmtisd1DSBq0zw8+ZCA8JE3PnjsPWPJ1+QfjhyoOXEmPI1mNzGAMc8TYEavg5QTLTi Ptkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ghhb7CWn; 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 d30si16293462edj.289.2019.11.19.07.05.09; Tue, 19 Nov 2019 07:05:34 -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=@linaro.org header.s=google header.b=ghhb7CWn; 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 S1727682AbfKSPDK (ORCPT + 99 others); Tue, 19 Nov 2019 10:03:10 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:41393 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726637AbfKSPDJ (ORCPT ); Tue, 19 Nov 2019 10:03:09 -0500 Received: by mail-lj1-f196.google.com with SMTP id m4so18754449ljj.8 for ; Tue, 19 Nov 2019 07:03:08 -0800 (PST) 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:content-transfer-encoding; bh=PbOCer/DbEIDkV9HM4Ua32e1t8DBngr+pDXysIFGRg8=; b=ghhb7CWnwNxAbrzbSuXvrfTWrUaikmjOuxcxbZzhekhweUFV9we26m0KktjuUT12cy DozWtpM03n61uITyiCInX3tY4YBxpKlEOG2nSGKyK5N9nZYuhQI7I8nlgr7v9u4WTAiC azEp+p7C9AEL7DBegmAPPbrND76N9Jjf0OWzfEkUmTdIa55WHk3ybiz29nshZn4Gtits Bc0GjA0BnNBYKZpWPx7MQIa9cxGUQeloQ3M7jYsv2LvZQFDeLGf0L2qUnJTskweJCjCu 156mBCrJ72nFj2G7luKBxfO5xwCFDuJ3NdbRLreV7CtFnrHx/itCksfMS1Fxmfo83llm eq1g== 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:content-transfer-encoding; bh=PbOCer/DbEIDkV9HM4Ua32e1t8DBngr+pDXysIFGRg8=; b=DWKjl4XqWhyecbilTdZ+RxmhkdbJu8vu+8YRCVAjqTPQ1RD7eQGRCha9HpwZupAyoy KAEiedbn8kq0Bv3mhNwVeErjbg2fD5bi0ko7MIunTWp5tJF5+TK7P4pKULLv1Cv0tIqS Ys9Xtqw+E+SFW3KDdSp2XY/qihA6kQaOyaoQxUEGC9Q0xd/8RhDznVyirg1DYQDlhPQZ i92Gc+3uMLEkOE36EpXldoK3s2IMV4YV1Fvif3mVFySq0aCcZbKhDOiTmp85yrYsJ0+f V+H9nWxsbUNKBMhu37aBA7oIuxO9yQdlGtKOgMiqU8uBGXvjUid56dPH1IqSI9ZAJoNz zX+Q== X-Gm-Message-State: APjAAAXHjCMzTCMD+Wo9jY5UHO1q2/QMm0vT6Wg5aeAOB+9ZrdIJezUh UEtsNVyrxlMJYyNVxXf4pxJ2I42BYsvgvijWlcyJoQ== X-Received: by 2002:a2e:8597:: with SMTP id b23mr4384572lji.218.1574175787982; Tue, 19 Nov 2019 07:03:07 -0800 (PST) MIME-Version: 1.0 References: <1573560684-48104-1-git-send-email-yash.shah@sifive.com> <1573560684-48104-4-git-send-email-yash.shah@sifive.com> In-Reply-To: From: Linus Walleij Date: Tue, 19 Nov 2019 16:02:56 +0100 Message-ID: Subject: Re: [PATCH 3/4] gpio: sifive: Add GPIO driver for SiFive SoCs To: Bartosz Golaszewski Cc: Yash Shah , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "palmer@dabbelt.com" , "Paul Walmsley ( Sifive)" , "aou@eecs.berkeley.edu" , "tglx@linutronix.de" , "jason@lakedaemon.net" , "maz@kernel.org" , "bmeng.cn@gmail.com" , "atish.patra@wdc.com" , Sagar Kadam , "linux-gpio@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Sachin Ghadi Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 18, 2019 at 11:15 AM Bartosz Golaszewski wrote: > pon., 18 lis 2019 o 11:03 Yash Shah napisa=C5=82(a= ): > > As suggested in the comments received on the RFC version of this patch[= 0], I am trying to use regmap MMIO by looking at gpio-mvebu.c. I got your p= oint regarding the usage of own locks is not making any sense. > > Here is what I will do in v2: > > 1. drop the usage of own locks > > 2. consistently use regmap_* apis for register access (replace all iowr= ites). > > Does this make sense now? > > The thing is: the gpio-mmio code you're (correctly) reusing uses a > different lock - namely: bgpio_lock in struct gpio_chip. If you want > to use regmap for register operations, then you need to set > disable_locking in regmap_config to true and then take this lock > manually on every access. Is it really so? The bgpio_lock does protect the registers used by regmap-mmio but unless the interrupt code is also using the same registers it is fine to have a different lock for those. Is the interrupt code really poking into the very same registers as passed to bgpio_init()? Of course it could be seen as a bit dirty to poke around in the same memory space with regmap and the bgpio_* accessors but in practice it's no problem if they never touch the same things. Yours, Linus Walleij