Skip to content

Commit 2905f5b

Browse files
committed
Merge branch 'cxgb4-next'
Hariprasad Shenai says: ==================== cxgb4: Trivial fixes for cxgb4 Fixes the following issues Don't read non existent T4/T5/T6 adapter registers for ethtool dump. For T4, dont read mailbox control registers. Adds new devlog faility and report correct link speed for unsupported ones. This patch series has been created against net-next tree and includes patches on cxgb4 driver. We have included all the maintainers of respective drivers. Kindly review the change and let us know in case of any review comments. ==================== Acked-by: Nicolas Dichtel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2 parents 40e1068 + 8541225 commit 2905f5b

File tree

3 files changed

+1154
-337
lines changed

3 files changed

+1154
-337
lines changed

drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,7 @@ static const char * const devlog_level_strings[] = {
940940

941941
static const char * const devlog_facility_strings[] = {
942942
[FW_DEVLOG_FACILITY_CORE] = "CORE",
943+
[FW_DEVLOG_FACILITY_CF] = "CF",
943944
[FW_DEVLOG_FACILITY_SCHED] = "SCHED",
944945
[FW_DEVLOG_FACILITY_TIMER] = "TIMER",
945946
[FW_DEVLOG_FACILITY_RES] = "RES",
@@ -1128,18 +1129,26 @@ static const struct file_operations devlog_fops = {
11281129
static int mbox_show(struct seq_file *seq, void *v)
11291130
{
11301131
static const char * const owner[] = { "none", "FW", "driver",
1131-
"unknown" };
1132+
"unknown", "<unread>" };
11321133

11331134
int i;
11341135
unsigned int mbox = (uintptr_t)seq->private & 7;
11351136
struct adapter *adap = seq->private - mbox;
11361137
void __iomem *addr = adap->regs + PF_REG(mbox, CIM_PF_MAILBOX_DATA_A);
1137-
unsigned int ctrl_reg = (is_t4(adap->params.chip)
1138-
? CIM_PF_MAILBOX_CTRL_A
1139-
: CIM_PF_MAILBOX_CTRL_SHADOW_COPY_A);
1140-
void __iomem *ctrl = adap->regs + PF_REG(mbox, ctrl_reg);
11411138

1142-
i = MBOWNER_G(readl(ctrl));
1139+
/* For T4 we don't have a shadow copy of the Mailbox Control register.
1140+
* And since reading that real register causes a side effect of
1141+
* granting ownership, we're best of simply not reading it at all.
1142+
*/
1143+
if (is_t4(adap->params.chip)) {
1144+
i = 4; /* index of "<unread>" */
1145+
} else {
1146+
unsigned int ctrl_reg = CIM_PF_MAILBOX_CTRL_SHADOW_COPY_A;
1147+
void __iomem *ctrl = adap->regs + PF_REG(mbox, ctrl_reg);
1148+
1149+
i = MBOWNER_G(readl(ctrl));
1150+
}
1151+
11431152
seq_printf(seq, "mailbox owned by %s\n\n", owner[i]);
11441153

11451154
for (i = 0; i < MBOX_LEN; i += 8)

drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ static void link_report(struct net_device *dev)
275275
else {
276276
static const char *fc[] = { "no", "Rx", "Tx", "Tx/Rx" };
277277

278-
const char *s = "10Mbps";
278+
const char *s;
279279
const struct port_info *p = netdev_priv(dev);
280280

281281
switch (p->link_cfg.speed) {
@@ -291,6 +291,10 @@ static void link_report(struct net_device *dev)
291291
case 40000:
292292
s = "40Gbps";
293293
break;
294+
default:
295+
pr_info("%s: unsupported speed: %d\n",
296+
dev->name, p->link_cfg.speed);
297+
return;
294298
}
295299

296300
netdev_info(dev, "link up, %s, full-duplex, %s PAUSE\n", s,

0 commit comments

Comments
 (0)