Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5990719ybe; Tue, 17 Sep 2019 17:34:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZuBzpdJoyEJUe1WeqnDBelGSVK2OwfKoK2IoaaxewvabwAloB0a6rBz12KEIpYlrXdqGy X-Received: by 2002:a17:906:c08:: with SMTP id s8mr7328446ejf.66.1568766897985; Tue, 17 Sep 2019 17:34:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568766897; cv=none; d=google.com; s=arc-20160816; b=AT3+cfnMwrz4rKaBlPlWhoexOMVPB7PebLAfNTWfs8ziWGsL+QFIVhGCWVIsIEQxbl CHVR/gq4GgweUcL+cpbyZKVFX0xeIqQUSuqejYFwfg3h0kIcMKK+01NnXzM4RR8UJsPY GcNh4B2S9FLQTTN4TeFIpkzrYgYSvKzwLSnOJTrYW8FGc/InRM9L7UkNNFIAEBnYLE67 M1WsDodbiIH5JNp8bhzab0GEXuQBGQCvI3IVzM1sKPPnAzssPkb1b814pVjxbxvhip9z QJaRQXyHPiVygZ5IbgQ8gTyyBoZolFW/JBXLsP9uRPBtTSgDPIyAAINnSKCGv2GLTXxQ 0EOg== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=KQLz48qGupB3U3q6Hm9UR083MeuUpn5l8eEYZ8P5LH4=; b=sSFQUMvUdSKwECzO1H2YRQ/Fv+b1iORXyxSBfQjWBeqdRpwCBojlwZY90dM8jf0V2J sSHuZkuaGz8ZbhyY9rlGxfvm4sQFRHYn8+KzEDYp5FVzjcUwsi9XqWZbtJsjNsp5Z5lI mNkOTOj3uzXcCG/OlXL7HCjphGgCXjphrwOup/ebP9N2cnbx9HwN24ml765KrmkZp7mG 6rHwxI8Ju0I+MKYlXmmcTQCsrqIWkZRTdHqDmBDdkVFcfHDwSzVebOkmbr45JvSpgyTJ TT/YCyrPagNLI7yR6QJROdK7MbB8JGt60O2xvWCzZAVHi4lglMOSAy22MlRk1s3MIoSQ GNBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=BCnH8N+v; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b31si2697131ede.12.2019.09.17.17.34.15; Tue, 17 Sep 2019 17:34:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=BCnH8N+v; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726720AbfIQV1I (ORCPT + 99 others); Tue, 17 Sep 2019 17:27:08 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:35568 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727247AbfIQV1F (ORCPT ); Tue, 17 Sep 2019 17:27:05 -0400 Received: by mail-pf1-f196.google.com with SMTP id 205so2914397pfw.2 for ; Tue, 17 Sep 2019 14:27:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KQLz48qGupB3U3q6Hm9UR083MeuUpn5l8eEYZ8P5LH4=; b=BCnH8N+v2Ndf8nZ0xfh7LR+M4kkjyoeZ9PT63+Jj6BMVvaEbYgtYK8KXQItxswnrYd 5VAsNknB30Szust6QXMPRDzNNgR6pSwWmDW0Cxodb6nQbCR0nWNkMebeWcW6oOxGJaOh Y6tn4n6yykauA7gfG2Q2Cz+h/TV3DMQ0bSVFw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KQLz48qGupB3U3q6Hm9UR083MeuUpn5l8eEYZ8P5LH4=; b=l/NPFO9w64ARouavf21L7wQTza20gXYmG3YoG3wx+5Ti/0GmYd+a8KZK1/hPBZLetS AMXPCs7u4YYRHuhfHqcaKjXZ0sM4bBLF/5LagxC4pewd1ziunPAQhN+WRl6igf+sMUv+ gfSD0qnzJ4Z7W//I3ugBY4hGFRYS0pZBFShDcxVXj7l3DfhsiwzAQAjAenT9a5FxmgGA pzViAOY95JtSIHFndZwZAODcvs7Bviz8IxzhfmCfusKnnNflj9ZyqwbYQ8qbWKmuQN4W 2ev4TaPIFEeGYCwQ1sJA88q4BNzkgRIc0WjnL/lWfjC2CW/JBXUuueVu934gMDsVPK1h nNsg== X-Gm-Message-State: APjAAAWSY8/xrGBL/atpc23DxTIFl49V5iiBsGp99TGJy0y67Bwi7Cxb NMY6f2AH3qIxzzg9SWSpGFBVqqRAExs= X-Received: by 2002:a63:9245:: with SMTP id s5mr862110pgn.123.1568755624437; Tue, 17 Sep 2019 14:27:04 -0700 (PDT) Received: from apsdesk.mtv.corp.google.com ([2620:15c:202:1:e09a:8d06:a338:aafb]) by smtp.gmail.com with ESMTPSA id l7sm8489803pga.92.2019.09.17.14.27.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 14:27:04 -0700 (PDT) From: Abhishek Pandit-Subedi To: linux-bluetooth@vger.kernel.org, linux-usb@vger.kernel.org Cc: dianders@chromium.org, Abhishek Pandit-Subedi , Kai-Heng Feng , Alan Stern , Hui Peng , linux-pm@vger.kernel.org, Johan Hedberg , Suzuki K Poulose , Mark Brown , "Rafael J. Wysocki" , Wolfram Sang , linux-kernel@vger.kernel.org, Marcel Holtmann , Len Brown , Mathias Payer , Dmitry Torokhov , Greg Kroah-Hartman , Mans Rullgard , Pavel Machek , YueHaibing Subject: [PATCH 0/2] Reset realtek bluetooth devices during user suspend Date: Tue, 17 Sep 2019 14:27:00 -0700 Message-Id: <20190917212702.35747-1-abhishekpandit@chromium.org> X-Mailer: git-send-email 2.23.0.237.gc6a4ce50a0-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On a Realtek USB bluetooth device, I wanted a simple and consistent way to put the device in reset during suspend (2 reasons: to save power and disable BT as a wakeup source). Resetting it in the suspend callback causes a detach and the resume callback is not called. Hence the changes in this series to do the reset in suspend_noirq. I looked into using PERSIST and reset on resume but those seem mainly for misbehaving devices that reset themselves. This patch series has been tested with Realtek BT hardware as well as Intel BT (test procedure = disable as wake source, user suspend and observe a detach + reattach on resume). Abhishek Pandit-Subedi (2): usb: support suspend_noirq Bluetooth: btusb: Reset realtek devices on user suspend drivers/bluetooth/btusb.c | 26 ++++++++++++++++++ drivers/usb/core/driver.c | 56 +++++++++++++++++++++++++++++++++++++++ drivers/usb/core/usb.c | 6 +++++ include/linux/pm.h | 8 ++++++ include/linux/usb.h | 3 +++ 5 files changed, 99 insertions(+) -- 2.23.0.237.gc6a4ce50a0-goog