From patchwork Thu Jul 11 09:05:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826219 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 104DB9F756 for ; Thu, 11 Jul 2013 09:19:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB8B120134 for ; Thu, 11 Jul 2013 09:19:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BB4A1200D0 for ; Thu, 11 Jul 2013 09:19:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756032Ab3GKJHU (ORCPT ); Thu, 11 Jul 2013 05:07:20 -0400 Received: from mail-pb0-f51.google.com ([209.85.160.51]:42148 "EHLO mail-pb0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755838Ab3GKJHP (ORCPT ); Thu, 11 Jul 2013 05:07:15 -0400 Received: by mail-pb0-f51.google.com with SMTP id um15so7702866pbc.10 for ; Thu, 11 Jul 2013 02:07:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=RFF9yDqNBS1ORM5i3mpnIlAODaHW4xP0Vs2ecp5h+i8=; b=WVGRBATObpvqr4DwJCDBjkQGz2QpdL0YE2jRO00Yl1cH6QwLKlQUvtFilRdPNwuwM4 h5ckRFl30lkuXD469bytDSL2GNPVo8ALYDihANOmMrg6HGvPZ9ruHP/8zwZl0+ALXiUI z4bHChMtKBVdLA77PbWxkC++i5G/IibrSkDJHQQjieSH1F5ux4aGZLtLgy4H9wOson+B S/m1/LBaDdm/x7XdsN7lvgXx7AxQ22gMP/KSMJm1+15vrAobENbJPDedpie5IQ32z0tn pGPMZQh5u3gHZmm1Jf8tpcE1s0+jubg15o6vShGlM0HkwVYUyBrIrVUaQmIzXfk80xK2 +5yA== X-Received: by 10.66.26.20 with SMTP id h20mr34726784pag.180.1373533635171; Thu, 11 Jul 2013 02:07:15 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id we2sm41093691pab.0.2013.07.11.02.07.10 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:07:14 -0700 (PDT) From: Ming Lei To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, Oliver Neukum , Alan Stern , linux-input@vger.kernel.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-media@vger.kernel.org, alsa-devel@alsa-project.org, Ming Lei Subject: [PATCH 05/50] USB: misc: uss720: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:28 +0800 Message-Id: <1373533573-12272-6-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1373533573-12272-1-git-send-email-ming.lei@canonical.com> References: <1373533573-12272-1-git-send-email-ming.lei@canonical.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Signed-off-by: Ming Lei --- drivers/usb/misc/uss720.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c index e129cf6..f7d15e8 100644 --- a/drivers/usb/misc/uss720.c +++ b/drivers/usb/misc/uss720.c @@ -121,6 +121,7 @@ static void async_complete(struct urb *urb) dev_err(&urb->dev->dev, "async_complete: urb error %d\n", status); } else if (rq->dr.bRequest == 3) { + unsigned long flags; memcpy(priv->reg, rq->reg, sizeof(priv->reg)); #if 0 dev_dbg(&priv->usbdev->dev, @@ -131,8 +132,11 @@ static void async_complete(struct urb *urb) (unsigned int)priv->reg[6]); #endif /* if nAck interrupts are enabled and we have an interrupt, call the interrupt procedure */ - if (rq->reg[2] & rq->reg[1] & 0x10 && pp) + if (rq->reg[2] & rq->reg[1] & 0x10 && pp) { + local_irq_save(flags); parport_generic_irq(pp); + local_irq_restore(flags); + } } complete(&rq->compl); kref_put(&rq->ref_count, destroy_async);