Received: by 2002:a05:6830:16d2:b0:61c:ac69:ca1b with SMTP id l18csp43046otr; Tue, 2 Aug 2022 15:41:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sXm4uPW13juc4wU1YrV5d1VWIPWmNRJkELIepheqHrhJuhKbF5W0nAi0MqW0eVrHH1Cjxq X-Received: by 2002:a05:6402:3693:b0:43d:1a40:21fd with SMTP id ej19-20020a056402369300b0043d1a4021fdmr22224714edb.206.1659480084205; Tue, 02 Aug 2022 15:41:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659480084; cv=none; d=google.com; s=arc-20160816; b=GpQiepPh4JTn8lF87xracKzYfRJI+YIFR7gpqMlX5Dd5D+BY0RmSGlZPi+F++xcoFC 5RD31Q5KpnUJM7h6CFEA+gW7FchWy8aEBW4eluH/4tmfqINhg2Q1sLcgf0LZ7UP8ceNG zuQUw/FUcVyxHlNeZA68j9srxO/R4hLUGIpizMzjq0nNAxx/uiOqPZrua1w0iIMMPgn5 UootsKqCEMAdUQViLYHFTHPbCRmTPvwkQLD1VstqXyGLuTf9SHcBhE3x4XqRGZOOQ9Az YeQV3L3UMyT81W+A9gG39j8Es70Kk1MOc+a/DR2KRCKGzPqS2dd9cSM7wmAXfAcpy3nM INuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=yX+b9vKM64BIHKdWKHiDXuOChQAIzvu4J7cVT/uA/MU=; b=e2vUVW5JuAIp0yIruUQKthZVq/TqxPBVIPLNFliYV+NfwFf/kUcHTLu/7QM6YEYgza I4XxfM6v2zwcGZjIINwtadlYlRBL6tvcLbjspoB/HiTbW4Wm33Hb1mlwid18j18HvC3S ut4J1MoLSdt+bTecQI29l1KJ9Ba68QOchSfD30Y6xxricSZFsr8AouAFNMgWONd11IR4 KYbxTePtFnAe0prgNhDsfgolO9evPz2rHMKIcqvVin4aS3q6VDsO5So6CU4QgZ1zcVHD aLQRSDhLXTS+EVqGw6k4lg7tiKG/gmmnM0tXOjyXzQ+sfCEeDqQIODX+DNGFFmF5adsz 3eow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MmRK1ttV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv13-20020a17090760cd00b007308bd44018si7505840ejc.550.2022.08.02.15.40.58; Tue, 02 Aug 2022 15:41:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MmRK1ttV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232483AbiHBWS4 (ORCPT + 99 others); Tue, 2 Aug 2022 18:18:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230173AbiHBWSy (ORCPT ); Tue, 2 Aug 2022 18:18:54 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2618464C3; Tue, 2 Aug 2022 15:18:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659478734; x=1691014734; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=46eujB+5/ILB4xpJ6ANIISZP2uck5Pj6UwNACvgbNjc=; b=MmRK1ttVz2Nm3VY0GKCuDArwtOptnOV9xJht8WlA/6ggoxEV1e2giSdk 0nATb1gRo0NT4jV0UWi1eVgCMzZ10zaHDwPuMtIUQfPeRr/BzSG/MzTpr utjhlZPxnwFJ+59P/ZTtfd4P5fwDArwcqbcQ3fdLFqeZsyo+yeFlzF+VR pEYqOd+cHGtA1dWIrvmRt7teU651TMAe0tgGjsU/KeaGyha2yT6xWVY8D HpLCksNSfKh2R+UEvpwcxjh/d/BkiROMBOevzkCfZPMfvEOcJZgIA3kbK SOfajcEmv4wfGKn0b48aoIKDudU+zbJwrjw/b4Fy/H8G+gvGclGcGcbri A==; X-IronPort-AV: E=McAfee;i="6400,9594,10427"; a="288286381" X-IronPort-AV: E=Sophos;i="5.93,212,1654585200"; d="scan'208";a="288286381" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2022 15:18:53 -0700 X-IronPort-AV: E=Sophos;i="5.93,212,1654585200"; d="scan'208";a="692015304" Received: from lkeefe-mobl.amr.corp.intel.com (HELO [10.212.232.208]) ([10.212.232.208]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2022 15:18:53 -0700 Message-ID: <6056c6cc-9861-9c29-8e36-48e0dd36c702@linux.intel.com> Date: Tue, 2 Aug 2022 15:18:53 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.11.0 Subject: Re: [PATCH v3] PCI/ERR: Use pcie_aer_is_native() to judge whether OS owns AER Content-Language: en-US To: Zhuo Chen Cc: ruscur@russell.cc, oohall@gmail.com, bhelgaas@google.com, lukas@wunner.de, jan.kiszka@siemens.com, stuart.w.hayes@gmail.com, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220727035334.9997-1-chenzhuo.1@bytedance.com> From: Sathyanarayanan Kuppuswamy In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/27/22 2:37 AM, Zhuo Chen wrote: >> > Do you mean changing "if ((host->native_aer || pcie_ports_native) && aer)" into "if (pcie_aer_is_native(dev) && aer)" ? > I thought changing into "if (pcie_aer_is_native(dev))" before. > > One another doubt. Not every pci device support aer. When dev->aer_cap is NULL and root->aer_cap is not NULL in aer_root_reset(), pcie_aer_is_native() will return false and OS cannot operate root register. It's different from just using "(host->native_aer || pcie_ports_native)". > > Or we can change "if ((host->native_aer || pcie_ports_native) && aer)" into "if (pcie_aer_is_native(root))". But in this way, argument NULL pointer check should be added in pcie_aer_is_native(). Looking into it again, I think it is better to leave it as it is. Please ignore my comment. -- Sathyanarayanan Kuppuswamy Linux Kernel Developer