Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1433875pxj; Fri, 4 Jun 2021 14:29:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAiYOf0XufMNoNIJASkJnSy30qNT5GWYauV6kMjbjffgtOwnESNypI4dknzWLHaJdmrlG9 X-Received: by 2002:a17:906:35ca:: with SMTP id p10mr5938245ejb.535.1622842142449; Fri, 04 Jun 2021 14:29:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622842142; cv=none; d=google.com; s=arc-20160816; b=fXudWo6hVJbgL0U8S6yLsrA1xPqPkQVqAekDDw+ZR3ghAyKxtL0JYdmGwuJWjsyww6 6zrnae20XwL27NznUQWMwc6ARq/7jX2oNWhW7X5TtaOlbc9IuLejhy1pYPnYAfLcX7GM gEGFuse3hVY2tYoiFan7EbTrk+c2fIlFwgAY/8okBMnlGhqhtwwQJDMI31dZV2zLnCsW MO1WKKAUA/6sqLSVasfHQux2gNlx6x2A163kD7oD0Bt/4d7ES4ASW5bs+HL3fbovXzpT VutdQp/OMtoX2FXxGVLYEuatN4Hskf2dDT3JlRaFErp1TcSmO0hBk8eziSd972uMSrz/ tqYQ== 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 :message-id:subject:cc:to:from:date:dkim-signature; bh=8bXMDC9wUh2v306Nc3wPD4x6T9oRNCifnk3OWc2AZbU=; b=dlBNXG97tWGyJ2vcBKDbVcetsYKk5mJJlIhF3vOclldYeIYUIB+Yf07WHhCMX64/X4 aBFFiIOhYsc8W6h4tiQBFRqBPcKM4V1nv8Ol4Dcvg6BdXlU6bod7OBvjmnawjh/GRmNS c8VRlSOEI0tfFFJddiFnMIWmx0dtwELFyIQasNPjxeO8PkCCqvnpSM10cgAkxeS6Z234 4n1idJrpC7mPv40THo6t/uyOhxyQ+C7jMvD8+JDd7XuhJ526HWGXZZKhvBCdJMYsX5ct 6jsJdVqI5Lmr+B+Qc5jYswJxkEozFErcDMErzYYwjW9KkS1XlPODHWlL8duTyPKKDtGC dFaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QNhcezxf; 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 g13si5855360ejb.117.2021.06.04.14.28.38; Fri, 04 Jun 2021 14:29:02 -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=k20201202 header.b=QNhcezxf; 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 S230264AbhFDV2L (ORCPT + 99 others); Fri, 4 Jun 2021 17:28:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:33458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229665AbhFDV2K (ORCPT ); Fri, 4 Jun 2021 17:28:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 99B4261106; Fri, 4 Jun 2021 21:26:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622841984; bh=Gui3O5Hg4UntSL86u71QCTzn6Ff++kMTUZPRfpQKiyM=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=QNhcezxfRsjXoDrXp7aaNT5h5/R5Vxvl1wuGbFSFZn5tIOs/iLV52MbwcP8fwOBU3 lwD1+Xz66OIqfYdMxUyLj+svXn2fVEdZlbIlaY/VSwcvd8rqD2xpouHN163tWI6fhP zkxkZ8TF9JfuCiT4fELNEQI9MrWt5U//g4i4POlhEiAGLDWXyIxH3S3xXJ3veA/Zv1 jYh64lRiEIL/SnMTj/QirbusH7dwRiiJRZxmKCy+wxdUWNvfpjOs1eQlFv4A3LZ1Zy gQySY12V4FF/BROPFvJufoffJrLlXaHLLmDFTd23GnzbN6fJSrNlPRees3vFe0UbCR VngXyuZ1RXr/w== Date: Fri, 4 Jun 2021 16:26:22 -0500 From: Bjorn Helgaas To: Wei Liu Cc: Haiyang Zhang , bhelgaas@google.com, lorenzo.pieralisi@arm.com, linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org, kys@microsoft.com, olaf@aepfle.de, vkuznets@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] pci-hyperv: Add check for hyperv_initialized in init_hv_pci_drv() Message-ID: <20210604212622.GA2241239@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210602103206.4nx55xsl3nxqt6zj@liuwe-devbox-debian-v2> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 02, 2021 at 10:32:06AM +0000, Wei Liu wrote: > On Tue, May 25, 2021 at 04:17:33PM -0700, Haiyang Zhang wrote: > > Add check for hv_is_hyperv_initialized() at the top of init_hv_pci_drv(), > > so if the pci-hyperv driver is force-loaded on non Hyper-V platforms, the > > init_hv_pci_drv() will exit immediately, without any side effects, like > > assignments to hvpci_block_ops, etc. > > > > Signed-off-by: Haiyang Zhang > > Reported-and-tested-by: Mohammad Alqayeem > > Hello PCI subsystem maintainers, are you going to take this patch or > shall I? This was mistakenly assigned to me, so I reassigned it back to Lorenzo. If you *do* take this, please at least update it to follow the PCI commit log conventions, e.g., PCI: hv: Add check ... and wrap the text so it fits in 75 columns. > > --- > > drivers/pci/controller/pci-hyperv.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c > > index 6511648271b2..bebe3eeebc4e 100644 > > --- a/drivers/pci/controller/pci-hyperv.c > > +++ b/drivers/pci/controller/pci-hyperv.c > > @@ -3476,6 +3476,9 @@ static void __exit exit_hv_pci_drv(void) > > > > static int __init init_hv_pci_drv(void) > > { > > + if (!hv_is_hyperv_initialized()) > > + return -ENODEV; > > + > > /* Set the invalid domain number's bit, so it will not be used */ > > set_bit(HVPCI_DOM_INVALID, hvpci_dom_map); > > > > -- > > 2.25.1 > >