Return-Path: From: "Ge, Ethan" To: "Ge, Ethan" , "An, Tedd" , "Poulain, Loic" CC: Marcel Holtmann , "linux-bluetooth@vger.kernel.org" Subject: RE: [PATCHv2] Bluetooth: btusb: Fix Intel controller hang after shutdown Date: Mon, 8 Jun 2015 07:48:03 +0000 Message-ID: <86D221DC0B85F94D9B05B97827669A3403CA6EA0@PGSMSX106.gar.corp.intel.com> References: <1432218957-3400-1-git-send-email-loic.poulain@intel.com> <69A96222-5518-4341-9F0B-32F3CEACCC35@holtmann.org> <55703D8F.6010602@intel.com> <41F028F6-E05E-4816-ACE8-3B0F121F2081@intel.com> <86D221DC0B85F94D9B05B97827669A3403CA5E7F@PGSMSX106.gar.corp.intel.com> In-Reply-To: <86D221DC0B85F94D9B05B97827669A3403CA5E7F@PGSMSX106.gar.corp.intel.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 List-ID: Q29ycmVjdCBtYWlsIGNvbnRlbnQuDQoNCkhpIExvaWMsDQoNCkkgYW0gaGVscGluZyBUZWRkIHRv IHRlc3QgdGhpcyBwYXRjaCBub3csIGJ1dCBJIGhhdmUgYSBxdWVzdGlvbiBhYm91dCB0aGlzIHBh dGNoLiANCg0KRm9yIHlvdXIgY29tbWVudCBJdCBsb29rcyBsaWtlIHlvdSB3YW50IHRvIHNlbmQg SENJIFJFU0VUIGNvbW1hbmQgdG8gY29udHJvbGxlciBmaXJzdCB3aGVuIEJUIGVuYWJsZWQsIHRo ZW4gSSBmb3VuZCBiZWxvdyBwYXRjaCBhbHNvIGRvIHNhbWUgdGhpbmcgYXMgeW91ciBwYXRjaC4g TWF5IEkga25vdyBhbnkgZGlmZmVyZW5jZSBmb3IgeW91ciBwYXRjaD8gVGhhbmtzLg0KDQpjb21t aXQgZGZmZDMwZWU5NjE5Y2NkNzE1M2YxODYxYmEwNDM2YmJjNDQwMGYzNg0KQXV0aG9yOiBUZWRk IEhvLUplb25nIEFuIDx0ZWRkLmFuQGludGVsLmNvbT4NCkRhdGU6ICA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