Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2035925ybt; Sun, 21 Jun 2020 07:17:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyc6Fvin7+eOLoWKV5s7uons/QPunx12Ir43orNeXHZv6FZ7gWB40crx8b/7zRKi153QkWs X-Received: by 2002:a50:e8c8:: with SMTP id l8mr6675783edn.386.1592749073374; Sun, 21 Jun 2020 07:17:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592749073; cv=none; d=google.com; s=arc-20160816; b=aI6/rz/EVFEQCMX5c/4g4kOvNxZdSb47BvBwWRq6vYBTtAQldKS5hPfpO8ae/iHkz8 B9idVCjqWtnPSWWHxMo5ZXcSfyfLbzmvo/B1F5PjZ2fn0XW+VXAwQy9E08RFaCLwqTSC zJ+szEe886hopvcAh3FuX7eEhUhSchWr20oIqzcCwZJ5s3M8Sv2REH88Z7CpVWpLniQL I8HsYjYzIU23A+6x9/HlAv7bgcqOicWYf9O6hHaXMoosHUvJME4XffU8UBS7C5Lr4W0E H33orL10tbRqobcgMq3veTTEFup3VHsG+ZfQSCCy20u0ZhMeY1hflwnEp9K2sAIAwpbp y0SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=ZF/Org4ein5GHXEP9qlfqPfU9/owt/dGHSyRh19Ah1M=; b=qOJk/bu5waoLvEZou2AgywM0FkVLZZc9vfTNY8F3jOIkB3Szd/H9SDmTAO42abrNCy MU68Bf9xIvWPnA8FupfeRsnkyoQjWa6i3Sw3kpuJy+0ULiSgVuMIZkzHIJ5XeM48LpQE psY2A1VxRPfYZ3QPsSKNOyhBLfyMXwB9bufNzW1zp8N3yzLv/G/ofArpAvT3NHYUJWuo kbwmLKkSzjolosFRgVYiRFzp1EYXZLozrghb1qPP21fUPPO8D2WWHfmwq7VD3fF/WXqF LFAn0DgTcLTDjQISnroefcCydyGwqSyOJpvep0LFvCKGWASYGpspW16i+TGUBvhxMIWH tAxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=x+y3ACx8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r19si2887860edw.168.2020.06.21.07.17.28; Sun, 21 Jun 2020 07:17:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=x+y3ACx8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730153AbgFUONH (ORCPT + 99 others); Sun, 21 Jun 2020 10:13:07 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:55550 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730129AbgFUONH (ORCPT ); Sun, 21 Jun 2020 10:13:07 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 05LECwQh125744; Sun, 21 Jun 2020 09:12:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1592748778; bh=ZF/Org4ein5GHXEP9qlfqPfU9/owt/dGHSyRh19Ah1M=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=x+y3ACx87yb2ZT/YwvoXHtXm2SXHXOOvz/Gw592FDNH3V36FMlll1KduN2AkV8pOv Y6K7bZIFltgxVqA4qhH22Q0tuY5tSkDKNPz77B9ssUxDm6LxSpjPjjZBRT4euTpjUb UFn0/9pJATEXcPT9gASmMN2gD702IjbkXDreQOkU= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 05LECwXZ081528 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 21 Jun 2020 09:12:58 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Sun, 21 Jun 2020 09:12:58 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Sun, 21 Jun 2020 09:12:58 -0500 Received: from [10.250.52.63] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 05LECwUT021461; Sun, 21 Jun 2020 09:12:58 -0500 Subject: Re: [RESEND PATCH v27 11/15] leds: lp55xx: Add multicolor framework support to lp55xx To: Jacek Anaszewski , , CC: , , , References: <20200615201522.19677-12-dmurphy@ti.com> <202006180032.JW0i39C6%lkp@intel.com> <0a8a6f57-678d-b1b9-41e5-5e58c15cfe6b@ti.com> <58ad7723-131f-6930-00d7-1144c993110c@gmail.com> <56823113-4875-4813-8627-84b0d1792391@ti.com> <04473d1d-5cd8-7d1f-7c5d-8d8b582df464@ti.com> <1f5dd2f9-01c7-1f74-9b93-0ae2a6dac915@gmail.com> From: Dan Murphy Message-ID: <69c01524-c4a4-55c8-578e-24b26bc863b8@ti.com> Date: Sun, 21 Jun 2020 09:12:58 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <1f5dd2f9-01c7-1f74-9b93-0ae2a6dac915@gmail.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jacek On 6/19/20 5:10 PM, Jacek Anaszewski wrote: > Dan, > > On 6/19/20 6:35 PM, Dan Murphy wrote: >> Jacek >> >> On 6/18/20 6:26 PM, Jacek Anaszewski wrote: >>> On 6/19/20 12:09 AM, Jacek Anaszewski wrote: >>>> Dan, >>>> >>>> On 6/18/20 11:44 PM, Dan Murphy wrote: >>>>> Jacek >>>>> >>>>> On 6/18/20 4:21 PM, Jacek Anaszewski wrote: >>>>>> Dan, >>>>>> >>>>>> On 6/18/20 12:33 AM, Dan Murphy wrote: >>>>>>> Jacek >>>>>>> >>>>>>> On 6/17/20 4:41 PM, Jacek Anaszewski wrote: >>>>>>>> Dan, >>>>>>>> >>>>>>>> On 6/17/20 9:22 PM, Dan Murphy wrote: >>>>>>>>> Pavel/Jacek >>>>>>>>> >>>>>>>>> On 6/17/20 11:28 AM, kernel test robot wrote: >>>>>>>>>> Hi Dan, >>>>>>>>>> >>>>>>>>>> I love your patch! Yet something to improve: >>>>>>>>>> >>>>>>>>>> [auto build test ERROR on pavel-linux-leds/for-next] >>>>>>>>>> [cannot apply to j.anaszewski-leds/for-next] >>>>>>>>>> [if your patch is applied to the wrong git tree, please drop >>>>>>>>>> us a note to help >>>>>>>>>> improve the system. BTW, we also suggest to use '--base' >>>>>>>>>> option to specify the >>>>>>>>>> base tree in git format-patch, please see >>>>>>>>>> https://stackoverflow.com/a/37406982] >>>>>>>>>> >>>>>>>>>> url: >>>>>>>>>> https://github.com/0day-ci/linux/commits/Dan-Murphy/Multicolor-Framework-v27/20200616-042217 >>>>>>>>>> >>>>>>>>>> base: >>>>>>>>>> git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git >>>>>>>>>> for-next >>>>>>>>>> config: ia64-randconfig-r015-20200617 (attached as .config) >>>>>>>>>> compiler: ia64-linux-gcc (GCC) 9.3.0 >>>>>>>>>> reproduce (this is a W=1 build): >>>>>>>>>> ???????? wget >>>>>>>>>> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross >>>>>>>>>> -O ~/bin/make.cross >>>>>>>>>> ???????? chmod +x ~/bin/make.cross >>>>>>>>>> ???????? # save the attached .config to linux build tree >>>>>>>>>> ???????? COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 >>>>>>>>>> make.cross ARCH=ia64 >>>>>>>>>> >>>>>>>>>> If you fix the issue, kindly add following tag as appropriate >>>>>>>>>> Reported-by: kernel test robot >>>>>>>>>> >>>>>>>>>> All errors (new ones prefixed by >>, old ones prefixed by <<): >>>>>>>>>> >>>>>>>>>> ia64-linux-ld: drivers/leds/leds-lp55xx-common.o: in function >>>>>>>>>> `lp55xx_set_mc_brightness': >>>>>>>>>>>> drivers/leds/leds-lp55xx-common.c:146: undefined reference >>>>>>>>>>>> to `led_mc_calc_color_components' >>>>>>>>>> ia64-linux-ld: drivers/leds/leds-lp55xx-common.o: in function >>>>>>>>>> `devm_led_classdev_multicolor_register': >>>>>>>>>>>> include/linux/led-class-multicolor.h:74: undefined >>>>>>>>>>>> reference to `devm_led_classdev_multicolor_register_ext' >>>>>>>>>> vim +146 drivers/leds/leds-lp55xx-common.c >>>>>>>>>> >>>>>>>>>> ??? 138 >>>>>>>>>> ??? 139??? static int lp55xx_set_mc_brightness(struct >>>>>>>>>> led_classdev *cdev, >>>>>>>>>> ??? 140??????????????????????? enum led_brightness brightness) >>>>>>>>>> ??? 141??? { >>>>>>>>>> ??? 142??????? struct led_classdev_mc *mc_dev = >>>>>>>>>> lcdev_to_mccdev(cdev); >>>>>>>>>> ??? 143??????? struct lp55xx_led *led = >>>>>>>>>> mcled_cdev_to_led(mc_dev); >>>>>>>>>> ??? 144??????? struct lp55xx_device_config *cfg = >>>>>>>>>> led->chip->cfg; >>>>>>>>>> ??? 145 >>>>>>>>>> ? > 146 led_mc_calc_color_components(&led->mc_cdev, brightness); >>>>>>>>>> ??? 147??????? return cfg->multicolor_brightness_fn(led); >>>>>>>>>> ??? 148 >>>>>>>>> >>>>>>>>> Well this was a mess to figure out. >>>>>>>>> >>>>>>>>> The only fix I can figure out here is to remove the >>>>>>>>> >>>>>>>>> ???? depends on LEDS_CLASS_MULTI_COLOR || !LEDS_CLASS_MULTI_COLOR >>>>>>>>> >>>>>>>>> from each child device and add >>>>>>>>> >>>>>>>>> ???? select LEDS_CLASS_MULTI_COLOR >>>>>>>>> >>>>>>>>> to the LP55XX_COMMON >>>>>>>>> >>>>>>>>> This way the Multi color framework will inherit the symbol >>>>>>>>> that was set by the COMMON flag which is inherited by majority >>>>>>>>> from the child flags. >>>>>>>> >>>>>>>> Did you try this? >>>>>>>> >>>>>>>> --- a/drivers/leds/Kconfig >>>>>>>> +++ b/drivers/leds/Kconfig >>>>>>>> @@ -398,6 +398,7 @@ config LEDS_LP50XX >>>>>>>> ?config LEDS_LP55XX_COMMON >>>>>>>> ??????? tristate "Common Driver for TI/National >>>>>>>> LP5521/5523/55231/5562/8501" >>>>>>>> ??????? depends on LEDS_LP5521 || LEDS_LP5523 || LEDS_LP5562 || >>>>>>>> LEDS_LP8501 >>>>>>>> +?????? depends on LEDS_CLASS_MULTI_COLOR || >>>>>>>> !LEDS_CLASS_MULTI_COLOR >>>>>>>> ??????? depends on OF >>>>>>>> ??????? select FW_LOADER >>>>>>>> ??????? select FW_LOADER_USER_HELPER >>>>>>>> >>>>>>>> >>>>>>> Yes I did >>>>>>> >>>>>>> That gave unmet dependencies. >>>>>>> >>>>>>> WARNING: unmet direct dependencies detected for LEDS_LP55XX_COMMON >>>>>>> ?? Depends on [m]: NEW_LEDS [=y] && (LEDS_LP5521 [=n] || >>>>>>> LEDS_LP5523 [=m] || LEDS_LP5562 [=y] || LEDS_LP8501 [=y]) && >>>>>>> (LEDS_CLASS_MULTI_COLOR [=m] || !LEDS_CLASS_MULTI_COLOR [=m]) && >>>>>>> OF [=y] >>>>>>> ?? Selected by [y]: >>>>>>> ?? - LEDS_LP5562 [=y] && NEW_LEDS [=y] && LEDS_CLASS [=y] && I2C >>>>>>> [=y] >>>>>>> ?? - LEDS_LP8501 [=y] && NEW_LEDS [=y] && LEDS_CLASS [=y] && I2C >>>>>>> [=y] >>>>>>> ?? Selected by [m]: >>>>>>> ?? - LEDS_LP5523 [=m] && NEW_LEDS [=y] && LEDS_CLASS [=y] && I2C >>>>>>> [=y] && (LEDS_CLASS_MULTI_COLOR [=m] || !LEDS_CLASS_MULTI_COLOR >>>>>>> [=m]) >>>>>>> >>>>>> >>>>>> When I was testing that yesterday I also had the same warning at >>>>>> some >>>>>> point of testing different Kconfig setups, but with what I showed >>>>>> above >>>>>> it ceased to appear. Now every time I am doing "make oldconfig" the >>>>>> CONFIG_LEDS_LP55XX_COMMON=y entry gets changed to =m with the config >>>>>> from the test bot. >>>>>> >>>>> That is not what I saw in my testing especially after doing a >>>>> distclean >>>> >>>> Could you please give your exact steps after "make distclean" and >>>> copying test bot config to the kernel root directory? >>>> >>>> Also, please share the toolchain you're using for tests. >>> >>> Actually at this stage the toolchain is of lesser relevance. >>> >>> I've tried once more and indeed the problem shows up. >>> >>> It is caused by the driver entries doing >>> >>> "select LEDS_LP55XX_COMMON". >>> >>> Select sets config to "y" so it conflicts with >>> "depends on LEDS_CLASS_MULTI_COLOR || !LEDS_CLASS_MULTI_COLOR" >>> in the "config LEDS_LP55XX_COMMON". >>> >>> Your proposed fix will block the possibility of building >>> LED_CLASS_MULTI_COLOR as a module when LP55XX drivers >>> are enabled so this is also not an option. >>> >>> Solving this riddle will require some more thinking. >>> I haven't analyzed it in detail but maybe "imply" statement from >>> kconfig-language.rst could help somehow here. >> >> The multicolor framework will build as a module if the LED_CLASS is >> defined as a module. >> >> See attached test_defconfig > > But it will be impossible to enable CONFIG_LEDS_LP50XX without > CONFIG_LEDS_CLASS_MULTI_COLOR if you will remove > > depends on LEDS_CLASS_MULTI_COLOR || !LEDS_CLASS_MULTI_COLOR. > I was not removing the dependency for the LP50xx only the LP55xx. > This is actually why the above entry was needed. > > LP55XX drivers have to work also without multicolor class. > Well I am not sure how else to resolve this problem.? Because the LP55xx has multi level dependencies. Only the LP55xx_common has the dependency on the MC framework. The device drivers do not. The issue is the mixing and matching of the MC fw as a module vs the LP55XX_COMMON as a built-in. Dan