From: Jae Hyun Yoo Subject: Re: [PATCH v10 06/12] peci: Add a PECI adapter driver for Aspeed AST24xx/AST25xx Date: Tue, 15 Jan 2019 15:36:43 -0800 Message-ID: <17179a43-9ac7-366a-bfe6-044e80875a06@linux.intel.com> References: <20190107214136.5256-1-jae.hyun.yoo@linux.intel.com> <20190107214136.5256-7-jae.hyun.yoo@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Joel Stanley Cc: devicetree , Ryan Chen , Andy Shevchenko , Arnd Bergmann , Andrew Jeffery , Greg Kroah-Hartman , OpenBMC Maillist , Linux Kernel Mailing List , James Feist , Vernon Mauery , Robin Murphy , Haiyue Wang List-Id: devicetree@vger.kernel.org On 1/15/2019 3:14 PM, Joel Stanley wrote: > 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. > Okay. I'll rewrite this driver code using readl and writel instead of regmap mmio. Thanks again for your review! Regards, Jae