Commit b3695540 authored by Hariprasad Shenai's avatar Hariprasad Shenai Committed by David S. Miller

cxgb4: For T4, don't read the Firmware Mailbox Control register

T4 doesn't have the Shadow copy of the register which we can read without
side effect. So don't read mbox control register for T4 adapter
Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8119c018
...@@ -1128,18 +1128,26 @@ static const struct file_operations devlog_fops = { ...@@ -1128,18 +1128,26 @@ static const struct file_operations devlog_fops = {
static int mbox_show(struct seq_file *seq, void *v) static int mbox_show(struct seq_file *seq, void *v)
{ {
static const char * const owner[] = { "none", "FW", "driver", static const char * const owner[] = { "none", "FW", "driver",
"unknown" }; "unknown", "<unread>" };
int i; int i;
unsigned int mbox = (uintptr_t)seq->private & 7; unsigned int mbox = (uintptr_t)seq->private & 7;
struct adapter *adap = seq->private - mbox; struct adapter *adap = seq->private - mbox;
void __iomem *addr = adap->regs + PF_REG(mbox, CIM_PF_MAILBOX_DATA_A); void __iomem *addr = adap->regs + PF_REG(mbox, CIM_PF_MAILBOX_DATA_A);
unsigned int ctrl_reg = (is_t4(adap->params.chip)
? CIM_PF_MAILBOX_CTRL_A
: CIM_PF_MAILBOX_CTRL_SHADOW_COPY_A);
void __iomem *ctrl = adap->regs + PF_REG(mbox, ctrl_reg);
i = MBOWNER_G(readl(ctrl)); /* For T4 we don't have a shadow copy of the Mailbox Control register.
* And since reading that real register causes a side effect of
* granting ownership, we're best of simply not reading it at all.
*/
if (is_t4(adap->params.chip)) {
i = 4; /* index of "<unread>" */
} else {
unsigned int ctrl_reg = CIM_PF_MAILBOX_CTRL_SHADOW_COPY_A;
void __iomem *ctrl = adap->regs + PF_REG(mbox, ctrl_reg);
i = MBOWNER_G(readl(ctrl));
}
seq_printf(seq, "mailbox owned by %s\n\n", owner[i]); seq_printf(seq, "mailbox owned by %s\n\n", owner[i]);
for (i = 0; i < MBOX_LEN; i += 8) for (i = 0; i < MBOX_LEN; i += 8)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment