Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp385789pxb; Wed, 3 Feb 2021 07:48:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJubQzKuWKx4ElLF2WC/MYcKaz8nknOE2uwBl6JfAb+VgHc6hpEwJpNrjuRx7whayoqK3S X-Received: by 2002:a17:906:c455:: with SMTP id ck21mr3889346ejb.354.1612367311725; Wed, 03 Feb 2021 07:48:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612367311; cv=none; d=google.com; s=arc-20160816; b=E/T4UB/Ip2rZvpRBMda9+RmE02PGP4WtDh9y1Wl8FiZHshIDfkzdxDkbStg6WR6IO1 CNqKwdX7vC5zL8O+l7yDeCtu9iq+9ViBLCCGSF2TnxfF4rUvyr+EKK5d18AzHLhg6A1e nEgCSju4AI1Gi6xOQl/z7vseOYPjUGMMfok60LrsCDeoUFT0JwBlphFnLt3nKaft176u goks0leca5iHo7GXszgElGymU4rPfm8MuyHeOLKGTbbSFT6mBzx9/jf5YpBuJXrhoye7 w808cB8ffpD3IpqNnALGKQqkKT+X+GUYEhvI7GfdvOYF9r74M45oD1UDUtVHjN4UvU6o KIsw== 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:dkim-signature; bh=tu9LEw5loFkoLHK9qKWMPaShmwNwlA2edyxOwBI59L4=; b=G/cf13hqgJjtxoDFZSoq7tSfw98CzEk3kiup/WppbcMpuc2W6t5Pjm2ahAup4g8B/v 3KIyxCFFWz9ohWpN3WzBed/pJN9eaYZEg8YLGama0xM6aHiILnHsL0J0WAEOLbe52lwn ufG8YnSQtsaP7tVdhIBI3BPyZwYe7DHE+sy5uS38JfYHwy9wrRVFRn3Pk5e7kPHRgXav fLo9LcKZAnutIXXmnBYX4h470iQfMGvM8ulrGcapAhxx7Rc+6Z37T5M837Pj+vYi582F 7cb7z80r2+Mw5xTNdGOiJYqwjZddxr7sAJvPcyDs3iwEIYMPl26wF7K/XfpfQ8g6TBth Mefw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g+I3GRdb; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d20si964517edy.24.2021.02.03.07.48.06; Wed, 03 Feb 2021 07:48:31 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=g+I3GRdb; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234639AbhBCPrC (ORCPT + 99 others); Wed, 3 Feb 2021 10:47:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:59432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234535AbhBCPpn (ORCPT ); Wed, 3 Feb 2021 10:45:43 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C06FE64E41; Wed, 3 Feb 2021 15:45:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612367102; bh=Kvu33qKzqe5FNDc9FlCFlRbXF4BqR859cnK7VKCkWiE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=g+I3GRdbyUuvqlL+yxntqhilgRG9W7s8iC65GhJMw+ys69kDBCjUcGWb2D4LHGzy/ Ll50u5loRgU6SV3jQrqKYDcOICBtPdDbQoc3prmpu24iCvhmT+gBSl+qJ7GQFa4iRD EkhmMi/r++Kjwf/vsw4iVlJANqSSsRMBSaRwXqoo= Date: Wed, 3 Feb 2021 16:44:59 +0100 From: Greg KH To: Mihai Carabas Cc: linux-kernel@vger.kernel.org, arnd@arndb.de, andriy.shevchenko@linux.intel.com, bobo.shaobowang@huawei.com Subject: Re: [PATCH 2/2] misc/pvpanic: add pci driver Message-ID: References: <1612363439-26656-1-git-send-email-mihai.carabas@oracle.com> <1612363439-26656-3-git-send-email-mihai.carabas@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1612363439-26656-3-git-send-email-mihai.carabas@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 03, 2021 at 04:43:59PM +0200, Mihai Carabas wrote: > Add pvpanic pci device driver support. > > Signed-off-by: Mihai Carabas > --- > drivers/misc/pvpanic/Kconfig | 16 ++++++++++- > drivers/misc/pvpanic/Makefile | 7 +++++ > drivers/misc/pvpanic/pvpanic-pci.c | 54 ++++++++++++++++++++++++++++++++++++++ > 3 files changed, 76 insertions(+), 1 deletion(-) > create mode 100644 drivers/misc/pvpanic/pvpanic-pci.c > > diff --git a/drivers/misc/pvpanic/Kconfig b/drivers/misc/pvpanic/Kconfig > index 12bb017..4a96e8d 100644 > --- a/drivers/misc/pvpanic/Kconfig > +++ b/drivers/misc/pvpanic/Kconfig > @@ -1,6 +1,11 @@ > +# SPDX-License-Identifier: GPL-2.0-only > +# > +# pvpanic device > +# > + > config PVPANIC > bool "pvpanic device support" > - depends on PVPANIC_MMIO > + depends on (PVPANIC_MMIO || PVPANIC_PCI) > help > This option enable generic code for pvpanic device driver logic. > > @@ -12,3 +17,12 @@ config PVPANIC_MMIO > This driver provides support for the pvpanic device. pvpanic is > a paravirtualized device provided by QEMU; it lets a virtual machine > (guest) communicate panic events to the host. > + > +config PVPANIC_PCI > + tristate "pvpanic pci device support" > + depends on PCI > + select PVPANIC > + help > + This driver provides support for the pvpanic device. pvpanic is > + a paravirtualized device provided by QEMU; it lets a virtual machine > + (guest) communicate panic events to the host. > diff --git a/drivers/misc/pvpanic/Makefile b/drivers/misc/pvpanic/Makefile > index d08379b..fe57d1f 100644 > --- a/drivers/misc/pvpanic/Makefile > +++ b/drivers/misc/pvpanic/Makefile > @@ -1,2 +1,9 @@ > +# SPDX-License-Identifier: GPL-2.0 > +# > +# Makefile for pvpanic device. > +# > + > + > obj-$(CONFIG_PVPANIC) += pvpanic.o > obj-$(CONFIG_PVPANIC_MMIO) += pvpanic-mmio.o > +obj-$(CONFIG_PVPANIC_PCI) += pvpanic-pci.o > diff --git a/drivers/misc/pvpanic/pvpanic-pci.c b/drivers/misc/pvpanic/pvpanic-pci.c > new file mode 100644 > index 00000000..1d25d11 > --- /dev/null > +++ b/drivers/misc/pvpanic/pvpanic-pci.c > @@ -0,0 +1,54 @@ > +// SPDX-License-Identifier: GPL-2.0+ > +/* > + * pvpanic pci driver. > + * > + * Copyright (C) 2021 Oracle. > + */ > + > +#include > +#include > +#include > +#include > +#include "pvpanic.h" > + > +#define PCI_VENDOR_ID_REDHAT 0x1b36 > +#define PCI_DEVICE_ID_REDHAT_PVPANIC 0x0011 > + > +static const struct pci_device_id pvpanic_pci_id_tbl[] = { > + { PCI_DEVICE(PCI_VENDOR_ID_REDHAT, PCI_DEVICE_ID_REDHAT_PVPANIC),}, > + {} > +}; > + > +static int pvpanic_pci_probe(struct pci_dev *pdev, > + const struct pci_device_id *ent) > +{ > + int ret; > + struct resource res; > + void __iomem *base; > + > + ret = pcim_enable_device(pdev); > + if (ret < 0) > + return ret; > + > + base = pci_iomap(pdev, 0, 0); > + if (IS_ERR(base)) > + return PTR_ERR(base); > + > + pvpanic_probe(base); > + > + return 0; > +} > + > +static void pvpanic_pci_remove(struct pci_dev *pdev) > +{ > + pvpanic_remove(); So no real device here? That feels really wrong, you can't have a single global instance anymore :( thanks, greg k-h