Page MenuHomeFreeBSD

pci: Add checked bus mastering helpers
Needs ReviewPublic

Authored by kbowling on Mon, Sep 7, 10:55 AM.

Details

Reviewers
jhb
kib
markj
Summary
Drivers must not release DMA mappings until a device has stopped
accessing them.  A failed device reset therefore needs a last resort
way to disable PCI bus mastering, verify the command register write,
and drain transactions initiated before the write.

Add pci_fence_dma() for that operation.  Also add
pci_enable_busmaster_checked() so a driver recovering from a fence can
verify BME restoration after it has reset stale device DMA state.  Keep
reset and recovery ordering under driver control.

MFC after:      2 weeks
Test Plan

Pattern may replace analogs in drivers around things like firmware resets or failed init.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped