From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753563AbbJGTNN (ORCPT ); Wed, 7 Oct 2015 15:13:13 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:50207 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751688AbbJGTNL (ORCPT ); Wed, 7 Oct 2015 15:13:11 -0400 From: Arnd Bergmann To: Viresh Kumar Cc: Greg Kroah-Hartman , Michael Turquette , Stephen Boyd , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Bartlomiej Zolnierkiewicz , Nishanth Menon , Dmitry Torokhov , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] PM / OPP: fix debugfs files for 64-bit Date: Wed, 07 Oct 2015 21:12:55 +0200 Message-ID: <5308760.2G5KJFF9Pi@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20151007130324.GA4557@linux> References: <5706174.BUsqiXljxZ@wuerfel> <20151007125735.GA8170@kroah.com> <20151007130324.GA4557@linux> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:vLqFUH2YjdNNy7Dj/VMp9ZErE04VLOdvKRSwNYXUvOLqdXOBrrg A26uWGy+0NPNizl9dPZkdkSsjkrAXTo+Sc20h37E1X3BSzulpO68HJbx3EjF+CAOObnBV3I Zk/OW6iM8tPxADm6PqmJfw1Wca00p8s1WNyZA6473agCxBNYRnFhmiIrh01LxVMIuL+Omto KXdDYGzGhQpOlJIUISOcQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:LLmnicaPmEk=:So0Cl6f+7/Wyy+DUlBJTXW fJ0Zd5xA+cBY/y406Q+aTz53RFMDOy0jIST5JFYKC9jtTnHyceErMTa3ixorBQV2qk3UUaoiN CsZrGqibHOdaVHJ1aOdVr/b6lilnZyMEMMfMkWZIH2f4muVXXCEalcCn+/s3rUZjbFJSItFXl NuX7+PJfsEH5ic+uGDllP7jz0lL7ZmwQlu16h9HkVN0zou+A63JnX/6koWLpDGFjQhZJCXT6t Krr/oppvH3iDfAvt15w0goIC5sRcs7RQY8LmTt5ltuS3+27ftiXewSSdv96Dfngs2b64MQqXh tL9cunUqd2F32bu4PVdHemQjxILo4ouOwIGkl7zRwooxLQSDUG+hbaGksciS2Hl39VLsYXgD+ jl1g4NHCz8buJ9K7mgjhSN3rt9zuGGgZSgSEaidOXe/japC6xvKBeSRzCgQyA5w2XRqpZkVwA akODwY5L3hPWwqwAuHeNIxPDwebVrCQmPsywkzR89WyTBOD7R4/MPUpklJYrv7QMeKlxmuuwc eaWRk4m32CTFI9bSiObjzuIUOG5gl/TwSTLAHBcu00fh+jSQDsSDcMZL+xdZeat9ncfKkBDP7 YhqTJWrBMT33Zk7g9fkPf1CC6yuSSdY7ST46McyFxIDQumumoaeAcDX4AKGY1eKHJyjwxC6e5 j0QH9D5EcWs0ViROmgM94Ovij1kDEZDVpn7jWaxWpENF1Ov4sDW9Sxjb1FxeA5vb3CJWnxFIl VW3ym6+0S0JEYdKx Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 07 October 2015 18:33:24 Viresh Kumar wrote: > Cc'ing Mike and Stephen.. > > On 07-10-15, 13:57, Greg Kroah-Hartman wrote: > > On Wed, Oct 07, 2015 at 04:51:49PM +0530, Viresh Kumar wrote: > > > On 07-10-15, 12:07, Greg Kroah-Hartman wrote: > > > > Why would you be wanting to create a "unsigned long" as an api anyway? > > > > Just force it to be u64 all the time, can't you do that? > > > > > > Okay, so the variable in question (lets say frequency) is an 'unsigned > > > long' and that's how all the APIs of clock framework expect/define > > > it. > > > > > > And you are probably saying that we do this: > > > > > > unsigned long freq; > > > > > > debugfs_create_u64((u64 *)&freq); > > > > > > Right? Or are you asking to update clock APIs to be converted to u64? > > > > Yes, they should be u64 as I doubt you want to debug problems that you > > have in the driver where it works on a 64bit system but doesn't on a > > 32bit one. > > Firstly changing the clock API (and other similar APIs) to make > frequency u64 instead of 'unsigned long', looks like a giant effort. > There are too many users of those API, etc.. > > Over that, it might be good performance wise to use u32 for 32 bit > systems and u64 for 64 bit one, to represent clock frequency and maybe > that's why we chose unsigned long there. I think it clearly makes sense to have a fixed length for each of these members: either 32 bit is enough to represent all possible values, then there is no need to make them 'long' on 64-bit architectures, or 32 bit is not enough and then the code is broken on 32-bit architectures today and should be fixed. In my patch, I assumed that if 32-bit architectures work fine today, then we don't need more range on 64-bit architectures either. Arnd