Received: by 10.223.185.116 with SMTP id b49csp1054230wrg; Fri, 16 Feb 2018 11:34:18 -0800 (PST) X-Google-Smtp-Source: AH8x226tgYMJlCfcIusmyYaBJs6ZHAE1FDLew/6Z8ryvXHmT77c5ifQAsdBaNMYe/CPQwjb84vIS X-Received: by 2002:a17:902:20e5:: with SMTP id v34-v6mr2372232plg.82.1518809658024; Fri, 16 Feb 2018 11:34:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518809657; cv=none; d=google.com; s=arc-20160816; b=UYze/DrGJCD4S6tclZWGRK2+bO0fXkGFPjnj9Lz7lvvRefZZWhorq2+YK5SFl/xyN5 MoLo3mWM8GqBC3sPP6br8kJWrjtLHYNremEzfR6M1Hp7dTT046mKm6MdDoI60E+4MvxF dxf8+OJbgwd9tLILpfpDGTtdsRHvraMl7Rt91ObP82HUBy/TC7d75HUx9q0PUX0arVG7 2fSQ2NklztS/XmY0DhRnkPCwJhsTMVqI9UuPZbK5xcgt9Rc71kVG2bUUTGFXjPSMwrDe xbsV5l+8+b4JZAAV5oR2iW+TFIomlg+P8bwq2X8DPIewmNN5+yRxDaMRnxYk2BxGxJTT jttw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=B2fxnaMIXcBzYklBOXzL6BrxzrUF1pJSvnHwgCGFtAY=; b=YTLgBngrCowPqrEeL6nHSlqNNqHtnlqABdTZimvQnVvrgG/qboWP4osofzOIyYKao0 S1xvoP/98LL9AJY6hQJVKnINt261u9bgDpSmodZn6/gB5AJNKMZJpFWWdLofQJrwasIC ehnXdmHmq2ShOKNMwdMfRHIga8N08e95wh3vAw8gMqF6HNbhXQP2Jh2SSZ1GBP+Gkjfg 7aq3K7lBNGWm4rLfGVRolDNU8ckf5AqR2Hvbdsl2b9LRiToQxEmAFUopFprujRmVWZ0U kZGpH8J5sharxgJwxcm7o5LDCTO/hLwOYtAV52qVNqvLvath5A2Rc6K2J3hBEPxWr5Ox WrMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=BghIPa+C; 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 x9-v6si1834949plw.160.2018.02.16.11.34.03; Fri, 16 Feb 2018 11:34:17 -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=fail header.i=@gmail.com header.s=20161025 header.b=BghIPa+C; 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 S1423246AbeBPDYE (ORCPT + 99 others); Thu, 15 Feb 2018 22:24:04 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:45402 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423214AbeBPDYA (ORCPT ); Thu, 15 Feb 2018 22:24:00 -0500 Received: by mail-pg0-f67.google.com with SMTP id e11so1401872pgq.12; Thu, 15 Feb 2018 19:23:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=B2fxnaMIXcBzYklBOXzL6BrxzrUF1pJSvnHwgCGFtAY=; b=BghIPa+C0U0rnGXPqat1FJpEKxZKbIr3TJzPQjoI7x/UcE8FDZRZLm/aZd5B3IJX+t 1nBGPcwwfZwiodx3MbbOCWPLhYsME3G2zUo7G90Ah3BxsE//xO9+9/+Ud1aurPRaTd/O 8TPMlmQ9MroRfaWYZBFQcoftkj0k4+CZn//Xj5hOmgwhENT+IyHSv4ovm2OReBt+3Kld TkOB4CqlWQ5W1IIgyuHI/jmfQQI+W0EbNo2C/wXwZs7kQthLQLYlmxwi9QFzU6UOvZpl keTnYVpOnghFFpeBlaDH/8HBiUzXWTinx6kHEkDAwB5ARh/Js+5ZWdnds2Yz3w8s3cad stfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=B2fxnaMIXcBzYklBOXzL6BrxzrUF1pJSvnHwgCGFtAY=; b=nQeuOXc72WWYu85sI4kcfX+iGCKljto7tfBQA/9+jZuA2F+LvkwhdynNim9yWhk/vB Brt/2Pov4aTCfAFmxwC6fu6etEq74wlXwZMbpMlleKWnd4jGK5Lq1S3G9oWZWQIQSVS2 wI37YJVrtcOZjHv1I6IGUCpXxA2+ERC/uwFCaUPgyWdKGirFD9Ptn8NOItQYcb4xhnlC FKPGFu2Ouyr9QtSxCdreJbBjNeXXBb/ErskUERFTddoThoyolmFl1G3pP0mYhR2q6Qux MMFSuH4ceNu6TMR88JchH8F9AunNbYYYinf1FrdtQXSO9uCs0SdpSdROCoUje0VIVppG 4Rag== X-Gm-Message-State: APf1xPBGE5eqgJKsDHBnUoHDk9CGF5k5ocVeLGHJiBawnVYMj63y2ulY bENreOFDNc5MWRu53+W1dSE= X-Received: by 10.99.51.77 with SMTP id z74mr4069077pgz.120.1518751439279; Thu, 15 Feb 2018 19:23:59 -0800 (PST) Received: from server.roeck-us.net (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id z15sm21298503pgr.68.2018.02.15.19.23.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Feb 2018 19:23:58 -0800 (PST) Subject: Re: [PATCH] Bluetooth: btusb: Restore QCA Rome suspend/resume fix with a "rewritten" version To: Brian Norris , Hans de Goede Cc: Marcel Holtmann , Gustavo Padovan , Johan Hedberg , linux-bluetooth@vger.kernel.org, linux-serial@vger.kernel.org, linux-acpi@vger.kernel.org, stable@vger.kernel.org, Leif Liddy , Matthias Kaehlcke , Daniel Drake , Kai-Heng Feng , matadeen@qti.qualcomm.com, linux-kernel@vger.kernel.org, Greg Kroah-Hartman References: <20180108094416.4789-1-hdegoede@redhat.com> <20180213022455.GA151190@rodete-desktop-imager.corp.google.com> <8cd918fd-bf6f-70ac-e561-e7deffa695f0@redhat.com> <20180216022721.GA69988@rodete-desktop-imager.corp.google.com> From: Guenter Roeck Message-ID: <6b599dc2-adde-3b68-3e00-58a9d52a1bad@roeck-us.net> Date: Thu, 15 Feb 2018 19:23:55 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180216022721.GA69988@rodete-desktop-imager.corp.google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/15/2018 06:27 PM, Brian Norris wrote: > Hi Hans, > > On Tue, Feb 13, 2018 at 12:25:55PM +0100, Hans de Goede wrote: >> On 13-02-18 03:24, Brian Norris wrote: >>> On Mon, Jan 08, 2018 at 10:44:16AM +0100, Hans de Goede wrote: >>>> 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. >>> >>> Wait, is autosuspend actually broken for all QCA Rome chipsets? I don't >>> think so -- I'm using one now. >> >> And have you manually enabled USB autosuspend for it, or are you >> running something which might have done so, e.g. powertop --auto-tune ? >> >> Because if you did not do that then you're already not using autosuspend >> for your QCA devices and this patch will change nothing. > > I use a set of udev rules that manually whitelist devices for > autosuspend. You can see it here: > > https://chromium.googlesource.com/chromiumos/platform2/+/43728a93f6de137006c6b92fbb2a7cc4f353c9bf/power_manager/udev/gen_autosuspend_rules.py#83 > > You'll find at least one Rome chip in there. > >>> Thus, this is a poor solution, which >>> negatively affects my systems. However, I see that this patch was >>> applied regardless... >> >> Note that there already is a quirk to handle broken suspend/resume >> behavior on ALL QCA devices in older kernels. Also note that the > > Yes, and the quirk was broken, and I made sure it got reverted when it > broke my devices ;) > >> patches series which this commit builds on top of was already >> setting USB_QUIRK_RESET_RESUME for some devices in >> usb/core/quirks.c. >> >> All my commit does is instead of duplicating all the QCA USB-ids in >> usb/core/quirks.c, move the setting of USB_QUIRK_RESET_RESUME >> to btusb.c so that we don't need to duplicate the USB-id tables. > > I was slightly more OK with marking specific IDs as broken, because > those IDs didn't happen to be ones that I knew were currently working. > Now you're breaking my systems again. But this time, it's more subtle > because bluetooth will still work, but we just suck more power leaving > our USB port active all the time. > >> The result of the combination of these patches is that the custom >> DIY reset on resume handling btusb.c was doing is now replaced >> by setting the standard USB-core USB_QUIRK_RESET_RESUME quirk. >> >> As a (desirable) side effect this also disables USB autosuspend >> for QCA devices since the USB-core does not allow USB autosuspend >> on devices with the USB_QUIRK_RESET_RESUME quirk. Testing has shown >> this to be necessary on at least some QCA devices and given that >> these devices tend to loose there firmware on a suspend, it seems >> sensible to not allow autosuspend on them. > > But you're not accurately targeting the "some". AFAICT, you're wasting > power on my system. > >>> What justifications was found for this anyway? AIUI, this is a platform >>> bug, and not entirely a chipset bug. >> >> No this is believed to be a chipset issue, hence also the quirk in >> older kernels to always reset these devices after a normal suspend/resume. > > I have Qualcomm telling me this is a platform issue. I haven't noticed > problems with autosuspend nor system suspend/resume on my platform. Do > you have any more detail on this issue? Have you consulsted QCA folks? > > Unfortunately, Greg is already queueing this patch up to all the -stable > trees, so I'm going to have to revert it yet again in Chromium > kernels... > Grumble Grumble Grumble. I'll try to remember to revert this patch when I merge v4.14.20 into chromeos-4.14. Please remind me if I forget for some reason. I don't see it queued in v4.4.y - is that still coming ? Hope I won't miss it. Guenter