From nobody Fri May 3 18:18:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1590717823; cv=none; d=zohomail.com; s=zohoarc; b=PJQA2jhWU0JIv+I3uqYzej6z1241naps5EjEpt5vP77og4UWv0nA7s8JQZJpe9Jhqnjpizyl225ZzWD4NcfNTS7moxnXvDAyZ3ALT9xkyhTEl4S0K0FTj1jelqDL+1XyGW/cMMu6bJx70rXKL/eJD6NSCdgV4wLWUtAH2EKHU7c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590717823; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=1DrUzr8iNDuy+mdtvz3XzNbrgeH8IM8IGqzi1tapQ60=; b=Sxr9dBcIq2GNGv+EfBlez2HmMJF5WUNZA9FoJUSWiuj50y7ZzGnYsooE9arU7Mmp05GKgH2qCyg3nLrhP1hBzcNUnitu5wnjMB1AuvmqHr7qwJ2qSCj6KocqYFmNBynM2HDI3cPEDyW3MbKfi/gvHG78GgC5PQE5qHsKJ2hmmOM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1590717823973429.41804066168436; Thu, 28 May 2020 19:03:43 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jeUMh-0003Nl-JC; Fri, 29 May 2020 02:03:19 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jeUMg-0003Ng-Il for xen-devel@lists.xenproject.org; Fri, 29 May 2020 02:03:18 +0000 Received: from userp2120.oracle.com (unknown [156.151.31.85]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 8f4866e8-a150-11ea-a85a-12813bfff9fa; Fri, 29 May 2020 02:03:16 +0000 (UTC) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04T21puW121232; Fri, 29 May 2020 02:03:13 GMT Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 318xbk81pg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 29 May 2020 02:03:13 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04T239ho142956; Fri, 29 May 2020 02:03:12 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 317ddtqq21-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 May 2020 02:03:12 +0000 Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 04T22w8a024931; Fri, 29 May 2020 02:02:58 GMT Received: from ovs104.us.oracle.com (/10.149.224.204) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 28 May 2020 19:02:58 -0700 X-Inumbo-ID: 8f4866e8-a150-11ea-a85a-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2020-01-29; bh=1DrUzr8iNDuy+mdtvz3XzNbrgeH8IM8IGqzi1tapQ60=; b=rTDzgnhVuu5mGfDVdgNNcrLujUua9cGYdnjngXVho/grDBxaQotormUOKs+IUw2CLoh1 lI14dyA3qnEs2R9mimPztTUtyPypFJQJHKx7qnBZu6YK+XBYBD0HTF2rZqNwiguaiHeY paFsuKMzkCfx7WmMt5+mm1KxPmwi19M3jKCPnqkgwG4ooOTDaCbBVfU6x2bPcpNSRSC9 Mw9T+slMc0R+KQEQB8/tPirFxCtzOnQ+3AYjyhPxSTzc8gcFW8AVp6DQ4HSpNev53vo+ i8b+vqCg7q0ues3m5bP9yDfRUNmLoF29kAEMHT41cFV5lTg/Pu4kIF2kIVDGNK36RxwI mw== From: Boris Ostrovsky To: linux-pci@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH] xen/pci: Get rid of verbose_request and use dev_dbg() instead Date: Thu, 28 May 2020 22:24:52 -0400 Message-Id: <1590719092-8578-1-git-send-email-boris.ostrovsky@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9635 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 mlxscore=0 phishscore=0 adultscore=0 suspectscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005290012 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9635 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 cotscore=-2147483648 suspectscore=0 bulkscore=0 clxscore=1015 impostorscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005290012 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: bhelgaas@google.com, jgross@suse.com, Boris Ostrovsky , sstabellini@kernel.org, konrad.wilk@oracle.com Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Information printed under verbose_request is clearly used for debugging only. Remove it and use dev_dbg() instead. Signed-off-by: Boris Ostrovsky Reviewed-by: Juergen Gross --- drivers/pci/xen-pcifront.c | 27 +++++++++------------- drivers/xen/xen-pciback/conf_space.c | 14 ++++-------- drivers/xen/xen-pciback/conf_space_header.c | 20 +++++------------ drivers/xen/xen-pciback/pciback.h | 2 -- drivers/xen/xen-pciback/pciback_ops.c | 35 +++++++++----------------= ---- 5 files changed, 31 insertions(+), 67 deletions(-) diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c index d1b16cf..fab267e 100644 --- a/drivers/pci/xen-pcifront.c +++ b/drivers/pci/xen-pcifront.c @@ -77,9 +77,6 @@ static inline void pcifront_init_sd(struct pcifront_sd *s= d, static DEFINE_SPINLOCK(pcifront_dev_lock); static struct pcifront_device *pcifront_dev; =20 -static int verbose_request; -module_param(verbose_request, int, 0644); - static int errno_to_pcibios_err(int errno) { switch (errno) { @@ -190,18 +187,16 @@ static int pcifront_bus_read(struct pci_bus *bus, uns= igned int devfn, struct pcifront_sd *sd =3D bus->sysdata; struct pcifront_device *pdev =3D pcifront_get_pdev(sd); =20 - if (verbose_request) - dev_info(&pdev->xdev->dev, - "read dev=3D%04x:%02x:%02x.%d - offset %x size %d\n", - pci_domain_nr(bus), bus->number, PCI_SLOT(devfn), - PCI_FUNC(devfn), where, size); + dev_dbg(&pdev->xdev->dev, + "read dev=3D%04x:%02x:%02x.%d - offset %x size %d\n", + pci_domain_nr(bus), bus->number, PCI_SLOT(devfn), + PCI_FUNC(devfn), where, size); =20 err =3D do_pci_op(pdev, &op); =20 if (likely(!err)) { - if (verbose_request) - dev_info(&pdev->xdev->dev, "read got back value %x\n", - op.value); + dev_dbg(&pdev->xdev->dev, "read got back value %x\n", + op.value); =20 *val =3D op.value; } else if (err =3D=3D -ENODEV) { @@ -229,12 +224,10 @@ static int pcifront_bus_write(struct pci_bus *bus, un= signed int devfn, struct pcifront_sd *sd =3D bus->sysdata; struct pcifront_device *pdev =3D pcifront_get_pdev(sd); =20 - if (verbose_request) - dev_info(&pdev->xdev->dev, - "write dev=3D%04x:%02x:%02x.%d - " - "offset %x size %d val %x\n", - pci_domain_nr(bus), bus->number, - PCI_SLOT(devfn), PCI_FUNC(devfn), where, size, val); + dev_dbg(&pdev->xdev->dev, + "write dev=3D%04x:%02x:%02x.%d - offset %x size %d val %x\n", + pci_domain_nr(bus), bus->number, + PCI_SLOT(devfn), PCI_FUNC(devfn), where, size, val); =20 return errno_to_pcibios_err(do_pci_op(pdev, &op)); } diff --git a/drivers/xen/xen-pciback/conf_space.c b/drivers/xen/xen-pciback= /conf_space.c index f2df4e5..059de92 100644 --- a/drivers/xen/xen-pciback/conf_space.c +++ b/drivers/xen/xen-pciback/conf_space.c @@ -156,9 +156,7 @@ int xen_pcibk_config_read(struct pci_dev *dev, int offs= et, int size, * (as if device didn't respond) */ u32 value =3D 0, tmp_val; =20 - if (unlikely(verbose_request)) - dev_printk(KERN_DEBUG, &dev->dev, "read %d bytes at 0x%x\n", - size, offset); + dev_dbg(&dev->dev, "read %d bytes at 0x%x\n", size, offset); =20 if (!valid_request(offset, size)) { err =3D XEN_PCI_ERR_invalid_offset; @@ -197,9 +195,7 @@ int xen_pcibk_config_read(struct pci_dev *dev, int offs= et, int size, } =20 out: - if (unlikely(verbose_request)) - dev_printk(KERN_DEBUG, &dev->dev, - "read %d bytes at 0x%x =3D %x\n", size, offset, value); + dev_dbg(&dev->dev, "read %d bytes at 0x%x =3D %x\n", size, offset, value); =20 *ret_val =3D value; return xen_pcibios_err_to_errno(err); @@ -214,10 +210,8 @@ int xen_pcibk_config_write(struct pci_dev *dev, int of= fset, int size, u32 value) u32 tmp_val; int field_start, field_end; =20 - if (unlikely(verbose_request)) - dev_printk(KERN_DEBUG, &dev->dev, - "write request %d bytes at 0x%x =3D %x\n", size, - offset, value); + dev_dbg(&dev->dev, "write request %d bytes at 0x%x =3D %x\n", + size, offset, value); =20 if (!valid_request(offset, size)) return XEN_PCI_ERR_invalid_offset; diff --git a/drivers/xen/xen-pciback/conf_space_header.c b/drivers/xen/xen-= pciback/conf_space_header.c index b277b68..ac45cdc 100644 --- a/drivers/xen/xen-pciback/conf_space_header.c +++ b/drivers/xen/xen-pciback/conf_space_header.c @@ -68,36 +68,30 @@ static int command_write(struct pci_dev *dev, int offse= t, u16 value, void *data) =20 dev_data =3D pci_get_drvdata(dev); if (!pci_is_enabled(dev) && is_enable_cmd(value)) { - if (unlikely(verbose_request)) - dev_printk(KERN_DEBUG, &dev->dev, "enable\n"); + dev_dbg(&dev->dev, "enable\n"); err =3D pci_enable_device(dev); if (err) return err; if (dev_data) dev_data->enable_intx =3D 1; } else if (pci_is_enabled(dev) && !is_enable_cmd(value)) { - if (unlikely(verbose_request)) - dev_printk(KERN_DEBUG, &dev->dev, "disable\n"); + dev_dbg(&dev->dev, "disable\n"); pci_disable_device(dev); if (dev_data) dev_data->enable_intx =3D 0; } =20 if (!dev->is_busmaster && is_master_cmd(value)) { - if (unlikely(verbose_request)) - dev_printk(KERN_DEBUG, &dev->dev, "set bus master\n"); + dev_dbg(&dev->dev, "set bus master\n"); pci_set_master(dev); } else if (dev->is_busmaster && !is_master_cmd(value)) { - if (unlikely(verbose_request)) - dev_printk(KERN_DEBUG, &dev->dev, "clear bus master\n"); + dev_dbg(&dev->dev, "clear bus master\n"); pci_clear_master(dev); } =20 if (!(cmd->val & PCI_COMMAND_INVALIDATE) && (value & PCI_COMMAND_INVALIDATE)) { - if (unlikely(verbose_request)) - dev_printk(KERN_DEBUG, &dev->dev, - "enable memory-write-invalidate\n"); + dev_dbg(&dev->dev, "enable memory-write-invalidate\n"); err =3D pci_set_mwi(dev); if (err) { dev_warn(&dev->dev, "cannot enable memory-write-invalidate (%d)\n", @@ -106,9 +100,7 @@ static int command_write(struct pci_dev *dev, int offse= t, u16 value, void *data) } } else if ((cmd->val & PCI_COMMAND_INVALIDATE) && !(value & PCI_COMMAND_INVALIDATE)) { - if (unlikely(verbose_request)) - dev_printk(KERN_DEBUG, &dev->dev, - "disable memory-write-invalidate\n"); + dev_dbg(&dev->dev, "disable memory-write-invalidate\n"); pci_clear_mwi(dev); } =20 diff --git a/drivers/xen/xen-pciback/pciback.h b/drivers/xen/xen-pciback/pc= iback.h index 7c95516..f1ed2db 100644 --- a/drivers/xen/xen-pciback/pciback.h +++ b/drivers/xen/xen-pciback/pciback.h @@ -186,8 +186,6 @@ static inline void xen_pcibk_release_devices(struct xen= _pcibk_device *pdev) int xen_pcibk_xenbus_register(void); void xen_pcibk_xenbus_unregister(void); =20 -extern int verbose_request; - void xen_pcibk_test_and_schedule_op(struct xen_pcibk_device *pdev); #endif =20 diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pcibac= k/pciback_ops.c index 8545ca7..e11a743 100644 --- a/drivers/xen/xen-pciback/pciback_ops.c +++ b/drivers/xen/xen-pciback/pciback_ops.c @@ -15,9 +15,6 @@ #include #include "pciback.h" =20 -int verbose_request; -module_param(verbose_request, int, 0644); - static irqreturn_t xen_pcibk_guest_interrupt(int irq, void *dev_id); =20 /* Ensure a device is has the fake IRQ handler "turned on/off" and is @@ -148,9 +145,6 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev, struct xen_pcibk_dev_data *dev_data; int status; =20 - if (unlikely(verbose_request)) - dev_printk(KERN_DEBUG, &dev->dev, "enable MSI\n"); - if (dev->msi_enabled) status =3D -EALREADY; else if (dev->msix_enabled) @@ -169,8 +163,8 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev, * the local domain's IRQ number. */ =20 op->value =3D dev->irq ? xen_pirq_from_irq(dev->irq) : 0; - if (unlikely(verbose_request)) - dev_printk(KERN_DEBUG, &dev->dev, "MSI: %d\n", op->value); + + dev_dbg(&dev->dev, "MSI: %d\n", op->value); =20 dev_data =3D pci_get_drvdata(dev); if (dev_data) @@ -183,9 +177,6 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev, int xen_pcibk_disable_msi(struct xen_pcibk_device *pdev, struct pci_dev *dev, struct xen_pci_op *op) { - if (unlikely(verbose_request)) - dev_printk(KERN_DEBUG, &dev->dev, "disable MSI\n"); - if (dev->msi_enabled) { struct xen_pcibk_dev_data *dev_data; =20 @@ -196,8 +187,9 @@ int xen_pcibk_disable_msi(struct xen_pcibk_device *pdev, dev_data->ack_intr =3D 1; } op->value =3D dev->irq ? xen_pirq_from_irq(dev->irq) : 0; - if (unlikely(verbose_request)) - dev_printk(KERN_DEBUG, &dev->dev, "MSI: %d\n", op->value); + + dev_dbg(&dev->dev, "MSI: %d\n", op->value); + return 0; } =20 @@ -210,8 +202,7 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev, struct msix_entry *entries; u16 cmd; =20 - if (unlikely(verbose_request)) - dev_printk(KERN_DEBUG, &dev->dev, "enable MSI-X\n"); + dev_dbg(&dev->dev, "enable MSI-X\n"); =20 if (op->value > SH_INFO_MAX_VEC) return -EINVAL; @@ -244,10 +235,8 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pde= v, if (entries[i].vector) { op->msix_entries[i].vector =3D xen_pirq_from_irq(entries[i].vector); - if (unlikely(verbose_request)) - dev_printk(KERN_DEBUG, &dev->dev, - "MSI-X[%d]: %d\n", i, - op->msix_entries[i].vector); + dev_dbg(&dev->dev, "MSI-X[%d]: %d\n", i, + op->msix_entries[i].vector); } } } else @@ -267,9 +256,6 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev, int xen_pcibk_disable_msix(struct xen_pcibk_device *pdev, struct pci_dev *dev, struct xen_pci_op *op) { - if (unlikely(verbose_request)) - dev_printk(KERN_DEBUG, &dev->dev, "disable MSI-X\n"); - if (dev->msix_enabled) { struct xen_pcibk_dev_data *dev_data; =20 @@ -284,8 +270,9 @@ int xen_pcibk_disable_msix(struct xen_pcibk_device *pde= v, * an undefined IRQ value of zero. */ op->value =3D dev->irq ? xen_pirq_from_irq(dev->irq) : 0; - if (unlikely(verbose_request)) - dev_printk(KERN_DEBUG, &dev->dev, "MSI-X: %d\n", op->value); + + dev_dbg(&dev->dev, "MSI-X: %d\n", op->value); + return 0; } #endif --=20 1.8.3.1