Received: by 2002:a05:6a10:4407:0:0:0:0 with SMTP id s7csp931889pxu; Wed, 14 Oct 2020 18:04:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfgcg0rM93YM2UZMlObphOC92P+uitoj/wyWEZIXsqFCsqtjGSK9oVVsPEnho8mKLLq/7Q X-Received: by 2002:a05:6402:1847:: with SMTP id v7mr1806043edy.307.1602723877396; Wed, 14 Oct 2020 18:04:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602723877; cv=none; d=google.com; s=arc-20160816; b=sNgd3ZesU+p4q0XzRznpOYlmZVtM2AKi5UTBqVKaxrbWkuMA4yCxROcahSe+z8Rv6R 9yN68M0piPIPfWYQK7J4pfzFDiUCktXJZu20aOF+IyFkNXTUAXdut0CbzMxWC1qFOPEF dPrxnE9ooi1aPIg3MYdLzVmZaA5ziXKzShe+q1hPAte5zKK0CUddWiL8PFMB5FYfyRVv MbGsG9GdExTwEQcKeNR9JvYxZZ49Z5ZJDnZpO28OPL176R7mQkvDkTPoIeHwJSVJZAay 6+Ls9qNRG43ctDdYW6O/CbbsBNfmYGR+qctSowXGDiKqvlFz7cweanPthEKE3XqF8uJF UJHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:subject:cc:to:from:date:dkim-signature:dkim-signature :message-id; bh=Pe8CFmf0/CnRVhPeaGPKSnnUTmz8AJUU7taQJPbdbP8=; b=vp89e0PlihG7rnRlTEX6l4p7JodDaOYGSpwL2SQz/sXHU4UUDDVfcv9JF1QDaj8ufr ReurNRiz0NJOi57gFE1IFOR8JzoIXKcItUyE67qn5tK1gVt1+EsR+IsKL46N01+BnSDc ltTRlPYSEN8GiqAHxL05/KeuzuBFMM1Whn6SetqTLvVWUIZPScnIr9RTpnbX7E+7N1jk oIBFyH5N8YtXJtAlvimGvXxkFDk0mXNmKzBaffHmSFiMBtzM2klQTZ0eJjlW+5BnIdlh f6cBZ6MXlq1tV1unbmorOJ5vx7aFXR2Ik5Yxyo1A8/xt3pawVNXde1T/WtMVd6wn6ATb g/ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=B6rdNxcz; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bg3si1012895ejb.616.2020.10.14.18.03.42; Wed, 14 Oct 2020 18:04:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=B6rdNxcz; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388947AbgJNPTG (ORCPT + 99 others); Wed, 14 Oct 2020 11:19:06 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:59116 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731760AbgJNPSz (ORCPT ); Wed, 14 Oct 2020 11:18:55 -0400 Message-Id: <20201014145727.607191004@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1602688732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=Pe8CFmf0/CnRVhPeaGPKSnnUTmz8AJUU7taQJPbdbP8=; b=B6rdNxczcOWWrcVbmjviVpJXMXqZ84hT2H0rQpIRoceWWrTcdA9FTUOaS7Fgw2L8fOdBdy HbzzKYWq9V9msbsFIlokMHqCeUwUqtRMpTRWHwAcLqZZXvSqIgbUkJXvocA/0LR+CjU/B6 IRLn5B25hI6G7a81TURqxOWEIykDwHsXr0VEmlT//sz5ZprWnWexzaGB6ko6NdL96oRFVQ +oExsQl/zMOtFkuZm2sj/8zelpvpkI/FS84sVW0h9kPI1zbDpua5qg7kw53q+PoEM8qAVk QDWwnsdTTlNv0RMzHiN3Qp5v0N41mRmSf5MdVz/xFd9xU2BGBPWsfDn0Ax2+rA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1602688732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=Pe8CFmf0/CnRVhPeaGPKSnnUTmz8AJUU7taQJPbdbP8=; b=3nHhxyYvsMB0O08Xcs0F+wU3UaP3H2JXQDPF1e8+qyTK47yO7ho0Y1DtTJSapPBVeQTtaW +ujbHldthT8mgxDQ== Date: Wed, 14 Oct 2020 16:52:20 +0200 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , "Ahmed S. Darwish" , Sebastian Andrzej Siewior , Mathias Nyman , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Thomas Winischhofer , Johan Hovold , Valentina Manea , Shuah Khan , Alan Stern , linux-omap@vger.kernel.org, Kukjin Kim , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Felipe Balbi , Duncan Sands Subject: [patch 05/12] usb: xhci: Remove in_interrupt() checks References: <20201014145215.518912759@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ahmed S. Darwish The usage of in_interrupt() in drivers is phased out for various reasons. xhci_set_hc_event_deq() has an !in_interrupt() check which is pointless because the function is only invoked from xhci_mem_init() which is clearly task context as it does GFP_KERNEL allocations. Remove it. xhci_urb_enqueue() prints a debug message if an URB is submitted after the underlying hardware was suspended. But that warning is only issued when in_interrupt() is true, which makes no sense. Simply return -ESHUTDOWN and be done with it. Signed-off-by: Ahmed S. Darwish Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Cc: Mathias Nyman Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org --- drivers/usb/host/xhci-mem.c | 2 +- drivers/usb/host/xhci.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -2110,7 +2110,7 @@ static void xhci_set_hc_event_deq(struct deq = xhci_trb_virt_to_dma(xhci->event_ring->deq_seg, xhci->event_ring->dequeue); - if (deq == 0 && !in_interrupt()) + if (!deq) xhci_warn(xhci, "WARN something wrong with SW event ring " "dequeue ptr.\n"); /* Update HC event ring dequeue pointer */ --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1473,11 +1473,9 @@ static int xhci_urb_enqueue(struct usb_h ep_index = xhci_get_endpoint_index(&urb->ep->desc); ep_state = &xhci->devs[slot_id]->eps[ep_index].ep_state; - if (!HCD_HW_ACCESSIBLE(hcd)) { - if (!in_interrupt()) - xhci_dbg(xhci, "urb submitted during PCI suspend\n"); + if (!HCD_HW_ACCESSIBLE(hcd)) return -ESHUTDOWN; - } + if (xhci->devs[slot_id]->flags & VDEV_PORT_ERROR) { xhci_dbg(xhci, "Can't queue urb, port error, link inactive\n"); return -ENODEV;