Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp839696pxb; Thu, 25 Feb 2021 17:08:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJymV5RALHeQItqIj9I2ToiTcaqivgYlralrLKwNxpeW7vJjwcz4wMSYaSkg+TXquRaGfGwI X-Received: by 2002:a17:906:f119:: with SMTP id gv25mr431971ejb.293.1614301716026; Thu, 25 Feb 2021 17:08:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614301716; cv=none; d=google.com; s=arc-20160816; b=ARcNlkAcd7m/zHlAdHd3vdcsXhvboTSIYWFPxSEeHeZ4b5Jvbq0YXIbcwRoLTmaITY 64niJmex93Nc3jCvhpDSvqiDF38P0mPhC6EafacipnHcLN5OUj9PcpHAeleqjfka2WFc uBM9eRkZY6XDmEbYDVW+sFe6+iOzIA0cjXRnwI6KnaLlVzIIiR4RjQZEha8RsIsBJHKi a5OTrQjLmVniX/XxpJ0zeefSr85/Vg/GVsllJhXbFFm8Cx1GF20aLKthBNiM131fsacj T364grdv0nFFpYDDxPcJddgbCY8YJqhtikVMhBJzsde7895hW/U/qGY5aPmGnr+s87Ly rSFg== 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=2whRCQZKFNhL6iagyWYw4fh8gooa/VmNdFnlI4DK+7E=; b=Tg0iejl1/4zGx7jZzAbYAhrkEEqTj/s9rptGO40ujLG27cSkGd15C0dCfokRKb8fLA Mly7Mct4nokPZNyBTivGAgnomUwzXdL2wJfGDFfwNXDZYSi5NUmlUpDSwJ5Z7FpvD5WH vnR9I/i4uc8NVp/iWHrnLx3sxFWe9GYZPo6mtfydJ7FXu1eurKzPZhpsDcVeFgPWC/tm D9gjxe3ZzVtiBITanDqQw+i0AwumSchalUwgPsW5cMuQDihDSb/rdxYkeI60jJSN+BNw 81kQpK9A31DIIWqytveN1t2EfTqumBtfW+g7LzldbYbHVsa12iIYcp8O7DkE2Owr8L3v lo0A== 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 q21si4656093ejo.166.2021.02.25.17.08.12; Thu, 25 Feb 2021 17:08:36 -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 S232237AbhBZBGB (ORCPT + 99 others); Thu, 25 Feb 2021 20:06:01 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:55786 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230100AbhBZBFx (ORCPT ); Thu, 25 Feb 2021 20:05:53 -0500 Received: from [123.112.65.122] (helo=[192.168.0.106]) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lFRZ9-0000gF-P2; Fri, 26 Feb 2021 01:05:12 +0000 Subject: Re: [PATCH 5.12 regression fix] 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> <20210218123728.17067-2-hdegoede@redhat.com> From: Hui Wang Message-ID: <9e4478ca-aa70-8b93-3068-f11b5a2107a0@canonical.com> Date: Fri, 26 Feb 2021 09:05:06 +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-2-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 Acked-by: Hui Wang On 2/18/21 8:37 PM, Hans de Goede wrote: > 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. > > This reverts commit 7bd9fb058d77213130e4b3e594115c028b708e7e. > > Cc: Hui Wang > Fixes: 7bd9fb058d77 ("Bluetooth: btusb: Fix the autosuspend enable and disable") > Signed-off-by: Hans de Goede > --- > drivers/bluetooth/btusb.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c > index 54a4f86f32e2..03b83aa91277 100644 > --- a/drivers/bluetooth/btusb.c > +++ b/drivers/bluetooth/btusb.c > @@ -4627,8 +4627,8 @@ static int btusb_probe(struct usb_interface *intf, > data->diag = NULL; > } > > - if (!enable_autosuspend) > - usb_disable_autosuspend(data->udev); > + if (enable_autosuspend) > + usb_enable_autosuspend(data->udev); > > err = hci_register_dev(hdev); > if (err < 0) > @@ -4688,9 +4688,6 @@ static void btusb_disconnect(struct usb_interface *intf) > gpiod_put(data->reset_gpio); > > hci_free_dev(hdev); > - > - if (!enable_autosuspend) > - usb_enable_autosuspend(data->udev); > } > > #ifdef CONFIG_PM