mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-26 15:45:14 +08:00
ccac05152e
tegra_dma_init currently simply bails out early if any initialization fails. This skips various data-structure initialization. In turn, this means that tegra_dma_allocate_channel can still hand out channels. In this case, when tegra_dma_free_channel is called, which calls tegra_dma_cancel, the walking on ch->list will OOPS since the list's next/prev pointers may still be NULL. To solve this, add an explicit "initialized" flag, only set this once _init has fully completed successfully, and have _allocate_channel refuse to hand out channels if this is not set. While at it, simplify _init: * Remove redundant memsets * Use bitmap_fill to mark all channels as in-use up-front, and remove some now-redundant bitmap initialization loops. * Only mark a channel as free once all channel-related initialization has completed. Finally, the successful exit path from _init always has ret==0, so just hard-code that return. The error path still returns ret. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Colin Cross <ccross@android.com> |
||
---|---|---|
.. | ||
include/mach | ||
board-harmony-pcie.c | ||
board-harmony-pinmux.c | ||
board-harmony.c | ||
board-harmony.h | ||
board-seaboard-pinmux.c | ||
board-seaboard.c | ||
board-seaboard.h | ||
board-trimslice-pinmux.c | ||
board-trimslice.c | ||
board-trimslice.h | ||
board.h | ||
clock.c | ||
clock.h | ||
common.c | ||
cpu-tegra.c | ||
devices.c | ||
devices.h | ||
dma.c | ||
fuse.c | ||
fuse.h | ||
gpio-names.h | ||
gpio.c | ||
headsmp.S | ||
hotplug.c | ||
io.c | ||
irq.c | ||
Kconfig | ||
legacy_irq.c | ||
localtimer.c | ||
Makefile | ||
Makefile.boot | ||
pcie.c | ||
pinmux-t2-tables.c | ||
pinmux.c | ||
platsmp.c | ||
powergate.c | ||
tegra2_clocks.c | ||
tegra2_emc.c | ||
tegra2_emc.h | ||
timer.c |