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: <202007260037.0b0Xds0e%lkp@intel.com>
Date:   Sun, 26 Jul 2020 00:33:21 +0800
From:   kernel test robot <lkp@...el.com>
To:     Andre Edich <andre.edich@...rochip.com>, netdev@...r.kernel.org,
        UNGLinuxDriver@...rochip.com, steve.glendinning@...well.net
Cc:     kbuild-all@...ts.01.org, Parthiban.Veerasooran@...rochip.com,
        Andre Edich <andre.edich@...rochip.com>
Subject: Re: [PATCH net-next v2 3/6] smsc95xx: add PAL support to use
 external PHY drivers

Hi Andre,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Andre-Edich/Add-PAL-support-to-smsc95xx/20200723-195824
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 7fc3b978a8971305d456b32d3f2ac13191f5a0d7
config: x86_64-randconfig-a016-20200724 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

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

All errors (new ones prefixed by >>):

   ld: drivers/net/usb/smsc95xx.o: in function `smsc95xx_disconnect_phy':
>> drivers/net/usb/smsc95xx.c:1395: undefined reference to `phy_stop'
>> ld: drivers/net/usb/smsc95xx.c:1396: undefined reference to `phy_disconnect'
   ld: drivers/net/usb/smsc95xx.o: in function `smsc95xx_unbind':
>> drivers/net/usb/smsc95xx.c:1359: undefined reference to `mdiobus_unregister'
>> ld: drivers/net/usb/smsc95xx.c:1360: undefined reference to `mdiobus_free'
   ld: drivers/net/usb/smsc95xx.o: in function `smsc95xx_start_phy':
>> drivers/net/usb/smsc95xx.c:1380: undefined reference to `phy_connect_direct'
>> ld: drivers/net/usb/smsc95xx.c:1388: undefined reference to `phy_attached_info'
>> ld: drivers/net/usb/smsc95xx.c:1389: undefined reference to `phy_start'
   ld: drivers/net/usb/smsc95xx.o: in function `smsc95xx_resume':
>> drivers/net/usb/smsc95xx.c:1951: undefined reference to `phy_init_hw'
   ld: drivers/net/usb/smsc95xx.o: in function `smsc95xx_handle_link_change':
>> drivers/net/usb/smsc95xx.c:1367: undefined reference to `phy_print_status'
   ld: drivers/net/usb/smsc95xx.o: in function `mdiobus_alloc':
>> include/linux/phy.h:318: undefined reference to `mdiobus_alloc_size'
   ld: drivers/net/usb/smsc95xx.o: in function `smsc95xx_bind':
>> drivers/net/usb/smsc95xx.c:1293: undefined reference to `__mdiobus_register'
>> ld: drivers/net/usb/smsc95xx.c:1299: undefined reference to `phy_find_first'
   ld: drivers/net/usb/smsc95xx.c:1344: undefined reference to `mdiobus_unregister'
   ld: drivers/net/usb/smsc95xx.c:1347: undefined reference to `mdiobus_free'

vim +1395 drivers/net/usb/smsc95xx.c

  1222	
  1223	static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf)
  1224	{
  1225		struct smsc95xx_priv *pdata;
  1226		u32 val;
  1227		int ret;
  1228	
  1229		printk(KERN_INFO SMSC_CHIPNAME " v" SMSC_DRIVER_VERSION "\n");
  1230	
  1231		ret = usbnet_get_endpoints(dev, intf);
  1232		if (ret < 0) {
  1233			netdev_warn(dev->net, "usbnet_get_endpoints failed: %d\n", ret);
  1234			return ret;
  1235		}
  1236	
  1237		pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
  1238		if (!pdata)
  1239			return -ENOMEM;
  1240	
  1241		dev->driver_priv = pdata;
  1242	
  1243		spin_lock_init(&pdata->mac_cr_lock);
  1244	
  1245		/* LAN95xx devices do not alter the computed checksum of 0 to 0xffff.
  1246		 * RFC 2460, ipv6 UDP calculated checksum yields a result of zero must
  1247		 * be changed to 0xffff. RFC 768, ipv4 UDP computed checksum is zero,
  1248		 * it is transmitted as all ones. The zero transmitted checksum means
  1249		 * transmitter generated no checksum. Hence, enable csum offload only
  1250		 * for ipv4 packets.
  1251		 */
  1252		if (DEFAULT_TX_CSUM_ENABLE)
  1253			dev->net->features |= NETIF_F_IP_CSUM;
  1254		if (DEFAULT_RX_CSUM_ENABLE)
  1255			dev->net->features |= NETIF_F_RXCSUM;
  1256	
  1257		dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_RXCSUM;
  1258		set_bit(EVENT_NO_IP_ALIGN, &dev->flags);
  1259	
  1260		smsc95xx_init_mac_address(dev);
  1261	
  1262		/* Init all registers */
  1263		ret = smsc95xx_reset(dev);
  1264		if (ret)
  1265			goto free_pdata;
  1266	
  1267		pdata->mdiobus = mdiobus_alloc();
  1268		if (!pdata->mdiobus) {
  1269			ret = -ENOMEM;
  1270			goto free_pdata;
  1271		}
  1272	
  1273		ret = smsc95xx_read_reg(dev, HW_CFG, &val);
  1274		if (ret < 0)
  1275			goto free_mdio;
  1276	
  1277		pdata->internal_phy = !(val & HW_CFG_PSEL_);
  1278		if (pdata->internal_phy)
  1279			pdata->mdiobus->phy_mask = ~(1u << SMSC95XX_INTERNAL_PHY_ID);
  1280	
  1281		pdata->mdiobus->priv = dev;
  1282		pdata->mdiobus->read = smsc95xx_mdiobus_read;
  1283		pdata->mdiobus->write = smsc95xx_mdiobus_write;
  1284		pdata->mdiobus->name = "smsc95xx-mdiobus";
  1285		pdata->mdiobus->parent = &dev->udev->dev;
  1286	
  1287		dev->mii.phy_id_mask = 0x1f;
  1288		dev->mii.reg_num_mask = 0x1f;
  1289	
  1290		snprintf(pdata->mdiobus->id, ARRAY_SIZE(pdata->mdiobus->id),
  1291			 "usb-%03d:%03d", dev->udev->bus->busnum, dev->udev->devnum);
  1292	
> 1293		ret = mdiobus_register(pdata->mdiobus);
  1294		if (ret) {
  1295			netdev_err(dev->net, "Could not register MDIO bus\n");
  1296			goto free_mdio;
  1297		}
  1298	
> 1299		pdata->phydev = phy_find_first(pdata->mdiobus);
  1300		if (!pdata->phydev) {
  1301			netdev_err(dev->net, "no PHY found\n");
  1302			ret = -ENODEV;
  1303			goto unregister_mdio;
  1304		}
  1305	
  1306		dev->mii.dev = dev->net;
  1307		dev->mii.mdio_read = smsc95xx_mdio_read;
  1308		dev->mii.mdio_write = smsc95xx_mdio_write;
  1309		dev->mii.phy_id = pdata->phydev->mdio.addr;
  1310	
  1311		/* detect device revision as different features may be available */
  1312		ret = smsc95xx_read_reg(dev, ID_REV, &val);
  1313		if (ret < 0)
  1314			goto unregister_mdio;
  1315	
  1316		val >>= 16;
  1317		pdata->chip_id = val;
  1318		if (pdata->internal_phy)
  1319			pdata->mdix_ctrl = get_mdix_status(dev->net);
  1320	
  1321		if ((val == ID_REV_CHIP_ID_9500A_) || (val == ID_REV_CHIP_ID_9530_) ||
  1322		    (val == ID_REV_CHIP_ID_89530_) || (val == ID_REV_CHIP_ID_9730_))
  1323			pdata->features = (FEATURE_8_WAKEUP_FILTERS |
  1324				FEATURE_PHY_NLP_CROSSOVER |
  1325				FEATURE_REMOTE_WAKEUP);
  1326		else if (val == ID_REV_CHIP_ID_9512_)
  1327			pdata->features = FEATURE_8_WAKEUP_FILTERS;
  1328	
  1329		dev->net->netdev_ops = &smsc95xx_netdev_ops;
  1330		dev->net->ethtool_ops = &smsc95xx_ethtool_ops;
  1331		dev->net->flags |= IFF_MULTICAST;
  1332		dev->net->hard_header_len += SMSC95XX_TX_OVERHEAD_CSUM;
  1333		dev->net->min_mtu = ETH_MIN_MTU;
  1334		dev->net->max_mtu = ETH_DATA_LEN;
  1335		dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
  1336	
  1337		pdata->dev = dev;
  1338		INIT_DELAYED_WORK(&pdata->carrier_check, check_carrier);
  1339		schedule_delayed_work(&pdata->carrier_check, CARRIER_CHECK_DELAY);
  1340	
  1341		return 0;
  1342	
  1343	unregister_mdio:
  1344		mdiobus_unregister(pdata->mdiobus);
  1345	
  1346	free_mdio:
  1347		mdiobus_free(pdata->mdiobus);
  1348	
  1349	free_pdata:
  1350		kfree(pdata);
  1351		return ret;
  1352	}
  1353	
  1354	static void smsc95xx_unbind(struct usbnet *dev, struct usb_interface *intf)
  1355	{
  1356		struct smsc95xx_priv *pdata = dev->driver_priv;
  1357	
  1358		cancel_delayed_work_sync(&pdata->carrier_check);
> 1359		mdiobus_unregister(pdata->mdiobus);
> 1360		mdiobus_free(pdata->mdiobus);
  1361		netif_dbg(dev, ifdown, dev->net, "free pdata\n");
  1362		kfree(pdata);
  1363	}
  1364	
  1365	static void smsc95xx_handle_link_change(struct net_device *net)
  1366	{
> 1367		phy_print_status(net->phydev);
  1368	}
  1369	
  1370	static int smsc95xx_start_phy(struct usbnet *dev)
  1371	{
  1372		struct smsc95xx_priv *pdata = dev->driver_priv;
  1373		struct net_device *net = dev->net;
  1374		int ret;
  1375	
  1376		ret = smsc95xx_reset(dev);
  1377		if (ret < 0)
  1378			return ret;
  1379	
> 1380		ret = phy_connect_direct(net, pdata->phydev,
  1381					 &smsc95xx_handle_link_change,
  1382					 PHY_INTERFACE_MODE_MII);
  1383		if (ret) {
  1384			netdev_err(net, "can't attach PHY to %s\n", pdata->mdiobus->id);
  1385			return ret;
  1386		}
  1387	
> 1388		phy_attached_info(net->phydev);
> 1389		phy_start(net->phydev);
  1390		return 0;
  1391	}
  1392	
  1393	static int smsc95xx_disconnect_phy(struct usbnet *dev)
  1394	{
> 1395		phy_stop(dev->net->phydev);
> 1396		phy_disconnect(dev->net->phydev);
  1397		return 0;
  1398	}
  1399	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (38364 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ