hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/misc/hpilo.c
....@@ -29,6 +29,13 @@
2929 static unsigned int ilo_major;
3030 static unsigned int max_ccb = 16;
3131 static char ilo_hwdev[MAX_ILO_DEV];
32
+static const struct pci_device_id ilo_blacklist[] = {
33
+ /* auxiliary iLO */
34
+ {PCI_DEVICE_SUB(PCI_VENDOR_ID_HP, 0x3307, PCI_VENDOR_ID_HP, 0x1979)},
35
+ /* CL */
36
+ {PCI_DEVICE_SUB(PCI_VENDOR_ID_HP, 0x3307, PCI_VENDOR_ID_HP_3PAR, 0x0289)},
37
+ {}
38
+};
3239
3340 static inline int get_entry_id(int entry)
3441 {
....@@ -200,7 +207,7 @@
200207 static inline int fifo_sz(int nr_entry)
201208 {
202209 /* size of a fifo is determined by the number of entries it contains */
203
- return (nr_entry * sizeof(u64)) + FIFOHANDLESIZE;
210
+ return nr_entry * sizeof(u64) + FIFOHANDLESIZE;
204211 }
205212
206213 static void fifo_setup(void *base_addr, int nr_entry)
....@@ -249,7 +256,8 @@
249256 memset_io(device_ccb, 0, sizeof(struct ccb));
250257
251258 /* free resources used to back send/recv queues */
252
- pci_free_consistent(pdev, data->dma_size, data->dma_va, data->dma_pa);
259
+ dma_free_coherent(&pdev->dev, data->dma_size, data->dma_va,
260
+ data->dma_pa);
253261 }
254262
255263 static int ilo_ccb_setup(struct ilo_hwinfo *hw, struct ccb_data *data, int slot)
....@@ -265,15 +273,13 @@
265273 2 * desc_mem_sz(NR_QENTRY) +
266274 ILO_START_ALIGN + ILO_CACHE_SZ;
267275
268
- data->dma_va = pci_alloc_consistent(hw->ilo_dev, data->dma_size,
269
- &data->dma_pa);
276
+ data->dma_va = dma_alloc_coherent(&hw->ilo_dev->dev, data->dma_size,
277
+ &data->dma_pa, GFP_ATOMIC);
270278 if (!data->dma_va)
271279 return -ENOMEM;
272280
273281 dma_va = (char *)data->dma_va;
274282 dma_pa = data->dma_pa;
275
-
276
- memset(dma_va, 0, data->dma_size);
277283
278284 dma_va = (char *)roundup((unsigned long)dma_va, ILO_START_ALIGN);
279285 dma_pa = roundup(dma_pa, ILO_START_ALIGN);
....@@ -763,9 +769,10 @@
763769 int devnum, minor, start, error = 0;
764770 struct ilo_hwinfo *ilo_hw;
765771
766
- /* Ignore subsystem_device = 0x1979 (set by BIOS) */
767
- if (pdev->subsystem_device == 0x1979)
768
- return 0;
772
+ if (pci_match_id(ilo_blacklist, pdev)) {
773
+ dev_dbg(&pdev->dev, "Not supported on this device\n");
774
+ return -ENODEV;
775
+ }
769776
770777 if (max_ccb > MAX_CCB)
771778 max_ccb = MAX_CCB;