Changeset View
Changeset View
Standalone View
Standalone View
head/sys/x86/iommu/busdma_dmar.c
Show First 20 Lines • Show All 355 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static int | static int | ||||
dmar_bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) | dmar_bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) | ||||
{ | { | ||||
struct bus_dma_tag_dmar *tag; | struct bus_dma_tag_dmar *tag; | ||||
struct bus_dmamap_dmar *map; | struct bus_dmamap_dmar *map; | ||||
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s", __func__); | |||||
cem: Why was WARN_SLEEPOK added here? The allocations in this function are M_NOWAIT.
If this… | |||||
cemUnsubmitted Not Done Inline ActionsAh, fixed in r346351 and r346851. cem: Ah, fixed in r346351 and r346851. | |||||
tag = (struct bus_dma_tag_dmar *)dmat; | tag = (struct bus_dma_tag_dmar *)dmat; | ||||
map = malloc(sizeof(*map), M_DMAR_DMAMAP, M_NOWAIT | M_ZERO); | map = malloc(sizeof(*map), M_DMAR_DMAMAP, M_NOWAIT | M_ZERO); | ||||
if (map == NULL) { | if (map == NULL) { | ||||
*mapp = NULL; | *mapp = NULL; | ||||
return (ENOMEM); | return (ENOMEM); | ||||
} | } | ||||
if (tag->segments == NULL) { | if (tag->segments == NULL) { | ||||
tag->segments = malloc(sizeof(bus_dma_segment_t) * | tag->segments = malloc(sizeof(bus_dma_segment_t) * | ||||
▲ Show 20 Lines • Show All 539 Lines • Show Last 20 Lines |
Why was WARN_SLEEPOK added here? The allocations in this function are M_NOWAIT.
If this function is sleepable, shouldn't the allocations by M_WAITOK?