Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4897543imu; Tue, 8 Jan 2019 08:06:31 -0800 (PST) X-Google-Smtp-Source: ALg8bN7Rvh4DvN5ECp60cqdzs5yFT05gyNF818iaDfK6ZN7AAf44qhsBOJ/RoKhQbidt3We9RI5w X-Received: by 2002:aa7:824f:: with SMTP id e15mr2241254pfn.192.1546963591448; Tue, 08 Jan 2019 08:06:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546963591; cv=none; d=google.com; s=arc-20160816; b=gMfX5k2WCl3CORduKmxUv7sMCcsG+ZULtvuW9Q+1mjvlE6og3EW9Zm7YCVNbpacTe8 LnGUc5Ejimv7XUjj5DEPbYL4JvM90Aofc4jlV4hy4Ic9widLJxqE245TMYjFRN1ad13Q qZtnpx8PC5eYvOojLbLME4SRSA7LTCjpXjm5x1IwN+m299QiqjPVFm3/SnhXXSZD+4Yb 5/CujatHxS1e2yDUcRb/Vow7yoXW0wftLFzmWwYEIsJgkSAxVPEsSH9Pe6lJphQYG5AL frHNGApp70eIy35lVnI3opXW2xR739ob/Hl1Sm5Y8/hRf5tydk70U5YQbvLdbZv358O/ SSVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=6m5R26C4njy+RkAXIwT+8NMBTZ6JeP0CWGJUVJFLvHo=; b=AeNqa3zhWfcz01FWkIGUdHw9Wq9xA0e15os/+KdG7bYwLX4vtAFWiR9U10zeFr8UsO YykExJVMEoQ07PMrckG2L5maWOTMkWbT/7dPjlhAxZCOwDkNyADDT1M+64CsHzX+DxGk 6D4fJNlVHalmGbdZ03w5k0FKj0pQy+4epkK5mWB1ziZ+4KOR4FKXaUP8vaIYBN1l/wSE Fht7M5mKfu86xwFbox1ERz/WHxADuKyvULNprLuOCqNjYt1HSXdK9Y8JRAMbhcDySwt6 2v2Cl/GURSZcl145KahAR/2yL2GNFTsK4ef+ysItpbN2Rw6jFa/X8HeukBGnQIVplQgQ 8ORA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s191si46853326pfs.53.2019.01.08.08.06.07; Tue, 08 Jan 2019 08:06:31 -0800 (PST) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728832AbfAHQEQ convert rfc822-to-8bit (ORCPT + 99 others); Tue, 8 Jan 2019 11:04:16 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:44483 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728483AbfAHQEQ (ORCPT ); Tue, 8 Jan 2019 11:04:16 -0500 Received: from mail-pg1-f200.google.com ([209.85.215.200]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ggtrS-0005YM-MA for linux-kernel@vger.kernel.org; Tue, 08 Jan 2019 16:04:14 +0000 Received: by mail-pg1-f200.google.com with SMTP id o17so2270073pgi.14 for ; Tue, 08 Jan 2019 08:04:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=rIM7bb97GwACYHLECJ4EObB0Md2UkL3PJGaw6qeRryQ=; b=IZxcI/JfoZfwawqSRgIh4RcgV1i8UyobN6qZbjeKAYT60QXtkhIxQO5f0r5buEAmjk yJ2ak8hnkF0p5EgsorVgMQibCZOIdBvpCvCIuacZy0RBKVf5f707FsSXjYSmhAUTBN9t cwG0XCcZEZeTmFpBGLWOE5s7rg4/DEtHSuF+wxUcykqJcuFaNy4W+bzFJv54lzThwyOv XcnWbykyUXnK3DYHpMslgsr4BTsnas5ahWuH0GLWzPdhFneKRYw4z2sC/B6C9AjX8ptM tqdWrcJGDSparoBnbWNgIJbRzwqYDYh6hKRliuI7iVSLKJ59qqwfmQF50FaVgVvNE8rk 989Q== X-Gm-Message-State: AJcUukczfLJKVKPpVtGv21sIyHorMCXVcfZCN2kO6JRY/52QuCrrWz+w OQJ+nJG1a58cOIAUVf9JXu0xkCjvzN+sd7BTVPrBC/HjcU0MbmGkDv673Ez/Un0xCq2/ASbaA3X t2Tz5xwXQuTQCHUSmCE8ICelEtndfTk1RSGKqKiCsYg== X-Received: by 2002:a63:9041:: with SMTP id a62mr1951564pge.163.1546963452414; Tue, 08 Jan 2019 08:04:12 -0800 (PST) X-Received: by 2002:a63:9041:: with SMTP id a62mr1951549pge.163.1546963452136; Tue, 08 Jan 2019 08:04:12 -0800 (PST) Received: from [192.168.1.215] (220-133-187-190.HINET-IP.hinet.net. [220.133.187.190]) by smtp.gmail.com with ESMTPSA id b68sm106793098pfg.160.2019.01.08.08.04.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Jan 2019 08:04:11 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: [PATCH v4] USB: Don't enable LPM if it's already enabled From: Kai Heng Feng In-Reply-To: <20190108154157.GA20561@kroah.com> Date: Wed, 9 Jan 2019 00:04:08 +0800 Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <98BF2E31-2F7F-47FA-B591-40B2FFBC65F1@canonical.com> References: <20181203102643.22690-1-kai.heng.feng@canonical.com> <20190108154157.GA20561@kroah.com> To: Greg KH X-Mailer: Apple Mail (2.3445.102.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jan 8, 2019, at 11:41 PM, Greg KH wrote: > > On Mon, Dec 03, 2018 at 06:26:43PM +0800, Kai-Heng Feng wrote: >> USB Bluetooth controller QCA ROME (0cf3:e007) sometimes stops working >> after S3: >> [ 165.110742] Bluetooth: hci0: using NVM file: qca/nvm_usb_00000302.bin >> [ 168.432065] Bluetooth: hci0: Failed to send body at 4 of 1953 (-110) >> >> After some experiments, I found that disabling LPM can workaround the >> issue. >> >> On some platforms, the USB power is cut during S3, so the driver uses >> reset-resume to resume the device. During port resume, LPM gets enabled >> twice, by usb_reset_and_verify_device() and usb_port_resume(). >> >> So let's enable LPM for just once, as this solves the issue for the >> device in question. >> >> Also consolidate USB2 LPM functions to usb_enable_usb2_hardware_lpm() >> and usb_disable_usb2_hardware_lpm(). > > I thought I asked for this to be two different patches. One that does > the "consolidation", and then one that fixes the bug. You are mixing > two different things here together, making it harder to review. > > Can you please break this up and send a patch series, with the correct > "Fixes:" tag added to the second patch that actually fixes the issue? The consolidation itself is the fix, so I am not sure how to break this up. In reset-resume case, LPM gets enabled twice, by usb_reset_and_verify_device() and usb_port_resume(). If it’s a normal resume, LPM only gets enabled once, by usb_port_resume(). Since all three checks (capable, allowed and enabled) are merged to a single place, enabling LPM twice can be avoided, hence fixing the issue. Kai-Heng > > thanks, > > greg k-h