Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753796Ab2JRCaN (ORCPT ); Wed, 17 Oct 2012 22:30:13 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:16570 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753653Ab2JRCaL (ORCPT ); Wed, 17 Oct 2012 22:30:11 -0400 X-AuditID: cbfee60f-b7f656d000001a3b-56-507f69b1f84c Date: Thu, 18 Oct 2012 02:30:09 +0000 (GMT) From: MyungJoo Ham Subject: Re: [PATCH] PM / OPP: predictable fail results for opp_find* functions To: Nishanth Menon , "linux-pm@vger.kernel.org" Cc: =?euc-kr?Q?=B9=DA=B0=E6=B9=CE?= , "Rafael J. Wysocki" , Kevin Hilman , "linux-kernel@vger.kernel.org" Reply-to: myungjoo.ham@samsung.com MIME-version: 1.0 X-MTR: 20121018022815467@myungjoo.ham Msgkey: 20121018022815467@myungjoo.ham X-EPLocale: ko_KR.euc-kr X-Priority: 3 X-EPWebmail-Msg-Type: personal X-EPWebmail-Reply-Demand: 0 X-EPApproval-Locale: X-EPHeader: ML X-EPTrCode: X-EPTrName: X-MLAttribute: X-RootMTR: 20121018022815467@myungjoo.ham X-ParentMTR: X-ArchiveUser: X-CPGSPASS: N Content-type: text/plain; charset=euc-kr MIME-version: 1.0 Message-id: <25178027.160161350527407382.JavaMail.weblogic@epml06> DLP-Filter: Pass X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGKsWRmVeSWpSXmKPExsVy+t8zLd2NmfUBBgf7dSwu75rD5sDo8XmT XABjFJdNSmpOZllqkb5dAlfG/CXr2Qoe8VV0zrrN0sC4hq+LkZNDSEBdYtGSk2wgtoSAicTi 66eZIWwxiQv31gPFuYBqljFKXP78kBmmaN7jj+wQifmMEotvfWIHSbAIqEpc/7+FtYuRg4NN QE9i5udkkLCwgL/Ep4PXwUpEBCIlmm/sZAbpZRY4xSjx4OkmNogrlCTW7HvFAmLzCghK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ftYGRpijF39/DBXnlzh2ewcTyJ0gvU/uB8OM2b35C9S/AhJTzxyEatWS WNF8B2o8n8SahW9ZYMbsOrWcGab3/pa5TCA2s4CixJTuh+wQtpbElx/72NC9xSvgJDHxaxfT BEa5WUhSs5C0z0LSjqxmASPLKkbR1ILkguKk9FRTveLE3OLSvHS95PzcTYzgFPWMfwfjogaL Q4wCHIxKPLwBS2sDhFgTy4orcw8xSnAwK4nw1jjXBwjxpiRWVqUW5ccXleakFh9i9AFG4ERm KdHkfGD6zCuJNzQ2MDY0tDQ3MDU0ssAhrCTOW+aREiAkkJ5YkpqdmlqQWgQzjomDU6qBcXKW 6Ks56orspTc+vWzYw/IpY6+zt9t6TW4zi7er7vwNTGKcsMRYU3iRZvpblaBr2UKmvLGREVwX fBabJyTmHBV6evPTs07laHGuV8emsJetfnmvaZpT8p+wbQ3zd0jckW9yOjlx0k/jN3XL79dd us7wI9a/aHeW/QUGR/mPhWE2PB5GVw0uKrEUZyQaajEXFScCADvEKm1+AwAA X-CFilter-Loop: Reflected 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 base64 to 8bit by mail.home.local id q9I2UKnS008188 Content-Length: 1492 Lines: 44 > Currently the opp_find* functions return -ENODEV when: > a) it cant find a device (e.g. request for an OPP search on device > which was not registered) > b) When it cant find a match for the search strategy used > > This makes life a little in-efficient for users such as devfreq > to make reasonable judgement before switching search strategies. > > So, standardize the return results as following: > -EINVAL for bad pointer parameters > -ENODEV when device cannot be found > -ERANGE when search fails > > This has the following benefit for devfreq implementation: > > Current code: > opp = opp_find_freq_floor(dev, freq); > /* Following search triggers even for un-registered device */ > if (opp == ERR_PTR(-ENODEV)) > opp = opp_find_freq_ceil(dev, freq); > > Vs (after this change): > opp = opp_find_freq_floor(dev, freq); > /* Will only be triggered if search logic fails: intended usage */ > if (opp == ERR_PTR(-ERANGE)) > opp = opp_find_freq_ceil(dev, freq); > > Cc: MyungJoo Ham > Cc: Kyungmin Park > Cc: "Rafael J. Wysocki" > Cc: Kevin Hilman > Cc: linux-pm@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > > Signed-off-by: Nishanth Menon Thanks. Acked-by: MyungJoo Ham > ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?