* [vireshk:virtio/msg-amp 19/22] drivers/virtio/virtio_msg_amp_sapphire.c:148:68: warning: right shift count >= width of type
@ 2026-04-07 7:47 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-04-07 7:47 UTC (permalink / raw)
To: Viresh Kumar; +Cc: oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vireshk/linux.git virtio/msg-amp
head: c94ce1567e36856cc5599c0cf2f1c7d75dcc3624
commit: 2072a647262622503b0540c495939b216bba8bf9 [19/22] virtio: msg: Add Sapphire PCI transport driver for virtio-msg AMP
config: csky-allmodconfig (https://download.01.org/0day-ci/archive/20260407/202604071503.P9DtQ1Ps-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260407/202604071503.P9DtQ1Ps-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202604071503.P9DtQ1Ps-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/virtio/virtio_msg_amp_sapphire.c: In function 'vmamp_sap_probe':
>> drivers/virtio/virtio_msg_amp_sapphire.c:148:68: warning: right shift count >= width of type [-Wshift-count-overflow]
148 | vmamp_sap->cfg_bram[0x4000 / 4 + 2] = vmamp_sap->shmem_dma >> 32;
| ^~
vim +148 drivers/virtio/virtio_msg_amp_sapphire.c
59
60 static int vmamp_sap_probe(struct pci_dev *pdev, const struct pci_device_id *id)
61 {
62 struct vmamp_sap *vmamp_sap;
63 resource_size_t size;
64 void __iomem * const *bar;
65 phys_addr_t addr;
66 int ret, i;
67
68 vmamp_sap = devm_kzalloc(&pdev->dev, sizeof(struct vmamp_sap),
69 GFP_KERNEL);
70 if (!vmamp_sap) {
71 ret = -ENOMEM;
72 goto error;
73 }
74
75 ret = pcim_enable_device(pdev);
76 if (ret)
77 goto error;
78
79 ret = pcim_iomap_regions(pdev, BIT(0) | BIT(1), dev_name(&pdev->dev));
80 if (ret)
81 goto error;
82
83 for (i = 0; i < 2; i++) {
84 addr = pci_resource_start(pdev, i);
85 size = pci_resource_len(pdev, i);
86 dev_dbg(&pdev->dev, "msix (BAR%d) at %pa, size %pr\n", i, &addr,
87 &size);
88 }
89
90 bar = pcim_iomap_table(pdev);
91 if (!bar) {
92 ret = -ENOMEM;
93 goto error;
94 }
95
96 vmamp_sap->cfg_bram = bar[1];
97 vmamp_sap->regs = (void __iomem *)((u8 __iomem *)bar[1] + 0x50000);
98
99 /*
100 * Grab all vectors although we can only coalesce them into a single
101 * notifier. This avoids missing any event.
102 */
103 vmamp_sap->vectors = pci_msix_vec_count(pdev);
104 if (vmamp_sap->vectors < 0)
105 vmamp_sap->vectors = 1;
106
107 ret = pci_alloc_irq_vectors(pdev, vmamp_sap->vectors,
108 vmamp_sap->vectors,
109 PCI_IRQ_INTX | PCI_IRQ_MSIX);
110 if (ret < 0)
111 goto error;
112
113 for (i = 0; i < vmamp_sap->vectors; i++) {
114 ret = request_irq(pci_irq_vector(pdev, i), irq_handler,
115 IRQF_SHARED, dev_name(&pdev->dev), vmamp_sap);
116 if (ret)
117 goto free_irq;
118 }
119
120 vmamp_sap->vmamp.dev = &pdev->dev;
121 vmamp_sap->vmamp.ops = &vmamp_sap_ops;
122 pci_set_drvdata(pdev, vmamp_sap);
123 pci_set_master(pdev);
124
125 vmamp_sap->vmamp.shmem_size = 8 * 1024;
126 vmamp_sap->vmamp.shmem = dma_alloc_coherent(&pdev->dev,
127 vmamp_sap->vmamp.shmem_size,
128 &vmamp_sap->shmem_dma,
129 GFP_KERNEL);
130 if (!vmamp_sap->vmamp.shmem) {
131 ret = -ENOMEM;
132 goto clear_master;
133 }
134
135 memset(vmamp_sap->vmamp.shmem, 0, vmamp_sap->vmamp.shmem_size);
136
137 hrtimer_setup(&vmamp_sap->poll, &poll_timer_expired, CLOCK_MONOTONIC,
138 HRTIMER_MODE_REL);
139 // hrtimer_start(&vmamp_sap->poll, ms_to_ktime(50), HRTIMER_MODE_REL);
140
141 ret = virtio_msg_amp_register(&vmamp_sap->vmamp);
142 if (ret)
143 goto free_shmem;
144
145 // hrtimer_cancel(&vmamp_sap->poll);
146
147 vmamp_sap->cfg_bram[0x4000 / 4 + 1] = vmamp_sap->shmem_dma;
> 148 vmamp_sap->cfg_bram[0x4000 / 4 + 2] = vmamp_sap->shmem_dma >> 32;
149 smp_wmb();
150 vmamp_sap->cfg_bram[0x4000 / 4 + 0] = 1;
151
152 return 0;
153
154 free_shmem:
155 dma_free_coherent(&pdev->dev, vmamp_sap->vmamp.shmem_size,
156 vmamp_sap->vmamp.shmem, vmamp_sap->shmem_dma);
157 clear_master:
158 pci_clear_master(pdev);
159 free_irq:
160 while (--i >= 0)
161 free_irq(pci_irq_vector(pdev, i), vmamp_sap);
162 pci_free_irq_vectors(pdev);
163
164 error:
165 dev_info(&pdev->dev, "probe failed: %d\n", ret);
166 return ret;
167 }
168
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-04-07 7:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-07 7:47 [vireshk:virtio/msg-amp 19/22] drivers/virtio/virtio_msg_amp_sapphire.c:148:68: warning: right shift count >= width of type kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.