liquidio: fix rare pci_driver.probe failure of VF driver
authorPrasad Kanneganti <prasad.kanneganti@cavium.com>
Thu, 25 May 2017 17:42:14 +0000 (10:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 May 2017 18:41:47 +0000 (14:41 -0400)
commitd5c7d9b934dc07261e97088681e3753b3f5eba80
tree8be54472c0a9d824312b9a8842f61ad48986b4ea
parentae782dec2c60457ec66a5c2589f4bd135ffa5893
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>
drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c
drivers/net/ethernet/cavium/liquidio/octeon_mailbox.h