Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp60985rdb; Thu, 21 Dec 2023 02:51:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJDt5kVoxKfMVh69fQljmWFLNcuqEEo2DqqFhRkuUmB//n+WiUsPtyjUZFHDcVV9pcBJAo X-Received: by 2002:ac2:54ad:0:b0:50e:384d:4d2c with SMTP id w13-20020ac254ad000000b0050e384d4d2cmr3058659lfk.104.1703155901504; Thu, 21 Dec 2023 02:51:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703155901; cv=none; d=google.com; s=arc-20160816; b=TH/3mb1IU/m/qVU0knPJL3tW+UfMMPo4wsM9Z3BVwsiFJGUr34Tz1Kgb0SCJrGoY2G NEzBXzht59V35haMNAauuCZ1+ySdAhedO8WdtKPAoLSh85Q48MV+L+fkYhB8WmWpnQlM PnFQc/4R7JhwT4wTSocIy/8ptootlgmUhS5fyfsyxcfSOfXACpu543L6XhXk7aoRX1+u I16yv9bn9K+OtX48kZft5EXFS/31fykXxZBFqX9MdA7Yex8Hh81mAc7JrG83X6xXqVY0 xAgdaruVNUScA6dC81A66mOfUkIukykiMJT4o+4gn8Z9NBZbkSny/aYW0BjOTHRmIPdo 6hXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=W2l+j8aPW5IcX1d37y+PoIInCviovKVCCw4bZbO73kE=; fh=kC0WQDdunCbOGYYYpR7FYhmhya0QP8gghf/EUCh78yo=; b=hfrk+4IJZX3AMWTUR7uYAK5noCAGn2s0TJusVHnBztG2RUx7icy/jWZQaGPSk/Kv+k cWenjPEsTL7ixg/o8sOP1cqa3w33HQieoyxDBle4nNaDwB+ZXGPViXvYnbep+5M4IyvJ du7EURB7m0BmCVgAJUtgivtw/s/TdUY2fmHmTQoAf2fitt5qFYeWItGVOZJRuMFCjehq +AuImQyr4B5Zsxqu/nj5+diDwtuvfWj/JzuAhbeJgKPyfLEa53t1HlMJxA62DXOZzCSp UCLzEFCv8eHLUL8NKiPEjXNYw0m0f1P56dg1phnulPaK11LcfsjNx9cfEYutYPRHiqmU matA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-8246-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8246-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id t7-20020a1709063e4700b00a1f78a5b5c1si714959eji.613.2023.12.21.02.51.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 02:51:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8246-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-8246-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8246-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 416D51F25201 for ; Thu, 21 Dec 2023 10:51:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC4F26ABAD; Thu, 21 Dec 2023 10:51:28 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from bmailout2.hostsharing.net (bmailout2.hostsharing.net [83.223.78.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71BB46AB88; Thu, 21 Dec 2023 10:51:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=h08.hostsharing.net Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by bmailout2.hostsharing.net (Postfix) with ESMTPS id E7D5D28011472; Thu, 21 Dec 2023 11:51:24 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id D9B971E5F; Thu, 21 Dec 2023 11:51:24 +0100 (CET) Date: Thu, 21 Dec 2023 11:51:24 +0100 From: Lukas Wunner To: Ethan Zhao Cc: bhelgaas@google.com, baolu.lu@linux.intel.com, dwmw2@infradead.org, will@kernel.org, robin.murphy@arm.com, linux-pci@vger.kernel.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Haorong Ye Subject: Re: [PATCH 1/2] PCI: make pci_dev_is_disconnected() helper public for other drivers Message-ID: <20231221105124.GC12714@wunner.de> References: <20231213034637.2603013-1-haifeng.zhao@linux.intel.com> <20231213034637.2603013-2-haifeng.zhao@linux.intel.com> <20231213104930.GB31964@wunner.de> <31bd82b6-6f7e-4dc4-8cbb-46fa806d699f@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <31bd82b6-6f7e-4dc4-8cbb-46fa806d699f@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) On Thu, Dec 14, 2023 at 08:58:49AM +0800, Ethan Zhao wrote: > On 12/13/2023 6:49 PM, Lukas Wunner wrote: > > On Tue, Dec 12, 2023 at 10:46:36PM -0500, Ethan Zhao wrote: > > > move pci_dev_is_disconnected() from driver/pci/pci.h to public > > > include/linux/pci.h for other driver's reference. > > > no function change. > > > > That's merely a prose description of the code. A reader can already > > see from the code what it's doing. You need to explain the *reason* > > for the change instead. E.g.: "Make pci_dev_is_disconnected() public > > so that it can be called from $DRIVER to speed up hot removal > > handling which may otherwise take seconds because of $REASONS." > > Yup, why I made it public. then how about > > "Make pci_dev_is_disconnected() public so that it can be called from > Intel vt-d driver to check the device's hotplug removal state when > issue devTLB flush request." Much better. You may optionally want to point out the location of the file in the source tree because not everyone may be familiar where to find the "Intel vt-d driver". Also, not every reader may know where issuing of devTLB flush requests occurs, so it might make sense to name the function where that happens. Finally, it is common to adhere to terms used in the PCIe Base Spec in commit messages, so "ATC Invalidate Request" might be preferable to "devTLB flush request". Thanks, Lukas