[sashal-linux-stable:queue-5.4 55/132] drivers/usb/gadget/udc/tegra-xudc.c:611:2: error: implicit declaration of function 'tegra_xusb_padctl_set_vbus_override'; did you mean
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-5.4
head: d2c5af89e80c5b71f1da59879464a930947306a2
commit: 677684bdcc9f12acfd230bf92e68595987cdca56 [55/132] usb: gadget: Add UDC driver for tegra XUSB device mode controller
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-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
# https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/c...
git remote add sashal-linux-stable https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable queue-5.4
git checkout 677684bdcc9f12acfd230bf92e68595987cdca56
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
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/usb/gadget/udc/tegra-xudc.c: In function 'tegra_xudc_device_mode_on':
>> drivers/usb/gadget/udc/tegra-xudc.c:611:2: error: implicit declaration of function 'tegra_xusb_padctl_set_vbus_override'; did you mean 'tegra_xusb_padctl_hsic_set_idle'? [-Werror=implicit-function-declaration]
611 | tegra_xusb_padctl_set_vbus_override(xudc->padctl, true);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| tegra_xusb_padctl_hsic_set_idle
drivers/usb/gadget/udc/tegra-xudc.c: In function 'tegra_xudc_port_reset_war_work':
>> drivers/usb/gadget/udc/tegra-xudc.c:741:10: error: implicit declaration of function 'tegra_phy_xusb_utmi_port_reset' [-Werror=implicit-function-declaration]
741 | ret = tegra_phy_xusb_utmi_port_reset(xudc->utmi_phy);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +611 drivers/usb/gadget/udc/tegra-xudc.c
594
595 static void tegra_xudc_device_mode_on(struct tegra_xudc *xudc)
596 {
597 int err;
598
599 pm_runtime_get_sync(xudc->dev);
600
601 err = phy_power_on(xudc->utmi_phy);
602 if (err < 0)
603 dev_err(xudc->dev, "utmi power on failed %d\n", err);
604
605 err = phy_power_on(xudc->usb3_phy);
606 if (err < 0)
607 dev_err(xudc->dev, "usb3 phy power on failed %d\n", err);
608
609 dev_dbg(xudc->dev, "device mode on\n");
610
> 611 tegra_xusb_padctl_set_vbus_override(xudc->padctl, true);
612
613 xudc->device_mode = USB_ROLE_DEVICE;
614 }
615
616 static void tegra_xudc_device_mode_off(struct tegra_xudc *xudc)
617 {
618 bool connected = false;
619 u32 pls, val;
620 int err;
621
622 dev_dbg(xudc->dev, "device mode off\n");
623
624 connected = !!(xudc_readl(xudc, PORTSC) & PORTSC_CCS);
625
626 reinit_completion(&xudc->disconnect_complete);
627
628 tegra_xusb_padctl_set_vbus_override(xudc->padctl, false);
629
630 pls = (xudc_readl(xudc, PORTSC) & PORTSC_PLS_MASK) >>
631 PORTSC_PLS_SHIFT;
632
633 /* Direct link to U0 if disconnected in RESUME or U2. */
634 if (xudc->soc->pls_quirk && xudc->gadget.speed == USB_SPEED_SUPER &&
635 (pls == PORTSC_PLS_RESUME || pls == PORTSC_PLS_U2)) {
636 val = xudc_readl(xudc, PORTPM);
637 val |= PORTPM_FRWE;
638 xudc_writel(xudc, val, PORTPM);
639
640 val = xudc_readl(xudc, PORTSC);
641 val &= ~(PORTSC_CHANGE_MASK | PORTSC_PLS_MASK);
642 val |= PORTSC_LWS | PORTSC_PLS(PORTSC_PLS_U0);
643 xudc_writel(xudc, val, PORTSC);
644 }
645
646 xudc->device_mode = USB_ROLE_NONE;
647
648 /* Wait for disconnect event. */
649 if (connected)
650 wait_for_completion(&xudc->disconnect_complete);
651
652 /* Make sure interrupt handler has completed before powergating. */
653 synchronize_irq(xudc->irq);
654
655 err = phy_power_off(xudc->utmi_phy);
656 if (err < 0)
657 dev_err(xudc->dev, "utmi_phy power off failed %d\n", err);
658
659 err = phy_power_off(xudc->usb3_phy);
660 if (err < 0)
661 dev_err(xudc->dev, "usb3_phy power off failed %d\n", err);
662
663 pm_runtime_put(xudc->dev);
664 }
665
666 static void tegra_xudc_usb_role_sw_work(struct work_struct *work)
667 {
668 struct tegra_xudc *xudc = container_of(work, struct tegra_xudc,
669 usb_role_sw_work);
670
671 if (!xudc->usb_role_sw ||
672 usb_role_switch_get_role(xudc->usb_role_sw) == USB_ROLE_DEVICE)
673 tegra_xudc_device_mode_on(xudc);
674 else
675 tegra_xudc_device_mode_off(xudc);
676
677 }
678
679 static int tegra_xudc_usb_role_sw_set(struct device *dev, enum usb_role role)
680 {
681 struct tegra_xudc *xudc = dev_get_drvdata(dev);
682 unsigned long flags;
683
684 dev_dbg(dev, "%s role is %d\n", __func__, role);
685
686 spin_lock_irqsave(&xudc->lock, flags);
687
688 if (!xudc->suspended)
689 schedule_work(&xudc->usb_role_sw_work);
690
691 spin_unlock_irqrestore(&xudc->lock, flags);
692
693 return 0;
694 }
695
696 static void tegra_xudc_plc_reset_work(struct work_struct *work)
697 {
698 struct delayed_work *dwork = to_delayed_work(work);
699 struct tegra_xudc *xudc = container_of(dwork, struct tegra_xudc,
700 plc_reset_work);
701 unsigned long flags;
702
703 spin_lock_irqsave(&xudc->lock, flags);
704
705 if (xudc->wait_csc) {
706 u32 pls = (xudc_readl(xudc, PORTSC) & PORTSC_PLS_MASK) >>
707 PORTSC_PLS_SHIFT;
708
709 if (pls == PORTSC_PLS_INACTIVE) {
710 dev_info(xudc->dev, "PLS = Inactive. Toggle VBUS\n");
711 tegra_xusb_padctl_set_vbus_override(xudc->padctl,
712 false);
713 tegra_xusb_padctl_set_vbus_override(xudc->padctl, true);
714 xudc->wait_csc = false;
715 }
716 }
717
718 spin_unlock_irqrestore(&xudc->lock, flags);
719 }
720
721 static void tegra_xudc_port_reset_war_work(struct work_struct *work)
722 {
723 struct delayed_work *dwork = to_delayed_work(work);
724 struct tegra_xudc *xudc =
725 container_of(dwork, struct tegra_xudc, port_reset_war_work);
726 unsigned long flags;
727 u32 pls;
728 int ret;
729
730 spin_lock_irqsave(&xudc->lock, flags);
731
732 if ((xudc->device_mode == USB_ROLE_DEVICE)
733 && xudc->wait_for_sec_prc) {
734 pls = (xudc_readl(xudc, PORTSC) & PORTSC_PLS_MASK) >>
735 PORTSC_PLS_SHIFT;
736 dev_dbg(xudc->dev, "pls = %x\n", pls);
737
738 if (pls == PORTSC_PLS_DISABLED) {
739 dev_dbg(xudc->dev, "toggle vbus\n");
740 /* PRC doesn't complete in 100ms, toggle the vbus */
> 741 ret = tegra_phy_xusb_utmi_port_reset(xudc->utmi_phy);
742 if (ret == 1)
743 xudc->wait_for_sec_prc = 0;
744 }
745 }
746
747 spin_unlock_irqrestore(&xudc->lock, flags);
748 }
749
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[sashal-linux-stable:queue-5.4 43/132] drivers/iio/adc/ad_sigma_delta.c:73:3: error: implicit declaration of function 'put_unaligned_be24'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-5.4
head: d2c5af89e80c5b71f1da59879464a930947306a2
commit: e16974f4fabeef9d0431762b387da9f2374ffad8 [43/132] iio: adc: ad_sigma_delta: Use {get,put}_unaligned_be24()
config: arm-randconfig-r023-20210318 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 436c6c9c20cc522c92a923440a5fc509c342a7db)
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
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/c...
git remote add sashal-linux-stable https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable queue-5.4
git checkout e16974f4fabeef9d0431762b387da9f2374ffad8
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm
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/iio/adc/ad_sigma_delta.c:73:3: error: implicit declaration of function 'put_unaligned_be24' [-Werror,-Wimplicit-function-declaration]
put_unaligned_be24(val, &data[1]);
^
drivers/iio/adc/ad_sigma_delta.c:73:3: note: did you mean 'put_unaligned_be64'?
include/linux/unaligned/be_byteshift.h:66:20: note: 'put_unaligned_be64' declared here
static inline void put_unaligned_be64(u64 val, void *p)
^
>> drivers/iio/adc/ad_sigma_delta.c:158:10: error: implicit declaration of function 'get_unaligned_be24' [-Werror,-Wimplicit-function-declaration]
*val = get_unaligned_be24(&sigma_delta->data[0]);
^
drivers/iio/adc/ad_sigma_delta.c:158:10: note: did you mean 'get_unaligned_be64'?
include/linux/unaligned/be_byteshift.h:51:19: note: 'get_unaligned_be64' declared here
static inline u64 get_unaligned_be64(const void *p)
^
2 errors generated.
vim +/put_unaligned_be24 +73 drivers/iio/adc/ad_sigma_delta.c
46
47 /**
48 * ad_sd_write_reg() - Write a register
49 *
50 * @sigma_delta: The sigma delta device
51 * @reg: Address of the register
52 * @size: Size of the register (0-3)
53 * @val: Value to write to the register
54 *
55 * Returns 0 on success, an error code otherwise.
56 **/
57 int ad_sd_write_reg(struct ad_sigma_delta *sigma_delta, unsigned int reg,
58 unsigned int size, unsigned int val)
59 {
60 uint8_t *data = sigma_delta->data;
61 struct spi_transfer t = {
62 .tx_buf = data,
63 .len = size + 1,
64 .cs_change = sigma_delta->keep_cs_asserted,
65 };
66 struct spi_message m;
67 int ret;
68
69 data[0] = (reg << sigma_delta->info->addr_shift) | sigma_delta->comm;
70
71 switch (size) {
72 case 3:
> 73 put_unaligned_be24(val, &data[1]);
74 break;
75 case 2:
76 put_unaligned_be16(val, &data[1]);
77 break;
78 case 1:
79 data[1] = val;
80 break;
81 case 0:
82 break;
83 default:
84 return -EINVAL;
85 }
86
87 spi_message_init(&m);
88 spi_message_add_tail(&t, &m);
89
90 if (sigma_delta->bus_locked)
91 ret = spi_sync_locked(sigma_delta->spi, &m);
92 else
93 ret = spi_sync(sigma_delta->spi, &m);
94
95 return ret;
96 }
97 EXPORT_SYMBOL_GPL(ad_sd_write_reg);
98
99 static int ad_sd_read_reg_raw(struct ad_sigma_delta *sigma_delta,
100 unsigned int reg, unsigned int size, uint8_t *val)
101 {
102 uint8_t *data = sigma_delta->data;
103 int ret;
104 struct spi_transfer t[] = {
105 {
106 .tx_buf = data,
107 .len = 1,
108 }, {
109 .rx_buf = val,
110 .len = size,
111 .cs_change = sigma_delta->bus_locked,
112 },
113 };
114 struct spi_message m;
115
116 spi_message_init(&m);
117
118 if (sigma_delta->info->has_registers) {
119 data[0] = reg << sigma_delta->info->addr_shift;
120 data[0] |= sigma_delta->info->read_mask;
121 data[0] |= sigma_delta->comm;
122 spi_message_add_tail(&t[0], &m);
123 }
124 spi_message_add_tail(&t[1], &m);
125
126 if (sigma_delta->bus_locked)
127 ret = spi_sync_locked(sigma_delta->spi, &m);
128 else
129 ret = spi_sync(sigma_delta->spi, &m);
130
131 return ret;
132 }
133
134 /**
135 * ad_sd_read_reg() - Read a register
136 *
137 * @sigma_delta: The sigma delta device
138 * @reg: Address of the register
139 * @size: Size of the register (1-4)
140 * @val: Read value
141 *
142 * Returns 0 on success, an error code otherwise.
143 **/
144 int ad_sd_read_reg(struct ad_sigma_delta *sigma_delta,
145 unsigned int reg, unsigned int size, unsigned int *val)
146 {
147 int ret;
148
149 ret = ad_sd_read_reg_raw(sigma_delta, reg, size, sigma_delta->data);
150 if (ret < 0)
151 goto out;
152
153 switch (size) {
154 case 4:
155 *val = get_unaligned_be32(sigma_delta->data);
156 break;
157 case 3:
> 158 *val = get_unaligned_be24(&sigma_delta->data[0]);
159 break;
160 case 2:
161 *val = get_unaligned_be16(sigma_delta->data);
162 break;
163 case 1:
164 *val = sigma_delta->data[0];
165 break;
166 default:
167 ret = -EINVAL;
168 break;
169 }
170
171 out:
172 return ret;
173 }
174 EXPORT_SYMBOL_GPL(ad_sd_read_reg);
175
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[sashal-linux-stable:queue-5.4 99/132] drivers/crypto/sunxi-ss/sun4i-ss-cipher.c:130:4: error: implicit declaration of function 'kfree_sensitive'; did you mean
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-5.4
head: d2c5af89e80c5b71f1da59879464a930947306a2
commit: 0e90a65d5e66810afc4d1a60a234138f90badb1e [99/132] crypto: sun4i-ss - IV register does not work on A10 and A13
config: arm-defconfig (attached as .config)
compiler: arm-linux-gnueabi-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
# https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/c...
git remote add sashal-linux-stable https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable queue-5.4
git checkout 0e90a65d5e66810afc4d1a60a234138f90badb1e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
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/crypto/sunxi-ss/sun4i-ss-cipher.c: In function 'sun4i_ss_opti_poll':
>> drivers/crypto/sunxi-ss/sun4i-ss-cipher.c:130:4: error: implicit declaration of function 'kfree_sensitive'; did you mean 'kvfree_sensitive'? [-Werror=implicit-function-declaration]
130 | kfree_sensitive(backup_iv);
| ^~~~~~~~~~~~~~~
| kvfree_sensitive
cc1: some warnings being treated as errors
vim +130 drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
14
15 static int noinline_for_stack sun4i_ss_opti_poll(struct skcipher_request *areq)
16 {
17 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(areq);
18 struct sun4i_tfm_ctx *op = crypto_skcipher_ctx(tfm);
19 struct sun4i_ss_ctx *ss = op->ss;
20 unsigned int ivsize = crypto_skcipher_ivsize(tfm);
21 struct sun4i_cipher_req_ctx *ctx = skcipher_request_ctx(areq);
22 u32 mode = ctx->mode;
23 void *backup_iv = NULL;
24 /* when activating SS, the default FIFO space is SS_RX_DEFAULT(32) */
25 u32 rx_cnt = SS_RX_DEFAULT;
26 u32 tx_cnt = 0;
27 u32 spaces;
28 u32 v;
29 int err = 0;
30 unsigned int i;
31 unsigned int ileft = areq->cryptlen;
32 unsigned int oleft = areq->cryptlen;
33 unsigned int todo;
34 unsigned long pi = 0, po = 0; /* progress for in and out */
35 bool miter_err;
36 struct sg_mapping_iter mi, mo;
37 unsigned int oi, oo; /* offset for in and out */
38 unsigned long flags;
39
40 if (!areq->cryptlen)
41 return 0;
42
43 if (!areq->src || !areq->dst) {
44 dev_err_ratelimited(ss->dev, "ERROR: Some SGs are NULL\n");
45 return -EINVAL;
46 }
47
48 if (areq->iv && ivsize > 0 && mode & SS_DECRYPTION) {
49 backup_iv = kzalloc(ivsize, GFP_KERNEL);
50 if (!backup_iv)
51 return -ENOMEM;
52 scatterwalk_map_and_copy(backup_iv, areq->src, areq->cryptlen - ivsize, ivsize, 0);
53 }
54
55 spin_lock_irqsave(&ss->slock, flags);
56
57 for (i = 0; i < op->keylen / 4; i++)
58 writesl(ss->base + SS_KEY0 + i * 4, &op->key[i], 1);
59
60 if (areq->iv) {
61 for (i = 0; i < 4 && i < ivsize / 4; i++) {
62 v = *(u32 *)(areq->iv + i * 4);
63 writesl(ss->base + SS_IV0 + i * 4, &v, 1);
64 }
65 }
66 writel(mode, ss->base + SS_CTL);
67
68
69 ileft = areq->cryptlen / 4;
70 oleft = areq->cryptlen / 4;
71 oi = 0;
72 oo = 0;
73 do {
74 if (ileft) {
75 sg_miter_start(&mi, areq->src, sg_nents(areq->src),
76 SG_MITER_FROM_SG | SG_MITER_ATOMIC);
77 if (pi)
78 sg_miter_skip(&mi, pi);
79 miter_err = sg_miter_next(&mi);
80 if (!miter_err || !mi.addr) {
81 dev_err_ratelimited(ss->dev, "ERROR: sg_miter return null\n");
82 err = -EINVAL;
83 goto release_ss;
84 }
85 todo = min(rx_cnt, ileft);
86 todo = min_t(size_t, todo, (mi.length - oi) / 4);
87 if (todo) {
88 ileft -= todo;
89 writesl(ss->base + SS_RXFIFO, mi.addr + oi, todo);
90 oi += todo * 4;
91 }
92 if (oi == mi.length) {
93 pi += mi.length;
94 oi = 0;
95 }
96 sg_miter_stop(&mi);
97 }
98
99 spaces = readl(ss->base + SS_FCSR);
100 rx_cnt = SS_RXFIFO_SPACES(spaces);
101 tx_cnt = SS_TXFIFO_SPACES(spaces);
102
103 sg_miter_start(&mo, areq->dst, sg_nents(areq->dst),
104 SG_MITER_TO_SG | SG_MITER_ATOMIC);
105 if (po)
106 sg_miter_skip(&mo, po);
107 miter_err = sg_miter_next(&mo);
108 if (!miter_err || !mo.addr) {
109 dev_err_ratelimited(ss->dev, "ERROR: sg_miter return null\n");
110 err = -EINVAL;
111 goto release_ss;
112 }
113 todo = min(tx_cnt, oleft);
114 todo = min_t(size_t, todo, (mo.length - oo) / 4);
115 if (todo) {
116 oleft -= todo;
117 readsl(ss->base + SS_TXFIFO, mo.addr + oo, todo);
118 oo += todo * 4;
119 }
120 if (oo == mo.length) {
121 oo = 0;
122 po += mo.length;
123 }
124 sg_miter_stop(&mo);
125 } while (oleft);
126
127 if (areq->iv) {
128 if (mode & SS_DECRYPTION) {
129 memcpy(areq->iv, backup_iv, ivsize);
> 130 kfree_sensitive(backup_iv);
131 } else {
132 scatterwalk_map_and_copy(areq->iv, areq->dst, areq->cryptlen - ivsize,
133 ivsize, 0);
134 }
135 }
136
137 release_ss:
138 writel(0, ss->base + SS_CTL);
139 spin_unlock_irqrestore(&ss->slock, flags);
140 return err;
141 }
142
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[arnd-playground:randconfig-v5.12 323/597] drivers/soc/ixp4xx/ixp4xx-qmgr.c:149:37: sparse: sparse: dereference of noderef expression
by kernel test robot
Hi Arnd,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git randconfig-v5.12
head: fd21c2581b744639b5207c11651ab40abf13701a
commit: c43a5a05c0cd6cc79fa4cf9400d94faf4f663b6f [323/597] fixup warnings
config: sparc64-randconfig-s031-20210318 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-277-gc089cd2d-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/commi...
git remote add arnd-playground https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git
git fetch --no-tags arnd-playground randconfig-v5.12
git checkout c43a5a05c0cd6cc79fa4cf9400d94faf4f663b6f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=sparc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/soc/ixp4xx/ixp4xx-qmgr.c:149:37: sparse: sparse: dereference of noderef expression
drivers/soc/ixp4xx/ixp4xx-qmgr.c:153:40: sparse: sparse: dereference of noderef expression
drivers/soc/ixp4xx/ixp4xx-qmgr.c:154:40: sparse: sparse: dereference of noderef expression
drivers/soc/ixp4xx/ixp4xx-qmgr.c:174:38: sparse: sparse: dereference of noderef expression
drivers/soc/ixp4xx/ixp4xx-qmgr.c:174:44: sparse: sparse: dereference of noderef expression
vim +149 drivers/soc/ixp4xx/ixp4xx-qmgr.c
82a96f5790ac93 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Halasa 2008-01-01 139
82a96f5790ac93 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Halasa 2008-01-01 140
d4c9e9fc975155 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-05-23 141 static irqreturn_t qmgr_irq1_a0(int irq, void *pdev)
d4c9e9fc975155 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-05-23 142 {
d4c9e9fc975155 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-05-23 143 int i, ret = 0;
0771c6939484d2 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-04-28 144 u32 en_bitmap, src, stat;
d4c9e9fc975155 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-05-23 145
d4c9e9fc975155 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-05-23 146 /* ACK - it may clear any bits so don't rely on it */
d4c9e9fc975155 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-05-23 147 __raw_writel(0xFFFFFFFF, &qmgr_regs->irqstat[0]);
d4c9e9fc975155 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-05-23 148
0771c6939484d2 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-04-28 @149 en_bitmap = qmgr_regs->irqen[0];
0771c6939484d2 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-04-28 150 while (en_bitmap) {
0771c6939484d2 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-04-28 151 i = __fls(en_bitmap); /* number of the last "low" queue */
0771c6939484d2 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-04-28 152 en_bitmap &= ~BIT(i);
d4c9e9fc975155 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-05-23 153 src = qmgr_regs->irqsrc[i >> 3];
d4c9e9fc975155 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-05-23 154 stat = qmgr_regs->stat1[i >> 3];
d4c9e9fc975155 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-05-23 155 if (src & 4) /* the IRQ condition is inverted */
d4c9e9fc975155 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-05-23 156 stat = ~stat;
d4c9e9fc975155 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-05-23 157 if (stat & BIT(src & 3)) {
d4c9e9fc975155 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-05-23 158 irq_handlers[i](irq_pdevs[i]);
d4c9e9fc975155 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-05-23 159 ret = IRQ_HANDLED;
d4c9e9fc975155 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-05-23 160 }
d4c9e9fc975155 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-05-23 161 }
d4c9e9fc975155 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-05-23 162 return ret;
d4c9e9fc975155 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-05-23 163 }
d4c9e9fc975155 arch/arm/mach-ixp4xx/ixp4xx_qmgr.c Krzysztof Hałasa 2009-05-23 164
:::::: The code at line 149 was first introduced by commit
:::::: 0771c6939484d2ebe0ec28257c2570aecd9911e0 IXP42x: Use __fls() in QMgr interrupt handlers.
:::::: TO: Krzysztof Hałasa <khc(a)pm.waw.pl>
:::::: CC: Krzysztof Hałasa <khc(a)pm.waw.pl>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[thierryreding:for-5.13/work 21/49] drivers/gpu/drm/tegra/uapi/../drm.h:84:1: error: attempted to randomize userland API struct tegra_drm_client_ops
by kernel test robot
tree: https://github.com/thierryreding/linux for-5.13/work
head: 009ea3ee74a12859073a37d2ef800fa154ff7705
commit: 1997b739eee70f5f7a656a10c432ee395020f12a [21/49] drm/tegra: Implement new UAPI
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-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
# https://github.com/thierryreding/linux/commit/1997b739eee70f5f7a656a10c43...
git remote add thierryreding https://github.com/thierryreding/linux
git fetch --no-tags thierryreding for-5.13/work
git checkout 1997b739eee70f5f7a656a10c432ee395020f12a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
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/gpu/drm/tegra/uapi/uapi.c:12:
>> drivers/gpu/drm/tegra/uapi/../drm.h:84:1: error: attempted to randomize userland API struct tegra_drm_client_ops
84 | };
| ^
drivers/gpu/drm/tegra/uapi/uapi.c:62:5: warning: no previous prototype for 'close_channel_ctx' [-Wmissing-prototypes]
62 | int close_channel_ctx(int id, void *p, void *data)
| ^~~~~~~~~~~~~~~~~
vim +84 drivers/gpu/drm/tegra/uapi/../drm.h
d43f81cbaf4353 drivers/gpu/host1x/drm/drm.h Terje Bergstrom 2013-03-22 74
53fa7f7204c97d drivers/gpu/host1x/drm/drm.h Thierry Reding 2013-09-24 75 struct tegra_drm_client_ops {
53fa7f7204c97d drivers/gpu/host1x/drm/drm.h Thierry Reding 2013-09-24 76 int (*open_channel)(struct tegra_drm_client *client,
c88c363072c6dc drivers/gpu/host1x/drm/drm.h Thierry Reding 2013-09-26 77 struct tegra_drm_context *context);
c88c363072c6dc drivers/gpu/host1x/drm/drm.h Thierry Reding 2013-09-26 78 void (*close_channel)(struct tegra_drm_context *context);
c40f0f1afcb1dc drivers/gpu/drm/tegra/drm.h Thierry Reding 2013-10-10 79 int (*is_addr_reg)(struct device *dev, u32 class, u32 offset);
0f563a4bf66e51 drivers/gpu/drm/tegra/drm.h Dmitry Osipenko 2017-06-15 80 int (*is_valid_class)(u32 class);
c88c363072c6dc drivers/gpu/host1x/drm/drm.h Thierry Reding 2013-09-26 81 int (*submit)(struct tegra_drm_context *context,
d43f81cbaf4353 drivers/gpu/host1x/drm/drm.h Terje Bergstrom 2013-03-22 82 struct drm_tegra_submit *args, struct drm_device *drm,
d43f81cbaf4353 drivers/gpu/host1x/drm/drm.h Terje Bergstrom 2013-03-22 83 struct drm_file *file);
d43f81cbaf4353 drivers/gpu/host1x/drm/drm.h Terje Bergstrom 2013-03-22 @84 };
d43f81cbaf4353 drivers/gpu/host1x/drm/drm.h Terje Bergstrom 2013-03-22 85
:::::: The code at line 84 was first introduced by commit
:::::: d43f81cbaf43531a977e8b4c4427f19acf8a5061 drm/tegra: Add gr2d device
:::::: TO: Terje Bergstrom <tbergstrom(a)nvidia.com>
:::::: CC: Thierry Reding <thierry.reding(a)avionic-design.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[sashal-linux-stable:queue-5.4 116/132] fs/btrfs/inode.c:10982:7: error: implicit declaration of function 'btrfs_drew_try_write_lock'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-5.4
head: d2c5af89e80c5b71f1da59879464a930947306a2
commit: 5f6e061c42f11262ce5b8065b50d90aaa970939b [116/132] btrfs: fix race between swap file activation and snapshot creation
config: x86_64-randconfig-r033-20210318 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 436c6c9c20cc522c92a923440a5fc509c342a7db)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/c...
git remote add sashal-linux-stable https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable queue-5.4
git checkout 5f6e061c42f11262ce5b8065b50d90aaa970939b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross 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 >>):
>> fs/btrfs/inode.c:10982:7: error: implicit declaration of function 'btrfs_drew_try_write_lock' [-Werror,-Wimplicit-function-declaration]
if (!btrfs_drew_try_write_lock(&root->snapshot_lock)) {
^
fs/btrfs/inode.c:10982:7: note: did you mean 'btrfs_try_tree_write_lock'?
fs/btrfs/locking.h:24:5: note: 'btrfs_try_tree_write_lock' declared here
int btrfs_try_tree_write_lock(struct extent_buffer *eb);
^
>> fs/btrfs/inode.c:10982:40: error: no member named 'snapshot_lock' in 'struct btrfs_root'
if (!btrfs_drew_try_write_lock(&root->snapshot_lock)) {
~~~~ ^
>> fs/btrfs/inode.c:11129:2: error: implicit declaration of function 'btrfs_drew_write_unlock' [-Werror,-Wimplicit-function-declaration]
btrfs_drew_write_unlock(&root->snapshot_lock);
^
fs/btrfs/inode.c:11129:33: error: no member named 'snapshot_lock' in 'struct btrfs_root'
btrfs_drew_write_unlock(&root->snapshot_lock);
~~~~ ^
4 errors generated.
vim +/btrfs_drew_try_write_lock +10982 fs/btrfs/inode.c
10917
10918 static int btrfs_swap_activate(struct swap_info_struct *sis, struct file *file,
10919 sector_t *span)
10920 {
10921 struct inode *inode = file_inode(file);
10922 struct btrfs_root *root = BTRFS_I(inode)->root;
10923 struct btrfs_fs_info *fs_info = root->fs_info;
10924 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree;
10925 struct extent_state *cached_state = NULL;
10926 struct extent_map *em = NULL;
10927 struct btrfs_device *device = NULL;
10928 struct btrfs_swap_info bsi = {
10929 .lowest_ppage = (sector_t)-1ULL,
10930 };
10931 int ret = 0;
10932 u64 isize;
10933 u64 start;
10934
10935 /*
10936 * If the swap file was just created, make sure delalloc is done. If the
10937 * file changes again after this, the user is doing something stupid and
10938 * we don't really care.
10939 */
10940 ret = btrfs_wait_ordered_range(inode, 0, (u64)-1);
10941 if (ret)
10942 return ret;
10943
10944 /*
10945 * The inode is locked, so these flags won't change after we check them.
10946 */
10947 if (BTRFS_I(inode)->flags & BTRFS_INODE_COMPRESS) {
10948 btrfs_warn(fs_info, "swapfile must not be compressed");
10949 return -EINVAL;
10950 }
10951 if (!(BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW)) {
10952 btrfs_warn(fs_info, "swapfile must not be copy-on-write");
10953 return -EINVAL;
10954 }
10955 if (!(BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM)) {
10956 btrfs_warn(fs_info, "swapfile must not be checksummed");
10957 return -EINVAL;
10958 }
10959
10960 /*
10961 * Balance or device remove/replace/resize can move stuff around from
10962 * under us. The exclop protection makes sure they aren't running/won't
10963 * run concurrently while we are mapping the swap extents, and
10964 * fs_info->swapfile_pins prevents them from running while the swap
10965 * file is active and moving the extents. Note that this also prevents
10966 * a concurrent device add which isn't actually necessary, but it's not
10967 * really worth the trouble to allow it.
10968 */
10969 if (!btrfs_exclop_start(fs_info, BTRFS_EXCLOP_SWAP_ACTIVATE)) {
10970 btrfs_warn(fs_info,
10971 "cannot activate swapfile while exclusive operation is running");
10972 return -EBUSY;
10973 }
10974
10975 /*
10976 * Prevent snapshot creation while we are activating the swap file.
10977 * We do not want to race with snapshot creation. If snapshot creation
10978 * already started before we bumped nr_swapfiles from 0 to 1 and
10979 * completes before the first write into the swap file after it is
10980 * activated, than that write would fallback to COW.
10981 */
10982 if (!btrfs_drew_try_write_lock(&root->snapshot_lock)) {
10983 btrfs_exclop_finish(fs_info);
10984 btrfs_warn(fs_info,
10985 "cannot activate swapfile because snapshot creation is in progress");
10986 return -EINVAL;
10987 }
10988 /*
10989 * Snapshots can create extents which require COW even if NODATACOW is
10990 * set. We use this counter to prevent snapshots. We must increment it
10991 * before walking the extents because we don't want a concurrent
10992 * snapshot to run after we've already checked the extents.
10993 */
10994 atomic_inc(&root->nr_swapfiles);
10995
10996 isize = ALIGN_DOWN(inode->i_size, fs_info->sectorsize);
10997
10998 lock_extent_bits(io_tree, 0, isize - 1, &cached_state);
10999 start = 0;
11000 while (start < isize) {
11001 u64 logical_block_start, physical_block_start;
11002 struct btrfs_block_group_cache *bg;
11003 u64 len = isize - start;
11004
11005 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, start, len, 0);
11006 if (IS_ERR(em)) {
11007 ret = PTR_ERR(em);
11008 goto out;
11009 }
11010
11011 if (em->block_start == EXTENT_MAP_HOLE) {
11012 btrfs_warn(fs_info, "swapfile must not have holes");
11013 ret = -EINVAL;
11014 goto out;
11015 }
11016 if (em->block_start == EXTENT_MAP_INLINE) {
11017 /*
11018 * It's unlikely we'll ever actually find ourselves
11019 * here, as a file small enough to fit inline won't be
11020 * big enough to store more than the swap header, but in
11021 * case something changes in the future, let's catch it
11022 * here rather than later.
11023 */
11024 btrfs_warn(fs_info, "swapfile must not be inline");
11025 ret = -EINVAL;
11026 goto out;
11027 }
11028 if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags)) {
11029 btrfs_warn(fs_info, "swapfile must not be compressed");
11030 ret = -EINVAL;
11031 goto out;
11032 }
11033
11034 logical_block_start = em->block_start + (start - em->start);
11035 len = min(len, em->len - (start - em->start));
11036 free_extent_map(em);
11037 em = NULL;
11038
11039 ret = can_nocow_extent(inode, start, &len, NULL, NULL, NULL, true);
11040 if (ret < 0) {
11041 goto out;
11042 } else if (ret) {
11043 ret = 0;
11044 } else {
11045 btrfs_warn(fs_info,
11046 "swapfile must not be copy-on-write");
11047 ret = -EINVAL;
11048 goto out;
11049 }
11050
11051 em = btrfs_get_chunk_map(fs_info, logical_block_start, len);
11052 if (IS_ERR(em)) {
11053 ret = PTR_ERR(em);
11054 goto out;
11055 }
11056
11057 if (em->map_lookup->type & BTRFS_BLOCK_GROUP_PROFILE_MASK) {
11058 btrfs_warn(fs_info,
11059 "swapfile must have single data profile");
11060 ret = -EINVAL;
11061 goto out;
11062 }
11063
11064 if (device == NULL) {
11065 device = em->map_lookup->stripes[0].dev;
11066 ret = btrfs_add_swapfile_pin(inode, device, false);
11067 if (ret == 1)
11068 ret = 0;
11069 else if (ret)
11070 goto out;
11071 } else if (device != em->map_lookup->stripes[0].dev) {
11072 btrfs_warn(fs_info, "swapfile must be on one device");
11073 ret = -EINVAL;
11074 goto out;
11075 }
11076
11077 physical_block_start = (em->map_lookup->stripes[0].physical +
11078 (logical_block_start - em->start));
11079 len = min(len, em->len - (logical_block_start - em->start));
11080 free_extent_map(em);
11081 em = NULL;
11082
11083 bg = btrfs_lookup_block_group(fs_info, logical_block_start);
11084 if (!bg) {
11085 btrfs_warn(fs_info,
11086 "could not find block group containing swapfile");
11087 ret = -EINVAL;
11088 goto out;
11089 }
11090
11091 ret = btrfs_add_swapfile_pin(inode, bg, true);
11092 if (ret) {
11093 btrfs_put_block_group(bg);
11094 if (ret == 1)
11095 ret = 0;
11096 else
11097 goto out;
11098 }
11099
11100 if (bsi.block_len &&
11101 bsi.block_start + bsi.block_len == physical_block_start) {
11102 bsi.block_len += len;
11103 } else {
11104 if (bsi.block_len) {
11105 ret = btrfs_add_swap_extent(sis, &bsi);
11106 if (ret)
11107 goto out;
11108 }
11109 bsi.start = start;
11110 bsi.block_start = physical_block_start;
11111 bsi.block_len = len;
11112 }
11113
11114 start += len;
11115 }
11116
11117 if (bsi.block_len)
11118 ret = btrfs_add_swap_extent(sis, &bsi);
11119
11120 out:
11121 if (!IS_ERR_OR_NULL(em))
11122 free_extent_map(em);
11123
11124 unlock_extent_cached(io_tree, 0, isize - 1, &cached_state);
11125
11126 if (ret)
11127 btrfs_swap_deactivate(file);
11128
11129 btrfs_drew_write_unlock(&root->snapshot_lock);
11130
11131 btrfs_exclop_finish(fs_info);
11132
11133 if (ret)
11134 return ret;
11135
11136 if (device)
11137 sis->bdev = device->bdev;
11138 *span = bsi.highest_ppage - bsi.lowest_ppage + 1;
11139 sis->max = bsi.nr_pages;
11140 sis->pages = bsi.nr_pages - 1;
11141 sis->highest_bit = bsi.nr_pages - 1;
11142 return bsi.nr_extents;
11143 }
11144 #else
11145 static void btrfs_swap_deactivate(struct file *file)
11146 {
11147 }
11148
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months