From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH RFC leds + net-next v4 1/2] net: phy: add API for LEDs controlled by PHY HW
Date: Wed, 29 Jul 2020 02:47:05 +0800 [thread overview]
Message-ID: <202007290259.LZRv2sbz%lkp@intel.com> (raw)
In-Reply-To: <20200728150530.28827-2-marek.behun@nic.cz>
[-- Attachment #1: Type: text/plain, Size: 10101 bytes --]
Hi "Marek,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Marek-Beh-n/Add-support-for-LEDs-on-Marvell-PHYs/20200728-231233
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 5e619d73e6797ed9f2554a1bf996d52d8c91ca50
config: riscv-allmodconfig (attached as .config)
compiler: riscv64-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=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/net/phy/phy_led.c: In function 'phy_led_brightness_set':
drivers/net/phy/phy_led.c:18:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
18 | int ret;
| ^~~
drivers/net/phy/phy_led.c: In function 'of_phy_register_led':
drivers/net/phy/phy_led.c:44:12: error: 'struct led_classdev' has no member named 'trigger_type'; did you mean 'trigger_lock'?
44 | led->cdev.trigger_type = &phy_hw_led_trig_type;
| ^~~~~~~~~~~~
| trigger_lock
drivers/net/phy/phy_led.c: At top level:
drivers/net/phy/phy_led.c:173:3: error: 'struct led_trigger' has no member named 'trigger_type'
173 | .trigger_type = &phy_hw_led_trig_type,
| ^~~~~~~~~~~~
>> drivers/net/phy/phy_led.c:173:18: warning: initialization of 'unsigned int' from 'struct led_hw_trigger_type *' makes integer from pointer without a cast [-Wint-conversion]
173 | .trigger_type = &phy_hw_led_trig_type,
| ^
drivers/net/phy/phy_led.c:173:18: note: (near initialization for 'phy_hw_led_trig.leddev_list_lock.raw_lock.lock')
drivers/net/phy/phy_led.c:173:18: error: initializer element is not computable at load time
drivers/net/phy/phy_led.c:173:18: note: (near initialization for 'phy_hw_led_trig.leddev_list_lock.raw_lock.lock')
drivers/net/phy/phy_led.c:170:38: warning: missing braces around initializer [-Wmissing-braces]
170 | struct led_trigger phy_hw_led_trig = {
| ^
......
173 | .trigger_type = &phy_hw_led_trig_type,
| {{ }}
In file included from include/linux/linkage.h:7,
from include/linux/kernel.h:8,
from include/asm-generic/bug.h:19,
from arch/riscv/include/asm/bug.h:83,
from include/linux/bug.h:5,
from arch/riscv/include/asm/current.h:13,
from include/linux/sched.h:12,
from include/linux/ratelimit.h:6,
from include/linux/dev_printk.h:16,
from include/linux/device.h:15,
from include/linux/leds.h:12,
from drivers/net/phy/phy_led.c:9:
drivers/net/phy/phy_led.c:168:19: error: storage size of 'phy_hw_led_trig_type' isn't known
168 | EXPORT_SYMBOL_GPL(phy_hw_led_trig_type);
| ^~~~~~~~~~~~~~~~~~~~
include/linux/export.h:98:21: note: in definition of macro '___EXPORT_SYMBOL'
98 | extern typeof(sym) sym; \
| ^~~
include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
| ^~~~~~~~~~~~~~~
include/linux/export.h:159:33: note: in expansion of macro '_EXPORT_SYMBOL'
159 | #define EXPORT_SYMBOL_GPL(sym) _EXPORT_SYMBOL(sym, "_gpl")
| ^~~~~~~~~~~~~~
drivers/net/phy/phy_led.c:168:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
168 | EXPORT_SYMBOL_GPL(phy_hw_led_trig_type);
| ^~~~~~~~~~~~~~~~~
drivers/net/phy/phy_led.c:168:19: error: storage size of 'phy_hw_led_trig_type' isn't known
168 | EXPORT_SYMBOL_GPL(phy_hw_led_trig_type);
| ^~~~~~~~~~~~~~~~~~~~
include/linux/export.h:98:21: note: in definition of macro '___EXPORT_SYMBOL'
98 | extern typeof(sym) sym; \
| ^~~
include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
| ^~~~~~~~~~~~~~~
include/linux/export.h:159:33: note: in expansion of macro '_EXPORT_SYMBOL'
159 | #define EXPORT_SYMBOL_GPL(sym) _EXPORT_SYMBOL(sym, "_gpl")
| ^~~~~~~~~~~~~~
drivers/net/phy/phy_led.c:168:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
168 | EXPORT_SYMBOL_GPL(phy_hw_led_trig_type);
| ^~~~~~~~~~~~~~~~~
vim +173 drivers/net/phy/phy_led.c
27
28 static int of_phy_register_led(struct phy_device *phydev, struct device_node *np)
29 {
30 struct led_init_data init_data = {};
31 struct phy_device_led *led;
32 u32 reg;
33 int ret;
34
35 ret = of_property_read_u32(np, "reg", ®);
36 if (ret < 0)
37 return ret;
38
39 led = devm_kzalloc(&phydev->mdio.dev, sizeof(struct phy_device_led), GFP_KERNEL);
40 if (!led)
41 return -ENOMEM;
42
43 led->cdev.brightness_set_blocking = phy_led_brightness_set;
> 44 led->cdev.trigger_type = &phy_hw_led_trig_type;
45 led->addr = reg;
46
47 of_property_read_string(np, "linux,default-trigger", &led->cdev.default_trigger);
48
49 init_data.fwnode = &np->fwnode;
50 init_data.devname_mandatory = true;
51 init_data.devicename = phydev->attached_dev ? netdev_name(phydev->attached_dev) : "";
52
53 ret = phydev->drv->led_init(phydev, led);
54 if (ret < 0)
55 goto err_free;
56
57 ret = devm_led_classdev_register_ext(&phydev->mdio.dev, &led->cdev, &init_data);
58 if (ret < 0)
59 goto err_free;
60
61 return 0;
62 err_free:
63 devm_kfree(&phydev->mdio.dev, led);
64 return ret;
65 }
66
67 int of_phy_register_leds(struct phy_device *phydev)
68 {
69 struct device_node *node = phydev->mdio.dev.of_node;
70 struct device_node *leds, *led;
71 int ret;
72
73 if (!IS_ENABLED(CONFIG_OF_MDIO))
74 return 0;
75
76 if (!phydev->drv->led_init)
77 return 0;
78
79 leds = of_get_child_by_name(node, "leds");
80 if (!leds)
81 return 0;
82
83 for_each_available_child_of_node(leds, led) {
84 ret = of_phy_register_led(phydev, led);
85 if (ret < 0)
86 phydev_err(phydev, "Nonfatal error: cannot register LED from node %pOFn: %i\n",
87 led, ret);
88 }
89
90 return 0;
91 }
92 EXPORT_SYMBOL_GPL(of_phy_register_leds);
93
94 static void phy_hw_led_trig_deactivate(struct led_classdev *cdev)
95 {
96 struct phy_device *phydev = to_phy_device(cdev->dev->parent);
97 int ret;
98
99 mutex_lock(&phydev->lock);
100 ret = phydev->drv->led_set_hw_mode(phydev, led_cdev_to_phy_device_led(cdev), NULL);
101 mutex_unlock(&phydev->lock);
102 if (ret < 0) {
103 phydev_err(phydev, "failed deactivating HW mode on LED %s\n", cdev->name);
104 return;
105 }
106 }
107
108 static ssize_t hw_mode_show(struct device *dev, struct device_attribute *attr, char *buf)
109 {
110 struct phy_device *phydev = to_phy_device(dev->parent);
111 const char *mode, *cur_mode;
112 struct phy_device_led *led;
113 void *iter = NULL;
114 int len = 0;
115
116 led = led_cdev_to_phy_device_led(led_trigger_get_led(dev));
117
118 mutex_lock(&phydev->lock);
119
120 cur_mode = phydev->drv->led_get_hw_mode(phydev, led);
121
122 for (mode = phydev->drv->led_iter_hw_mode(phydev, led, &iter);
123 mode;
124 mode = phydev->drv->led_iter_hw_mode(phydev, led, &iter)) {
125 bool sel;
126
127 sel = cur_mode && !strcmp(mode, cur_mode);
128
129 len += scnprintf(buf + len, PAGE_SIZE - len, "%s%s%s ", sel ? "[" : "", mode,
130 sel ? "]" : "");
131 }
132
133 if (buf[len - 1] == ' ')
134 buf[len - 1] = '\n';
135
136 mutex_unlock(&phydev->lock);
137
138 return len;
139 }
140
141 static ssize_t hw_mode_store(struct device *dev, struct device_attribute *attr, const char *buf,
142 size_t count)
143 {
144 struct phy_device *phydev = to_phy_device(dev->parent);
145 struct phy_device_led *led;
146 int ret;
147
148 led = led_cdev_to_phy_device_led(led_trigger_get_led(dev));
149
150 mutex_lock(&phydev->lock);
151 ret = phydev->drv->led_set_hw_mode(phydev, led, buf);
152 mutex_unlock(&phydev->lock);
153 if (ret < 0)
154 return ret;
155
156 return count;
157 }
158
159 static DEVICE_ATTR_RW(hw_mode);
160
161 static struct attribute *phy_hw_led_trig_attrs[] = {
162 &dev_attr_hw_mode.attr,
163 NULL
164 };
165 ATTRIBUTE_GROUPS(phy_hw_led_trig);
166
167 struct led_hw_trigger_type phy_hw_led_trig_type;
168 EXPORT_SYMBOL_GPL(phy_hw_led_trig_type);
169
170 struct led_trigger phy_hw_led_trig = {
171 .name = "phydev-hw-mode",
172 .deactivate = phy_hw_led_trig_deactivate,
> 173 .trigger_type = &phy_hw_led_trig_type,
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 64958 bytes --]
next prev parent reply other threads:[~2020-07-28 18:47 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-28 15:05 [PATCH RFC leds + net-next v4 0/2] Add support for LEDs on Marvell PHYs Marek Behún
2020-07-28 15:05 ` [PATCH RFC leds + net-next v4 1/2] net: phy: add API for LEDs controlled by PHY HW Marek Behún
2020-07-28 15:11 ` Marek Behún
2020-07-28 16:28 ` Andrew Lunn
2020-07-28 17:27 ` Marek Behun
2020-07-28 16:18 ` Andrew Lunn
2020-07-28 17:28 ` Marek Behun
2020-07-28 18:47 ` kernel test robot [this message]
2020-07-28 19:13 ` kernel test robot
2020-07-28 15:05 ` [PATCH RFC leds + net-next v4 2/2] net: phy: marvell: add support for PHY LEDs via LED class Marek Behún
2020-07-28 15:52 ` [PATCH RFC leds + net-next v4 0/2] Add support for LEDs on Marvell PHYs Jakub Kicinski
2020-08-07 9:06 ` Pavel Machek
2020-08-07 13:29 ` Andrew Lunn
2020-08-29 22:43 ` Pavel Machek
2020-08-29 23:36 ` Andrew Lunn
2020-08-30 1:50 ` Andrew Lunn
2020-08-30 9:22 ` Pavel Machek
2020-08-25 8:13 ` Matthias Schiffer
2020-08-30 22:56 ` Marek Behun
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=202007290259.LZRv2sbz%lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.