Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp905492imu; Wed, 16 Jan 2019 09:23:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN7PmJfWqiiT73XWULD0xXVlEKbXhke0QONMKlU6haV9CQRu27ytEebH8ULnS4oWuw1T2tQQ X-Received: by 2002:a63:6d48:: with SMTP id i69mr9494536pgc.215.1547659417976; Wed, 16 Jan 2019 09:23:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547659417; cv=none; d=google.com; s=arc-20160816; b=Rf7Rr6zCeSimMgJ93FOpMR0bP71IsnRJV55VTSkVSJLrE1UzpInRKGCIJSE+MmIQAg crrwpREMOzIxz/AhZ/EZCQjXADRpTtrjWF+lf6QCWp1W1ahYvbz45cp43x74FsFLlaaE IG5lHqxgSA+8fR61cUMOPV9tttjRWfmezAgq4uEV7QtUJ+J3eUJSWaxSWHwN33Xe09DT L9vIDKZewBDEXm/KcHlqaiOawEPu1uQBD25wh/iDcFvQ/oKTyAdfOdMi0GJrXcnSjol2 LtNrue6HIKX1nmwp8s8CE1WxfeTVO3tPt1vBL3Wm+QL26uyFw3tR10ZJaCSFqZ5MHit0 PVQg== 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=TE0RgnW3gqU0OlkU8MUNLqvrL9uNfl6XW2noSA9azQs=; b=tzdgRQDVypdQVuvzTry0HVfojhf1IIwryAVY5nQLKIZ07CWCWkGtIh6QPRkROlNBi9 Cx8TuTZOmJThMJlw41pFy7rdOi86bo0eVGpLrAMjoyB9ld2zbAZijTkrycpdTRlpe5PK Nc62h+Ya2mlS5m6w1JgAhlvvcT4HUwXRWRs+msD2xn2+EbI9pp0M2/hIWhkEaudMPHcz TUuPlULIzyiHanbI4lRpaY3LlyrWlIVDmTsBL1NnViKOK2eopPpcMuZ4HsRHcf+mfQh6 Tb8HSWtdOfgrkXdzlZrqc91dlzkIx3leqP0r22xeujqQ3lUXvffixVHoPqyiLTee1Jkk ONLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@jms.id.au header.s=google header.b=R+s9h54c; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y191si6553011pgd.4.2019.01.16.09.23.16; Wed, 16 Jan 2019 09:23:37 -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=@jms.id.au header.s=google header.b=R+s9h54c; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391395AbfAOXOl (ORCPT + 99 others); Tue, 15 Jan 2019 18:14:41 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:33423 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728858AbfAOXOk (ORCPT ); Tue, 15 Jan 2019 18:14:40 -0500 Received: by mail-qk1-f193.google.com with SMTP id d15so2683263qkj.0; Tue, 15 Jan 2019 15:14:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jms.id.au; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TE0RgnW3gqU0OlkU8MUNLqvrL9uNfl6XW2noSA9azQs=; b=R+s9h54coXHYdJx8cPfptzIQ6EHyxabE/zalyJeZFNbB8K5zBlEFDNDpvc57P1g3Lo nSWBMv9VnM2XyVTCY+DjQgY7+e0H1JmVbIFVKleKd2vQdqmrgoWg7igdhL84hSjg51vF CQztl+nbg4qT1IgbHeUtT+OvtFlxTadZWzC98= 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=TE0RgnW3gqU0OlkU8MUNLqvrL9uNfl6XW2noSA9azQs=; b=FM06N0RCBaPN+nGrbvBJbcPp1rZQKsST1fEctsGmAwuKZb/jXs4z3amtsmGFmw2CL3 kGTUn05sueSzwyGuBe9VtQlTclQtjU+NBz9q1u9CfRAoH/FBLnVoXFmUlkUB5ZvY89ZI bCQNPSZXZC4xbcbfmkXTJEhHK/LPGaIvf5Wmg8ZFH7dOk9fYGplHwq9ePf8tuXzRNTgs EsjUOpGxVy3UiQqHplmBsOc/Zz5IOSiinP5LR6WRU4Tn7UaXfYvRkUniNlNTyeuTjCdU txinEvlocbqtbag9MePmDd1onQAFe92CHMNilVlGmZKplFY2Gv0M8gOXC9fUZMHOCOvn oyHA== X-Gm-Message-State: AJcUukfnfXIZ7slJO/yNyytagxPwEjCurQUofChcE6lpFL8wgqGy+Pf0 CjqRkyKU0LZCl/qBrrbiqndnmoLx526IlXIudPE= X-Received: by 2002:a37:61cd:: with SMTP id v196mr4656877qkb.25.1547594078546; Tue, 15 Jan 2019 15:14:38 -0800 (PST) MIME-Version: 1.0 References: <20190107214136.5256-1-jae.hyun.yoo@linux.intel.com> <20190107214136.5256-7-jae.hyun.yoo@linux.intel.com> In-Reply-To: From: Joel Stanley Date: Wed, 16 Jan 2019 10:14:26 +1100 Message-ID: Subject: Re: [PATCH v10 06/12] peci: Add a PECI adapter driver for Aspeed AST24xx/AST25xx To: Jae Hyun Yoo Cc: Andrew Jeffery , Greg Kroah-Hartman , Arnd Bergmann , devicetree , Linux Kernel Mailing List , OpenBMC Maillist , Andy Shevchenko , Robin Murphy , Ryan Chen , Haiyue Wang , James Feist , Vernon Mauery 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, 15 Jan 2019 at 09:49, Jae Hyun Yoo wrote: > >> + /** > >> + * We check that the regmap works on this very first access, > >> + * but as this is an MMIO-backed regmap, subsequent regmap > >> + * access is not going to fail and we skip error checks from > >> + * this point. > > > > Why do you use a regmap for this driver? AFAICT it has exclusive > > ownership over the register range it uses, which is sometimes a reason > > to use a regmap over a mmio region. > > > > I'm not sure if you've ever disassembled drivers/base/regmap/regmap.o, > > but if you do you will find that a single mmio read turns into > > hundreds of instructions. > > > > No specific reason. regmap makes some overhead as you mentioned but it > also provides some advantages on access simplification, endianness > handling and register dump at run time. I would not insist using of > regmap if you prefer using of raw readl and writel. Do you want replace > regmap with readl and writel in this driver? I think that would be best. You raise some good points about the regmap API, and you're not alone in using it for these reasons. We should look in to providing a suitable API without the overhead, or making regmap more efficient for the mmio case.