Received: by 10.223.185.116 with SMTP id b49csp1053979wrg; Fri, 16 Feb 2018 11:34:02 -0800 (PST) X-Google-Smtp-Source: AH8x227qjfAsCZstplYXdnqq2V4USO0RyejTaE8+1+sgLazbmqSgSyZdKU52n+eZ6bqzbjeBN0dP X-Received: by 10.98.101.195 with SMTP id z186mr7014775pfb.47.1518809642034; Fri, 16 Feb 2018 11:34:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518809642; cv=none; d=google.com; s=arc-20160816; b=fIvK008u5y7eGC8Ck7NbOY7AJXakIkz1wk3K+00qPKvte+86UGRMNdgpvE7UqHfyJq O/LiCUwKDTP5hTu7jtSxNonLZbcs7pVhOXrlElkGmhYKr2G+XoT1g/U8uISCFZnxuNEe WJhRKfJvEzfkM/tAbiIELrBjUslnZUAHYyqWaEabblFhloL6spOO4Zg5RuDRCxj8tMQd af1U23oN4ViVJyMyhJwCFyBgfxBpDIkF9Qq1/BJzFR5mONPauuSG9d6VEAVy5hH8i6mj 2jDB+6XvtpIUXY8STKggswED3vhIqAU/2qrhY1b0F563ryxvEt2kaRCrc2fR1qw4sft3 nvdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=YQ3Fy/CtpGbq+6Kqge6cFJMlDY51DjfsmbWZWPDBP4c=; b=IsfXp732NEdgwT7bgh49Q928pXJWJgoAOPU+k1XUOrJtSmrGaZhMFL698CPH4WXc24 EjWVPaQCHBqjLo25/vltZ9BvVkP3807Mbuy9oZ2UhqqFet6fBq+Eco3YcNM7ZQfUPOL/ Nq15Ls0+8GD+GTFVVIRFlFoSe31DsLRLmxtSBZ0FsjUEZ87C9OuvMPfKPsPCaZCYvXvh bUG2aZmt08HZRN+FDcB7L0bWHMyIdIkoPEyibRYN3BAlY2Pi+T0eqcXpKoSCbgJ+aHBt LAMYKZl2QSLVwVJ1ELIaF42r/E2rVZcZWB8wshb8tEsT2+0KPLP7maSM7YQUMPVhbfuw 6HiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VfC+b91Z; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p11si487358pgs.537.2018.02.16.11.33.47; Fri, 16 Feb 2018 11:34:02 -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; dkim=pass header.i=@chromium.org header.s=google header.b=VfC+b91Z; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757261AbeBPCby (ORCPT + 99 others); Thu, 15 Feb 2018 21:31:54 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:45830 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757237AbeBPCbv (ORCPT ); Thu, 15 Feb 2018 21:31:51 -0500 Received: by mail-pl0-f67.google.com with SMTP id p5so923370plo.12 for ; Thu, 15 Feb 2018 18:31:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=YQ3Fy/CtpGbq+6Kqge6cFJMlDY51DjfsmbWZWPDBP4c=; b=VfC+b91ZQLXROXBt60Z0FsNHV38L+t9WrMDUDh0rZLXXupGynSLvnI9Al/X6XFH8Tr bkh6r+81loq75S0/zgg/2+I1DCzuSm2lTVTiBRlpMzzg22RJPTz97pO55QveZGaXDzBS vmi5aHFAuS8LUuXYBqPPM9RVgVw/Lldeu3hHs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=YQ3Fy/CtpGbq+6Kqge6cFJMlDY51DjfsmbWZWPDBP4c=; b=hG28Zz7J8Bor5sWkNNXVxTwTuO2kN2LmaOFatgKYzsLmhFWZgVHiIx6OuOSw2bfQX0 MT5/IzXi9Y44s4cMbeReAFnBZHrjOvHW3+UWRCLNFERKgXWKyqqRvJq6SIndPMX7rwUq /+MEUaevW0yQL2cSPdrAafzFlo22NgKHPOzo8wtnZ+Bzof0+/lhZomDCFfMCiHE8P9M+ CKcX7RVYnL5zwILYWKLRmFQCyDTlSWjvzR+PTFZcdo/ymBE8Rj6ejGSdjRBHETKRWvkk i+SUb/pyAa7js348vWbMzxH/xu7y7+MQqv4suH3dV7F4wzImEGcivfFSDh9ncriCtYrH 4IIg== X-Gm-Message-State: APf1xPCzWK6ce1sL2wHfRv9eiwqgpEgXTCFyTxGAI0rd17M1YehHnAhM xKUGjoQUV3kTuBYzfrQvsj+Gaw== X-Received: by 2002:a17:902:d806:: with SMTP id a6-v6mr4380400plz.274.1518748311253; Thu, 15 Feb 2018 18:31:51 -0800 (PST) Received: from rodete-desktop-imager.corp.google.com ([2620:0:1000:1501:da1a:a5c1:68e:d948]) by smtp.gmail.com with ESMTPSA id u9sm35811892pgv.4.2018.02.15.18.31.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Feb 2018 18:31:50 -0800 (PST) Date: Thu, 15 Feb 2018 18:31:48 -0800 From: Brian Norris To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Leif Liddy , Matthias Kaehlcke , Daniel Drake , Kai-Heng Feng , Hans de Goede , Marcel Holtmann , Guenter Roeck Subject: Re: [PATCH 4.4 095/108] Bluetooth: btusb: Restore QCA Rome suspend/resume fix with a "rewritten" version Message-ID: <20180216023147.GB69988@rodete-desktop-imager.corp.google.com> References: <20180215151222.267507937@linuxfoundation.org> <20180215151235.620152736@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180215151235.620152736@linuxfoundation.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 15, 2018 at 04:17:32PM +0100, Greg Kroah-Hartman wrote: > 4.4-stable review patch. If anyone has any objections, please let me know. Consider this an objection: I'm currently arguing that this is unnecessarily regressing power consumption here: https://patchwork.kernel.org/patch/10149195/ I'll leave it up to you what to do with this, but if this ends up in Chromium OS kernels, I'm likely to revert it there... Brian > ------------------ > > From: Hans de Goede > > commit 61f5acea8737d9b717fcc22bb6679924f3c82b98 upstream. > > Commit 7d06d5895c15 ("Revert "Bluetooth: btusb: fix QCA...suspend/resume"") > removed the setting of the BTUSB_RESET_RESUME quirk for QCA Rome devices, > instead favoring adding USB_QUIRK_RESET_RESUME quirks in usb/core/quirks.c. > > This was done because the DIY BTUSB_RESET_RESUME reset-resume handling > has several issues (see the original commit message). An added advantage > of moving over to the USB-core reset-resume handling is that it also > disables autosuspend for these devices, which is similarly broken on these. > > But there are 2 issues with this approach: > 1) It leaves the broken DIY BTUSB_RESET_RESUME code in place for Realtek > devices. > 2) Sofar only 2 of the 10 QCA devices known to the btusb code have been > added to usb/core/quirks.c and if we fix the Realtek case the same way > we need to add an additional 14 entries. So in essence we need to > duplicate a large part of the usb_device_id table in btusb.c in > usb/core/quirks.c and manually keep them in sync. > > This commit instead restores setting a reset-resume quirk for QCA devices > in the btusb.c code, avoiding the duplicate usb_device_id table problem. > > This commit avoids the problems with the original DIY BTUSB_RESET_RESUME > code by simply setting the USB_QUIRK_RESET_RESUME quirk directly on the > usb_device. > > This commit also moves the BTUSB_REALTEK case over to directly setting the > USB_QUIRK_RESET_RESUME on the usb_device and removes the now unused > BTUSB_RESET_RESUME code. > > BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1514836 > Fixes: 7d06d5895c15 ("Revert "Bluetooth: btusb: fix QCA...suspend/resume"") > Cc: Leif Liddy > Cc: Matthias Kaehlcke > Cc: Brian Norris > Cc: Daniel Drake > Cc: Kai-Heng Feng > Signed-off-by: Hans de Goede > Signed-off-by: Marcel Holtmann > Signed-off-by: Greg Kroah-Hartman > > --- > drivers/bluetooth/btusb.c | 21 ++++++++++----------- > 1 file changed, 10 insertions(+), 11 deletions(-) > > --- a/drivers/bluetooth/btusb.c > +++ b/drivers/bluetooth/btusb.c > @@ -23,6 +23,7 @@ > > #include > #include > +#include > #include > #include > > @@ -360,8 +361,8 @@ static const struct usb_device_id blackl > #define BTUSB_FIRMWARE_LOADED 7 > #define BTUSB_FIRMWARE_FAILED 8 > #define BTUSB_BOOTING 9 > -#define BTUSB_RESET_RESUME 10 > -#define BTUSB_DIAG_RUNNING 11 > +#define BTUSB_DIAG_RUNNING 10 > +#define BTUSB_OOB_WAKE_ENABLED 11 > > struct btusb_data { > struct hci_dev *hdev; > @@ -2969,6 +2970,12 @@ static int btusb_probe(struct usb_interf > if (id->driver_info & BTUSB_QCA_ROME) { > data->setup_on_usb = btusb_setup_qca; > hdev->set_bdaddr = btusb_set_bdaddr_ath3012; > + > + /* QCA Rome devices lose their updated firmware over suspend, > + * but the USB hub doesn't notice any status change. > + * explicitly request a device reset on resume. > + */ > + interface_to_usbdev(intf)->quirks |= USB_QUIRK_RESET_RESUME; > } > > #ifdef CONFIG_BT_HCIBTUSB_RTL > @@ -2979,7 +2986,7 @@ static int btusb_probe(struct usb_interf > * but the USB hub doesn't notice any status change. > * Explicitly request a device reset on resume. > */ > - set_bit(BTUSB_RESET_RESUME, &data->flags); > + interface_to_usbdev(intf)->quirks |= USB_QUIRK_RESET_RESUME; > } > #endif > > @@ -3136,14 +3143,6 @@ static int btusb_suspend(struct usb_inte > btusb_stop_traffic(data); > usb_kill_anchored_urbs(&data->tx_anchor); > > - /* Optionally request a device reset on resume, but only when > - * wakeups are disabled. If wakeups are enabled we assume the > - * device will stay powered up throughout suspend. > - */ > - if (test_bit(BTUSB_RESET_RESUME, &data->flags) && > - !device_may_wakeup(&data->udev->dev)) > - data->udev->reset_resume = 1; > - > return 0; > } > > >