From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933239AbcBPTKF (ORCPT ); Tue, 16 Feb 2016 14:10:05 -0500 Received: from home.keithp.com ([63.227.221.253]:59767 "EHLO elaine.keithp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933090AbcBPTJ6 (ORCPT ); Tue, 16 Feb 2016 14:09:58 -0500 From: Keith Packard To: Oliver Neukum Cc: linux-usb@vger.kernel.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: check for signals in chaoskey read function In-Reply-To: <1455611093.4532.2.camel@suse.com> References: <1455590972-2120-1-git-send-email-keithp@keithp.com> <1455611093.4532.2.camel@suse.com> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Tue, 16 Feb 2016 11:09:55 -0800 Message-ID: <86h9h8ii9o.fsf@hiro.keithp.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Oliver Neukum writes: > why is this needed? You are doing this right after a > mutex_lock_interruptible(). When the device isn't contended, this mutex will never block and so mutex_lock_interruptible will never check for a signal. I had mistakenly assumed that usb_bulk_msg would abort when a signal was delivered, but it doesn't. I could be convinced that the driver should be using a different path through the USB stack that would allow a signal to wake up while waiting for the URB to complete, but this patch at least avoids needing to wait for a huge read to finish. The other option would be to eliminate the loop reading multiple URBs from the device, but that would reduce the available bandwidth from the device pretty considerably. =2D-=20 =2Dkeith --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIVAwUBVsN0A9siGmkAAAARAQhHjQ/5AaC1qa9B5k/obiig1tsD6HhMnW5ius5k ANZig7qIVgwg6+tLLBSiyIlia5MoCJIANMcyEoiXKuHd6zrQRSx7VcRAY0xKATNg KsAzow+VGwwqqCT83FKqqbyTkOJl1N+T7XjyxBFoU/3hCLEf8VuIhlTMfK7i6bnD WfYTWwj1spjqRk62p7/o8m05OWPiG7+FFmLg149jK6Jn8voyNn+pCnUOUFFBhSji 7FvAgqRyvjekQay/VDPYIRkJyWz7AEtQgXBW337Mu7my+5cQLoKrVaH36+jdkSoC L0icrktBNYnWvD3lv9YuVRTFjh/Xv3TUWToIsVMWnAx0oO3Rf5QAEupMoQaS/Mbn W8rSWr/qJE4FdxNGMhLOR9A9jqSyRUlmn0zzaKvnYKv/MPSsDL4V2eJnaBEWJ8Fk Iu85UA/MOpjD1CjJGj1NVg+98okzpM8Y8LlDRvbku5NvFr1E8eZ30m3/rKmI3nnU 18dpyztf4EWhxFAX8b4U7Du9ELq+tXI6fiQFnXyBr4qDwC2jc1HrIbkiAT4fgP9e zmQopx9Zx1aW0e3kAYLO2VeyVE6EL9OTmYqJKQPA4ax+8dpoSbR7VPidtL0MSTY/ Yz+pdxveBaaHGW2lp5EC2RIL0fa927aum/fiKVpHtj8l9QTQe68Cr95bC6oxajWI ip3TDiJteqA= =Ek/I -----END PGP SIGNATURE----- --=-=-=--