* Scan for devices on a bus. * * If there are bridges on the bus, recursively scan the buses behind the * bridges. If the setting up and tuning of the bus causes a reset to be * required, reset the bus and scan it again. * * @param busdev Pointer to the bus device. */
| 375 | * @param busdev Pointer to the bus device. |
| 376 | */ |
| 377 | static void scan_bus(struct device *busdev) |
| 378 | { |
| 379 | int do_scan_bus; |
| 380 | struct stopwatch sw; |
| 381 | long scan_time; |
| 382 | |
| 383 | if (!busdev->enabled) |
| 384 | return; |
| 385 | |
| 386 | printk(BIOS_DEBUG, "%s scanning...\n", dev_path(busdev)); |
| 387 | |
| 388 | post_log_path(busdev); |
| 389 | |
| 390 | stopwatch_init(&sw); |
| 391 | |
| 392 | do_scan_bus = 1; |
| 393 | while (do_scan_bus) { |
| 394 | struct bus *link = busdev->downstream; |
| 395 | busdev->ops->scan_bus(busdev); |
| 396 | do_scan_bus = 0; |
| 397 | if (!link || !link->reset_needed) |
| 398 | continue; |
| 399 | if (reset_bus(link)) |
| 400 | do_scan_bus = 1; |
| 401 | else |
| 402 | busdev->upstream->reset_needed = 1; |
| 403 | } |
| 404 | |
| 405 | scan_time = stopwatch_duration_msecs(&sw); |
| 406 | printk(BIOS_DEBUG, "%s: bus %s finished in %ld msecs\n", __func__, |
| 407 | dev_path(busdev), scan_time); |
| 408 | } |
| 409 | |
| 410 | void scan_bridges(struct bus *bus) |
| 411 | { |
no test coverage detected