diff options
author | Prasad Kanneganti <prasad.kanneganti@cavium.com> | 2017-05-25 20:42:14 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-05-26 21:41:47 +0300 |
commit | d5c7d9b934dc07261e97088681e3753b3f5eba80 (patch) | |
tree | 8be54472c0a9d824312b9a8842f61ad48986b4ea /drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c | |
parent | ae782dec2c60457ec66a5c2589f4bd135ffa5893 (diff) | |
download | linux-d5c7d9b934dc07261e97088681e3753b3f5eba80.tar.xz |
liquidio: fix rare pci_driver.probe failure of VF driver
There's a rare pci_driver.probe failure of the VF driver that's caused by
PF/VF handshake going out of sync. The culprit is octeon_mbox_write() who
ignores an ack timeout condition; it just keeps unconditionally writing all
elements of mbox_cmd->data[] even when the other side is not ready for
them. Fix it by making each write of mbox_cmd->data[i] conditional to
having previously received an ack.
Also fix the octeon_mbox_state enum such that each state gets a unique
value. Also add ULL suffix to numeric literals in macro definitions.
Signed-off-by: Prasad Kanneganti <prasad.kanneganti@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c')
-rw-r--r-- | drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c b/drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c index 5cca73b8880b..57af7df74ced 100644 --- a/drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c +++ b/drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c @@ -178,7 +178,10 @@ int octeon_mbox_write(struct octeon_device *oct, break; } } - writeq(mbox_cmd->data[i], mbox->mbox_write_reg); + if (ret == OCTEON_MBOX_STATUS_SUCCESS) + writeq(mbox_cmd->data[i], mbox->mbox_write_reg); + else + break; } } |