Re: [PATCH next 2/2] misc: Add Renesas Synchronization Management Unit (SMU) support

kernel test robot
2021-03-27T08:00:56Z

[-- Attachment #1: Type: text/plain, Size: 5832 bytes --]

Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on next-20210326]

url: https://github.com/0day-ci/linux/commits/min-li-xe-renesas-com/mfd-Add-Renesas-Synchronization-Management-Unit-SMU-support/20210327-150316
base: 931294922e65a23e1aad6398b9ae02df74044679
config: x86_64-randconfig-r036-20210327 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/0719d3e2c97f4073f3b495311f260c6c3e0dda28
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review min-li-xe-renesas-com/mfd-Add-Renesas-Synchronization-Management-Unit-SMU-support/20210327-150316
git checkout 0719d3e2c97f4073f3b495311f260c6c3e0dda28
# 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@intel.com>

All errors (new ones prefixed by >>):

ld: drivers/misc/rsmu_cm.o: in function `rsmu_cm_get_dpll_ffo':
>> drivers/misc/rsmu_cm.c:148: undefined reference to `rsmu_read'
ld: drivers/misc/rsmu_cm.o: in function `rsmu_cm_get_dpll_state':
drivers/misc/rsmu_cm.c:80: undefined reference to `rsmu_read'
ld: drivers/misc/rsmu_cm.o: in function `rsmu_cm_set_combomode':
drivers/misc/rsmu_cm.c:56: undefined reference to `rsmu_read'
>> ld: drivers/misc/rsmu_cm.c:67: undefined reference to `rsmu_write'
ld: drivers/misc/rsmu_sabre.o: in function `rsmu_sabre_get_dpll_ffo':
>> drivers/misc/rsmu_sabre.c:110: undefined reference to `rsmu_read'
ld: drivers/misc/rsmu_sabre.o: in function `rsmu_sabre_get_dpll_state':
drivers/misc/rsmu_sabre.c:65: undefined reference to `rsmu_read'
ld: drivers/misc/rsmu_sabre.o: in function `rsmu_sabre_set_combomode':
drivers/misc/rsmu_sabre.c:38: undefined reference to `rsmu_read'
>> ld: drivers/misc/rsmu_sabre.c:45: undefined reference to `rsmu_write'

vim +148 drivers/misc/rsmu_cm.c

17
18 static int rsmu_cm_set_combomode(struct rsmu_cdev *rsmu, u8 dpll, u8 mode)
19 {
20 u16 dpll_ctrl_n;
21 u8 cfg;
22 int err;
23
24 switch (dpll) {
25 case 0:
26 dpll_ctrl_n = DPLL_CTRL_0;
27 break;
28 case 1:
29 dpll_ctrl_n = DPLL_CTRL_1;
30 break;
31 case 2:
32 dpll_ctrl_n = DPLL_CTRL_2;
33 break;
34 case 3:
35 dpll_ctrl_n = DPLL_CTRL_3;
36 break;
37 case 4:
38 dpll_ctrl_n = DPLL_CTRL_4;
39 break;
40 case 5:
41 dpll_ctrl_n = DPLL_CTRL_5;
42 break;
43 case 6:
44 dpll_ctrl_n = DPLL_CTRL_6;
45 break;
46 case 7:
47 dpll_ctrl_n = DPLL_CTRL_7;
48 break;
49 default:
50 return -EINVAL;
51 }
52
53 if (mode >= E_COMBOMODE_MAX)
54 return -EINVAL;
55
56 err = rsmu_read(rsmu->mfd, dpll_ctrl_n + DPLL_CTRL_COMBO_MASTER_CFG,
57 &cfg, sizeof(cfg));
58 if (err)
59 return err;
60
61 /* Only need to enable/disable COMBO_MODE_HOLD. */
62 if (mode)
63 cfg |= COMBO_MASTER_HOLD;
64 else
65 cfg &= ~COMBO_MASTER_HOLD;
66
> 67 return rsmu_write(rsmu->mfd, dpll_ctrl_n + DPLL_CTRL_COMBO_MASTER_CFG,
68 &cfg, sizeof(cfg));
69 }
70
71 static int rsmu_cm_get_dpll_state(struct rsmu_cdev *rsmu, u8 dpll, u8 *state)
72 {
73 u8 cfg;
74 int err;
75
76 /* 8 is sys dpll */
77 if (dpll > 8)
78 return -EINVAL;
79
80 err = rsmu_read(rsmu->mfd,
81 STATUS + DPLL0_STATUS + dpll,
82 &cfg, sizeof(cfg));
83 if (err)
84 return err;
85
86 switch (cfg & DPLL_STATE_MASK) {
87 case DPLL_STATE_FREERUN:
88 *state = E_SRVLOUNQUALIFIEDSTATE;
89 break;
90 case DPLL_STATE_LOCKACQ:
91 case DPLL_STATE_LOCKREC:
92 *state = E_SRVLOLOCKACQSTATE;
93 break;
94 case DPLL_STATE_LOCKED:
95 *state = E_SRVLOTIMELOCKEDSTATE;
96 break;
97 case DPLL_STATE_HOLDOVER:
98 *state = E_SRVLOHOLDOVERINSPECSTATE;
99 break;
100 default:
101 *state = E_SRVLOSTATEINVALID;
102 break;
103 }
104
105 return 0;
106 }
107
108 static int rsmu_cm_get_dpll_ffo(struct rsmu_cdev *rsmu, u8 dpll,
109 struct rsmu_get_ffo *ffo)
110 {
111 u8 buf[8] = {0};
112 s64 fcw = 0;
113 u16 dpll_filter_status;
114 int err;
115
116 switch (dpll) {
117 case 0:
118 dpll_filter_status = DPLL0_FILTER_STATUS;
119 break;
120 case 1:
121 dpll_filter_status = DPLL1_FILTER_STATUS;
122 break;
123 case 2:
124 dpll_filter_status = DPLL2_FILTER_STATUS;
125 break;
126 case 3:
127 dpll_filter_status = DPLL3_FILTER_STATUS;
128 break;
129 case 4:
130 dpll_filter_status = DPLL4_FILTER_STATUS;
131 break;
132 case 5:
133 dpll_filter_status = DPLL5_FILTER_STATUS;
134 break;
135 case 6:
136 dpll_filter_status = DPLL6_FILTER_STATUS;
137 break;
138 case 7:
139 dpll_filter_status = DPLL7_FILTER_STATUS;
140 break;
141 case 8:
142 dpll_filter_status = DPLLSYS_FILTER_STATUS;
143 break;
144 default:
145 return -EINVAL;
146 }
147
> 148 err = rsmu_read(rsmu->mfd, STATUS + dpll_filter_status, buf, 6);
149 if (err)
150 return err;
151
152 /* Convert to frequency control word */
153 fcw = sign_extend64(get_unaligned_le64(buf), 47);
154
155 /* FCW unit is 2 ^ -53 = 1.1102230246251565404236316680908e-16 */
156 ffo->ffo = fcw * 111;
157
158 return 0;
159 }
160

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29323 bytes --]