amdsmn(4): Do not probe not matching hostbridges
Similar to r323195, but for amdsmn(4) driver (which borrowed some design). Ignore hostbs that do not match our PCI device id criteria. Sponsored by: Dell EMC Isilon
This commit is contained in:
parent
40f7bccb5d
commit
1b93938ae4
@ -90,23 +90,28 @@ static devclass_t amdsmn_devclass;
|
|||||||
DRIVER_MODULE(amdsmn, hostb, amdsmn_driver, amdsmn_devclass, NULL, NULL);
|
DRIVER_MODULE(amdsmn, hostb, amdsmn_driver, amdsmn_devclass, NULL, NULL);
|
||||||
MODULE_VERSION(amdsmn, 1);
|
MODULE_VERSION(amdsmn, 1);
|
||||||
|
|
||||||
static void
|
static bool
|
||||||
amdsmn_identify(driver_t *driver, device_t parent)
|
amdsmn_match(device_t parent)
|
||||||
{
|
{
|
||||||
device_t child;
|
|
||||||
uint32_t devid;
|
uint32_t devid;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
/* Make sure we're not being doubly invoked. */
|
|
||||||
if (device_find_child(parent, "amdsmn", -1) != NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
devid = pci_get_devid(parent);
|
devid = pci_get_devid(parent);
|
||||||
for (i = 0; i < nitems(amdsmn_ids); i++)
|
for (i = 0; i < nitems(amdsmn_ids); i++)
|
||||||
if (amdsmn_ids[i].device_id == devid)
|
if (amdsmn_ids[i].device_id == devid)
|
||||||
break;
|
return (true);
|
||||||
|
return (false);
|
||||||
|
}
|
||||||
|
|
||||||
if (i >= nitems(amdsmn_ids))
|
static void
|
||||||
|
amdsmn_identify(driver_t *driver, device_t parent)
|
||||||
|
{
|
||||||
|
device_t child;
|
||||||
|
|
||||||
|
/* Make sure we're not being doubly invoked. */
|
||||||
|
if (device_find_child(parent, "amdsmn", -1) != NULL)
|
||||||
|
return;
|
||||||
|
if (!amdsmn_match(parent))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
child = device_add_child(parent, "amdsmn", -1);
|
child = device_add_child(parent, "amdsmn", -1);
|
||||||
@ -121,6 +126,8 @@ amdsmn_probe(device_t dev)
|
|||||||
|
|
||||||
if (resource_disabled("amdsmn", 0))
|
if (resource_disabled("amdsmn", 0))
|
||||||
return (ENXIO);
|
return (ENXIO);
|
||||||
|
if (!amdsmn_match(device_get_parent(dev)))
|
||||||
|
return (ENXIO);
|
||||||
|
|
||||||
family = CPUID_TO_FAMILY(cpu_id);
|
family = CPUID_TO_FAMILY(cpu_id);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user