Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2462155pxk; Sun, 27 Sep 2020 08:30:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzv7dghZpiPYigo3lzWOAihUQ05vvp4c/E3gEVY40kjap+3xRiBNSzD/E+jp9BGbos3uqH X-Received: by 2002:a17:906:30cf:: with SMTP id b15mr11646774ejb.351.1601220610032; Sun, 27 Sep 2020 08:30:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601220610; cv=none; d=google.com; s=arc-20160816; b=GS+Z2yxdaCJSFZ+JUhx5+oga6z+hZWwASdSGA5Sl1utiiusb26t6x9WePhRaRLXZk+ sgpWmnem3JeAGDkR7Uudr3aPg3vDjgMYmWHwXmr8ZdvCwqDZzy09j/BPRhATFiN+QrOy UIbkvznkSCVBpDE6as+DJ+tNt3aiGpJsSr8MUgh6jtB+zeZiISAbOKsSOPF66RXZ5K9t D1RyTxkFRYXzsQ0kRmyj3msFVIwaDRYasQ/Ss/kMh9HC9DqAe4cMH/aeX4cCKcBZRxr4 95MrPIDj2/viPxNMqAChID6py/aW2d6E3e3bE4T5kaPiFdg2aNz6uIa4x3VhuB9tzkh8 OxlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:autocrypt:from :references:cc:to:subject:dkim-signature; bh=4h+6yKw9lQy3q9x3wKVNTzuvwQDzgSUSGIHPVK7uMmw=; b=BS1fh/GsriVIA/hYnfiolkxA6oCL7mXtGsRxCQ3LoksZ8rhYyACeiL5FHe5o7kxDET 6aleedR0o5KcqHFeaDgT8znKItYM5+S5w3zu6P5pOIieTY1qhLUS7ACjpytOYrSCb5nf tdxStoPFtlgr/fYNohWATxWQi6Aguihs4D5tQH3YLoOXOgR+7eSGsh40QYMhkFxmJwTw RkemdQeozcy47E4Nweid4kwgQKUl5hMf7mRG9tyWJGUsGyizAajQkRSisRxcBtUZ5xRl qMZIyCtsivP0/kn1dHd9NqXcYEwWEr505McPXrQ3ALu5qLn2IPshN8bnhwGufo4yxp/c JKjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AchQ5I+d; 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 l21si6456735ejg.119.2020.09.27.08.29.46; Sun, 27 Sep 2020 08:30:10 -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=default header.b=AchQ5I+d; 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 S1726315AbgI0P1t (ORCPT + 99 others); Sun, 27 Sep 2020 11:27:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:49556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726210AbgI0P1t (ORCPT ); Sun, 27 Sep 2020 11:27:49 -0400 Received: from [192.168.0.112] (75-58-59-55.lightspeed.rlghnc.sbcglobal.net [75.58.59.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4286923899; Sun, 27 Sep 2020 15:27:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601220468; bh=ghI4SDPcs9ny3QAb9kTUesvhXSzM8eWaBp3CgO0sxvw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=AchQ5I+dL4yGR/mAb5ygcHnme9SLZ4bE9ef77rwjRZPmxep4ETDEMk+KJrUJArJEC MrmbPvApWTD4Kfl4tMPjmJGwfsVo+uf9v4hlxrR0WKjqBs+2k2MeNa5MjGsnrWKEjw SOh1KsC42i4QuKqnDdBpBaKJZlK2W3NQ4pcfio4c= Subject: Re: [PATCH 2/5 V2] PCI: pciehp: check and wait port status out of DPC before handling DLLSC and PDC 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, Keith Busch 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 References: <20200927032829.11321-1-haifeng.zhao@intel.com> <20200927032829.11321-3-haifeng.zhao@intel.com> From: Sinan Kaya Autocrypt: addr=okaya@kernel.org; keydata= mQENBFrnOrUBCADGOL0kF21B6ogpOkuYvz6bUjO7NU99PKhXx1MfK/AzK+SFgxJF7dMluoF6 uT47bU7zb7HqACH6itTgSSiJeSoq86jYoq5s4JOyaj0/18Hf3/YBah7AOuwk6LtV3EftQIhw 9vXqCnBwP/nID6PQ685zl3vH68yzF6FVNwbDagxUz/gMiQh7scHvVCjiqkJ+qu/36JgtTYYw 8lGWRcto6gr0eTF8Wd8f81wspmUHGsFdN/xPsZPKMw6/on9oOj3AidcR3P9EdLY4qQyjvcNC V9cL9b5I/Ud9ghPwW4QkM7uhYqQDyh3SwgEFudc+/RsDuxjVlg9CFnGhS0nPXR89SaQZABEB AAG0HVNpbmFuIEtheWEgPG9rYXlhQGtlcm5lbC5vcmc+iQFOBBMBCAA4FiEEYdOlMSE+a7/c ckrQvGF4I+4LAFcFAlztcAoCGwMFCwkIBwIG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fXqF3sX9Aol2eLUmQuLpThJtq5EHu6FzJ7Y L+s0nPaNMKwv/Xhhm6Y= Message-ID: Date: Sun, 27 Sep 2020 11:27:46 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200927032829.11321-3-haifeng.zhao@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/26/2020 11:28 PM, Ethan Zhao wrote: > diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c > index 53433b37e181..6f271160f18d 100644 > --- a/drivers/pci/hotplug/pciehp_hpc.c > +++ b/drivers/pci/hotplug/pciehp_hpc.c > @@ -710,8 +710,10 @@ static irqreturn_t pciehp_ist(int irq, void *dev_id) > down_read(&ctrl->reset_lock); > if (events & DISABLE_SLOT) > pciehp_handle_disable_request(ctrl); > - else if (events & (PCI_EXP_SLTSTA_PDC | PCI_EXP_SLTSTA_DLLSC)) > + else if (events & (PCI_EXP_SLTSTA_PDC | PCI_EXP_SLTSTA_DLLSC)) { > + pci_wait_port_outdpc(pdev); > pciehp_handle_presence_or_link_change(ctrl, events); > + } > up_read(&ctrl->reset_lock); This looks like a hack TBH. Lukas, Keith; What is your take on this? Why is device lock not protecting this situation? Is there a lock missing in hotplug driver? Sinan