Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1041922AbdDUSdN (ORCPT ); Fri, 21 Apr 2017 14:33:13 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:57750 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1039072AbdDUSdH (ORCPT ); Fri, 21 Apr 2017 14:33:07 -0400 Date: Fri, 21 Apr 2017 18:27:09 +0100 From: Mark Brown To: noman pouigt Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org Message-ID: <20170421172709.dqz7vq3vor56a5qg@sirena.org.uk> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qyztiwf3n5ibkedg" Content-Disposition: inline In-Reply-To: X-Cookie: I'll be Grateful when they're Dead. User-Agent: NeoMutt/20170306 (1.8.0) X-SA-Exim-Connect-IP: 2001:470:1f1d:6b5::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: bug fix for registers debugfs file implementation [RFC] X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2363 Lines: 56 --qyztiwf3n5ibkedg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > 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, 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. 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 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... --qyztiwf3n5ibkedg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlj6QOwACgkQJNaLcl1U h9DhgAf+NkjjR1qhBUCte1gyzCRK+5C0aQeUu8fLHZqAhk3xisALCN5n8whauqDL zMxqg1w3G+mLTlcMe8nwjnGDOVg7/466uSQHjHFkfq/k1OvukQ2OmBy4clMb4X8d idAAUtzNwIfofRfuCgVSDWNiHv3rjiztM3a1fyjSAW6ijWf/ILt20WZd+9R/w1UA GDQ1yJfufL3nnYPsuJPNmCgcbApLWpCI9SAiG72s2/dGIehQAe1gLb+EtQ0OL5p2 dFtocY5hjjajurg5Fsr7Btxwg2vl0TDlupHGuOZVjag3JKCzmYsfadmcGM0Jj2/I vLGw2ic80SzxVW0H/FIKqxYjSu3pCg== =jihF -----END PGP SIGNATURE----- --qyztiwf3n5ibkedg--