Hi Nitin,
FYI, the error/warning still remains.
tree:
https://github.com/Freescale/linux-fslc pr/521
head: e1200a7e26459892adfac6cb313bd8458b21fa95
commit: 1730a5e196055cef89fe50dd63852ebc32cce135 [1728/9999] MLK-25346: net: add
imx-shmem-net driver
config: m68k-allmodconfig
(
https://download.01.org/0day-ci/archive/20220115/202201150115.7h4jcXMX-lk...)
compiler: m68k-linux-gcc (GCC) 11.2.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/Freescale/linux-fslc/commit/1730a5e196055cef89fe50dd63...
git remote add freescale-fslc
https://github.com/Freescale/linux-fslc
git fetch --no-tags freescale-fslc pr/521
git checkout 1730a5e196055cef89fe50dd63852ebc32cce135
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir
ARCH=m68k SHELL=/bin/bash
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/kernel.h:11,
from drivers/net/imx-shmem-net.c:19:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:169:50: warning: ordered comparison of pointer with
null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET
&& (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:45: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:9: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:17: note: in expansion of macro
'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
drivers/net/imx-shmem-net.c: In function 'mu_enable_reset_irq':
drivers/net/imx-shmem-net.c:993:13: warning: unused variable 'sciErr'
[-Wunused-variable]
993 | int sciErr;
| ^~~~~~
drivers/net/imx-shmem-net.c: In function 'imx_shm_net_probe':
> drivers/net/imx-shmem-net.c:1175:9: error: implicit declaration
of function 'imx_scu_irq_unregister_notifier'; did you mean
'netlink_unregister_notifier'? [-Werror=implicit-function-declaration]
1175 | imx_scu_irq_unregister_notifier(&in->pnotifier);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| netlink_unregister_notifier
At top level:
drivers/net/imx-shmem-net.c:887:12: warning: 'imx_shm_partition_notify' defined
but not used [-Wunused-function]
887 | static int imx_shm_partition_notify(struct notifier_block *nb,
| ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for NEED_MULTIPLE_NODES
Depends on DISCONTIGMEM || NUMA
Selected by
- SINGLE_MEMORY_CHUNK && MMU
vim +1175 drivers/net/imx-shmem-net.c
989
990 /* enable reset notification MU */
991 static int mu_enable_reset_irq(struct net_device *ndev)
992 {
993 int sciErr;
994 struct imx_shm_net *isndev;
995 struct device_node *np;
996
997 isndev = netdev_priv(ndev);
998 np = isndev->pdev->dev.of_node;
999
1000 /* Get muB partition id and enable irq in SCFW then */
1001 if (of_property_read_u32(np, "mub-partition",
1002 &isndev->mub_partition))
1003 isndev->mub_partition = IMX_SHM_NET_DEFAULT_PART;
1004 dev_dbg(&isndev->pdev->dev, "watching reset from partition
%d\n",
1005 isndev->mub_partition);
1006
1007 #ifdef CONFIG_IMX_SCU
1008 /* Request for the partition reset interrupt. */
1009 sciErr = imx_scu_irq_group_enable(SC_IRQ_GROUP_REBOOTED,
1010 BIT(isndev->mub_partition), true);
1011 if (sciErr)
1012 dev_warn(&isndev->pdev->dev, "Cannot request partition reset
interrupt\n");
1013
1014 isndev->pnotifier.notifier_call = imx_shm_partition_notify;
1015 sciErr = imx_scu_irq_register_notifier(&isndev->pnotifier);
1016 if (sciErr) {
1017 imx_scu_irq_group_enable(SC_IRQ_GROUP_REBOOTED,
1018 BIT(isndev->mub_partition), false);
1019 dev_warn(&isndev->pdev->dev, "Failed to register partition reset
notifier\n");
1020 }
1021 #endif
1022 return 0;
1023 }
1024
1025 static const struct ethtool_ops imx_shm_net_ethtool_ops = {
1026 .get_sset_count = imx_shm_net_get_sset_count,
1027 .get_strings = imx_shm_net_get_strings,
1028 .get_ethtool_stats = imx_shm_net_get_ethtool_stats,
1029 .get_regs_len = imx_shm_net_get_regs_len,
1030 .get_regs = imx_shm_net_get_regs,
1031 };
1032
1033 static int imx_shm_net_probe(struct platform_device *pdev)
1034 {
1035 struct net_device *ndev = NULL;
1036 struct imx_shm_net *in;
1037 resource_size_t shmaddr;
1038 resource_size_t shmlen;
1039 char *device_name;
1040 void *shm = NULL;
1041 u32 ivpos;
1042 int ret;
1043
1044 /* check if 1st probe or another attempt after EAGAIN */
1045 if (pdev->dev.driver_data) {
1046 dev_dbg(&pdev->dev, "Retrying connection...\n");
1047 in = netdev_priv(platform_get_drvdata(pdev));
1048 goto retry;
1049 }
1050
1051 if (of_property_read_bool(pdev->dev.of_node, "rxfirst")) {
1052 ivpos = 1;
1053 dev_info(&pdev->dev, "queue position is RX first\n");
1054 } else {
1055 ivpos = 0;
1056 dev_info(&pdev->dev, "queue position is TX first\n");
1057 }
1058
1059 /* get shared coherent memory for buffers */
1060 if (of_reserved_mem_device_init(&pdev->dev)) {
1061 dev_err(&pdev->dev,
1062 "dev doesn't have specific DMA pool.\n");
1063 return -ENOMEM;
1064 }
1065 shmlen = IMX_SHM_NET_DMA_SIZE;
1066 shm = dma_alloc_coherent(&pdev->dev, IMX_SHM_NET_DMA_SIZE,
1067 &shmaddr, GFP_KERNEL);
1068 if (!shm || !shmaddr)
1069 return -ENOMEM;
1070
1071 dev_info(&pdev->dev, "allocated %d bytes in coherent mem @
0x%x\n",
1072 (uint)shmlen, (uint)shmaddr);
1073
1074 device_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s[%s]",
DRV_NAME,
1075 dev_name(&pdev->dev));
1076 if (!device_name) {
1077 ret = -ENOMEM;
1078 goto err_free_dma;
1079 }
1080
1081 ndev = alloc_etherdev(sizeof(*in));
1082 if (!ndev) {
1083 ret = -ENOMEM;
1084 goto err_free_dma;
1085 }
1086 dev_info(&pdev->dev, "allocated ethernet device %s\n",
ndev->name);
1087
1088 platform_set_drvdata(pdev, ndev);
1089 SET_NETDEV_DEV(ndev, &pdev->dev);
1090
1091 /* get struct 'imx_shm_net' stored as private data in ndev */
1092 in = netdev_priv(ndev);
1093
1094 list_add(&in->isn_node, &imx_shm_net_head);
1095
1096 in->shm = shm;
1097 in->shmaddr = shmaddr;
1098 in->shmlen = shmlen;
1099 in->pdev = pdev;
1100 in->regs.ivpos = ivpos;
1101 in->regs.rstate = IMX_SHM_NET_STATE_RESET;
1102 in->remote_message = IMX_SHM_NET_STATE_RESET;
1103 spin_lock_init(&in->tx_free_lock);
1104 spin_lock_init(&in->tx_clean_lock);
1105 mutex_init(&in->state_lock);
1106
1107 /* enable peer's reset notification */
1108 ret = mu_enable_reset_irq(ndev);
1109 if (ret)
1110 goto err_free;
1111
1112 ret = imx_shm_net_calc_qsize(ndev);
1113 if (ret)
1114 goto err_reset_irq;
1115
1116 in->state_wq = alloc_ordered_workqueue(device_name, 0);
1117 if (!in->state_wq) {
1118 ret = -ENOMEM;
1119 goto err_reset_irq;
1120 }
1121
1122 INIT_WORK(&in->state_work, imx_shm_net_state_change);
1123
1124 eth_random_addr(ndev->dev_addr);
1125 ndev->netdev_ops = &imx_shm_net_ops;
1126 ndev->ethtool_ops = &imx_shm_net_ethtool_ops;
1127 ndev->mtu = min_t(u32, IMX_SHM_NET_MTU_DEF, in->qsize / 16);
1128 ndev->hw_features = NETIF_F_HW_CSUM | NETIF_F_SG;
1129 ndev->features = ndev->hw_features;
1130
1131 netif_carrier_off(ndev);
1132 netif_napi_add(ndev, &in->napi, imx_shm_net_poll, NAPI_POLL_WEIGHT);
1133
1134 ret = register_netdev(ndev);
1135 if (ret)
1136 goto err_wq;
1137
1138 /* initialize Mailbox for RX/TX */
1139 ret = imx_shm_xtr_channel_init(in);
1140 if (ret) {
1141 dev_err(&in->pdev->dev, "unable to initialize Mailbox.\n");
1142 /* MU may not be ready yet, need to try later on */
1143 ret = -EPROBE_DEFER;
1144 goto err_unregister;
1145 }
1146 dev_info(&in->pdev->dev,
1147 "Mailbox is ready for cross core communication!\n");
1148
1149 retry:
1150 /* notify reset */
1151 mutex_lock(&in->state_lock);
1152 in->regs.lstate = IMX_SHM_NET_STATE_RESET;
1153 in->message_state = MESS_STATE_NEW;
1154 mutex_unlock(&in->state_lock);
1155
1156 /* only device with queue position TXfirst sends the first message */
1157 if (!ivpos) {
1158 ret = mbox_send_message(in->tx_ch, &in->regs.lstate);
1159 if (ret < 0)
1160 dev_err(&pdev->dev, "%s first message error=%d!\n",
1161 __func__, ret);
1162
1163 dev_dbg(&pdev->dev, "%s sent first message\n", __func__);
1164 }
1165
1166 return 0;
1167
1168 err_unregister:
1169 unregister_netdev(ndev);
1170
1171 err_wq:
1172 destroy_workqueue(in->state_wq);
1173
1174 err_reset_irq:
1175 imx_scu_irq_unregister_notifier(&in->pnotifier);
1176
1177 err_free:
1178 list_del(&in->isn_node);
1179 free_netdev(ndev);
1180
1181 err_free_dma:
1182 dma_free_coherent(&pdev->dev, shmlen, shm, shmaddr);
1183
1184 return ret;
1185 }
1186
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org