[MTHCA] bugfix in CMD interface: wait for GO bit before issuing command in polling...
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 27 Nov 2008 13:38:02 +0000 (13:38 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 27 Nov 2008 13:38:02 +0000 (13:38 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1775 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

hw/mthca/kernel/mthca_cmd.c

index 0c2ba3c..e3483f7 100644 (file)
@@ -259,10 +259,16 @@ static int mthca_cmd_post(struct mthca_dev *dev,
 
        down(&dev->cmd.hcr_mutex);
 
-       if (event && wait_go_bit(dev,GO_BIT_TIMEOUT)) {
-               err = -EAGAIN;
-               goto out;
-       }
+       if (event)
+               if (wait_go_bit(dev,GO_BIT_TIMEOUT)) {
+                       err = -EAGAIN;
+                       goto out;
+               }
+       else
+               if (go_bit(dev)) {
+                       err = -EAGAIN;
+                       goto out;
+               }
 
        /*
         * We use writel (instead of something like memcpy_toio)