aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/vga
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2010-02-02 17:38:15 -0500
committerH. Peter Anvin <hpa@zytor.com>2010-02-05 17:05:41 -0500
commit773a38dbdad03474c5ee235f7d9bf9f51c9e3c2b (patch)
tree0ae8953a3ad092f9294f51de0f6b3f2c48d1a0ef /drivers/gpu/vga
parent841582ea9e29a8f757c30c5377ce649586ba793a (diff)
vgaarb: Fix VGA arbiter to accept PCI domains other than 0
Update the VGA Arbiter to accept PCI Domains other than 0. Signed-off-by: Mike Travis <travis@sgi.com> LKML-Reference: <201002022238.o12McFe8018730@imap1.linux-foundation.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Robin Holt <holt@sgi.com> Cc: Jack Steiner <steiner@sgi.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: David Airlie <airlied@linux.ie> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'drivers/gpu/vga')
-rw-r--r--drivers/gpu/vga/vgaarb.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
index 1ac0c93603c9..ba7fa9ee54dc 100644
--- a/drivers/gpu/vga/vgaarb.c
+++ b/drivers/gpu/vga/vgaarb.c
@@ -954,6 +954,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf,
954 } 954 }
955 955
956 } else if (strncmp(curr_pos, "target ", 7) == 0) { 956 } else if (strncmp(curr_pos, "target ", 7) == 0) {
957 struct pci_bus *pbus;
957 unsigned int domain, bus, devfn; 958 unsigned int domain, bus, devfn;
958 struct vga_device *vgadev; 959 struct vga_device *vgadev;
959 960
@@ -969,18 +970,31 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf,
969 ret_val = -EPROTO; 970 ret_val = -EPROTO;
970 goto done; 971 goto done;
971 } 972 }
972 973 pr_devel("vgaarb: %s ==> %x:%x:%x.%x\n", curr_pos,
973 pdev = pci_get_bus_and_slot(bus, devfn); 974 domain, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
975
976 pbus = pci_find_bus(domain, bus);
977 pr_devel("vgaarb: pbus %p\n", pbus);
978 if (pbus == NULL) {
979 pr_err("vgaarb: invalid PCI domain and/or bus address %x:%x\n",
980 domain, bus);
981 ret_val = -ENODEV;
982 goto done;
983 }
984 pdev = pci_get_slot(pbus, devfn);
985 pr_devel("vgaarb: pdev %p\n", pdev);
974 if (!pdev) { 986 if (!pdev) {
975 pr_info("vgaarb: invalid PCI address!\n"); 987 pr_err("vgaarb: invalid PCI address %x:%x\n",
988 bus, devfn);
976 ret_val = -ENODEV; 989 ret_val = -ENODEV;
977 goto done; 990 goto done;
978 } 991 }
979 } 992 }
980 993
981 vgadev = vgadev_find(pdev); 994 vgadev = vgadev_find(pdev);
995 pr_devel("vgaarb: vgadev %p\n", vgadev);
982 if (vgadev == NULL) { 996 if (vgadev == NULL) {
983 pr_info("vgaarb: this pci device is not a vga device\n"); 997 pr_err("vgaarb: this pci device is not a vga device\n");
984 pci_dev_put(pdev); 998 pci_dev_put(pdev);
985 ret_val = -ENODEV; 999 ret_val = -ENODEV;
986 goto done; 1000 goto done;
@@ -998,7 +1012,8 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf,
998 } 1012 }
999 } 1013 }
1000 if (i == MAX_USER_CARDS) { 1014 if (i == MAX_USER_CARDS) {
1001 pr_err("vgaarb: maximum user cards number reached!\n"); 1015 pr_err("vgaarb: maximum user cards (%d) number reached!\n",
1016 MAX_USER_CARDS);
1002 pci_dev_put(pdev); 1017 pci_dev_put(pdev);
1003 /* XXX: which value to return? */ 1018 /* XXX: which value to return? */
1004 ret_val = -ENOMEM; 1019 ret_val = -ENOMEM;