Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a20f5cf authored by Hariprasad Shenai's avatar Hariprasad Shenai Committed by David S. Miller
Browse files

cxgb4: Don't sleep when mbox cmd is issued from interrupt context



When link goes down, from the interrupt handler DCB priority for the
Tx queues needs to be unset. We issue mbox command to unset the Tx queue
priority with negative timeout. In t4_wr_mbox_meat_timeout() do not sleep
when negative timeout is passed, since it is called from interrupt context.

Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ecc9120e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -304,6 +304,12 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox, const void *cmd,
	if (adap->pdev->error_state != pci_channel_io_normal)
		return -EIO;

	/* If we have a negative timeout, that implies that we can't sleep. */
	if (timeout < 0) {
		sleep_ok = false;
		timeout = -timeout;
	}

	v = MBOWNER_G(t4_read_reg(adap, ctl_reg));
	for (i = 0; v == MBOX_OWNER_NONE && i < 3; i++)
		v = MBOWNER_G(t4_read_reg(adap, ctl_reg));