Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1342910ybp; Thu, 17 Oct 2019 11:20:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyh11y9qkDYojigFbHRchlgFwrSJ/8swW6XJv4l9xmIAUq1fIzrOqBjMNaLwskktGGEkDuT X-Received: by 2002:a17:907:3301:: with SMTP id ym1mr4921221ejb.106.1571336414547; Thu, 17 Oct 2019 11:20:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571336414; cv=none; d=google.com; s=arc-20160816; b=N4U8RzEIwxGarhySOOfjSYkYztuNk13CLKqTQeBVa/+MAx91wFnjJhxDPQTJ7mvPMI StSUpewKtada++QM25r1dytSRX6bcQRMwWVsT0oOLXPowzFkOI8icCbXykrd5Zqwv9Gg tRHM01ne/N9xM32P+zhUnd7L/969nE1lCRbFhW8Mh9ahs1TpVDT/DwSLT6MkknaZiF4i BM709+CiOGy/yh0TvgJqUK0ILWbefGrkv1pNME+dBbXfBVkSDZj6Gdf2T4t/Sb2P3d7l KDTh0fowErMzLB11YAh6tejZ0ls9/5akcX2l3GqkBmgOPGFhzhsNbUeuhX7Iimds+fUU g69A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RZr7kVynSnyuEGNMp+aZlD+o9rFJwTiwMAy8qHlgFMw=; b=Ywz9ZX9BFzeFHCNxPvEZpLKQXJJy26gWmNWFgjn3eMsfLEL9TBFKleEAYZoypkYhaw GXYilxKcoR4ykgfKYD3EHfiSP48SQe4zwLQAm4o+P+cYBg2zGOjhpE1/QfdC6mdd9zmz 23/RvKViwLrqXFDDaGv+nZxOkEhf+upxsUWXM1S/RjFT3llMp5vvaHJ3WB4WAEHX2tMa rSA6OF0Vhqg0GcNTix8BUMxU9KH2bYGhILBRiQ/xCfwA20vzJC9l4DWg9m2mfYHYrtj2 NN8iTCc0ejPvTxiFgV6T03nUTCeDhM5kWgWTp8YlHPrn2zHt4sD8Z5IF4gsvisn+EkI3 eUnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=f5uKPT06; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rl13si1954816ejb.228.2019.10.17.11.19.51; Thu, 17 Oct 2019 11:20:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=f5uKPT06; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438728AbfJPWAN (ORCPT + 99 others); Wed, 16 Oct 2019 18:00:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:53516 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726231AbfJPV7I (ORCPT ); Wed, 16 Oct 2019 17:59:08 -0400 Received: from localhost (unknown [192.55.54.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DE54221A4C; Wed, 16 Oct 2019 21:59:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571263148; bh=uySbU/iStrpg7gYqVAO/jw0Lt6eyVT6b5EdH9JhGSaU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f5uKPT06r378iZZK/osr3cpQ8Ksn/XcJo5ESnIVCGZ+GwUEf9cgz8p35DauIkot14 pKmgeMNt/FxTRgn+Ig6APtNI1QXdMx6wk5eFAoarXHJGqlSyx6b4TyUMlgKOx2kLj0 myg+t/hnZoNZ+mhWdq0vgxer+gc35OQ8Bvmb9rw4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold Subject: [PATCH 5.3 030/112] USB: serial: fix runtime PM after driver unbind Date: Wed, 16 Oct 2019 14:50:22 -0700 Message-Id: <20191016214853.073187033@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191016214844.038848564@linuxfoundation.org> References: <20191016214844.038848564@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold commit d51bdb93ca7e71d7fb30a572c7b47ed0194bf3fe upstream. Since commit c2b71462d294 ("USB: core: Fix bug caused by duplicate interface PM usage counter") USB drivers must always balance their runtime PM gets and puts, including when the driver has already been unbound from the interface. Leaving the interface with a positive PM usage counter would prevent a later bound driver from suspending the device. Fixes: c2b71462d294 ("USB: core: Fix bug caused by duplicate interface PM usage counter") Cc: stable Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20191001084908.2003-4-johan@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/usb-serial.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -314,10 +314,7 @@ static void serial_cleanup(struct tty_st serial = port->serial; owner = serial->type->driver.owner; - mutex_lock(&serial->disc_mutex); - if (!serial->disconnected) - usb_autopm_put_interface(serial->interface); - mutex_unlock(&serial->disc_mutex); + usb_autopm_put_interface(serial->interface); usb_serial_put(serial); module_put(owner);