From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ming Lei Subject: Re: [PATCH] hid: usbhid: fix possible deadlock in __usbhid_submit_report Date: Sun, 22 Apr 2012 19:53:32 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from youngberry.canonical.com ([91.189.89.112]:37056 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751330Ab2DVLxg (ORCPT ); Sun, 22 Apr 2012 07:53:36 -0400 In-Reply-To: Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Alan Stern Cc: Oliver Neukum , Greg Kroah-Hartman , Jiri Kosina , linux-usb@vger.kernel.org, linux-input@vger.kernel.org, stable@vger.kernel.org On Sun, Apr 22, 2012 at 1:31 AM, Alan Stern wrote: > On Sat, 21 Apr 2012, Ming Lei wrote: >> How about always scheduling a tasklet to run what usb_unlink_urb does? >> just implement usb_unlink_urb as something like >> tasklet_schedule(unlink_tasklet). >> >> Then we can have a uniform lock requirement and no changes are involved >> on host controller drivers. > > The return values would not be correct. If you run 'git grep -n usb_unlink_urb drivers/usb/', it may show that most of callers do not check its return value, and the others only check for dumping warnings. If usb_unlink_urb is converted into tasklet implementation, we still can dump these warnings inside its tasklet function. > > On the other hand, usbnet could call usb_unlink_urb from within a > tasklet. Sorry, you mean tasklet_schedule can't be called inside a tasklet? Thanks, -- Ming Lei