Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sparc64: Propagate PCI device archdata into OF device tree for EBUS.

In order to convert EBUS drivers doing DMA into pure OF drivers,
we need the of_device->dev.archdata setup properly.

EBUS instances that can provide DMA for device nodes sit on PCI,
so detect and propagate the information there.

Signed-off-by: David S. Miller <davem@davemloft.net>

+6 -2
+6 -2
arch/sparc64/kernel/pci.c
··· 337 337 struct pci_bus *bus, int devfn) 338 338 { 339 339 struct dev_archdata *sd; 340 + struct of_device *op; 340 341 struct pci_dev *dev; 341 342 const char *type; 342 343 u32 class; ··· 351 350 sd->stc = &pbm->stc; 352 351 sd->host_controller = pbm; 353 352 sd->prom_node = node; 354 - sd->op = of_find_device_by_node(node); 353 + sd->op = op = of_find_device_by_node(node); 355 354 sd->numa_node = pbm->numa_node; 356 355 357 - sd = &sd->op->dev.archdata; 356 + sd = &op->dev.archdata; 358 357 sd->iommu = pbm->iommu; 359 358 sd->stc = &pbm->stc; 360 359 sd->numa_node = pbm->numa_node; 360 + 361 + if (!strcmp(node->name, "ebus")) 362 + of_propagate_archdata(op); 361 363 362 364 type = of_get_property(node, "device_type", NULL); 363 365 if (type == NULL)