Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2105751pxj; Sat, 19 Jun 2021 03:07:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFpsf6u1QJpS4TT/+bYMkNCpHYJUK3Paxn9omRDwYRQVvGs5i+6UVwgx2V134TFLM6vulY X-Received: by 2002:a5d:8190:: with SMTP id u16mr11824046ion.158.1624097261294; Sat, 19 Jun 2021 03:07:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624097261; cv=none; d=google.com; s=arc-20160816; b=hzjmX4UNRIPenw+5wuFu40R0iAzegoOTrIdo81ELeSyT/G0NTSIAyjs8x/KyP0+Tdj aNpN5VoWblVdvHCbQUBmOkk9pXpay2YWkbHaHNzlYKMxTb+hL9po2n/hmyrUMw4IYsm4 jnrUXwTIh34FTLNJeMIFc/bAfXu4AB40ZS4rULlURBaa73JpOzIyrT6Ziopk1CBnKsq1 rrZxDa3fobnRObTPZ1maRfVO7kiiS2r8z//KfWgpWMHfAveLXpa6uXRBQbdMGOAdAhhw xAxHkQC3VqU7MI85YnG6exmEKayKwzIYcejviblZzB6doNL4dw2EnzafVNeCDuFyJ/f4 varw== 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:dkim-signature; bh=7PrEeiopzKO6h1cqVENl1RfcSGgu3A3Ry4fKTOoH7n4=; b=WvGh0yBuTYaFpPS0QeTv7yIKlNq1xJKywwU5qFuGmLTxGWbGkQMDixBpqD1qk0WOva AKB1in4zqIWG4ICHQ5C4L+0EJJuLQFMmREi/7vP6B3oVtTi3GRLM/a/OOzdJBh/WsQ8G ppIWQfJOSzSbBwqY6tERdmap2wCwBJYKA7ezKDz9jjZKcGLA7kzr8BUG48OF1POqTZzv ISyMJeWzmDMhTrekGbtkCpIZZFd60asxoZNm3bLzHhZ2MnIocbSG7Ej5QRheKPvRPhfv 8hUbCnN30bSdQ3aIOtIUnkggboJ9H5EkqNSCmfdsIOPRYZy1dWDpuiykICvoEaGwT77P uRbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Oy/1bVbp"; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j1si11041076jar.65.2021.06.19.03.07.29; Sat, 19 Jun 2021 03:07:41 -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=@kernel.org header.s=k20201202 header.b="Oy/1bVbp"; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232558AbhFSI5t (ORCPT + 99 others); Sat, 19 Jun 2021 04:57:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:53482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230225AbhFSI5s (ORCPT ); Sat, 19 Jun 2021 04:57:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 393E9611AC; Sat, 19 Jun 2021 08:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624092938; bh=H65t3E3E1UfbQm0vFNUtnZkOHVJMZekG+qInfxOtAWM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Oy/1bVbpWvijx+yMF4KrmzPASld/lhNxS3J9mB4Fm+Is+yWhyhWxJ0J9dO19gUCbP xuzVvs+/1xpO+1FzdWJVlMQGN9NIzTVznZaSBkIzPkeOyP0avkdA+07pO1bTmODqEu 8hgXAujIIRl1e39BJbLIZvBv2C03EJU1cLc04H7Fyn63HynHUmH24+fZLcqqQ4/Lk0 5ZEezmOur8J4nsAbntFSxM0cd/P/k7J6B50Ag84D/gRxZ1nII157gdAo8lzTdYzJRh ZcoVqbDTLSythnXkRMEYSU/l3bZxmbQjoJbpwofeTz+EZYhCDI+3vBarBjzjogJeQe VAJdYP8yWgVhw== Received: by pali.im (Postfix) id BF920655; Sat, 19 Jun 2021 10:55:35 +0200 (CEST) Date: Sat, 19 Jun 2021 10:55:35 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Lukas Wunner Cc: David Laight , Greg KH , "linux-usb@vger.kernel.org" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Marek =?utf-8?B?QmVow7pu?= Subject: Re: xhci_pci & PCIe hotplug crash Message-ID: <20210619085535.rpqitskpptgj7dwk@pali> References: <20210505120117.4wpmo6fhvzznf3wv@pali> <20210505123346.kxfpumww5i4qmhnk@pali> <20210505124402.GB29101@wunner.de> <20210505130240.lmryb26xffzkg4pl@pali> <20210505153942.mntbkmphw3ik3pdg@pali> <20210619075358.GA31639@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210619075358.GA31639@wunner.de> User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Saturday 19 June 2021 09:53:58 Lukas Wunner wrote: > On Wed, May 05, 2021 at 05:39:42PM +0200, Pali Rohár wrote: > > On Wednesday 05 May 2021 15:20:11 David Laight wrote: > > > From: Pali Rohár > > > Sent: 05 May 2021 14:03 > > > > So seems that PCIe controller HW triggers these external aborts when > > > > device on PCIe bus is not accessible anymore. > > > > > > > > If this issue is really caused by MMIO access from xhci driver when > > > > device is not accessible on the bus anymore, can we do something to > > > > prevent this kernel crash? Somehow mask that external abort in kernel > > > > for a time during MMIO access? > > > > > > If it is a cycle abort then the interrupted address is probably > > > that of the MMIO instruction. > > > So you need to catch the abort, emulate the instruction and > > > then return to the next one. > > > > Has kernel API & infrastructure for catching these aborts and executing > > own driver handler when abort happens? > > Yes, see here for an example: > > https://lore.kernel.org/linux-pci/20210615191405.21878-4-jim2101024@gmail.com/ What I do not see here how to catch and recover from error. It looks like that in above patch is just implemented catching error, printing more verbose output and let kernel continue in rebooting / crashing. At least I do not see how to "catch the abort, emulate the instruction and then return to the next one" as David wrote.