Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7271255pxb; Thu, 18 Feb 2021 06:06:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJytTj5954tcTsiAWRRMnqyzPZSJPRD9sihzKazygGSv1DbfidAwAyHaWZaufMC9BPiJfBvW X-Received: by 2002:a17:906:6943:: with SMTP id c3mr4050838ejs.133.1613657204633; Thu, 18 Feb 2021 06:06:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613657204; cv=none; d=google.com; s=arc-20160816; b=Wk2sMTwkxyyyp9ZZc8GrxskaKp2TDZCvJnWYAkMy6eaVvH2TKsoUuuSGe068qDUTvl Szh4TBapEBLoG+wV5hd1uNJOo2uIY3aaoyCa7czZ3tjMZbIERgU9vP/5VldUxxJV81Ni cXt6v+MqSBV1rW4+CvOpE4KjVU1125qT0oIEyUwrDDMho4pkVvjNIShvnS0ptp44L6N5 d0lU+EzfKsJqKN5BD68wqM2AnTsGOx3W5UdbNDzXg6GSwKAaX0Fz03d2fwMwkBM0dMLF O3Q+xo2BufCeykrRJbUEZzR3SA+20KutFskc/hGhzl21qs0bVVscdDXlJHNr2nPb7dta Dk8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=betO9GoaaqvpfkxBm/rutAC4zJebJ6sLVYc1fE722PE=; b=p7FMvg7WM2hpV4fJjMKTiwyl3lNEJGS1zk9Xu8KK0gu/R8q14XstnzwNO6LAcoksJw FDVMEPNbcLQo+UfCyR3CcD6Wtxm5F/Aho1RugHlstMd7mA+pzGYWzqtGkk+Kg/5DeEex Seugjf+oQbP5WH3TnFw4GQcviDQGlW2A2ucIAmW9E+u+dxFYuiIVsp5+xifeMeBqZMm5 nxmTD9zHOfoy43GxCOiysoQGyoKfiQm07IHORQI2D48Iq0KuoY8NT0pdj8MM+oGQ9Ebv MNIlc1oCoNi5LExH2bc6mK/VTywPiLCEhrWhLerwljH//09jd/O88bmajeOwdKnD4lxI nMlg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-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. [23.128.96.18]) by mx.google.com with ESMTP id h24si4177432ejt.11.2021.02.18.06.05.44; Thu, 18 Feb 2021 06:06:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-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 S231801AbhBROAe (ORCPT + 99 others); Thu, 18 Feb 2021 09:00:34 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:34270 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230499AbhBRNd4 (ORCPT ); Thu, 18 Feb 2021 08:33:56 -0500 Received: from [123.112.65.49] (helo=[192.168.2.108]) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lCjQI-0007Mq-EE; Thu, 18 Feb 2021 13:32:50 +0000 Subject: Re: [PATCH 5.12 regression fix 0/1] Bluetooth: btusb: Revert "Fix the autosuspend enable and disable" To: Hans de Goede , Marcel Holtmann , Johan Hedberg Cc: linux-bluetooth@vger.kernel.org References: <20210218123728.17067-1-hdegoede@redhat.com> From: Hui Wang Message-ID: <4762ccc8-457b-ae35-29ad-39a4e7e4d80e@canonical.com> Date: Thu, 18 Feb 2021 21:32:36 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20210218123728.17067-1-hdegoede@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On 2/18/21 8:37 PM, Hans de Goede wrote: > Hi All, > > >From the commit msg: > > """ > drivers/usb/core/hub.c: usb_new_device() contains the following: > > /* By default, forbid autosuspend for all devices. It will be > * allowed for hubs during binding. > */ > usb_disable_autosuspend(udev); > > So for anything which is not a hub, such as btusb devices, autosuspend is > disabled by default and we MUST call usb_enable_autosuspend(udev) to > enable it. > > This means that the "Fix the autosuspend enable and disable" commit, > which drops the usb_enable_autosuspend() call when the enable_autosuspend > module option is true, is completely wrong, revert it. > """ > > Hui, I guess that what you were seeing is caused by: > /lib/udev/hwdb.d/60-autosuspend-chromiumos.hwdb Hi Hans, You are right, the VID:PID of the BT adapter on my machine is in that file, the autosuspend is enabled by udev instead of kernel. I tested on another machine whose BT adapter's ID is not in that file, the autosuspend is controlled by btusb.enable_autosuspend=0. Your reverting patch is correct. > Which enables autosuspend on a bunch of USB devices based on VID:PID, > overruling the kernel defaults. This is done to get better power-consumption > with devices where it is known that it is safe to do this. > > I guess that that the device you were testing this with is on that list. > So the proper fix would be to edit that file and remove your VID:PID from it. > > Hui, also next time please try to Cc the original author of the code you > are modifying. A simple "git blame drivers/bluetooth/btusb.c" would have > found you commit eff2d68ca738 ("Bluetooth: btusb: Add a Kconfig option to > enable USB autosuspend by default") and then you could have added me to > the Cc and I could have nacked the patch before it got merged. OK, got it. will be careful and will Cc to the original author next time. > I happen to spot this this time since I was looking into some other > btusb issue. But if I had not spotted this, this would have caused > a significant power-consumption regression on many laptops. > > Btusb might not look like a big consumer, but if it does not autosuspend > it often is the only USB device not autosuspending, keeping the XHCI > controller awake, which in turn is keeping a whole power-plane awake on > what once used to be the southbridge. At least on Skylake era hw this > could lead to an extra idle powerconsumption of 1W. So a small change > can cause a big impact. > > Regards, > > Hans > >