yangsong8-a1 opened a new pull request, #22407:
URL: https://github.com/apache/nuttx/pull/22407

   ## Summary
   
   - When multiple CPUs scan the same PCI bus (BMP), a device whose
     PCI_COMMAND IO or MEMORY bit is already set was probed by a
     prior CPU's driver (via pci_enable_device). Check those bits in
     pci_register_device() and return -EBUSY to avoid a duplicate
     probe.
   
   ## Impact
   
   - Single-CPU and direct-boot (no firmware) systems are unaffected:
     PCI_COMMAND IO/MEMORY are cleared at reset, so the check always
     passes. Verified by identical qemu-armv8a boot logs with and
     without the patch.
   - On systems where firmware leaves IO/MEMORY enabled on a device,
     that device is now skipped instead of probed again.
   
   ## Testing
   
   - qemu-armv8a:netnsh with `-device pci-testdev -device edu`:
     pci_scan_bus enumerates all devices, the qemu-testdev driver
     probes and completes its BAR tests, NSH comes up. The boot log
     is identical to master (timestamps stripped).
   
   ```
   pci_scan_bus: pci_scan_bus for bus 0
   pci_scan_bus: 00:08 [1b36:0005]
   pci_qemu_test_bar: WRITING Test# 3 0x3eff0000
   nsh>
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

  • [PR] pci: Skip already-initia... yangsong8-a1 (via GitHub) via commits

Reply via email to