Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031096AbbKFArq (ORCPT ); Thu, 5 Nov 2015 19:47:46 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:25907 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030611AbbKFArn (ORCPT ); Thu, 5 Nov 2015 19:47:43 -0500 X-AuditID: cbfec7f4-f79c56d0000012ee-99-563bf8acf362 Subject: Re: [PATCH v3 7/7] drivers: soc: Add support for Exynos PMU driver To: Pankaj Dubey , linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <1445864143-25695-1-git-send-email-pankaj.dubey@samsung.com> <1445864143-25695-8-git-send-email-pankaj.dubey@samsung.com> <56381A66.1010406@samsung.com> <563AE9C7.4030701@samsung.com> Cc: kgene.kim@samsung.com, thomas.ab@samsung.com, amitdanielk@gmail.com From: Krzysztof Kozlowski X-Enigmail-Draft-Status: N1110 Message-id: <563BF8A9.5040708@samsung.com> Date: Fri, 06 Nov 2015 09:47:37 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-version: 1.0 In-reply-to: <563AE9C7.4030701@samsung.com> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCLMWRmVeSWpSXmKPExsVy+t/xy7prfliHGVzYqGLxcfVLNovXLwwt ehdcZbPY9Pgaq8XlXXPYLGac38dksWjrF3aLjmWMDhweO2fdZffYvKTeo2/LKkaPz5vkAlii uGxSUnMyy1KL9O0SuDKmn1zLXtAtVHHi3GfGBsbrfF2MnBwSAiYSW7dvZYOwxSQu3FsPZHNx CAksZZRom/eSHcL5wigxYfpWVpAqYQFviZ/TZoFViQhMYZS42LOMEaLqOKPElts7mUGqmAXc JVZ2/2EEsdkEjCU2L18CtUNOord7EksXIwcHr4CWxIwrZiBhFgFVia9Ld4G1igpESEyc0AC2 jFdAUOLH5HssIDangLbE5MeHWUFamQX0JO5f1ILYJC+xec1b5gmMgrOQdMxCqJqFpGoBI/Mq RtHU0uSC4qT0XEO94sTc4tK8dL3k/NxNjJCw/7KDcfExq0OMAhyMSjy8N5ZYhwmxJpYVV+Ye YpTgYFYS4a05BhTiTUmsrEotyo8vKs1JLT7EKM3BoiTOO3fX+xAhgfTEktTs1NSC1CKYLBMH p1QDo2TzY44HVw6ez9y2purL75az3/IW3Zil2Xsyah+PSXXzjq+F1kyHjuYfaRb9OP39yvsW m7cZ7OSZ9pEjfb4Pn3xmnPytIxUnJ139sHdS7syld3s1X/2q/zmB7yLboSmaMSUHNnwMNN0v uaNAZM15Ds1EE424+yw3Lt2ff8RZ8lsne1f20ukPLWSVWIozEg21mIuKEwHqWJtudwIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2499 Lines: 66 On 05.11.2015 14:31, Pankaj Dubey wrote: > Hi Krzysztof, > > On Tuesday 03 November 2015 07:52 AM, Krzysztof Kozlowski wrote: > >> >> 1. Please reorder the exynos_sys_powerdown_conf() to be after the >> statics. I am thinking also about adding EXPORT_SYMBOL... but maybe this >> would be over-thinking. >> > > I could not understand your point of reordering, will you please explain > this. Usually static functions are put at beginning of a file and the externally linkable ones (including exportable) are at the end. This allows quick finding of what is exported by this unit. Mixing static-nonstatic-static brings confusion/ This is a driver so everything except it is static, so I see two choices: 1. Put it in front, just after pmu_context definition. 2. Put it in back, just before the probe. > >> 2. I think the proper location of everything is drivers/power/reset/. >> Although I don't have strong opinion. >> > > There has been discussion about the proper location for this driver, > initial attempt was done in "drivers/mfd" folder but then we realized > that this driver is not exactly fitting in MFD category. > There was suggestion from Catalin Marinas [1], [2] to move it to > "drivers/power" or a more suitable place other than mfd. As I received > comments from Bartlomiej [3] and other members also (sorry I could not > produce all links as it was quite more than a year back), I feel driver > is very much SoC specific and hence decided to move it here. > > 1: https://lkml.org/lkml/2014/4/28/879 > 2: > http://lists.infradead.org/pipermail/linux-arm-kernel/2014-April/252018.html > > 3: > http://lists.infradead.org/pipermail/linux-arm-kernel/2014-April/244690.html In drivers/power/reset there are already very-SoC-specific reset handlers. All of them are non-reusable outside of some SoC family. However I don't think it really matters - both locations (soc and power) seem fine to me. Looking at Bart's comments I see that you did not resolve all of them. One was left: "what happens if exynos_sys_powerdown_conf() is called while there are no platform devices binded to a driver but driver itself is loaded." Looking at the code NULL pointer exception will happen on pmu_context dereference. Best regards, Krzysztof -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/