aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/shpchp_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/hotplug/shpchp_pci.c')
-rw-r--r--drivers/pci/hotplug/shpchp_pci.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/drivers/pci/hotplug/shpchp_pci.c b/drivers/pci/hotplug/shpchp_pci.c
index 3fc4ec0eea0b..138f161becc0 100644
--- a/drivers/pci/hotplug/shpchp_pci.c
+++ b/drivers/pci/hotplug/shpchp_pci.c
@@ -49,9 +49,7 @@ static void program_fw_provided_values(struct pci_dev *dev)
49 /* use default values if we can't get them from firmware */ 49 /* use default values if we can't get them from firmware */
50 if (get_hp_params_from_firmware(dev, &hpp) || 50 if (get_hp_params_from_firmware(dev, &hpp) ||
51 !hpp.t0 || (hpp.t0->revision > 1)) { 51 !hpp.t0 || (hpp.t0->revision > 1)) {
52 printk(KERN_WARNING 52 warn("Could not get hotplug parameters. Use defaults\n");
53 "%s: Could not get hotplug parameters. Use defaults\n",
54 __func__);
55 hpp.t0 = &hpp.type0_data; 53 hpp.t0 = &hpp.type0_data;
56 hpp.t0->revision = 0; 54 hpp.t0->revision = 0;
57 hpp.t0->cache_line_size = 8; 55 hpp.t0->cache_line_size = 8;
@@ -101,18 +99,20 @@ int __ref shpchp_configure_device(struct slot *p_slot)
101 struct pci_dev *dev; 99 struct pci_dev *dev;
102 struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate; 100 struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate;
103 int num, fn; 101 int num, fn;
102 struct controller *ctrl = p_slot->ctrl;
104 103
105 dev = pci_get_slot(parent, PCI_DEVFN(p_slot->device, 0)); 104 dev = pci_get_slot(parent, PCI_DEVFN(p_slot->device, 0));
106 if (dev) { 105 if (dev) {
107 err("Device %s already exists at %x:%x, cannot hot-add\n", 106 ctrl_err(ctrl, "Device %s already exists "
108 pci_name(dev), p_slot->bus, p_slot->device); 107 "at %04x:%02x:%02x, cannot hot-add\n", pci_name(dev),
108 pci_domain_nr(parent), p_slot->bus, p_slot->device);
109 pci_dev_put(dev); 109 pci_dev_put(dev);
110 return -EINVAL; 110 return -EINVAL;
111 } 111 }
112 112
113 num = pci_scan_slot(parent, PCI_DEVFN(p_slot->device, 0)); 113 num = pci_scan_slot(parent, PCI_DEVFN(p_slot->device, 0));
114 if (num == 0) { 114 if (num == 0) {
115 err("No new device found\n"); 115 ctrl_err(ctrl, "No new device found\n");
116 return -ENODEV; 116 return -ENODEV;
117 } 117 }
118 118
@@ -121,8 +121,8 @@ int __ref shpchp_configure_device(struct slot *p_slot)
121 if (!dev) 121 if (!dev)
122 continue; 122 continue;
123 if ((dev->class >> 16) == PCI_BASE_CLASS_DISPLAY) { 123 if ((dev->class >> 16) == PCI_BASE_CLASS_DISPLAY) {
124 err("Cannot hot-add display device %s\n", 124 ctrl_err(ctrl, "Cannot hot-add display device %s\n",
125 pci_name(dev)); 125 pci_name(dev));
126 pci_dev_put(dev); 126 pci_dev_put(dev);
127 continue; 127 continue;
128 } 128 }
@@ -138,14 +138,15 @@ int __ref shpchp_configure_device(struct slot *p_slot)
138 break; 138 break;
139 } 139 }
140 if (busnr >= end) { 140 if (busnr >= end) {
141 err("No free bus for hot-added bridge\n"); 141 ctrl_err(ctrl,
142 "No free bus for hot-added bridge\n");
142 pci_dev_put(dev); 143 pci_dev_put(dev);
143 continue; 144 continue;
144 } 145 }
145 child = pci_add_new_bus(parent, dev, busnr); 146 child = pci_add_new_bus(parent, dev, busnr);
146 if (!child) { 147 if (!child) {
147 err("Cannot add new bus for %s\n", 148 ctrl_err(ctrl, "Cannot add new bus for %s\n",
148 pci_name(dev)); 149 pci_name(dev));
149 pci_dev_put(dev); 150 pci_dev_put(dev);
150 continue; 151 continue;
151 } 152 }
@@ -168,8 +169,10 @@ int shpchp_unconfigure_device(struct slot *p_slot)
168 int j; 169 int j;
169 u8 bctl = 0; 170 u8 bctl = 0;
170 struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate; 171 struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate;
172 struct controller *ctrl = p_slot->ctrl;
171 173
172 dbg("%s: bus/dev = %x/%x\n", __func__, p_slot->bus, p_slot->device); 174 ctrl_dbg(ctrl, "%s: domain:bus:dev = %04x:%02x:%02x\n",
175 __func__, pci_domain_nr(parent), p_slot->bus, p_slot->device);
173 176
174 for (j=0; j<8 ; j++) { 177 for (j=0; j<8 ; j++) {
175 struct pci_dev* temp = pci_get_slot(parent, 178 struct pci_dev* temp = pci_get_slot(parent,
@@ -177,16 +180,17 @@ int shpchp_unconfigure_device(struct slot *p_slot)
177 if (!temp) 180 if (!temp)
178 continue; 181 continue;
179 if ((temp->class >> 16) == PCI_BASE_CLASS_DISPLAY) { 182 if ((temp->class >> 16) == PCI_BASE_CLASS_DISPLAY) {
180 err("Cannot remove display device %s\n", 183 ctrl_err(ctrl, "Cannot remove display device %s\n",
181 pci_name(temp)); 184 pci_name(temp));
182 pci_dev_put(temp); 185 pci_dev_put(temp);
183 continue; 186 continue;
184 } 187 }
185 if (temp->hdr_type == PCI_HEADER_TYPE_BRIDGE) { 188 if (temp->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
186 pci_read_config_byte(temp, PCI_BRIDGE_CONTROL, &bctl); 189 pci_read_config_byte(temp, PCI_BRIDGE_CONTROL, &bctl);
187 if (bctl & PCI_BRIDGE_CTL_VGA) { 190 if (bctl & PCI_BRIDGE_CTL_VGA) {
188 err("Cannot remove display device %s\n", 191 ctrl_err(ctrl,
189 pci_name(temp)); 192 "Cannot remove display device %s\n",
193 pci_name(temp));
190 pci_dev_put(temp); 194 pci_dev_put(temp);
191 continue; 195 continue;
192 } 196 }