lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <540B4159.9000003@lwfinger.net>
Date:	Sat, 06 Sep 2014 12:16:09 -0500
From:	Larry Finger <Larry.Finger@...inger.net>
To:	Marcel Holtmann <marcel@...tmann.org>
CC:	"Gustavo F. Padovan" <gustavo@...ovan.org>,
	Johan Hedberg <johan.hedberg@...il.com>,
	linux-bluetooth@...r.kernel.org, netdev@...r.kernel.org,
	Champion Chen <champion_chen@...lsil.com.cn>,
	Stable <stable@...r.kernel.org>
Subject: Re: [PATCH] bluetooth: btusb: Fix issue with suspend

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@...lsil.com.cn>
>> Signed-off-by: Larry Finger <Larry.Finger@...inger.net>
>> Cc: Stable <stable@...r.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


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ