lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202212151329.b9n9Ph5y-lkp@intel.com>
Date:   Thu, 15 Dec 2022 13:31:13 +0800
From:   kernel test robot <lkp@...el.com>
To:     Christian Marangi <ansuelsmth@...il.com>,
        Andrew Lunn <andrew@...n.ch>,
        Florian Fainelli <f.fainelli@...il.com>,
        Vladimir Oltean <olteanv@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        Jonathan Corbet <corbet@....net>, Pavel Machek <pavel@....cz>,
        "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>,
        John Crispin <john@...ozen.org>, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
        linux-leds@...r.kernel.org, Tim Harvey <tharvey@...eworks.com>,
        Alexander Stein <alexander.stein@...tq-group.com>,
        Rasmus Villemoes <rasmus.villemoes@...vas.dk>
Cc:     oe-kbuild-all@...ts.linux.dev, netdev@...r.kernel.org
Subject: Re: [PATCH v7 06/11] leds: trigger: netdev: add hardware control
 support

Hi Christian,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on pavel-leds/for-next]
[also build test ERROR on robh/for-next net-next/master net/master linus/master v6.1 next-20221215]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Christian-Marangi/Adds-support-for-PHY-LEDs-with-offload-triggers/20221215-080414
base:   git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git for-next
patch link:    https://lore.kernel.org/r/20221214235438.30271-7-ansuelsmth%40gmail.com
patch subject: [PATCH v7 06/11] leds: trigger: netdev: add hardware control support
config: arc-randconfig-r005-20221214
compiler: arceb-elf-gcc (GCC) 12.1.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
        # https://github.com/intel-lab-lkp/linux/commit/eb6fea2dd465c5aa879ed5c47d7109bd441797c2
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Christian-Marangi/Adds-support-for-PHY-LEDs-with-offload-triggers/20221215-080414
        git checkout eb6fea2dd465c5aa879ed5c47d7109bd441797c2
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arc SHELL=/bin/bash drivers/leds/trigger/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All errors (new ones prefixed by >>):

   drivers/leds/trigger/ledtrig-netdev.c: In function 'validate_baseline_state':
>> drivers/leds/trigger/ledtrig-netdev.c:102:29: error: implicit declaration of function 'led_trigger_blink_mode_is_supported'; did you mean 'led_trigger_blink_oneshot'? [-Werror=implicit-function-declaration]
     102 |                         if (led_trigger_blink_mode_is_supported(led_cdev, detail->bit))
         |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |                             led_trigger_blink_oneshot
   drivers/leds/trigger/ledtrig-netdev.c: In function 'set_baseline_state':
>> drivers/leds/trigger/ledtrig-netdev.c:137:25: error: 'struct led_classdev' has no member named 'hw_control_configure'
     137 |                 led_cdev->hw_control_configure(led_cdev, BIT(TRIGGER_NETDEV_LINK),
         |                         ^~
>> drivers/leds/trigger/ledtrig-netdev.c:138:48: error: 'BLINK_MODE_ZERO' undeclared (first use in this function)
     138 |                                                BLINK_MODE_ZERO);
         |                                                ^~~~~~~~~~~~~~~
   drivers/leds/trigger/ledtrig-netdev.c:138:48: note: each undeclared identifier is reported only once for each function it appears in
   drivers/leds/trigger/ledtrig-netdev.c:146:33: error: 'struct led_classdev' has no member named 'hw_control_configure'
     146 |                         led_cdev->hw_control_configure(led_cdev, BIT(detail->bit),
         |                                 ^~
>> drivers/leds/trigger/ledtrig-netdev.c:147:56: error: 'BLINK_MODE_ENABLE' undeclared (first use in this function); did you mean 'IF_LINK_MODE_DEFAULT'?
     147 |                                                        BLINK_MODE_ENABLE);
         |                                                        ^~~~~~~~~~~~~~~~~
         |                                                        IF_LINK_MODE_DEFAULT
>> drivers/leds/trigger/ledtrig-netdev.c:150:25: error: 'struct led_classdev' has no member named 'hw_control_start'
     150 |                 led_cdev->hw_control_start(led_cdev);
         |                         ^~
   drivers/leds/trigger/ledtrig-netdev.c: In function 'netdev_trig_activate':
>> drivers/leds/trigger/ledtrig-netdev.c:503:29: error: 'struct led_classdev' has no member named 'hw_control_status'
     503 |                 if (led_cdev->hw_control_status(led_cdev)) {
         |                             ^~
   drivers/leds/trigger/ledtrig-netdev.c:504:38: error: 'struct led_classdev' has no member named 'hw_control_configure'
     504 |                         rc = led_cdev->hw_control_configure(led_cdev, BIT(TRIGGER_NETDEV_LINK),
         |                                      ^~
   drivers/leds/trigger/ledtrig-netdev.c:505:61: error: 'BLINK_MODE_ZERO' undeclared (first use in this function)
     505 |                                                             BLINK_MODE_ZERO);
         |                                                             ^~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +102 drivers/leds/trigger/ledtrig-netdev.c

    68	
    69	static bool validate_baseline_state(struct led_netdev_data *trigger_data)
    70	{
    71		struct led_classdev *led_cdev = trigger_data->led_cdev;
    72		struct netdev_led_attr_detail *detail;
    73		u32 hw_blink_mode_supported = 0;
    74		bool force_sw = false;
    75		int i;
    76	
    77		for (i = 0; i < ARRAY_SIZE(attr_details); i++) {
    78			detail = &attr_details[i];
    79	
    80			/* Mode not active, skip */
    81			if (!test_bit(detail->bit, &trigger_data->mode))
    82				continue;
    83	
    84			/* Hardware only mode enabled on software controlled led */
    85			if (led_cdev->blink_mode == SOFTWARE_CONTROLLED &&
    86			    detail->hardware_only)
    87				return false;
    88	
    89			/* Check if the mode supports hardware mode */
    90			if (led_cdev->blink_mode != SOFTWARE_CONTROLLED) {
    91				/* With a net dev set, force software mode.
    92				 * With modes are handled by hardware, led will blink
    93				 * based on his own events and will ignore any event
    94				 * from the provided dev.
    95				 */
    96				if (trigger_data->net_dev) {
    97					force_sw = true;
    98					continue;
    99				}
   100	
   101				/* With empty dev, check if the mode is supported */
 > 102				if (led_trigger_blink_mode_is_supported(led_cdev, detail->bit))
   103					hw_blink_mode_supported |= BIT(detail->bit);
   104			}
   105		}
   106	
   107		/* We can't run modes handled by both software and hardware.
   108		 * Check if we run hardware modes and check if all the modes
   109		 * can be handled by hardware.
   110		 */
   111		if (hw_blink_mode_supported && hw_blink_mode_supported != trigger_data->mode)
   112			return false;
   113	
   114		/* Modes are valid. Decide now the running mode to later
   115		 * set the baseline.
   116		 * Software mode is enforced with net_dev set. With an empty
   117		 * one hardware mode is selected by default (if supported).
   118		 */
   119		if (force_sw || led_cdev->blink_mode == SOFTWARE_CONTROLLED)
   120			trigger_data->blink_mode = SOFTWARE_CONTROLLED;
   121		else
   122			trigger_data->blink_mode = HARDWARE_CONTROLLED;
   123	
   124		return true;
   125	}
   126	
   127	static void set_baseline_state(struct led_netdev_data *trigger_data)
   128	{
   129		int i;
   130		int current_brightness;
   131		struct netdev_led_attr_detail *detail;
   132		struct led_classdev *led_cdev = trigger_data->led_cdev;
   133	
   134		/* Modes already validated. Directly apply hw trigger modes */
   135		if (trigger_data->blink_mode == HARDWARE_CONTROLLED) {
   136			/* We are refreshing the blink modes. Reset them */
 > 137			led_cdev->hw_control_configure(led_cdev, BIT(TRIGGER_NETDEV_LINK),
 > 138						       BLINK_MODE_ZERO);
   139	
   140			for (i = 0; i < ARRAY_SIZE(attr_details); i++) {
   141				detail = &attr_details[i];
   142	
   143				if (!test_bit(detail->bit, &trigger_data->mode))
   144					continue;
   145	
   146				led_cdev->hw_control_configure(led_cdev, BIT(detail->bit),
 > 147							       BLINK_MODE_ENABLE);
   148			}
   149	
 > 150			led_cdev->hw_control_start(led_cdev);
   151	
   152			return;
   153		}
   154	
   155		/* Handle trigger modes by software */
   156		current_brightness = led_cdev->brightness;
   157		if (current_brightness)
   158			led_cdev->blink_brightness = current_brightness;
   159		if (!led_cdev->blink_brightness)
   160			led_cdev->blink_brightness = led_cdev->max_brightness;
   161	
   162		if (!trigger_data->carrier_link_up) {
   163			led_set_brightness(led_cdev, LED_OFF);
   164		} else {
   165			if (test_bit(TRIGGER_NETDEV_LINK, &trigger_data->mode))
   166				led_set_brightness(led_cdev,
   167						   led_cdev->blink_brightness);
   168			else
   169				led_set_brightness(led_cdev, LED_OFF);
   170	
   171			/* If we are looking for RX/TX start periodically
   172			 * checking stats
   173			 */
   174			if (test_bit(TRIGGER_NETDEV_TX, &trigger_data->mode) ||
   175			    test_bit(TRIGGER_NETDEV_RX, &trigger_data->mode))
   176				schedule_delayed_work(&trigger_data->work, 0);
   177		}
   178	}
   179	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (112890 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ