All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <jbeulich@novell.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] x86/PCI-MSI: fix messages
Date: Wed, 24 Sep 2008 10:01:10 +0100	[thread overview]
Message-ID: <48DA1DF6.76E4.0078.0@novell.com> (raw)

XENLOG_G_* should not be used in invocations of gdprintk().

Also change the wording in a few places and consistently print the
target domain. It remains questionable whether the code should be this
verbose in the first place, especially now that MSI is on by default.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

Index: 2008-09-19/xen/arch/x86/physdev.c
===================================================================
--- 2008-09-19.orig/xen/arch/x86/physdev.c	2008-09-24 09:19:57.000000000 +0200
+++ 2008-09-19/xen/arch/x86/physdev.c	2008-09-24 09:22:04.000000000 +0200
@@ -73,8 +73,8 @@ static int map_domain_pirq(struct domain
 
     if ( pirq < 0 || pirq >= NR_PIRQS || vector < 0 || vector >= NR_VECTORS )
     {
-        gdprintk(XENLOG_G_ERR,
-                 "invalid pirq %x or vector %x\n", pirq, vector);
+        dprintk(XENLOG_G_ERR, "dom%d: invalid pirq %d or vector %d\n",
+                d->domain_id, pirq, vector);
         return -EINVAL;
     }
 
@@ -84,8 +84,8 @@ static int map_domain_pirq(struct domain
     if ( (old_vector && (old_vector != vector) ) ||
          (old_pirq && (old_pirq != pirq)) )
     {
-        gdprintk(XENLOG_G_ERR, "remap pirq %x vector %x while not unmap\n",
-                 pirq, vector);
+        dprintk(XENLOG_G_ERR, "dom%d: pirq %d or vector %d already mapped\n",
+                d->domain_id, pirq, vector);
         ret = -EINVAL;
         goto done;
     }
@@ -93,8 +93,8 @@ static int map_domain_pirq(struct domain
     ret = irq_permit_access(d, pirq);
     if ( ret )
     {
-        gdprintk(XENLOG_G_ERR, "add irq permit access %x failed\n", pirq);
-        ret = -EINVAL;
+        dprintk(XENLOG_G_ERR, "dom%d: could not permit access to irq %d\n",
+                d->domain_id, pirq);
         goto done;
     }
 
@@ -107,8 +107,8 @@ static int map_domain_pirq(struct domain
 
         spin_lock_irqsave(&desc->lock, flags);
         if ( desc->handler != &no_irq_type )
-            gdprintk(XENLOG_G_ERR, "Map vector %x to msi while it is in use\n",
-                     vector);
+            dprintk(XENLOG_G_ERR, "dom%d: vector %d in use\n",
+                    d->domain_id, vector);
         desc->handler = &pci_msi_type;
 
         msi.bus = map->bus;
@@ -150,8 +150,8 @@ static int unmap_domain_pirq(struct doma
 
     if ( vector <= 0 )
     {
-        gdprintk(XENLOG_G_ERR, "domain %X: pirq %x not mapped still\n",
-                 d->domain_id, pirq);
+        dprintk(XENLOG_G_ERR, "dom%d: pirq %d not mapped\n",
+                d->domain_id, pirq);
         ret = -EINVAL;
         goto done;
     }
@@ -185,7 +185,8 @@ static int unmap_domain_pirq(struct doma
 
     ret = irq_deny_access(d, pirq);
     if ( ret )
-        gdprintk(XENLOG_G_ERR, "deny irq %x access failed\n", pirq);
+        dprintk(XENLOG_G_ERR, "dom%d: could not deny access to irq %d\n",
+                d->domain_id, pirq);
 
  done:
     return ret;
@@ -217,19 +218,19 @@ static int physdev_map_pirq(struct physd
     switch ( map->type )
     {
         case MAP_PIRQ_TYPE_GSI:
-            if ( map->index >= NR_IRQS )
+            if ( map->index < 0 || map->index >= NR_IRQS )
             {
+                dprintk(XENLOG_G_ERR, "dom%d: map invalid irq %d\n",
+                        d->domain_id, map->index);
                 ret = -EINVAL;
-                gdprintk(XENLOG_G_ERR,
-                         "map invalid irq %x\n", map->index);
                 goto free_domain;
             }
             vector = IO_APIC_VECTOR(map->index);
             if ( !vector )
             {
+                dprintk(XENLOG_G_ERR, "dom%d: map irq with no vector %d\n",
+                        d->domain_id, map->index);
                 ret = -EINVAL;
-                gdprintk(XENLOG_G_ERR,
-                         "map irq with no vector %x\n", map->index);
                 goto free_domain;
             }
             break;
@@ -240,17 +241,16 @@ static int physdev_map_pirq(struct physd
 
             if ( vector < 0 || vector >= NR_VECTORS )
             {
+                dprintk(XENLOG_G_ERR, "dom%d: map irq with wrong vector %d\n",
+                        d->domain_id, map->index);
                 ret = -EINVAL;
-                gdprintk(XENLOG_G_ERR,
-                         "map_pirq with wrong vector %x\n", map->index);
                 goto free_domain;
             }
             break;
         default:
+            dprintk(XENLOG_G_ERR, "dom%d: wrong map_pirq type %x\n", d->domain_id, map->type);
             ret = -EINVAL;
-            gdprintk(XENLOG_G_ERR, "wrong map_pirq type %x\n", map->type);
             goto free_domain;
-            break;
     }
 
     spin_lock_irqsave(&d->arch.irq_lock, flags);
@@ -258,9 +258,9 @@ static int physdev_map_pirq(struct physd
     {
         if ( d->arch.vector_pirq[vector] )
         {
-            gdprintk(XENLOG_G_ERR, "%x %x mapped already%x\n",
-                                    map->index, map->pirq,
-                                    d->arch.vector_pirq[vector]);
+            dprintk(XENLOG_G_ERR, "dom%d: %d:%d already mapped to %d\n",
+                    d->domain_id, map->index, map->pirq,
+                    d->arch.vector_pirq[vector]);
             pirq = d->arch.vector_pirq[vector];
             if ( pirq < 0 )
             {
@@ -273,8 +273,8 @@ static int physdev_map_pirq(struct physd
             pirq = get_free_pirq(d, map->type, map->index);
             if ( pirq < 0 )
             {
+                dprintk(XENLOG_G_ERR, "dom%d: no free pirq\n", d->domain_id);
                 ret = pirq;
-                gdprintk(XENLOG_G_ERR, "No free pirq\n");
                 goto done;
             }
         }
@@ -284,8 +284,8 @@ static int physdev_map_pirq(struct physd
         if ( d->arch.vector_pirq[vector] &&
              d->arch.vector_pirq[vector] != map->pirq )
         {
-            gdprintk(XENLOG_G_ERR, "%x conflict with %x\n",
-              map->index, map->pirq);
+            dprintk(XENLOG_G_ERR, "dom%d: vector %d conflicts with irq %d\n",
+                    d->domain_id, map->index, map->pirq);
             ret = -EEXIST;
             goto done;
         }

                 reply	other threads:[~2008-09-24  9:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48DA1DF6.76E4.0078.0@novell.com \
    --to=jbeulich@novell.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.