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

staging: unisys: Don't hold device responses until driver loads

Currently if a driver is not loaded for a device, we will not
respond to the device create until it is done. This causes
s-Par to not mark the partition running if the driver for the
device is not loaded. Since there are several devices that
could be assigned to a guest that don't have an actual
driver this will cause us to never go running.

If the device driver is loaded, we WILL continue to only
respond to the device PAUSE message when the device driver
has responded that it is done with the device.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

David Kershner and committed by
Greg Kroah-Hartman
86ea8acc 5e54654c

+7 -21
+7 -21
drivers/staging/unisys/visorbus/visorbus_main.c
··· 70 70 NULL, 71 71 }; 72 72 73 - 74 73 /** This describes the TYPE of bus. 75 74 * (Don't confuse this with an INSTANCE of the bus.) 76 75 */ ··· 744 745 away: 745 746 if (rc != 0) 746 747 put_device(&dev->device); 747 - /* We could get here more than once if the child driver module is 748 - * unloaded and re-loaded while devices are present. That's why we 749 - * need a flag to be sure that we only respond to the device_create 750 - * once. We cannot respond to the device_create prior to here, 751 - * because until we call drv->probe() above, the channel has not been 752 - * initialized. 753 - */ 754 - if (!dev->responded_to_device_create) { 755 - 756 - dev->responded_to_device_create = true; 757 - if (chipset_responders.device_create) 758 - (*chipset_responders.device_create)(dev, rc); 759 - } 760 748 return rc; 761 749 } 762 750 ··· 1291 1305 POSTCODE_SEVERITY_INFO); 1292 1306 1293 1307 rc = create_visor_device(dev_info); 1294 - if (rc < 0) { 1308 + if (chipset_responders.device_create) 1309 + chipset_responders.device_create(dev_info, rc); 1310 + 1311 + if (rc < 0) 1295 1312 POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no, 1296 1313 POSTCODE_SEVERITY_ERR); 1297 - if (chipset_responders.device_create) 1298 - (*chipset_responders.device_create)(dev_info, rc); 1299 - } 1300 - 1301 - POSTCODE_LINUX_4(DEVICE_CREATE_SUCCESS_PC, dev_no, bus_no, 1302 - POSTCODE_SEVERITY_INFO); 1314 + else 1315 + POSTCODE_LINUX_4(DEVICE_CREATE_SUCCESS_PC, dev_no, bus_no, 1316 + POSTCODE_SEVERITY_INFO); 1303 1317 } 1304 1318 1305 1319 static void