Commit 2905f5bb authored by David S. Miller's avatar David S. Miller

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: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 40e10680 85412255
...@@ -940,6 +940,7 @@ static const char * const devlog_level_strings[] = { ...@@ -940,6 +940,7 @@ static const char * const devlog_level_strings[] = {
static const char * const devlog_facility_strings[] = { static const char * const devlog_facility_strings[] = {
[FW_DEVLOG_FACILITY_CORE] = "CORE", [FW_DEVLOG_FACILITY_CORE] = "CORE",
[FW_DEVLOG_FACILITY_CF] = "CF",
[FW_DEVLOG_FACILITY_SCHED] = "SCHED", [FW_DEVLOG_FACILITY_SCHED] = "SCHED",
[FW_DEVLOG_FACILITY_TIMER] = "TIMER", [FW_DEVLOG_FACILITY_TIMER] = "TIMER",
[FW_DEVLOG_FACILITY_RES] = "RES", [FW_DEVLOG_FACILITY_RES] = "RES",
...@@ -1128,18 +1129,26 @@ static const struct file_operations devlog_fops = { ...@@ -1128,18 +1129,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)
......
...@@ -275,7 +275,7 @@ static void link_report(struct net_device *dev) ...@@ -275,7 +275,7 @@ static void link_report(struct net_device *dev)
else { else {
static const char *fc[] = { "no", "Rx", "Tx", "Tx/Rx" }; static const char *fc[] = { "no", "Rx", "Tx", "Tx/Rx" };
const char *s = "10Mbps"; const char *s;
const struct port_info *p = netdev_priv(dev); const struct port_info *p = netdev_priv(dev);
switch (p->link_cfg.speed) { switch (p->link_cfg.speed) {
...@@ -291,6 +291,10 @@ static void link_report(struct net_device *dev) ...@@ -291,6 +291,10 @@ static void link_report(struct net_device *dev)
case 40000: case 40000:
s = "40Gbps"; s = "40Gbps";
break; 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, netdev_info(dev, "link up, %s, full-duplex, %s PAUSE\n", s,
......
This diff is collapsed.
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