Skip to content

Commit 5bda8f7

Browse files
Yongji Xietomba
authored andcommitted
video: fbdev: offb: Call pci_enable_device() before using the PCI VGA device
Currently the offb module will use the PCI VGA device as frame buffer device without calling something like pci_enable_device(). However, this would cause some problem if we disable memory decoding of the upstream bridge before. When the console driver issued memory access to the VGA device, the access cannot be supported by the bridge which will cause EEH error on Power machine. Signed-off-by: Yongji Xie <xyjxie@linux.vnet.ibm.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
1 parent 220be8d commit 5bda8f7

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

drivers/video/fbdev/offb.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,21 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
625625
if (address == OF_BAD_ADDR && addr_prop)
626626
address = (u64)addr_prop;
627627
if (address != OF_BAD_ADDR) {
628+
#ifdef CONFIG_PCI
629+
const __be32 *vidp, *didp;
630+
u32 vid, did;
631+
struct pci_dev *pdev;
632+
633+
vidp = of_get_property(dp, "vendor-id", NULL);
634+
didp = of_get_property(dp, "device-id", NULL);
635+
if (vidp && didp) {
636+
vid = be32_to_cpup(vidp);
637+
did = be32_to_cpup(didp);
638+
pdev = pci_get_device(vid, did, NULL);
639+
if (!pdev || pci_enable_device(pdev))
640+
return;
641+
}
642+
#endif
628643
/* kludge for valkyrie */
629644
if (strcmp(dp->name, "valkyrie") == 0)
630645
address += 0x1000;

0 commit comments

Comments
 (0)