From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26C67C43381 for ; Fri, 22 Mar 2019 18:21:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E709121929 for ; Fri, 22 Mar 2019 18:21:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553278870; bh=TDXTRaeKJJ8f5eLpXsxp5wnF/dzZmenmq+ik5ystD+Y=; h=Subject:To:From:Date:List-ID:From; b=UwVq62n1ClrtXHQliuOk+BQQ24iz4EKPyD5xtNqqSHsKVuvYPiH26o6+Ee54pmSnd Jqqe3T7pOrVep9m03lgLZRpsGcibEj0e4WjEfx4V95WjzTulvrE9qFH4B7/tzFYcSl DEwBogIYZju567e1/hsBm4qJ5xQk2rujJeHeZiCI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726472AbfCVSVJ (ORCPT ); Fri, 22 Mar 2019 14:21:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:55792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726056AbfCVSVJ (ORCPT ); Fri, 22 Mar 2019 14:21:09 -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 3949021929; Fri, 22 Mar 2019 18:21:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553278868; bh=TDXTRaeKJJ8f5eLpXsxp5wnF/dzZmenmq+ik5ystD+Y=; h=Subject:To:From:Date:From; b=GKq5qG+0V7nfbnTizmttjNlRM8+CVvuVP95DpwUgA/I9rQPJctmbZooAdA07yLRMz S6yJm3naB29ihfIRFg80b+A3O6RRxtmZZa0VOiAwNmRbkP+6vwXRNZIgmAwPns9g0Y 1WgC1WpYmdSv2dUEU/B0AWECzeww91WTErlLXT/4= Subject: patch "usb: xhci: dbc: Don't free all memory with spinlock held" added to usb-linus To: mathias.nyman@linux.intel.com, gregkh@linuxfoundation.org, stable@vger.kernel.org From: Date: Fri, 22 Mar 2019 19:20:55 +0100 Message-ID: <155327885523349@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled usb: xhci: dbc: Don't free all memory with spinlock held to my usb git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git in the usb-linus branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will hopefully also be merged in Linus's tree for the next -rc kernel release. If you have any questions about this process, please let me know. >From 8867ea262196a6945c24a0fb739575af646ec0e9 Mon Sep 17 00:00:00 2001 From: Mathias Nyman Date: Fri, 22 Mar 2019 17:50:16 +0200 Subject: usb: xhci: dbc: Don't free all memory with spinlock held 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(-) diff --git a/drivers/usb/host/xhci-dbgcap.c b/drivers/usb/host/xhci-dbgcap.c index c78be578abb0..d932cc31711e 100644 --- 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_hcd *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_hcd *xhci) 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 -- 2.21.0