Received: by 10.223.185.116 with SMTP id b49csp1015763wrg; Fri, 16 Feb 2018 10:51:54 -0800 (PST) X-Google-Smtp-Source: AH8x224xcFvCozIXTEBQDiDQvmI6W30NYTDjYeT26ov1MKOmkJW/SvfXFq+vysjtqyKYxwZsrZ2x X-Received: by 10.98.141.66 with SMTP id z63mr6891260pfd.165.1518807113998; Fri, 16 Feb 2018 10:51:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518807113; cv=none; d=google.com; s=arc-20160816; b=Zcyrf6N9TnhTOa/XScg2hgfMuPl/ySG7/X4AkqRGKUg3ElJTumCXyb4SMeX8UBlfw4 mJ7j0TRqXIvzg9WXMujwt3SoxcApEEfJr5t9ZZjXLYqv2gaEcF8y7x6hwgBJhJJCq1hd cKstv3aO9xysDYRvqV6koP5RDUdz+DeVoJ4s3xbSe5YAM3ylcFlYBjcVjePtmBk9ZZuJ bCFHn3wQee+XliDKhdr7BkcQTwktfJTC6nTmIpZmJkT4Xga+srdtDnv7k3Mc10k38xVD WfRQfPuEilE9y/0GOGyH19saUmDZsV5Q+agztfrsRO/MsFElJIcGCmqLiAsW9W+2XCQG DL5Q== 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:arc-authentication-results; bh=bwpf6wr2ePIcU7+wXq1t2MXUXnsmgt8EW4uGK/EUPO4=; b=xR/Ogq/IABTcc8MjIoAII4DzGOjatrIkNlaq5fptQfnxJaPF8NlEIgm4fnoNeqPBYK EfFiAgeU/tRryTEa6fJMrkoxyjHw2v78wdDfZe7IJ8l65qx9/gzLFUCY7TUr+FkeTWw+ ntwFoTCHcLsOXYQWN6PP1zuXigucEFoZZPuwOCCyZWgGzc8qp0MCJJtWm5Ps93gyCVMX TpY5CdtbzJHfoZaE0CTOHlExTUUWH8dGkEG7QArM1V9LHz6v1MmOZHLJgbaphQk77/eT 6TIGOt9ttc0etYU8GEV2Sbp3huNHawybTBPUgZ6o70L5oXm2z/XMEXk4HZyZ/ZrL0UZj c4lA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si1259629pgp.414.2018.02.16.10.51.39; Fri, 16 Feb 2018 10:51:53 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754898AbeBPInV convert rfc822-to-8bit (ORCPT + 99 others); Fri, 16 Feb 2018 03:43:21 -0500 Received: from coyote.holtmann.net ([212.227.132.17]:47026 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754775AbeBPInT (ORCPT ); Fri, 16 Feb 2018 03:43:19 -0500 Received: from marcel-macpro.fritz.box (p5B3D2E4B.dip0.t-ipconnect.de [91.61.46.75]) by mail.holtmann.org (Postfix) with ESMTPSA id CD0E3CF2BB; Fri, 16 Feb 2018 09:49:25 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: [PATCH] Bluetooth: btusb: Restore QCA Rome suspend/resume fix with a "rewritten" version From: Marcel Holtmann In-Reply-To: <20180216022721.GA69988@rodete-desktop-imager.corp.google.com> Date: Fri, 16 Feb 2018 09:43:16 +0100 Cc: Hans de Goede , "Gustavo F. Padovan" , Johan Hedberg , Bluez mailing list , linux-serial@vger.kernel.org, ACPI Devel Maling List , stable , Leif Liddy , Matthias Kaehlcke , Daniel Drake , Kai-Heng Feng , matadeen@qti.qualcomm.com, Linux Kernel Mailing List , Greg Kroah-Hartman , Guenter Roeck Content-Transfer-Encoding: 8BIT Message-Id: <6A7B0B8A-71AD-4FC6-AE2F-B959B3C4BA00@holtmann.org> 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> To: Brian Norris X-Mailer: Apple Mail (2.3445.5.20) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Brian, >>> 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... if this is a platform issue, then doing this based on VID:PID pairs is wrong no matter what. Then again, if we have really dedicated VID:PID combination for certain platforms, we could also just whitelist them in the driver. The btusb.c already contains an extra blacklist check. It is easy to add another USB ID table for a QCA whitelist. Regards Marcel