serial: 8250: omap: Shut down on remove for console uart
authorTony Lindgren <tony@atomide.com>
Mon, 8 May 2023 08:20:14 +0000 (11:20 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 May 2023 10:33:56 +0000 (19:33 +0900)
commitdb86bb6ed4979ed8a987057f9098ea88f85e48be
treea1012c3af11a63c76dc9b166678e666a5958420b
parentfef4f600319e35b7121c3ea6005ee38626f4f959
serial: 8250: omap: Shut down on remove for console uart

When unbinding the console uart, we want to power down the uart hardware
on remove. For the console uart, the normal shutdown path will never get
called as the cons_filp stays open. Let's rearrange the dma related
functions a bit so we can call driver shutdown also on console uart rebind.

Currently we set up->dma on probe, but that causes issues calling
omap_8250_shutdown() on remove. The dma startup will not get called on
the next rebind as we still have up->dma set from probe.

Note that serial8250_release_dma() already checks for dma so we can
remove the check for it in 8205_omap driver.

With these changes we also avoid hogging dma virtual channels for the
unused uarts that may be limited on some devices.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20230508082014.23083-5-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_omap.c