Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp522592yba; Mon, 1 Apr 2019 11:01:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqzb6zdyOa8V1jyAFgMhCYK8XvA9mS39XAM9h4PgTyNkRy9fiZmFMSLtkwUydCXPT8T7NwhR X-Received: by 2002:a62:58c7:: with SMTP id m190mr63760806pfb.4.1554141664407; Mon, 01 Apr 2019 11:01:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554141664; cv=none; d=google.com; s=arc-20160816; b=g+Ga+6uEJtY0JdB+h0ecWJHP3yXubD8daksrLYlbI8HiFzVB/yiXFBFSBbekyqNQ3S bYuFgnWnsxIRmksJxP9nY7RqiLJFmyNGCZbKiK5sY9OdQEAzR1/BWSCWZ8Xa+UjIdL+l EUYR/7oq49QzXNtR2Ve1eULEt+19tlhzoDQpSE2I1JV/ZfzSi6c9L78czyESZO3a7y6Y wXKNB8HiT5L/nYrFvFk14SNzv/21J+xlMjVpDbMyNOC2R97Us0908MfA2kDzLpgULuKB sS8cspSf63JyZ9hItBjCTia3nAvTJnxbj4uBjAIwL49g/fudbhKcooFeY/ypksDKYrDx M6Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=T6BPR0p09Rw35LOiiTo57BdeRnOT1A0ouLph9mRzHMc=; b=jcnLeza6cOE52c+SodqMucb5NPJrjk2k0Rvqa6ofFMDcqxtXAcNpWwNm+jA+6KtPaJ S9rrF6dtK49/fcIeJ+8KBAgmOxD1errWxSCkx8EErOIKdqAvTzl5Hb0R0SyoLE4tRL3P t23EUfCXdc+GSnXA99WDMz2Kf7e8G4YoJhGF6w8AVvm2X4XGrTt+uIojX4VoxIyIRKSW 4gezz2T8WZpOcXEcA4I0OUPoDwVZvgziPLTt8u8qyCJsf6s+VV2hSnlg0jk5k75cpyLC dSVKgD+hR16TPtfSC6yq/DGnDuocbj6Pl7DlB3RTwHXoJQvUXJO9A/i2RpG82lkA/VdG ygcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0vAEa6E+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m184si9496124pfb.73.2019.04.01.11.00.49; Mon, 01 Apr 2019 11:01:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0vAEa6E+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731586AbfDAR7B (ORCPT + 99 others); Mon, 1 Apr 2019 13:59:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:44972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731318AbfDARSG (ORCPT ); Mon, 1 Apr 2019 13:18:06 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2800521473; Mon, 1 Apr 2019 17:18:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554139085; bh=+V/kBv2FT4LMrr6EzmLacGwQdRe5eI7eaEhFZBRsZCs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0vAEa6E+t6iTxfQoikKoa8q0YCb3Wrqp6IC1673H2fRGLHqokfctrRzocp9X8wL5t hEEuE7hSVOnpxnDlKFGsHyeAEqwl/6YWxkzcSiACXJueIfto5uReRtIRU3mkdMXM6W tQhKEZVvDPWDhHIfoM7SO8SZiUbxvT+HX63FNB/k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathias Nyman Subject: [PATCH 4.19 108/134] usb: xhci: dbc: Dont free all memory with spinlock held Date: Mon, 1 Apr 2019 19:02:24 +0200 Message-Id: <20190401170054.310737307@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190401170044.243719205@linuxfoundation.org> References: <20190401170044.243719205@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mathias Nyman commit 8867ea262196a6945c24a0fb739575af646ec0e9 upstream. The xhci debug capability (DbC) feature did its memory cleanup with spinlock held. dma_free_coherent() warns if called with interrupts disabled move the memory cleanup outside the spinlock Cc: stable Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-dbgcap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/usb/host/xhci-dbgcap.c +++ b/drivers/usb/host/xhci-dbgcap.c @@ -516,7 +516,6 @@ static int xhci_do_dbc_stop(struct xhci_ return -1; writel(0, &dbc->regs->control); - xhci_dbc_mem_cleanup(xhci); dbc->state = DS_DISABLED; return 0; @@ -562,8 +561,10 @@ static void xhci_dbc_stop(struct xhci_hc ret = xhci_do_dbc_stop(xhci); spin_unlock_irqrestore(&dbc->lock, flags); - if (!ret) + if (!ret) { + xhci_dbc_mem_cleanup(xhci); pm_runtime_put_sync(xhci_to_hcd(xhci)->self.controller); + } } static void