Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pds_core: check health in devcmd wait

Similar to what we do in the AdminQ, check for devcmd health
while waiting for an answer.

Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Shannon Nelson and committed by
David S. Miller
f7b5bd72 8d6198a1

+10 -2
+9 -2
drivers/net/ethernet/amd/pds_core/dev.c
··· 42 42 return -ERANGE; 43 43 case PDS_RC_BAD_ADDR: 44 44 return -EFAULT; 45 + case PDS_RC_BAD_PCI: 46 + return -ENXIO; 45 47 case PDS_RC_EOPCODE: 46 48 case PDS_RC_EINTR: 47 49 case PDS_RC_DEV_CMD: ··· 64 62 /* Firmware is useful only if the running bit is set and 65 63 * fw_status != 0xff (bad PCI read) 66 64 */ 67 - return (pdsc->fw_status != 0xff) && 65 + return (pdsc->fw_status != PDS_RC_BAD_PCI) && 68 66 (pdsc->fw_status & PDS_CORE_FW_STS_F_RUNNING); 69 67 } 70 68 ··· 130 128 unsigned long max_wait; 131 129 unsigned long duration; 132 130 int timeout = 0; 131 + bool running; 133 132 int done = 0; 134 133 int err = 0; 135 134 int status; ··· 139 136 max_wait = start_time + (max_seconds * HZ); 140 137 141 138 while (!done && !timeout) { 139 + running = pdsc_is_fw_running(pdsc); 140 + if (!running) 141 + break; 142 + 142 143 done = pdsc_devcmd_done(pdsc); 143 144 if (done) 144 145 break; ··· 159 152 dev_dbg(dev, "DEVCMD %d %s after %ld secs\n", 160 153 opcode, pdsc_devcmd_str(opcode), duration / HZ); 161 154 162 - if (!done || timeout) { 155 + if ((!done || timeout) && running) { 163 156 dev_err(dev, "DEVCMD %d %s timeout, done %d timeout %d max_seconds=%d\n", 164 157 opcode, pdsc_devcmd_str(opcode), done, timeout, 165 158 max_seconds);
+1
include/linux/pds/pds_core_if.h
··· 79 79 PDS_RC_EVFID = 31, /* VF ID does not exist */ 80 80 PDS_RC_BAD_FW = 32, /* FW file is invalid or corrupted */ 81 81 PDS_RC_ECLIENT = 33, /* No such client id */ 82 + PDS_RC_BAD_PCI = 255, /* Broken PCI when reading status */ 82 83 }; 83 84 84 85 /**