Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2140919ybl; Sun, 18 Aug 2019 19:29:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwq/dFdrGFvIvkOkv3+psxihjG3GBuUk5NA+Oc1vbuU3ddR3x/l6f34f3PmNkItr/GOBGIf X-Received: by 2002:a17:902:9f82:: with SMTP id g2mr4145318plq.63.1566181770427; Sun, 18 Aug 2019 19:29:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566181770; cv=none; d=google.com; s=arc-20160816; b=b+9ScwKs5hfWuX1bq/i65wxrStlOytrAkouYIzMo4WnyyZCYd6wkua2BGfnKZkDJQc nWsQN0Y8nMofxXHkJoKfu3uTyB8cX6fX8MWLuDAs6/7thTf3d/3hErLPZ9coU6wktHIJ klGTdm3xN/qDtpIhxIziaa9flB0mliNUrQOvIyuwMcgJ/KU+6jRwyTgpXxbIqYkttD+X o6IBKMZHEVAvYLavXsRfRc93xtWCWHVzD+mi8j/H689HZzI6PQblBWsChqntEMoC0Z5G fBpOthlN4Qsgy7HHEmXbHBF+N/53+Z+3iRrmZvfk6exZAPLzMFO587icTH9YIeJtNJ8o csPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=HCXgnblLuPBIu7LoXIhdldMwWgbSbpuAkPZ5hsdlrEI=; b=xTcJrVxN8ATqE6o/xgYsBX+jFKUrQmbMyPLa38Bsn9tKIkXEPvcItmFj+RqdrOStL+ 0GwsR9csgbAxq8JYfEBUy8bZL7nXePDFdv9CRy4XFEU35fYoTrJMT66DmdcuG/g9cHUY rchqp9g0lAyDGbcX0U09BBfk88qrDBWTqfZrvPt92iVkcJq9AbWgo3WE1klrvyhAgYTN p11qI9FINoe0OZ1PXsz1RQuETWfymeawq4qE66VQP12iq86uJcVcoa22S/IdbB/LqG0+ yPAkxHCMsLM10ZrApVEDlE8l/zxZXdQZRTmw0hH7AoihMRtJsjtbAEIG9B/dTjwiuCUI SlTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1aR+005g; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id d5si9018588pla.93.2019.08.18.19.29.15; Sun, 18 Aug 2019 19:29:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1aR+005g; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726504AbfHSC2Z (ORCPT + 99 others); Sun, 18 Aug 2019 22:28:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:60670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726139AbfHSC2Y (ORCPT ); Sun, 18 Aug 2019 22:28:24 -0400 Received: from [192.168.1.74] (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 527F72087E; Mon, 19 Aug 2019 02:28:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566181703; bh=tRFaATwxagRnxg5e9oTIToxiP+fSshlHwHrwVBFW9tc=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=1aR+005gOBEDxMAwYvR2kZYSd2DhGVquW5MCgs5pRpZcFp3BZYUkSyVDbw/9M7Kha pboHlivuqlNohx+C2ymNp8JGs734juo08zi82BVlQBmzze/H5mW3rvUX+BQIUP5YSd /Iy9yoWqqWmzJcot8tmP0GFF8rWGZcfHMdl5ncmM= Subject: Re: [PATCH v2 2/2] PCI: pciehp: Prevent deadlock on disconnect To: Mika Westerberg , Bjorn Helgaas , "Rafael J. Wysocki" Cc: Lukas Wunner , Keith Busch , Andy Shevchenko , Frederick Lawler , "Gustavo A . R . Silva" , Kai-Heng Feng , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190812143133.75319-1-mika.westerberg@linux.intel.com> <20190812143133.75319-2-mika.westerberg@linux.intel.com> From: Sinan Kaya Openpgp: preference=signencrypt 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+4LAFcFAlztcAoCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQvGF4I+4L AFfidAf/VKHInxep0Z96iYkIq42432HTZUrxNzG9IWk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, 18 Aug 2019 22:28:13 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190812143133.75319-2-mika.westerberg@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/12/2019 10:31 AM, Mika Westerberg wrote: > +int pciehp_card_present_or_link_active(struct controller *ctrl) > { > - return pciehp_card_present(ctrl) || pciehp_check_link_active(ctrl); > + int ret; > + > + ret = pciehp_card_present(ctrl); > + if (ret) > + return ret; > + > + return pciehp_check_link_active(ctrl); The semantics of this function changed here. Before it was checking for either presence detect bit or link active bit. Now, it is looking to have both set. There are PCI controllers that won't report presence detect correctly, but still report link active. I think you want if (ret < 0) return ret; here to match the previous behavior while still handling device removal.