Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp494603pxy; Wed, 5 May 2021 07:12:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfI/OmpqJPa+4tZ30Gxj6aQAG6K2shuHWud60xqDx/FqJuV/12r6Dho23WpGSKV6Y4U2Nb X-Received: by 2002:a17:90a:7893:: with SMTP id x19mr35292939pjk.3.1620223963693; Wed, 05 May 2021 07:12:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620223963; cv=none; d=google.com; s=arc-20160816; b=w2vhKltpX10MGCaRMnJi0WeWtSZ97B/mSg4p627IUkLRO33ZcwyGWuV2WYIP4JQrFx A10XrEeEe7yFV7gkd1aQ0zvRnY40pXgrvCHPIuNTpAISHnVKOdIB/ADv0J+u0q3X8Bij 5XL1IIQKamfnwg0f1CW+2We1vNEtE8/IZ+m8znFCT/h0k0YHlq8DyDU5G96pnSYCctay y2qHM0OYmSUrmGIQ48Oh3uRz/JFiIvpLl4O/GmO5HnWVFRMAFhAhq0igxm1DAfiXN+mO 8wcIa9HOW3t32jZjOgPk9oo4DlDIeYufAGC/wWDRDfYr7w76x+JfAFd/rO06ho+7wv5k t4SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=wWNwsl6Nery15dzL9tPW6Sd0sBRRZycZjWlnP+lf7eo=; b=WFzIXpP7ZqOIWm7oEiSwszGGTIO2Nj5r4kX1i+Vk5iB832GRJI78743g2Guswp3Y56 wmlzo205uJ2hczBsVm0eVBXCOLSHzj4/xL3RV/lMEVWfByYJTWvteJ9jpMvTwNZHpy6d gFDHg7HsJqtJdOFv+qKDJH6KMhTUpdmcwpbtxkZxtke3xdVALK17z0dAc9C8yJnIVERU uNkRL+4Dd70LV+aEEcpLyDXU6ayyY8G9UwzOPbYcX3xsw6aBntYMK3+Q/gTBf4VwJeoA TjFuBeaGSAaoxaI2uLiJG83JHKAkouxhwUmocj81VR+RRUQyKTNHvg3iqShlWyjEesR/ pFKQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d15si7559039pgt.242.2021.05.05.07.12.26; Wed, 05 May 2021 07:12:43 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233590AbhEEMjY (ORCPT + 99 others); Wed, 5 May 2021 08:39:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232513AbhEEMiw (ORCPT ); Wed, 5 May 2021 08:38:52 -0400 X-Greylist: delayed 98398 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 05 May 2021 05:37:55 PDT Received: from bmailout2.hostsharing.net (bmailout2.hostsharing.net [IPv6:2a01:37:3000::53df:4ef0:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55F54C06174A for ; Wed, 5 May 2021 05:37:54 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by bmailout2.hostsharing.net (Postfix) with ESMTPS id 3295D2800B6C9; Wed, 5 May 2021 14:37:53 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 1D07588EB8; Wed, 5 May 2021 14:37:53 +0200 (CEST) Date: Wed, 5 May 2021 14:37:53 +0200 From: Lukas Wunner To: Greg KH Cc: Pali =?iso-8859-1?Q?Roh=E1r?= , linux-usb@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Marek =?iso-8859-1?Q?Beh=FAn?= Subject: Re: xhci_pci & PCIe hotplug crash Message-ID: <20210505123753.GA29101@wunner.de> References: <20210505120117.4wpmo6fhvzznf3wv@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 05, 2021 at 02:09:17PM +0200, Greg KH wrote: > On Wed, May 05, 2021 at 02:01:17PM +0200, Pali Roh?r wrote: > > [ 72.511899] Internal error: synchronous external abort: 96000210 [#1] SMP [...] > > [ 72.636415] Call trace: > > [ 72.638936] xhci_irq+0x70/0x17b8 > > [ 72.642360] usb_hcd_irq+0x34/0x50 > > [ 72.645876] usb_hcd_pci_remove+0x78/0x138 > > [ 72.650106] xhci_pci_remove+0x6c/0xa8 > > [ 72.653978] pci_device_remove+0x44/0x108 > > [ 72.658122] device_release_driver_internal+0x110/0x1e0 > > [ 72.663521] device_release_driver+0x1c/0x28 > > [ 72.667931] pci_stop_bus_device+0x84/0xc0 > > [ 72.672162] pci_stop_and_remove_bus_device+0x1c/0x30 > > [ 72.677373] pciehp_unconfigure_device+0x98/0xf8 > > [ 72.682138] pciehp_disable_slot+0x60/0x118 > > [ 72.686457] pciehp_handle_presence_or_link_change+0xec/0x3b0 > > [ 72.692386] pciehp_ist+0x170/0x1a0 > > [ 72.695984] irq_thread_fn+0x30/0x90 ^^^^^^^^^^^^^ [...] > > I suspect that issue is in usb_hcd_pci_remove() function which calls > > local_irq_disable()+usb_hcd_irq()+local_irq_enable() functions but do > > not take into care that whole usb_hcd_pci_remove() function may be > > called from interrupt context. > > usb_hcd_pci_remove() should NOT be called from interrupt context. > > What is causing that to happen? Nothing. It's called from an IRQ *thread*, i.e. task context, see above. > > Can you look at this issue if it is really safe to call usb_hcd_irq() > > from interrupt context? Or rather if it is safe to call functions like > > pciehp_disable_slot() or device_release_driver() from interrupt context > > like it can be seen in call trace? > > What is removing devices from an irq? That is wrong, pci hotplug never > used to do that, what recently changed? Nothing changed, the allegation that something is called from interrupt context is wrong. Thanks, Lukas