[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202005310549.dVSWxuGH%lkp@intel.com>
Date: Sun, 31 May 2020 05:32:58 +0800
From: kbuild test robot <lkp@...el.com>
To: "Thomas, Bogendoerfer," <tbogendoerfer@...e.de>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
Paul Burton <paulburton@...nel.org>
Subject: arch/mips/sgi-ip27/ip27-hubio.c:30:15: warning: no previous
prototype for 'hub_pio_map'
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 86852175b016f0c6873dcbc24b93d12b7b246612
commit: b78e9d63a3b6307b6b786e6ba189d3978b60ceb5 MIPS: SGI-IP27: use asm/sn/agent.h for including HUB related stuff
date: 5 months ago
config: mips-ip27_defconfig (attached as .config)
compiler: mips64-linux-gcc (GCC) 9.3.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
git checkout b78e9d63a3b6307b6b786e6ba189d3978b60ceb5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@...el.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> arch/mips/sgi-ip27/ip27-hubio.c:30:15: warning: no previous prototype for 'hub_pio_map' [-Wmissing-prototypes]
30 | unsigned long hub_pio_map(nasid_t nasid, xwidgetnum_t widget,
| ^~~~~~~~~~~
>> arch/mips/sgi-ip27/ip27-hubio.c:175:6: warning: no previous prototype for 'hub_pio_init' [-Wmissing-prototypes]
175 | void hub_pio_init(nasid_t nasid)
| ^~~~~~~~~~~~
vim +/hub_pio_map +30 arch/mips/sgi-ip27/ip27-hubio.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 20
^1da177e4c3f41 Linus Torvalds 2005-04-16 21 /**
^1da177e4c3f41 Linus Torvalds 2005-04-16 22 * hub_pio_map - establish a HUB PIO mapping
^1da177e4c3f41 Linus Torvalds 2005-04-16 23 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 24 * @hub: hub to perform PIO mapping on
^1da177e4c3f41 Linus Torvalds 2005-04-16 25 * @widget: widget ID to perform PIO mapping for
^1da177e4c3f41 Linus Torvalds 2005-04-16 26 * @xtalk_addr: xtalk_address that needs to be mapped
^1da177e4c3f41 Linus Torvalds 2005-04-16 27 * @size: size of the PIO mapping
^1da177e4c3f41 Linus Torvalds 2005-04-16 28 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 29 **/
4bf841ebf17aaa Thomas Bogendoerfer 2019-10-03 @30 unsigned long hub_pio_map(nasid_t nasid, xwidgetnum_t widget,
^1da177e4c3f41 Linus Torvalds 2005-04-16 31 unsigned long xtalk_addr, size_t size)
^1da177e4c3f41 Linus Torvalds 2005-04-16 32 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 33 unsigned i;
^1da177e4c3f41 Linus Torvalds 2005-04-16 34
^1da177e4c3f41 Linus Torvalds 2005-04-16 35 /* use small-window mapping if possible */
^1da177e4c3f41 Linus Torvalds 2005-04-16 36 if ((xtalk_addr % SWIN_SIZE) + size <= SWIN_SIZE)
^1da177e4c3f41 Linus Torvalds 2005-04-16 37 return NODE_SWIN_BASE(nasid, widget) + (xtalk_addr % SWIN_SIZE);
^1da177e4c3f41 Linus Torvalds 2005-04-16 38
^1da177e4c3f41 Linus Torvalds 2005-04-16 39 if ((xtalk_addr % BWIN_SIZE) + size > BWIN_SIZE) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 40 printk(KERN_WARNING "PIO mapping at hub %d widget %d addr 0x%lx"
^1da177e4c3f41 Linus Torvalds 2005-04-16 41 " too big (%ld)\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 42 nasid, widget, xtalk_addr, size);
^1da177e4c3f41 Linus Torvalds 2005-04-16 43 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 44 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 45
^1da177e4c3f41 Linus Torvalds 2005-04-16 46 xtalk_addr &= ~(BWIN_SIZE-1);
^1da177e4c3f41 Linus Torvalds 2005-04-16 47 for (i = 0; i < HUB_NUM_BIG_WINDOW; i++) {
4bf841ebf17aaa Thomas Bogendoerfer 2019-10-03 48 if (test_and_set_bit(i, hub_data(nasid)->h_bigwin_used))
^1da177e4c3f41 Linus Torvalds 2005-04-16 49 continue;
^1da177e4c3f41 Linus Torvalds 2005-04-16 50
^1da177e4c3f41 Linus Torvalds 2005-04-16 51 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 52 * The code below does a PIO write to setup an ITTE entry.
^1da177e4c3f41 Linus Torvalds 2005-04-16 53 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 54 * We need to prevent other CPUs from seeing our updated
^1da177e4c3f41 Linus Torvalds 2005-04-16 55 * memory shadow of the ITTE (in the piomap) until the ITTE
^1da177e4c3f41 Linus Torvalds 2005-04-16 56 * entry is actually set up; otherwise, another CPU might
^1da177e4c3f41 Linus Torvalds 2005-04-16 57 * attempt a PIO prematurely.
^1da177e4c3f41 Linus Torvalds 2005-04-16 58 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 59 * Also, the only way we can know that an entry has been
^1da177e4c3f41 Linus Torvalds 2005-04-16 60 * received by the hub and can be used by future PIO reads/
^1da177e4c3f41 Linus Torvalds 2005-04-16 61 * writes is by reading back the ITTE entry after writing it.
^1da177e4c3f41 Linus Torvalds 2005-04-16 62 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 63 * For these two reasons, we PIO read back the ITTE entry
^1da177e4c3f41 Linus Torvalds 2005-04-16 64 * after we write it.
^1da177e4c3f41 Linus Torvalds 2005-04-16 65 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 66 IIO_ITTE_PUT(nasid, i, HUB_PIO_MAP_TO_MEM, widget, xtalk_addr);
db0e7d4e42b055 Thomas Bogendoerfer 2019-02-19 67 __raw_readq(IIO_ITTE_GET(nasid, i));
^1da177e4c3f41 Linus Torvalds 2005-04-16 68
^1da177e4c3f41 Linus Torvalds 2005-04-16 69 return NODE_BWIN_BASE(nasid, widget) + (xtalk_addr % BWIN_SIZE);
^1da177e4c3f41 Linus Torvalds 2005-04-16 70 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 71
^1da177e4c3f41 Linus Torvalds 2005-04-16 72 printk(KERN_WARNING "unable to establish PIO mapping for at"
^1da177e4c3f41 Linus Torvalds 2005-04-16 73 " hub %d widget %d addr 0x%lx\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 74 nasid, widget, xtalk_addr);
^1da177e4c3f41 Linus Torvalds 2005-04-16 75 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 76 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 77
^1da177e4c3f41 Linus Torvalds 2005-04-16 78
^1da177e4c3f41 Linus Torvalds 2005-04-16 79 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 80 * hub_setup_prb(nasid, prbnum, credits, conveyor)
^1da177e4c3f41 Linus Torvalds 2005-04-16 81 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 82 * Put a PRB into fire-and-forget mode if conveyor isn't set. Otherwise,
^1da177e4c3f41 Linus Torvalds 2005-04-16 83 * put it into conveyor belt mode with the specified number of credits.
^1da177e4c3f41 Linus Torvalds 2005-04-16 84 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 85 static void hub_setup_prb(nasid_t nasid, int prbnum, int credits)
^1da177e4c3f41 Linus Torvalds 2005-04-16 86 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 87 iprb_t prb;
^1da177e4c3f41 Linus Torvalds 2005-04-16 88 int prb_offset;
^1da177e4c3f41 Linus Torvalds 2005-04-16 89
^1da177e4c3f41 Linus Torvalds 2005-04-16 90 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 91 * Get the current register value.
^1da177e4c3f41 Linus Torvalds 2005-04-16 92 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 93 prb_offset = IIO_IOPRB(prbnum);
^1da177e4c3f41 Linus Torvalds 2005-04-16 94 prb.iprb_regval = REMOTE_HUB_L(nasid, prb_offset);
^1da177e4c3f41 Linus Torvalds 2005-04-16 95
^1da177e4c3f41 Linus Torvalds 2005-04-16 96 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 97 * Clear out some fields.
^1da177e4c3f41 Linus Torvalds 2005-04-16 98 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 99 prb.iprb_ovflow = 1;
^1da177e4c3f41 Linus Torvalds 2005-04-16 100 prb.iprb_bnakctr = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 101 prb.iprb_anakctr = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 102
^1da177e4c3f41 Linus Torvalds 2005-04-16 103 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 104 * Enable or disable fire-and-forget mode.
^1da177e4c3f41 Linus Torvalds 2005-04-16 105 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 106 prb.iprb_ff = force_fire_and_forget ? 1 : 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 107
^1da177e4c3f41 Linus Torvalds 2005-04-16 108 /*
87fd4e2692a2ad Andrea Gelmini 2016-05-21 109 * Set the appropriate number of PIO credits for the widget.
^1da177e4c3f41 Linus Torvalds 2005-04-16 110 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 111 prb.iprb_xtalkctr = credits;
^1da177e4c3f41 Linus Torvalds 2005-04-16 112
^1da177e4c3f41 Linus Torvalds 2005-04-16 113 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 114 * Store the new value to the register.
^1da177e4c3f41 Linus Torvalds 2005-04-16 115 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 116 REMOTE_HUB_S(nasid, prb_offset, prb.iprb_regval);
^1da177e4c3f41 Linus Torvalds 2005-04-16 117 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 118
^1da177e4c3f41 Linus Torvalds 2005-04-16 119 /**
^1da177e4c3f41 Linus Torvalds 2005-04-16 120 * hub_set_piomode - set pio mode for a given hub
^1da177e4c3f41 Linus Torvalds 2005-04-16 121 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 122 * @nasid: physical node ID for the hub in question
^1da177e4c3f41 Linus Torvalds 2005-04-16 123 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 124 * Put the hub into either "PIO conveyor belt" mode or "fire-and-forget" mode.
^1da177e4c3f41 Linus Torvalds 2005-04-16 125 * To do this, we have to make absolutely sure that no PIOs are in progress
^1da177e4c3f41 Linus Torvalds 2005-04-16 126 * so we turn off access to all widgets for the duration of the function.
^1da177e4c3f41 Linus Torvalds 2005-04-16 127 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 128 * XXX - This code should really check what kind of widget we're talking
^1da177e4c3f41 Linus Torvalds 2005-04-16 129 * to. Bridges can only handle three requests, but XG will do more.
^1da177e4c3f41 Linus Torvalds 2005-04-16 130 * How many can crossbow handle to widget 0? We're assuming 1.
^1da177e4c3f41 Linus Torvalds 2005-04-16 131 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 132 * XXX - There is a bug in the crossbow that link reset PIOs do not
^1da177e4c3f41 Linus Torvalds 2005-04-16 133 * return write responses. The easiest solution to this problem is to
^1da177e4c3f41 Linus Torvalds 2005-04-16 134 * leave widget 0 (xbow) in fire-and-forget mode at all times. This
^1da177e4c3f41 Linus Torvalds 2005-04-16 135 * only affects pio's to xbow registers, which should be rare.
^1da177e4c3f41 Linus Torvalds 2005-04-16 136 **/
^1da177e4c3f41 Linus Torvalds 2005-04-16 137 static void hub_set_piomode(nasid_t nasid)
^1da177e4c3f41 Linus Torvalds 2005-04-16 138 {
db0e7d4e42b055 Thomas Bogendoerfer 2019-02-19 139 u64 ii_iowa;
^1da177e4c3f41 Linus Torvalds 2005-04-16 140 hubii_wcr_t ii_wcr;
^1da177e4c3f41 Linus Torvalds 2005-04-16 141 unsigned i;
^1da177e4c3f41 Linus Torvalds 2005-04-16 142
^1da177e4c3f41 Linus Torvalds 2005-04-16 143 ii_iowa = REMOTE_HUB_L(nasid, IIO_OUTWIDGET_ACCESS);
^1da177e4c3f41 Linus Torvalds 2005-04-16 144 REMOTE_HUB_S(nasid, IIO_OUTWIDGET_ACCESS, 0);
^1da177e4c3f41 Linus Torvalds 2005-04-16 145
^1da177e4c3f41 Linus Torvalds 2005-04-16 146 ii_wcr.wcr_reg_value = REMOTE_HUB_L(nasid, IIO_WCR);
^1da177e4c3f41 Linus Torvalds 2005-04-16 147
^1da177e4c3f41 Linus Torvalds 2005-04-16 148 if (ii_wcr.iwcr_dir_con) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 149 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 150 * Assume a bridge here.
^1da177e4c3f41 Linus Torvalds 2005-04-16 151 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 152 hub_setup_prb(nasid, 0, 3);
^1da177e4c3f41 Linus Torvalds 2005-04-16 153 } else {
^1da177e4c3f41 Linus Torvalds 2005-04-16 154 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 155 * Assume a crossbow here.
^1da177e4c3f41 Linus Torvalds 2005-04-16 156 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 157 hub_setup_prb(nasid, 0, 1);
^1da177e4c3f41 Linus Torvalds 2005-04-16 158 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 159
^1da177e4c3f41 Linus Torvalds 2005-04-16 160 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 161 * XXX - Here's where we should take the widget type into
^1da177e4c3f41 Linus Torvalds 2005-04-16 162 * when account assigning credits.
^1da177e4c3f41 Linus Torvalds 2005-04-16 163 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 164 for (i = HUB_WIDGET_ID_MIN; i <= HUB_WIDGET_ID_MAX; i++)
^1da177e4c3f41 Linus Torvalds 2005-04-16 165 hub_setup_prb(nasid, i, 3);
^1da177e4c3f41 Linus Torvalds 2005-04-16 166
^1da177e4c3f41 Linus Torvalds 2005-04-16 167 REMOTE_HUB_S(nasid, IIO_OUTWIDGET_ACCESS, ii_iowa);
^1da177e4c3f41 Linus Torvalds 2005-04-16 168 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 169
^1da177e4c3f41 Linus Torvalds 2005-04-16 170 /*
603e82edf78ad6 Joe Perches 2008-02-03 171 * hub_pio_init - PIO-related hub initialization
^1da177e4c3f41 Linus Torvalds 2005-04-16 172 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 173 * @hub: hubinfo structure for our hub
^1da177e4c3f41 Linus Torvalds 2005-04-16 174 */
4bf841ebf17aaa Thomas Bogendoerfer 2019-10-03 @175 void hub_pio_init(nasid_t nasid)
:::::: The code at line 30 was first introduced by commit
:::::: 4bf841ebf17aaa0f7712623896c699b44fa92f44 MIPS: SGI-IP27: get rid of compact node ids
:::::: TO: Thomas Bogendoerfer <tbogendoerfer@...e.de>
:::::: CC: Paul Burton <paul.burton@...s.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (17446 bytes)
Powered by blists - more mailing lists