tree:
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
pending-4.4
head: 6c69917afdae1284331f6ff2508ee96417c16aed
commit: 6c69917afdae1284331f6ff2508ee96417c16aed [25/25] net: mdio-mux: Handle
-EPROBE_DEFER correctly
config: alpha-buildonly-randconfig-r002-20210822 (attached as .config)
compiler: alpha-linux-gcc (GCC) 7.5.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://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/c...
git remote add sashal-linux-stable
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable pending-4.4
git checkout 6c69917afdae1284331f6ff2508ee96417c16aed
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-7.5.0 make.cross O=build_dir
ARCH=alpha SHELL=/bin/bash drivers/gpu/drm/ drivers/net/phy/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/list.h:8:0,
from include/linux/agp_backend.h:33,
from include/drm/drmP.h:35,
from drivers/gpu/drm/drm_fops.c:37:
drivers/gpu/drm/drm_fops.c: In function 'drm_open_helper':
> drivers/gpu/drm/drm_fops.c:272:35: error:
'pci_root_buses' undeclared (first use in this function); did you mean
'pci_is_root_bus'?
struct pci_bus *b =
list_entry(pci_root_buses.next,
^
include/linux/kernel.h:815:49: note: in definition of macro 'container_of'
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
^~~
drivers/gpu/drm/drm_fops.c:272:24: note: in expansion of macro 'list_entry'
struct pci_bus *b = list_entry(pci_root_buses.next,
^~~~~~~~~~
drivers/gpu/drm/drm_fops.c:272:35: note: each undeclared identifier is reported only
once for each function it appears in
struct pci_bus *b = list_entry(pci_root_buses.next,
^
include/linux/kernel.h:815:49: note: in definition of macro 'container_of'
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
^~~
drivers/gpu/drm/drm_fops.c:272:24: note: in expansion of macro 'list_entry'
struct pci_bus *b = list_entry(pci_root_buses.next,
^~~~~~~~~~
drivers/gpu/drm/drm_fops.c: In function 'drm_read':
drivers/gpu/drm/drm_fops.c:544:31: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (e->event->length + ret > count)
^
In file included from arch/alpha/include/asm/io.h:218:0,
from include/linux/scatterlist.h:8,
from include/linux/dma-mapping.h:10,
from include/drm/drmP.h:37,
from drivers/gpu/drm/drm_fops.c:37:
drivers/gpu/drm/drm_fops.c: At top level:
arch/alpha/include/asm/jensen.h:166:3: warning: 'jensen_bus_outb' is static but
used in inline function 'jensen_outb' which is not static
jensen_bus_outb(b, addr);
^~~~~~~~~~~~~~~
arch/alpha/include/asm/jensen.h:164:3: warning: 'jensen_local_outb' is static
but used in inline function 'jensen_outb' which is not static
jensen_local_outb(b, addr);
^~~~~~~~~~~~~~~~~
arch/alpha/include/asm/jensen.h:158:10: warning: 'jensen_bus_inb' is static but
used in inline function 'jensen_inb' which is not static
return jensen_bus_inb(addr);
^~~~~~~~~~~~~~
arch/alpha/include/asm/jensen.h:156:10: warning: 'jensen_local_inb' is static
but used in inline function 'jensen_inb' which is not static
return jensen_local_inb(addr);
^~~~~~~~~~~~~~~~
--
In file included from include/linux/if_ether.h:23:0,
from include/uapi/linux/ethtool.h:17,
from include/linux/ethtool.h:16,
from include/linux/phy.h:20,
from include/linux/of_mdio.h:12,
from drivers/net/phy/mdio-mux.c:11:
include/linux/skbuff.h: In function 'skb_add_data':
include/linux/skbuff.h:2687:23: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
&csum, from) == copy) {
^~
include/linux/skbuff.h:2691:60: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
} else if (copy_from_iter(skb_put(skb, copy), copy, from) == copy)
^~
include/linux/skbuff.h: In function 'skb_can_coalesce':
include/linux/skbuff.h:2705:14: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
off == frag->page_offset + skb_frag_size(frag);
^~
include/linux/skbuff.h: In function 'memcpy_from_msg':
include/linux/skbuff.h:2933:51: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
return copy_from_iter(data, len, &msg->msg_iter) == len ? 0 : -EFAULT;
^~
include/linux/skbuff.h: In function 'memcpy_to_msg':
include/linux/skbuff.h:2938:49: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
return copy_to_iter(data, len, &msg->msg_iter) == len ? 0 : -EFAULT;
^~
drivers/net/phy/mdio-mux.c: In function 'mdio_mux_init':
> drivers/net/phy/mdio-mux.c:172:5: error: label 'err_loop'
used but not defined
goto err_loop;
^~~~
In file included from arch/alpha/include/asm/io.h:218:0,
from include/linux/scatterlist.h:8,
from include/linux/dma-mapping.h:10,
from include/linux/skbuff.h:34,
from include/linux/if_ether.h:23,
from include/uapi/linux/ethtool.h:17,
from include/linux/ethtool.h:16,
from include/linux/phy.h:20,
from include/linux/of_mdio.h:12,
from drivers/net/phy/mdio-mux.c:11:
drivers/net/phy/mdio-mux.c: At top level:
arch/alpha/include/asm/jensen.h:166:3: warning: 'jensen_bus_outb' is static but
used in inline function 'jensen_outb' which is not static
jensen_bus_outb(b, addr);
^~~~~~~~~~~~~~~
arch/alpha/include/asm/jensen.h:164:3: warning: 'jensen_local_outb' is static
but used in inline function 'jensen_outb' which is not static
jensen_local_outb(b, addr);
^~~~~~~~~~~~~~~~~
arch/alpha/include/asm/jensen.h:158:10: warning: 'jensen_bus_inb' is static but
used in inline function 'jensen_inb' which is not static
return jensen_bus_inb(addr);
^~~~~~~~~~~~~~
arch/alpha/include/asm/jensen.h:156:10: warning: 'jensen_local_inb' is static
but used in inline function 'jensen_inb' which is not static
return jensen_local_inb(addr);
^~~~~~~~~~~~~~~~
vim +/err_loop +172 drivers/net/phy/mdio-mux.c
95
96 int mdio_mux_init(struct device *dev,
97 int (*switch_fn)(int cur, int desired, void *data),
98 void **mux_handle,
99 void *data)
100 {
101 struct device_node *parent_bus_node;
102 struct device_node *child_bus_node;
103 int r, ret_val;
104 struct mii_bus *parent_bus;
105 struct mdio_mux_parent_bus *pb;
106 struct mdio_mux_child_bus *cb;
107
108 if (!dev->of_node)
109 return -ENODEV;
110
111 parent_bus_node = of_parse_phandle(dev->of_node, "mdio-parent-bus",
0);
112
113 if (!parent_bus_node)
114 return -ENODEV;
115
116 pb = devm_kzalloc(dev, sizeof(*pb), GFP_KERNEL);
117 if (pb == NULL) {
118 ret_val = -ENOMEM;
119 goto err_parent_bus;
120 }
121
122 parent_bus = of_mdio_find_bus(parent_bus_node);
123 if (parent_bus == NULL) {
124 ret_val = -EPROBE_DEFER;
125 goto err_parent_bus;
126 }
127
128 pb->switch_data = data;
129 pb->switch_fn = switch_fn;
130 pb->current_child = -1;
131 pb->parent_id = parent_count++;
132 pb->mii_bus = parent_bus;
133
134 ret_val = -ENODEV;
135 for_each_available_child_of_node(dev->of_node, child_bus_node) {
136 u32 v;
137
138 r = of_property_read_u32(child_bus_node, "reg", &v);
139 if (r)
140 continue;
141
142 cb = devm_kzalloc(dev, sizeof(*cb), GFP_KERNEL);
143 if (cb == NULL) {
144 dev_err(dev,
145 "Error: Failed to allocate memory for child\n");
146 ret_val = -ENOMEM;
147 of_node_put(child_bus_node);
148 break;
149 }
150 cb->bus_number = v;
151 cb->parent = pb;
152
153 cb->mii_bus = mdiobus_alloc();
154 if (!cb->mii_bus) {
155 ret_val = -ENOMEM;
156 of_node_put(child_bus_node);
157 break;
158 }
159 cb->mii_bus->priv = cb;
160 cb->mii_bus->irq = cb->phy_irq;
161 cb->mii_bus->name = "mdio_mux";
162 snprintf(cb->mii_bus->id, MII_BUS_ID_SIZE, "%x.%x",
163 pb->parent_id, v);
164 cb->mii_bus->parent = dev;
165 cb->mii_bus->read = mdio_mux_read;
166 cb->mii_bus->write = mdio_mux_write;
167 r = of_mdiobus_register(cb->mii_bus, child_bus_node);
168 if (r) {
169 mdiobus_free(cb->mii_bus);
170 if (r == -EPROBE_DEFER) {
171 ret_val = r;
172 goto err_loop;
173 }
174 devm_kfree(dev, cb);
175 dev_err(dev,
176 "Error: Failed to register MDIO bus for child %pOF\n",
177 child_bus_node);
178 } else {
179 of_node_get(child_bus_node);
180 cb->next = pb->children;
181 pb->children = cb;
182 }
183 }
184 if (pb->children) {
185 *mux_handle = pb;
186 dev_info(dev, "Version " DRV_VERSION "\n");
187 return 0;
188 }
189
190 /* balance the reference of_mdio_find_bus() took */
191 put_device(&pb->mii_bus->dev);
192
193 err_parent_bus:
194 of_node_put(parent_bus_node);
195 return ret_val;
196 }
197 EXPORT_SYMBOL_GPL(mdio_mux_init);
198
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org