Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5528531pxj; Wed, 26 May 2021 12:44:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGF+ftiIx0wflNzCch66uKeFH/bzouRCQjl0Ezyko51XZxqISLQPJdXQ0t0r88+IFc9H9f X-Received: by 2002:a17:907:961e:: with SMTP id gb30mr10986ejc.58.1622058241841; Wed, 26 May 2021 12:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622058241; cv=none; d=google.com; s=arc-20160816; b=P/vxyc3vwlPnqp7a0Lm5p6pB7KgZFWaB5g6kJRFvfRLAntjifJmirc5Ap3hsz46lGO H6vbjniadqwkrPryO4vRc1toDULW2YgRAv0bTi+M3FEmlRFPZlLaf63o8Mp7d5DIKajh dsxXM3q+Ktn6HcjgnXodLpp8v/bM/vaEkSJ5SeNrSUdmcNfDp76nG7gfFkvoLrxfMotJ W5aJE/iBc5uYReXg9yrJKL68CTmKTpbbyswS5dVsqijLIAFWRzucKAjAi/Di+l8gSBL9 2d35wHF5rcAfIlpA9LKYpZ8pRi4Evj905QEtP/nNn78kCm1F34sTRsbnXnu1d8QOTbPe E71g== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=zHdFU0BnXgRqmClkuJ/7AkCWquE9LT1xUpvB2v9ylFI=; b=Y5iN5SZrkN3uuQTStDYhcaJFwpfEd6JpepHq2e7R8Z+OuWoDpf9KYb99ZTK2+mES1i 31uh4F5u/JwynFjHj6dDMvm1nucj9W0+LsxBTLA9jKtHFUXZpRrQJgG6fRfGy00IcE4F 3k+Ic0DXFmwqChjZh4IiO0g319GB82fY1jSb1RK1sfXRFwNSd5JOjAIsqcg453u91Lk/ HnOEpyWMsHqaDVEwqczue3AQhiLBFgM+lSEX4+3frSXUroQbIW8LMGktbcFAWABNgUP5 szjG9kFfUC9eefaGWZaTG79K2Cy4JtLFCKoI2ntenMn1UFtpRLmpRZB7QrL2xiWaX0+z yhhg== 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 v24si274161edy.327.2021.05.26.12.43.38; Wed, 26 May 2021 12:44:01 -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 S235192AbhEZSTr (ORCPT + 99 others); Wed, 26 May 2021 14:19:47 -0400 Received: from bmailout3.hostsharing.net ([176.9.242.62]:32915 "EHLO bmailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235092AbhEZSTp (ORCPT ); Wed, 26 May 2021 14:19:45 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (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 bmailout3.hostsharing.net (Postfix) with ESMTPS id 974E2100AFFE6; Wed, 26 May 2021 20:18:10 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 6327B40898F; Wed, 26 May 2021 20:18:10 +0200 (CEST) Date: Wed, 26 May 2021 20:18:10 +0200 From: Lukas Wunner To: Lambert Wang Cc: Krzysztof Wilczy??ski , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] pci: add pci_dev_is_alive API Message-ID: <20210526181810.GA13052@wunner.de> References: <20210525125925.112306-1-lambert.q.wang@gmail.com> <20210525132035.GA66609@rocinante.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 26, 2021 at 02:12:38PM +0800, Lambert Wang wrote: > The user is our new PCI driver under development for WWAN devices . > Surprise removal could happen under multiple circumstances. > e.g. Exception, Link Failure, etc. > > We wanted this API to detect surprise removal or check device recovery > when AER and Hotplug are disabled. You may want to take a look at pci_dev_is_disconnected(). Be aware of its limitations, which Bjorn has already pointed out and which are discussed in more detail under the following link in the "Surprise removal" section: https://lwn.net/Articles/767885/ Thanks, Lukas