From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:32916 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932079AbbHKIQx (ORCPT ); Tue, 11 Aug 2015 04:16:53 -0400 Message-ID: <1439280938.6524.2.camel@suse.com> Subject: Re: [PATCH 2/2] drivers/usb: Delete XHCI command timer if necessary From: Oliver Neukum To: Mathias Nyman Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, Gavin Shan , stable@vger.kernel.org Date: Tue, 11 Aug 2015 10:15:38 +0200 In-Reply-To: <1438607269-8977-3-git-send-email-mathias.nyman@linux.intel.com> References: <1438607269-8977-1-git-send-email-mathias.nyman@linux.intel.com> <1438607269-8977-3-git-send-email-mathias.nyman@linux.intel.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: On Mon, 2015-08-03 at 16:07 +0300, Mathias Nyman wrote: > From: Gavin Shan > > When xhci_mem_cleanup() is called, it's possible that the command > timer isn't initialized and scheduled. For those cases, to delete > the command timer causes soft-lockup as below stack dump shows. > > The patch avoids deleting the command timer if it's not scheduled > with the help of timer_pending(). Are you sure this is safe? timer_pending() will not show you that the timer function is running. It looks like you introduced a race between timeout and cleanup. Regards Oliver