llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Ansuel Smith <ansuelsmth@gmail.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org
Subject: Re: [RFC PATCH v6 06/11] leds: trigger: netdev: add hardware control support
Date: Wed, 4 May 2022 06:05:49 +0800	[thread overview]
Message-ID: <202205040646.Qyd8nG2X-lkp@intel.com> (raw)
In-Reply-To: <20220503151633.18760-7-ansuelsmth@gmail.com>

Hi Ansuel,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on robh/for-next]
[also build test ERROR on net-next/master net/master linus/master v5.18-rc5 next-20220503]
[cannot apply to pavel-leds/for-next]
[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]

url:    https://github.com/intel-lab-lkp/linux/commits/Ansuel-Smith/Adds-support-for-PHY-LEDs-with-offload-triggers/20220503-232347
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: hexagon-randconfig-r041-20220501 (https://download.01.org/0day-ci/archive/20220504/202205040646.Qyd8nG2X-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 363b3a645a1e30011cc8da624f13dac5fd915628)
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/d5c00815ca4c96e479d3653feceef0d4f21723c2
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Ansuel-Smith/Adds-support-for-PHY-LEDs-with-offload-triggers/20220503-232347
        git checkout d5c00815ca4c96e479d3653feceef0d4f21723c2
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/leds/trigger/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/leds/trigger/ledtrig-netdev.c:102:8: error: call to undeclared function 'led_trigger_blink_mode_is_supported'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                           if (led_trigger_blink_mode_is_supported(led_cdev, detail->bit))
                               ^
>> drivers/leds/trigger/ledtrig-netdev.c:137:13: error: no member named 'hw_control_configure' in 'struct led_classdev'
                   led_cdev->hw_control_configure(led_cdev, BIT(TRIGGER_NETDEV_LINK),
                   ~~~~~~~~  ^
>> drivers/leds/trigger/ledtrig-netdev.c:138:13: error: use of undeclared identifier 'BLINK_MODE_ZERO'
                                                  BLINK_MODE_ZERO);
                                                  ^
   drivers/leds/trigger/ledtrig-netdev.c:146:14: error: no member named 'hw_control_configure' in 'struct led_classdev'
                           led_cdev->hw_control_configure(led_cdev, BIT(detail->bit),
                           ~~~~~~~~  ^
>> drivers/leds/trigger/ledtrig-netdev.c:147:14: error: use of undeclared identifier 'BLINK_MODE_ENABLE'
                                                          BLINK_MODE_ENABLE);
                                                          ^
>> drivers/leds/trigger/ledtrig-netdev.c:150:13: error: no member named 'hw_control_start' in 'struct led_classdev'
                   led_cdev->hw_control_start(led_cdev);
                   ~~~~~~~~  ^
>> drivers/leds/trigger/ledtrig-netdev.c:503:17: error: no member named 'hw_control_status' in 'struct led_classdev'
                   if (led_cdev->hw_control_status(led_cdev)) {
                       ~~~~~~~~  ^
   drivers/leds/trigger/ledtrig-netdev.c:504:19: error: no member named 'hw_control_configure' in 'struct led_classdev'
                           rc = led_cdev->hw_control_configure(led_cdev, BIT(TRIGGER_NETDEV_LINK),
                                ~~~~~~~~  ^
   drivers/leds/trigger/ledtrig-netdev.c:505:12: error: use of undeclared identifier 'BLINK_MODE_ZERO'
                                                               BLINK_MODE_ZERO);
                                                               ^
   9 errors generated.


vim +/led_trigger_blink_mode_is_supported +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

           reply	other threads:[~2022-05-03 22:06 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20220503151633.18760-7-ansuelsmth@gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202205040646.Qyd8nG2X-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ansuelsmth@gmail.com \
    --cc=kbuild-all@lists.01.org \
    --cc=llvm@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).