Hi Yan-Hsuan, Thank you for the patch! Yet something to improve: [auto build test ERROR on wireless-drivers-next/master] [also build test ERROR on v4.19-rc4 next-20180921] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/yhchuang-realtek-com/rtwlan-mac80211-driver-for-Realtek-802-11ac-wireless-network-chips/20180923-065459 base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master config: sh-allmodconfig (attached as .config) compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0 reproduce: 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 GCC_VERSION=7.2.0 make.cross ARCH=sh All error/warnings (new ones prefixed by >>): drivers/net/wireless/realtek/rtwlan/pci.c: In function 'rtw_pci_io_mapping': >> drivers/net/wireless/realtek/rtwlan/pci.c:880:17: error: implicit declaration of function 'pci_iomap'; did you mean 'pcim_iomap'? [-Werror=implicit-function-declaration] rtwpci->mmap = pci_iomap(pdev, bar_id, len); ^~~~~~~~~ pcim_iomap >> drivers/net/wireless/realtek/rtwlan/pci.c:880:15: warning: assignment makes pointer from integer without a cast [-Wint-conversion] rtwpci->mmap = pci_iomap(pdev, bar_id, len); ^ drivers/net/wireless/realtek/rtwlan/pci.c: In function 'rtw_pci_io_unmapping': >> drivers/net/wireless/realtek/rtwlan/pci.c:895:3: error: implicit declaration of function 'pci_iounmap'; did you mean 'pcim_iounmap'? [-Werror=implicit-function-declaration] pci_iounmap(pdev, rtwpci->mmap); ^~~~~~~~~~~ pcim_iounmap drivers/net/wireless/realtek/rtwlan/pci.c: In function 'rtw_pci_parse_configuration': >> drivers/net/wireless/realtek/rtwlan/pci.c:1009:2: error: implicit declaration of function 'pcie_capability_read_word'; did you mean 'has_capability_noaudit'? [-Werror=implicit-function-declaration] pcie_capability_read_word(pdev, PCI_EXP_LNKCTL, &link_control); ^~~~~~~~~~~~~~~~~~~~~~~~~ has_capability_noaudit drivers/net/wireless/realtek/rtwlan/pci.c: In function 'rtw_pci_declaim': >> drivers/net/wireless/realtek/rtwlan/pci.c:1037:2: error: implicit declaration of function 'pci_clear_master'; did you mean 'pci_set_master'? [-Werror=implicit-function-declaration] pci_clear_master(pdev); ^~~~~~~~~~~~~~~~ pci_set_master drivers/net/wireless/realtek/rtwlan/pci.c: At top level: >> drivers/net/wireless/realtek/rtwlan/pci.c:1213:1: warning: data definition has no type or storage class module_pci_driver(rtw_pci_driver); ^~~~~~~~~~~~~~~~~ >> drivers/net/wireless/realtek/rtwlan/pci.c:1213:1: error: type defaults to 'int' in declaration of 'module_pci_driver' [-Werror=implicit-int] >> drivers/net/wireless/realtek/rtwlan/pci.c:1213:1: warning: parameter names (without types) in function declaration drivers/net/wireless/realtek/rtwlan/pci.c:1189:26: warning: 'rtw_pci_driver' defined but not used [-Wunused-variable] static struct pci_driver rtw_pci_driver = { ^~~~~~~~~~~~~~ cc1: some warnings being treated as errors vim +880 drivers/net/wireless/realtek/rtwlan/pci.c d6f77d8d Yan-Hsuan Chuang 2018-09-21 864 d6f77d8d Yan-Hsuan Chuang 2018-09-21 865 static int rtw_pci_io_mapping(struct rtw_dev *rtwdev, d6f77d8d Yan-Hsuan Chuang 2018-09-21 866 struct pci_dev *pdev) d6f77d8d Yan-Hsuan Chuang 2018-09-21 867 { d6f77d8d Yan-Hsuan Chuang 2018-09-21 868 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; d6f77d8d Yan-Hsuan Chuang 2018-09-21 869 unsigned long len; d6f77d8d Yan-Hsuan Chuang 2018-09-21 870 u8 bar_id = 2; d6f77d8d Yan-Hsuan Chuang 2018-09-21 871 int ret; d6f77d8d Yan-Hsuan Chuang 2018-09-21 872 d6f77d8d Yan-Hsuan Chuang 2018-09-21 873 ret = pci_request_regions(pdev, KBUILD_MODNAME); d6f77d8d Yan-Hsuan Chuang 2018-09-21 874 if (ret) { d6f77d8d Yan-Hsuan Chuang 2018-09-21 875 rtw_err(rtwdev, "failed to request pci regions\n"); d6f77d8d Yan-Hsuan Chuang 2018-09-21 876 return ret; d6f77d8d Yan-Hsuan Chuang 2018-09-21 877 } d6f77d8d Yan-Hsuan Chuang 2018-09-21 878 d6f77d8d Yan-Hsuan Chuang 2018-09-21 879 len = pci_resource_len(pdev, bar_id); d6f77d8d Yan-Hsuan Chuang 2018-09-21 @880 rtwpci->mmap = pci_iomap(pdev, bar_id, len); d6f77d8d Yan-Hsuan Chuang 2018-09-21 881 if (!rtwpci->mmap) { d6f77d8d Yan-Hsuan Chuang 2018-09-21 882 rtw_err(rtwdev, "failed to map pci memory\n"); d6f77d8d Yan-Hsuan Chuang 2018-09-21 883 return -ENOMEM; d6f77d8d Yan-Hsuan Chuang 2018-09-21 884 } d6f77d8d Yan-Hsuan Chuang 2018-09-21 885 d6f77d8d Yan-Hsuan Chuang 2018-09-21 886 return 0; d6f77d8d Yan-Hsuan Chuang 2018-09-21 887 } d6f77d8d Yan-Hsuan Chuang 2018-09-21 888 d6f77d8d Yan-Hsuan Chuang 2018-09-21 889 static void rtw_pci_io_unmapping(struct rtw_dev *rtwdev, d6f77d8d Yan-Hsuan Chuang 2018-09-21 890 struct pci_dev *pdev) d6f77d8d Yan-Hsuan Chuang 2018-09-21 891 { d6f77d8d Yan-Hsuan Chuang 2018-09-21 892 struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; d6f77d8d Yan-Hsuan Chuang 2018-09-21 893 d6f77d8d Yan-Hsuan Chuang 2018-09-21 894 if (rtwpci->mmap) { d6f77d8d Yan-Hsuan Chuang 2018-09-21 @895 pci_iounmap(pdev, rtwpci->mmap); d6f77d8d Yan-Hsuan Chuang 2018-09-21 896 pci_release_regions(pdev); d6f77d8d Yan-Hsuan Chuang 2018-09-21 897 } d6f77d8d Yan-Hsuan Chuang 2018-09-21 898 } d6f77d8d Yan-Hsuan Chuang 2018-09-21 899 d6f77d8d Yan-Hsuan Chuang 2018-09-21 900 static void rtw_pci_init_aspm(struct rtw_dev *rtwdev) d6f77d8d Yan-Hsuan Chuang 2018-09-21 901 { d6f77d8d Yan-Hsuan Chuang 2018-09-21 902 } d6f77d8d Yan-Hsuan Chuang 2018-09-21 903 d6f77d8d Yan-Hsuan Chuang 2018-09-21 904 static void rtw_dbi_write8(struct rtw_dev *rtwdev, u16 addr, u8 data) d6f77d8d Yan-Hsuan Chuang 2018-09-21 905 { d6f77d8d Yan-Hsuan Chuang 2018-09-21 906 u16 write_addr; d6f77d8d Yan-Hsuan Chuang 2018-09-21 907 u16 remainder = addr & 0x3; d6f77d8d Yan-Hsuan Chuang 2018-09-21 908 u8 flag; d6f77d8d Yan-Hsuan Chuang 2018-09-21 909 u8 cnt = 20; d6f77d8d Yan-Hsuan Chuang 2018-09-21 910 d6f77d8d Yan-Hsuan Chuang 2018-09-21 911 write_addr = ((addr & 0x0ffc) | (BIT(0) << (remainder + 12))); d6f77d8d Yan-Hsuan Chuang 2018-09-21 912 rtw_write8(rtwdev, REG_DBI_WDATA_V1 + remainder, data); d6f77d8d Yan-Hsuan Chuang 2018-09-21 913 rtw_write16(rtwdev, REG_DBI_FLAG_V1, write_addr); d6f77d8d Yan-Hsuan Chuang 2018-09-21 914 rtw_write8(rtwdev, REG_DBI_FLAG_V1 + 2, 0x01); d6f77d8d Yan-Hsuan Chuang 2018-09-21 915 d6f77d8d Yan-Hsuan Chuang 2018-09-21 916 flag = rtw_read8(rtwdev, REG_DBI_FLAG_V1 + 2); d6f77d8d Yan-Hsuan Chuang 2018-09-21 917 while (flag && (cnt != 0)) { d6f77d8d Yan-Hsuan Chuang 2018-09-21 918 udelay(10); d6f77d8d Yan-Hsuan Chuang 2018-09-21 919 flag = rtw_read8(rtwdev, REG_DBI_FLAG_V1 + 2); d6f77d8d Yan-Hsuan Chuang 2018-09-21 920 cnt--; d6f77d8d Yan-Hsuan Chuang 2018-09-21 921 } d6f77d8d Yan-Hsuan Chuang 2018-09-21 922 d6f77d8d Yan-Hsuan Chuang 2018-09-21 923 WARN(flag, "DBI write fail"); d6f77d8d Yan-Hsuan Chuang 2018-09-21 924 } d6f77d8d Yan-Hsuan Chuang 2018-09-21 925 d6f77d8d Yan-Hsuan Chuang 2018-09-21 926 static void rtw_mdio_write(struct rtw_dev *rtwdev, u8 addr, u16 data, bool g1) d6f77d8d Yan-Hsuan Chuang 2018-09-21 927 { d6f77d8d Yan-Hsuan Chuang 2018-09-21 928 u8 page; d6f77d8d Yan-Hsuan Chuang 2018-09-21 929 u8 wflag; d6f77d8d Yan-Hsuan Chuang 2018-09-21 930 u8 cnt; d6f77d8d Yan-Hsuan Chuang 2018-09-21 931 d6f77d8d Yan-Hsuan Chuang 2018-09-21 932 rtw_write16(rtwdev, REG_MDIO_V1, data); d6f77d8d Yan-Hsuan Chuang 2018-09-21 933 d6f77d8d Yan-Hsuan Chuang 2018-09-21 934 page = addr < 0x20 ? 0 : 1; d6f77d8d Yan-Hsuan Chuang 2018-09-21 935 page += g1 ? 0 : 2; d6f77d8d Yan-Hsuan Chuang 2018-09-21 936 rtw_write8(rtwdev, REG_PCIE_MIX_CFG, addr & 0x1f); d6f77d8d Yan-Hsuan Chuang 2018-09-21 937 rtw_write8(rtwdev, REG_PCIE_MIX_CFG + 3, page); d6f77d8d Yan-Hsuan Chuang 2018-09-21 938 d6f77d8d Yan-Hsuan Chuang 2018-09-21 939 rtw_write32_mask(rtwdev, REG_PCIE_MIX_CFG, BIT_MDIO_WFLAG_V1, 1); d6f77d8d Yan-Hsuan Chuang 2018-09-21 940 wflag = rtw_read32_mask(rtwdev, REG_PCIE_MIX_CFG, BIT_MDIO_WFLAG_V1); d6f77d8d Yan-Hsuan Chuang 2018-09-21 941 d6f77d8d Yan-Hsuan Chuang 2018-09-21 942 cnt = 20; d6f77d8d Yan-Hsuan Chuang 2018-09-21 943 while (wflag && (cnt != 0)) { d6f77d8d Yan-Hsuan Chuang 2018-09-21 944 udelay(10); d6f77d8d Yan-Hsuan Chuang 2018-09-21 945 wflag = rtw_read32_mask(rtwdev, REG_PCIE_MIX_CFG, d6f77d8d Yan-Hsuan Chuang 2018-09-21 946 BIT_MDIO_WFLAG_V1); d6f77d8d Yan-Hsuan Chuang 2018-09-21 947 cnt--; d6f77d8d Yan-Hsuan Chuang 2018-09-21 948 } d6f77d8d Yan-Hsuan Chuang 2018-09-21 949 d6f77d8d Yan-Hsuan Chuang 2018-09-21 950 WARN(wflag, "MDIO write fail"); d6f77d8d Yan-Hsuan Chuang 2018-09-21 951 } d6f77d8d Yan-Hsuan Chuang 2018-09-21 952 d6f77d8d Yan-Hsuan Chuang 2018-09-21 953 static void rtw_pci_phy_cfg(struct rtw_dev *rtwdev) d6f77d8d Yan-Hsuan Chuang 2018-09-21 954 { d6f77d8d Yan-Hsuan Chuang 2018-09-21 955 struct rtw_chip_info *chip = rtwdev->chip; d6f77d8d Yan-Hsuan Chuang 2018-09-21 956 struct rtw_intf_phy_para *para; d6f77d8d Yan-Hsuan Chuang 2018-09-21 957 u16 cut; d6f77d8d Yan-Hsuan Chuang 2018-09-21 958 u16 value; d6f77d8d Yan-Hsuan Chuang 2018-09-21 959 u16 offset; d6f77d8d Yan-Hsuan Chuang 2018-09-21 960 u16 ip_sel; d6f77d8d Yan-Hsuan Chuang 2018-09-21 961 int i; d6f77d8d Yan-Hsuan Chuang 2018-09-21 962 d6f77d8d Yan-Hsuan Chuang 2018-09-21 963 cut = BIT(0) << rtwdev->hal.cut_version; d6f77d8d Yan-Hsuan Chuang 2018-09-21 964 d6f77d8d Yan-Hsuan Chuang 2018-09-21 965 for (i = 0; i < chip->intf_table->n_gen1_para; i++) { d6f77d8d Yan-Hsuan Chuang 2018-09-21 966 para = &chip->intf_table->gen1_para[i]; d6f77d8d Yan-Hsuan Chuang 2018-09-21 967 if (!(para->cut_mask & cut)) d6f77d8d Yan-Hsuan Chuang 2018-09-21 968 continue; d6f77d8d Yan-Hsuan Chuang 2018-09-21 969 if (para->offset == 0xffff) d6f77d8d Yan-Hsuan Chuang 2018-09-21 970 break; d6f77d8d Yan-Hsuan Chuang 2018-09-21 971 offset = para->offset; d6f77d8d Yan-Hsuan Chuang 2018-09-21 972 value = para->value; d6f77d8d Yan-Hsuan Chuang 2018-09-21 973 ip_sel = para->ip_sel; d6f77d8d Yan-Hsuan Chuang 2018-09-21 974 if (para->ip_sel == RTW_IP_SEL_PHY) d6f77d8d Yan-Hsuan Chuang 2018-09-21 975 rtw_mdio_write(rtwdev, offset, value, true); d6f77d8d Yan-Hsuan Chuang 2018-09-21 976 else d6f77d8d Yan-Hsuan Chuang 2018-09-21 977 rtw_dbi_write8(rtwdev, offset, value); d6f77d8d Yan-Hsuan Chuang 2018-09-21 978 } d6f77d8d Yan-Hsuan Chuang 2018-09-21 979 d6f77d8d Yan-Hsuan Chuang 2018-09-21 980 for (i = 0; i < chip->intf_table->n_gen2_para; i++) { d6f77d8d Yan-Hsuan Chuang 2018-09-21 981 para = &chip->intf_table->gen2_para[i]; d6f77d8d Yan-Hsuan Chuang 2018-09-21 982 if (!(para->cut_mask & cut)) d6f77d8d Yan-Hsuan Chuang 2018-09-21 983 continue; d6f77d8d Yan-Hsuan Chuang 2018-09-21 984 if (para->offset == 0xffff) d6f77d8d Yan-Hsuan Chuang 2018-09-21 985 break; d6f77d8d Yan-Hsuan Chuang 2018-09-21 986 offset = para->offset; d6f77d8d Yan-Hsuan Chuang 2018-09-21 987 value = para->value; d6f77d8d Yan-Hsuan Chuang 2018-09-21 988 ip_sel = para->ip_sel; d6f77d8d Yan-Hsuan Chuang 2018-09-21 989 if (para->ip_sel == RTW_IP_SEL_PHY) d6f77d8d Yan-Hsuan Chuang 2018-09-21 990 rtw_mdio_write(rtwdev, offset, value, false); d6f77d8d Yan-Hsuan Chuang 2018-09-21 991 else d6f77d8d Yan-Hsuan Chuang 2018-09-21 992 rtw_dbi_write8(rtwdev, offset, value); d6f77d8d Yan-Hsuan Chuang 2018-09-21 993 } d6f77d8d Yan-Hsuan Chuang 2018-09-21 994 } d6f77d8d Yan-Hsuan Chuang 2018-09-21 995 d6f77d8d Yan-Hsuan Chuang 2018-09-21 996 static void rtw_pci_parse_configuration(struct rtw_dev *rtwdev, d6f77d8d Yan-Hsuan Chuang 2018-09-21 997 struct pci_dev *pdev) d6f77d8d Yan-Hsuan Chuang 2018-09-21 998 { d6f77d8d Yan-Hsuan Chuang 2018-09-21 999 u16 link_control; d6f77d8d Yan-Hsuan Chuang 2018-09-21 1000 u8 config; d6f77d8d Yan-Hsuan Chuang 2018-09-21 1001 d6f77d8d Yan-Hsuan Chuang 2018-09-21 1002 /* Disable Clk Request */ d6f77d8d Yan-Hsuan Chuang 2018-09-21 1003 pci_write_config_byte(pdev, 0x81, 0); d6f77d8d Yan-Hsuan Chuang 2018-09-21 1004 /* leave D3 mode */ d6f77d8d Yan-Hsuan Chuang 2018-09-21 1005 pci_write_config_byte(pdev, 0x44, 0); d6f77d8d Yan-Hsuan Chuang 2018-09-21 1006 pci_write_config_byte(pdev, 0x04, 0x06); d6f77d8d Yan-Hsuan Chuang 2018-09-21 1007 pci_write_config_byte(pdev, 0x04, 0x07); d6f77d8d Yan-Hsuan Chuang 2018-09-21 1008 d6f77d8d Yan-Hsuan Chuang 2018-09-21 @1009 pcie_capability_read_word(pdev, PCI_EXP_LNKCTL, &link_control); d6f77d8d Yan-Hsuan Chuang 2018-09-21 1010 d6f77d8d Yan-Hsuan Chuang 2018-09-21 1011 pci_read_config_byte(pdev, 0x98, &config); d6f77d8d Yan-Hsuan Chuang 2018-09-21 1012 config |= BIT(4); d6f77d8d Yan-Hsuan Chuang 2018-09-21 1013 pci_write_config_byte(pdev, 0x98, config); d6f77d8d Yan-Hsuan Chuang 2018-09-21 1014 d6f77d8d Yan-Hsuan Chuang 2018-09-21 1015 pci_write_config_byte(pdev, 0x70f, 0x17); d6f77d8d Yan-Hsuan Chuang 2018-09-21 1016 } d6f77d8d Yan-Hsuan Chuang 2018-09-21 1017 d6f77d8d Yan-Hsuan Chuang 2018-09-21 1018 static int rtw_pci_claim(struct rtw_dev *rtwdev, struct pci_dev *pdev) d6f77d8d Yan-Hsuan Chuang 2018-09-21 1019 { d6f77d8d Yan-Hsuan Chuang 2018-09-21 1020 int ret; d6f77d8d Yan-Hsuan Chuang 2018-09-21 1021 d6f77d8d Yan-Hsuan Chuang 2018-09-21 1022 ret = pci_enable_device(pdev); d6f77d8d Yan-Hsuan Chuang 2018-09-21 1023 if (ret) { d6f77d8d Yan-Hsuan Chuang 2018-09-21 1024 rtw_err(rtwdev, "failed to enable pci device\n"); d6f77d8d Yan-Hsuan Chuang 2018-09-21 1025 return ret; d6f77d8d Yan-Hsuan Chuang 2018-09-21 1026 } d6f77d8d Yan-Hsuan Chuang 2018-09-21 1027 d6f77d8d Yan-Hsuan Chuang 2018-09-21 1028 pci_set_master(pdev); d6f77d8d Yan-Hsuan Chuang 2018-09-21 1029 pci_set_drvdata(pdev, rtwdev->hw); d6f77d8d Yan-Hsuan Chuang 2018-09-21 1030 SET_IEEE80211_DEV(rtwdev->hw, &pdev->dev); d6f77d8d Yan-Hsuan Chuang 2018-09-21 1031 d6f77d8d Yan-Hsuan Chuang 2018-09-21 1032 return 0; d6f77d8d Yan-Hsuan Chuang 2018-09-21 1033 } d6f77d8d Yan-Hsuan Chuang 2018-09-21 1034 d6f77d8d Yan-Hsuan Chuang 2018-09-21 1035 static void rtw_pci_declaim(struct rtw_dev *rtwdev, struct pci_dev *pdev) d6f77d8d Yan-Hsuan Chuang 2018-09-21 1036 { d6f77d8d Yan-Hsuan Chuang 2018-09-21 @1037 pci_clear_master(pdev); d6f77d8d Yan-Hsuan Chuang 2018-09-21 1038 pci_disable_device(pdev); d6f77d8d Yan-Hsuan Chuang 2018-09-21 1039 } d6f77d8d Yan-Hsuan Chuang 2018-09-21 1040 :::::: The code at line 880 was first introduced by commit :::::: d6f77d8d40f1f149ed8722a46f3803c0b09fb642 rtwlan: hci files :::::: TO: Yan-Hsuan Chuang <yhchuang@xxxxxxxxxxx> :::::: CC: 0day robot <lkp@xxxxxxxxx> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip