Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1247436pxk; Fri, 25 Sep 2020 09:44:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmgx26VIDRIjOLz65cAlw2hNIM7Ygd61t+JzXK5Zr8vIpeoy2nNGFvJ0wCx6Y+QP5alXA/ X-Received: by 2002:a17:906:c0d0:: with SMTP id bn16mr3548253ejb.279.1601052281415; Fri, 25 Sep 2020 09:44:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601052281; cv=none; d=google.com; s=arc-20160816; b=aWvLOQiR8x7XU12GpQB4R51QgzQskCfFDKIonm3qgvLL6hTSyCz6eK2FHYAz+AUIBD XzB2s7nD3aiFAVI9yQwpZ8bOpsNh9qsh0CefF63jLEt71i8Na9voKP9BxBqjJw9jd31/ RbmbT6EvZ16v5lGGahjx80aC8BFscNJMOEv1eNdT7LAF2pUA0/2xby8+V+c5fhBq30QS eYOc64e2iODdbGR3qLvlRmov35TDF7hE1QJzsfEKoG98m2c6sARVVat6RIp2egqgmCdI ehTsI78bxrMHT9EHOx2GzWIXU4+LEccw7hkHPXbUci68OOVhHkWsv+a1TQbjl9anAsj0 lG/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=HbVxJE8SRc4Fbc4yVTq4U0X34ILQImKpZ3oQlKBnQIo=; b=Ke0Z9wBhxiAQ3NbM6e5cNloF7ZxZ9bM1OHb/no+m0vD+/dd5sGG3/rzGG1f5h9D8Ss AILL9wHCR8N2/u70VO1hngLG8AXpwQrFfDgJYMcloy0vcd0h2q8EON/ELPiQH00gBXyF 7kNrQFUd5dcIexnO3sZym5BQTCR6MI5MQ3eyczD2fRFjcT5/BztUEla4r6elvTE89CIF 2SrShhDqsgAlweLqN83FKITYSzaF4VA3VDaL5CoF0k5uODG1hSDzOnGALAPKbb8//3gu I/BmlZurLpvjPNcXLLe2y/KovaJIinSabQYdam1QxFCru22Fu6CYJHDuTsXnKu6Abz+X 16Zg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j11si2263116ejk.10.2020.09.25.09.44.18; Fri, 25 Sep 2020 09:44: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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729223AbgIYQkm (ORCPT + 99 others); Fri, 25 Sep 2020 12:40:42 -0400 Received: from mga04.intel.com ([192.55.52.120]:26777 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726990AbgIYQkm (ORCPT ); Fri, 25 Sep 2020 12:40:42 -0400 IronPort-SDR: d2yBEuqkY3481dZBXrpTCNz1+8SGLrR4mpuzGk4JX37sbWJ7F+Z3kWYoDNtxcaUDBVwAOdLjXo dIKoXeeZTXOw== X-IronPort-AV: E=McAfee;i="6000,8403,9755"; a="158980020" X-IronPort-AV: E=Sophos;i="5.77,302,1596524400"; d="scan'208";a="158980020" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2020 09:40:08 -0700 IronPort-SDR: 7Snvcif0RQrruV5i04teGjWGlvgAHxfwMBgqUnBRQ7p0yaeCb/Gdxu7ly69HDuOU7ZJM+UIYEG LrAqPJiLBTGA== X-IronPort-AV: E=Sophos;i="5.77,302,1596524400"; d="scan'208";a="310880095" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2020 09:40:05 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1kLmwV-001uyQ-Sn; Fri, 25 Sep 2020 15:35:15 +0300 Date: Fri, 25 Sep 2020 15:35:15 +0300 From: Andy Shevchenko To: Ethan Zhao Cc: bhelgaas@google.com, oohall@gmail.com, ruscur@russell.cc, lukas@wunner.de, stuart.w.hayes@gmail.com, mr.nuke.me@gmail.com, mika.westerberg@linux.intel.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, pei.p.jia@intel.com Subject: Re: [PATCH 3/5] PCI/ERR: get device before call device driver to avoid null pointer reference Message-ID: <20200925123515.GF3956970@smile.fi.intel.com> References: <20200925023423.42675-1-haifeng.zhao@intel.com> <20200925023423.42675-4-haifeng.zhao@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200925023423.42675-4-haifeng.zhao@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 24, 2020 at 10:34:21PM -0400, Ethan Zhao wrote: > During DPC error injection test we found there is race condition between > pciehp and DPC driver, null pointer reference caused panic as following null -> NULL > > # setpci -s 64:02.0 0x196.w=000a > // 64:02.0 is rootport has DPC capability > # setpci -s 65:00.0 0x04.w=0544 > // 65:00.0 is NVMe SSD populated in above port > # mount /dev/nvme0n1p1 nvme > > (tested on stable 5.8 & ICX platform) > > Buffer I/O error on dev nvme0n1p1, logical block 468843328, > async page read > BUG: kernel NULL pointer dereference, address: 0000000000000050 > #PF: supervisor read access in kernel mode > #PF: error_code(0x0000) - not-present page Same comment about Oops. -- With Best Regards, Andy Shevchenko