[ofw][mlx4][patch] improve Event Logging in case of HCA command errors

Leonid Keller leonid at mellanox.co.il
Thu Oct 30 08:21:48 PDT 2008


We run from time to time into situations, where the bus driver fails on
the start up because of some FW problem.
Bus driver usually  writes to Event Log the name of the failed command
without the error code.
 
I've committed a fix (1714, 1715), that improves this logging.
 
Index: V:/svn/winib/trunk/hw/mlx4/kernel/bus/net/cmd.c
===================================================================
--- V:/svn/winib/trunk/hw/mlx4/kernel/bus/net/cmd.c (revision 3404)
+++ V:/svn/winib/trunk/hw/mlx4/kernel/bus/net/cmd.c (revision 3405)
@@ -208,6 +208,7 @@
  u8 __iomem *hcr = priv->cmd.hcr;
  int err = 0;
  u64 end;
+ u8 status;
 
  down(&priv->cmd.poll_sem);
 
@@ -232,8 +233,11 @@
    (u64) be32_to_cpu((__force __be32)
        __raw_readl(hcr + HCR_OUT_PARAM_OFFSET + 4));
 
- err = mlx4_status_to_errno((u8)(be32_to_cpu((__force __be32)
-            __raw_readl(hcr + HCR_STATUS_OFFSET)) >> 24));
+ status = (u8)(be32_to_cpu((__force __be32)__raw_readl(hcr +
HCR_STATUS_OFFSET)) >> 24);
+ err = mlx4_status_to_errno(status);
+ if (status)
+  mlx4_err(dev, "Command failed: op %#hx, status %d, errno %d.\n", 
+   op, status, err);
 
 out:
  up(&priv->cmd.poll_sem);
@@ -251,6 +255,10 @@
   return;
 
  context->result    = mlx4_status_to_errno(status);
+ 
+ if (status)
+  mlx4_err(dev, "Command failed: token %#hx, status %d, errno %d.\n", 
+   token, status, context->result);
  context->out_param = out_param;
 
  complete(&context->done);
@@ -280,7 +288,7 @@
 
  if (wait_for_completion_timeout(&context->done,
msecs_to_jiffies(timeout))) {
   if (!context->done.done) {
-   static int spam_limit = 10;
+   static int spam_limit = 5;
    err = -EBUSY;
    if (spam_limit-- > 0)
     mlx4_err(dev, "mlx4_cmd_wait: Command %02x completed with timeout
after %d secs \n",

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20081030/83f797e7/attachment.html>


More information about the ofw mailing list