Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp1826614imc; Fri, 22 Feb 2019 11:57:19 -0800 (PST) X-Google-Smtp-Source: AHgI3IZerp26FE8ecmbQOQYH1ofBhIIjVmPqOObLdmz/ofRn3fmUQS129yt6Q+pUS1sFgVY2SQ5q X-Received: by 2002:aa7:8847:: with SMTP id k7mr5783018pfo.99.1550865439804; Fri, 22 Feb 2019 11:57:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550865439; cv=none; d=google.com; s=arc-20160816; b=LXqsgxJafQQ0sT6bHcqWjmdzhHlL54maeGJDrCM7C/JFvSYRr0XCDR0MLjSUX6q303 Irq/H+aUDHTWiaQkCJoCAjNQ/xO47Y1QmiuQ3WCg95KICDqqELVxzkpnd/7+pB0lGbhR hLe1Rq6KnfrKaNZB80jsfYEyI8KQx7JyXh4cdWKpCk2WQdN28ZZxz/ur9FyXDV3UNAnU sj3Pi3Ej1ovaCPm4v/uWwV/EoZnXO/TNBgYpVtkQ8O6r/zASHFDWaoPimMDLfH5qlFg8 UsDE8DV9wveXstn+NOktFVKM5laANBiLWz4gXhgHxKYLkuNI03STfbD8ygdHU98FYY66 T7Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:to:from:cc:dkim-signature; bh=2ob5gvrqpEtcQNugtGQDuTTwtumvu4XcNlzXeCq2ynM=; b=OWIO1D7xV94QVmersZBfK7XhskNrtKIraoisqe0ztaSH99hCDxlXJ9iafDESkKmxza 1MtxAkE2zY+s0j+Zd/zIUlBEL3x556mvk8PFEoAx2MaI4WpG3n3EtKLcikji6FZBiZ53 Gi0HwfQDNg29OAz9OPzyCzcxxync4jmtu670Z0JdQmPKA9iERkOlBHR+OtXeg0srohlR X3Lza3a6QjcZz5p/U5kJ8aUu/4cXvw6IJZd8dJII+iCHCDbunxphuAZSsjOlbMvScQJ3 ZgF+aRDg2c+1hjy3N5sQ1kArtIQIGcay4FGyLlbQEJnsFVq7teeVS0HKIS5ReHhzjoom hOqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@dellteam.com header.s=smtpout header.b=CXQTpY12; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v3si2081677pga.556.2019.02.22.11.57.04; Fri, 22 Feb 2019 11:57:19 -0800 (PST) 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=fail header.i=@dellteam.com header.s=smtpout header.b=CXQTpY12; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726654AbfBVT4m (ORCPT + 99 others); Fri, 22 Feb 2019 14:56:42 -0500 Received: from esa5.dell-outbound.iphmx.com ([68.232.153.95]:51463 "EHLO esa5.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725892AbfBVT4m (ORCPT ); Fri, 22 Feb 2019 14:56:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dellteam.com; i=@dellteam.com; q=dns/txt; s=smtpout; t=1550865379; x=1582401379; h=cc:from:to:subject:date:message-id:references: content-transfer-encoding:mime-version; bh=mCUDY+Sygt522QCXqMHQTd6X6QbkG/EpAaAKhTFn4Z4=; b=CXQTpY12w5x7yn2RM5zsId1znR63r5JWT9OBeLyl+EDhid44oJWmW1Zt U6tcr5s2KgZlsne4PoF2D9MG7or5blNARV5OUbDCOT6P6fNpn1HzcIms9 oMrq+tz8MYD4hGDT7YTi/xCOtEBD2x6kD5yjXYdtW6VvOdXC7tlewAE6A g=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2EDAAB/UnBchieV50NkGgEBAQEBAgE?= =?us-ascii?q?BAQEHAgEBAQGBUQUBAQEBCwGCWYEUMYwXX40IgX2WIRSBZwsBASyEQIQBIjQ?= =?us-ascii?q?JDQEDAQECAQECAQECEAEBAQoJCwgpL4I6IoJwAQEBAxIVEz8QAgEIGB4QVwI?= =?us-ascii?q?EARoTB4J+gXOfUD0CbYEBiQcBAQGBazOKMIxIghaDdS6EaRiFYQKMD5dKCQW?= =?us-ascii?q?SUyGTD4pOkg4CBAIEBQIUgUeCD3CDPYI1HI4LQYFZjUQBgR4BAQ?= X-IPAS-Result: =?us-ascii?q?A2EDAAB/UnBchieV50NkGgEBAQEBAgEBAQEHAgEBAQGBU?= =?us-ascii?q?QUBAQEBCwGCWYEUMYwXX40IgX2WIRSBZwsBASyEQIQBIjQJDQEDAQECAQECA?= =?us-ascii?q?QECEAEBAQoJCwgpL4I6IoJwAQEBAxIVEz8QAgEIGB4QVwIEARoTB4J+gXOfU?= =?us-ascii?q?D0CbYEBiQcBAQGBazOKMIxIghaDdS6EaRiFYQKMD5dKCQWSUyGTD4pOkg4CB?= =?us-ascii?q?AIEBQIUgUeCD3CDPYI1HI4LQYFZjUQBgR4BAQ?= Received: from mx0a-00154901.pphosted.com ([67.231.149.39]) by esa5.dell-outbound.iphmx.com with ESMTP/TLS/AES256-SHA256; 22 Feb 2019 13:56:19 -0600 Received: from pps.filterd (m0142699.ppops.net [127.0.0.1]) by mx0a-00154901.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1MJhLaW193665; Fri, 22 Feb 2019 14:56:41 -0500 Received: from esa1.dell-outbound2.iphmx.com (esa1.dell-outbound2.iphmx.com [68.232.153.201]) by mx0a-00154901.pphosted.com with ESMTP id 2qtp2qgk7m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 22 Feb 2019 14:56:41 -0500 Cc: , , , , , , , Received: from ausxippc101.us.dell.com ([143.166.85.207]) by esa1.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA256; 23 Feb 2019 01:56:30 +0600 X-LoopCount0: from 10.166.134.89 X-IronPort-AV: E=Sophos;i="5.58,400,1544508000"; d="scan'208";a="1200292796" From: To: , Subject: Re: [PATCH RFC v2 2/4] PCI: pciehp: Do not turn off slot if presence comes up after link Thread-Topic: [PATCH RFC v2 2/4] PCI: pciehp: Do not turn off slot if presence comes up after link Thread-Index: AQHUyLqR+ed3yG3ljUu42ub7Hwypsg== Date: Fri, 22 Feb 2019 19:56:28 +0000 Message-ID: References: <20190220012031.10741-1-mr.nuke.me@gmail.com> <20190220012031.10741-3-mr.nuke.me@gmail.com> <20190221073634.snvazxlzgvjhilaz@wunner.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [143.166.11.234] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-22_13:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=595 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902220136 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/21/19 1:36 AM, Lukas Wunner wrote:=0A= > On Tue, Feb 19, 2019 at 07:20:28PM -0600, Alexandru Gagniuc wrote:=0A= >> mutex_lock(&ctrl->state_lock);=0A= >> + present =3D pciehp_card_present(ctrl);=0A= >> + link_active =3D pciehp_check_link_active(ctrl);=0A= >> switch (ctrl->state) {=0A= > =0A= > These two assignments appear to be superfluous as you're also performing= =0A= > them in pciehp_check_link_active().=0A= =0A= Not sure. Between the first check, and this check, you can have several =0A= seconds elapse depending on whether the driver's .probe()/remove() is =0A= invoked. Whatever you got at the beginning would be stale. If you had a =0A= picture dictionary and looked up 'bad idea', it would have a picture of =0A= the above code with the second check removed.=0A= =0A= I've got all the other review comments addressed in my local branch. I'm = =0A= waiting on Lord Helgass' decision on which solution is better.=0A= =0A= Alex=0A= =0A= =0A=