Skip to content

Commit

Permalink
Merge pull request torvalds#205 in PROCESSOR-SDK/processor-sdk-linux …
Browse files Browse the repository at this point in the history
…from PLSDK-3095 to processor-sdk-linux-4.19.y

* commit '6990349d22caa8302a390d90ec9cf2b954061132':
  net: prueth: fix disabling storm prevention
  • Loading branch information
Aaron Kramer committed Dec 11, 2019
2 parents e42a684 + 6990349 commit 525b663
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
11 changes: 11 additions & 0 deletions drivers/net/ethernet/ti/prueth.c
Original file line number Diff line number Diff line change
Expand Up @@ -5909,6 +5909,17 @@ static int prueth_netdev_init(struct prueth *prueth,
emac->ndev = ndev;
emac->port_id = port;

switch (port) {
case PRUETH_PORT_MII0:
emac->dram = PRUETH_MEM_DRAM0;
break;
case PRUETH_PORT_MII1:
emac->dram = PRUETH_MEM_DRAM1;
break;
default:
return -EINVAL;
}

if (PRUETH_HAS_PTP(prueth) && !PRUETH_IS_EMAC(prueth))
tx_int = "hsrprp_ptp_tx";
else
Expand Down
7 changes: 5 additions & 2 deletions drivers/net/ethernet/ti/prueth_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@ static ssize_t nsp_credit_store(struct device *dev,
const char *buffer, size_t count)
{
struct prueth_emac *emac = nsp_credit_to_emac(attr);
void __iomem *dram = emac->prueth->mem[emac->dram].va;
u32 val;

if (kstrtou32(buffer, 0, &val))
return -EINVAL;

if (val)
if (val) {
emac->nsp_credit =
(val << PRUETH_NSP_CREDIT_SHIFT) | PRUETH_NSP_ENABLE;
else
} else {
emac->nsp_credit = PRUETH_NSP_DISABLE;
writel(emac->nsp_credit, dram + STORM_PREVENTION_OFFSET);
}

return count;
}
Expand Down

0 comments on commit 525b663

Please sign in to comment.