hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/char/agp/parisc-agp.c
....@@ -90,6 +90,9 @@
9090 {
9191 struct _parisc_agp_info *info = &parisc_agp_info;
9292
93
+ /* force fdc ops to be visible to IOMMU */
94
+ asm_io_sync();
95
+
9396 writeq(info->gart_base | ilog2(info->gart_size), info->ioc_regs+IOC_PCOM);
9497 readq(info->ioc_regs+IOC_PCOM); /* flush */
9598 }
....@@ -158,6 +161,7 @@
158161 info->gatt[j] =
159162 parisc_agp_mask_memory(agp_bridge,
160163 paddr, type);
164
+ asm_io_fdc(&info->gatt[j]);
161165 }
162166 }
163167
....@@ -191,7 +195,16 @@
191195 parisc_agp_mask_memory(struct agp_bridge_data *bridge, dma_addr_t addr,
192196 int type)
193197 {
194
- return SBA_PDIR_VALID_BIT | addr;
198
+ unsigned ci; /* coherent index */
199
+ dma_addr_t pa;
200
+
201
+ pa = addr & IOVP_MASK;
202
+ asm("lci 0(%1), %0" : "=r" (ci) : "r" (phys_to_virt(pa)));
203
+
204
+ pa |= (ci >> PAGE_SHIFT) & 0xff;/* move CI (8 bits) into lowest byte */
205
+ pa |= SBA_PDIR_VALID_BIT; /* set "valid" bit */
206
+
207
+ return cpu_to_le64(pa);
195208 }
196209
197210 static void
....@@ -381,8 +394,6 @@
381394 static int __init
382395 parisc_agp_init(void)
383396 {
384
- extern struct sba_device *sba_list;
385
-
386397 int err = -1;
387398 struct parisc_device *sba = NULL, *lba = NULL;
388399 struct lba_device *lbadev = NULL;