Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4361232pxj; Tue, 25 May 2021 06:22:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4OE1zYrPL6uc9gpvRMVa/w+AzS3e2BWxd+8d2aD8qdpBCPVodj1/IJja+qVbh1xXj5/bv X-Received: by 2002:a17:906:fb88:: with SMTP id lr8mr28717023ejb.429.1621948963822; Tue, 25 May 2021 06:22:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621948963; cv=none; d=google.com; s=arc-20160816; b=kv0SNJj4CXuf3zTYpnoiBno42/+zISTemGvCvTpHa9iad39DFy0KldoEOlJYGpLwbO X/WLxPjNkvQfnSdtDE7fvFeIRU7UCwtPoOScqUgWvAl9H45Wj6N1dJ2sERpBBQzkBLQZ Z4aM3CRMIZbcgd18pqF2y6RkgZWtHXIQm6ClCuGXwN3hmMQgryYzwNrnCEfqUlRTwKmo IcIdTs+ZMkaNTdN5/JWdKanuFM4ztWj7YynFVNAaSs3glp0tv7I9cjQjTgVEk4UvqYsC 9D1y0xxAJz9EgxOEkxQebUrWl6WsZBXdAGxVdgBb5VzAZeadGT5Kk5Ew6/X60kklL+JN hapw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=0m3RCAXahdUBRecbZdgKCTWuOHPg5vuE0WA5DSFNEuc=; b=Je7MtUbiXDuno0ZcwR5fbnxvB3pUDkw2rIkEmXJYLpzK5h4bHWk0451VmWt1G7uSVz +XZBGd7I36u/yae67RD/Qii/uBPXVmpjo9YtSL+6FuIY60MukPxXEOoIJvS+y3DtVzL+ J0HZMia/TnymCk7m4bs7rZR05+qsO8tiU4MD4wT9z2WiAzP7ckuWSBAVAHeG/QwqBA34 6WHbHKo0zG+fX/kC2X4rRO2ZMtg35skonUNvJvR7mUKY20b6I5Xv60b/hCODzsr3AcVX 3WBKdE+1mU4/ubrYKu964U1o9FK2LovbwuOtftyFTL9Bqcm3E6c1US+segs4MLnmp+hz QvKA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zh8si18417331ejb.109.2021.05.25.06.22.20; Tue, 25 May 2021 06:22:43 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233172AbhEYNWK (ORCPT + 99 others); Tue, 25 May 2021 09:22:10 -0400 Received: from mail-ej1-f50.google.com ([209.85.218.50]:44998 "EHLO mail-ej1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233070AbhEYNWJ (ORCPT ); Tue, 25 May 2021 09:22:09 -0400 Received: by mail-ej1-f50.google.com with SMTP id lz27so47288497ejb.11; Tue, 25 May 2021 06:20:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=0m3RCAXahdUBRecbZdgKCTWuOHPg5vuE0WA5DSFNEuc=; b=oElrAF+IsJ6+8vqxWH2pp7cP8yfSoH0g+JCXd+wBPDyG3QaNr0fTgP6uCtpAGp/jAz BAgSemkLDZQUtezSEvOYvezFp0HpJO0VCbhrV9DcMiXgZPGT04Gi1PJazVL3Ax+K5+vG F2xEe4JwcrtI7rKjLpCb+KjzznAc+XxVIdrMrvTRA+4xA+IozhSDKO69wbv9PnMDJpP3 qFwBewpUsV6nOCDANPr/Jowm2SHxA3spyy+ZzfLtMEMPuK5KkvCRyoGhVv/+5+tV6kzs qeX2YgFvTRr/LS5ZrrrFKumTdMgwwG2XdXc/9LpG8F5bo2VBjxLnppte+hMrnaktPmbQ T4zA== X-Gm-Message-State: AOAM530GQ89BtHACi+9wG6/pmVn7TmGGFy6Vg+QZNgEFrSP4zsgAReX+ mHqR8JSkRUhAwpIgZtmG7snGCdcuEr6LJw== X-Received: by 2002:a17:906:2b8c:: with SMTP id m12mr25091741ejg.358.1621948837922; Tue, 25 May 2021 06:20:37 -0700 (PDT) Received: from rocinante.localdomain ([95.155.85.46]) by smtp.gmail.com with ESMTPSA id s21sm10759721edy.23.2021.05.25.06.20.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 06:20:37 -0700 (PDT) Date: Tue, 25 May 2021 15:20:35 +0200 From: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= To: Lambert Wang Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] pci: add pci_dev_is_alive API Message-ID: <20210525132035.GA66609@rocinante.localdomain> References: <20210525125925.112306-1-lambert.q.wang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210525125925.112306-1-lambert.q.wang@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Lambert, Thank you for sending the patch over! To match the style of other patches you'd need to capitalise "PCI" in the subject, see the following for some examples: $ git log --oneline drivers/pci/pci.c Also, it might be worth mentioning in the subject that this is a new API that will be added. > Device drivers use this API to proactively check if the device > is alive or not. It is helpful for some PCI devices to detect > surprise removal and do recovery when Hotplug function is disabled. > > Note: Device in power states larger than D0 is also treated not alive > by this function. [...] Question to you: do you have any particular users of this new API in mind? Or is this solving some problem you've seen and/or reported via the kernel Bugzilla? > +/** > + * pci_dev_is_alive - check the pci device is alive or not > + * @pdev: the PCI device That would be "PCI" in the function brief above. Also, try to be consistent and capitalise everything plus add missing periods, see the following for an example on how to write kernel-doc: https://www.kernel.org/doc/html/latest/doc-guide/kernel-doc.html#function-documentation > + * Device drivers use this API to proactively check if the device > + * is alive or not. It is helpful for some PCI devices to detect > + * surprise removal and do recovery when Hotplug function is disabled. As per my question above - what users of this new API do you have in mind? Are they any other patches pending adding users of this API? > + * Note: Device in power state larger than D0 is also treated not alive > + * by this function. > + * > + * Returns true if the device is alive. > + */ > +bool pci_dev_is_alive(struct pci_dev *pdev) > +{ > + u16 vendor; > + > + pci_read_config_word(pdev, PCI_VENDOR_ID, &vendor); > + > + return vendor == pdev->vendor; > +} > +EXPORT_SYMBOL(pci_dev_is_alive); Why not use the EXPORT_SYMBOL_GPL()? Krzysztof