Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1427061AbdDVU2Z (ORCPT ); Sat, 22 Apr 2017 16:28:25 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:33737 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1426960AbdDVU2T (ORCPT ); Sat, 22 Apr 2017 16:28:19 -0400 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: bug fix for registers debugfs file implementation [RFC] From: Variksla X-Mailer: iPhone Mail (14D27) In-Reply-To: <20170421172709.dqz7vq3vor56a5qg@sirena.org.uk> Date: Sat, 22 Apr 2017 13:28:15 -0700 Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org Message-Id: References: <20170421172709.dqz7vq3vor56a5qg@sirena.org.uk> To: Mark Brown , ckeepax@opensource.wolfsonmicro.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v3MKSd8E010834 Content-Length: 2209 Lines: 50 > On Apr 21, 2017, at 10:27 AM, Mark Brown wrote: Thanks for the response. > >> On Sat, Apr 01, 2017 at 02:13:41AM -0700, noman pouigt wrote: >> Current registers debugfs file implementation doesn't >> handle if the size exceeds 4k. It just dumps 4k of registers. >> Fix this by using the seq_file which already handles >> the file offset logic instead of reinventing the wheel. >> >> I am wondering if there is any issue is doing below which >> I am not aware of? > > If I remember correctly this is done the way it is because seq_file has > to iterate through the entire file to get to the point being read by the > application. This is a *very* big overhead for some applications (like > monitoring some registers to see what they're doing) on bigger devices, Wondering why would the user space application be monitoring the registers? > especially if there's lots of uncached stuff and the reads have to go to > the hardware. With the current code you can open the file, seek to the > registers you're interested in and read only them. You'll notice that > the other debug files have been converted over to seq_file as they're > pure software and there's less reason to repeatedly read them. Yes. I noticed that and that is why I realized that I am doing something wrong. > > I'm also very surprised that this is failing for you as I know this code > has been fairly heavily exercised with devices with very large register > maps much larger than 4k and my own testing is mainly doing cats which > seemed to work last time I tried and should be iterating over the 4k > boundary... what's the actual failure mode? I'm guessing it's I have integrated Florida codec(wm8281) from cirrus and it has more than 4K registers. I could not dump more than 4K with the existing interface. Charles, are you able to dump all the registers? > something if we end a register exactly on a page boundary or something? > > Also your patch is completely tab/space mangled so it's not appliable. > >> +static void regmap_debugfs_stop(struct seq_file *s, void *v) >> +{ >> +} > > The need for empty functions is worrying... In several other places in kernel code the usage is similar.