From patchwork Fri Sep 18 14:42:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Nyman X-Patchwork-Id: 53881 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id C7ACE218E3 for ; Fri, 18 Sep 2015 14:38:33 +0000 (UTC) Received: by lbbti1 with SMTP id ti1sf17726873lbb.3 for ; Fri, 18 Sep 2015 07:38:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=QD+9qqMTT5a3wJTgF/mxHsgjjLuC56USqn1TAG/Cnwk=; b=POpfANJ8sxtdCdgZO2H9DSqhjpS61zUlrkNnvnhocfCIrDxgIBhUDXx5P+TmcSwwAw dUkDBgaDJYGE+Ocjsxtw6X7f2dMO+W/vTUgb4WIxvmVfLR3ARcA5wXIrM1/e/LRZTYAe JtomfV8V6bfPNSz7o84QHqDn/iW4FYcLIQNqqMZH9ZsoC3aqaU+9Ic8udRTLa7FqaGwd L/x7EaCQtsEVb3ZyaY2WJ8VFM/2EhKpXTdy3DXWGL4O/gLQIKv2Wm7l4u4BEAdsGXS14 JEK/8C2LAFAu67o1TO3kwS1gZDJTHbYicnwtMwjiLDTWTwgSSlv5p6qsSkgNR74h6N2E 2opg== X-Gm-Message-State: ALoCoQkSrzMv21vyDUftavaEpVWpom19ABTOnKeX/DZfOI1zWFI8xOnCFTZ9880itA9TPqJLmYv4 X-Received: by 10.180.210.71 with SMTP id ms7mr1924018wic.4.1442587112866; Fri, 18 Sep 2015 07:38:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.237.36 with SMTP id uz4ls246163lac.6.gmail; Fri, 18 Sep 2015 07:38:32 -0700 (PDT) X-Received: by 10.112.62.137 with SMTP id y9mr3215269lbr.63.1442587112743; Fri, 18 Sep 2015 07:38:32 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id an5si6302490lac.166.2015.09.18.07.38.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Sep 2015 07:38:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by lbpo4 with SMTP id o4so26263300lbp.2 for ; Fri, 18 Sep 2015 07:38:32 -0700 (PDT) X-Received: by 10.112.51.142 with SMTP id k14mr2935594lbo.76.1442587112635; Fri, 18 Sep 2015 07:38:32 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp333975lbq; Fri, 18 Sep 2015 07:38:31 -0700 (PDT) X-Received: by 10.66.221.170 with SMTP id qf10mr7454945pac.134.1442587111503; Fri, 18 Sep 2015 07:38:31 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zv8si14045210pbc.164.2015.09.18.07.38.31; Fri, 18 Sep 2015 07:38:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752793AbbIROiZ (ORCPT + 4 others); Fri, 18 Sep 2015 10:38:25 -0400 Received: from mga01.intel.com ([192.55.52.88]:44696 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752233AbbIROiY (ORCPT ); Fri, 18 Sep 2015 10:38:24 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 18 Sep 2015 07:38:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,553,1437462000"; d="scan'208";a="564275827" Received: from mattu-haswell.fi.intel.com ([10.237.72.176]) by FMSMGA003.fm.intel.com with ESMTP; 18 Sep 2015 07:38:09 -0700 From: Mathias Nyman To: Cc: , Roger Quadros , Mathias Nyman Subject: [PATCH 4/9] usb: xhci: lock mutex on xhci_stop Date: Fri, 18 Sep 2015 17:42:08 +0300 Message-Id: <1442587333-21056-5-git-send-email-mathias.nyman@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442587333-21056-1-git-send-email-mathias.nyman@linux.intel.com> References: <1442587333-21056-1-git-send-email-mathias.nyman@linux.intel.com> Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Roger Quadros Else it races with xhci_setup_device Signed-off-by: Roger Quadros Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 6b0f4a4..f560c41 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -677,8 +677,11 @@ void xhci_stop(struct usb_hcd *hcd) u32 temp; struct xhci_hcd *xhci = hcd_to_xhci(hcd); + mutex_lock(&xhci->mutex); + if (!usb_hcd_is_primary_hcd(hcd)) { xhci_only_stop_hcd(xhci->shared_hcd); + mutex_unlock(&xhci->mutex); return; } @@ -717,6 +720,7 @@ void xhci_stop(struct usb_hcd *hcd) xhci_dbg_trace(xhci, trace_xhci_dbg_init, "xhci_stop completed - status = %x", readl(&xhci->op_regs->status)); + mutex_unlock(&xhci->mutex); } /*