From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Subject: Re: [PATCH] HID: hidraw: fix nonblock read return EAGAIN after device removed Date: Mon, 26 Nov 2012 00:15:12 -0800 Message-ID: <20121126081512.GD21091@core.coreip.homeip.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-pa0-f46.google.com ([209.85.220.46]:53556 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752631Ab2KZIPQ (ORCPT ); Mon, 26 Nov 2012 03:15:16 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: "founder.fang" Cc: jkosina@suse.cz, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Hi Founder, On Mon, Nov 26, 2012 at 10:30:37AM +0800, founder.fang wrote: > Hi Linux-Input, Jiri, Dmitry, > this patch is related to nonblock read on hidraw device. > when nonblock read the condition check (file->f_flags & O_NONBLOCK) > always be true, > signal_pending and device exist checking never get a chance to run, so > the user mode code always > get EAGAIN even if device removed. move nonblock mode checking to the > last can fix this problem. > > Signed-off-by: Founder Fang > Reviewed-by: Dmitry Torokhov Makes sense to me. However it looks like your mailer line-wrapped the patch, please resend so Jiri can apply it. Thanks. -- Dmitry