Skip to content

Commit

Permalink
Merge branch 'cxgb4-next'
Browse files Browse the repository at this point in the history
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 <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Oct 5, 2015
2 parents 40e1068 + 8541225 commit 2905f5b
Show file tree
Hide file tree
Showing 3 changed files with 1,154 additions and 337 deletions.
21 changes: 15 additions & 6 deletions drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,7 @@ static const char * const devlog_level_strings[] = {

static const char * const devlog_facility_strings[] = {
[FW_DEVLOG_FACILITY_CORE] = "CORE",
[FW_DEVLOG_FACILITY_CF] = "CF",
[FW_DEVLOG_FACILITY_SCHED] = "SCHED",
[FW_DEVLOG_FACILITY_TIMER] = "TIMER",
[FW_DEVLOG_FACILITY_RES] = "RES",
Expand Down Expand Up @@ -1128,18 +1129,26 @@ static const struct file_operations devlog_fops = {
static int mbox_show(struct seq_file *seq, void *v)
{
static const char * const owner[] = { "none", "FW", "driver",
"unknown" };
"unknown", "<unread>" };

int i;
unsigned int mbox = (uintptr_t)seq->private & 7;
struct adapter *adap = seq->private - mbox;
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]);

for (i = 0; i < MBOX_LEN; i += 8)
Expand Down
6 changes: 5 additions & 1 deletion drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ static void link_report(struct net_device *dev)
else {
static const char *fc[] = { "no", "Rx", "Tx", "Tx/Rx" };

const char *s = "10Mbps";
const char *s;
const struct port_info *p = netdev_priv(dev);

switch (p->link_cfg.speed) {
Expand All @@ -291,6 +291,10 @@ static void link_report(struct net_device *dev)
case 40000:
s = "40Gbps";
break;
default:
pr_info("%s: unsupported speed: %d\n",
dev->name, p->link_cfg.speed);
return;
}

netdev_info(dev, "link up, %s, full-duplex, %s PAUSE\n", s,
Expand Down
Loading

0 comments on commit 2905f5b

Please sign in to comment.