Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2294389pxk; Sun, 27 Sep 2020 02:18:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+DcZrNuX6LLy6GoaxLf+jrOf42+NwC75rklx+nbjOx8MMT6IdN1YMAy/SEHDR/uN/Pzsj X-Received: by 2002:a17:906:a002:: with SMTP id p2mr10000213ejy.399.1601198301769; Sun, 27 Sep 2020 02:18:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601198301; cv=none; d=google.com; s=arc-20160816; b=G3IR0YxOlLRicTfHAWbwgVmnWdv1XHGylzZoBBv4w8Up5UWxLgnqBNCNaY11bFAtNB IXT4Iv63kUvZc7PsXy6vPDsT7GvoE54Iv8m5DCKf8EnElhbJK30XP9IQP821aFY53iiU YIPGVtsXCH63K994AxW+L2UdLj3SxbYGrtsNeNUs/L5CD6HSmrREqBTT5hOS5M8pMuj/ ZLKIxXNfox92RNd6QLRJ8WKFVZe9l1PuZ3L+wqjZSmnoS9rXuywSozJE9bxFZuPjGwVi s5Y1jCpErckDNwZaRdYO6xBUR5ojZqHfH9cs9qgzjf2BlyLwU6XEljn0QT/b5AcQiGqI o+wg== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=GAHmnuhh1WsCb9RRGWQQv7bbrIrA7t9V6XtIMt0xmn4=; b=iWcs06hXEJyGX14RSBzTb1snUbodFcpfBYiu1T/E1Dg+N2V1BeflluNSs7GjB7Ykdp HVlsAS4y6g60MZhoTjFiIiBvgX12KUu8DnhFOKINvooUHWLxhq7jWl3tPM26wDLYfKol HrGN0ZDWlf9Y7h+LcpylSIxGwssU5KcbwrrhvnmXigMxwMp0YdiuLkSWto7V8KcRSRNH 6l/c2GB5WsL99t3FF/NUkSP3AnRErKzaFffMpp8S9z+Dw4ocPIdDkkqNB0Y8ZrcorOuA DC5rKuaV4iFYRCfqdGtTfGCE9+D/lJ5rWXevulRZ3JjfmUJ6LvKigMV7Q3Xi6hJ4J3iG BUpw== 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 cd7si5399981ejb.433.2020.09.27.02.17.59; Sun, 27 Sep 2020 02:18:21 -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 S1726303AbgI0JO3 (ORCPT + 99 others); Sun, 27 Sep 2020 05:14:29 -0400 Received: from smtprelay0166.hostedemail.com ([216.40.44.166]:42266 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726185AbgI0JO3 (ORCPT ); Sun, 27 Sep 2020 05:14:29 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id 67EF2100E7B43; Sun, 27 Sep 2020 09:14:28 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1431:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2693:2828:2904:2911:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3871:3872:3873:3874:4250:4321:4425:4605:5007:6119:7514:7903:8660:10004:10400:10848:11026:11232:11658:11914:12043:12048:12297:12438:12740:12760:12895:13069:13071:13148:13230:13311:13357:13439:14096:14097:14180:14181:14659:14721:21060:21080:21451:21627:21939:21990:30045:30054:30064:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: map07_2d111ff27177 X-Filterd-Recvd-Size: 2342 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf10.hostedemail.com (Postfix) with ESMTPA; Sun, 27 Sep 2020 09:14:26 +0000 (UTC) Message-ID: <6e7fe17a30e455187066da1079fad0941f5aa5cc.camel@perches.com> Subject: Re: [PATCH 4/5 V4] PCI: only return true when dev io state is really changed From: Joe Perches To: Ethan Zhao , bhelgaas@google.com, oohall@gmail.com, ruscur@russell.cc, lukas@wunner.de, andriy.shevchenko@linux.intel.com, stuart.w.hayes@gmail.com, mr.nuke.me@gmail.com, mika.westerberg@linux.intel.com Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, pei.p.jia@intel.com, ashok.raj@linux.intel.com, sathyanarayanan.kuppuswamy@intel.com, hch@infradead.org Date: Sun, 27 Sep 2020 02:14:25 -0700 In-Reply-To: <20200927082736.14633-5-haifeng.zhao@intel.com> References: <20200927082736.14633-1-haifeng.zhao@intel.com> <20200927082736.14633-5-haifeng.zhao@intel.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2020-09-27 at 04:27 -0400, Ethan Zhao wrote: > When uncorrectable error happens, AER driver and DPC driver interrupt > handlers likely call > > pcie_do_recovery() > ->pci_walk_bus() > ->report_frozen_detected() > > with pci_channel_io_frozen the same time. > If pci_dev_set_io_state() return true even if the original state is > pci_channel_io_frozen, that will cause AER or DPC handler re-enter > the error detecting and recovery procedure one after another. > The result is the recovery flow mixed between AER and DPC. > So simplify the pci_dev_set_io_state() function to only return true > when dev->error_state is changed. > > Signed-off-by: Ethan Zhao > Tested-by: Wen Jin > Tested-by: Shanshan Zhang > Reviewed-by: Andy Shevchenko > Reviewed-by: Alexandru Gagniuc > Reviewed-by: Joe Perches Hi Ethan/Haifeng. Like Andy, I did not "review" this patch and sign it. I merely suggested another simplification. Please do not add -by: lines unless actually received by you.