From patchwork Thu Feb 6 07:23:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 3594231 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 41AB29F390 for ; Thu, 6 Feb 2014 07:24:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4C1C720127 for ; Thu, 6 Feb 2014 07:24:44 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9B30820125 for ; Thu, 6 Feb 2014 07:24:42 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WBJK4-0001lp-GR; Thu, 06 Feb 2014 07:24:32 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WBJK2-00067w-3P; Thu, 06 Feb 2014 07:24:30 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WBJJy-00066q-6X for linux-arm-kernel@lists.infradead.org; Thu, 06 Feb 2014 07:24:28 +0000 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N0K007KACJPHR40@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 06 Feb 2014 16:23:49 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.51]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 8C.7E.10364.58833F25; Thu, 06 Feb 2014 16:23:49 +0900 (KST) X-AuditID: cbfee690-b7f266d00000287c-f7-52f3388567fe Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 55.39.28157.48833F25; Thu, 06 Feb 2014 16:23:49 +0900 (KST) Received: from DOJG1HAN03 ([12.23.120.99]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N0K00HWACJOMNC0@mmp1.samsung.com>; Thu, 06 Feb 2014 16:23:48 +0900 (KST) From: Jingoo Han To: 'Linus Walleij' , 'Thierry Reding' References: <1391518634-6472-1-git-send-email-linus.walleij@linaro.org> <000401cf222f$43263b20$c972b160$%han@samsung.com> <000101cf2307$97a3c770$c6eb5650$%han@samsung.com> In-reply-to: <000101cf2307$97a3c770$c6eb5650$%han@samsung.com> Subject: Re: [PATCH] backlight: add PWM dependencies Date: Thu, 06 Feb 2014 16:23:48 +0900 Message-id: <000001cf230c$60ec1ca0$22c455e0$%han@samsung.com> MIME-version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac8iUE/iqGSybP6uTbyxaFS67OfvHwAtkufwAADCzSA= Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCIsWRmVeSWpSXmKPExsVy+t8zY91Wi89BBvuvcFv8nXSM3WJH23E2 i8sLL7FaTPmznMli0+NrrBaXd81hs7h7dxWjxe3LvBY/d81jceD0aGnuYfP4/WsSo8fOWXfZ Pe5c28PmsXlJvUffllWMHp83yQWwR3HZpKTmZJalFunbJXBlrDu1iLFgmmrFps2mDYw/ZLsY OTkkBEwkZq3tY4KwxSQu3FvP1sXIxSEksIxR4s6pc4wwRR8nLmOFSCxilHj37RULSEJI4Bej xIfTmSA2m4CaxJcvh9lBb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Fj8j2wzcwCWhLrdx5n grDlJTaveQs0kwPoVHWJR391IY6wkni6/Cw7RImIxL4X7xgnMArNQjJpFpJJs5BMmoWkZQEj yypG0dSC5ILipPRcI73ixNzi0rx0veT83E2M4ATyTHoH46oGi0OMAhyMSjy8G9Z/ChJiTSwr rsw9xCjBwawkwrvV/HOQEG9KYmVValF+fFFpTmrxIcZkoEcnMkuJJucDk1teSbyhsYmZkaWR mYWRibk5acJK4rwHW60DhQTSE0tSs1NTC1KLYLYwcXBKNTAWr/wTKNFfkx/IcY41oO38jgl6 +u6FjBY7MvgW1l51F9nu3rHi8HGz6juhHomff31aPzP9hepr/Uee9p8O1K2LFF06U+F1OqPX 8S1u+9n9Noe8XSqX9sVhRaLlm5ec5q18x9QOP7t+eLvQs7Qnvi9eZpjvFf31bIlF3OsLzzi1 NT58kil+eOG+EktxRqKhFnNRcSIACg1+bGQDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140206_022426_481745_4837AE79 X-CRM114-Status: GOOD ( 24.51 ) X-Spam-Score: -7.4 (-------) Cc: linux-pwm@vger.kernel.org, 'Eric Miao' , 'Arnd Bergmann' , 'Jingoo Han' , linux-kernel@vger.kernel.org, 'Russell King - ARM Linux' , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thursday, February 06, 2014 3:50 PM, Jingoo Han wrote: > On Wednesday, February 05, 2014 5:58 PM, Linus Walleij wrote: > > On Wed, Feb 5, 2014 at 6:01 AM, Jingoo Han wrote: > > > On Tuesday, February 04, 2014 9:57 PM, Linus Walleij wrote: > > >> > > >> In some compilations the LM3630A and LP855X backlight drivers > > >> fail like this: > > >> > > >> drivers/built-in.o: In function `lm3630a_pwm_ctrl': > > >> drivers/video/backlight/lm3630a_bl.c:168: undefined reference to `pwm_config' > > >> drivers/video/backlight/lm3630a_bl.c:172: undefined reference to `pwm_disable' > > >> drivers/video/backlight/lm3630a_bl.c:170: undefined reference to `pwm_enable' > > >> drivers/built-in.o: In function `lp855x_pwm_ctrl': > > >> drivers/video/backlight/lp855x_bl.c:249: undefined reference to `pwm_config' > > >> drivers/video/backlight/lp855x_bl.c:253: undefined reference to `pwm_disable' > > >> drivers/video/backlight/lp855x_bl.c:251: undefined reference to `pwm_enable' > > >> > > >> This is because both drivers depend on the PWM framework, so > > >> add this dependency to their Kconfig entries. > > > > > > However, even though, when CONFIG_PWM is not enabled, the problem > > > should not happen. pwm_config(),pwm_disable(), and pwm_enable() > > > are already defined for CONFIG_PWM=n case as below. > > > > So you may think but it does happen :-) > > > > I reproduced this with the defconfig for ARM pxa255-idp and enabling > > all boards for that platform, then enabling all available backlight drivers > > as compiled-in objects (y). > > However, I cannot reproduce it with mainline kernel 3.14-rc1. > > 1. make pxa255-idp_defconfig > 2. Enabling all boards > (System Type -> Intel PXA2xx/PXA3xx Implementations -> ...) > 3. Enabling all available backlight drivers as compiled-in objects (y) > > In this case, the LM3630A and LP855X backlight drivers are compiled > properly as below: > > drivers/video/backlight/lm3630a_bl.o > drivers/video/backlight/lp855x_bl.o > > Would you check it with mainline kernel 3.14-rc1? > If the errors happen, please attach the .config file. (+cc Arnd Bergmann) Oh, sorry. There was my mistake. I tested this with linux-next tree. With linux 3.14-rc1, it makes the problem as below. drivers/built-in.o: In function `lm3630a_pwm_ctrl': drivers/video/backlight/lm3630a_bl.c:168: undefined reference to `pwm_config' drivers/video/backlight/lm3630a_bl.c:172: undefined reference to `pwm_disable' drivers/video/backlight/lm3630a_bl.c:170: undefined reference to `pwm_enable' drivers/built-in.o: In function `lp855x_pwm_ctrl': drivers/video/backlight/lp855x_bl.c:249: undefined reference to `pwm_config' drivers/video/backlight/lp855x_bl.c:253: undefined reference to `pwm_disable' drivers/video/backlight/lp855x_bl.c:251: undefined reference to `pwm_enable' > > > > > > ./include/linux/pwm.h > > > #if IS_ENABLED(CONFIG_PWM) || IS_ENABLED(CONFIG_HAVE_PWM) > > > ..... > > > #else > > > > Hm PXA that I am using defines CONFIG_HAVE_PWM, but doesn't > > provide the required signatures (pwm_config/pwm_disable/pwm_enable). > > > > One of two things is wrong: > > > > - Either the PXA platform is breaking the CONFIG_HAVE_PWM > > contract by not providing pwm_config/pwm_disable/pwm_enable > > functions. Then HAVE_PWM should be removed from the PXA > > Kconfig selects. > > > > Or: > > > > - There is no such contract that these functions must exist if > > CONFIG_HAVE_PWM is defined, and the > > #if IS_ENABLED(CONFIG_HAVE_PWM) > > should be removed from > > > > Does anyone know which one it is? > > > > PWM subsystem maintainer? :-) Thierry Reding, Would you confirm this? In the case of "CONFIG_HAVE_PWM=y && CONFIG_PWM=n", it makes the problem. The HAVE_PWM symbol is only for legacy platforms that provide the PWM API without using the generic framework. PXA looks to use the generic PWM framework. Then, how about removing "select HAVE_PWM" from PXA as below? Best regards, Jingoo Han Acked-by: Linus Walleij --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig @@ -7,7 +7,6 @@ comment "Intel/Marvell Dev Platforms (sorted by hardware release time)" config MACH_PXA3XX_DT bool "Support PXA3xx platforms from device tree" select CPU_PXA300 - select HAVE_PWM select POWER_SUPPLY select PXA3xx select USE_OF @@ -23,12 +22,10 @@ config ARCH_LUBBOCK config MACH_MAINSTONE bool "Intel HCDDBBVA0 Development Platform (aka Mainstone)" - select HAVE_PWM select PXA27x config MACH_ZYLONITE bool - select HAVE_PWM select PXA3xx .....