Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3881784pxf; Tue, 6 Apr 2021 02:37:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxHxXC+3OqgMx9aX0o8tujf0sFbphieE2uDCjFYUWuVmqQ0XxcGyR9f/DyKpdWimnSTEqC X-Received: by 2002:a02:3b10:: with SMTP id c16mr28591408jaa.48.1617701830182; Tue, 06 Apr 2021 02:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617701830; cv=none; d=google.com; s=arc-20160816; b=EzVckmV2aVPy6vE02bF7eZpoaCy727EplUesXvHY2iVuPBENVfhCzTqYPXbE6W1Vwk Cc0Iw0wRg2mITt48V/aFNgFfx6v0P4BRHHmSaRuDWMp61pYeXFPcy5iCzeDnzzn9A3O4 5wZOXYX7nu5fAoDJcARSVhvPumVr0Y4oYhnn5plVIhIvgd1SqJRQI9y2zviTuqRn0N2I LyFcVkKejFWUiob4tfjDRYwKlLHgxZS4uEaRzu6T/yGC9Sy7zkKOZE9y+ad2R9lqXsrx APPQkzlPcx0YW377cMquTcQc0+MxPP+l/7XUcb/pK4Vmb6m94wnmaPUbVqBHTUn2YvLg o7pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=v++je7X7UZ6KTTWUIYkq0B1XsnNaBOenCbYwRjCUGPA=; b=VHh8DPbqdOhe1tAcAsmlfc+0t1WOcgYSykLZ0mhkHOSTlW92fymn5gJhMKFK22BJVV o2hVcFf/gQV5lQX2NRHAKQtzShiY8KK4Tq3hJTIIPOqeSgUsxtLfpu/S69V/e3Wp2dYd WZwMC9Nlxr5JXpTZigEnI681srLJrwXolqpzzFcUsoD/jLfRxS6vwl4u1tbzxKL+K41X /YlVixIwh1HHuW84wn3HDGa+wn2nidfbElraSDGKDnSLLhFC0mqviBjhqhJ8pu/uMtGJ 8msPukcqpCYpPRSUwxR2sg5prgQ7nvaU7xZSIYECPPh/f+GIoCIBU6FNAxZvNSoP5far n9GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=M37O5FzB; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f6si16575720jaj.119.2021.04.06.02.36.54; Tue, 06 Apr 2021 02:37:10 -0700 (PDT) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=M37O5FzB; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239310AbhDEUfs (ORCPT + 99 others); Mon, 5 Apr 2021 16:35:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:48603 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235275AbhDEUfs (ORCPT ); Mon, 5 Apr 2021 16:35:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617654940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v++je7X7UZ6KTTWUIYkq0B1XsnNaBOenCbYwRjCUGPA=; b=M37O5FzBy+ICktXqEVpH+zSp/f/wBtLtjnJMGVM6kD1LzS/IoX9pRxSqN26ufqOw3ESTqj n3/yEG1F6SrSApTsa0VJi4dP/3PYwLyviCi4vdeJbKvwNjmqIECQuAkAwxv5Jk8o7OYGe2 lPbLwvwsP3OeoASuW4I7AVcGbh8Rb48= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-393-7psx3p9jN_KG4ZiYa_uSfg-1; Mon, 05 Apr 2021 16:35:39 -0400 X-MC-Unique: 7psx3p9jN_KG4ZiYa_uSfg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CACDE881D66; Mon, 5 Apr 2021 20:35:37 +0000 (UTC) Received: from x1.localdomain (ovpn-112-31.ams2.redhat.com [10.36.112.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 92AFD610A8; Mon, 5 Apr 2021 20:35:36 +0000 (UTC) From: Hans de Goede To: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz Cc: Hans de Goede , Hui Wang , linux-bluetooth@vger.kernel.org Subject: [PATCH 5.12 regression fix resend 1/1] Bluetooth: btusb: Revert Fix the autosuspend enable and disable Date: Mon, 5 Apr 2021 22:35:33 +0200 Message-Id: <20210405203533.17091-2-hdegoede@redhat.com> In-Reply-To: <20210405203533.17091-1-hdegoede@redhat.com> References: <20210405203533.17091-1-hdegoede@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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") Acked-by: Hui Wang 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 52683fd22e05..5cbfbd948f67 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -4849,8 +4849,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) @@ -4910,9 +4910,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 -- 2.30.2