tree:
https://github.com/frank-w/BPI-R2-4.14 5.15-rtl8367dsa
head: c795ca3e9bf72973b4819834fac0728a9108f600
commit: 6c61ebc583fdb65eefc6724a48fac393db2a233d [28/43] net: dsa: add rtl8367rb
config: hexagon-buildonly-randconfig-r003-20211114 (attached as .config)
compiler: clang version 14.0.0 (
https://github.com/llvm/llvm-project
c3dddeeafb529e769cde87bd29ef6271ac6bfa5c)
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/frank-w/BPI-R2-4.14/commit/6c61ebc583fdb65eefc6724a48f...
git remote add frank-w-bpi-r2-4.14
https://github.com/frank-w/BPI-R2-4.14
git fetch --no-tags frank-w-bpi-r2-4.14 5.15-rtl8367dsa
git checkout 6c61ebc583fdb65eefc6724a48fac393db2a233d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=hexagon
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
> drivers/net/dsa/rtl8367rb.c:929:2: warning: variable
'count' is used uninitialized whenever switch default is taken
[-Wsometimes-uninitialized]
default:
^~~~~~~
drivers/net/dsa/rtl8367rb.c:933:47: note: uninitialized use occurs here
ret = rtl8367b_write_initvals(smi, initvals, count);
^~~~~
drivers/net/dsa/rtl8367rb.c:887:11: note: initialize the variable 'count' to
silence this warning
int count;
^
= 0
1 warning generated.
vim +/count +929 drivers/net/dsa/rtl8367rb.c
878
879 static int rtl8367rb_setup(struct dsa_switch *ds)
880 {
881 struct realtek_smi *smi = ds->priv;
882 const struct rtl8367b_initval *initvals;
883 struct rtl8367rb *rb;
884 const char *chip_name;
885 u32 chip_ver = 0;
886 u32 rlvid;
887 int count;
888 //u32 val;
889 int ret;
890 int i;
891
892 rb = smi->chip_data;
893
894 //REG_WR(smi, RTL8367B_RTL_MAGIC_ID_REG, RTL8367B_RTL_MAGIC_ID_VAL);
895 ret = regmap_read(smi->map, RTL8367RB_CHIP_VER_REG,
896 &chip_ver);
897 if (ret) {
898 dev_err(smi->dev, "unable to read chip version\n");
899 return ret;
900 }
901
902 switch (chip_ver) {
903 case RTL8367RB_CHIP_VER_8367RB:
904 chip_name="8367RB";
905 break;
906 case RTL8367RB_CHIP_VER_8367RVB:
907 chip_name="8367R-VB";
908 break;
909 default:
910 dev_err(smi->dev, "unknown chip version (%04x)\n", chip_ver);
911 return -ENODEV;
912 }
913
914 rlvid = (chip_ver >> RTL8367RB_CHIP_VER_RLVID_SHIFT) &
915 RTL8367RB_CHIP_VER_RLVID_MASK;
916 dev_info(smi->dev, "RTL%s ver %u chip found\n",
917 chip_name, rlvid);
918
919 /* Do the init dance using the right jam table */
920 switch (rlvid) {
921 case 0:
922 initvals = rtl8367r_vb_initvals_0;
923 count = ARRAY_SIZE(rtl8367r_vb_initvals_0);
924 break;
925 case 1:
926 initvals = rtl8367r_vb_initvals_1;
927 count = ARRAY_SIZE(rtl8367r_vb_initvals_1);
928 break;
929 default:
930 break;
931 }
932
933 ret = rtl8367b_write_initvals(smi, initvals, count);
934 if (ret)
935 return ret;
936
937 /* Set up the "green ethernet" feature */
938 /*ret = rtl8367rb_jam_table(rtl8367rb_green_jam,
939 ARRAY_SIZE(rtl8367rb_green_jam), smi, false);
940 if (ret)
941 return ret;
942
943 ret = regmap_write(smi->map,
944 RTL8367RB_GREEN_FEATURE_REG,
945 (chip_ver == 1) ? 0x0007 : 0x0003);
946 if (ret)
947 return ret;*/
948
949 /* Set some random MAC address */
950 ret = rtl8367rb_set_addr(smi);
951 if (ret)
952 return ret;
953
954 /* Enable CPU port with custom DSA tag 8899.
955 *
956 * If you set RTL8368RB_CPU_NO_TAG (bit 15) in this registers
957 * the custom tag is turned off.
958 */
959 ret = regmap_update_bits(smi->map, RTL8368RB_CPU_CTRL_REG,
960 0xFFFF,
961 BIT(smi->cpu_port));
962 if (ret)
963 return ret;
964
965 /* Make sure we default-enable the fixed CPU port */
966 ret = regmap_update_bits(smi->map, RTL8367RB_PECR,
967 BIT(smi->cpu_port),
968 0);
969 if (ret)
970 return ret;
971
972 /* Set maximum packet length to 1536 bytes */
973 ret = regmap_update_bits(smi->map, RTL8367RB_SGCR,
974 RTL8367RB_SGCR_MAX_LENGTH_MASK,
975 RTL8367RB_SGCR_MAX_LENGTH_1536);
976 if (ret)
977 return ret;
978 for (i = 0; i < RTL8367RB_NUM_PORTS; i++)
979 /* layer 2 size, see rtl8366rb_change_mtu() */
980 rb->max_mtu[i] = 1532;
981
982 /* Enable learning for all ports */
983 ret = regmap_write(smi->map, RTL8367RB_SSCR0, 0);
984 if (ret)
985 return ret;
986
987 /* Enable auto ageing for all ports */
988 ret = regmap_write(smi->map, RTL8367RB_SSCR1, 0);
989 if (ret)
990 return ret;
991
992 /* Port 4 setup: this enables Port 4, usually the WAN port,
993 * common PHY IO mode is apparently mode 0, and this is not what
994 * the port is initialized to. There is no explanation of the
995 * IO modes in the Realtek source code, if your WAN port is
996 * connected to something exotic such as fiber, then this might
997 * be worth experimenting with.
998 */
999 ret = regmap_update_bits(smi->map, RTL8367RB_PMC0,
1000 RTL8367RB_PMC0_P4_IOMODE_MASK,
1001 0 << RTL8367RB_PMC0_P4_IOMODE_SHIFT);
1002 if (ret)
1003 return ret;
1004
1005 /* Discard VLAN tagged packets if the port is not a member of
1006 * the VLAN with which the packets is associated.
1007 */
1008 /*ret = regmap_write(smi->map, RTL8367RB_VLAN_INGRESS_CTRL2_REG,
1009 RTL8367RB_PORT_ALL);
1010 if (ret)
1011 return ret;
1012 */
1013 /* Don't drop packets whose DA has not been learned */
1014 ret = regmap_update_bits(smi->map, RTL8367RB_SSCR2,
1015 RTL8367RB_SSCR2_DROP_UNKNOWN_DA, 0);
1016 if (ret)
1017 return ret;
1018
1019 /* Set blinking, TODO: make this configurable */
1020 /*ret = regmap_update_bits(smi->map, RTL8367RB_LED_BLINKRATE_REG,
1021 RTL8367RB_LED_BLINKRATE_MASK,
1022 RTL8367RB_LED_BLINKRATE_56MS);
1023 if (ret)
1024 return ret;*/
1025
1026 /* Set up LED activity:
1027 * Each port has 4 LEDs, we configure all ports to the same
1028 * behaviour (no individual config) but we can set up each
1029 * LED separately.
1030 */
1031 /*if (smi->leds_disabled) {
1032 // Turn everything off
1033 regmap_update_bits(smi->map,
1034 RTL8367RB_LED_0_1_CTRL_REG,
1035 0x0FFF, 0);
1036 regmap_update_bits(smi->map,
1037 RTL8367RB_LED_2_3_CTRL_REG,
1038 0x0FFF, 0);
1039 regmap_update_bits(smi->map,
1040 RTL8367RB_INTERRUPT_CONTROL_REG,
1041 RTL8367RB_P4_RGMII_LED,
1042 0);
1043 val = RTL8367RB_LED_OFF;
1044 } else {
1045 // TODO: make this configurable per LED
1046 val = RTL8367RB_LED_FORCE;
1047 }
1048 for (i = 0; i < 4; i++) {
1049 ret = regmap_update_bits(smi->map,
1050 RTL8367RB_LED_CTRL_REG,
1051 0xf << (i * 4),
1052 val << (i * 4));
1053 if (ret)
1054 return ret;
1055 }*/
1056
1057 /*ret = rtl8367_init_vlan(smi);
1058 if (ret)
1059 return ret;
1060 */
1061 ret = rtl8367rb_setup_cascaded_irq(smi);
1062 if (ret)
1063 dev_info(smi->dev, "no interrupt support\n");
1064
1065 ret = realtek_smi_setup_mdio(smi);
1066 if (ret) {
1067 dev_info(smi->dev, "could not set up MDIO bus\n");
1068 return -ENODEV;
1069 }
1070
1071 ds->configure_vlan_while_not_filtering = false;
1072
1073 return 0;
1074 }
1075
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org