From: Larry Finger <Larry.Finger@lwfinger.net>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: "Gustavo F. Padovan" <gustavo@padovan.org>,
Johan Hedberg <johan.hedberg@gmail.com>,
linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org,
Champion Chen <champion_chen@realsil.com.cn>,
Stable <stable@vger.kernel.org>
Subject: Re: [PATCH] bluetooth: btusb: Fix issue with suspend
Date: Sat, 06 Sep 2014 12:16:09 -0500 [thread overview]
Message-ID: <540B4159.9000003@lwfinger.net> (raw)
In-Reply-To: <6DF81E54-681F-4B18-95C7-F4684FF19786@holtmann.org>
On 09/06/2014 12:02 PM, Marcel Holtmann wrote:
> Hi Larry,
>
>> Suspend could fail for some platforms because
>> btusb_suspend==> btusb_stop_traffic ==> usb_kill_anchored_urbs,
>>
>> When btusb_bulk_complete returns before system suspend and resubmits an urb,
>> the system cannot enter suspend state.
>>
>> Signed-off-by: Champion Chen <champion_chen@realsil.com.cn>
>> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
>> Cc: Stable <stable@vger.kernel.org>
>> ---
>> Johan,
>>
>> To help Champion with the process, I have formatted the patch in
>> the correct manner. I hope I understand the issue correctly and
>> stated it in a coherent manner in the commit message.
>>
>> Larry
>> ---
>> drivers/bluetooth/btusb.c | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
>> index 292c38e..45a7211 100644
>> --- a/drivers/bluetooth/btusb.c
>> +++ b/drivers/bluetooth/btusb.c
>> @@ -330,6 +330,9 @@ static void btusb_intr_complete(struct urb *urb)
>> BT_ERR("%s corrupted event packet", hdev->name);
>> hdev->stat.err_rx++;
>> }
>> + } else if (urb->status == -ENOENT) {
>> + /* Avoid suspend failed when usb_kill_urb */
>> + return;
>> }
>>
>> if (!test_bit(BTUSB_INTR_RUNNING, &data->flags))
>> @@ -417,6 +420,9 @@ static void btusb_bulk_complete(struct urb *urb)
>> urb->actual_length) < 0) {
>> BT_ERR("%s corrupted ACL packet", hdev->name);
>> hdev->stat.err_rx++;
>> + } else if (urb->status == -ENOENT) {
>> + /* Avoid suspend failed when usb_kill_urb */
>> + return;
>> }
>
> this one is utterly bogus. Either urb->status is 0 or it is -ENOENT, but it will not be both. I think you put it to the wrong if clause.
Thanks for the review. Obviously, you are correct. A revised patch will be sent
soon.
The code sent by Champion is now posted at
http://github.com/lwfinger/rtl8723au_bt/new. It works for everyone that has
tested it.
Larry
next prev parent reply other threads:[~2014-09-06 17:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-05 15:16 [PATCH] bluetooth: btusb: Fix issue with suspend Larry Finger
2014-09-06 17:02 ` Marcel Holtmann
2014-09-06 17:16 ` Larry Finger [this message]
2014-09-06 17:35 ` Marcel Holtmann
2014-09-06 19:05 ` Larry Finger
2014-09-06 19:12 ` Marcel Holtmann
2014-09-06 19:19 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=540B4159.9000003@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=champion_chen@realsil.com.cn \
--cc=gustavo@padovan.org \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).