mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-30 16:51:41 +00:00
Add bus_release_resource() method to nexus on arm64
The nexus module was missing method for releasing bus resources. As a result, it couldn't be released and the bus_release_resource() call would return ENXIO. Next call to bus_alloc_resource() for the same resource was returning error, because it wasn't released previously and it was still busy. The implementation of the nexus_release_resource() is the same as for arm architecture. Submitted by: Michal Krawczyk <mk@semihalf.com> Reported-by: Greg V <greg@unrelenting.technology> Tested-by: cperciva, Greg V <greg@unrelenting.technology> Obtained from: Semihalf MFC after: 2 weeks Sponsored by: Amazon, Inc. Differential revision: https://reviews.freebsd.org/D19641
This commit is contained in:
parent
505f6a0cea
commit
8b0f6c4215
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=345373
@ -113,6 +113,8 @@ static int nexus_set_resource(device_t, device_t, int, int,
|
||||
rman_res_t, rman_res_t);
|
||||
static int nexus_deactivate_resource(device_t, device_t, int, int,
|
||||
struct resource *);
|
||||
static int nexus_release_resource(device_t, device_t, int, int,
|
||||
struct resource *);
|
||||
|
||||
static int nexus_setup_intr(device_t dev, device_t child, struct resource *res,
|
||||
int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep);
|
||||
@ -137,6 +139,7 @@ static device_method_t nexus_methods[] = {
|
||||
DEVMETHOD(bus_get_resource_list, nexus_get_reslist),
|
||||
DEVMETHOD(bus_set_resource, nexus_set_resource),
|
||||
DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource),
|
||||
DEVMETHOD(bus_release_resource, nexus_release_resource),
|
||||
DEVMETHOD(bus_setup_intr, nexus_setup_intr),
|
||||
DEVMETHOD(bus_teardown_intr, nexus_teardown_intr),
|
||||
DEVMETHOD(bus_get_bus_tag, nexus_get_bus_tag),
|
||||
@ -270,6 +273,20 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
return (rv);
|
||||
}
|
||||
|
||||
static int
|
||||
nexus_release_resource(device_t bus, device_t child, int type, int rid,
|
||||
struct resource *res)
|
||||
{
|
||||
int error;
|
||||
|
||||
if (rman_get_flags(res) & RF_ACTIVE) {
|
||||
error = bus_deactivate_resource(child, type, rid, res);
|
||||
if (error)
|
||||
return (error);
|
||||
}
|
||||
return (rman_release_resource(res));
|
||||
}
|
||||
|
||||
static int
|
||||
nexus_config_intr(device_t dev, int irq, enum intr_trigger trig,
|
||||
enum intr_polarity pol)
|
||||
|
Loading…
Reference in New Issue
Block a user