[frank-w-bpi-r2-4.14:5.15-rtl8367dsa 39/44] drivers/net/dsa/rtl8367s_mdio.h:171:15: error: no previous prototype for 'rtk_vlan_reset'
by kernel test robot
tree: https://github.com/frank-w/BPI-R2-4.14 5.15-rtl8367dsa
head: e9ec03c13f235a810e08f9797a0e826b994a8743
commit: 123e43eb62b6c9b008f7cec61ddae23d97e2f764 [39/44] net: dsa: rtl8367: add basic code from phy driver
config: m68k-allmodconfig (attached as .config)
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/frank-w/BPI-R2-4.14/commit/123e43eb62b6c9b008f7cec61dd...
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 123e43eb62b6c9b008f7cec61ddae23d97e2f764
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=m68k
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 drivers/net/dsa/rtl8367s_mdio.c:23:
>> drivers/net/dsa/rtl8367s_mdio.h:171:15: error: no previous prototype for 'rtk_vlan_reset' [-Werror=missing-prototypes]
171 | rtk_api_ret_t rtk_vlan_reset(void) {return 0;}
| ^~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.h:174:15: error: no previous prototype for 'rtk_vlan_init' [-Werror=missing-prototypes]
174 | rtk_api_ret_t rtk_vlan_init(void) {return 0;}
| ^~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.h:197:15: error: no previous prototype for 'rtk_vlan_set' [-Werror=missing-prototypes]
197 | rtk_api_ret_t rtk_vlan_set(rtk_vlan_t vid, rtk_vlan_cfg_t *pVlanCfg) {return 0;}
| ^~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.h:222:15: error: no previous prototype for 'rtk_vlan_portPvid_set' [-Werror=missing-prototypes]
222 | rtk_api_ret_t rtk_vlan_portPvid_set(rtk_port_t port, rtk_vlan_t pvid, rtk_pri_t priority) {return 0;}
| ^~~~~~~~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.h:258:15: error: no previous prototype for 'rtk_port_macForceLinkExt_set' [-Werror=missing-prototypes]
258 | rtk_api_ret_t rtk_port_macForceLinkExt_set(rtk_port_t port, rtk_mode_ext_t mode, rtk_port_mac_ability_t *pPortability) {return 0;};
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/net/dsa/rtl8367s_mdio.c:23:
>> drivers/net/dsa/rtl8367s_mdio.h:280:15: error: no previous prototype for 'rtk_port_phyEnableAll_set' [-Werror=missing-prototypes]
280 | rtk_api_ret_t rtk_port_phyEnableAll_set(rtk_enable_t enable) {return 0;}
| ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.h:302:15: error: no previous prototype for 'rtk_port_rgmiiDelayExt_set' [-Werror=missing-prototypes]
302 | rtk_api_ret_t rtk_port_rgmiiDelayExt_set(rtk_port_t port, rtk_data_t txDelay, rtk_data_t rxDelay) {return 0;}
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.h:322:15: error: no previous prototype for 'rtk_port_sgmiiNway_set' [-Werror=missing-prototypes]
322 | rtk_api_ret_t rtk_port_sgmiiNway_set(rtk_port_t port, rtk_enable_t state) {return 0;}
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.c:42:14: error: no previous prototype for 'mii_mgr_read' [-Werror=missing-prototypes]
42 | unsigned int mii_mgr_read(unsigned int phy_addr,unsigned int phy_register,unsigned int *read_data)
| ^~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.c:55:14: error: no previous prototype for 'mii_mgr_write' [-Werror=missing-prototypes]
55 | unsigned int mii_mgr_write(unsigned int phy_addr,unsigned int phy_register,unsigned int write_data)
| ^~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.c:68:12: error: redefinition of 'rtk_switch_init'
68 | static int rtk_switch_init(void) { return 0; }
| ^~~~~~~~~~~~~~~
In file included from drivers/net/dsa/rtl8367s_mdio.c:23:
drivers/net/dsa/rtl8367s_mdio.h:135:12: note: previous definition of 'rtk_switch_init' with type 'int(void)'
135 | static int rtk_switch_init(void) { return 0; }
| ^~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.c:209:6: error: no previous prototype for 'init_gsw' [-Werror=missing-prototypes]
209 | void init_gsw(void)
| ^~~~~~~~
In file included from drivers/net/dsa/rtl8367s_mdio.c:23:
drivers/net/dsa/rtl8367s_mdio.h:135:12: error: 'rtk_switch_init' defined but not used [-Werror=unused-function]
135 | static int rtk_switch_init(void) { return 0; }
| ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +/rtk_vlan_reset +171 drivers/net/dsa/rtl8367s_mdio.h
136
137 /* Function Name:
138 * rtk_vlan_init
139 * Description:
140 * Initialize VLAN.
141 * Input:
142 * None
143 * Output:
144 * None
145 * Return:
146 * RT_ERR_OK - OK
147 * RT_ERR_FAILED - Failed
148 * RT_ERR_SMI - SMI access error
149 * Note:
150 * VLAN is disabled by default. User has to call this API to enable VLAN before
151 * using it. And It will set a default VLAN(vid 1) including all ports and set
152 * all ports PVID to the default VLAN.
153 */
154
155 /* Function Name:
156 * rtk_vlan_reset
157 * Description:
158 * Reset VLAN
159 * Input:
160 * None.
161 * Output:
162 * pEnabled - State of 1p remarking at real keep packet
163 * Return:
164 * RT_ERR_OK - OK
165 * RT_ERR_FAILED - Failed
166 * RT_ERR_SMI - SMI access error
167 * RT_ERR_INPUT - Error Input
168 * Note:
169 *
170 */
> 171 rtk_api_ret_t rtk_vlan_reset(void) {return 0;}
172
173 //extern
> 174 rtk_api_ret_t rtk_vlan_init(void) {return 0;}
175
176 /* Function Name:
177 * rtk_vlan_set
178 * Description:
179 * Set a VLAN entry.
180 * Input:
181 * vid - VLAN ID to configure.
182 * pVlanCfg - VLAN Configuration
183 * Output:
184 * None
185 * Return:
186 * RT_ERR_OK - OK
187 * RT_ERR_FAILED - Failed
188 * RT_ERR_SMI - SMI access error
189 * RT_ERR_INPUT - Invalid input parameters.
190 * RT_ERR_L2_FID - Invalid FID.
191 * RT_ERR_VLAN_PORT_MBR_EXIST - Invalid member port mask.
192 * RT_ERR_VLAN_VID - Invalid VID parameter.
193 * Note:
194 *
195 */
196 //extern
> 197 rtk_api_ret_t rtk_vlan_set(rtk_vlan_t vid, rtk_vlan_cfg_t *pVlanCfg) {return 0;}
198
199 /* Function Name:
200 * rtk_vlan_portPvid_set
201 * Description:
202 * Set port to specified VLAN ID(PVID).
203 * Input:
204 * port - Port id.
205 * pvid - Specified VLAN ID.
206 * priority - 802.1p priority for the PVID.
207 * Output:
208 * None
209 * Return:
210 * RT_ERR_OK - OK
211 * RT_ERR_FAILED - Failed
212 * RT_ERR_SMI - SMI access error
213 * RT_ERR_PORT_ID - Invalid port number.
214 * RT_ERR_VLAN_PRIORITY - Invalid priority.
215 * RT_ERR_VLAN_ENTRY_NOT_FOUND - VLAN entry not found.
216 * RT_ERR_VLAN_VID - Invalid VID parameter.
217 * Note:
218 * The API is used for Port-based VLAN. The untagged frame received from the
219 * port will be classified to the specified VLAN and assigned to the specified priority.
220 */
221 //extern
> 222 rtk_api_ret_t rtk_vlan_portPvid_set(rtk_port_t port, rtk_vlan_t pvid, rtk_pri_t priority) {return 0;}
223
224 /* Function Name:
225 * rtk_port_macForceLinkExt_set
226 * Description:
227 * Set external interface force linking configuration.
228 * Input:
229 * port - external port ID
230 * mode - external interface mode
231 * pPortability - port ability configuration
232 * Output:
233 * None
234 * Return:
235 * RT_ERR_OK - OK
236 * RT_ERR_FAILED - Failed
237 * RT_ERR_SMI - SMI access error
238 * RT_ERR_INPUT - Invalid input parameters.
239 * Note:
240 * This API can set external interface force mode properties.
241 * The external interface can be set to:
242 * - MODE_EXT_DISABLE,
243 * - MODE_EXT_RGMII,
244 * - MODE_EXT_MII_MAC,
245 * - MODE_EXT_MII_PHY,
246 * - MODE_EXT_TMII_MAC,
247 * - MODE_EXT_TMII_PHY,
248 * - MODE_EXT_GMII,
249 * - MODE_EXT_RMII_MAC,
250 * - MODE_EXT_RMII_PHY,
251 * - MODE_EXT_SGMII,
252 * - MODE_EXT_HSGMII,
253 * - MODE_EXT_1000X_100FX,
254 * - MODE_EXT_1000X,
255 * - MODE_EXT_100FX,
256 */
257 //extern
> 258 rtk_api_ret_t rtk_port_macForceLinkExt_set(rtk_port_t port, rtk_mode_ext_t mode, rtk_port_mac_ability_t *pPortability) {return 0;};
259
260 /* Function Name:
261 * rtk_port_phyEnableAll_set
262 * Description:
263 * Set all PHY enable status.
264 * Input:
265 * enable - PHY Enable State.
266 * Output:
267 * None
268 * Return:
269 * RT_ERR_OK - OK
270 * RT_ERR_FAILED - Failed
271 * RT_ERR_SMI - SMI access error
272 * RT_ERR_ENABLE - Invalid enable input.
273 * Note:
274 * This API can set all PHY status.
275 * The configuration of all PHY is as following:
276 * - DISABLE
277 * - ENABLE
278 */
279 //extern
> 280 rtk_api_ret_t rtk_port_phyEnableAll_set(rtk_enable_t enable) {return 0;}
281
282 /* Function Name:
283 * rtk_port_rgmiiDelayExt_set
284 * Description:
285 * Set RGMII interface delay value for TX and RX.
286 * Input:
287 * txDelay - TX delay value, 1 for delay 2ns and 0 for no-delay
288 * rxDelay - RX delay value, 0~7 for delay setup.
289 * Output:
290 * None
291 * Return:
292 * RT_ERR_OK - OK
293 * RT_ERR_FAILED - Failed
294 * RT_ERR_SMI - SMI access error
295 * RT_ERR_INPUT - Invalid input parameters.
296 * Note:
297 * This API can set external interface 2 RGMII delay.
298 * In TX delay, there are 2 selection: no-delay and 2ns delay.
299 * In RX dekay, there are 8 steps for delay tunning. 0 for no-delay, and 7 for maximum delay.
300 */
301 //extern
> 302 rtk_api_ret_t rtk_port_rgmiiDelayExt_set(rtk_port_t port, rtk_data_t txDelay, rtk_data_t rxDelay) {return 0;}
303
304 /* Function Name:
305 * rtk_port_sgmiiNway_set
306 * Description:
307 * Configure SGMII/HSGMII port Nway state
308 * Input:
309 * port - Port ID
310 * state - Nway state
311 * Output:
312 * None.
313 * Return:
314 * RT_ERR_OK - OK
315 * RT_ERR_FAILED - Failed
316 * RT_ERR_SMI - SMI access error
317 * RT_ERR_PORT_ID - Invalid port ID.
318 * Note:
319 * The API configure SGMII/HSGMII port Nway state
320 */
321 //extern
> 322 rtk_api_ret_t rtk_port_sgmiiNway_set(rtk_port_t port, rtk_enable_t state) {return 0;}
323
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
[frank-w-bpi-r2-4.14:5.15-rtl8367dsa 42/44] drivers/net/dsa/rtl8367s_mdio.h:664:15: warning: no previous prototype for 'rtk_switch_logicalPortCheck'
by kernel test robot
tree: https://github.com/frank-w/BPI-R2-4.14 5.15-rtl8367dsa
head: e9ec03c13f235a810e08f9797a0e826b994a8743
commit: fb5ff9592d60bcaaac8322ffd96b90bcf30d1f79 [42/44] net: dsa: rtl8367: add basic init for CHIP_RTL8367C
config: s390-randconfig-r022-20211114 (attached as .config)
compiler: s390-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/frank-w/BPI-R2-4.14/commit/fb5ff9592d60bcaaac8322ffd96...
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 fb5ff9592d60bcaaac8322ffd96b90bcf30d1f79
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=s390
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 >>):
In file included from drivers/net/dsa/rtl8367s_mdio.c:23:
drivers/net/dsa/rtl8367s_mdio.h:511:15: warning: no previous prototype for 'rtk_vlan_reset' [-Wmissing-prototypes]
511 | rtk_api_ret_t rtk_vlan_reset(void) {return 0;}
| ^~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:514:15: warning: no previous prototype for 'rtk_vlan_init' [-Wmissing-prototypes]
514 | rtk_api_ret_t rtk_vlan_init(void) {return 0;}
| ^~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:537:15: warning: no previous prototype for 'rtk_vlan_set' [-Wmissing-prototypes]
537 | rtk_api_ret_t rtk_vlan_set(rtk_vlan_t vid, rtk_vlan_cfg_t *pVlanCfg) {return 0;}
| ^~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:562:15: warning: no previous prototype for 'rtk_vlan_portPvid_set' [-Wmissing-prototypes]
562 | rtk_api_ret_t rtk_vlan_portPvid_set(rtk_port_t port, rtk_vlan_t pvid, rtk_pri_t priority) {return 0;}
| ^~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:598:15: warning: no previous prototype for 'rtk_port_macForceLinkExt_set' [-Wmissing-prototypes]
598 | rtk_api_ret_t rtk_port_macForceLinkExt_set(rtk_port_t port, rtk_mode_ext_t mode, rtk_port_mac_ability_t *pPortability) {return 0;};
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:620:15: warning: no previous prototype for 'rtk_port_phyEnableAll_set' [-Wmissing-prototypes]
620 | rtk_api_ret_t rtk_port_phyEnableAll_set(rtk_enable_t enable) {return 0;}
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:642:15: warning: no previous prototype for 'rtk_port_rgmiiDelayExt_set' [-Wmissing-prototypes]
642 | rtk_api_ret_t rtk_port_rgmiiDelayExt_set(rtk_port_t port, rtk_data_t txDelay, rtk_data_t rxDelay) {return 0;}
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:662:15: warning: no previous prototype for 'rtk_port_sgmiiNway_set' [-Wmissing-prototypes]
662 | rtk_api_ret_t rtk_port_sgmiiNway_set(rtk_port_t port, rtk_enable_t state) {return 0;}
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.h:664:15: warning: no previous prototype for 'rtk_switch_logicalPortCheck' [-Wmissing-prototypes]
664 | rtk_api_ret_t rtk_switch_logicalPortCheck(rtk_port_t logicalPort)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.h:679:15: warning: no previous prototype for 'rtk_switch_isUtpPort' [-Wmissing-prototypes]
679 | rtk_api_ret_t rtk_switch_isUtpPort(rtk_port_t logicalPort)
| ^~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.c:46:14: warning: no previous prototype for 'mii_mgr_read' [-Wmissing-prototypes]
46 | unsigned int mii_mgr_read(unsigned int phy_addr,unsigned int phy_register,unsigned int *read_data)
| ^~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.c:59:14: warning: no previous prototype for 'mii_mgr_write' [-Wmissing-prototypes]
59 | unsigned int mii_mgr_write(unsigned int phy_addr,unsigned int phy_register,unsigned int write_data)
| ^~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.c:76:11: warning: no previous prototype for 'smi_read' [-Wmissing-prototypes]
76 | rtk_int32 smi_read(rtk_uint32 mAddrs, rtk_uint32 *rData)
| ^~~~~~~~
drivers/net/dsa/rtl8367s_mdio.c:105:11: warning: no previous prototype for 'smi_write' [-Wmissing-prototypes]
105 | rtk_int32 smi_write(rtk_uint32 mAddrs, rtk_uint32 rData)
| ^~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.c:135:7: warning: no previous prototype for 'rtl8367c_setAsicReg' [-Wmissing-prototypes]
135 | ret_t rtl8367c_setAsicReg(rtk_uint32 reg, rtk_uint32 value)
| ^~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.c:146:7: warning: no previous prototype for 'rtl8367c_getAsicReg' [-Wmissing-prototypes]
146 | ret_t rtl8367c_getAsicReg(rtk_uint32 reg, rtk_uint32 *pValue)
| ^~~~~~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.c:162:7: warning: no previous prototype for 'rtl8367c_setAsicRegBit' [-Wmissing-prototypes]
162 | ret_t rtl8367c_setAsicRegBit(rtk_uint32 reg, rtk_uint32 bit, rtk_uint32 value)
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.c:186:7: warning: no previous prototype for 'rtl8367c_getAsicRegBit' [-Wmissing-prototypes]
186 | ret_t rtl8367c_getAsicRegBit(rtk_uint32 reg, rtk_uint32 bit, rtk_uint32 *pValue)
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.c:201:7: warning: no previous prototype for 'rtl8367c_getAsicRegBits' [-Wmissing-prototypes]
201 | ret_t rtl8367c_getAsicRegBits(rtk_uint32 reg, rtk_uint32 bits, rtk_uint32 *pValue)
| ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.c:227:7: warning: no previous prototype for 'rtl8367c_setAsicRegBits' [-Wmissing-prototypes]
227 | ret_t rtl8367c_setAsicRegBits(rtk_uint32 reg, rtk_uint32 bits, rtk_uint32 value)
| ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.c:264:7: warning: no previous prototype for 'rtl8367c_setAsicPHYOCPReg' [-Wmissing-prototypes]
264 | ret_t rtl8367c_setAsicPHYOCPReg(rtk_uint32 phyNo, rtk_uint32 ocpAddr, rtk_uint32 ocpData )
| ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.c:285:7: warning: no previous prototype for 'rtl8367c_getAsicPHYOCPReg' [-Wmissing-prototypes]
285 | ret_t rtl8367c_getAsicPHYOCPReg(rtk_uint32 phyNo, rtk_uint32 ocpAddr, rtk_uint32 *pRegData )
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.c:405:15: warning: no previous prototype for 'rtk_switch_probe' [-Wmissing-prototypes]
405 | rtk_api_ret_t rtk_switch_probe(switch_chip_t *pSwitchChip)
| ^~~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.c:454:15: warning: no previous prototype for 'rtk_switch_initialState_set' [-Wmissing-prototypes]
454 | rtk_api_ret_t rtk_switch_initialState_set(init_state_t state)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.c:463:15: warning: no previous prototype for 'rtk_switch_init' [-Wmissing-prototypes]
463 | rtk_api_ret_t rtk_switch_init(void)
| ^~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.c:633:6: warning: no previous prototype for 'init_gsw' [-Wmissing-prototypes]
633 | void init_gsw(void)
| ^~~~~~~~
vim +/rtk_switch_logicalPortCheck +664 drivers/net/dsa/rtl8367s_mdio.h
663
> 664 rtk_api_ret_t rtk_switch_logicalPortCheck(rtk_port_t logicalPort)
665 {
666 if(init_state != INIT_COMPLETED)
667 return RT_ERR_NOT_INIT;
668
669 if(logicalPort >= RTK_SWITCH_PORT_NUM)
670 return RT_ERR_FAILED;
671
672 if(halCtrl->l2p_port[logicalPort] == 0xFF)
673 return RT_ERR_FAILED;
674
675 return RT_ERR_OK;
676 }
677 #define RTK_SCAN_ALL_LOG_PORT(__port__) for(__port__ = 0; __port__ < RTK_SWITCH_PORT_NUM; __port__++) if( rtk_switch_logicalPortCheck(__port__) == RT_ERR_OK)
678
> 679 rtk_api_ret_t rtk_switch_isUtpPort(rtk_port_t logicalPort)
680 {
681 if(init_state != INIT_COMPLETED)
682 return RT_ERR_NOT_INIT;
683
684 if(logicalPort >= RTK_SWITCH_PORT_NUM)
685 return RT_ERR_FAILED;
686
687 if(halCtrl->log_port_type[logicalPort] == UTP_PORT)
688 return RT_ERR_OK;
689 else
690 return RT_ERR_FAILED;
691 }
692
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
vmlinux.o: warning: objtool: __sev_es_ist_exit()+0x32: call to ftrace_likely_update() leaves .noinstr.text section
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ccfff0a2bd2a30de130b5623d242ddecd0272bc2
commit: 315562c9af3d583502b35c4b223a08d95ce69864 x86/sev-es: Adjust #VC IST Stack on entering NMI handler
date: 1 year, 2 months ago
config: x86_64-buildonly-randconfig-r005-20211028 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 315562c9af3d583502b35c4b223a08d95ce69864
# save the attached .config to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
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 >>):
vmlinux.o: warning: objtool: idtentry_enter_nmi()+0x54: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: idtentry_exit_nmi()+0x75: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: __wrgsbase_inactive()+0x33: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: __rdgsbase_inactive()+0x30: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: fixup_bad_iret()+0x7b: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: noist_exc_debug()+0x3d: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: exc_nmi()+0x37: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: poke_int3_handler()+0x51: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: mce_check_crashing_cpu()+0x37: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: do_machine_check()+0x3f: call to mce_rdmsrl() leaves .noinstr.text section
vmlinux.o: warning: objtool: exc_machine_check()+0x9a: call to ftrace_likely_update() leaves .noinstr.text section
>> vmlinux.o: warning: objtool: __sev_es_ist_exit()+0x32: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: match_held_lock()+0x11c: call to rcu_read_lock_any_held() leaves .noinstr.text section
vmlinux.o: warning: objtool: lock_is_held_type()+0x44: call to check_flags.part.0() leaves .noinstr.text section
vmlinux.o: warning: objtool: rcu_dynticks_eqs_enter()+0x44: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: rcu_dynticks_eqs_exit()+0x48: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: rcu_eqs_enter.constprop.0()+0x48: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: rcu_eqs_exit.constprop.0()+0x36: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: rcu_irq_exit()+0x29: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: rcu_nmi_enter()+0x3f: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: rcu_irq_enter()+0x29: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: syscall_enter_from_user_mode()+0x4a: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: syscall_enter_from_user_mode_prepare()+0x46: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: syscall_exit_to_user_mode()+0x139: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: irqentry_enter_from_user_mode()+0x46: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: irqentry_exit_to_user_mode()+0x35: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: irqentry_exit()+0x35: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: context_tracking_recursion_enter()+0x101: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: __context_tracking_enter()+0x38: call to ftrace_likely_update() leaves .noinstr.text section
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
[frank-w-bpi-r2-4.14:5.15-rtl8367dsa 40/44] drivers/net/dsa/rtl8367s_mdio.c:79:11: warning: no previous prototype for 'smi_read'
by kernel test robot
tree: https://github.com/frank-w/BPI-R2-4.14 5.15-rtl8367dsa
head: e9ec03c13f235a810e08f9797a0e826b994a8743
commit: 135bbd3ba8140624beeff45f30dc314c30a9be6f [40/44] net: dsa: rtl8367: add chip detection
config: s390-randconfig-r022-20211114 (attached as .config)
compiler: s390-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/frank-w/BPI-R2-4.14/commit/135bbd3ba8140624beeff45f30d...
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 135bbd3ba8140624beeff45f30dc314c30a9be6f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=s390
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 >>):
In file included from drivers/net/dsa/rtl8367s_mdio.c:23:
drivers/net/dsa/rtl8367s_mdio.h:393:15: warning: no previous prototype for 'rtk_vlan_reset' [-Wmissing-prototypes]
393 | rtk_api_ret_t rtk_vlan_reset(void) {return 0;}
| ^~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:396:15: warning: no previous prototype for 'rtk_vlan_init' [-Wmissing-prototypes]
396 | rtk_api_ret_t rtk_vlan_init(void) {return 0;}
| ^~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:419:15: warning: no previous prototype for 'rtk_vlan_set' [-Wmissing-prototypes]
419 | rtk_api_ret_t rtk_vlan_set(rtk_vlan_t vid, rtk_vlan_cfg_t *pVlanCfg) {return 0;}
| ^~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:444:15: warning: no previous prototype for 'rtk_vlan_portPvid_set' [-Wmissing-prototypes]
444 | rtk_api_ret_t rtk_vlan_portPvid_set(rtk_port_t port, rtk_vlan_t pvid, rtk_pri_t priority) {return 0;}
| ^~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:480:15: warning: no previous prototype for 'rtk_port_macForceLinkExt_set' [-Wmissing-prototypes]
480 | rtk_api_ret_t rtk_port_macForceLinkExt_set(rtk_port_t port, rtk_mode_ext_t mode, rtk_port_mac_ability_t *pPortability) {return 0;};
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:502:15: warning: no previous prototype for 'rtk_port_phyEnableAll_set' [-Wmissing-prototypes]
502 | rtk_api_ret_t rtk_port_phyEnableAll_set(rtk_enable_t enable) {return 0;}
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:524:15: warning: no previous prototype for 'rtk_port_rgmiiDelayExt_set' [-Wmissing-prototypes]
524 | rtk_api_ret_t rtk_port_rgmiiDelayExt_set(rtk_port_t port, rtk_data_t txDelay, rtk_data_t rxDelay) {return 0;}
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:544:15: warning: no previous prototype for 'rtk_port_sgmiiNway_set' [-Wmissing-prototypes]
544 | rtk_api_ret_t rtk_port_sgmiiNway_set(rtk_port_t port, rtk_enable_t state) {return 0;}
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.c:49:14: warning: no previous prototype for 'mii_mgr_read' [-Wmissing-prototypes]
49 | unsigned int mii_mgr_read(unsigned int phy_addr,unsigned int phy_register,unsigned int *read_data)
| ^~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.c:62:14: warning: no previous prototype for 'mii_mgr_write' [-Wmissing-prototypes]
62 | unsigned int mii_mgr_write(unsigned int phy_addr,unsigned int phy_register,unsigned int write_data)
| ^~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.c:79:11: warning: no previous prototype for 'smi_read' [-Wmissing-prototypes]
79 | rtk_int32 smi_read(rtk_uint32 mAddrs, rtk_uint32 *rData)
| ^~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.c:108:11: warning: no previous prototype for 'smi_write' [-Wmissing-prototypes]
108 | rtk_int32 smi_write(rtk_uint32 mAddrs, rtk_uint32 rData)
| ^~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.c:155:7: warning: no previous prototype for 'rtl8367c_setAsicReg' [-Wmissing-prototypes]
155 | ret_t rtl8367c_setAsicReg(rtk_uint32 reg, rtk_uint32 value)
| ^~~~~~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.c:180:7: warning: no previous prototype for 'rtl8367c_getAsicReg' [-Wmissing-prototypes]
180 | ret_t rtl8367c_getAsicReg(rtk_uint32 reg, rtk_uint32 *pValue)
| ^~~~~~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.c:210:15: warning: no previous prototype for 'rtk_switch_probe' [-Wmissing-prototypes]
210 | rtk_api_ret_t rtk_switch_probe(switch_chip_t *pSwitchChip)
| ^~~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.c:258:15: warning: no previous prototype for 'rtk_switch_init' [-Wmissing-prototypes]
258 | rtk_api_ret_t rtk_switch_init(void)
| ^~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.c:412:6: warning: no previous prototype for 'init_gsw' [-Wmissing-prototypes]
412 | void init_gsw(void)
| ^~~~~~~~
vim +/smi_read +79 drivers/net/dsa/rtl8367s_mdio.c
77
78 //MDC_MDIO_OPERATION is defined in phy code via makefile
> 79 rtk_int32 smi_read(rtk_uint32 mAddrs, rtk_uint32 *rData)
80 {
81 if(mAddrs > 0xFFFF)
82 return RT_ERR_INPUT;
83
84 if(rData == NULL)
85 return RT_ERR_NULL_POINTER;
86
87 /* Lock (empty function in phy driver) */
88 //rtlglue_drvMutexLock();
89
90 /* Write address control code to register 31 */
91 MDC_MDIO_WRITE(MDC_MDIO_PREAMBLE_LEN, MDC_MDIO_PHY_ID, MDC_MDIO_CTRL0_REG, MDC_MDIO_ADDR_OP);
92
93 /* Write address to register 23 */
94 MDC_MDIO_WRITE(MDC_MDIO_PREAMBLE_LEN, MDC_MDIO_PHY_ID, MDC_MDIO_ADDRESS_REG, mAddrs);
95
96 /* Write read control code to register 21 */
97 MDC_MDIO_WRITE(MDC_MDIO_PREAMBLE_LEN, MDC_MDIO_PHY_ID, MDC_MDIO_CTRL1_REG, MDC_MDIO_READ_OP);
98
99 /* Read data from register 25 */
100 MDC_MDIO_READ(MDC_MDIO_PREAMBLE_LEN, MDC_MDIO_PHY_ID, MDC_MDIO_DATA_READ_REG, rData);
101
102 /* Unlock (empty function in phy driver) */
103 //rtlglue_drvMutexUnlock();
104
105 return RT_ERR_OK;
106 }
107
> 108 rtk_int32 smi_write(rtk_uint32 mAddrs, rtk_uint32 rData)
109 {
110 if(mAddrs > 0xFFFF)
111 return RT_ERR_INPUT;
112
113 if(rData > 0xFFFF)
114 return RT_ERR_INPUT;
115
116 /* Lock (empty function in phy driver) */
117 //rtlglue_drvMutexLock();
118
119 /* Write address control code to register 31 */
120 MDC_MDIO_WRITE(MDC_MDIO_PREAMBLE_LEN, MDC_MDIO_PHY_ID, MDC_MDIO_CTRL0_REG, MDC_MDIO_ADDR_OP);
121
122 /* Write address to register 23 */
123 MDC_MDIO_WRITE(MDC_MDIO_PREAMBLE_LEN, MDC_MDIO_PHY_ID, MDC_MDIO_ADDRESS_REG, mAddrs);
124
125 /* Write data to register 24 */
126 MDC_MDIO_WRITE(MDC_MDIO_PREAMBLE_LEN, MDC_MDIO_PHY_ID, MDC_MDIO_DATA_WRITE_REG, rData);
127
128 /* Write data control code to register 21 */
129 MDC_MDIO_WRITE(MDC_MDIO_PREAMBLE_LEN, MDC_MDIO_PHY_ID, MDC_MDIO_CTRL1_REG, MDC_MDIO_WRITE_OP);
130
131 /* Unlock (empty function in phy driver) */
132 //rtlglue_drvMutexUnlock();
133
134 return RT_ERR_OK;
135
136 }
137
138
139
140 /* Function Name:
141 * rtl8367c_setAsicReg
142 * Description:
143 * Set content of asic register
144 * Input:
145 * reg - register's address
146 * value - Value setting to register
147 * Output:
148 * None
149 * Return:
150 * RT_ERR_OK - Success
151 * RT_ERR_SMI - SMI access error
152 * Note:
153 * The value will be set to ASIC mapping address only and it is always return RT_ERR_OK while setting un-mapping address registers
154 */
> 155 ret_t rtl8367c_setAsicReg(rtk_uint32 reg, rtk_uint32 value)
156 {
157 ret_t retVal;
158
159 retVal = smi_write(reg, value);
160 if(retVal != RT_ERR_OK)
161 return RT_ERR_SMI;
162
163 return RT_ERR_OK;
164 }
165 /* Function Name:
166 * rtl8367c_getAsicReg
167 * Description:
168 * Get content of asic register
169 * Input:
170 * reg - register's address
171 * value - Value setting to register
172 * Output:
173 * None
174 * Return:
175 * RT_ERR_OK - Success
176 * RT_ERR_SMI - SMI access error
177 * Note:
178 * Value 0x0000 will be returned for ASIC un-mapping address
179 */
> 180 ret_t rtl8367c_getAsicReg(rtk_uint32 reg, rtk_uint32 *pValue)
181 {
182
183 rtk_uint32 regData;
184 ret_t retVal;
185
186 retVal = smi_read(reg, ®Data);
187 if(retVal != RT_ERR_OK)
188 return RT_ERR_SMI;
189
190 *pValue = regData;
191
192 return RT_ERR_OK;
193 }
194
195
196 /* Function Name:
197 * rtk_switch_probe
198 * Description:
199 * Probe switch
200 * Input:
201 * None
202 * Output:
203 * None
204 * Return:
205 * RT_ERR_OK - Switch probed
206 * RT_ERR_FAILED - Switch Unprobed.
207 * Note:
208 *
209 */
> 210 rtk_api_ret_t rtk_switch_probe(switch_chip_t *pSwitchChip)
211 {
212 rtk_uint32 retVal;
213 rtk_uint32 data, regValue;
214
215 if((retVal = rtl8367c_setAsicReg(0x13C2, 0x0249)) != RT_ERR_OK)
216 return retVal;
217
218 if((retVal = rtl8367c_getAsicReg(0x1300, &data)) != RT_ERR_OK)
219 return retVal;
220
221 if((retVal = rtl8367c_getAsicReg(0x1301, ®Value)) != RT_ERR_OK)
222 return retVal;
223
224 if((retVal = rtl8367c_setAsicReg(0x13C2, 0x0000)) != RT_ERR_OK)
225 return retVal;
226
227 printk(KERN_ALERT "DEBUG: Passed %s %d chip: 0x%x\n",__FUNCTION__,__LINE__,data); //0x6367 on r64 v0.1
228
229 switch (data)
230 {
231 case 0x0276:
232 case 0x0597:
233 case 0x6367:
234 *pSwitchChip = CHIP_RTL8367C;
235 break;
236 case 0x0652:
237 case 0x6368:
238 *pSwitchChip = CHIP_RTL8370B;
239 break;
240 case 0x0801:
241 case 0x6511:
242 if( (regValue & 0x00F0) == 0x0080)
243 {
244 *pSwitchChip = CHIP_RTL8363SC_VB;
245 }
246 else
247 {
248 *pSwitchChip = CHIP_RTL8364B;
249 }
250 break;
251 default:
252 return RT_ERR_FAILED;
253 }
254
255 return RT_ERR_OK;
256 }
257
> 258 rtk_api_ret_t rtk_switch_init(void)
259 {
260 rtk_uint32 retVal;
261 //rtl8367c_rma_t rmaCfg;
262 switch_chip_t switchChip;
263
264 /* probe switch */
265 if ((retVal = rtk_switch_probe(&switchChip)) != RT_ERR_OK)
266 return retVal;
267
268 //some more missing here...
269
270 return 0;
271 }
272
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
[frank-w-bpi-r2-4.14:5.15-rtl8367dsa 39/44] drivers/net/dsa/rtl8367s_mdio.h:171:15: warning: no previous prototype for 'rtk_vlan_reset'
by kernel test robot
tree: https://github.com/frank-w/BPI-R2-4.14 5.15-rtl8367dsa
head: e9ec03c13f235a810e08f9797a0e826b994a8743
commit: 123e43eb62b6c9b008f7cec61ddae23d97e2f764 [39/44] net: dsa: rtl8367: add basic code from phy driver
config: s390-randconfig-r022-20211114 (attached as .config)
compiler: s390-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/frank-w/BPI-R2-4.14/commit/123e43eb62b6c9b008f7cec61dd...
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 123e43eb62b6c9b008f7cec61ddae23d97e2f764
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=s390
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 >>):
In file included from drivers/net/dsa/rtl8367s_mdio.c:23:
>> drivers/net/dsa/rtl8367s_mdio.h:171:15: warning: no previous prototype for 'rtk_vlan_reset' [-Wmissing-prototypes]
171 | rtk_api_ret_t rtk_vlan_reset(void) {return 0;}
| ^~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.h:174:15: warning: no previous prototype for 'rtk_vlan_init' [-Wmissing-prototypes]
174 | rtk_api_ret_t rtk_vlan_init(void) {return 0;}
| ^~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.h:197:15: warning: no previous prototype for 'rtk_vlan_set' [-Wmissing-prototypes]
197 | rtk_api_ret_t rtk_vlan_set(rtk_vlan_t vid, rtk_vlan_cfg_t *pVlanCfg) {return 0;}
| ^~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.h:222:15: warning: no previous prototype for 'rtk_vlan_portPvid_set' [-Wmissing-prototypes]
222 | rtk_api_ret_t rtk_vlan_portPvid_set(rtk_port_t port, rtk_vlan_t pvid, rtk_pri_t priority) {return 0;}
| ^~~~~~~~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.h:258:15: warning: no previous prototype for 'rtk_port_macForceLinkExt_set' [-Wmissing-prototypes]
258 | rtk_api_ret_t rtk_port_macForceLinkExt_set(rtk_port_t port, rtk_mode_ext_t mode, rtk_port_mac_ability_t *pPortability) {return 0;};
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/net/dsa/rtl8367s_mdio.c:23:
>> drivers/net/dsa/rtl8367s_mdio.h:280:15: warning: no previous prototype for 'rtk_port_phyEnableAll_set' [-Wmissing-prototypes]
280 | rtk_api_ret_t rtk_port_phyEnableAll_set(rtk_enable_t enable) {return 0;}
| ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.h:302:15: warning: no previous prototype for 'rtk_port_rgmiiDelayExt_set' [-Wmissing-prototypes]
302 | rtk_api_ret_t rtk_port_rgmiiDelayExt_set(rtk_port_t port, rtk_data_t txDelay, rtk_data_t rxDelay) {return 0;}
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.h:322:15: warning: no previous prototype for 'rtk_port_sgmiiNway_set' [-Wmissing-prototypes]
322 | rtk_api_ret_t rtk_port_sgmiiNway_set(rtk_port_t port, rtk_enable_t state) {return 0;}
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.c:42:14: warning: no previous prototype for 'mii_mgr_read' [-Wmissing-prototypes]
42 | unsigned int mii_mgr_read(unsigned int phy_addr,unsigned int phy_register,unsigned int *read_data)
| ^~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.c:55:14: warning: no previous prototype for 'mii_mgr_write' [-Wmissing-prototypes]
55 | unsigned int mii_mgr_write(unsigned int phy_addr,unsigned int phy_register,unsigned int write_data)
| ^~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.c:68:12: error: redefinition of 'rtk_switch_init'
68 | static int rtk_switch_init(void) { return 0; }
| ^~~~~~~~~~~~~~~
In file included from drivers/net/dsa/rtl8367s_mdio.c:23:
drivers/net/dsa/rtl8367s_mdio.h:135:12: note: previous definition of 'rtk_switch_init' with type 'int(void)'
135 | static int rtk_switch_init(void) { return 0; }
| ^~~~~~~~~~~~~~~
>> drivers/net/dsa/rtl8367s_mdio.c:209:6: warning: no previous prototype for 'init_gsw' [-Wmissing-prototypes]
209 | void init_gsw(void)
| ^~~~~~~~
In file included from drivers/net/dsa/rtl8367s_mdio.c:23:
drivers/net/dsa/rtl8367s_mdio.h:135:12: warning: 'rtk_switch_init' defined but not used [-Wunused-function]
135 | static int rtk_switch_init(void) { return 0; }
| ^~~~~~~~~~~~~~~
vim +/rtk_vlan_reset +171 drivers/net/dsa/rtl8367s_mdio.h
136
137 /* Function Name:
138 * rtk_vlan_init
139 * Description:
140 * Initialize VLAN.
141 * Input:
142 * None
143 * Output:
144 * None
145 * Return:
146 * RT_ERR_OK - OK
147 * RT_ERR_FAILED - Failed
148 * RT_ERR_SMI - SMI access error
149 * Note:
150 * VLAN is disabled by default. User has to call this API to enable VLAN before
151 * using it. And It will set a default VLAN(vid 1) including all ports and set
152 * all ports PVID to the default VLAN.
153 */
154
155 /* Function Name:
156 * rtk_vlan_reset
157 * Description:
158 * Reset VLAN
159 * Input:
160 * None.
161 * Output:
162 * pEnabled - State of 1p remarking at real keep packet
163 * Return:
164 * RT_ERR_OK - OK
165 * RT_ERR_FAILED - Failed
166 * RT_ERR_SMI - SMI access error
167 * RT_ERR_INPUT - Error Input
168 * Note:
169 *
170 */
> 171 rtk_api_ret_t rtk_vlan_reset(void) {return 0;}
172
173 //extern
> 174 rtk_api_ret_t rtk_vlan_init(void) {return 0;}
175
176 /* Function Name:
177 * rtk_vlan_set
178 * Description:
179 * Set a VLAN entry.
180 * Input:
181 * vid - VLAN ID to configure.
182 * pVlanCfg - VLAN Configuration
183 * Output:
184 * None
185 * Return:
186 * RT_ERR_OK - OK
187 * RT_ERR_FAILED - Failed
188 * RT_ERR_SMI - SMI access error
189 * RT_ERR_INPUT - Invalid input parameters.
190 * RT_ERR_L2_FID - Invalid FID.
191 * RT_ERR_VLAN_PORT_MBR_EXIST - Invalid member port mask.
192 * RT_ERR_VLAN_VID - Invalid VID parameter.
193 * Note:
194 *
195 */
196 //extern
> 197 rtk_api_ret_t rtk_vlan_set(rtk_vlan_t vid, rtk_vlan_cfg_t *pVlanCfg) {return 0;}
198
199 /* Function Name:
200 * rtk_vlan_portPvid_set
201 * Description:
202 * Set port to specified VLAN ID(PVID).
203 * Input:
204 * port - Port id.
205 * pvid - Specified VLAN ID.
206 * priority - 802.1p priority for the PVID.
207 * Output:
208 * None
209 * Return:
210 * RT_ERR_OK - OK
211 * RT_ERR_FAILED - Failed
212 * RT_ERR_SMI - SMI access error
213 * RT_ERR_PORT_ID - Invalid port number.
214 * RT_ERR_VLAN_PRIORITY - Invalid priority.
215 * RT_ERR_VLAN_ENTRY_NOT_FOUND - VLAN entry not found.
216 * RT_ERR_VLAN_VID - Invalid VID parameter.
217 * Note:
218 * The API is used for Port-based VLAN. The untagged frame received from the
219 * port will be classified to the specified VLAN and assigned to the specified priority.
220 */
221 //extern
> 222 rtk_api_ret_t rtk_vlan_portPvid_set(rtk_port_t port, rtk_vlan_t pvid, rtk_pri_t priority) {return 0;}
223
224 /* Function Name:
225 * rtk_port_macForceLinkExt_set
226 * Description:
227 * Set external interface force linking configuration.
228 * Input:
229 * port - external port ID
230 * mode - external interface mode
231 * pPortability - port ability configuration
232 * Output:
233 * None
234 * Return:
235 * RT_ERR_OK - OK
236 * RT_ERR_FAILED - Failed
237 * RT_ERR_SMI - SMI access error
238 * RT_ERR_INPUT - Invalid input parameters.
239 * Note:
240 * This API can set external interface force mode properties.
241 * The external interface can be set to:
242 * - MODE_EXT_DISABLE,
243 * - MODE_EXT_RGMII,
244 * - MODE_EXT_MII_MAC,
245 * - MODE_EXT_MII_PHY,
246 * - MODE_EXT_TMII_MAC,
247 * - MODE_EXT_TMII_PHY,
248 * - MODE_EXT_GMII,
249 * - MODE_EXT_RMII_MAC,
250 * - MODE_EXT_RMII_PHY,
251 * - MODE_EXT_SGMII,
252 * - MODE_EXT_HSGMII,
253 * - MODE_EXT_1000X_100FX,
254 * - MODE_EXT_1000X,
255 * - MODE_EXT_100FX,
256 */
257 //extern
> 258 rtk_api_ret_t rtk_port_macForceLinkExt_set(rtk_port_t port, rtk_mode_ext_t mode, rtk_port_mac_ability_t *pPortability) {return 0;};
259
260 /* Function Name:
261 * rtk_port_phyEnableAll_set
262 * Description:
263 * Set all PHY enable status.
264 * Input:
265 * enable - PHY Enable State.
266 * Output:
267 * None
268 * Return:
269 * RT_ERR_OK - OK
270 * RT_ERR_FAILED - Failed
271 * RT_ERR_SMI - SMI access error
272 * RT_ERR_ENABLE - Invalid enable input.
273 * Note:
274 * This API can set all PHY status.
275 * The configuration of all PHY is as following:
276 * - DISABLE
277 * - ENABLE
278 */
279 //extern
> 280 rtk_api_ret_t rtk_port_phyEnableAll_set(rtk_enable_t enable) {return 0;}
281
282 /* Function Name:
283 * rtk_port_rgmiiDelayExt_set
284 * Description:
285 * Set RGMII interface delay value for TX and RX.
286 * Input:
287 * txDelay - TX delay value, 1 for delay 2ns and 0 for no-delay
288 * rxDelay - RX delay value, 0~7 for delay setup.
289 * Output:
290 * None
291 * Return:
292 * RT_ERR_OK - OK
293 * RT_ERR_FAILED - Failed
294 * RT_ERR_SMI - SMI access error
295 * RT_ERR_INPUT - Invalid input parameters.
296 * Note:
297 * This API can set external interface 2 RGMII delay.
298 * In TX delay, there are 2 selection: no-delay and 2ns delay.
299 * In RX dekay, there are 8 steps for delay tunning. 0 for no-delay, and 7 for maximum delay.
300 */
301 //extern
> 302 rtk_api_ret_t rtk_port_rgmiiDelayExt_set(rtk_port_t port, rtk_data_t txDelay, rtk_data_t rxDelay) {return 0;}
303
304 /* Function Name:
305 * rtk_port_sgmiiNway_set
306 * Description:
307 * Configure SGMII/HSGMII port Nway state
308 * Input:
309 * port - Port ID
310 * state - Nway state
311 * Output:
312 * None.
313 * Return:
314 * RT_ERR_OK - OK
315 * RT_ERR_FAILED - Failed
316 * RT_ERR_SMI - SMI access error
317 * RT_ERR_PORT_ID - Invalid port ID.
318 * Note:
319 * The API configure SGMII/HSGMII port Nway state
320 */
321 //extern
> 322 rtk_api_ret_t rtk_port_sgmiiNway_set(rtk_port_t port, rtk_enable_t state) {return 0;}
323
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
[iwlwifi-chromeos:chromeos-kernelupstream-5.14-rc6__master 1219/1223] drivers/media/pci/intel/ipu6/../ipu-isys-tpg.c:143:27: error: passing argument 2 of '__ipu_isys_get_ffmt' from incompatible pointer type
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/chromeos.git chromeos-kernelupstream-5.14-rc6__master
head: 559fc6b20030249e9152cf36ab505d8d6a828ff2
commit: e56ec43c5d29d49e540a3883be0a5d2ffa441103 [1219/1223] FIXUP:media: v4l2-subdev: add subdev-wide state struct
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/chromeos.git/comm...
git remote add iwlwifi-chromeos https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/chromeos.git
git fetch --no-tags iwlwifi-chromeos chromeos-kernelupstream-5.14-rc6__master
git checkout e56ec43c5d29d49e540a3883be0a5d2ffa441103
# 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(a)intel.com>
All errors (new ones prefixed by >>):
drivers/media/pci/intel/ipu6/../ipu-isys-tpg.c: In function 'tpg_set_ffmt':
>> drivers/media/pci/intel/ipu6/../ipu-isys-tpg.c:143:27: error: passing argument 2 of '__ipu_isys_get_ffmt' from incompatible pointer type [-Werror=incompatible-pointer-types]
143 | *__ipu_isys_get_ffmt(sd, cfg, fmt->pad, fmt->which) = fmt->format;
| ^~~
| |
| struct v4l2_subdev_pad_config *
In file included from drivers/media/pci/intel/ipu6/../ipu-isys-csi2.h:11,
from drivers/media/pci/intel/ipu6/../ipu-isys.h:17,
from drivers/media/pci/intel/ipu6/../ipu-isys-tpg.c:13:
drivers/media/pci/intel/ipu6/../ipu-isys-subdev.h:92:28: note: expected 'struct v4l2_subdev_state *' but argument is of type 'struct v4l2_subdev_pad_config *'
92 | struct v4l2_mbus_framefmt *__ipu_isys_get_ffmt(struct v4l2_subdev *sd,
| ^~~~~~~~~~~~~~~~~~~
drivers/media/pci/intel/ipu6/../ipu-isys-tpg.c: In function 'ipu_isys_tpg_set_ffmt':
>> drivers/media/pci/intel/ipu6/../ipu-isys-tpg.c:157:40: error: passing argument 2 of '__ipu_isys_subdev_set_ffmt' from incompatible pointer type [-Werror=incompatible-pointer-types]
157 | rval = __ipu_isys_subdev_set_ffmt(sd, cfg, fmt);
| ^~~
| |
| struct v4l2_subdev_pad_config *
In file included from drivers/media/pci/intel/ipu6/../ipu-isys-csi2.h:11,
from drivers/media/pci/intel/ipu6/../ipu-isys.h:17,
from drivers/media/pci/intel/ipu6/../ipu-isys-tpg.c:13:
drivers/media/pci/intel/ipu6/../ipu-isys-subdev.h:114:37: note: expected 'struct v4l2_subdev_state *' but argument is of type 'struct v4l2_subdev_pad_config *'
114 | struct v4l2_subdev_state *state,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
drivers/media/pci/intel/ipu6/../ipu-isys-tpg.c: At top level:
drivers/media/pci/intel/ipu6/../ipu-isys-tpg.c:189:13: error: initialization of 'int (*)(struct v4l2_subdev *, struct v4l2_subdev_state *, struct v4l2_subdev_format *)' from incompatible pointer type 'int (*)(struct v4l2_subdev *, struct v4l2_subdev_pad_config *, struct v4l2_subdev_format *)' [-Werror=incompatible-pointer-types]
189 | .set_fmt = ipu_isys_tpg_set_ffmt,
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/pci/intel/ipu6/../ipu-isys-tpg.c:189:13: note: (near initialization for 'tpg_sd_pad_ops.set_fmt')
drivers/media/pci/intel/ipu6/../ipu-isys-tpg.c: In function 'ipu_isys_tpg_init':
drivers/media/pci/intel/ipu6/../ipu-isys-tpg.c:268:20: error: assignment to 'void (*)(struct v4l2_subdev *, struct v4l2_subdev_state *, struct v4l2_subdev_format *)' from incompatible pointer type 'void (*)(struct v4l2_subdev *, struct v4l2_subdev_pad_config *, struct v4l2_subdev_format *)' [-Werror=incompatible-pointer-types]
268 | tpg->asd.set_ffmt = tpg_set_ffmt;
| ^
cc1: some warnings being treated as errors
vim +/__ipu_isys_get_ffmt +143 drivers/media/pci/intel/ipu6/../ipu-isys-tpg.c
03193a44d18182 Tianshu Qiu 2021-07-16 137
03193a44d18182 Tianshu Qiu 2021-07-16 138 static void tpg_set_ffmt(struct v4l2_subdev *sd,
03193a44d18182 Tianshu Qiu 2021-07-16 139 struct v4l2_subdev_pad_config *cfg,
03193a44d18182 Tianshu Qiu 2021-07-16 140 struct v4l2_subdev_format *fmt)
03193a44d18182 Tianshu Qiu 2021-07-16 141 {
03193a44d18182 Tianshu Qiu 2021-07-16 142 fmt->format.field = V4L2_FIELD_NONE;
03193a44d18182 Tianshu Qiu 2021-07-16 @143 *__ipu_isys_get_ffmt(sd, cfg, fmt->pad, fmt->which) = fmt->format;
03193a44d18182 Tianshu Qiu 2021-07-16 144 }
03193a44d18182 Tianshu Qiu 2021-07-16 145
03193a44d18182 Tianshu Qiu 2021-07-16 146 static int ipu_isys_tpg_set_ffmt(struct v4l2_subdev *sd,
03193a44d18182 Tianshu Qiu 2021-07-16 147 struct v4l2_subdev_pad_config *cfg,
03193a44d18182 Tianshu Qiu 2021-07-16 148 struct v4l2_subdev_format *fmt)
03193a44d18182 Tianshu Qiu 2021-07-16 149 {
03193a44d18182 Tianshu Qiu 2021-07-16 150 struct ipu_isys_tpg *tpg = to_ipu_isys_tpg(sd);
03193a44d18182 Tianshu Qiu 2021-07-16 151 __u32 code = tpg->asd.ffmt[TPG_PAD_SOURCE].code;
03193a44d18182 Tianshu Qiu 2021-07-16 152 unsigned int bpp = ipu_isys_mbus_code_to_bpp(code);
03193a44d18182 Tianshu Qiu 2021-07-16 153 s64 tpg_rate = ipu_isys_tpg_rate(tpg, bpp);
03193a44d18182 Tianshu Qiu 2021-07-16 154 int rval;
03193a44d18182 Tianshu Qiu 2021-07-16 155
03193a44d18182 Tianshu Qiu 2021-07-16 156 mutex_lock(&tpg->asd.mutex);
03193a44d18182 Tianshu Qiu 2021-07-16 @157 rval = __ipu_isys_subdev_set_ffmt(sd, cfg, fmt);
03193a44d18182 Tianshu Qiu 2021-07-16 158 mutex_unlock(&tpg->asd.mutex);
03193a44d18182 Tianshu Qiu 2021-07-16 159
03193a44d18182 Tianshu Qiu 2021-07-16 160 if (rval || fmt->which != V4L2_SUBDEV_FORMAT_ACTIVE)
03193a44d18182 Tianshu Qiu 2021-07-16 161 return rval;
03193a44d18182 Tianshu Qiu 2021-07-16 162
03193a44d18182 Tianshu Qiu 2021-07-16 163 v4l2_ctrl_s_ctrl_int64(tpg->pixel_rate, tpg_rate);
03193a44d18182 Tianshu Qiu 2021-07-16 164
03193a44d18182 Tianshu Qiu 2021-07-16 165 return 0;
03193a44d18182 Tianshu Qiu 2021-07-16 166 }
03193a44d18182 Tianshu Qiu 2021-07-16 167
:::::: The code at line 143 was first introduced by commit
:::::: 03193a44d181823be57cf5e6f70a668691c10173 CHROMIUM: media: intel-ipu6: copy IPU6 driver from v5.4 branch
:::::: TO: Tianshu Qiu <tian.shu.qiu(a)intel.com>
:::::: CC: Google Cont Rebase <goog-rebase-dev(a)semihalf.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
[zen:5.15/zen-sauce 5/28] fs/ntfs3/fslog.c:2247:1: warning: the frame size of 1068 bytes is larger than 1024 bytes
by kernel test robot
tree: https://github.com/zen-kernel/zen-kernel 5.15/zen-sauce
head: 81ba2917231b206b7b6b9b160e456c5452c4f62e
commit: b67c5033547771052515687e96adf98858ea0de6 [5/28] ZEN: Unrestrict CONFIG_OPTIMIZE_FOR_PERFORMANCE_O3
config: h8300-randconfig-r025-20211114 (attached as .config)
compiler: h8300-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/zen-kernel/zen-kernel/commit/b67c5033547771052515687e9...
git remote add zen https://github.com/zen-kernel/zen-kernel
git fetch --no-tags zen 5.15/zen-sauce
git checkout b67c5033547771052515687e96adf98858ea0de6
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=h8300
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 >>):
fs/ntfs3/fslog.c: In function 'last_log_lsn':
>> fs/ntfs3/fslog.c:2247:1: warning: the frame size of 1068 bytes is larger than 1024 bytes [-Wframe-larger-than=]
2247 | }
| ^
--
crypto/nhpoly1305.c: In function 'crypto_nhpoly1305_update':
>> crypto/nhpoly1305.c:195:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]
195 | }
| ^
vim +2247 fs/ntfs3/fslog.c
b46acd6a6a627d Konstantin Komarov 2021-08-13 1595
b46acd6a6a627d Konstantin Komarov 2021-08-13 1596 /*
b46acd6a6a627d Konstantin Komarov 2021-08-13 1597 * last_log_lsn
b46acd6a6a627d Konstantin Komarov 2021-08-13 1598 *
e8b8e97f91b80f Kari Argillander 2021-08-03 1599 * Walks through the log pages for a file, searching for the
e8b8e97f91b80f Kari Argillander 2021-08-03 1600 * last log page written to the file.
b46acd6a6a627d Konstantin Komarov 2021-08-13 1601 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 1602 static int last_log_lsn(struct ntfs_log *log)
b46acd6a6a627d Konstantin Komarov 2021-08-13 1603 {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1604 int err;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1605 bool usa_error = false;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1606 bool replace_page = false;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1607 bool reuse_page = log->l_flags & NTFSLOG_REUSE_TAIL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1608 bool wrapped_file, wrapped;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1609
b46acd6a6a627d Konstantin Komarov 2021-08-13 1610 u32 page_cnt = 1, page_pos = 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1611 u32 page_off = 0, page_off1 = 0, saved_off = 0;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1612 u32 final_off, second_off, final_off_prev = 0, second_off_prev = 0;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1613 u32 first_file_off = 0, second_file_off = 0;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1614 u32 part_io_count = 0;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1615 u32 tails = 0;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1616 u32 this_off, curpage_off, nextpage_off, remain_pages;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1617
b46acd6a6a627d Konstantin Komarov 2021-08-13 1618 u64 expected_seq, seq_base = 0, lsn_base = 0;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1619 u64 best_lsn, best_lsn1, best_lsn2;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1620 u64 lsn_cur, lsn1, lsn2;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1621 u64 last_ok_lsn = reuse_page ? log->last_lsn : 0;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1622
b46acd6a6a627d Konstantin Komarov 2021-08-13 1623 u16 cur_pos, best_page_pos;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1624
b46acd6a6a627d Konstantin Komarov 2021-08-13 1625 struct RECORD_PAGE_HDR *page = NULL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1626 struct RECORD_PAGE_HDR *tst_page = NULL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1627 struct RECORD_PAGE_HDR *first_tail = NULL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1628 struct RECORD_PAGE_HDR *second_tail = NULL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1629 struct RECORD_PAGE_HDR *tail_page = NULL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1630 struct RECORD_PAGE_HDR *second_tail_prev = NULL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1631 struct RECORD_PAGE_HDR *first_tail_prev = NULL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1632 struct RECORD_PAGE_HDR *page_bufs = NULL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1633 struct RECORD_PAGE_HDR *best_page;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1634
b46acd6a6a627d Konstantin Komarov 2021-08-13 1635 if (log->major_ver >= 2) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1636 final_off = 0x02 * log->page_size;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1637 second_off = 0x12 * log->page_size;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1638
b46acd6a6a627d Konstantin Komarov 2021-08-13 1639 // 0x10 == 0x12 - 0x2
195c52bdd5d5ec Kari Argillander 2021-08-24 1640 page_bufs = kmalloc(log->page_size * 0x10, GFP_NOFS);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1641 if (!page_bufs)
b46acd6a6a627d Konstantin Komarov 2021-08-13 1642 return -ENOMEM;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1643 } else {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1644 second_off = log->first_page - log->page_size;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1645 final_off = second_off - log->page_size;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1646 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1647
b46acd6a6a627d Konstantin Komarov 2021-08-13 1648 next_tail:
e8b8e97f91b80f Kari Argillander 2021-08-03 1649 /* Read second tail page (at pos 3/0x12000). */
b46acd6a6a627d Konstantin Komarov 2021-08-13 1650 if (read_log_page(log, second_off, &second_tail, &usa_error) ||
b46acd6a6a627d Konstantin Komarov 2021-08-13 1651 usa_error || second_tail->rhdr.sign != NTFS_RCRD_SIGNATURE) {
195c52bdd5d5ec Kari Argillander 2021-08-24 1652 kfree(second_tail);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1653 second_tail = NULL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1654 second_file_off = 0;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1655 lsn2 = 0;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1656 } else {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1657 second_file_off = hdr_file_off(log, second_tail);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1658 lsn2 = le64_to_cpu(second_tail->record_hdr.last_end_lsn);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1659 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1660
e8b8e97f91b80f Kari Argillander 2021-08-03 1661 /* Read first tail page (at pos 2/0x2000). */
b46acd6a6a627d Konstantin Komarov 2021-08-13 1662 if (read_log_page(log, final_off, &first_tail, &usa_error) ||
b46acd6a6a627d Konstantin Komarov 2021-08-13 1663 usa_error || first_tail->rhdr.sign != NTFS_RCRD_SIGNATURE) {
195c52bdd5d5ec Kari Argillander 2021-08-24 1664 kfree(first_tail);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1665 first_tail = NULL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1666 first_file_off = 0;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1667 lsn1 = 0;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1668 } else {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1669 first_file_off = hdr_file_off(log, first_tail);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1670 lsn1 = le64_to_cpu(first_tail->record_hdr.last_end_lsn);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1671 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1672
b46acd6a6a627d Konstantin Komarov 2021-08-13 1673 if (log->major_ver < 2) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1674 int best_page;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1675
b46acd6a6a627d Konstantin Komarov 2021-08-13 1676 first_tail_prev = first_tail;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1677 final_off_prev = first_file_off;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1678 second_tail_prev = second_tail;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1679 second_off_prev = second_file_off;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1680 tails = 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1681
b46acd6a6a627d Konstantin Komarov 2021-08-13 1682 if (!first_tail && !second_tail)
b46acd6a6a627d Konstantin Komarov 2021-08-13 1683 goto tail_read;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1684
b46acd6a6a627d Konstantin Komarov 2021-08-13 1685 if (first_tail && second_tail)
b46acd6a6a627d Konstantin Komarov 2021-08-13 1686 best_page = lsn1 < lsn2 ? 1 : 0;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1687 else if (first_tail)
b46acd6a6a627d Konstantin Komarov 2021-08-13 1688 best_page = 0;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1689 else
b46acd6a6a627d Konstantin Komarov 2021-08-13 1690 best_page = 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1691
b46acd6a6a627d Konstantin Komarov 2021-08-13 1692 page_off = best_page ? second_file_off : first_file_off;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1693 seq_base = (best_page ? lsn2 : lsn1) >> log->file_data_bits;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1694 goto tail_read;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1695 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1696
b46acd6a6a627d Konstantin Komarov 2021-08-13 1697 best_lsn1 = first_tail ? base_lsn(log, first_tail, first_file_off) : 0;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1698 best_lsn2 =
b46acd6a6a627d Konstantin Komarov 2021-08-13 1699 second_tail ? base_lsn(log, second_tail, second_file_off) : 0;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1700
b46acd6a6a627d Konstantin Komarov 2021-08-13 1701 if (first_tail && second_tail) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1702 if (best_lsn1 > best_lsn2) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1703 best_lsn = best_lsn1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1704 best_page = first_tail;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1705 this_off = first_file_off;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1706 } else {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1707 best_lsn = best_lsn2;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1708 best_page = second_tail;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1709 this_off = second_file_off;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1710 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1711 } else if (first_tail) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1712 best_lsn = best_lsn1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1713 best_page = first_tail;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1714 this_off = first_file_off;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1715 } else if (second_tail) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1716 best_lsn = best_lsn2;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1717 best_page = second_tail;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1718 this_off = second_file_off;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1719 } else {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1720 goto tail_read;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1721 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1722
b46acd6a6a627d Konstantin Komarov 2021-08-13 1723 best_page_pos = le16_to_cpu(best_page->page_pos);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1724
b46acd6a6a627d Konstantin Komarov 2021-08-13 1725 if (!tails) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1726 if (best_page_pos == page_pos) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1727 seq_base = best_lsn >> log->file_data_bits;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1728 saved_off = page_off = le32_to_cpu(best_page->file_off);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1729 lsn_base = best_lsn;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1730
b46acd6a6a627d Konstantin Komarov 2021-08-13 1731 memmove(page_bufs, best_page, log->page_size);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1732
b46acd6a6a627d Konstantin Komarov 2021-08-13 1733 page_cnt = le16_to_cpu(best_page->page_count);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1734 if (page_cnt > 1)
b46acd6a6a627d Konstantin Komarov 2021-08-13 1735 page_pos += 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1736
b46acd6a6a627d Konstantin Komarov 2021-08-13 1737 tails = 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1738 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1739 } else if (seq_base == (best_lsn >> log->file_data_bits) &&
b46acd6a6a627d Konstantin Komarov 2021-08-13 1740 saved_off + log->page_size == this_off &&
b46acd6a6a627d Konstantin Komarov 2021-08-13 1741 lsn_base < best_lsn &&
b46acd6a6a627d Konstantin Komarov 2021-08-13 1742 (page_pos != page_cnt || best_page_pos == page_pos ||
b46acd6a6a627d Konstantin Komarov 2021-08-13 1743 best_page_pos == 1) &&
b46acd6a6a627d Konstantin Komarov 2021-08-13 1744 (page_pos >= page_cnt || best_page_pos == page_pos)) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1745 u16 bppc = le16_to_cpu(best_page->page_count);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1746
b46acd6a6a627d Konstantin Komarov 2021-08-13 1747 saved_off += log->page_size;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1748 lsn_base = best_lsn;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1749
b46acd6a6a627d Konstantin Komarov 2021-08-13 1750 memmove(Add2Ptr(page_bufs, tails * log->page_size), best_page,
b46acd6a6a627d Konstantin Komarov 2021-08-13 1751 log->page_size);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1752
b46acd6a6a627d Konstantin Komarov 2021-08-13 1753 tails += 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1754
b46acd6a6a627d Konstantin Komarov 2021-08-13 1755 if (best_page_pos != bppc) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1756 page_cnt = bppc;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1757 page_pos = best_page_pos;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1758
b46acd6a6a627d Konstantin Komarov 2021-08-13 1759 if (page_cnt > 1)
b46acd6a6a627d Konstantin Komarov 2021-08-13 1760 page_pos += 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1761 } else {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1762 page_pos = page_cnt = 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1763 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1764 } else {
195c52bdd5d5ec Kari Argillander 2021-08-24 1765 kfree(first_tail);
195c52bdd5d5ec Kari Argillander 2021-08-24 1766 kfree(second_tail);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1767 goto tail_read;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1768 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1769
195c52bdd5d5ec Kari Argillander 2021-08-24 1770 kfree(first_tail_prev);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1771 first_tail_prev = first_tail;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1772 final_off_prev = first_file_off;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1773 first_tail = NULL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1774
195c52bdd5d5ec Kari Argillander 2021-08-24 1775 kfree(second_tail_prev);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1776 second_tail_prev = second_tail;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1777 second_off_prev = second_file_off;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1778 second_tail = NULL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1779
b46acd6a6a627d Konstantin Komarov 2021-08-13 1780 final_off += log->page_size;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1781 second_off += log->page_size;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1782
b46acd6a6a627d Konstantin Komarov 2021-08-13 1783 if (tails < 0x10)
b46acd6a6a627d Konstantin Komarov 2021-08-13 1784 goto next_tail;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1785 tail_read:
b46acd6a6a627d Konstantin Komarov 2021-08-13 1786 first_tail = first_tail_prev;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1787 final_off = final_off_prev;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1788
b46acd6a6a627d Konstantin Komarov 2021-08-13 1789 second_tail = second_tail_prev;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1790 second_off = second_off_prev;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1791
b46acd6a6a627d Konstantin Komarov 2021-08-13 1792 page_cnt = page_pos = 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1793
b46acd6a6a627d Konstantin Komarov 2021-08-13 1794 curpage_off = seq_base == log->seq_num ? min(log->next_page, page_off)
b46acd6a6a627d Konstantin Komarov 2021-08-13 1795 : log->next_page;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1796
b46acd6a6a627d Konstantin Komarov 2021-08-13 1797 wrapped_file =
b46acd6a6a627d Konstantin Komarov 2021-08-13 1798 curpage_off == log->first_page &&
b46acd6a6a627d Konstantin Komarov 2021-08-13 1799 !(log->l_flags & (NTFSLOG_NO_LAST_LSN | NTFSLOG_REUSE_TAIL));
b46acd6a6a627d Konstantin Komarov 2021-08-13 1800
b46acd6a6a627d Konstantin Komarov 2021-08-13 1801 expected_seq = wrapped_file ? (log->seq_num + 1) : log->seq_num;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1802
b46acd6a6a627d Konstantin Komarov 2021-08-13 1803 nextpage_off = curpage_off;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1804
b46acd6a6a627d Konstantin Komarov 2021-08-13 1805 next_page:
b46acd6a6a627d Konstantin Komarov 2021-08-13 1806 tail_page = NULL;
e8b8e97f91b80f Kari Argillander 2021-08-03 1807 /* Read the next log page. */
b46acd6a6a627d Konstantin Komarov 2021-08-13 1808 err = read_log_page(log, curpage_off, &page, &usa_error);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1809
e8b8e97f91b80f Kari Argillander 2021-08-03 1810 /* Compute the next log page offset the file. */
b46acd6a6a627d Konstantin Komarov 2021-08-13 1811 nextpage_off = next_page_off(log, curpage_off);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1812 wrapped = nextpage_off == log->first_page;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1813
b46acd6a6a627d Konstantin Komarov 2021-08-13 1814 if (tails > 1) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1815 struct RECORD_PAGE_HDR *cur_page =
b46acd6a6a627d Konstantin Komarov 2021-08-13 1816 Add2Ptr(page_bufs, curpage_off - page_off);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1817
b46acd6a6a627d Konstantin Komarov 2021-08-13 1818 if (curpage_off == saved_off) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1819 tail_page = cur_page;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1820 goto use_tail_page;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1821 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1822
b46acd6a6a627d Konstantin Komarov 2021-08-13 1823 if (page_off > curpage_off || curpage_off >= saved_off)
b46acd6a6a627d Konstantin Komarov 2021-08-13 1824 goto use_tail_page;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1825
b46acd6a6a627d Konstantin Komarov 2021-08-13 1826 if (page_off1)
b46acd6a6a627d Konstantin Komarov 2021-08-13 1827 goto use_cur_page;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1828
b46acd6a6a627d Konstantin Komarov 2021-08-13 1829 if (!err && !usa_error &&
b46acd6a6a627d Konstantin Komarov 2021-08-13 1830 page->rhdr.sign == NTFS_RCRD_SIGNATURE &&
b46acd6a6a627d Konstantin Komarov 2021-08-13 1831 cur_page->rhdr.lsn == page->rhdr.lsn &&
b46acd6a6a627d Konstantin Komarov 2021-08-13 1832 cur_page->record_hdr.next_record_off ==
b46acd6a6a627d Konstantin Komarov 2021-08-13 1833 page->record_hdr.next_record_off &&
b46acd6a6a627d Konstantin Komarov 2021-08-13 1834 ((page_pos == page_cnt &&
b46acd6a6a627d Konstantin Komarov 2021-08-13 1835 le16_to_cpu(page->page_pos) == 1) ||
b46acd6a6a627d Konstantin Komarov 2021-08-13 1836 (page_pos != page_cnt &&
b46acd6a6a627d Konstantin Komarov 2021-08-13 1837 le16_to_cpu(page->page_pos) == page_pos + 1 &&
b46acd6a6a627d Konstantin Komarov 2021-08-13 1838 le16_to_cpu(page->page_count) == page_cnt))) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1839 cur_page = NULL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1840 goto use_tail_page;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1841 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1842
b46acd6a6a627d Konstantin Komarov 2021-08-13 1843 page_off1 = page_off;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1844
b46acd6a6a627d Konstantin Komarov 2021-08-13 1845 use_cur_page:
b46acd6a6a627d Konstantin Komarov 2021-08-13 1846
b46acd6a6a627d Konstantin Komarov 2021-08-13 1847 lsn_cur = le64_to_cpu(cur_page->rhdr.lsn);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1848
b46acd6a6a627d Konstantin Komarov 2021-08-13 1849 if (last_ok_lsn !=
b46acd6a6a627d Konstantin Komarov 2021-08-13 1850 le64_to_cpu(cur_page->record_hdr.last_end_lsn) &&
b46acd6a6a627d Konstantin Komarov 2021-08-13 1851 ((lsn_cur >> log->file_data_bits) +
b46acd6a6a627d Konstantin Komarov 2021-08-13 1852 ((curpage_off <
b46acd6a6a627d Konstantin Komarov 2021-08-13 1853 (lsn_to_vbo(log, lsn_cur) & ~log->page_mask))
b46acd6a6a627d Konstantin Komarov 2021-08-13 1854 ? 1
b46acd6a6a627d Konstantin Komarov 2021-08-13 1855 : 0)) != expected_seq) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1856 goto check_tail;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1857 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1858
b46acd6a6a627d Konstantin Komarov 2021-08-13 1859 if (!is_log_record_end(cur_page)) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1860 tail_page = NULL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1861 last_ok_lsn = lsn_cur;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1862 goto next_page_1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1863 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1864
b46acd6a6a627d Konstantin Komarov 2021-08-13 1865 log->seq_num = expected_seq;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1866 log->l_flags &= ~NTFSLOG_NO_LAST_LSN;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1867 log->last_lsn = le64_to_cpu(cur_page->record_hdr.last_end_lsn);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1868 log->ra->current_lsn = cur_page->record_hdr.last_end_lsn;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1869
b46acd6a6a627d Konstantin Komarov 2021-08-13 1870 if (log->record_header_len <=
b46acd6a6a627d Konstantin Komarov 2021-08-13 1871 log->page_size -
b46acd6a6a627d Konstantin Komarov 2021-08-13 1872 le16_to_cpu(cur_page->record_hdr.next_record_off)) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1873 log->l_flags |= NTFSLOG_REUSE_TAIL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1874 log->next_page = curpage_off;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1875 } else {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1876 log->l_flags &= ~NTFSLOG_REUSE_TAIL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1877 log->next_page = nextpage_off;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1878 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1879
b46acd6a6a627d Konstantin Komarov 2021-08-13 1880 if (wrapped_file)
b46acd6a6a627d Konstantin Komarov 2021-08-13 1881 log->l_flags |= NTFSLOG_WRAPPED;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1882
b46acd6a6a627d Konstantin Komarov 2021-08-13 1883 last_ok_lsn = le64_to_cpu(cur_page->record_hdr.last_end_lsn);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1884 goto next_page_1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1885 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1886
b46acd6a6a627d Konstantin Komarov 2021-08-13 1887 /*
b46acd6a6a627d Konstantin Komarov 2021-08-13 1888 * If we are at the expected first page of a transfer check to see
e8b8e97f91b80f Kari Argillander 2021-08-03 1889 * if either tail copy is at this offset.
b46acd6a6a627d Konstantin Komarov 2021-08-13 1890 * If this page is the last page of a transfer, check if we wrote
e8b8e97f91b80f Kari Argillander 2021-08-03 1891 * a subsequent tail copy.
b46acd6a6a627d Konstantin Komarov 2021-08-13 1892 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 1893 if (page_cnt == page_pos || page_cnt == page_pos + 1) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1894 /*
b46acd6a6a627d Konstantin Komarov 2021-08-13 1895 * Check if the offset matches either the first or second
e8b8e97f91b80f Kari Argillander 2021-08-03 1896 * tail copy. It is possible it will match both.
b46acd6a6a627d Konstantin Komarov 2021-08-13 1897 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 1898 if (curpage_off == final_off)
b46acd6a6a627d Konstantin Komarov 2021-08-13 1899 tail_page = first_tail;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1900
b46acd6a6a627d Konstantin Komarov 2021-08-13 1901 /*
b46acd6a6a627d Konstantin Komarov 2021-08-13 1902 * If we already matched on the first page then
b46acd6a6a627d Konstantin Komarov 2021-08-13 1903 * check the ending lsn's.
b46acd6a6a627d Konstantin Komarov 2021-08-13 1904 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 1905 if (curpage_off == second_off) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1906 if (!tail_page ||
b46acd6a6a627d Konstantin Komarov 2021-08-13 1907 (second_tail &&
b46acd6a6a627d Konstantin Komarov 2021-08-13 1908 le64_to_cpu(second_tail->record_hdr.last_end_lsn) >
b46acd6a6a627d Konstantin Komarov 2021-08-13 1909 le64_to_cpu(first_tail->record_hdr
b46acd6a6a627d Konstantin Komarov 2021-08-13 1910 .last_end_lsn))) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1911 tail_page = second_tail;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1912 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1913 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1914 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1915
b46acd6a6a627d Konstantin Komarov 2021-08-13 1916 use_tail_page:
b46acd6a6a627d Konstantin Komarov 2021-08-13 1917 if (tail_page) {
e8b8e97f91b80f Kari Argillander 2021-08-03 1918 /* We have a candidate for a tail copy. */
b46acd6a6a627d Konstantin Komarov 2021-08-13 1919 lsn_cur = le64_to_cpu(tail_page->record_hdr.last_end_lsn);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1920
b46acd6a6a627d Konstantin Komarov 2021-08-13 1921 if (last_ok_lsn < lsn_cur) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1922 /*
b46acd6a6a627d Konstantin Komarov 2021-08-13 1923 * If the sequence number is not expected,
e8b8e97f91b80f Kari Argillander 2021-08-03 1924 * then don't use the tail copy.
b46acd6a6a627d Konstantin Komarov 2021-08-13 1925 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 1926 if (expected_seq != (lsn_cur >> log->file_data_bits))
b46acd6a6a627d Konstantin Komarov 2021-08-13 1927 tail_page = NULL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1928 } else if (last_ok_lsn > lsn_cur) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1929 /*
b46acd6a6a627d Konstantin Komarov 2021-08-13 1930 * If the last lsn is greater than the one on
e8b8e97f91b80f Kari Argillander 2021-08-03 1931 * this page then forget this tail.
b46acd6a6a627d Konstantin Komarov 2021-08-13 1932 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 1933 tail_page = NULL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1934 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1935 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1936
e8b8e97f91b80f Kari Argillander 2021-08-03 1937 /*
e8b8e97f91b80f Kari Argillander 2021-08-03 1938 *If we have an error on the current page,
e8b8e97f91b80f Kari Argillander 2021-08-03 1939 * we will break of this loop.
e8b8e97f91b80f Kari Argillander 2021-08-03 1940 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 1941 if (err || usa_error)
b46acd6a6a627d Konstantin Komarov 2021-08-13 1942 goto check_tail;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1943
b46acd6a6a627d Konstantin Komarov 2021-08-13 1944 /*
b46acd6a6a627d Konstantin Komarov 2021-08-13 1945 * Done if the last lsn on this page doesn't match the previous known
e8b8e97f91b80f Kari Argillander 2021-08-03 1946 * last lsn or the sequence number is not expected.
b46acd6a6a627d Konstantin Komarov 2021-08-13 1947 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 1948 lsn_cur = le64_to_cpu(page->rhdr.lsn);
b46acd6a6a627d Konstantin Komarov 2021-08-13 1949 if (last_ok_lsn != lsn_cur &&
b46acd6a6a627d Konstantin Komarov 2021-08-13 1950 expected_seq != (lsn_cur >> log->file_data_bits)) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1951 goto check_tail;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1952 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1953
b46acd6a6a627d Konstantin Komarov 2021-08-13 1954 /*
e8b8e97f91b80f Kari Argillander 2021-08-03 1955 * Check that the page position and page count values are correct.
b46acd6a6a627d Konstantin Komarov 2021-08-13 1956 * If this is the first page of a transfer the position must be 1
e8b8e97f91b80f Kari Argillander 2021-08-03 1957 * and the count will be unknown.
b46acd6a6a627d Konstantin Komarov 2021-08-13 1958 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 1959 if (page_cnt == page_pos) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1960 if (page->page_pos != cpu_to_le16(1) &&
b46acd6a6a627d Konstantin Komarov 2021-08-13 1961 (!reuse_page || page->page_pos != page->page_count)) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1962 /*
b46acd6a6a627d Konstantin Komarov 2021-08-13 1963 * If the current page is the first page we are
b46acd6a6a627d Konstantin Komarov 2021-08-13 1964 * looking at and we are reusing this page then
b46acd6a6a627d Konstantin Komarov 2021-08-13 1965 * it can be either the first or last page of a
b46acd6a6a627d Konstantin Komarov 2021-08-13 1966 * transfer. Otherwise it can only be the first.
b46acd6a6a627d Konstantin Komarov 2021-08-13 1967 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 1968 goto check_tail;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1969 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1970 } else if (le16_to_cpu(page->page_count) != page_cnt ||
b46acd6a6a627d Konstantin Komarov 2021-08-13 1971 le16_to_cpu(page->page_pos) != page_pos + 1) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1972 /*
b46acd6a6a627d Konstantin Komarov 2021-08-13 1973 * The page position better be 1 more than the last page
e8b8e97f91b80f Kari Argillander 2021-08-03 1974 * position and the page count better match.
b46acd6a6a627d Konstantin Komarov 2021-08-13 1975 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 1976 goto check_tail;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1977 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1978
b46acd6a6a627d Konstantin Komarov 2021-08-13 1979 /*
b46acd6a6a627d Konstantin Komarov 2021-08-13 1980 * We have a valid page the file and may have a valid page
e8b8e97f91b80f Kari Argillander 2021-08-03 1981 * the tail copy area.
b46acd6a6a627d Konstantin Komarov 2021-08-13 1982 * If the tail page was written after the page the file then
e8b8e97f91b80f Kari Argillander 2021-08-03 1983 * break of the loop.
b46acd6a6a627d Konstantin Komarov 2021-08-13 1984 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 1985 if (tail_page &&
b46acd6a6a627d Konstantin Komarov 2021-08-13 1986 le64_to_cpu(tail_page->record_hdr.last_end_lsn) > lsn_cur) {
e8b8e97f91b80f Kari Argillander 2021-08-03 1987 /* Remember if we will replace the page. */
b46acd6a6a627d Konstantin Komarov 2021-08-13 1988 replace_page = true;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1989 goto check_tail;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1990 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 1991
b46acd6a6a627d Konstantin Komarov 2021-08-13 1992 tail_page = NULL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 1993
b46acd6a6a627d Konstantin Komarov 2021-08-13 1994 if (is_log_record_end(page)) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 1995 /*
b46acd6a6a627d Konstantin Komarov 2021-08-13 1996 * Since we have read this page we know the sequence number
e8b8e97f91b80f Kari Argillander 2021-08-03 1997 * is the same as our expected value.
b46acd6a6a627d Konstantin Komarov 2021-08-13 1998 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 1999 log->seq_num = expected_seq;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2000 log->last_lsn = le64_to_cpu(page->record_hdr.last_end_lsn);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2001 log->ra->current_lsn = page->record_hdr.last_end_lsn;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2002 log->l_flags &= ~NTFSLOG_NO_LAST_LSN;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2003
b46acd6a6a627d Konstantin Komarov 2021-08-13 2004 /*
b46acd6a6a627d Konstantin Komarov 2021-08-13 2005 * If there is room on this page for another header then
e8b8e97f91b80f Kari Argillander 2021-08-03 2006 * remember we want to reuse the page.
b46acd6a6a627d Konstantin Komarov 2021-08-13 2007 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 2008 if (log->record_header_len <=
b46acd6a6a627d Konstantin Komarov 2021-08-13 2009 log->page_size -
b46acd6a6a627d Konstantin Komarov 2021-08-13 2010 le16_to_cpu(page->record_hdr.next_record_off)) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2011 log->l_flags |= NTFSLOG_REUSE_TAIL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2012 log->next_page = curpage_off;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2013 } else {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2014 log->l_flags &= ~NTFSLOG_REUSE_TAIL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2015 log->next_page = nextpage_off;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2016 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 2017
e8b8e97f91b80f Kari Argillander 2021-08-03 2018 /* Remember if we wrapped the log file. */
b46acd6a6a627d Konstantin Komarov 2021-08-13 2019 if (wrapped_file)
b46acd6a6a627d Konstantin Komarov 2021-08-13 2020 log->l_flags |= NTFSLOG_WRAPPED;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2021 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 2022
b46acd6a6a627d Konstantin Komarov 2021-08-13 2023 /*
b46acd6a6a627d Konstantin Komarov 2021-08-13 2024 * Remember the last page count and position.
e8b8e97f91b80f Kari Argillander 2021-08-03 2025 * Also remember the last known lsn.
b46acd6a6a627d Konstantin Komarov 2021-08-13 2026 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 2027 page_cnt = le16_to_cpu(page->page_count);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2028 page_pos = le16_to_cpu(page->page_pos);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2029 last_ok_lsn = le64_to_cpu(page->rhdr.lsn);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2030
b46acd6a6a627d Konstantin Komarov 2021-08-13 2031 next_page_1:
b46acd6a6a627d Konstantin Komarov 2021-08-13 2032
b46acd6a6a627d Konstantin Komarov 2021-08-13 2033 if (wrapped) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2034 expected_seq += 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2035 wrapped_file = 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2036 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 2037
b46acd6a6a627d Konstantin Komarov 2021-08-13 2038 curpage_off = nextpage_off;
195c52bdd5d5ec Kari Argillander 2021-08-24 2039 kfree(page);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2040 page = NULL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2041 reuse_page = 0;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2042 goto next_page;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2043
b46acd6a6a627d Konstantin Komarov 2021-08-13 2044 check_tail:
b46acd6a6a627d Konstantin Komarov 2021-08-13 2045 if (tail_page) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2046 log->seq_num = expected_seq;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2047 log->last_lsn = le64_to_cpu(tail_page->record_hdr.last_end_lsn);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2048 log->ra->current_lsn = tail_page->record_hdr.last_end_lsn;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2049 log->l_flags &= ~NTFSLOG_NO_LAST_LSN;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2050
b46acd6a6a627d Konstantin Komarov 2021-08-13 2051 if (log->page_size -
b46acd6a6a627d Konstantin Komarov 2021-08-13 2052 le16_to_cpu(
b46acd6a6a627d Konstantin Komarov 2021-08-13 2053 tail_page->record_hdr.next_record_off) >=
b46acd6a6a627d Konstantin Komarov 2021-08-13 2054 log->record_header_len) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2055 log->l_flags |= NTFSLOG_REUSE_TAIL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2056 log->next_page = curpage_off;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2057 } else {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2058 log->l_flags &= ~NTFSLOG_REUSE_TAIL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2059 log->next_page = nextpage_off;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2060 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 2061
b46acd6a6a627d Konstantin Komarov 2021-08-13 2062 if (wrapped)
b46acd6a6a627d Konstantin Komarov 2021-08-13 2063 log->l_flags |= NTFSLOG_WRAPPED;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2064 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 2065
e8b8e97f91b80f Kari Argillander 2021-08-03 2066 /* Remember that the partial IO will start at the next page. */
b46acd6a6a627d Konstantin Komarov 2021-08-13 2067 second_off = nextpage_off;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2068
b46acd6a6a627d Konstantin Komarov 2021-08-13 2069 /*
b46acd6a6a627d Konstantin Komarov 2021-08-13 2070 * If the next page is the first page of the file then update
e8b8e97f91b80f Kari Argillander 2021-08-03 2071 * the sequence number for log records which begon the next page.
b46acd6a6a627d Konstantin Komarov 2021-08-13 2072 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 2073 if (wrapped)
b46acd6a6a627d Konstantin Komarov 2021-08-13 2074 expected_seq += 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2075
b46acd6a6a627d Konstantin Komarov 2021-08-13 2076 /*
b46acd6a6a627d Konstantin Komarov 2021-08-13 2077 * If we have a tail copy or are performing single page I/O we can
e8b8e97f91b80f Kari Argillander 2021-08-03 2078 * immediately look at the next page.
b46acd6a6a627d Konstantin Komarov 2021-08-13 2079 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 2080 if (replace_page || (log->ra->flags & RESTART_SINGLE_PAGE_IO)) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2081 page_cnt = 2;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2082 page_pos = 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2083 goto check_valid;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2084 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 2085
b46acd6a6a627d Konstantin Komarov 2021-08-13 2086 if (page_pos != page_cnt)
b46acd6a6a627d Konstantin Komarov 2021-08-13 2087 goto check_valid;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2088 /*
b46acd6a6a627d Konstantin Komarov 2021-08-13 2089 * If the next page causes us to wrap to the beginning of the log
b46acd6a6a627d Konstantin Komarov 2021-08-13 2090 * file then we know which page to check next.
b46acd6a6a627d Konstantin Komarov 2021-08-13 2091 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 2092 if (wrapped) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2093 page_cnt = 2;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2094 page_pos = 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2095 goto check_valid;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2096 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 2097
b46acd6a6a627d Konstantin Komarov 2021-08-13 2098 cur_pos = 2;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2099
b46acd6a6a627d Konstantin Komarov 2021-08-13 2100 next_test_page:
195c52bdd5d5ec Kari Argillander 2021-08-24 2101 kfree(tst_page);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2102 tst_page = NULL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2103
e8b8e97f91b80f Kari Argillander 2021-08-03 2104 /* Walk through the file, reading log pages. */
b46acd6a6a627d Konstantin Komarov 2021-08-13 2105 err = read_log_page(log, nextpage_off, &tst_page, &usa_error);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2106
b46acd6a6a627d Konstantin Komarov 2021-08-13 2107 /*
b46acd6a6a627d Konstantin Komarov 2021-08-13 2108 * If we get a USA error then assume that we correctly found
e8b8e97f91b80f Kari Argillander 2021-08-03 2109 * the end of the original transfer.
b46acd6a6a627d Konstantin Komarov 2021-08-13 2110 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 2111 if (usa_error)
b46acd6a6a627d Konstantin Komarov 2021-08-13 2112 goto file_is_valid;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2113
b46acd6a6a627d Konstantin Komarov 2021-08-13 2114 /*
b46acd6a6a627d Konstantin Komarov 2021-08-13 2115 * If we were able to read the page, we examine it to see if it
e8b8e97f91b80f Kari Argillander 2021-08-03 2116 * is the same or different Io block.
b46acd6a6a627d Konstantin Komarov 2021-08-13 2117 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 2118 if (err)
b46acd6a6a627d Konstantin Komarov 2021-08-13 2119 goto next_test_page_1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2120
b46acd6a6a627d Konstantin Komarov 2021-08-13 2121 if (le16_to_cpu(tst_page->page_pos) == cur_pos &&
b46acd6a6a627d Konstantin Komarov 2021-08-13 2122 check_subseq_log_page(log, tst_page, nextpage_off, expected_seq)) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2123 page_cnt = le16_to_cpu(tst_page->page_count) + 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2124 page_pos = le16_to_cpu(tst_page->page_pos);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2125 goto check_valid;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2126 } else {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2127 goto file_is_valid;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2128 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 2129
b46acd6a6a627d Konstantin Komarov 2021-08-13 2130 next_test_page_1:
b46acd6a6a627d Konstantin Komarov 2021-08-13 2131
b46acd6a6a627d Konstantin Komarov 2021-08-13 2132 nextpage_off = next_page_off(log, curpage_off);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2133 wrapped = nextpage_off == log->first_page;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2134
b46acd6a6a627d Konstantin Komarov 2021-08-13 2135 if (wrapped) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2136 expected_seq += 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2137 page_cnt = 2;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2138 page_pos = 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2139 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 2140
b46acd6a6a627d Konstantin Komarov 2021-08-13 2141 cur_pos += 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2142 part_io_count += 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2143 if (!wrapped)
b46acd6a6a627d Konstantin Komarov 2021-08-13 2144 goto next_test_page;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2145
b46acd6a6a627d Konstantin Komarov 2021-08-13 2146 check_valid:
e8b8e97f91b80f Kari Argillander 2021-08-03 2147 /* Skip over the remaining pages this transfer. */
b46acd6a6a627d Konstantin Komarov 2021-08-13 2148 remain_pages = page_cnt - page_pos - 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2149 part_io_count += remain_pages;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2150
b46acd6a6a627d Konstantin Komarov 2021-08-13 2151 while (remain_pages--) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2152 nextpage_off = next_page_off(log, curpage_off);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2153 wrapped = nextpage_off == log->first_page;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2154
b46acd6a6a627d Konstantin Komarov 2021-08-13 2155 if (wrapped)
b46acd6a6a627d Konstantin Komarov 2021-08-13 2156 expected_seq += 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2157 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 2158
e8b8e97f91b80f Kari Argillander 2021-08-03 2159 /* Call our routine to check this log page. */
195c52bdd5d5ec Kari Argillander 2021-08-24 2160 kfree(tst_page);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2161 tst_page = NULL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2162
b46acd6a6a627d Konstantin Komarov 2021-08-13 2163 err = read_log_page(log, nextpage_off, &tst_page, &usa_error);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2164 if (!err && !usa_error &&
b46acd6a6a627d Konstantin Komarov 2021-08-13 2165 check_subseq_log_page(log, tst_page, nextpage_off, expected_seq)) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2166 err = -EINVAL;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2167 goto out;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2168 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 2169
b46acd6a6a627d Konstantin Komarov 2021-08-13 2170 file_is_valid:
b46acd6a6a627d Konstantin Komarov 2021-08-13 2171
e8b8e97f91b80f Kari Argillander 2021-08-03 2172 /* We have a valid file. */
b46acd6a6a627d Konstantin Komarov 2021-08-13 2173 if (page_off1 || tail_page) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2174 struct RECORD_PAGE_HDR *tmp_page;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2175
b46acd6a6a627d Konstantin Komarov 2021-08-13 2176 if (sb_rdonly(log->ni->mi.sbi->sb)) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2177 err = -EROFS;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2178 goto out;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2179 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 2180
b46acd6a6a627d Konstantin Komarov 2021-08-13 2181 if (page_off1) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2182 tmp_page = Add2Ptr(page_bufs, page_off1 - page_off);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2183 tails -= (page_off1 - page_off) / log->page_size;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2184 if (!tail_page)
b46acd6a6a627d Konstantin Komarov 2021-08-13 2185 tails -= 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2186 } else {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2187 tmp_page = tail_page;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2188 tails = 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2189 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 2190
b46acd6a6a627d Konstantin Komarov 2021-08-13 2191 while (tails--) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2192 u64 off = hdr_file_off(log, tmp_page);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2193
b46acd6a6a627d Konstantin Komarov 2021-08-13 2194 if (!page) {
195c52bdd5d5ec Kari Argillander 2021-08-24 2195 page = kmalloc(log->page_size, GFP_NOFS);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2196 if (!page)
b46acd6a6a627d Konstantin Komarov 2021-08-13 2197 return -ENOMEM;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2198 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 2199
b46acd6a6a627d Konstantin Komarov 2021-08-13 2200 /*
b46acd6a6a627d Konstantin Komarov 2021-08-13 2201 * Correct page and copy the data from this page
e8b8e97f91b80f Kari Argillander 2021-08-03 2202 * into it and flush it to disk.
b46acd6a6a627d Konstantin Komarov 2021-08-13 2203 */
b46acd6a6a627d Konstantin Komarov 2021-08-13 2204 memcpy(page, tmp_page, log->page_size);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2205
e8b8e97f91b80f Kari Argillander 2021-08-03 2206 /* Fill last flushed lsn value flush the page. */
b46acd6a6a627d Konstantin Komarov 2021-08-13 2207 if (log->major_ver < 2)
b46acd6a6a627d Konstantin Komarov 2021-08-13 2208 page->rhdr.lsn = page->record_hdr.last_end_lsn;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2209 else
b46acd6a6a627d Konstantin Komarov 2021-08-13 2210 page->file_off = 0;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2211
b46acd6a6a627d Konstantin Komarov 2021-08-13 2212 page->page_pos = page->page_count = cpu_to_le16(1);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2213
b46acd6a6a627d Konstantin Komarov 2021-08-13 2214 ntfs_fix_pre_write(&page->rhdr, log->page_size);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2215
b46acd6a6a627d Konstantin Komarov 2021-08-13 2216 err = ntfs_sb_write_run(log->ni->mi.sbi,
b46acd6a6a627d Konstantin Komarov 2021-08-13 2217 &log->ni->file.run, off, page,
6354467245ff8d Konstantin Komarov 2021-09-09 2218 log->page_size, 0);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2219
b46acd6a6a627d Konstantin Komarov 2021-08-13 2220 if (err)
b46acd6a6a627d Konstantin Komarov 2021-08-13 2221 goto out;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2222
b46acd6a6a627d Konstantin Komarov 2021-08-13 2223 if (part_io_count && second_off == off) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2224 second_off += log->page_size;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2225 part_io_count -= 1;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2226 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 2227
b46acd6a6a627d Konstantin Komarov 2021-08-13 2228 tmp_page = Add2Ptr(tmp_page, log->page_size);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2229 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 2230 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 2231
b46acd6a6a627d Konstantin Komarov 2021-08-13 2232 if (part_io_count) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2233 if (sb_rdonly(log->ni->mi.sbi->sb)) {
b46acd6a6a627d Konstantin Komarov 2021-08-13 2234 err = -EROFS;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2235 goto out;
b46acd6a6a627d Konstantin Komarov 2021-08-13 2236 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 2237 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 2238
b46acd6a6a627d Konstantin Komarov 2021-08-13 2239 out:
195c52bdd5d5ec Kari Argillander 2021-08-24 2240 kfree(second_tail);
195c52bdd5d5ec Kari Argillander 2021-08-24 2241 kfree(first_tail);
195c52bdd5d5ec Kari Argillander 2021-08-24 2242 kfree(page);
195c52bdd5d5ec Kari Argillander 2021-08-24 2243 kfree(tst_page);
195c52bdd5d5ec Kari Argillander 2021-08-24 2244 kfree(page_bufs);
b46acd6a6a627d Konstantin Komarov 2021-08-13 2245
b46acd6a6a627d Konstantin Komarov 2021-08-13 2246 return err;
b46acd6a6a627d Konstantin Komarov 2021-08-13 @2247 }
b46acd6a6a627d Konstantin Komarov 2021-08-13 2248
:::::: The code at line 2247 was first introduced by commit
:::::: b46acd6a6a627d876898e1c84d3f84902264b445 fs/ntfs3: Add NTFS journal
:::::: TO: Konstantin Komarov <almaz.alexandrovich(a)paragon-software.com>
:::::: CC: Konstantin Komarov <almaz.alexandrovich(a)paragon-software.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
[frank-w-bpi-r2-4.14:5.15-rtl8367dsa 31/44] cc1: error: drivers/net/phy/rtk/rtl8367c/include: No such file or directory
by kernel test robot
tree: https://github.com/frank-w/BPI-R2-4.14 5.15-rtl8367dsa
head: e9ec03c13f235a810e08f9797a0e826b994a8743
commit: 54251835782f2792cb404b5c12dd412deb72dd7c [31/44] net: phy: add rtl8367 switch phy driver for r64 v0.1
config: s390-randconfig-r022-20211114 (attached as .config)
compiler: s390-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/frank-w/BPI-R2-4.14/commit/54251835782f2792cb404b5c12d...
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 54251835782f2792cb404b5c12dd412deb72dd7c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=s390
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 >>):
>> cc1: error: drivers/net/phy/rtk/rtl8367c/include: No such file or directory [-Werror=missing-include-dirs]
>> cc1: error: include/linux/: No such file or directory [-Werror=missing-include-dirs]
>> drivers/net/phy/rtk/rtl8367s_mdio.c:45:14: error: no previous prototype for 'mii_mgr_read' [-Werror=missing-prototypes]
45 | unsigned int mii_mgr_read(unsigned int phy_addr,unsigned int phy_register,unsigned int *read_data)
| ^~~~~~~~~~~~
>> drivers/net/phy/rtk/rtl8367s_mdio.c:58:14: error: no previous prototype for 'mii_mgr_write' [-Werror=missing-prototypes]
58 | unsigned int mii_mgr_write(unsigned int phy_addr,unsigned int phy_register,unsigned int write_data)
| ^~~~~~~~~~~~~
>> drivers/net/phy/rtk/rtl8367s_mdio.c:213:6: error: no previous prototype for 'init_gsw' [-Werror=missing-prototypes]
213 | void init_gsw(void)
| ^~~~~~~~
cc1: all warnings being treated as errors
--
>> cc1: error: drivers/net/phy/rtk/rtl8367c/include: No such file or directory [-Werror=missing-include-dirs]
>> cc1: error: include/linux/: No such file or directory [-Werror=missing-include-dirs]
>> drivers/net/phy/rtk/rtl8367s_dbg.c:169:5: error: no previous prototype for 'gsw_debug_proc_init' [-Werror=missing-prototypes]
169 | int gsw_debug_proc_init(void)
| ^~~~~~~~~~~~~~~~~~~
>> drivers/net/phy/rtk/rtl8367s_dbg.c:190:6: error: no previous prototype for 'gsw_debug_proc_exit' [-Werror=missing-prototypes]
190 | void gsw_debug_proc_exit(void)
| ^~~~~~~~~~~~~~~~~~~
>> drivers/net/phy/rtk/rtl8367s_dbg.c:160:30: error: 'switch_vlan_fops' defined but not used [-Werror=unused-const-variable=]
160 | static const struct proc_ops switch_vlan_fops = {
| ^~~~~~~~~~~~~~~~
>> drivers/net/phy/rtk/rtl8367s_dbg.c:152:30: error: 'switch_count_fops' defined but not used [-Werror=unused-const-variable=]
152 | static const struct proc_ops switch_count_fops = {
| ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
--
>> cc1: error: drivers/net/phy/rtk/rtl8367c/include: No such file or directory [-Werror=missing-include-dirs]
>> cc1: error: include/linux/: No such file or directory [-Werror=missing-include-dirs]
cc1: all warnings being treated as errors
--
>> cc1: error: drivers/net/phy/rtk/rtl8367c/include: No such file or directory [-Werror=missing-include-dirs]
>> cc1: error: include/linux/: No such file or directory [-Werror=missing-include-dirs]
>> drivers/net/phy/rtk/rtl8367c/rtk_switch.c:43:6: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
43 | #if (AUTO_PROBE || defined(FORCE_PROBE_RTL8367C))
| ^~~~~~~~~~
>> drivers/net/phy/rtk/rtl8367c/rtk_switch.c:43:6: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
>> drivers/net/phy/rtk/rtl8367c/rtk_switch.c:43:6: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
>> drivers/net/phy/rtk/rtl8367c/rtk_switch.c:43:6: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
drivers/net/phy/rtk/rtl8367c/rtk_switch.c:112:6: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
112 | #if (AUTO_PROBE || defined(FORCE_PROBE_RTL8370B))
| ^~~~~~~~~~
drivers/net/phy/rtk/rtl8367c/rtk_switch.c:112:6: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
drivers/net/phy/rtk/rtl8367c/rtk_switch.c:112:6: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
drivers/net/phy/rtk/rtl8367c/rtk_switch.c:112:6: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
drivers/net/phy/rtk/rtl8367c/rtk_switch.c:181:6: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
181 | #if (AUTO_PROBE || defined(FORCE_PROBE_RTL8364B))
| ^~~~~~~~~~
drivers/net/phy/rtk/rtl8367c/rtk_switch.c:181:6: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
drivers/net/phy/rtk/rtl8367c/rtk_switch.c:181:6: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
drivers/net/phy/rtk/rtl8367c/rtk_switch.c:181:6: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
drivers/net/phy/rtk/rtl8367c/rtk_switch.c:250:6: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
250 | #if (AUTO_PROBE || defined(FORCE_PROBE_RTL8363SC_VB))
| ^~~~~~~~~~
drivers/net/phy/rtk/rtl8367c/rtk_switch.c:250:6: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
drivers/net/phy/rtk/rtl8367c/rtk_switch.c:250:6: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
drivers/net/phy/rtk/rtl8367c/rtk_switch.c:250:6: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
cc1: all warnings being treated as errors
--
>> cc1: error: drivers/net/phy/rtk/rtl8367c/include: No such file or directory [-Werror=missing-include-dirs]
>> cc1: error: include/linux/: No such file or directory [-Werror=missing-include-dirs]
drivers/net/phy/rtk/rtl8367c/stat.c: In function 'rtk_stat_global_get':
>> drivers/net/phy/rtk/rtl8367c/stat.c:143:50: error: implicit conversion from 'rtk_stat_global_type_t' {aka 'enum rtk_stat_global_type_e'} to 'RTL8367C_MIBCOUNTER' {aka 'enum RTL8367C_MIBCOUNTER_E'} [-Werror=enum-conversion]
143 | if ((retVal = rtl8367c_getAsicMIBsCounter(0, cntr_idx, pCntr)) != RT_ERR_OK)
| ^~~~~~~~
drivers/net/phy/rtk/rtl8367c/stat.c: In function 'rtk_stat_global_getAll':
>> drivers/net/phy/rtk/rtl8367c/stat.c:175:49: error: implicit conversion from 'enum rtk_stat_global_type_e' to 'RTL8367C_MIBCOUNTER' {aka 'enum RTL8367C_MIBCOUNTER_E'} [-Werror=enum-conversion]
175 | if ((retVal = rtl8367c_getAsicMIBsCounter(0,DOT1D_TP_LEARNED_ENTRY_DISCARDS_INDEX, &pGlobal_cntrs->dot1dTpLearnedEntryDiscards)) != RT_ERR_OK)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
--
>> cc1: error: drivers/net/phy/rtk/rtl8367c/include: No such file or directory [-Werror=missing-include-dirs]
>> cc1: error: include/linux/: No such file or directory [-Werror=missing-include-dirs]
drivers/net/phy/rtk/rtl8367c/vlan.c: In function 'rtk_vlan_protoAndPortBasedVlan_add':
>> drivers/net/phy/rtk/rtl8367c/vlan.c:953:13: error: implicit conversion from 'rtk_vlan_protoVlan_frameType_t' {aka 'enum rtk_vlan_protoVlan_frameType_e'} to 'rtl8367c_provlan_frametype' [-Werror=enum-conversion]
953 | tmp = pInfo->frame_type;
| ^
drivers/net/phy/rtk/rtl8367c/vlan.c:979:32: error: implicit conversion from 'rtk_vlan_protoVlan_frameType_t' {aka 'enum rtk_vlan_protoVlan_frameType_e'} to 'rtl8367c_provlan_frametype' [-Werror=enum-conversion]
979 | ppb_data_cfg.frameType = pInfo->frame_type;
| ^
drivers/net/phy/rtk/rtl8367c/vlan.c: In function 'rtk_vlan_tagMode_set':
>> drivers/net/phy/rtk/rtl8367c/vlan.c:1270:84: error: implicit conversion from 'rtk_vlan_tagMode_t' {aka 'enum rtk_vlan_tagMode_e'} to 'rtl8367c_egtagmode' [-Werror=enum-conversion]
1270 | if ((retVal = rtl8367c_setAsicVlanEgressTagMode(rtk_switch_port_L2P_get(port), tag_mode)) != RT_ERR_OK)
| ^~~~~~~~
cc1: all warnings being treated as errors
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
[frank-w-bpi-r2-4.14:5.15-rtl8367dsa 39/44] drivers/net/dsa/rtl8367s_mdio.h:171:15: warning: no previous prototype for function 'rtk_vlan_reset'
by kernel test robot
tree: https://github.com/frank-w/BPI-R2-4.14 5.15-rtl8367dsa
head: e9ec03c13f235a810e08f9797a0e826b994a8743
commit: 123e43eb62b6c9b008f7cec61ddae23d97e2f764 [39/44] net: dsa: rtl8367: add basic code from phy driver
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/123e43eb62b6c9b008f7cec61dd...
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 123e43eb62b6c9b008f7cec61ddae23d97e2f764
# 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 >>):
In file included from drivers/net/dsa/rtl8367s_mdio.c:23:
>> drivers/net/dsa/rtl8367s_mdio.h:171:15: warning: no previous prototype for function 'rtk_vlan_reset' [-Wmissing-prototypes]
rtk_api_ret_t rtk_vlan_reset(void) {return 0;}
^
drivers/net/dsa/rtl8367s_mdio.h:171:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
rtk_api_ret_t rtk_vlan_reset(void) {return 0;}
^
static
>> drivers/net/dsa/rtl8367s_mdio.h:174:15: warning: no previous prototype for function 'rtk_vlan_init' [-Wmissing-prototypes]
rtk_api_ret_t rtk_vlan_init(void) {return 0;}
^
drivers/net/dsa/rtl8367s_mdio.h:174:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
rtk_api_ret_t rtk_vlan_init(void) {return 0;}
^
static
>> drivers/net/dsa/rtl8367s_mdio.h:197:15: warning: no previous prototype for function 'rtk_vlan_set' [-Wmissing-prototypes]
rtk_api_ret_t rtk_vlan_set(rtk_vlan_t vid, rtk_vlan_cfg_t *pVlanCfg) {return 0;}
^
drivers/net/dsa/rtl8367s_mdio.h:197:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
rtk_api_ret_t rtk_vlan_set(rtk_vlan_t vid, rtk_vlan_cfg_t *pVlanCfg) {return 0;}
^
static
>> drivers/net/dsa/rtl8367s_mdio.h:222:15: warning: no previous prototype for function 'rtk_vlan_portPvid_set' [-Wmissing-prototypes]
rtk_api_ret_t rtk_vlan_portPvid_set(rtk_port_t port, rtk_vlan_t pvid, rtk_pri_t priority) {return 0;}
^
drivers/net/dsa/rtl8367s_mdio.h:222:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
rtk_api_ret_t rtk_vlan_portPvid_set(rtk_port_t port, rtk_vlan_t pvid, rtk_pri_t priority) {return 0;}
^
static
>> drivers/net/dsa/rtl8367s_mdio.h:258:15: warning: no previous prototype for function 'rtk_port_macForceLinkExt_set' [-Wmissing-prototypes]
rtk_api_ret_t rtk_port_macForceLinkExt_set(rtk_port_t port, rtk_mode_ext_t mode, rtk_port_mac_ability_t *pPortability) {return 0;};
^
drivers/net/dsa/rtl8367s_mdio.h:258:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
rtk_api_ret_t rtk_port_macForceLinkExt_set(rtk_port_t port, rtk_mode_ext_t mode, rtk_port_mac_ability_t *pPortability) {return 0;};
^
static
>> drivers/net/dsa/rtl8367s_mdio.h:280:15: warning: no previous prototype for function 'rtk_port_phyEnableAll_set' [-Wmissing-prototypes]
rtk_api_ret_t rtk_port_phyEnableAll_set(rtk_enable_t enable) {return 0;}
^
drivers/net/dsa/rtl8367s_mdio.h:280:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
rtk_api_ret_t rtk_port_phyEnableAll_set(rtk_enable_t enable) {return 0;}
^
static
>> drivers/net/dsa/rtl8367s_mdio.h:302:15: warning: no previous prototype for function 'rtk_port_rgmiiDelayExt_set' [-Wmissing-prototypes]
rtk_api_ret_t rtk_port_rgmiiDelayExt_set(rtk_port_t port, rtk_data_t txDelay, rtk_data_t rxDelay) {return 0;}
^
drivers/net/dsa/rtl8367s_mdio.h:302:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
rtk_api_ret_t rtk_port_rgmiiDelayExt_set(rtk_port_t port, rtk_data_t txDelay, rtk_data_t rxDelay) {return 0;}
^
static
>> drivers/net/dsa/rtl8367s_mdio.h:322:15: warning: no previous prototype for function 'rtk_port_sgmiiNway_set' [-Wmissing-prototypes]
rtk_api_ret_t rtk_port_sgmiiNway_set(rtk_port_t port, rtk_enable_t state) {return 0;}
^
drivers/net/dsa/rtl8367s_mdio.h:322:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
rtk_api_ret_t rtk_port_sgmiiNway_set(rtk_port_t port, rtk_enable_t state) {return 0;}
^
static
>> drivers/net/dsa/rtl8367s_mdio.c:42:14: warning: no previous prototype for function 'mii_mgr_read' [-Wmissing-prototypes]
unsigned int mii_mgr_read(unsigned int phy_addr,unsigned int phy_register,unsigned int *read_data)
^
drivers/net/dsa/rtl8367s_mdio.c:42:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
unsigned int mii_mgr_read(unsigned int phy_addr,unsigned int phy_register,unsigned int *read_data)
^
static
>> drivers/net/dsa/rtl8367s_mdio.c:55:14: warning: no previous prototype for function 'mii_mgr_write' [-Wmissing-prototypes]
unsigned int mii_mgr_write(unsigned int phy_addr,unsigned int phy_register,unsigned int write_data)
^
drivers/net/dsa/rtl8367s_mdio.c:55:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
unsigned int mii_mgr_write(unsigned int phy_addr,unsigned int phy_register,unsigned int write_data)
^
static
drivers/net/dsa/rtl8367s_mdio.c:68:12: error: redefinition of 'rtk_switch_init'
static int rtk_switch_init(void) { return 0; }
^
drivers/net/dsa/rtl8367s_mdio.h:135:12: note: previous definition is here
static int rtk_switch_init(void) { return 0; }
^
>> drivers/net/dsa/rtl8367s_mdio.c:209:6: warning: no previous prototype for function 'init_gsw' [-Wmissing-prototypes]
void init_gsw(void)
^
drivers/net/dsa/rtl8367s_mdio.c:209:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void init_gsw(void)
^
static
11 warnings and 1 error generated.
vim +/rtk_vlan_reset +171 drivers/net/dsa/rtl8367s_mdio.h
136
137 /* Function Name:
138 * rtk_vlan_init
139 * Description:
140 * Initialize VLAN.
141 * Input:
142 * None
143 * Output:
144 * None
145 * Return:
146 * RT_ERR_OK - OK
147 * RT_ERR_FAILED - Failed
148 * RT_ERR_SMI - SMI access error
149 * Note:
150 * VLAN is disabled by default. User has to call this API to enable VLAN before
151 * using it. And It will set a default VLAN(vid 1) including all ports and set
152 * all ports PVID to the default VLAN.
153 */
154
155 /* Function Name:
156 * rtk_vlan_reset
157 * Description:
158 * Reset VLAN
159 * Input:
160 * None.
161 * Output:
162 * pEnabled - State of 1p remarking at real keep packet
163 * Return:
164 * RT_ERR_OK - OK
165 * RT_ERR_FAILED - Failed
166 * RT_ERR_SMI - SMI access error
167 * RT_ERR_INPUT - Error Input
168 * Note:
169 *
170 */
> 171 rtk_api_ret_t rtk_vlan_reset(void) {return 0;}
172
173 //extern
> 174 rtk_api_ret_t rtk_vlan_init(void) {return 0;}
175
176 /* Function Name:
177 * rtk_vlan_set
178 * Description:
179 * Set a VLAN entry.
180 * Input:
181 * vid - VLAN ID to configure.
182 * pVlanCfg - VLAN Configuration
183 * Output:
184 * None
185 * Return:
186 * RT_ERR_OK - OK
187 * RT_ERR_FAILED - Failed
188 * RT_ERR_SMI - SMI access error
189 * RT_ERR_INPUT - Invalid input parameters.
190 * RT_ERR_L2_FID - Invalid FID.
191 * RT_ERR_VLAN_PORT_MBR_EXIST - Invalid member port mask.
192 * RT_ERR_VLAN_VID - Invalid VID parameter.
193 * Note:
194 *
195 */
196 //extern
> 197 rtk_api_ret_t rtk_vlan_set(rtk_vlan_t vid, rtk_vlan_cfg_t *pVlanCfg) {return 0;}
198
199 /* Function Name:
200 * rtk_vlan_portPvid_set
201 * Description:
202 * Set port to specified VLAN ID(PVID).
203 * Input:
204 * port - Port id.
205 * pvid - Specified VLAN ID.
206 * priority - 802.1p priority for the PVID.
207 * Output:
208 * None
209 * Return:
210 * RT_ERR_OK - OK
211 * RT_ERR_FAILED - Failed
212 * RT_ERR_SMI - SMI access error
213 * RT_ERR_PORT_ID - Invalid port number.
214 * RT_ERR_VLAN_PRIORITY - Invalid priority.
215 * RT_ERR_VLAN_ENTRY_NOT_FOUND - VLAN entry not found.
216 * RT_ERR_VLAN_VID - Invalid VID parameter.
217 * Note:
218 * The API is used for Port-based VLAN. The untagged frame received from the
219 * port will be classified to the specified VLAN and assigned to the specified priority.
220 */
221 //extern
> 222 rtk_api_ret_t rtk_vlan_portPvid_set(rtk_port_t port, rtk_vlan_t pvid, rtk_pri_t priority) {return 0;}
223
224 /* Function Name:
225 * rtk_port_macForceLinkExt_set
226 * Description:
227 * Set external interface force linking configuration.
228 * Input:
229 * port - external port ID
230 * mode - external interface mode
231 * pPortability - port ability configuration
232 * Output:
233 * None
234 * Return:
235 * RT_ERR_OK - OK
236 * RT_ERR_FAILED - Failed
237 * RT_ERR_SMI - SMI access error
238 * RT_ERR_INPUT - Invalid input parameters.
239 * Note:
240 * This API can set external interface force mode properties.
241 * The external interface can be set to:
242 * - MODE_EXT_DISABLE,
243 * - MODE_EXT_RGMII,
244 * - MODE_EXT_MII_MAC,
245 * - MODE_EXT_MII_PHY,
246 * - MODE_EXT_TMII_MAC,
247 * - MODE_EXT_TMII_PHY,
248 * - MODE_EXT_GMII,
249 * - MODE_EXT_RMII_MAC,
250 * - MODE_EXT_RMII_PHY,
251 * - MODE_EXT_SGMII,
252 * - MODE_EXT_HSGMII,
253 * - MODE_EXT_1000X_100FX,
254 * - MODE_EXT_1000X,
255 * - MODE_EXT_100FX,
256 */
257 //extern
> 258 rtk_api_ret_t rtk_port_macForceLinkExt_set(rtk_port_t port, rtk_mode_ext_t mode, rtk_port_mac_ability_t *pPortability) {return 0;};
259
260 /* Function Name:
261 * rtk_port_phyEnableAll_set
262 * Description:
263 * Set all PHY enable status.
264 * Input:
265 * enable - PHY Enable State.
266 * Output:
267 * None
268 * Return:
269 * RT_ERR_OK - OK
270 * RT_ERR_FAILED - Failed
271 * RT_ERR_SMI - SMI access error
272 * RT_ERR_ENABLE - Invalid enable input.
273 * Note:
274 * This API can set all PHY status.
275 * The configuration of all PHY is as following:
276 * - DISABLE
277 * - ENABLE
278 */
279 //extern
> 280 rtk_api_ret_t rtk_port_phyEnableAll_set(rtk_enable_t enable) {return 0;}
281
282 /* Function Name:
283 * rtk_port_rgmiiDelayExt_set
284 * Description:
285 * Set RGMII interface delay value for TX and RX.
286 * Input:
287 * txDelay - TX delay value, 1 for delay 2ns and 0 for no-delay
288 * rxDelay - RX delay value, 0~7 for delay setup.
289 * Output:
290 * None
291 * Return:
292 * RT_ERR_OK - OK
293 * RT_ERR_FAILED - Failed
294 * RT_ERR_SMI - SMI access error
295 * RT_ERR_INPUT - Invalid input parameters.
296 * Note:
297 * This API can set external interface 2 RGMII delay.
298 * In TX delay, there are 2 selection: no-delay and 2ns delay.
299 * In RX dekay, there are 8 steps for delay tunning. 0 for no-delay, and 7 for maximum delay.
300 */
301 //extern
> 302 rtk_api_ret_t rtk_port_rgmiiDelayExt_set(rtk_port_t port, rtk_data_t txDelay, rtk_data_t rxDelay) {return 0;}
303
304 /* Function Name:
305 * rtk_port_sgmiiNway_set
306 * Description:
307 * Configure SGMII/HSGMII port Nway state
308 * Input:
309 * port - Port ID
310 * state - Nway state
311 * Output:
312 * None.
313 * Return:
314 * RT_ERR_OK - OK
315 * RT_ERR_FAILED - Failed
316 * RT_ERR_SMI - SMI access error
317 * RT_ERR_PORT_ID - Invalid port ID.
318 * Note:
319 * The API configure SGMII/HSGMII port Nway state
320 */
321 //extern
> 322 rtk_api_ret_t rtk_port_sgmiiNway_set(rtk_port_t port, rtk_enable_t state) {return 0;}
323
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
[frank-w-bpi-r2-4.14:5.15-rtl8367dsa 28/43] drivers/net/dsa/rtl8367rb.c:929:2: warning: variable 'count' is used uninitialized whenever switch default is taken
by kernel test robot
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
10 months, 1 week