From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tony Lindgren Subject: Re: [PATCH 1/2] serial: omap: fix runtime-pm handling on unbind Date: Mon, 10 Apr 2017 09:15:24 -0700 Message-ID: <20170410161524.GA5339@atomide.com> References: <20170410092139.11441-1-johan@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20170410092139.11441-1-johan@kernel.org> Sender: linux-kernel-owner@vger.kernel.org To: Johan Hovold Cc: Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Felipe Balbi , Santosh Shilimkar List-Id: linux-serial@vger.kernel.org * Johan Hovold [170410 02:27]: > An unbalanced and misplaced synchronous put was used to suspend the > device on driver unbind, something which with a likewise misplaced > pm_runtime_disable leads to external aborts when an open port is being > removed. > > Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa024010 > ... > [] (serial_omap_set_mctrl) from [] (uart_update_mctrl+0x50/0x60) > [] (uart_update_mctrl) from [] (uart_shutdown+0xbc/0x138) > [] (uart_shutdown) from [] (uart_hangup+0x94/0x190) > [] (uart_hangup) from [] (__tty_hangup+0x404/0x41c) > [] (__tty_hangup) from [] (tty_vhangup+0x1c/0x20) > [] (tty_vhangup) from [] (uart_remove_one_port+0xec/0x260) > [] (uart_remove_one_port) from [] (serial_omap_remove+0x40/0x60) > [] (serial_omap_remove) from [] (platform_drv_remove+0x34/0x4c) > > Fix this up by resuming the device before deregistering the port and by > suspending and disabling runtime pm only after the port has been > removed. > > Also make sure to disable autosuspend before disabling runtime pm so > that the usage count is balanced and device actually suspended before > returning. > > Note that due to a negative autosuspend delay being set in probe, the > unbalanced put would actually suspend the device on first driver unbind, > while rebinding and again unbinding would result in a negative > power.usage_count. > > Fixes: 7e9c8e7dbf3b ("serial: omap: make sure to suspend device before remove") > Cc: Felipe Balbi > Cc: Santosh Shilimkar > Cc: Tony Lindgren > Signed-off-by: Johan Hovold Acked-by: Tony Lindgren