From patchwork Mon Sep 21 14:46:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Nyman X-Patchwork-Id: 53965 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by patches.linaro.org (Postfix) with ESMTPS id 46F1722B1E for ; Mon, 21 Sep 2015 14:42:43 +0000 (UTC) Received: by lbcao8 with SMTP id ao8sf39064261lbc.1 for ; Mon, 21 Sep 2015 07:42:42 -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=yd8o3HbFwVmDggxV1TCGFNPHkelmLY5nxxtT6xChUkk=; b=QXEh09GwrCPqP3dAFtDJsESqF/Q3TLoVHWmCQqaV9s/zrjsOPE4ema8musfu7Qcf/n JCCQ+dMkLQgyZCa/3+Mcyo/Pyar6PfIpbrCthjw/eNmMgns0irwhdYc6qlubQQm64JYC sNEK2Q5E36NupSKqZFnM3t4A9747c9gwTZRnIvnmyNMPCANsW93yVZu/i1MvpaEXW1R1 jfe36oNR176QAhUWOyFiUJTR3UPvVXXY0cPdtojO9awj1yKfeA1ENaNGeBcHLxF7iWQs l8xSoc/0InhgH9/jcFPtkqE77wVASEsBc8LRoL6tGLCJIMFRjhKE/40y1NfKXzFWfW2R 00Ig== X-Gm-Message-State: ALoCoQlnKgmTb7uF2LchmIZqBhjJ+TG9vJvTQjNTlNDl3+b/xZiXNN7+0XXaOmmLtPqX76Dkd7sC X-Received: by 10.180.106.197 with SMTP id gw5mr2139320wib.7.1442846562232; Mon, 21 Sep 2015 07:42:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.138 with SMTP id y10ls484668laj.35.gmail; Mon, 21 Sep 2015 07:42:42 -0700 (PDT) X-Received: by 10.112.168.66 with SMTP id zu2mr7640317lbb.29.1442846562114; Mon, 21 Sep 2015 07:42:42 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id ck10si16201019lbc.145.2015.09.21.07.42.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Sep 2015 07:42:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by lahg1 with SMTP id g1so69689873lah.1 for ; Mon, 21 Sep 2015 07:42:42 -0700 (PDT) X-Received: by 10.112.151.106 with SMTP id up10mr7808177lbb.106.1442846561994; Mon, 21 Sep 2015 07:42:41 -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 w3csp1753722lbq; Mon, 21 Sep 2015 07:42:41 -0700 (PDT) X-Received: by 10.67.6.164 with SMTP id cv4mr25313108pad.59.1442846555731; Mon, 21 Sep 2015 07:42:35 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ax2si38238984pbc.170.2015.09.21.07.42.35; Mon, 21 Sep 2015 07:42:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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 S1756708AbbIUOmZ (ORCPT + 1 other); Mon, 21 Sep 2015 10:42:25 -0400 Received: from mga09.intel.com ([134.134.136.24]:20015 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756392AbbIUOmX (ORCPT ); Mon, 21 Sep 2015 10:42:23 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 21 Sep 2015 07:42:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,568,1437462000"; d="scan'208";a="809845956" Received: from mattu-haswell.fi.intel.com ([10.237.72.176]) by fmsmga002.fm.intel.com with ESMTP; 21 Sep 2015 07:42:16 -0700 From: Mathias Nyman To: Cc: , Roger Quadros , , Mathias Nyman Subject: [PATCH v2 4/9] usb: xhci: lock mutex on xhci_stop Date: Mon, 21 Sep 2015 17:46:12 +0300 Message-Id: <1442846777-18389-5-git-send-email-mathias.nyman@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442846777-18389-1-git-send-email-mathias.nyman@linux.intel.com> References: <1442846777-18389-1-git-send-email-mathias.nyman@linux.intel.com> Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@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.215.43 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 Cc: 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); } /*