Update to 3.11-rc2
Drop patches applied upstream; refresh the rest. Disable aufs until it's updated. svn path=/dists/trunk/linux/; revision=20404
This commit is contained in:
parent
9f71a67f85
commit
1669b35019
|
@ -1,3 +1,9 @@
|
|||
linux (3.11~rc2-1~exp1) UNRELEASED; urgency=low
|
||||
|
||||
* New upstream release candidate
|
||||
|
||||
-- Ben Hutchings <ben@decadent.org.uk> Mon, 22 Jul 2013 04:18:31 +0100
|
||||
|
||||
linux (3.10.1-1) unstable; urgency=low
|
||||
|
||||
* New upstream release: http://kernelnewbies.org/Linux_3.10
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
From: Johannes Berg <johannes@sipsolutions.net>
|
||||
Date: Sat, 29 Jun 2013 19:23:14 +0200
|
||||
Subject: [2/6] alx: fix 100mbit/half duplex speed translation
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git//commit?id=17fdd35268f3856702dae5c3c0d8f756ec2c6d2d
|
||||
|
||||
100mbit half duplex is ADVERTISED_100baseT_Half, not
|
||||
ADVERTISED_10baseT_Half.
|
||||
|
||||
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/ethernet/atheros/alx/hw.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/atheros/alx/hw.c b/drivers/net/ethernet/atheros/alx/hw.c
|
||||
index 220a16a..dc71cfb 100644
|
||||
--- a/drivers/net/ethernet/atheros/alx/hw.c
|
||||
+++ b/drivers/net/ethernet/atheros/alx/hw.c
|
||||
@@ -1134,7 +1134,7 @@ static inline u32 alx_speed_to_ethadv(int speed)
|
||||
case SPEED_100 + DUPLEX_FULL:
|
||||
return ADVERTISED_100baseT_Full;
|
||||
case SPEED_100 + DUPLEX_HALF:
|
||||
- return ADVERTISED_10baseT_Half;
|
||||
+ return ADVERTISED_100baseT_Half;
|
||||
case SPEED_10 + DUPLEX_FULL:
|
||||
return ADVERTISED_10baseT_Full;
|
||||
case SPEED_10 + DUPLEX_HALF:
|
|
@ -1,43 +0,0 @@
|
|||
From: Johannes Berg <johannes@sipsolutions.net>
|
||||
Date: Sat, 29 Jun 2013 19:23:18 +0200
|
||||
Subject: [5/6] alx: fix MAC address alignment problem
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git//commit?id=46ab9b347d677976b2b4072837cb4065839c0b80
|
||||
|
||||
In two places, parts of MAC addresses are used as u32/u16
|
||||
values. This can cause alignment problems, use put_unaligned
|
||||
and get_unaligned to fix this.
|
||||
|
||||
Reported-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/ethernet/atheros/alx/hw.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/atheros/alx/hw.c b/drivers/net/ethernet/atheros/alx/hw.c
|
||||
index aed48a7..ea99e5d 100644
|
||||
--- a/drivers/net/ethernet/atheros/alx/hw.c
|
||||
+++ b/drivers/net/ethernet/atheros/alx/hw.c
|
||||
@@ -282,8 +282,8 @@ static bool alx_read_macaddr(struct alx_hw *hw, u8 *addr)
|
||||
mac1 = alx_read_mem32(hw, ALX_STAD1);
|
||||
|
||||
/* addr should be big-endian */
|
||||
- *(__be32 *)(addr + 2) = cpu_to_be32(mac0);
|
||||
- *(__be16 *)addr = cpu_to_be16(mac1);
|
||||
+ put_unaligned(cpu_to_be32(mac0), (__be32 *)(addr + 2));
|
||||
+ put_unaligned(cpu_to_be16(mac1), (__be16 *)addr);
|
||||
|
||||
return is_valid_ether_addr(addr);
|
||||
}
|
||||
@@ -326,9 +326,9 @@ void alx_set_macaddr(struct alx_hw *hw, const u8 *addr)
|
||||
u32 val;
|
||||
|
||||
/* for example: 00-0B-6A-F6-00-DC * STAD0=6AF600DC, STAD1=000B */
|
||||
- val = be32_to_cpu(*(__be32 *)(addr + 2));
|
||||
+ val = be32_to_cpu(get_unaligned((__be32 *)(addr + 2)));
|
||||
alx_write_mem32(hw, ALX_STAD0, val);
|
||||
- val = be16_to_cpu(*(__be16 *)addr);
|
||||
+ val = be16_to_cpu(get_unaligned((__be16 *)addr));
|
||||
alx_write_mem32(hw, ALX_STAD1, val);
|
||||
}
|
||||
|
|
@ -1,140 +0,0 @@
|
|||
From: Johannes Berg <johannes@sipsolutions.net>
|
||||
Date: Sat, 29 Jun 2013 19:23:19 +0200
|
||||
Subject: [6/6] alx: fix ethtool support code
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git//commit?id=7ec5689461989fd80f1cf82ae084f5d50a5e63ee
|
||||
|
||||
A number of places treated features wrongly, listing not-supported
|
||||
features instead of supported ones. Also, the get_drvinfo ethtool
|
||||
callback isn't needed, and alx_get_pauseparam can be simplified.
|
||||
|
||||
Reported-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/ethernet/atheros/alx/ethtool.c | 64 ++++++++++++++----------------
|
||||
1 file changed, 29 insertions(+), 35 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/atheros/alx/ethtool.c b/drivers/net/ethernet/atheros/alx/ethtool.c
|
||||
index 5e19e08..9261006 100644
|
||||
--- a/drivers/net/ethernet/atheros/alx/ethtool.c
|
||||
+++ b/drivers/net/ethernet/atheros/alx/ethtool.c
|
||||
@@ -46,21 +46,37 @@
|
||||
#include "reg.h"
|
||||
#include "hw.h"
|
||||
|
||||
+static u32 alx_get_supported_speeds(struct alx_hw *hw)
|
||||
+{
|
||||
+ u32 supported = SUPPORTED_10baseT_Half |
|
||||
+ SUPPORTED_10baseT_Full |
|
||||
+ SUPPORTED_100baseT_Half |
|
||||
+ SUPPORTED_100baseT_Full;
|
||||
+
|
||||
+ if (alx_hw_giga(hw))
|
||||
+ supported |= SUPPORTED_1000baseT_Full;
|
||||
+
|
||||
+ BUILD_BUG_ON(SUPPORTED_10baseT_Half != ADVERTISED_10baseT_Half);
|
||||
+ BUILD_BUG_ON(SUPPORTED_10baseT_Full != ADVERTISED_10baseT_Full);
|
||||
+ BUILD_BUG_ON(SUPPORTED_100baseT_Half != ADVERTISED_100baseT_Half);
|
||||
+ BUILD_BUG_ON(SUPPORTED_100baseT_Full != ADVERTISED_100baseT_Full);
|
||||
+ BUILD_BUG_ON(SUPPORTED_1000baseT_Full != ADVERTISED_1000baseT_Full);
|
||||
+
|
||||
+ return supported;
|
||||
+}
|
||||
|
||||
static int alx_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
|
||||
{
|
||||
struct alx_priv *alx = netdev_priv(netdev);
|
||||
struct alx_hw *hw = &alx->hw;
|
||||
|
||||
- ecmd->supported = SUPPORTED_10baseT_Half |
|
||||
- SUPPORTED_10baseT_Full |
|
||||
- SUPPORTED_100baseT_Half |
|
||||
- SUPPORTED_100baseT_Full |
|
||||
- SUPPORTED_Autoneg |
|
||||
+ ecmd->supported = SUPPORTED_Autoneg |
|
||||
SUPPORTED_TP |
|
||||
- SUPPORTED_Pause;
|
||||
+ SUPPORTED_Pause |
|
||||
+ SUPPORTED_Asym_Pause;
|
||||
if (alx_hw_giga(hw))
|
||||
ecmd->supported |= SUPPORTED_1000baseT_Full;
|
||||
+ ecmd->supported |= alx_get_supported_speeds(hw);
|
||||
|
||||
ecmd->advertising = ADVERTISED_TP;
|
||||
if (hw->adv_cfg & ADVERTISED_Autoneg)
|
||||
@@ -68,6 +84,7 @@ static int alx_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
|
||||
|
||||
ecmd->port = PORT_TP;
|
||||
ecmd->phy_address = 0;
|
||||
+
|
||||
if (hw->adv_cfg & ADVERTISED_Autoneg)
|
||||
ecmd->autoneg = AUTONEG_ENABLE;
|
||||
else
|
||||
@@ -100,7 +117,7 @@ static int alx_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
|
||||
ASSERT_RTNL();
|
||||
|
||||
if (ecmd->autoneg == AUTONEG_ENABLE) {
|
||||
- if (ecmd->advertising & ADVERTISED_1000baseT_Half)
|
||||
+ if (ecmd->advertising & ~alx_get_supported_speeds(hw))
|
||||
return -EINVAL;
|
||||
adv_cfg = ecmd->advertising | ADVERTISED_Autoneg;
|
||||
} else {
|
||||
@@ -121,21 +138,10 @@ static void alx_get_pauseparam(struct net_device *netdev,
|
||||
struct alx_priv *alx = netdev_priv(netdev);
|
||||
struct alx_hw *hw = &alx->hw;
|
||||
|
||||
- if (hw->flowctrl & ALX_FC_ANEG &&
|
||||
- hw->adv_cfg & ADVERTISED_Autoneg)
|
||||
- pause->autoneg = AUTONEG_ENABLE;
|
||||
- else
|
||||
- pause->autoneg = AUTONEG_DISABLE;
|
||||
-
|
||||
- if (hw->flowctrl & ALX_FC_TX)
|
||||
- pause->tx_pause = 1;
|
||||
- else
|
||||
- pause->tx_pause = 0;
|
||||
-
|
||||
- if (hw->flowctrl & ALX_FC_RX)
|
||||
- pause->rx_pause = 1;
|
||||
- else
|
||||
- pause->rx_pause = 0;
|
||||
+ pause->autoneg = !!(hw->flowctrl & ALX_FC_ANEG &&
|
||||
+ hw->adv_cfg & ADVERTISED_Autoneg);
|
||||
+ pause->tx_pause = !!(hw->flowctrl & ALX_FC_TX);
|
||||
+ pause->rx_pause = !!(hw->flowctrl & ALX_FC_RX);
|
||||
}
|
||||
|
||||
|
||||
@@ -214,8 +220,7 @@ static int alx_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
|
||||
struct alx_priv *alx = netdev_priv(netdev);
|
||||
struct alx_hw *hw = &alx->hw;
|
||||
|
||||
- if (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE |
|
||||
- WAKE_UCAST | WAKE_BCAST | WAKE_MCAST))
|
||||
+ if (wol->wolopts & ~(WAKE_MAGIC | WAKE_PHY))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
hw->sleep_ctrl = 0;
|
||||
@@ -230,22 +235,11 @@ static int alx_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void alx_get_drvinfo(struct net_device *netdev,
|
||||
- struct ethtool_drvinfo *drvinfo)
|
||||
-{
|
||||
- struct alx_priv *alx = netdev_priv(netdev);
|
||||
-
|
||||
- strlcpy(drvinfo->driver, alx_drv_name, sizeof(drvinfo->driver));
|
||||
- strlcpy(drvinfo->bus_info, pci_name(alx->hw.pdev),
|
||||
- sizeof(drvinfo->bus_info));
|
||||
-}
|
||||
-
|
||||
const struct ethtool_ops alx_ethtool_ops = {
|
||||
.get_settings = alx_get_settings,
|
||||
.set_settings = alx_set_settings,
|
||||
.get_pauseparam = alx_get_pauseparam,
|
||||
.set_pauseparam = alx_set_pauseparam,
|
||||
- .get_drvinfo = alx_get_drvinfo,
|
||||
.get_msglevel = alx_get_msglevel,
|
||||
.set_msglevel = alx_set_msglevel,
|
||||
.get_wol = alx_get_wol,
|
|
@ -1,36 +0,0 @@
|
|||
From: Maarten Lankhorst <maarten.lankhorst@canonical.com>
|
||||
Date: Thu, 11 Jul 2013 15:53:21 +0200
|
||||
Subject: [8/8] alx: fix lockdep annotation
|
||||
Origin: https://git.kernel.org/linus/a8798a5c77c9981e88caef1373a3310bf8aed219
|
||||
|
||||
Move spin_lock_init to be called before the spinlocks are used, preventing a lockdep splat.
|
||||
|
||||
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/ethernet/atheros/alx/main.c | 5 ++---
|
||||
1 file changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
|
||||
index 0e0b242..027398e 100644
|
||||
--- a/drivers/net/ethernet/atheros/alx/main.c
|
||||
+++ b/drivers/net/ethernet/atheros/alx/main.c
|
||||
@@ -1245,6 +1245,8 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
|
||||
SET_NETDEV_DEV(netdev, &pdev->dev);
|
||||
alx = netdev_priv(netdev);
|
||||
+ spin_lock_init(&alx->hw.mdio_lock);
|
||||
+ spin_lock_init(&alx->irq_lock);
|
||||
alx->dev = netdev;
|
||||
alx->hw.pdev = pdev;
|
||||
alx->msg_enable = NETIF_MSG_LINK | NETIF_MSG_HW | NETIF_MSG_IFUP |
|
||||
@@ -1327,9 +1329,6 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
|
||||
INIT_WORK(&alx->link_check_wk, alx_link_check);
|
||||
INIT_WORK(&alx->reset_wk, alx_reset);
|
||||
- spin_lock_init(&alx->hw.mdio_lock);
|
||||
- spin_lock_init(&alx->irq_lock);
|
||||
-
|
||||
netif_carrier_off(netdev);
|
||||
|
||||
err = register_netdev(netdev);
|
|
@ -1,39 +0,0 @@
|
|||
From: Johannes Berg <johannes@sipsolutions.net>
|
||||
Date: Sat, 29 Jun 2013 19:23:16 +0200
|
||||
Subject: [3/6] alx: make sizes unsigned
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git//commit?id=4a134c39db2d9d6f31c55e7c3773fc33189c9320
|
||||
|
||||
The ring sizes should be unsigned, pointed out by Ben Hutchings.
|
||||
|
||||
Reported-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/ethernet/atheros/alx/alx.h | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/atheros/alx/alx.h b/drivers/net/ethernet/atheros/alx/alx.h
|
||||
index 50b3ae2..d71103d 100644
|
||||
--- a/drivers/net/ethernet/atheros/alx/alx.h
|
||||
+++ b/drivers/net/ethernet/atheros/alx/alx.h
|
||||
@@ -85,16 +85,16 @@ struct alx_priv {
|
||||
struct {
|
||||
dma_addr_t dma;
|
||||
void *virt;
|
||||
- int size;
|
||||
+ unsigned int size;
|
||||
} descmem;
|
||||
|
||||
/* protect int_mask updates */
|
||||
spinlock_t irq_lock;
|
||||
u32 int_mask;
|
||||
|
||||
- int tx_ringsz;
|
||||
- int rx_ringsz;
|
||||
- int rxbuf_size;
|
||||
+ unsigned int tx_ringsz;
|
||||
+ unsigned int rx_ringsz;
|
||||
+ unsigned int rxbuf_size;
|
||||
|
||||
struct napi_struct napi;
|
||||
struct alx_tx_queue txq;
|
|
@ -1,501 +0,0 @@
|
|||
From: Johannes Berg <johannes@sipsolutions.net>
|
||||
Date: Wed, 3 Jul 2013 21:48:11 +0200
|
||||
Subject: [7/8] alx: remove WoL support
|
||||
Origin: https://git.kernel.org/linus/bc2bebe8de8ed4ba6482c9cc370b0dd72ffe8cd2
|
||||
|
||||
Unfortunately, WoL is broken and the system will immediately
|
||||
resume after suspending, and I can't seem to figure out why.
|
||||
Remove WoL support until the issue can be found.
|
||||
|
||||
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/ethernet/atheros/alx/ethtool.c | 36 -------
|
||||
drivers/net/ethernet/atheros/alx/hw.c | 155 -----------------------------
|
||||
drivers/net/ethernet/atheros/alx/hw.h | 5 -
|
||||
drivers/net/ethernet/atheros/alx/main.c | 142 +++-----------------------
|
||||
4 files changed, 15 insertions(+), 323 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/atheros/alx/ethtool.c b/drivers/net/ethernet/atheros/alx/ethtool.c
|
||||
index 9261006..45b3650 100644
|
||||
--- a/drivers/net/ethernet/atheros/alx/ethtool.c
|
||||
+++ b/drivers/net/ethernet/atheros/alx/ethtool.c
|
||||
@@ -201,40 +201,6 @@ static void alx_set_msglevel(struct net_device *netdev, u32 data)
|
||||
alx->msg_enable = data;
|
||||
}
|
||||
|
||||
-static void alx_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
|
||||
-{
|
||||
- struct alx_priv *alx = netdev_priv(netdev);
|
||||
- struct alx_hw *hw = &alx->hw;
|
||||
-
|
||||
- wol->supported = WAKE_MAGIC | WAKE_PHY;
|
||||
- wol->wolopts = 0;
|
||||
-
|
||||
- if (hw->sleep_ctrl & ALX_SLEEP_WOL_MAGIC)
|
||||
- wol->wolopts |= WAKE_MAGIC;
|
||||
- if (hw->sleep_ctrl & ALX_SLEEP_WOL_PHY)
|
||||
- wol->wolopts |= WAKE_PHY;
|
||||
-}
|
||||
-
|
||||
-static int alx_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
|
||||
-{
|
||||
- struct alx_priv *alx = netdev_priv(netdev);
|
||||
- struct alx_hw *hw = &alx->hw;
|
||||
-
|
||||
- if (wol->wolopts & ~(WAKE_MAGIC | WAKE_PHY))
|
||||
- return -EOPNOTSUPP;
|
||||
-
|
||||
- hw->sleep_ctrl = 0;
|
||||
-
|
||||
- if (wol->wolopts & WAKE_MAGIC)
|
||||
- hw->sleep_ctrl |= ALX_SLEEP_WOL_MAGIC;
|
||||
- if (wol->wolopts & WAKE_PHY)
|
||||
- hw->sleep_ctrl |= ALX_SLEEP_WOL_PHY;
|
||||
-
|
||||
- device_set_wakeup_enable(&alx->hw.pdev->dev, hw->sleep_ctrl);
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
const struct ethtool_ops alx_ethtool_ops = {
|
||||
.get_settings = alx_get_settings,
|
||||
.set_settings = alx_set_settings,
|
||||
@@ -242,7 +208,5 @@ const struct ethtool_ops alx_ethtool_ops = {
|
||||
.set_pauseparam = alx_set_pauseparam,
|
||||
.get_msglevel = alx_get_msglevel,
|
||||
.set_msglevel = alx_set_msglevel,
|
||||
- .get_wol = alx_get_wol,
|
||||
- .set_wol = alx_set_wol,
|
||||
.get_link = ethtool_op_get_link,
|
||||
};
|
||||
diff --git a/drivers/net/ethernet/atheros/alx/hw.c b/drivers/net/ethernet/atheros/alx/hw.c
|
||||
index ea99e5d..1e8c24a 100644
|
||||
--- a/drivers/net/ethernet/atheros/alx/hw.c
|
||||
+++ b/drivers/net/ethernet/atheros/alx/hw.c
|
||||
@@ -332,16 +332,6 @@ void alx_set_macaddr(struct alx_hw *hw, const u8 *addr)
|
||||
alx_write_mem32(hw, ALX_STAD1, val);
|
||||
}
|
||||
|
||||
-static void alx_enable_osc(struct alx_hw *hw)
|
||||
-{
|
||||
- u32 val;
|
||||
-
|
||||
- /* rising edge */
|
||||
- val = alx_read_mem32(hw, ALX_MISC);
|
||||
- alx_write_mem32(hw, ALX_MISC, val & ~ALX_MISC_INTNLOSC_OPEN);
|
||||
- alx_write_mem32(hw, ALX_MISC, val | ALX_MISC_INTNLOSC_OPEN);
|
||||
-}
|
||||
-
|
||||
static void alx_reset_osc(struct alx_hw *hw, u8 rev)
|
||||
{
|
||||
u32 val, val2;
|
||||
@@ -858,66 +848,6 @@ void alx_post_phy_link(struct alx_hw *hw)
|
||||
}
|
||||
}
|
||||
|
||||
-
|
||||
-/* NOTE:
|
||||
- * 1. phy link must be established before calling this function
|
||||
- * 2. wol option (pattern,magic,link,etc.) is configed before call it.
|
||||
- */
|
||||
-int alx_pre_suspend(struct alx_hw *hw, int speed, u8 duplex)
|
||||
-{
|
||||
- u32 master, mac, phy, val;
|
||||
- int err = 0;
|
||||
-
|
||||
- master = alx_read_mem32(hw, ALX_MASTER);
|
||||
- master &= ~ALX_MASTER_PCLKSEL_SRDS;
|
||||
- mac = hw->rx_ctrl;
|
||||
- /* 10/100 half */
|
||||
- ALX_SET_FIELD(mac, ALX_MAC_CTRL_SPEED, ALX_MAC_CTRL_SPEED_10_100);
|
||||
- mac &= ~(ALX_MAC_CTRL_FULLD | ALX_MAC_CTRL_RX_EN | ALX_MAC_CTRL_TX_EN);
|
||||
-
|
||||
- phy = alx_read_mem32(hw, ALX_PHY_CTRL);
|
||||
- phy &= ~(ALX_PHY_CTRL_DSPRST_OUT | ALX_PHY_CTRL_CLS);
|
||||
- phy |= ALX_PHY_CTRL_RST_ANALOG | ALX_PHY_CTRL_HIB_PULSE |
|
||||
- ALX_PHY_CTRL_HIB_EN;
|
||||
-
|
||||
- /* without any activity */
|
||||
- if (!(hw->sleep_ctrl & ALX_SLEEP_ACTIVE)) {
|
||||
- err = alx_write_phy_reg(hw, ALX_MII_IER, 0);
|
||||
- if (err)
|
||||
- return err;
|
||||
- phy |= ALX_PHY_CTRL_IDDQ | ALX_PHY_CTRL_POWER_DOWN;
|
||||
- } else {
|
||||
- if (hw->sleep_ctrl & (ALX_SLEEP_WOL_MAGIC | ALX_SLEEP_CIFS))
|
||||
- mac |= ALX_MAC_CTRL_RX_EN | ALX_MAC_CTRL_BRD_EN;
|
||||
- if (hw->sleep_ctrl & ALX_SLEEP_CIFS)
|
||||
- mac |= ALX_MAC_CTRL_TX_EN;
|
||||
- if (duplex == DUPLEX_FULL)
|
||||
- mac |= ALX_MAC_CTRL_FULLD;
|
||||
- if (speed == SPEED_1000)
|
||||
- ALX_SET_FIELD(mac, ALX_MAC_CTRL_SPEED,
|
||||
- ALX_MAC_CTRL_SPEED_1000);
|
||||
- phy |= ALX_PHY_CTRL_DSPRST_OUT;
|
||||
- err = alx_write_phy_ext(hw, ALX_MIIEXT_ANEG,
|
||||
- ALX_MIIEXT_S3DIG10,
|
||||
- ALX_MIIEXT_S3DIG10_SL);
|
||||
- if (err)
|
||||
- return err;
|
||||
- }
|
||||
-
|
||||
- alx_enable_osc(hw);
|
||||
- hw->rx_ctrl = mac;
|
||||
- alx_write_mem32(hw, ALX_MASTER, master);
|
||||
- alx_write_mem32(hw, ALX_MAC_CTRL, mac);
|
||||
- alx_write_mem32(hw, ALX_PHY_CTRL, phy);
|
||||
-
|
||||
- /* set val of PDLL D3PLLOFF */
|
||||
- val = alx_read_mem32(hw, ALX_PDLL_TRNS1);
|
||||
- val |= ALX_PDLL_TRNS1_D3PLLOFF_EN;
|
||||
- alx_write_mem32(hw, ALX_PDLL_TRNS1, val);
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
bool alx_phy_configured(struct alx_hw *hw)
|
||||
{
|
||||
u32 cfg, hw_cfg;
|
||||
@@ -990,26 +920,6 @@ int alx_clear_phy_intr(struct alx_hw *hw)
|
||||
return alx_read_phy_reg(hw, ALX_MII_ISR, &isr);
|
||||
}
|
||||
|
||||
-int alx_config_wol(struct alx_hw *hw)
|
||||
-{
|
||||
- u32 wol = 0;
|
||||
- int err = 0;
|
||||
-
|
||||
- /* turn on magic packet event */
|
||||
- if (hw->sleep_ctrl & ALX_SLEEP_WOL_MAGIC)
|
||||
- wol |= ALX_WOL0_MAGIC_EN | ALX_WOL0_PME_MAGIC_EN;
|
||||
-
|
||||
- /* turn on link up event */
|
||||
- if (hw->sleep_ctrl & ALX_SLEEP_WOL_PHY) {
|
||||
- wol |= ALX_WOL0_LINK_EN | ALX_WOL0_PME_LINK;
|
||||
- /* only link up can wake up */
|
||||
- err = alx_write_phy_reg(hw, ALX_MII_IER, ALX_IER_LINK_UP);
|
||||
- }
|
||||
- alx_write_mem32(hw, ALX_WOL0, wol);
|
||||
-
|
||||
- return err;
|
||||
-}
|
||||
-
|
||||
void alx_disable_rss(struct alx_hw *hw)
|
||||
{
|
||||
u32 ctrl = alx_read_mem32(hw, ALX_RXQ0);
|
||||
@@ -1121,71 +1031,6 @@ void alx_configure_basic(struct alx_hw *hw)
|
||||
alx_write_mem32(hw, ALX_WRR, val);
|
||||
}
|
||||
|
||||
-int alx_select_powersaving_speed(struct alx_hw *hw, int *speed, u8 *duplex)
|
||||
-{
|
||||
- int i, err;
|
||||
- u16 lpa;
|
||||
-
|
||||
- err = alx_read_phy_link(hw);
|
||||
- if (err)
|
||||
- return err;
|
||||
-
|
||||
- if (hw->link_speed == SPEED_UNKNOWN) {
|
||||
- *speed = SPEED_UNKNOWN;
|
||||
- *duplex = DUPLEX_UNKNOWN;
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
- err = alx_read_phy_reg(hw, MII_LPA, &lpa);
|
||||
- if (err)
|
||||
- return err;
|
||||
-
|
||||
- if (!(lpa & LPA_LPACK)) {
|
||||
- *speed = hw->link_speed;
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
- if (lpa & LPA_10FULL) {
|
||||
- *speed = SPEED_10;
|
||||
- *duplex = DUPLEX_FULL;
|
||||
- } else if (lpa & LPA_10HALF) {
|
||||
- *speed = SPEED_10;
|
||||
- *duplex = DUPLEX_HALF;
|
||||
- } else if (lpa & LPA_100FULL) {
|
||||
- *speed = SPEED_100;
|
||||
- *duplex = DUPLEX_FULL;
|
||||
- } else {
|
||||
- *speed = SPEED_100;
|
||||
- *duplex = DUPLEX_HALF;
|
||||
- }
|
||||
-
|
||||
- if (*speed == hw->link_speed && *duplex == hw->duplex)
|
||||
- return 0;
|
||||
- err = alx_write_phy_reg(hw, ALX_MII_IER, 0);
|
||||
- if (err)
|
||||
- return err;
|
||||
- err = alx_setup_speed_duplex(hw, alx_speed_to_ethadv(*speed, *duplex) |
|
||||
- ADVERTISED_Autoneg, ALX_FC_ANEG |
|
||||
- ALX_FC_RX | ALX_FC_TX);
|
||||
- if (err)
|
||||
- return err;
|
||||
-
|
||||
- /* wait for linkup */
|
||||
- for (i = 0; i < ALX_MAX_SETUP_LNK_CYCLE; i++) {
|
||||
- msleep(100);
|
||||
-
|
||||
- err = alx_read_phy_link(hw);
|
||||
- if (err < 0)
|
||||
- return err;
|
||||
- if (hw->link_speed != SPEED_UNKNOWN)
|
||||
- break;
|
||||
- }
|
||||
- if (i == ALX_MAX_SETUP_LNK_CYCLE)
|
||||
- return -ETIMEDOUT;
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
bool alx_get_phy_info(struct alx_hw *hw)
|
||||
{
|
||||
u16 devs1, devs2;
|
||||
diff --git a/drivers/net/ethernet/atheros/alx/hw.h b/drivers/net/ethernet/atheros/alx/hw.h
|
||||
index a60e35c..96f3b43 100644
|
||||
--- a/drivers/net/ethernet/atheros/alx/hw.h
|
||||
+++ b/drivers/net/ethernet/atheros/alx/hw.h
|
||||
@@ -418,8 +418,6 @@ struct alx_hw {
|
||||
u8 flowctrl;
|
||||
u32 adv_cfg;
|
||||
|
||||
- u32 sleep_ctrl;
|
||||
-
|
||||
spinlock_t mdio_lock;
|
||||
struct mdio_if_info mdio;
|
||||
u16 phy_id[2];
|
||||
@@ -479,14 +477,12 @@ void alx_reset_pcie(struct alx_hw *hw);
|
||||
void alx_enable_aspm(struct alx_hw *hw, bool l0s_en, bool l1_en);
|
||||
int alx_setup_speed_duplex(struct alx_hw *hw, u32 ethadv, u8 flowctrl);
|
||||
void alx_post_phy_link(struct alx_hw *hw);
|
||||
-int alx_pre_suspend(struct alx_hw *hw, int speed, u8 duplex);
|
||||
int alx_read_phy_reg(struct alx_hw *hw, u16 reg, u16 *phy_data);
|
||||
int alx_write_phy_reg(struct alx_hw *hw, u16 reg, u16 phy_data);
|
||||
int alx_read_phy_ext(struct alx_hw *hw, u8 dev, u16 reg, u16 *pdata);
|
||||
int alx_write_phy_ext(struct alx_hw *hw, u8 dev, u16 reg, u16 data);
|
||||
int alx_read_phy_link(struct alx_hw *hw);
|
||||
int alx_clear_phy_intr(struct alx_hw *hw);
|
||||
-int alx_config_wol(struct alx_hw *hw);
|
||||
void alx_cfg_mac_flowcontrol(struct alx_hw *hw, u8 fc);
|
||||
void alx_start_mac(struct alx_hw *hw);
|
||||
int alx_reset_mac(struct alx_hw *hw);
|
||||
@@ -494,7 +490,6 @@ void alx_set_macaddr(struct alx_hw *hw, const u8 *addr);
|
||||
bool alx_phy_configured(struct alx_hw *hw);
|
||||
void alx_configure_basic(struct alx_hw *hw);
|
||||
void alx_disable_rss(struct alx_hw *hw);
|
||||
-int alx_select_powersaving_speed(struct alx_hw *hw, int *speed, u8 *duplex);
|
||||
bool alx_get_phy_info(struct alx_hw *hw);
|
||||
|
||||
static inline u32 alx_speed_to_ethadv(int speed, u8 duplex)
|
||||
diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
|
||||
index 148b4b9..0e0b242 100644
|
||||
--- a/drivers/net/ethernet/atheros/alx/main.c
|
||||
+++ b/drivers/net/ethernet/atheros/alx/main.c
|
||||
@@ -706,7 +706,6 @@ static int alx_init_sw(struct alx_priv *alx)
|
||||
alx->rxbuf_size = ALIGN(ALX_RAW_MTU(hw->mtu), 8);
|
||||
alx->tx_ringsz = 256;
|
||||
alx->rx_ringsz = 512;
|
||||
- hw->sleep_ctrl = ALX_SLEEP_WOL_MAGIC | ALX_SLEEP_WOL_PHY;
|
||||
hw->imt = 200;
|
||||
alx->int_mask = ALX_ISR_MISC;
|
||||
hw->dma_chnl = hw->max_dma_chnl;
|
||||
@@ -961,66 +960,6 @@ static int alx_stop(struct net_device *netdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int __alx_shutdown(struct pci_dev *pdev, bool *wol_en)
|
||||
-{
|
||||
- struct alx_priv *alx = pci_get_drvdata(pdev);
|
||||
- struct net_device *netdev = alx->dev;
|
||||
- struct alx_hw *hw = &alx->hw;
|
||||
- int err, speed;
|
||||
- u8 duplex;
|
||||
-
|
||||
- netif_device_detach(netdev);
|
||||
-
|
||||
- if (netif_running(netdev))
|
||||
- __alx_stop(alx);
|
||||
-
|
||||
-#ifdef CONFIG_PM_SLEEP
|
||||
- err = pci_save_state(pdev);
|
||||
- if (err)
|
||||
- return err;
|
||||
-#endif
|
||||
-
|
||||
- err = alx_select_powersaving_speed(hw, &speed, &duplex);
|
||||
- if (err)
|
||||
- return err;
|
||||
- err = alx_clear_phy_intr(hw);
|
||||
- if (err)
|
||||
- return err;
|
||||
- err = alx_pre_suspend(hw, speed, duplex);
|
||||
- if (err)
|
||||
- return err;
|
||||
- err = alx_config_wol(hw);
|
||||
- if (err)
|
||||
- return err;
|
||||
-
|
||||
- *wol_en = false;
|
||||
- if (hw->sleep_ctrl & ALX_SLEEP_ACTIVE) {
|
||||
- netif_info(alx, wol, netdev,
|
||||
- "wol: ctrl=%X, speed=%X\n",
|
||||
- hw->sleep_ctrl, speed);
|
||||
- device_set_wakeup_enable(&pdev->dev, true);
|
||||
- *wol_en = true;
|
||||
- }
|
||||
-
|
||||
- pci_disable_device(pdev);
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static void alx_shutdown(struct pci_dev *pdev)
|
||||
-{
|
||||
- int err;
|
||||
- bool wol_en;
|
||||
-
|
||||
- err = __alx_shutdown(pdev, &wol_en);
|
||||
- if (!err) {
|
||||
- pci_wake_from_d3(pdev, wol_en);
|
||||
- pci_set_power_state(pdev, PCI_D3hot);
|
||||
- } else {
|
||||
- dev_err(&pdev->dev, "shutdown fail %d\n", err);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
static void alx_link_check(struct work_struct *work)
|
||||
{
|
||||
struct alx_priv *alx;
|
||||
@@ -1399,8 +1338,6 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
goto out_unmap;
|
||||
}
|
||||
|
||||
- device_set_wakeup_enable(&pdev->dev, hw->sleep_ctrl);
|
||||
-
|
||||
netdev_info(netdev,
|
||||
"Qualcomm Atheros AR816x/AR817x Ethernet [%pM]\n",
|
||||
netdev->dev_addr);
|
||||
@@ -1445,22 +1382,12 @@ static void alx_remove(struct pci_dev *pdev)
|
||||
static int alx_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(dev);
|
||||
- int err;
|
||||
- bool wol_en;
|
||||
-
|
||||
- err = __alx_shutdown(pdev, &wol_en);
|
||||
- if (err) {
|
||||
- dev_err(&pdev->dev, "shutdown fail in suspend %d\n", err);
|
||||
- return err;
|
||||
- }
|
||||
-
|
||||
- if (wol_en) {
|
||||
- pci_prepare_to_sleep(pdev);
|
||||
- } else {
|
||||
- pci_wake_from_d3(pdev, false);
|
||||
- pci_set_power_state(pdev, PCI_D3hot);
|
||||
- }
|
||||
+ struct alx_priv *alx = pci_get_drvdata(pdev);
|
||||
|
||||
+ if (!netif_running(alx->dev))
|
||||
+ return 0;
|
||||
+ netif_device_detach(alx->dev);
|
||||
+ __alx_stop(alx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1468,49 +1395,20 @@ static int alx_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(dev);
|
||||
struct alx_priv *alx = pci_get_drvdata(pdev);
|
||||
- struct net_device *netdev = alx->dev;
|
||||
- struct alx_hw *hw = &alx->hw;
|
||||
- int err;
|
||||
-
|
||||
- pci_set_power_state(pdev, PCI_D0);
|
||||
- pci_restore_state(pdev);
|
||||
- pci_save_state(pdev);
|
||||
-
|
||||
- pci_enable_wake(pdev, PCI_D3hot, 0);
|
||||
- pci_enable_wake(pdev, PCI_D3cold, 0);
|
||||
-
|
||||
- hw->link_speed = SPEED_UNKNOWN;
|
||||
- alx->int_mask = ALX_ISR_MISC;
|
||||
-
|
||||
- alx_reset_pcie(hw);
|
||||
- alx_reset_phy(hw);
|
||||
-
|
||||
- err = alx_reset_mac(hw);
|
||||
- if (err) {
|
||||
- netif_err(alx, hw, alx->dev,
|
||||
- "resume:reset_mac fail %d\n", err);
|
||||
- return -EIO;
|
||||
- }
|
||||
-
|
||||
- err = alx_setup_speed_duplex(hw, hw->adv_cfg, hw->flowctrl);
|
||||
- if (err) {
|
||||
- netif_err(alx, hw, alx->dev,
|
||||
- "resume:setup_speed_duplex fail %d\n", err);
|
||||
- return -EIO;
|
||||
- }
|
||||
-
|
||||
- if (netif_running(netdev)) {
|
||||
- err = __alx_open(alx, true);
|
||||
- if (err)
|
||||
- return err;
|
||||
- }
|
||||
-
|
||||
- netif_device_attach(netdev);
|
||||
|
||||
- return err;
|
||||
+ if (!netif_running(alx->dev))
|
||||
+ return 0;
|
||||
+ netif_device_attach(alx->dev);
|
||||
+ return __alx_open(alx, true);
|
||||
}
|
||||
+
|
||||
+static SIMPLE_DEV_PM_OPS(alx_pm_ops, alx_suspend, alx_resume);
|
||||
+#define ALX_PM_OPS (&alx_pm_ops)
|
||||
+#else
|
||||
+#define ALX_PM_OPS NULL
|
||||
#endif
|
||||
|
||||
+
|
||||
static pci_ers_result_t alx_pci_error_detected(struct pci_dev *pdev,
|
||||
pci_channel_state_t state)
|
||||
{
|
||||
@@ -1553,8 +1451,6 @@ static pci_ers_result_t alx_pci_error_slot_reset(struct pci_dev *pdev)
|
||||
}
|
||||
|
||||
pci_set_master(pdev);
|
||||
- pci_enable_wake(pdev, PCI_D3hot, 0);
|
||||
- pci_enable_wake(pdev, PCI_D3cold, 0);
|
||||
|
||||
alx_reset_pcie(hw);
|
||||
if (!alx_reset_mac(hw))
|
||||
@@ -1590,13 +1486,6 @@ static const struct pci_error_handlers alx_err_handlers = {
|
||||
.resume = alx_pci_error_resume,
|
||||
};
|
||||
|
||||
-#ifdef CONFIG_PM_SLEEP
|
||||
-static SIMPLE_DEV_PM_OPS(alx_pm_ops, alx_suspend, alx_resume);
|
||||
-#define ALX_PM_OPS (&alx_pm_ops)
|
||||
-#else
|
||||
-#define ALX_PM_OPS NULL
|
||||
-#endif
|
||||
-
|
||||
static DEFINE_PCI_DEVICE_TABLE(alx_pci_tbl) = {
|
||||
{ PCI_VDEVICE(ATTANSIC, ALX_DEV_ID_AR8161),
|
||||
.driver_data = ALX_DEV_QUIRK_MSI_INTX_DISABLE_BUG },
|
||||
@@ -1614,7 +1503,6 @@ static struct pci_driver alx_driver = {
|
||||
.id_table = alx_pci_tbl,
|
||||
.probe = alx_probe,
|
||||
.remove = alx_remove,
|
||||
- .shutdown = alx_shutdown,
|
||||
.err_handler = &alx_err_handlers,
|
||||
.driver.pm = ALX_PM_OPS,
|
||||
};
|
|
@ -1,488 +0,0 @@
|
|||
From: Johannes Berg <johannes@sipsolutions.net>
|
||||
Date: Sat, 29 Jun 2013 19:23:17 +0200
|
||||
Subject: [4/6] alx: separate link speed/duplex fields
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git//commit?id=a5b87cc9e0538bf6680d431e0076d778e5bae38e
|
||||
|
||||
As suggested by Ben Hutchings, use separate fields to track
|
||||
current link speed and duplex setting.
|
||||
|
||||
Reported-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/ethernet/atheros/alx/ethtool.c | 31 ++-----
|
||||
drivers/net/ethernet/atheros/alx/hw.c | 139 +++++++++++++----------------
|
||||
drivers/net/ethernet/atheros/alx/hw.h | 24 ++++-
|
||||
drivers/net/ethernet/atheros/alx/main.c | 37 ++++----
|
||||
4 files changed, 106 insertions(+), 125 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/atheros/alx/ethtool.c b/drivers/net/ethernet/atheros/alx/ethtool.c
|
||||
index 50a91d0..5e19e08 100644
|
||||
--- a/drivers/net/ethernet/atheros/alx/ethtool.c
|
||||
+++ b/drivers/net/ethernet/atheros/alx/ethtool.c
|
||||
@@ -85,14 +85,8 @@ static int alx_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
|
||||
}
|
||||
}
|
||||
|
||||
- if (hw->link_speed != SPEED_UNKNOWN) {
|
||||
- ethtool_cmd_speed_set(ecmd,
|
||||
- hw->link_speed - hw->link_speed % 10);
|
||||
- ecmd->duplex = hw->link_speed % 10;
|
||||
- } else {
|
||||
- ethtool_cmd_speed_set(ecmd, SPEED_UNKNOWN);
|
||||
- ecmd->duplex = DUPLEX_UNKNOWN;
|
||||
- }
|
||||
+ ethtool_cmd_speed_set(ecmd, hw->link_speed);
|
||||
+ ecmd->duplex = hw->duplex;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -110,24 +104,11 @@ static int alx_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
|
||||
return -EINVAL;
|
||||
adv_cfg = ecmd->advertising | ADVERTISED_Autoneg;
|
||||
} else {
|
||||
- int speed = ethtool_cmd_speed(ecmd);
|
||||
-
|
||||
- switch (speed + ecmd->duplex) {
|
||||
- case SPEED_10 + DUPLEX_HALF:
|
||||
- adv_cfg = ADVERTISED_10baseT_Half;
|
||||
- break;
|
||||
- case SPEED_10 + DUPLEX_FULL:
|
||||
- adv_cfg = ADVERTISED_10baseT_Full;
|
||||
- break;
|
||||
- case SPEED_100 + DUPLEX_HALF:
|
||||
- adv_cfg = ADVERTISED_100baseT_Half;
|
||||
- break;
|
||||
- case SPEED_100 + DUPLEX_FULL:
|
||||
- adv_cfg = ADVERTISED_100baseT_Full;
|
||||
- break;
|
||||
- default:
|
||||
+ adv_cfg = alx_speed_to_ethadv(ethtool_cmd_speed(ecmd),
|
||||
+ ecmd->duplex);
|
||||
+
|
||||
+ if (!adv_cfg || adv_cfg == ADVERTISED_1000baseT_Full)
|
||||
return -EINVAL;
|
||||
- }
|
||||
}
|
||||
|
||||
hw->adv_cfg = adv_cfg;
|
||||
diff --git a/drivers/net/ethernet/atheros/alx/hw.c b/drivers/net/ethernet/atheros/alx/hw.c
|
||||
index dc71cfb..aed48a7 100644
|
||||
--- a/drivers/net/ethernet/atheros/alx/hw.c
|
||||
+++ b/drivers/net/ethernet/atheros/alx/hw.c
|
||||
@@ -624,12 +624,12 @@ void alx_start_mac(struct alx_hw *hw)
|
||||
alx_write_mem32(hw, ALX_TXQ0, txq | ALX_TXQ0_EN);
|
||||
|
||||
mac = hw->rx_ctrl;
|
||||
- if (hw->link_speed % 10 == DUPLEX_FULL)
|
||||
+ if (hw->duplex == DUPLEX_FULL)
|
||||
mac |= ALX_MAC_CTRL_FULLD;
|
||||
else
|
||||
mac &= ~ALX_MAC_CTRL_FULLD;
|
||||
ALX_SET_FIELD(mac, ALX_MAC_CTRL_SPEED,
|
||||
- hw->link_speed >= SPEED_1000 ? ALX_MAC_CTRL_SPEED_1000 :
|
||||
+ hw->link_speed == SPEED_1000 ? ALX_MAC_CTRL_SPEED_1000 :
|
||||
ALX_MAC_CTRL_SPEED_10_100);
|
||||
mac |= ALX_MAC_CTRL_TX_EN | ALX_MAC_CTRL_RX_EN;
|
||||
hw->rx_ctrl = mac;
|
||||
@@ -790,28 +790,22 @@ void alx_post_phy_link(struct alx_hw *hw)
|
||||
u16 phy_val, len, agc;
|
||||
u8 revid = alx_hw_revision(hw);
|
||||
bool adj_th = revid == ALX_REV_B0;
|
||||
- int speed;
|
||||
-
|
||||
- if (hw->link_speed == SPEED_UNKNOWN)
|
||||
- speed = SPEED_UNKNOWN;
|
||||
- else
|
||||
- speed = hw->link_speed - hw->link_speed % 10;
|
||||
|
||||
if (revid != ALX_REV_B0 && !alx_is_rev_a(revid))
|
||||
return;
|
||||
|
||||
/* 1000BT/AZ, wrong cable length */
|
||||
- if (speed != SPEED_UNKNOWN) {
|
||||
+ if (hw->link_speed != SPEED_UNKNOWN) {
|
||||
alx_read_phy_ext(hw, ALX_MIIEXT_PCS, ALX_MIIEXT_CLDCTRL6,
|
||||
&phy_val);
|
||||
len = ALX_GET_FIELD(phy_val, ALX_CLDCTRL6_CAB_LEN);
|
||||
alx_read_phy_dbg(hw, ALX_MIIDBG_AGC, &phy_val);
|
||||
agc = ALX_GET_FIELD(phy_val, ALX_AGC_2_VGA);
|
||||
|
||||
- if ((speed == SPEED_1000 &&
|
||||
+ if ((hw->link_speed == SPEED_1000 &&
|
||||
(len > ALX_CLDCTRL6_CAB_LEN_SHORT1G ||
|
||||
(len == 0 && agc > ALX_AGC_LONG1G_LIMT))) ||
|
||||
- (speed == SPEED_100 &&
|
||||
+ (hw->link_speed == SPEED_100 &&
|
||||
(len > ALX_CLDCTRL6_CAB_LEN_SHORT100M ||
|
||||
(len == 0 && agc > ALX_AGC_LONG100M_LIMT)))) {
|
||||
alx_write_phy_dbg(hw, ALX_MIIDBG_AZ_ANADECT,
|
||||
@@ -831,10 +825,10 @@ void alx_post_phy_link(struct alx_hw *hw)
|
||||
|
||||
/* threshold adjust */
|
||||
if (adj_th && hw->lnk_patch) {
|
||||
- if (speed == SPEED_100) {
|
||||
+ if (hw->link_speed == SPEED_100) {
|
||||
alx_write_phy_dbg(hw, ALX_MIIDBG_MSE16DB,
|
||||
ALX_MSE16DB_UP);
|
||||
- } else if (speed == SPEED_1000) {
|
||||
+ } else if (hw->link_speed == SPEED_1000) {
|
||||
/*
|
||||
* Giga link threshold, raise the tolerance of
|
||||
* noise 50%
|
||||
@@ -869,7 +863,7 @@ void alx_post_phy_link(struct alx_hw *hw)
|
||||
* 1. phy link must be established before calling this function
|
||||
* 2. wol option (pattern,magic,link,etc.) is configed before call it.
|
||||
*/
|
||||
-int alx_pre_suspend(struct alx_hw *hw, int speed)
|
||||
+int alx_pre_suspend(struct alx_hw *hw, int speed, u8 duplex)
|
||||
{
|
||||
u32 master, mac, phy, val;
|
||||
int err = 0;
|
||||
@@ -897,9 +891,9 @@ int alx_pre_suspend(struct alx_hw *hw, int speed)
|
||||
mac |= ALX_MAC_CTRL_RX_EN | ALX_MAC_CTRL_BRD_EN;
|
||||
if (hw->sleep_ctrl & ALX_SLEEP_CIFS)
|
||||
mac |= ALX_MAC_CTRL_TX_EN;
|
||||
- if (speed % 10 == DUPLEX_FULL)
|
||||
+ if (duplex == DUPLEX_FULL)
|
||||
mac |= ALX_MAC_CTRL_FULLD;
|
||||
- if (speed >= SPEED_1000)
|
||||
+ if (speed == SPEED_1000)
|
||||
ALX_SET_FIELD(mac, ALX_MAC_CTRL_SPEED,
|
||||
ALX_MAC_CTRL_SPEED_1000);
|
||||
phy |= ALX_PHY_CTRL_DSPRST_OUT;
|
||||
@@ -938,7 +932,7 @@ bool alx_phy_configured(struct alx_hw *hw)
|
||||
return cfg == hw_cfg;
|
||||
}
|
||||
|
||||
-int alx_get_phy_link(struct alx_hw *hw, int *speed)
|
||||
+int alx_read_phy_link(struct alx_hw *hw)
|
||||
{
|
||||
struct pci_dev *pdev = hw->pdev;
|
||||
u16 bmsr, giga;
|
||||
@@ -953,7 +947,8 @@ int alx_get_phy_link(struct alx_hw *hw, int *speed)
|
||||
return err;
|
||||
|
||||
if (!(bmsr & BMSR_LSTATUS)) {
|
||||
- *speed = SPEED_UNKNOWN;
|
||||
+ hw->link_speed = SPEED_UNKNOWN;
|
||||
+ hw->duplex = DUPLEX_UNKNOWN;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -967,20 +962,20 @@ int alx_get_phy_link(struct alx_hw *hw, int *speed)
|
||||
|
||||
switch (giga & ALX_GIGA_PSSR_SPEED) {
|
||||
case ALX_GIGA_PSSR_1000MBS:
|
||||
- *speed = SPEED_1000;
|
||||
+ hw->link_speed = SPEED_1000;
|
||||
break;
|
||||
case ALX_GIGA_PSSR_100MBS:
|
||||
- *speed = SPEED_100;
|
||||
+ hw->link_speed = SPEED_100;
|
||||
break;
|
||||
case ALX_GIGA_PSSR_10MBS:
|
||||
- *speed = SPEED_10;
|
||||
+ hw->link_speed = SPEED_10;
|
||||
break;
|
||||
default:
|
||||
goto wrong_speed;
|
||||
}
|
||||
|
||||
- *speed += (giga & ALX_GIGA_PSSR_DPLX) ? DUPLEX_FULL : DUPLEX_HALF;
|
||||
- return 1;
|
||||
+ hw->duplex = (giga & ALX_GIGA_PSSR_DPLX) ? DUPLEX_FULL : DUPLEX_HALF;
|
||||
+ return 0;
|
||||
|
||||
wrong_speed:
|
||||
dev_err(&pdev->dev, "invalid PHY speed/duplex: 0x%x\n", giga);
|
||||
@@ -1126,81 +1121,67 @@ void alx_configure_basic(struct alx_hw *hw)
|
||||
alx_write_mem32(hw, ALX_WRR, val);
|
||||
}
|
||||
|
||||
-static inline u32 alx_speed_to_ethadv(int speed)
|
||||
-{
|
||||
- switch (speed) {
|
||||
- case SPEED_1000 + DUPLEX_FULL:
|
||||
- return ADVERTISED_1000baseT_Full;
|
||||
- case SPEED_100 + DUPLEX_FULL:
|
||||
- return ADVERTISED_100baseT_Full;
|
||||
- case SPEED_100 + DUPLEX_HALF:
|
||||
- return ADVERTISED_100baseT_Half;
|
||||
- case SPEED_10 + DUPLEX_FULL:
|
||||
- return ADVERTISED_10baseT_Full;
|
||||
- case SPEED_10 + DUPLEX_HALF:
|
||||
- return ADVERTISED_10baseT_Half;
|
||||
- default:
|
||||
- return 0;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-int alx_select_powersaving_speed(struct alx_hw *hw, int *speed)
|
||||
+int alx_select_powersaving_speed(struct alx_hw *hw, int *speed, u8 *duplex)
|
||||
{
|
||||
- int i, err, spd;
|
||||
+ int i, err;
|
||||
u16 lpa;
|
||||
|
||||
- err = alx_get_phy_link(hw, &spd);
|
||||
- if (err < 0)
|
||||
+ err = alx_read_phy_link(hw);
|
||||
+ if (err)
|
||||
return err;
|
||||
|
||||
- if (spd == SPEED_UNKNOWN)
|
||||
+ if (hw->link_speed == SPEED_UNKNOWN) {
|
||||
+ *speed = SPEED_UNKNOWN;
|
||||
+ *duplex = DUPLEX_UNKNOWN;
|
||||
return 0;
|
||||
+ }
|
||||
|
||||
err = alx_read_phy_reg(hw, MII_LPA, &lpa);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (!(lpa & LPA_LPACK)) {
|
||||
- *speed = spd;
|
||||
+ *speed = hw->link_speed;
|
||||
return 0;
|
||||
}
|
||||
|
||||
- if (lpa & LPA_10FULL)
|
||||
- *speed = SPEED_10 + DUPLEX_FULL;
|
||||
- else if (lpa & LPA_10HALF)
|
||||
- *speed = SPEED_10 + DUPLEX_HALF;
|
||||
- else if (lpa & LPA_100FULL)
|
||||
- *speed = SPEED_100 + DUPLEX_FULL;
|
||||
- else
|
||||
- *speed = SPEED_100 + DUPLEX_HALF;
|
||||
-
|
||||
- if (*speed != spd) {
|
||||
- err = alx_write_phy_reg(hw, ALX_MII_IER, 0);
|
||||
- if (err)
|
||||
- return err;
|
||||
- err = alx_setup_speed_duplex(hw,
|
||||
- alx_speed_to_ethadv(*speed) |
|
||||
- ADVERTISED_Autoneg,
|
||||
- ALX_FC_ANEG | ALX_FC_RX |
|
||||
- ALX_FC_TX);
|
||||
- if (err)
|
||||
- return err;
|
||||
+ if (lpa & LPA_10FULL) {
|
||||
+ *speed = SPEED_10;
|
||||
+ *duplex = DUPLEX_FULL;
|
||||
+ } else if (lpa & LPA_10HALF) {
|
||||
+ *speed = SPEED_10;
|
||||
+ *duplex = DUPLEX_HALF;
|
||||
+ } else if (lpa & LPA_100FULL) {
|
||||
+ *speed = SPEED_100;
|
||||
+ *duplex = DUPLEX_FULL;
|
||||
+ } else {
|
||||
+ *speed = SPEED_100;
|
||||
+ *duplex = DUPLEX_HALF;
|
||||
+ }
|
||||
|
||||
- /* wait for linkup */
|
||||
- for (i = 0; i < ALX_MAX_SETUP_LNK_CYCLE; i++) {
|
||||
- int speed2;
|
||||
+ if (*speed == hw->link_speed && *duplex == hw->duplex)
|
||||
+ return 0;
|
||||
+ err = alx_write_phy_reg(hw, ALX_MII_IER, 0);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+ err = alx_setup_speed_duplex(hw, alx_speed_to_ethadv(*speed, *duplex) |
|
||||
+ ADVERTISED_Autoneg, ALX_FC_ANEG |
|
||||
+ ALX_FC_RX | ALX_FC_TX);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
|
||||
- msleep(100);
|
||||
+ /* wait for linkup */
|
||||
+ for (i = 0; i < ALX_MAX_SETUP_LNK_CYCLE; i++) {
|
||||
+ msleep(100);
|
||||
|
||||
- err = alx_get_phy_link(hw, &speed2);
|
||||
- if (err < 0)
|
||||
- return err;
|
||||
- if (speed2 != SPEED_UNKNOWN)
|
||||
- break;
|
||||
- }
|
||||
- if (i == ALX_MAX_SETUP_LNK_CYCLE)
|
||||
- return -ETIMEDOUT;
|
||||
+ err = alx_read_phy_link(hw);
|
||||
+ if (err < 0)
|
||||
+ return err;
|
||||
+ if (hw->link_speed != SPEED_UNKNOWN)
|
||||
+ break;
|
||||
}
|
||||
+ if (i == ALX_MAX_SETUP_LNK_CYCLE)
|
||||
+ return -ETIMEDOUT;
|
||||
|
||||
return 0;
|
||||
}
|
||||
diff --git a/drivers/net/ethernet/atheros/alx/hw.h b/drivers/net/ethernet/atheros/alx/hw.h
|
||||
index 65e723d..a60e35c 100644
|
||||
--- a/drivers/net/ethernet/atheros/alx/hw.h
|
||||
+++ b/drivers/net/ethernet/atheros/alx/hw.h
|
||||
@@ -412,10 +412,11 @@ struct alx_hw {
|
||||
u32 smb_timer;
|
||||
/* SPEED_* + DUPLEX_*, SPEED_UNKNOWN if link is down */
|
||||
int link_speed;
|
||||
+ u8 duplex;
|
||||
|
||||
/* auto-neg advertisement or force mode config */
|
||||
- u32 adv_cfg;
|
||||
u8 flowctrl;
|
||||
+ u32 adv_cfg;
|
||||
|
||||
u32 sleep_ctrl;
|
||||
|
||||
@@ -478,12 +479,12 @@ void alx_reset_pcie(struct alx_hw *hw);
|
||||
void alx_enable_aspm(struct alx_hw *hw, bool l0s_en, bool l1_en);
|
||||
int alx_setup_speed_duplex(struct alx_hw *hw, u32 ethadv, u8 flowctrl);
|
||||
void alx_post_phy_link(struct alx_hw *hw);
|
||||
-int alx_pre_suspend(struct alx_hw *hw, int speed);
|
||||
+int alx_pre_suspend(struct alx_hw *hw, int speed, u8 duplex);
|
||||
int alx_read_phy_reg(struct alx_hw *hw, u16 reg, u16 *phy_data);
|
||||
int alx_write_phy_reg(struct alx_hw *hw, u16 reg, u16 phy_data);
|
||||
int alx_read_phy_ext(struct alx_hw *hw, u8 dev, u16 reg, u16 *pdata);
|
||||
int alx_write_phy_ext(struct alx_hw *hw, u8 dev, u16 reg, u16 data);
|
||||
-int alx_get_phy_link(struct alx_hw *hw, int *speed);
|
||||
+int alx_read_phy_link(struct alx_hw *hw);
|
||||
int alx_clear_phy_intr(struct alx_hw *hw);
|
||||
int alx_config_wol(struct alx_hw *hw);
|
||||
void alx_cfg_mac_flowcontrol(struct alx_hw *hw, u8 fc);
|
||||
@@ -493,7 +494,22 @@ void alx_set_macaddr(struct alx_hw *hw, const u8 *addr);
|
||||
bool alx_phy_configured(struct alx_hw *hw);
|
||||
void alx_configure_basic(struct alx_hw *hw);
|
||||
void alx_disable_rss(struct alx_hw *hw);
|
||||
-int alx_select_powersaving_speed(struct alx_hw *hw, int *speed);
|
||||
+int alx_select_powersaving_speed(struct alx_hw *hw, int *speed, u8 *duplex);
|
||||
bool alx_get_phy_info(struct alx_hw *hw);
|
||||
|
||||
+static inline u32 alx_speed_to_ethadv(int speed, u8 duplex)
|
||||
+{
|
||||
+ if (speed == SPEED_1000 && duplex == DUPLEX_FULL)
|
||||
+ return ADVERTISED_1000baseT_Full;
|
||||
+ if (speed == SPEED_100 && duplex == DUPLEX_FULL)
|
||||
+ return ADVERTISED_100baseT_Full;
|
||||
+ if (speed == SPEED_100 && duplex== DUPLEX_HALF)
|
||||
+ return ADVERTISED_100baseT_Half;
|
||||
+ if (speed == SPEED_10 && duplex == DUPLEX_FULL)
|
||||
+ return ADVERTISED_10baseT_Full;
|
||||
+ if (speed == SPEED_10 && duplex == DUPLEX_HALF)
|
||||
+ return ADVERTISED_10baseT_Half;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
#endif
|
||||
diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
|
||||
index 418de8b..148b4b9 100644
|
||||
--- a/drivers/net/ethernet/atheros/alx/main.c
|
||||
+++ b/drivers/net/ethernet/atheros/alx/main.c
|
||||
@@ -712,6 +712,7 @@ static int alx_init_sw(struct alx_priv *alx)
|
||||
hw->dma_chnl = hw->max_dma_chnl;
|
||||
hw->ith_tpd = alx->tx_ringsz / 3;
|
||||
hw->link_speed = SPEED_UNKNOWN;
|
||||
+ hw->duplex = DUPLEX_UNKNOWN;
|
||||
hw->adv_cfg = ADVERTISED_Autoneg |
|
||||
ADVERTISED_10baseT_Half |
|
||||
ADVERTISED_10baseT_Full |
|
||||
@@ -758,6 +759,7 @@ static void alx_halt(struct alx_priv *alx)
|
||||
|
||||
alx_netif_stop(alx);
|
||||
hw->link_speed = SPEED_UNKNOWN;
|
||||
+ hw->duplex = DUPLEX_UNKNOWN;
|
||||
|
||||
alx_reset_mac(hw);
|
||||
|
||||
@@ -869,18 +871,18 @@ static void __alx_stop(struct alx_priv *alx)
|
||||
alx_free_rings(alx);
|
||||
}
|
||||
|
||||
-static const char *alx_speed_desc(u16 speed)
|
||||
+static const char *alx_speed_desc(struct alx_hw *hw)
|
||||
{
|
||||
- switch (speed) {
|
||||
- case SPEED_1000 + DUPLEX_FULL:
|
||||
+ switch (alx_speed_to_ethadv(hw->link_speed, hw->duplex)) {
|
||||
+ case ADVERTISED_1000baseT_Full:
|
||||
return "1 Gbps Full";
|
||||
- case SPEED_100 + DUPLEX_FULL:
|
||||
+ case ADVERTISED_100baseT_Full:
|
||||
return "100 Mbps Full";
|
||||
- case SPEED_100 + DUPLEX_HALF:
|
||||
+ case ADVERTISED_100baseT_Half:
|
||||
return "100 Mbps Half";
|
||||
- case SPEED_10 + DUPLEX_FULL:
|
||||
+ case ADVERTISED_10baseT_Full:
|
||||
return "10 Mbps Full";
|
||||
- case SPEED_10 + DUPLEX_HALF:
|
||||
+ case ADVERTISED_10baseT_Half:
|
||||
return "10 Mbps Half";
|
||||
default:
|
||||
return "Unknown speed";
|
||||
@@ -891,7 +893,8 @@ static void alx_check_link(struct alx_priv *alx)
|
||||
{
|
||||
struct alx_hw *hw = &alx->hw;
|
||||
unsigned long flags;
|
||||
- int speed, old_speed;
|
||||
+ int old_speed;
|
||||
+ u8 old_duplex;
|
||||
int err;
|
||||
|
||||
/* clear PHY internal interrupt status, otherwise the main
|
||||
@@ -899,7 +902,9 @@ static void alx_check_link(struct alx_priv *alx)
|
||||
*/
|
||||
alx_clear_phy_intr(hw);
|
||||
|
||||
- err = alx_get_phy_link(hw, &speed);
|
||||
+ old_speed = hw->link_speed;
|
||||
+ old_duplex = hw->duplex;
|
||||
+ err = alx_read_phy_link(hw);
|
||||
if (err < 0)
|
||||
goto reset;
|
||||
|
||||
@@ -908,15 +913,12 @@ static void alx_check_link(struct alx_priv *alx)
|
||||
alx_write_mem32(hw, ALX_IMR, alx->int_mask);
|
||||
spin_unlock_irqrestore(&alx->irq_lock, flags);
|
||||
|
||||
- old_speed = hw->link_speed;
|
||||
-
|
||||
- if (old_speed == speed)
|
||||
+ if (old_speed == hw->link_speed)
|
||||
return;
|
||||
- hw->link_speed = speed;
|
||||
|
||||
- if (speed != SPEED_UNKNOWN) {
|
||||
+ if (hw->link_speed != SPEED_UNKNOWN) {
|
||||
netif_info(alx, link, alx->dev,
|
||||
- "NIC Up: %s\n", alx_speed_desc(speed));
|
||||
+ "NIC Up: %s\n", alx_speed_desc(hw));
|
||||
alx_post_phy_link(hw);
|
||||
alx_enable_aspm(hw, true, true);
|
||||
alx_start_mac(hw);
|
||||
@@ -965,6 +967,7 @@ static int __alx_shutdown(struct pci_dev *pdev, bool *wol_en)
|
||||
struct net_device *netdev = alx->dev;
|
||||
struct alx_hw *hw = &alx->hw;
|
||||
int err, speed;
|
||||
+ u8 duplex;
|
||||
|
||||
netif_device_detach(netdev);
|
||||
|
||||
@@ -977,13 +980,13 @@ static int __alx_shutdown(struct pci_dev *pdev, bool *wol_en)
|
||||
return err;
|
||||
#endif
|
||||
|
||||
- err = alx_select_powersaving_speed(hw, &speed);
|
||||
+ err = alx_select_powersaving_speed(hw, &speed, &duplex);
|
||||
if (err)
|
||||
return err;
|
||||
err = alx_clear_phy_intr(hw);
|
||||
if (err)
|
||||
return err;
|
||||
- err = alx_pre_suspend(hw, speed);
|
||||
+ err = alx_pre_suspend(hw, speed, duplex);
|
||||
if (err)
|
||||
return err;
|
||||
err = alx_config_wol(hw);
|
|
@ -1,33 +0,0 @@
|
|||
From: Johannes Berg <johannes@sipsolutions.net>
|
||||
Date: Sat, 29 Jun 2013 19:23:13 +0200
|
||||
Subject: [1/6] alx: treat flow control correctly in alx_set_pauseparam()
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git//commit?id=ef0cc4b1d296ce041e3b24d103177dd70642740c
|
||||
|
||||
Even when alx_setup_speed_duplex() is called, we still
|
||||
need to call alx_cfg_mac_flowcontrol() and set hw->flowctrl
|
||||
if flow control changed.
|
||||
|
||||
This was a bug I accidentally introduced while simplifying
|
||||
the original driver.
|
||||
|
||||
Reported-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/ethernet/atheros/alx/ethtool.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/atheros/alx/ethtool.c b/drivers/net/ethernet/atheros/alx/ethtool.c
|
||||
index 6fa2aec..50a91d0 100644
|
||||
--- a/drivers/net/ethernet/atheros/alx/ethtool.c
|
||||
+++ b/drivers/net/ethernet/atheros/alx/ethtool.c
|
||||
@@ -187,7 +187,8 @@ static int alx_set_pauseparam(struct net_device *netdev,
|
||||
|
||||
if (reconfig_phy) {
|
||||
err = alx_setup_speed_duplex(hw, hw->adv_cfg, fc);
|
||||
- return err;
|
||||
+ if (err)
|
||||
+ return err;
|
||||
}
|
||||
|
||||
/* flow control on mac */
|
|
@ -1,84 +0,0 @@
|
|||
From: Ben Hutchings <ben@decadent.org.uk>
|
||||
Date: Mon, 1 Jul 2013 00:13:27 +0100
|
||||
Subject: cassini: Make missing firmware non-fatal
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git//commit?id=15627e847e4356ebdd49e7c3f10a671819995be6
|
||||
|
||||
The firmware patch for the Saturn PHY fixes a bug, but is not absolutely
|
||||
essential. And its licence is unclear, so it is not included in all
|
||||
distributions. Just log an error message and continue if it is missing
|
||||
or invalid.
|
||||
|
||||
References: http://bugs.debian.org/712674
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
Tested-by: Jose Andres Arias Velichko <Andres.Arias@PaisLinux.net> (against 3.2)
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/ethernet/sun/cassini.c | 18 ++++++++----------
|
||||
1 file changed, 8 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c
|
||||
index 4c682a3..759441b 100644
|
||||
--- a/drivers/net/ethernet/sun/cassini.c
|
||||
+++ b/drivers/net/ethernet/sun/cassini.c
|
||||
@@ -808,44 +808,43 @@ static int cas_reset_mii_phy(struct cas *cp)
|
||||
return limit <= 0;
|
||||
}
|
||||
|
||||
-static int cas_saturn_firmware_init(struct cas *cp)
|
||||
+static void cas_saturn_firmware_init(struct cas *cp)
|
||||
{
|
||||
const struct firmware *fw;
|
||||
const char fw_name[] = "sun/cassini.bin";
|
||||
int err;
|
||||
|
||||
if (PHY_NS_DP83065 != cp->phy_id)
|
||||
- return 0;
|
||||
+ return;
|
||||
|
||||
err = request_firmware(&fw, fw_name, &cp->pdev->dev);
|
||||
if (err) {
|
||||
pr_err("Failed to load firmware \"%s\"\n",
|
||||
fw_name);
|
||||
- return err;
|
||||
+ return;
|
||||
}
|
||||
if (fw->size < 2) {
|
||||
pr_err("bogus length %zu in \"%s\"\n",
|
||||
fw->size, fw_name);
|
||||
- err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
cp->fw_load_addr= fw->data[1] << 8 | fw->data[0];
|
||||
cp->fw_size = fw->size - 2;
|
||||
cp->fw_data = vmalloc(cp->fw_size);
|
||||
- if (!cp->fw_data) {
|
||||
- err = -ENOMEM;
|
||||
+ if (!cp->fw_data)
|
||||
goto out;
|
||||
- }
|
||||
memcpy(cp->fw_data, &fw->data[2], cp->fw_size);
|
||||
out:
|
||||
release_firmware(fw);
|
||||
- return err;
|
||||
}
|
||||
|
||||
static void cas_saturn_firmware_load(struct cas *cp)
|
||||
{
|
||||
int i;
|
||||
|
||||
+ if (!cp->fw_data)
|
||||
+ return;
|
||||
+
|
||||
cas_phy_powerdown(cp);
|
||||
|
||||
/* expanded memory access mode */
|
||||
@@ -5083,8 +5082,7 @@ static int cas_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
if (cas_check_invariants(cp))
|
||||
goto err_out_iounmap;
|
||||
if (cp->cas_flags & CAS_FLAG_SATURN)
|
||||
- if (cas_saturn_firmware_init(cp))
|
||||
- goto err_out_iounmap;
|
||||
+ cas_saturn_firmware_init(cp);
|
||||
|
||||
cp->init_block = (struct cas_init_block *)
|
||||
pci_alloc_consistent(pdev, sizeof(struct cas_init_block),
|
|
@ -1,26 +0,0 @@
|
|||
From: Dan Carpenter <dan.carpenter@oracle.com>
|
||||
Date: Wed, 19 Jun 2013 10:05:29 +1000
|
||||
Subject: fanotify: info leak in copy_event_to_user()
|
||||
Origin: http://www.ozlabs.org/~akpm/mmotm/broken-out/fanotify-info-leak-in-copy_event_to_user.patch
|
||||
|
||||
The ->reserverd field isn't cleared so we leak one byte of stack
|
||||
information to userspace.
|
||||
|
||||
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
|
||||
Cc: Eric Paris <eparis@redhat.com>
|
||||
Cc: Al Viro <viro@zeniv.linux.org.uk>
|
||||
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
|
||||
---
|
||||
fs/notify/fanotify/fanotify_user.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/fs/notify/fanotify/fanotify_user.c
|
||||
+++ b/fs/notify/fanotify/fanotify_user.c
|
||||
@@ -121,6 +121,7 @@ static int fill_event_metadata(struct fs
|
||||
metadata->event_len = FAN_EVENT_METADATA_LEN;
|
||||
metadata->metadata_len = FAN_EVENT_METADATA_LEN;
|
||||
metadata->vers = FANOTIFY_METADATA_VERSION;
|
||||
+ metadata->reserved = 0;
|
||||
metadata->mask = event->mask & FAN_ALL_OUTGOING_EVENTS;
|
||||
metadata->pid = pid_vnr(event->tgid);
|
||||
if (unlikely(event->mask & FAN_Q_OVERFLOW))
|
|
@ -203,7 +203,7 @@ upstream submission.
|
|||
fw->size, fw_name);
|
||||
--- a/drivers/dma/imx-sdma.c
|
||||
+++ b/drivers/dma/imx-sdma.c
|
||||
@@ -1163,10 +1163,8 @@ static void sdma_load_firmware(const str
|
||||
@@ -1164,10 +1164,8 @@ static void sdma_load_firmware(const str
|
||||
const struct sdma_script_start_addrs *addr;
|
||||
unsigned short *ram_code;
|
||||
|
||||
|
@ -232,7 +232,7 @@ upstream submission.
|
|||
where = 0;
|
||||
--- a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
|
||||
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
|
||||
@@ -513,10 +513,8 @@ nvc0_graph_ctor_fw(struct nvc0_graph_pri
|
||||
@@ -1092,10 +1092,8 @@ nvc0_graph_ctor_fw(struct nvc0_graph_pri
|
||||
if (ret) {
|
||||
snprintf(f, sizeof(f), "nouveau/%s", fwname);
|
||||
ret = request_firmware(&fw, f, &device->pdev->dev);
|
||||
|
@ -261,9 +261,9 @@ upstream submission.
|
|||
printk(KERN_ERR
|
||||
--- a/drivers/gpu/drm/radeon/ni.c
|
||||
+++ b/drivers/gpu/drm/radeon/ni.c
|
||||
@@ -676,10 +676,6 @@ out:
|
||||
platform_device_unregister(pdev);
|
||||
@@ -806,10 +806,6 @@ int ni_init_microcode(struct radeon_devi
|
||||
|
||||
out:
|
||||
if (err) {
|
||||
- if (err != -EINVAL)
|
||||
- printk(KERN_ERR
|
||||
|
@ -274,10 +274,10 @@ upstream submission.
|
|||
release_firmware(rdev->me_fw);
|
||||
--- a/drivers/gpu/drm/radeon/r100.c
|
||||
+++ b/drivers/gpu/drm/radeon/r100.c
|
||||
@@ -1044,10 +1044,7 @@ static int r100_cp_init_microcode(struct
|
||||
@@ -1035,10 +1035,7 @@ static int r100_cp_init_microcode(struct
|
||||
}
|
||||
|
||||
err = request_firmware(&rdev->me_fw, fw_name, &pdev->dev);
|
||||
platform_device_unregister(pdev);
|
||||
err = request_firmware(&rdev->me_fw, fw_name, rdev->dev);
|
||||
- if (err) {
|
||||
- printk(KERN_ERR "radeon_cp: Failed to load firmware \"%s\"\n",
|
||||
- fw_name);
|
||||
|
@ -288,9 +288,9 @@ upstream submission.
|
|||
rdev->me_fw->size, fw_name);
|
||||
--- a/drivers/gpu/drm/radeon/r600.c
|
||||
+++ b/drivers/gpu/drm/radeon/r600.c
|
||||
@@ -2291,10 +2291,6 @@ out:
|
||||
platform_device_unregister(pdev);
|
||||
@@ -2311,10 +2311,6 @@ int r600_init_microcode(struct radeon_de
|
||||
|
||||
out:
|
||||
if (err) {
|
||||
- if (err != -EINVAL)
|
||||
- printk(KERN_ERR
|
||||
|
@ -534,15 +534,13 @@ upstream submission.
|
|||
if (state->microcode == NULL) {
|
||||
--- a/drivers/media/dvb-frontends/drxk_hard.c
|
||||
+++ b/drivers/media/dvb-frontends/drxk_hard.c
|
||||
@@ -6229,12 +6229,6 @@ static void load_firmware_cb(const struc
|
||||
@@ -6282,10 +6282,6 @@ static void load_firmware_cb(const struc
|
||||
|
||||
dprintk(1, ": %s\n", fw ? "firmware loaded" : "firmware not loaded");
|
||||
if (!fw) {
|
||||
- printk(KERN_ERR
|
||||
- "drxk: Could not load firmware file %s.\n",
|
||||
- pr_err("Could not load firmware file %s.\n",
|
||||
- state->microcode_name);
|
||||
- printk(KERN_INFO
|
||||
- "drxk: Copy %s to your hotplug directory!\n",
|
||||
- pr_info("Copy %s to your hotplug directory!\n",
|
||||
- state->microcode_name);
|
||||
state->microcode_name = NULL;
|
||||
|
||||
|
@ -736,7 +734,7 @@ upstream submission.
|
|||
|
||||
rc = request_firmware(&fw, fw_filename, coredev->device);
|
||||
- if (rc < 0) {
|
||||
- sms_info("failed to open \"%s\"", fw_filename);
|
||||
- sms_err("failed to open firmware file \"%s\"", fw_filename);
|
||||
+ if (rc)
|
||||
return rc;
|
||||
- }
|
||||
|
@ -825,7 +823,7 @@ upstream submission.
|
|||
packet_num = ptr[0];
|
||||
--- a/drivers/media/radio/wl128x/fmdrv_common.c
|
||||
+++ b/drivers/media/radio/wl128x/fmdrv_common.c
|
||||
@@ -1248,10 +1248,8 @@ static int fm_download_firmware(struct f
|
||||
@@ -1252,10 +1252,8 @@ static int fm_download_firmware(struct f
|
||||
|
||||
ret = request_firmware(&fw_entry, fw_name,
|
||||
&fmdev->radio_dev->dev);
|
||||
|
@ -839,7 +837,7 @@ upstream submission.
|
|||
fw_data = (void *)fw_entry->data;
|
||||
--- a/drivers/media/pci/bt8xx/bttv-cards.c
|
||||
+++ b/drivers/media/pci/bt8xx/bttv-cards.c
|
||||
@@ -3759,10 +3759,8 @@ static int pvr_boot(struct bttv *btv)
|
||||
@@ -3799,10 +3799,8 @@ static int pvr_boot(struct bttv *btv)
|
||||
int rc;
|
||||
|
||||
rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
|
||||
|
@ -1207,7 +1205,7 @@ upstream submission.
|
|||
fw_tx->size, FIRMWARE_TX);
|
||||
--- a/drivers/net/ethernet/alteon/acenic.c
|
||||
+++ b/drivers/net/ethernet/alteon/acenic.c
|
||||
@@ -2902,11 +2902,8 @@ static int ace_load_firmware(struct net_
|
||||
@@ -2889,11 +2889,8 @@ static int ace_load_firmware(struct net_
|
||||
fw_name = "acenic/tg1.bin";
|
||||
|
||||
ret = request_firmware(&fw, fw_name, &ap->pdev->dev);
|
||||
|
@ -1244,7 +1242,7 @@ upstream submission.
|
|||
if (bp->mips_firmware->size < sizeof(*mips_fw) ||
|
||||
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
|
||||
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
|
||||
@@ -12258,11 +12258,8 @@ static int bnx2x_init_firmware(struct bn
|
||||
@@ -12412,11 +12412,8 @@ static int bnx2x_init_firmware(struct bn
|
||||
BNX2X_DEV_INFO("Loading %s\n", fw_file_name);
|
||||
|
||||
rc = request_firmware(&bp->firmware, fw_file_name, &bp->pdev->dev);
|
||||
|
@ -1259,7 +1257,7 @@ upstream submission.
|
|||
if (rc) {
|
||||
--- a/drivers/net/ethernet/broadcom/tg3.c
|
||||
+++ b/drivers/net/ethernet/broadcom/tg3.c
|
||||
@@ -11016,11 +11016,8 @@ static int tg3_request_firmware(struct t
|
||||
@@ -11123,11 +11123,8 @@ static int tg3_request_firmware(struct t
|
||||
{
|
||||
const struct tg3_firmware_hdr *fw_hdr;
|
||||
|
||||
|
@ -1467,7 +1465,7 @@ upstream submission.
|
|||
fwh = (struct at76_fw_header *)(fwe->fw->data);
|
||||
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
|
||||
@@ -1092,12 +1092,8 @@ static void ath9k_hif_usb_firmware_cb(co
|
||||
@@ -1098,12 +1098,8 @@ static void ath9k_hif_usb_firmware_cb(co
|
||||
struct hif_device_usb *hif_dev = context;
|
||||
int ret;
|
||||
|
||||
|
@ -1509,7 +1507,7 @@ upstream submission.
|
|||
int success = 0;
|
||||
--- a/drivers/net/wireless/b43/main.c
|
||||
+++ b/drivers/net/wireless/b43/main.c
|
||||
@@ -2158,19 +2158,8 @@ int b43_do_request_fw(struct b43_request
|
||||
@@ -2160,19 +2160,8 @@ int b43_do_request_fw(struct b43_request
|
||||
}
|
||||
err = request_firmware(&ctx->blob, ctx->fwname,
|
||||
ctx->dev->dev->dev);
|
||||
|
@ -1547,7 +1545,7 @@ upstream submission.
|
|||
hdr = (struct b43legacy_fw_header *)((*fw)->data);
|
||||
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
|
||||
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
|
||||
@@ -3037,10 +3037,8 @@ static int brcmf_sdbrcm_download_code_fi
|
||||
@@ -2959,10 +2959,8 @@ static int brcmf_sdbrcm_download_code_fi
|
||||
|
||||
ret = request_firmware(&bus->firmware, BRCMF_SDIO_FW_NAME,
|
||||
&bus->sdiodev->func[2]->dev);
|
||||
|
@ -1559,7 +1557,7 @@ upstream submission.
|
|||
bus->fw_ptr = 0;
|
||||
|
||||
memptr = memblock = kmalloc(MEMBLOCK + BRCMF_SDALIGN, GFP_ATOMIC);
|
||||
@@ -3159,10 +3157,8 @@ static int brcmf_sdbrcm_download_nvram(s
|
||||
@@ -3081,10 +3079,8 @@ static int brcmf_sdbrcm_download_nvram(s
|
||||
|
||||
ret = request_firmware(&bus->firmware, BRCMF_SDIO_NV_NAME,
|
||||
&bus->sdiodev->func[2]->dev);
|
||||
|
@ -1597,7 +1595,7 @@ upstream submission.
|
|||
}
|
||||
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
|
||||
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
|
||||
@@ -8428,12 +8428,8 @@ static int ipw2100_get_firmware(struct i
|
||||
@@ -8426,12 +8426,8 @@ static int ipw2100_get_firmware(struct i
|
||||
|
||||
rc = request_firmware(&fw->fw_entry, fw_name, &priv->pci_dev->dev);
|
||||
|
||||
|
@ -1665,7 +1663,7 @@ upstream submission.
|
|||
}
|
||||
--- a/drivers/net/wireless/mwifiex/main.c
|
||||
+++ b/drivers/net/wireless/mwifiex/main.c
|
||||
@@ -316,11 +316,8 @@ static void mwifiex_fw_dpc(const struct
|
||||
@@ -400,11 +400,8 @@ static void mwifiex_fw_dpc(const struct
|
||||
struct mwifiex_adapter *adapter = context;
|
||||
struct mwifiex_fw_image fw;
|
||||
|
||||
|
@ -1680,7 +1678,7 @@ upstream submission.
|
|||
adapter->firmware = firmware;
|
||||
--- a/drivers/net/wireless/mwl8k.c
|
||||
+++ b/drivers/net/wireless/mwl8k.c
|
||||
@@ -5524,16 +5524,12 @@ static int mwl8k_firmware_load_success(s
|
||||
@@ -5531,16 +5531,12 @@ static int mwl8k_firmware_load_success(s
|
||||
static void mwl8k_fw_state_machine(const struct firmware *fw, void *context)
|
||||
{
|
||||
struct mwl8k_priv *priv = context;
|
||||
|
@ -1698,7 +1696,7 @@ upstream submission.
|
|||
priv->fw_helper = fw;
|
||||
rc = mwl8k_request_fw(priv, priv->fw_pref, &priv->fw_ucode,
|
||||
true);
|
||||
@@ -5568,11 +5564,8 @@ static void mwl8k_fw_state_machine(const
|
||||
@@ -5575,11 +5571,8 @@ static void mwl8k_fw_state_machine(const
|
||||
break;
|
||||
|
||||
case FW_STATE_LOADING_ALT:
|
||||
|
@ -1711,7 +1709,7 @@ upstream submission.
|
|||
priv->fw_ucode = fw;
|
||||
rc = mwl8k_firmware_load_success(priv);
|
||||
if (rc)
|
||||
@@ -5610,10 +5603,8 @@ retry:
|
||||
@@ -5617,10 +5610,8 @@ retry:
|
||||
|
||||
/* Ask userland hotplug daemon for the device firmware */
|
||||
rc = mwl8k_request_firmware(priv, fw_image, nowait);
|
||||
|
@ -1759,7 +1757,7 @@ upstream submission.
|
|||
|
||||
--- a/drivers/net/wireless/orinoco/orinoco_usb.c
|
||||
+++ b/drivers/net/wireless/orinoco/orinoco_usb.c
|
||||
@@ -1690,7 +1690,6 @@ static int ezusb_probe(struct usb_interf
|
||||
@@ -1691,7 +1691,6 @@ static int ezusb_probe(struct usb_interf
|
||||
if (ezusb_firmware_download(upriv, &firmware))
|
||||
goto error;
|
||||
} else {
|
||||
|
@ -1779,7 +1777,7 @@ upstream submission.
|
|||
}
|
||||
--- a/drivers/net/wireless/p54/p54spi.c
|
||||
+++ b/drivers/net/wireless/p54/p54spi.c
|
||||
@@ -171,10 +171,8 @@ static int p54spi_request_firmware(struc
|
||||
@@ -170,10 +170,8 @@ static int p54spi_request_firmware(struc
|
||||
/* FIXME: should driver use it's own struct device? */
|
||||
ret = request_firmware(&priv->firmware, "3826.arm", &priv->spi->dev);
|
||||
|
||||
|
@ -1880,7 +1878,7 @@ upstream submission.
|
|||
wl1251_error("nvs size is not multiple of 32 bits: %zu",
|
||||
--- a/drivers/net/wireless/ti/wlcore/main.c
|
||||
+++ b/drivers/net/wireless/ti/wlcore/main.c
|
||||
@@ -753,10 +753,8 @@ static int wl12xx_fetch_firmware(struct
|
||||
@@ -740,10 +740,8 @@ static int wl12xx_fetch_firmware(struct
|
||||
|
||||
ret = request_firmware(&fw, fw_name, wl->dev);
|
||||
|
||||
|
@ -1989,7 +1987,7 @@ upstream submission.
|
|||
if (err) {
|
||||
--- a/drivers/scsi/bfa/bfad.c
|
||||
+++ b/drivers/scsi/bfa/bfad.c
|
||||
@@ -1803,7 +1803,6 @@ bfad_read_firmware(struct pci_dev *pdev,
|
||||
@@ -1811,7 +1811,6 @@ bfad_read_firmware(struct pci_dev *pdev,
|
||||
const struct firmware *fw;
|
||||
|
||||
if (request_firmware(&fw, fw_name, &pdev->dev)) {
|
||||
|
@ -1999,7 +1997,7 @@ upstream submission.
|
|||
}
|
||||
--- a/drivers/scsi/ipr.c
|
||||
+++ b/drivers/scsi/ipr.c
|
||||
@@ -3907,10 +3907,8 @@ static ssize_t ipr_store_update_fw(struc
|
||||
@@ -3945,10 +3945,8 @@ static ssize_t ipr_store_update_fw(struc
|
||||
len = snprintf(fname, 99, "%s", buf);
|
||||
fname[len-1] = '\0';
|
||||
|
||||
|
@ -2036,7 +2034,7 @@ upstream submission.
|
|||
}
|
||||
--- a/drivers/scsi/qla2xxx/qla_init.c
|
||||
+++ b/drivers/scsi/qla2xxx/qla_init.c
|
||||
@@ -5134,8 +5134,6 @@ qla2x00_load_risc(scsi_qla_host_t *vha,
|
||||
@@ -5126,8 +5126,6 @@ qla2x00_load_risc(scsi_qla_host_t *vha,
|
||||
/* Load firmware blob. */
|
||||
blob = qla2x00_request_firmware(vha);
|
||||
if (!blob) {
|
||||
|
@ -2045,7 +2043,7 @@ upstream submission.
|
|||
ql_log(ql_log_info, vha, 0x0084,
|
||||
"Firmware images can be retrieved from: "QLA_FW_URL ".\n");
|
||||
return QLA_FUNCTION_FAILED;
|
||||
@@ -5236,8 +5234,6 @@ qla24xx_load_risc_blob(scsi_qla_host_t *
|
||||
@@ -5228,8 +5226,6 @@ qla24xx_load_risc_blob(scsi_qla_host_t *
|
||||
/* Load firmware blob. */
|
||||
blob = qla2x00_request_firmware(vha);
|
||||
if (!blob) {
|
||||
|
@ -2056,7 +2054,7 @@ upstream submission.
|
|||
QLA_FW_URL ".\n");
|
||||
--- a/drivers/scsi/qla2xxx/qla_nx.c
|
||||
+++ b/drivers/scsi/qla2xxx/qla_nx.c
|
||||
@@ -2447,11 +2447,8 @@ try_blob_fw:
|
||||
@@ -2441,11 +2441,8 @@ try_blob_fw:
|
||||
|
||||
/* Load firmware blob. */
|
||||
blob = ha->hablob = qla2x00_request_firmware(vha);
|
||||
|
@ -2071,7 +2069,7 @@ upstream submission.
|
|||
if (qla82xx_validate_firmware_blob(vha,
|
||||
--- a/drivers/scsi/qla2xxx/qla_os.c
|
||||
+++ b/drivers/scsi/qla2xxx/qla_os.c
|
||||
@@ -5204,8 +5204,6 @@ qla2x00_request_firmware(scsi_qla_host_t
|
||||
@@ -5200,8 +5200,6 @@ qla2x00_request_firmware(scsi_qla_host_t
|
||||
goto out;
|
||||
|
||||
if (request_firmware(&blob->fw, blob->name, &ha->pdev->dev)) {
|
||||
|
@ -2095,36 +2093,6 @@ upstream submission.
|
|||
if (fw->size % 2) {
|
||||
printk(KERN_ERR "Bogus length %zu in image \"%s\"\n",
|
||||
fw->size, fwname);
|
||||
--- a/drivers/staging/comedi/drivers/usbdux.c
|
||||
+++ b/drivers/staging/comedi/drivers/usbdux.c
|
||||
@@ -2376,11 +2376,8 @@ static void usbdux_firmware_request_comp
|
||||
struct usb_interface *uinterf = usbduxsub_tmp->interface;
|
||||
int ret;
|
||||
|
||||
- if (fw == NULL) {
|
||||
- dev_err(&uinterf->dev,
|
||||
- "Firmware complete handler without firmware!\n");
|
||||
+ if (fw == NULL)
|
||||
return;
|
||||
- }
|
||||
|
||||
/*
|
||||
* we need to upload the firmware here because fw will be
|
||||
--- a/drivers/staging/comedi/drivers/usbduxsigma.c
|
||||
+++ b/drivers/staging/comedi/drivers/usbduxsigma.c
|
||||
@@ -2358,11 +2358,8 @@ static void usbdux_firmware_request_comp
|
||||
struct usb_interface *uinterf = usbduxsub_tmp->interface;
|
||||
int ret;
|
||||
|
||||
- if (fw == NULL) {
|
||||
- dev_err(&uinterf->dev,
|
||||
- "Firmware complete handler without firmware!\n");
|
||||
+ if (fw == NULL)
|
||||
return;
|
||||
- }
|
||||
|
||||
/*
|
||||
* we need to upload the firmware here because fw will be
|
||||
--- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
|
||||
+++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
|
||||
@@ -2203,16 +2203,12 @@ struct net_device *init_ft1000_card(stru
|
||||
|
@ -2148,7 +2116,7 @@ upstream submission.
|
|||
ft1000_enable_interrupts(dev);
|
||||
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
|
||||
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
|
||||
@@ -134,10 +134,8 @@ static int ft1000_probe(struct usb_inter
|
||||
@@ -138,10 +138,8 @@ static int ft1000_probe(struct usb_inter
|
||||
ft1000dev->bulk_out_endpointAddr);
|
||||
|
||||
ret = request_firmware(&dsp_fw, "ft3000.img", &dev->dev);
|
||||
|
@ -2261,15 +2229,15 @@ upstream submission.
|
|||
+++ b/drivers/staging/rtl8192u/r819xU_firmware.c
|
||||
@@ -284,10 +284,8 @@ bool init_firmware(struct net_device *de
|
||||
*/
|
||||
if(rst_opt == OPT_SYSTEM_RESET) {
|
||||
if (rst_opt == OPT_SYSTEM_RESET) {
|
||||
rc = request_firmware(&fw_entry, fw_name[init_step],&priv->udev->dev);
|
||||
- if(rc < 0 ) {
|
||||
- if (rc < 0 ) {
|
||||
- RT_TRACE(COMP_ERR, "request firmware fail!\n");
|
||||
+ if (rc)
|
||||
goto download_firmware_fail;
|
||||
- }
|
||||
|
||||
if(fw_entry->size > sizeof(pfirmware->firmware_buf)) {
|
||||
if (fw_entry->size > sizeof(pfirmware->firmware_buf)) {
|
||||
RT_TRACE(COMP_ERR, "img file size exceed the container buffer fail!\n");
|
||||
--- a/drivers/staging/rtl8712/hal_init.c
|
||||
+++ b/drivers/staging/rtl8712/hal_init.c
|
||||
|
@ -2743,7 +2711,7 @@ upstream submission.
|
|||
}
|
||||
--- a/sound/pci/hda/hda_intel.c
|
||||
+++ b/sound/pci/hda/hda_intel.c
|
||||
@@ -3664,11 +3664,8 @@ static void azx_firmware_cb(const struct
|
||||
@@ -3718,11 +3718,8 @@ static void azx_firmware_cb(const struct
|
||||
struct azx *chip = card->private_data;
|
||||
struct pci_dev *pci = chip->pci;
|
||||
|
||||
|
|
|
@ -20,13 +20,14 @@ removed in later patches.
|
|||
|
||||
--- a/drivers/base/firmware_class.c
|
||||
+++ b/drivers/base/firmware_class.c
|
||||
@@ -619,14 +619,23 @@ static ssize_t firmware_loading_store(st
|
||||
@@ -636,15 +636,24 @@ static ssize_t firmware_loading_store(st
|
||||
* is completed.
|
||||
* */
|
||||
fw_map_pages_buf(fw_buf);
|
||||
+ if (!fw_buf->data)
|
||||
+ dev_err(dev->parent, "%s: vmap() failed\n",
|
||||
+ __func__);
|
||||
list_del_init(&fw_buf->pending_list);
|
||||
complete_all(&fw_buf->completion);
|
||||
break;
|
||||
}
|
||||
|
@ -46,7 +47,7 @@ removed in later patches.
|
|||
fw_load_abort(fw_priv);
|
||||
break;
|
||||
}
|
||||
@@ -792,6 +801,9 @@ static void firmware_class_timeout_work(
|
||||
@@ -810,6 +819,9 @@ static void firmware_class_timeout_work(
|
||||
struct firmware_priv, timeout_work.work);
|
||||
|
||||
mutex_lock(&fw_lock);
|
||||
|
@ -56,7 +57,7 @@ removed in later patches.
|
|||
fw_load_abort(fw_priv);
|
||||
mutex_unlock(&fw_lock);
|
||||
}
|
||||
@@ -843,25 +855,28 @@ static int _request_firmware_load(struct
|
||||
@@ -858,26 +870,29 @@ static int _request_firmware_load(struct
|
||||
|
||||
retval = device_add(f_dev);
|
||||
if (retval) {
|
||||
|
@ -83,13 +84,14 @@ removed in later patches.
|
|||
}
|
||||
|
||||
if (uevent) {
|
||||
buf->need_uevent = true;
|
||||
dev_set_uevent_suppress(f_dev, false);
|
||||
- dev_dbg(f_dev, "firmware: requesting %s\n", buf->fw_id);
|
||||
+ dev_dbg(f_dev->parent, "firmware: requesting %s\n", buf->fw_id);
|
||||
if (timeout != MAX_SCHEDULE_TIMEOUT)
|
||||
schedule_delayed_work(&fw_priv->timeout_work, timeout);
|
||||
|
||||
@@ -949,7 +964,8 @@ _request_firmware_prepare(struct firmwar
|
||||
@@ -990,7 +1005,8 @@ _request_firmware_prepare(struct firmwar
|
||||
}
|
||||
|
||||
if (fw_get_builtin_firmware(firmware, name)) {
|
||||
|
@ -99,7 +101,7 @@ removed in later patches.
|
|||
return 0; /* assigned */
|
||||
}
|
||||
|
||||
@@ -979,9 +995,16 @@ static int assign_firmware_buf(struct fi
|
||||
@@ -1021,9 +1037,16 @@ static int assign_firmware_buf(struct fi
|
||||
struct firmware_buf *buf = fw->priv;
|
||||
|
||||
mutex_lock(&fw_lock);
|
||||
|
@ -117,7 +119,7 @@ removed in later patches.
|
|||
}
|
||||
|
||||
/*
|
||||
@@ -1030,7 +1053,7 @@ _request_firmware(const struct firmware
|
||||
@@ -1072,7 +1095,7 @@ _request_firmware(const struct firmware
|
||||
if (nowait) {
|
||||
timeout = usermodehelper_read_lock_wait(timeout);
|
||||
if (!timeout) {
|
||||
|
@ -126,7 +128,7 @@ removed in later patches.
|
|||
name);
|
||||
ret = -EBUSY;
|
||||
goto out;
|
||||
@@ -1056,6 +1079,9 @@ _request_firmware(const struct firmware
|
||||
@@ -1100,6 +1123,9 @@ _request_firmware(const struct firmware
|
||||
if (ret < 0) {
|
||||
release_firmware(fw);
|
||||
fw = NULL;
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no>
|
||||
Date: Wed, 21 Nov 2012 09:54:48 +0100
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Subject: [PATCH] megaraid_sas: fix memory leak if SGL has zero length entries
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Forwarded: http://thread.gmane.org/gmane.linux.scsi/78850
|
||||
|
||||
commit 98cb7e44 ([SCSI] megaraid_sas: Sanity check user
|
||||
supplied length before passing it to dma_alloc_coherent())
|
||||
introduced a memory leak. Memory allocated for entries
|
||||
following zero length SGL entries will not be freed.
|
||||
|
||||
Reference: http://bugs.debian.org/688198
|
||||
Cc: <stable@vger.kernel.org>
|
||||
Signed-off-by: Bjørn Mork <bjorn@mork.no>
|
||||
Acked-by: Adam Radford <aradford@gmail.com>
|
||||
---
|
||||
drivers/scsi/megaraid/megaraid_sas_base.c | 10 ++++++----
|
||||
1 file changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
|
||||
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
|
||||
@@ -4886,10 +4886,12 @@ megasas_mgmt_fw_ioctl(struct megasas_ins
|
||||
sense, sense_handle);
|
||||
}
|
||||
|
||||
- for (i = 0; i < ioc->sge_count && kbuff_arr[i]; i++) {
|
||||
- dma_free_coherent(&instance->pdev->dev,
|
||||
- kern_sge32[i].length,
|
||||
- kbuff_arr[i], kern_sge32[i].phys_addr);
|
||||
+ for (i = 0; i < ioc->sge_count; i++) {
|
||||
+ if (kbuff_arr[i])
|
||||
+ dma_free_coherent(&instance->pdev->dev,
|
||||
+ kern_sge32[i].length,
|
||||
+ kbuff_arr[i],
|
||||
+ kern_sge32[i].phys_addr);
|
||||
}
|
||||
|
||||
megasas_return_cmd(instance, cmd);
|
|
@ -1,25 +0,0 @@
|
|||
From: "Arnaud Patard \\(Rtp\\)" <arnaud.patard@rtp-net.org>
|
||||
Date: Thu, 20 Jun 2013 23:07:06 +0200
|
||||
Subject: i2c: imx: allow autoloading on dt ids
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/wsa/linux.git/commit?id=2f641a8bdb1b808b9bf1d0ca7d169d199aaf6ff4
|
||||
|
||||
Allow udev to autoload the module when booting with device-tree
|
||||
|
||||
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
|
||||
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
|
||||
---
|
||||
drivers/i2c/busses/i2c-imx.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
|
||||
index 6406aa9..e242797 100644
|
||||
--- a/drivers/i2c/busses/i2c-imx.c
|
||||
+++ b/drivers/i2c/busses/i2c-imx.c
|
||||
@@ -147,6 +147,7 @@ static const struct of_device_id i2c_imx_dt_ids[] = {
|
||||
{ .compatible = "fsl,imx21-i2c", .data = &imx_i2c_devtype[IMX21_I2C], },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
+MODULE_DEVICE_TABLE(of, i2c_imx_dt_ids);
|
||||
|
||||
static inline int is_imx1_i2c(struct imx_i2c_struct *i2c_imx)
|
||||
{
|
|
@ -1,32 +0,0 @@
|
|||
From: Arnaud Patard <arnaud.patard@rtp-net.org>
|
||||
Subject: imx-sgtl5000: return E_PROBE_DEFER if ssi/codec not found
|
||||
Forwarded: http://thread.gmane.org/gmane.linux.alsa.devel/109469
|
||||
|
||||
If the ssi or codec drivers are not loaded (for instance, because spi or i2c
|
||||
bus drivers are not loaded), returning -EINVAL will for people to unload and
|
||||
then reload the module to get sound working. Returning E_PROBE_DEFER will
|
||||
mitigate this.
|
||||
|
||||
[ not sure if upstream will like that ]
|
||||
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
|
||||
|
||||
Index: linux/sound/soc/fsl/imx-sgtl5000.c
|
||||
===================================================================
|
||||
--- linux.orig/sound/soc/fsl/imx-sgtl5000.c 2013-05-16 09:33:01.000000000 +0200
|
||||
+++ linux/sound/soc/fsl/imx-sgtl5000.c 2013-05-16 09:35:14.000000000 +0200
|
||||
@@ -113,13 +113,13 @@ static int imx_sgtl5000_probe(struct pla
|
||||
ssi_pdev = of_find_device_by_node(ssi_np);
|
||||
if (!ssi_pdev) {
|
||||
dev_err(&pdev->dev, "failed to find SSI platform device\n");
|
||||
- ret = -EINVAL;
|
||||
+ ret = -EPROBE_DEFER;
|
||||
goto fail;
|
||||
}
|
||||
codec_dev = of_find_i2c_device_by_node(codec_np);
|
||||
if (!codec_dev) {
|
||||
dev_err(&pdev->dev, "failed to find codec platform device\n");
|
||||
- return -EINVAL;
|
||||
+ return -EPROBE_DEFER;
|
||||
}
|
||||
|
||||
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
|
|
@ -10,9 +10,9 @@ Forwarded: http://thread.gmane.org/gmane.linux.network/273997
|
|||
|
||||
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
|
||||
|
||||
--- a/drivers/net/ethernet/marvell/mvneta.c 2013-04-14 22:17:41.073749379 +0200
|
||||
+++ b/drivers/net/ethernet/marvell/mvneta.c 2013-04-14 23:22:16.033578898 +0200
|
||||
@@ -89,6 +89,8 @@
|
||||
--- a/drivers/net/ethernet/marvell/mvneta.c
|
||||
+++ b/drivers/net/ethernet/marvell/mvneta.c
|
||||
@@ -88,6 +88,8 @@
|
||||
#define MVNETA_TX_IN_PRGRS BIT(1)
|
||||
#define MVNETA_TX_FIFO_EMPTY BIT(8)
|
||||
#define MVNETA_RX_MIN_FRAME_SIZE 0x247c
|
||||
|
@ -21,7 +21,7 @@ Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
|
|||
#define MVNETA_TYPE_PRIO 0x24bc
|
||||
#define MVNETA_FORCE_UNI BIT(21)
|
||||
#define MVNETA_TXQ_CMD_1 0x24e4
|
||||
@@ -657,6 +659,9 @@ static void mvneta_port_sgmii_config(str
|
||||
@@ -655,6 +657,9 @@ static void mvneta_port_sgmii_config(str
|
||||
val = mvreg_read(pp, MVNETA_GMAC_CTRL_2);
|
||||
val |= MVNETA_GMAC2_PSC_ENABLE;
|
||||
mvreg_write(pp, MVNETA_GMAC_CTRL_2, val);
|
||||
|
@ -31,7 +31,7 @@ Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
|
|||
}
|
||||
|
||||
/* Start the Ethernet port RX and TX activity */
|
||||
@@ -2729,20 +2734,10 @@ static int mvneta_probe(struct platform_
|
||||
@@ -2728,20 +2733,10 @@ static int mvneta_probe(struct platform_
|
||||
|
||||
pp = netdev_priv(dev);
|
||||
|
||||
|
@ -52,9 +52,9 @@ Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
|
|||
pp->clk = devm_clk_get(&pdev->dev, NULL);
|
||||
if (IS_ERR(pp->clk)) {
|
||||
err = PTR_ERR(pp->clk);
|
||||
@@ -2751,7 +2746,16 @@ static int mvneta_probe(struct platform_
|
||||
|
||||
clk_prepare_enable(pp->clk);
|
||||
@@ -2765,7 +2760,16 @@ static int mvneta_probe(struct platform_
|
||||
}
|
||||
}
|
||||
|
||||
+ pp->base = of_iomap(dn, 0);
|
||||
+ if (pp->base == NULL) {
|
||||
|
|
|
@ -12,9 +12,9 @@ Removing the choice entry make things work.
|
|||
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
|
||||
--- a/drivers/usb/musb/Kconfig
|
||||
+++ b/drivers/usb/musb/Kconfig
|
||||
@@ -27,9 +27,6 @@ config USB_MUSB_HDRC
|
||||
@@ -56,9 +56,6 @@ config USB_MUSB_DUAL_ROLE
|
||||
|
||||
if USB_MUSB_HDRC
|
||||
endchoice
|
||||
|
||||
-choice
|
||||
- prompt "Platform Glue Layer"
|
||||
|
@ -22,7 +22,7 @@ Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
|
|||
config USB_MUSB_DAVINCI
|
||||
tristate "DaVinci"
|
||||
depends on ARCH_DAVINCI_DMx
|
||||
@@ -62,8 +59,6 @@ config USB_MUSB_BLACKFIN
|
||||
@@ -91,8 +88,6 @@ config USB_MUSB_BLACKFIN
|
||||
config USB_MUSB_UX500
|
||||
tristate "U8500 and U5500"
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
struct stat tmpstat;
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
@@ -666,16 +686,18 @@ int main(int ac, char **av)
|
||||
@@ -668,16 +688,18 @@ int main(int ac, char **av)
|
||||
input_mode = silentoldconfig;
|
||||
/* fall through */
|
||||
case oldconfig:
|
||||
|
@ -120,8 +120,8 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
int conf_write(const char *name)
|
||||
{
|
||||
FILE *out;
|
||||
@@ -1153,7 +1161,10 @@ void conf_set_all_new_symbols(enum conf_
|
||||
}
|
||||
@@ -1159,7 +1167,10 @@ bool conf_set_all_new_symbols(enum conf_
|
||||
bool has_changed = false;
|
||||
|
||||
for_all_symbols(i, sym) {
|
||||
- if (sym_has_value(sym) || (sym->flags & SYMBOL_VALID))
|
||||
|
@ -134,9 +134,9 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
case S_BOOLEAN:
|
||||
--- a/scripts/kconfig/expr.h
|
||||
+++ b/scripts/kconfig/expr.h
|
||||
@@ -106,6 +106,8 @@ struct symbol {
|
||||
#define SYMBOL_DEF3 0x40000 /* symbol.def[S_DEF_3] is valid */
|
||||
#define SYMBOL_DEF4 0x80000 /* symbol.def[S_DEF_4] is valid */
|
||||
@@ -109,6 +109,8 @@ struct symbol {
|
||||
/* choice values need to be set before calculating this symbol value */
|
||||
#define SYMBOL_NEED_SET_CHOICE_VALUES 0x100000
|
||||
|
||||
+#define SYMBOL_NEW 0x100000 /* symbol is new (loaded config did not provide a value) */
|
||||
+
|
||||
|
|
|
@ -19,7 +19,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
|
||||
--- a/Documentation/kernel-parameters.txt
|
||||
+++ b/Documentation/kernel-parameters.txt
|
||||
@@ -449,8 +449,8 @@ bytes respectively. Such letter suffixes
|
||||
@@ -458,8 +458,8 @@ bytes respectively. Such letter suffixes
|
||||
ccw_timeout_log [S390]
|
||||
See Documentation/s390/CommonIO for details.
|
||||
|
||||
|
@ -32,7 +32,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
checkreqprot [SELINUX] Set initial checkreqprot flag value.
|
||||
--- a/init/Kconfig
|
||||
+++ b/init/Kconfig
|
||||
@@ -845,6 +845,14 @@ config MEMCG
|
||||
@@ -930,6 +930,14 @@ config MEMCG
|
||||
This config option also selects MM_OWNER config option, which
|
||||
could in turn add some fork/exit overhead.
|
||||
|
||||
|
@ -49,18 +49,18 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
depends on MEMCG && SWAP
|
||||
--- a/kernel/cgroup.c
|
||||
+++ b/kernel/cgroup.c
|
||||
@@ -5193,7 +5193,7 @@ static void cgroup_release_agent(struct
|
||||
@@ -5293,7 +5293,7 @@ static void cgroup_release_agent(struct
|
||||
mutex_unlock(&cgroup_mutex);
|
||||
}
|
||||
|
||||
-static int __init cgroup_disable(char *str)
|
||||
+static int __init cgroup_set_disabled(char *str, int value)
|
||||
{
|
||||
int i;
|
||||
struct cgroup_subsys *ss;
|
||||
char *token;
|
||||
@@ -5213,17 +5213,29 @@ static int __init cgroup_disable(char *s
|
||||
continue;
|
||||
|
||||
@@ -5309,17 +5309,29 @@ static int __init cgroup_disable(char *s
|
||||
*/
|
||||
for_each_builtin_subsys(ss, i) {
|
||||
if (!strcmp(token, ss->name)) {
|
||||
- ss->disabled = 1;
|
||||
- printk(KERN_INFO "Disabling %s control group"
|
||||
|
@ -93,7 +93,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
*/
|
||||
--- a/mm/memcontrol.c
|
||||
+++ b/mm/memcontrol.c
|
||||
@@ -6789,6 +6789,9 @@ static void mem_cgroup_move_task(struct
|
||||
@@ -6951,6 +6951,9 @@ static void mem_cgroup_bind(struct cgrou
|
||||
|
||||
struct cgroup_subsys mem_cgroup_subsys = {
|
||||
.name = "memory",
|
||||
|
|
|
@ -17,11 +17,9 @@ SysRq mask (sysctl: kernel.sysrq).
|
|||
|
||||
/* Possible values of bitmask for enabling sysrq functions */
|
||||
/* 0x0001 is reserved for enable everything */
|
||||
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
|
||||
index 234ceb1..415a834 100644
|
||||
--- a/lib/Kconfig.debug
|
||||
+++ b/lib/Kconfig.debug
|
||||
@@ -50,6 +50,14 @@ config MAGIC_SYSRQ
|
||||
@@ -312,6 +312,14 @@ config MAGIC_SYSRQ
|
||||
keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
|
||||
unless you really know what this hack does.
|
||||
|
||||
|
@ -33,6 +31,6 @@ index 234ceb1..415a834 100644
|
|||
+ Specifies the default mask for the allowed SysRq keys. This can be
|
||||
+ used to disable several sensitive keys by default.
|
||||
+
|
||||
config STRIP_ASM_SYMS
|
||||
bool "Strip assembler-generated symbols during link"
|
||||
default n
|
||||
config DEBUG_KERNEL
|
||||
bool "Kernel debugging"
|
||||
help
|
||||
|
|
|
@ -41,14 +41,14 @@ Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
|
|||
#endif /* _ASM_X86_MICROCODE_H */
|
||||
--- a/arch/x86/kernel/Makefile
|
||||
+++ b/arch/x86/kernel/Makefile
|
||||
@@ -93,6 +93,7 @@ obj-$(CONFIG_MICROCODE_INTEL_LIB) += mic
|
||||
@@ -95,6 +95,7 @@ obj-$(CONFIG_MICROCODE_INTEL_LIB) += mic
|
||||
microcode-y := microcode_core.o
|
||||
microcode-$(CONFIG_MICROCODE_INTEL) += microcode_intel.o
|
||||
microcode-$(CONFIG_MICROCODE_AMD) += microcode_amd.o
|
||||
+microcode-$(CONFIG_MICROCODE_XEN) += microcode_xen.o
|
||||
obj-$(CONFIG_MICROCODE_AMD_EARLY) += microcode_amd_early.o
|
||||
obj-$(CONFIG_MICROCODE) += microcode.o
|
||||
|
||||
obj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION) += check.o
|
||||
--- a/arch/x86/kernel/microcode_core.c
|
||||
+++ b/arch/x86/kernel/microcode_core.c
|
||||
@@ -84,6 +84,7 @@
|
||||
|
|
|
@ -1,100 +0,0 @@
|
|||
From: Michael Grzeschik <m.grzeschik@pengutronix.de>
|
||||
Date: Thu, 11 Apr 2013 10:13:15 +0000
|
||||
Subject: ARM: dts: imx: add imx5x usb clock DT lookups
|
||||
Origin: https://git.linaro.org/gitweb?p=people/shawnguo/linux-2.6.git;a=commit;h=8ed5da7959d5e6d3fcbdfafbacb58614499fb314
|
||||
|
||||
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
|
||||
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
|
||||
---
|
||||
(limited to 'arch/arm/boot/dts')
|
||||
|
||||
diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
|
||||
index 761ae1c..b118e01 100644
|
||||
--- a/arch/arm/boot/dts/imx51.dtsi
|
||||
+++ b/arch/arm/boot/dts/imx51.dtsi
|
||||
@@ -179,6 +179,7 @@
|
||||
compatible = "fsl,imx51-usb", "fsl,imx27-usb";
|
||||
reg = <0x73f80000 0x0200>;
|
||||
interrupts = <18>;
|
||||
+ clocks = <&clks 108>;
|
||||
fsl,usbmisc = <&usbmisc 0>;
|
||||
status = "disabled";
|
||||
};
|
||||
@@ -187,6 +188,7 @@
|
||||
compatible = "fsl,imx51-usb", "fsl,imx27-usb";
|
||||
reg = <0x73f80200 0x0200>;
|
||||
interrupts = <14>;
|
||||
+ clocks = <&clks 108>;
|
||||
fsl,usbmisc = <&usbmisc 1>;
|
||||
status = "disabled";
|
||||
};
|
||||
@@ -195,6 +197,7 @@
|
||||
compatible = "fsl,imx51-usb", "fsl,imx27-usb";
|
||||
reg = <0x73f80400 0x0200>;
|
||||
interrupts = <16>;
|
||||
+ clocks = <&clks 108>;
|
||||
fsl,usbmisc = <&usbmisc 2>;
|
||||
status = "disabled";
|
||||
};
|
||||
@@ -203,6 +206,7 @@
|
||||
compatible = "fsl,imx51-usb", "fsl,imx27-usb";
|
||||
reg = <0x73f80600 0x0200>;
|
||||
interrupts = <17>;
|
||||
+ clocks = <&clks 108>;
|
||||
fsl,usbmisc = <&usbmisc 3>;
|
||||
status = "disabled";
|
||||
};
|
||||
@@ -211,6 +215,7 @@
|
||||
#index-cells = <1>;
|
||||
compatible = "fsl,imx51-usbmisc";
|
||||
reg = <0x73f80800 0x200>;
|
||||
+ clocks = <&clks 108>;
|
||||
};
|
||||
|
||||
gpio1: gpio@73f84000 {
|
||||
diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi
|
||||
index 6c8fa7d..faea9fa 100644
|
||||
--- a/arch/arm/boot/dts/imx53.dtsi
|
||||
+++ b/arch/arm/boot/dts/imx53.dtsi
|
||||
@@ -167,6 +167,7 @@
|
||||
compatible = "fsl,imx53-usb", "fsl,imx27-usb";
|
||||
reg = <0x53f80000 0x0200>;
|
||||
interrupts = <18>;
|
||||
+ clocks = <&clks 108>;
|
||||
fsl,usbmisc = <&usbmisc 0>;
|
||||
status = "disabled";
|
||||
};
|
||||
@@ -175,6 +176,7 @@
|
||||
compatible = "fsl,imx53-usb", "fsl,imx27-usb";
|
||||
reg = <0x53f80200 0x0200>;
|
||||
interrupts = <14>;
|
||||
+ clocks = <&clks 108>;
|
||||
fsl,usbmisc = <&usbmisc 1>;
|
||||
status = "disabled";
|
||||
};
|
||||
@@ -183,6 +185,7 @@
|
||||
compatible = "fsl,imx53-usb", "fsl,imx27-usb";
|
||||
reg = <0x53f80400 0x0200>;
|
||||
interrupts = <16>;
|
||||
+ clocks = <&clks 108>;
|
||||
fsl,usbmisc = <&usbmisc 2>;
|
||||
status = "disabled";
|
||||
};
|
||||
@@ -191,6 +194,7 @@
|
||||
compatible = "fsl,imx53-usb", "fsl,imx27-usb";
|
||||
reg = <0x53f80600 0x0200>;
|
||||
interrupts = <17>;
|
||||
+ clocks = <&clks 108>;
|
||||
fsl,usbmisc = <&usbmisc 3>;
|
||||
status = "disabled";
|
||||
};
|
||||
@@ -199,6 +203,7 @@
|
||||
#index-cells = <1>;
|
||||
compatible = "fsl,imx53-usbmisc";
|
||||
reg = <0x53f80800 0x200>;
|
||||
+ clocks = <&clks 108>;
|
||||
};
|
||||
|
||||
gpio1: gpio@53f84000 {
|
||||
--
|
||||
cgit v0.9.1
|
|
@ -1,102 +0,0 @@
|
|||
From: Michael Grzeschik <m.grzeschik@pengutronix.de>
|
||||
Date: Thu, 11 Apr 2013 10:13:14 +0000
|
||||
Subject: ARM: dts: imx: add imx5x usbmisc entries
|
||||
Origin: https://git.linaro.org/gitweb?p=people/shawnguo/linux-2.6.git;a=commit;h=feb57438936827ce9faadd35f4835102b8fd0901
|
||||
|
||||
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
|
||||
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
|
||||
---
|
||||
(limited to 'arch/arm/boot/dts')
|
||||
|
||||
diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
|
||||
index 21bb786..761ae1c 100644
|
||||
--- a/arch/arm/boot/dts/imx51.dtsi
|
||||
+++ b/arch/arm/boot/dts/imx51.dtsi
|
||||
@@ -179,6 +179,7 @@
|
||||
compatible = "fsl,imx51-usb", "fsl,imx27-usb";
|
||||
reg = <0x73f80000 0x0200>;
|
||||
interrupts = <18>;
|
||||
+ fsl,usbmisc = <&usbmisc 0>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -186,6 +187,7 @@
|
||||
compatible = "fsl,imx51-usb", "fsl,imx27-usb";
|
||||
reg = <0x73f80200 0x0200>;
|
||||
interrupts = <14>;
|
||||
+ fsl,usbmisc = <&usbmisc 1>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -193,6 +195,7 @@
|
||||
compatible = "fsl,imx51-usb", "fsl,imx27-usb";
|
||||
reg = <0x73f80400 0x0200>;
|
||||
interrupts = <16>;
|
||||
+ fsl,usbmisc = <&usbmisc 2>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -200,9 +203,16 @@
|
||||
compatible = "fsl,imx51-usb", "fsl,imx27-usb";
|
||||
reg = <0x73f80600 0x0200>;
|
||||
interrupts = <17>;
|
||||
+ fsl,usbmisc = <&usbmisc 3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
+ usbmisc: usbmisc@73f80800 {
|
||||
+ #index-cells = <1>;
|
||||
+ compatible = "fsl,imx51-usbmisc";
|
||||
+ reg = <0x73f80800 0x200>;
|
||||
+ };
|
||||
+
|
||||
gpio1: gpio@73f84000 {
|
||||
compatible = "fsl,imx51-gpio", "fsl,imx35-gpio";
|
||||
reg = <0x73f84000 0x4000>;
|
||||
diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi
|
||||
index 845982e..6c8fa7d 100644
|
||||
--- a/arch/arm/boot/dts/imx53.dtsi
|
||||
+++ b/arch/arm/boot/dts/imx53.dtsi
|
||||
@@ -167,6 +167,7 @@
|
||||
compatible = "fsl,imx53-usb", "fsl,imx27-usb";
|
||||
reg = <0x53f80000 0x0200>;
|
||||
interrupts = <18>;
|
||||
+ fsl,usbmisc = <&usbmisc 0>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -174,6 +175,7 @@
|
||||
compatible = "fsl,imx53-usb", "fsl,imx27-usb";
|
||||
reg = <0x53f80200 0x0200>;
|
||||
interrupts = <14>;
|
||||
+ fsl,usbmisc = <&usbmisc 1>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -181,6 +183,7 @@
|
||||
compatible = "fsl,imx53-usb", "fsl,imx27-usb";
|
||||
reg = <0x53f80400 0x0200>;
|
||||
interrupts = <16>;
|
||||
+ fsl,usbmisc = <&usbmisc 2>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -188,9 +191,16 @@
|
||||
compatible = "fsl,imx53-usb", "fsl,imx27-usb";
|
||||
reg = <0x53f80600 0x0200>;
|
||||
interrupts = <17>;
|
||||
+ fsl,usbmisc = <&usbmisc 3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
+ usbmisc: usbmisc@53f80800 {
|
||||
+ #index-cells = <1>;
|
||||
+ compatible = "fsl,imx53-usbmisc";
|
||||
+ reg = <0x53f80800 0x200>;
|
||||
+ };
|
||||
+
|
||||
gpio1: gpio@53f84000 {
|
||||
compatible = "fsl,imx53-gpio", "fsl,imx35-gpio";
|
||||
reg = <0x53f84000 0x4000>;
|
||||
--
|
||||
cgit v0.9.1
|
|
@ -1,28 +0,0 @@
|
|||
From: Michael Grzeschik <m.grzeschik@pengutronix.de>
|
||||
Date: Thu, 11 Apr 2013 10:13:17 +0000
|
||||
Subject: ARM: dts: imx: imx53-qsb.dts: enable usbotg and usbh1
|
||||
Origin: https://git.linaro.org/gitweb?p=people/shawnguo/linux-2.6.git;a=commit;h=c9cb1ec6e2a15e744a6481cb14730a5812471e71
|
||||
|
||||
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
|
||||
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
|
||||
---
|
||||
(limited to 'arch/arm/boot/dts')
|
||||
|
||||
diff --git a/arch/arm/boot/dts/imx53-qsb.dts b/arch/arm/boot/dts/imx53-qsb.dts
|
||||
index 8f0e9ae..160d1bc 100644
|
||||
--- a/arch/arm/boot/dts/imx53-qsb.dts
|
||||
+++ b/arch/arm/boot/dts/imx53-qsb.dts
|
||||
@@ -268,3 +268,11 @@
|
||||
phy-reset-gpios = <&gpio7 6 0>;
|
||||
status = "okay";
|
||||
};
|
||||
+
|
||||
+&usbh1 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usbotg {
|
||||
+ status = "okay";
|
||||
+};
|
||||
--
|
||||
cgit v0.9.1
|
|
@ -1,77 +0,0 @@
|
|||
From: Michael Grzeschik <m.grzeschik@pengutronix.de>
|
||||
Date: Thu, 11 Apr 2013 10:13:16 +0000
|
||||
Subject: ARM: dts: imx: use usb-nop-xceiv usbphy entries for imx5x
|
||||
Origin: https://git.linaro.org/gitweb?p=people/shawnguo/linux-2.6.git;a=commit;h=972a8dd0c7ca37b70d4bf523018e32703937a829
|
||||
|
||||
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
|
||||
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
|
||||
---
|
||||
(limited to 'arch/arm/boot/dts')
|
||||
|
||||
diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
|
||||
index b118e01..f23636f 100644
|
||||
--- a/arch/arm/boot/dts/imx51.dtsi
|
||||
+++ b/arch/arm/boot/dts/imx51.dtsi
|
||||
@@ -175,12 +175,20 @@
|
||||
};
|
||||
};
|
||||
|
||||
+ usbphy0: usbphy@0 {
|
||||
+ compatible = "usb-nop-xceiv";
|
||||
+ clocks = <&clks 124>;
|
||||
+ clock-names = "main_clk";
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+
|
||||
usbotg: usb@73f80000 {
|
||||
compatible = "fsl,imx51-usb", "fsl,imx27-usb";
|
||||
reg = <0x73f80000 0x0200>;
|
||||
interrupts = <18>;
|
||||
clocks = <&clks 108>;
|
||||
fsl,usbmisc = <&usbmisc 0>;
|
||||
+ fsl,usbphy = <&usbphy0>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi
|
||||
index faea9fa..c4ddf51 100644
|
||||
--- a/arch/arm/boot/dts/imx53.dtsi
|
||||
+++ b/arch/arm/boot/dts/imx53.dtsi
|
||||
@@ -163,12 +163,27 @@
|
||||
};
|
||||
};
|
||||
|
||||
+ usbphy0: usbphy@0 {
|
||||
+ compatible = "usb-nop-xceiv";
|
||||
+ clocks = <&clks 124>;
|
||||
+ clock-names = "main_clk";
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+
|
||||
+ usbphy1: usbphy@1 {
|
||||
+ compatible = "usb-nop-xceiv";
|
||||
+ clocks = <&clks 125>;
|
||||
+ clock-names = "main_clk";
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+
|
||||
usbotg: usb@53f80000 {
|
||||
compatible = "fsl,imx53-usb", "fsl,imx27-usb";
|
||||
reg = <0x53f80000 0x0200>;
|
||||
interrupts = <18>;
|
||||
clocks = <&clks 108>;
|
||||
fsl,usbmisc = <&usbmisc 0>;
|
||||
+ fsl,usbphy = <&usbphy0>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -178,6 +193,7 @@
|
||||
interrupts = <14>;
|
||||
clocks = <&clks 108>;
|
||||
fsl,usbmisc = <&usbmisc 1>;
|
||||
+ fsl,usbphy = <&usbphy1>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
--
|
||||
cgit v0.9.1
|
File diff suppressed because it is too large
Load Diff
|
@ -1,286 +0,0 @@
|
|||
From: Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
Date: Thu, 30 May 2013 03:49:21 +0000
|
||||
Subject: [PATCH 02/10] net: Add MDIO bus driver for the Allwinner EMAC
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit?id=4bdcb1dd9feb03608e12cfa46aba385035af8ea5
|
||||
Bug-Debian: http://bugs.debian.org/711998
|
||||
|
||||
This patch adds a separate driver for the MDIO interface of the
|
||||
Allwinner ethernet controllers.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
Tested-by: Richard Genoud <richard.genoud@gmail.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
.../bindings/net/allwinner,sun4i-mdio.txt | 26 +++
|
||||
drivers/net/phy/Kconfig | 10 +
|
||||
drivers/net/phy/Makefile | 1 +
|
||||
drivers/net/phy/mdio-sun4i.c | 194 ++++++++++++++++++++
|
||||
4 files changed, 231 insertions(+)
|
||||
create mode 100644 Documentation/devicetree/bindings/net/allwinner,sun4i-mdio.txt
|
||||
create mode 100644 drivers/net/phy/mdio-sun4i.c
|
||||
|
||||
diff --git a/Documentation/devicetree/bindings/net/allwinner,sun4i-mdio.txt b/Documentation/devicetree/bindings/net/allwinner,sun4i-mdio.txt
|
||||
new file mode 100644
|
||||
index 0000000..00b9f9a
|
||||
--- /dev/null
|
||||
+++ b/Documentation/devicetree/bindings/net/allwinner,sun4i-mdio.txt
|
||||
@@ -0,0 +1,26 @@
|
||||
+* Allwinner A10 MDIO Ethernet Controller interface
|
||||
+
|
||||
+Required properties:
|
||||
+- compatible: should be "allwinner,sun4i-mdio".
|
||||
+- reg: address and length of the register set for the device.
|
||||
+
|
||||
+Optional properties:
|
||||
+- phy-supply: phandle to a regulator if the PHY needs one
|
||||
+
|
||||
+Example at the SoC level:
|
||||
+mdio@01c0b080 {
|
||||
+ compatible = "allwinner,sun4i-mdio";
|
||||
+ reg = <0x01c0b080 0x14>;
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+};
|
||||
+
|
||||
+And at the board level:
|
||||
+
|
||||
+mdio@01c0b080 {
|
||||
+ phy-supply = <®_emac_3v3>;
|
||||
+
|
||||
+ phy0: ethernet-phy@0 {
|
||||
+ reg = <0>;
|
||||
+ };
|
||||
+};
|
||||
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
|
||||
index 1e11f2b..3a316b3 100644
|
||||
--- a/drivers/net/phy/Kconfig
|
||||
+++ b/drivers/net/phy/Kconfig
|
||||
@@ -144,6 +144,16 @@ config MDIO_OCTEON
|
||||
|
||||
If in doubt, say Y.
|
||||
|
||||
+config MDIO_SUN4I
|
||||
+ tristate "Allwinner sun4i MDIO interface support"
|
||||
+ depends on ARCH_SUNXI
|
||||
+ select REGULATOR
|
||||
+ select REGULATOR_FIXED_VOLTAGE
|
||||
+ help
|
||||
+ This driver supports the MDIO interface found in the network
|
||||
+ interface units of the Allwinner SoC that have an EMAC (A10,
|
||||
+ A12, A10s, etc.)
|
||||
+
|
||||
config MDIO_BUS_MUX
|
||||
tristate
|
||||
depends on OF_MDIO
|
||||
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
|
||||
index 9645e38..23a2ab2 100644
|
||||
--- a/drivers/net/phy/Makefile
|
||||
+++ b/drivers/net/phy/Makefile
|
||||
@@ -30,3 +30,4 @@ obj-$(CONFIG_AMD_PHY) += amd.o
|
||||
obj-$(CONFIG_MDIO_BUS_MUX) += mdio-mux.o
|
||||
obj-$(CONFIG_MDIO_BUS_MUX_GPIO) += mdio-mux-gpio.o
|
||||
obj-$(CONFIG_MDIO_BUS_MUX_MMIOREG) += mdio-mux-mmioreg.o
|
||||
+obj-$(CONFIG_MDIO_SUN4I) += mdio-sun4i.o
|
||||
diff --git a/drivers/net/phy/mdio-sun4i.c b/drivers/net/phy/mdio-sun4i.c
|
||||
new file mode 100644
|
||||
index 0000000..61d3f4e
|
||||
--- /dev/null
|
||||
+++ b/drivers/net/phy/mdio-sun4i.c
|
||||
@@ -0,0 +1,194 @@
|
||||
+/*
|
||||
+ * Allwinner EMAC MDIO interface driver
|
||||
+ *
|
||||
+ * Copyright 2012-2013 Stefan Roese <sr@denx.de>
|
||||
+ * Copyright 2013 Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
+ *
|
||||
+ * Based on the Linux driver provided by Allwinner:
|
||||
+ * Copyright (C) 1997 Sten Wang
|
||||
+ *
|
||||
+ * This file is licensed under the terms of the GNU General Public
|
||||
+ * License version 2. This program is licensed "as is" without any
|
||||
+ * warranty of any kind, whether express or implied.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/mutex.h>
|
||||
+#include <linux/of_address.h>
|
||||
+#include <linux/of_mdio.h>
|
||||
+#include <linux/phy.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/regulator/consumer.h>
|
||||
+
|
||||
+#define EMAC_MAC_MCMD_REG (0x00)
|
||||
+#define EMAC_MAC_MADR_REG (0x04)
|
||||
+#define EMAC_MAC_MWTD_REG (0x08)
|
||||
+#define EMAC_MAC_MRDD_REG (0x0c)
|
||||
+#define EMAC_MAC_MIND_REG (0x10)
|
||||
+#define EMAC_MAC_SSRR_REG (0x14)
|
||||
+
|
||||
+#define MDIO_TIMEOUT (msecs_to_jiffies(100))
|
||||
+
|
||||
+struct sun4i_mdio_data {
|
||||
+ void __iomem *membase;
|
||||
+ struct regulator *regulator;
|
||||
+};
|
||||
+
|
||||
+static int sun4i_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
|
||||
+{
|
||||
+ struct sun4i_mdio_data *data = bus->priv;
|
||||
+ unsigned long start_jiffies;
|
||||
+ int value;
|
||||
+
|
||||
+ /* issue the phy address and reg */
|
||||
+ writel((mii_id << 8) | regnum, data->membase + EMAC_MAC_MADR_REG);
|
||||
+ /* pull up the phy io line */
|
||||
+ writel(0x1, data->membase + EMAC_MAC_MCMD_REG);
|
||||
+
|
||||
+ /* Wait read complete */
|
||||
+ start_jiffies = jiffies;
|
||||
+ while (readl(data->membase + EMAC_MAC_MIND_REG) & 0x1) {
|
||||
+ if (time_after(start_jiffies,
|
||||
+ start_jiffies + MDIO_TIMEOUT))
|
||||
+ return -ETIMEDOUT;
|
||||
+ msleep(1);
|
||||
+ }
|
||||
+
|
||||
+ /* push down the phy io line */
|
||||
+ writel(0x0, data->membase + EMAC_MAC_MCMD_REG);
|
||||
+ /* and read data */
|
||||
+ value = readl(data->membase + EMAC_MAC_MRDD_REG);
|
||||
+
|
||||
+ return value;
|
||||
+}
|
||||
+
|
||||
+static int sun4i_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
|
||||
+ u16 value)
|
||||
+{
|
||||
+ struct sun4i_mdio_data *data = bus->priv;
|
||||
+ unsigned long start_jiffies;
|
||||
+
|
||||
+ /* issue the phy address and reg */
|
||||
+ writel((mii_id << 8) | regnum, data->membase + EMAC_MAC_MADR_REG);
|
||||
+ /* pull up the phy io line */
|
||||
+ writel(0x1, data->membase + EMAC_MAC_MCMD_REG);
|
||||
+
|
||||
+ /* Wait read complete */
|
||||
+ start_jiffies = jiffies;
|
||||
+ while (readl(data->membase + EMAC_MAC_MIND_REG) & 0x1) {
|
||||
+ if (time_after(start_jiffies,
|
||||
+ start_jiffies + MDIO_TIMEOUT))
|
||||
+ return -ETIMEDOUT;
|
||||
+ msleep(1);
|
||||
+ }
|
||||
+
|
||||
+ /* push down the phy io line */
|
||||
+ writel(0x0, data->membase + EMAC_MAC_MCMD_REG);
|
||||
+ /* and write data */
|
||||
+ writel(value, data->membase + EMAC_MAC_MWTD_REG);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int sun4i_mdio_reset(struct mii_bus *bus)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int sun4i_mdio_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device_node *np = pdev->dev.of_node;
|
||||
+ struct mii_bus *bus;
|
||||
+ struct sun4i_mdio_data *data;
|
||||
+ int ret, i;
|
||||
+
|
||||
+ bus = mdiobus_alloc_size(sizeof(*data));
|
||||
+ if (!bus)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ bus->name = "sun4i_mii_bus";
|
||||
+ bus->read = &sun4i_mdio_read;
|
||||
+ bus->write = &sun4i_mdio_write;
|
||||
+ bus->reset = &sun4i_mdio_reset;
|
||||
+ snprintf(bus->id, MII_BUS_ID_SIZE, "%s-mii", dev_name(&pdev->dev));
|
||||
+ bus->parent = &pdev->dev;
|
||||
+
|
||||
+ bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
|
||||
+ if (!bus->irq) {
|
||||
+ ret = -ENOMEM;
|
||||
+ goto err_out_free_mdiobus;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < PHY_MAX_ADDR; i++)
|
||||
+ bus->irq[i] = PHY_POLL;
|
||||
+
|
||||
+ data = bus->priv;
|
||||
+ data->membase = of_iomap(np, 0);
|
||||
+ if (!data->membase) {
|
||||
+ ret = -ENOMEM;
|
||||
+ goto err_out_free_mdio_irq;
|
||||
+ }
|
||||
+
|
||||
+ data->regulator = devm_regulator_get(&pdev->dev, "phy");
|
||||
+ if (IS_ERR(data->regulator)) {
|
||||
+ if (PTR_ERR(data->regulator) == -EPROBE_DEFER)
|
||||
+ return -EPROBE_DEFER;
|
||||
+
|
||||
+ dev_info(&pdev->dev, "no regulator found\n");
|
||||
+ } else {
|
||||
+ ret = regulator_enable(data->regulator);
|
||||
+ if (ret)
|
||||
+ goto err_out_free_mdio_irq;
|
||||
+ }
|
||||
+
|
||||
+ ret = of_mdiobus_register(bus, np);
|
||||
+ if (ret < 0)
|
||||
+ goto err_out_disable_regulator;
|
||||
+
|
||||
+ platform_set_drvdata(pdev, bus);
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+err_out_disable_regulator:
|
||||
+ regulator_disable(data->regulator);
|
||||
+err_out_free_mdio_irq:
|
||||
+ kfree(bus->irq);
|
||||
+err_out_free_mdiobus:
|
||||
+ mdiobus_free(bus);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int sun4i_mdio_remove(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct mii_bus *bus = platform_get_drvdata(pdev);
|
||||
+
|
||||
+ mdiobus_unregister(bus);
|
||||
+ kfree(bus->irq);
|
||||
+ mdiobus_free(bus);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const struct of_device_id sun4i_mdio_dt_ids[] = {
|
||||
+ { .compatible = "allwinner,sun4i-mdio" },
|
||||
+ { }
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(of, sun4i_mdio_dt_ids);
|
||||
+
|
||||
+static struct platform_driver sun4i_mdio_driver = {
|
||||
+ .probe = sun4i_mdio_probe,
|
||||
+ .remove = sun4i_mdio_remove,
|
||||
+ .driver = {
|
||||
+ .name = "sun4i-mdio",
|
||||
+ .of_match_table = sun4i_mdio_dt_ids,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+module_platform_driver(sun4i_mdio_driver);
|
||||
+
|
||||
+MODULE_DESCRIPTION("Allwinner EMAC MDIO interface driver");
|
||||
+MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com>");
|
||||
+MODULE_LICENSE("GPL");
|
||||
--
|
||||
1.7.10.4
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
From: Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
Date: Thu, 30 May 2013 03:49:22 +0000
|
||||
Subject: [PATCH 03/10] ARM: sun4i: Add muxing options for the ethernet
|
||||
controller
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit?id=b21da664120b1c8332fc5059a1e7c1462dd26433
|
||||
Bug-Debian: http://bugs.debian.org/711998
|
||||
|
||||
The EMAC only has one pinset available for muxing, so hopefully, we
|
||||
cover all cases.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
Tested-by: Richard Genoud <richard.genoud@gmail.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
arch/arm/boot/dts/sun4i-a10.dtsi | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
|
||||
index e7ef619..ff1f41f 100644
|
||||
--- a/arch/arm/boot/dts/sun4i-a10.dtsi
|
||||
+++ b/arch/arm/boot/dts/sun4i-a10.dtsi
|
||||
@@ -199,6 +199,17 @@
|
||||
allwinner,drive = <0>;
|
||||
allwinner,pull = <0>;
|
||||
};
|
||||
+
|
||||
+ emac_pins_a: emac0@0 {
|
||||
+ allwinner,pins = "PA0", "PA1", "PA2",
|
||||
+ "PA3", "PA4", "PA5", "PA6",
|
||||
+ "PA7", "PA8", "PA9", "PA10",
|
||||
+ "PA11", "PA12", "PA13", "PA14",
|
||||
+ "PA15", "PA16";
|
||||
+ allwinner,function = "emac";
|
||||
+ allwinner,drive = <0>;
|
||||
+ allwinner,pull = <0>;
|
||||
+ };
|
||||
};
|
||||
|
||||
timer@01c20c00 {
|
||||
--
|
||||
1.7.10.4
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
From: Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
Date: Thu, 30 May 2013 03:49:23 +0000
|
||||
Subject: [PATCH 04/10] ARM: sunxi: Add EMAC controller node to sun4i DTSI
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit?id=e38afcb33ff4b472254c8f6f140699e002c44d84
|
||||
Bug-Debian: http://bugs.debian.org/711998
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
Tested-by: Richard Genoud <richard.genoud@gmail.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
arch/arm/boot/dts/sun4i-a10.dtsi | 16 ++++++++++++++++
|
||||
1 file changed, 16 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
|
||||
index ff1f41f..983da33 100644
|
||||
--- a/arch/arm/boot/dts/sun4i-a10.dtsi
|
||||
+++ b/arch/arm/boot/dts/sun4i-a10.dtsi
|
||||
@@ -163,6 +163,22 @@
|
||||
reg = <0x01c20000 0x300000>;
|
||||
ranges;
|
||||
|
||||
+ emac: ethernet@01c0b000 {
|
||||
+ compatible = "allwinner,sun4i-emac";
|
||||
+ reg = <0x01c0b000 0x1000>;
|
||||
+ interrupts = <55>;
|
||||
+ clocks = <&ahb_gates 17>;
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+
|
||||
+ mdio@01c0b080 {
|
||||
+ compatible = "allwinner,sun4i-mdio";
|
||||
+ reg = <0x01c0b080 0x14>;
|
||||
+ status = "disabled";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ };
|
||||
+
|
||||
intc: interrupt-controller@01c20400 {
|
||||
compatible = "allwinner,sun4i-ic";
|
||||
reg = <0x01c20400 0x400>;
|
||||
--
|
||||
1.7.10.4
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
From: Stefan Roese <sr@denx.de>
|
||||
Date: Thu, 30 May 2013 03:49:24 +0000
|
||||
Subject: [PATCH 05/10] ARM: cubieboard: Enable ethernet (EMAC) support in dts
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit?id=e5a84bac5d6797c64541f87e7a567d56699bbb74
|
||||
Bug-Debian: http://bugs.debian.org/711998
|
||||
|
||||
Signed-off-by: Stefan Roese <sr@denx.de>
|
||||
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
Tested-by: Richard Genoud <richard.genoud@gmail.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
arch/arm/boot/dts/sun4i-a10-cubieboard.dts | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
|
||||
index b70fe0d..e752b57 100644
|
||||
--- a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
|
||||
+++ b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
|
||||
@@ -27,6 +27,21 @@
|
||||
};
|
||||
|
||||
soc@01c20000 {
|
||||
+ emac: ethernet@01c0b000 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&emac_pins_a>;
|
||||
+ phy = <&phy1>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+
|
||||
+ mdio@01c0b080 {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ phy1: ethernet-phy@1 {
|
||||
+ reg = <1>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
pinctrl@01c20800 {
|
||||
led_pins_cubieboard: led_pins@0 {
|
||||
allwinner,pins = "PH20", "PH21";
|
||||
--
|
||||
1.7.10.4
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
From: Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
Date: Thu, 30 May 2013 03:49:25 +0000
|
||||
Subject: [PATCH 06/10] ARM: sunxi: Add EMAC Controller to Hackberry dt
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit?id=d97a079a79a7dcbc2470572b41cd1f07a16d8b7f
|
||||
Bug-Debian: http://bugs.debian.org/711998
|
||||
|
||||
The Hackberry has a PHY that needs to be powered up through a GPIO, so
|
||||
we need to use a fixed regulator here.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
Tested-by: Richard Genoud <richard.genoud@gmail.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
arch/arm/boot/dts/sun4i-a10-hackberry.dts | 41 +++++++++++++++++++++++++++++
|
||||
1 file changed, 41 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/sun4i-a10-hackberry.dts b/arch/arm/boot/dts/sun4i-a10-hackberry.dts
|
||||
index b9efac1..3514b37 100644
|
||||
--- a/arch/arm/boot/dts/sun4i-a10-hackberry.dts
|
||||
+++ b/arch/arm/boot/dts/sun4i-a10-hackberry.dts
|
||||
@@ -23,10 +23,51 @@
|
||||
};
|
||||
|
||||
soc@01c20000 {
|
||||
+ emac: ethernet@01c0b000 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&emac_pins_a>;
|
||||
+ phy = <&phy0>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+
|
||||
+ mdio@01c0b080 {
|
||||
+ phy-supply = <®_emac_3v3>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ phy0: ethernet-phy@0 {
|
||||
+ reg = <0>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ pio: pinctrl@01c20800 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&hackberry_hogs>;
|
||||
+
|
||||
+ hackberry_hogs: hogs@0 {
|
||||
+ allwinner,pins = "PH19";
|
||||
+ allwinner,function = "gpio_out";
|
||||
+ allwinner,drive = <0>;
|
||||
+ allwinner,pull = <0>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
uart0: serial@01c28000 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart0_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
+
|
||||
+ regulators {
|
||||
+ compatible = "simple-bus";
|
||||
+
|
||||
+ reg_emac_3v3: emac-3v3 {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "emac-3v3";
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ enable-active-high;
|
||||
+ gpio = <&pio 7 19 0>;
|
||||
+ };
|
||||
+ };
|
||||
};
|
||||
--
|
||||
1.7.10.4
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
|
||||
Date: Mon, 3 Jun 2013 03:36:52 +0000
|
||||
Subject: [PATCH 07/10] net: sun4i-emac: fix a typo in emac_probe()
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit?id=93baf4c615584fa02c21aa78f305428fc7060656
|
||||
Bug-Debian: http://bugs.debian.org/711998
|
||||
|
||||
Just fixed a typo in emac_probe().
|
||||
|
||||
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
|
||||
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/ethernet/allwinner/sun4i-emac.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c
|
||||
index b411344..26083cd 100644
|
||||
--- a/drivers/net/ethernet/allwinner/sun4i-emac.c
|
||||
+++ b/drivers/net/ethernet/allwinner/sun4i-emac.c
|
||||
@@ -821,7 +821,7 @@ static int emac_probe(struct platform_device *pdev)
|
||||
db->membase = of_iomap(np, 0);
|
||||
if (!db->membase) {
|
||||
dev_err(&pdev->dev, "failed to remap registers\n");
|
||||
- return -ENOMEM;
|
||||
+ ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
--
|
||||
1.7.10.4
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
From: Arnd Bergmann <arnd@arndb.de>
|
||||
Date: Mon, 3 Jun 2013 11:36:50 +0000
|
||||
Subject: [PATCH 08/10] net: sun4i-emac: remove erroneous assignment
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit?id=10e179e364beafc23d837e81cf98d99720f42551
|
||||
Bug-Debian: http://bugs.debian.org/711998
|
||||
|
||||
The newly added sun4i-emac driver causes a build error when
|
||||
CONFIG_NET_POLL_CONTROLLER is set, because it attempts to
|
||||
assign a pointer to netdev->poll_controller, which has
|
||||
been replaced with ops->ndo_poll_controller in 2.6.31!
|
||||
|
||||
The correct assignment is present as well, so we just need
|
||||
to remove the wrong one.
|
||||
|
||||
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
|
||||
Cc: Stefan Roese <sr@denx.de>
|
||||
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
Cc: Richard Genoud <richard.genoud@gmail.com>
|
||||
Acked-by: Stefan Roese <sr@denx.de>
|
||||
Acked-by: Maxime Ripard <maxime.ripard@anandra.org>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/ethernet/allwinner/sun4i-emac.c | 4 ----
|
||||
1 file changed, 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c
|
||||
index 26083cd..0bb2f4a 100644
|
||||
--- a/drivers/net/ethernet/allwinner/sun4i-emac.c
|
||||
+++ b/drivers/net/ethernet/allwinner/sun4i-emac.c
|
||||
@@ -869,10 +869,6 @@ static int emac_probe(struct platform_device *pdev)
|
||||
ndev->watchdog_timeo = msecs_to_jiffies(watchdog);
|
||||
ndev->ethtool_ops = &emac_ethtool_ops;
|
||||
|
||||
-#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
- ndev->poll_controller = &emac_poll_controller;
|
||||
-#endif
|
||||
-
|
||||
platform_set_drvdata(pdev, ndev);
|
||||
|
||||
/* Carrier starts down, phylib will bring it up */
|
||||
--
|
||||
1.7.10.4
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
From: Sachin Kamat <sachin.kamat@linaro.org>
|
||||
Date: Tue, 4 Jun 2013 00:31:19 +0000
|
||||
Subject: [PATCH 09/10] net: sun4i-emac: Remove redundant
|
||||
platform_set_drvdata()
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit?id=aff5c3557cf72fcad913d8b4b44b055a4e034bb5
|
||||
Bug-Debian: http://bugs.debian.org/711998
|
||||
|
||||
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
|
||||
driver is bound) removes the need to set driver data field to
|
||||
NULL.
|
||||
|
||||
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
|
||||
Cc: Stefan Roese <sr@denx.de>
|
||||
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/ethernet/allwinner/sun4i-emac.c | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c
|
||||
index 0bb2f4a..e9c8dbe 100644
|
||||
--- a/drivers/net/ethernet/allwinner/sun4i-emac.c
|
||||
+++ b/drivers/net/ethernet/allwinner/sun4i-emac.c
|
||||
@@ -898,8 +898,6 @@ static int emac_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct net_device *ndev = platform_get_drvdata(pdev);
|
||||
|
||||
- platform_set_drvdata(pdev, NULL);
|
||||
-
|
||||
unregister_netdev(ndev);
|
||||
free_netdev(ndev);
|
||||
|
||||
--
|
||||
1.7.10.4
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
From: Sachin Kamat <sachin.kamat@linaro.org>
|
||||
Date: Tue, 4 Jun 2013 00:31:20 +0000
|
||||
Subject: [PATCH 10/10] net: sun4i-emac: Staticize local symbols
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit?id=11a164a04382d735230b01f4cc46ad78a7c4abf6
|
||||
Bug-Debian: http://bugs.debian.org/711998
|
||||
|
||||
Some symbols referenced only in this file are made static.
|
||||
|
||||
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
|
||||
Cc: Stefan Roese <sr@denx.de>
|
||||
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/ethernet/allwinner/sun4i-emac.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c
|
||||
index e9c8dbe..50b853a 100644
|
||||
--- a/drivers/net/ethernet/allwinner/sun4i-emac.c
|
||||
+++ b/drivers/net/ethernet/allwinner/sun4i-emac.c
|
||||
@@ -258,7 +258,7 @@ static const struct ethtool_ops emac_ethtool_ops = {
|
||||
.get_link = ethtool_op_get_link,
|
||||
};
|
||||
|
||||
-unsigned int emac_setup(struct net_device *ndev)
|
||||
+static unsigned int emac_setup(struct net_device *ndev)
|
||||
{
|
||||
struct emac_board_info *db = netdev_priv(ndev);
|
||||
unsigned int reg_val;
|
||||
@@ -310,7 +310,7 @@ unsigned int emac_setup(struct net_device *ndev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-unsigned int emac_powerup(struct net_device *ndev)
|
||||
+static unsigned int emac_powerup(struct net_device *ndev)
|
||||
{
|
||||
struct emac_board_info *db = netdev_priv(ndev);
|
||||
unsigned int reg_val;
|
||||
--
|
||||
1.7.10.4
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
From: "Arnaud Patard (Rtp)" <arnaud.patard@rtp-net.org>
|
||||
Date: Thu, 20 Jun 2013 23:33:25 +0200
|
||||
Subject: usbmisc_imx: allow autoloading on according to dt ids
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/gregkh/usb.git/commit?id=269b83dc9ce007efc4393e8a5b77f208a0e18e4a
|
||||
|
||||
Allow udev to autoload the module when booting with device-tree
|
||||
|
||||
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
---
|
||||
drivers/usb/chipidea/usbmisc_imx.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
|
||||
index 588bae8..c912e7b 100644
|
||||
--- a/drivers/usb/chipidea/usbmisc_imx.c
|
||||
+++ b/drivers/usb/chipidea/usbmisc_imx.c
|
||||
@@ -175,6 +175,7 @@ static const struct of_device_id usbmisc_imx_dt_ids[] = {
|
||||
},
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
+MODULE_DEVICE_TABLE(of, usbmisc_imx_dt_ids);
|
||||
|
||||
static int usbmisc_imx_probe(struct platform_device *pdev)
|
||||
{
|
|
@ -13,21 +13,20 @@ features/all/Kbuild-kconfig-Verbose-version-of-listnewconfig.patch
|
|||
features/all/drivers-media-dvb-usb-af9005-request_firmware.patch
|
||||
features/all/sound-pci-cs46xx-request_firmware.patch
|
||||
debian/iwlwifi-do-not-request-unreleased-firmware.patch
|
||||
bugfix/all/cassini-Make-missing-firmware-non-fatal.patch
|
||||
bugfix/all/firmware_class-log-every-success-and-failure.patch
|
||||
bugfix/all/firmware-remove-redundant-log-messages-from-drivers.patch
|
||||
bugfix/all/radeon-firmware-is-required-for-drm-and-kms-on-r600-onward.patch
|
||||
|
||||
# Patches and source files from aufs3 repository, imported with
|
||||
# debian/patches/features/all/aufs3/gen-patch.
|
||||
features/all/aufs3/aufs3-base.patch
|
||||
features/all/aufs3/aufs3-standalone.patch
|
||||
features/all/aufs3/aufs3-kbuild.patch
|
||||
features/all/aufs3/aufs3-add.patch
|
||||
#features/all/aufs3/aufs3-base.patch
|
||||
#features/all/aufs3/aufs3-standalone.patch
|
||||
#features/all/aufs3/aufs3-kbuild.patch
|
||||
#features/all/aufs3/aufs3-add.patch
|
||||
# mark as staging/crap
|
||||
debian/aufs3-mark-as-staging.patch
|
||||
#debian/aufs3-mark-as-staging.patch
|
||||
# hide broken config option
|
||||
debian/AUFS_PROC_MAP-is-BROKEN.patch
|
||||
#debian/AUFS_PROC_MAP-is-BROKEN.patch
|
||||
|
||||
# Change some defaults for security reasons
|
||||
features/all/sysrq-mask.patch
|
||||
|
@ -58,50 +57,21 @@ features/all/xen/microcode-api-update.patch
|
|||
# ARM bug fixes
|
||||
bugfix/arm/omap-musb-choice.patch
|
||||
bugfix/arm/mvneta-module-fix.patch
|
||||
bugfix/arm/i2c-imx-add-module_device_table.patch
|
||||
bugfix/arm/imx-sgtl5000-probe-defer.patch
|
||||
|
||||
# Miscellaneous bug fixes
|
||||
bugfix/mips/disable-advansys.patch
|
||||
bugfix/powerpc/lpar-console.patch
|
||||
bugfix/all/dm-Deal-with-merge_bvec_fn-in-component-devices-bett.patch
|
||||
bugfix/arm/ixp4xx_iobe.patch
|
||||
bugfix/all/megaraid_sas-fix-memory-leak-if-SGL-has-zero-length-entries.patch
|
||||
bugfix/all/ath6kl-do-not-use-virt_addr_valid.patch
|
||||
features/all/cpu-devices/Partially-revert-cpufreq-Add-support-for-x86-cpuinfo.patch
|
||||
bugfix/x86/viafb-autoload-on-olpc-xo1.5-only.patch
|
||||
bugfix/all/misc-bmp085-Enable-building-as-a-module.patch
|
||||
bugfix/all/fanotify-info-leak-in-copy_event_to_user.patch
|
||||
bugfix/all/xen-blkback-Check-device-permissions-before-allowing.patch
|
||||
|
||||
# ARM hardware support
|
||||
features/arm/ARM-dts-imx-add-imx5x-usbmisc-entries.patch
|
||||
features/arm/ARM-dts-imx-add-imx5x-usb-clock-DT-lookups.patch
|
||||
features/arm/ARM-dts-imx-use-usb-nop-xceiv-usbphy-entries-for-imx5x.patch
|
||||
features/arm/ARM-dts-imx-imx53-qsb.dts-enable-usbotg-and-usbh1.patch
|
||||
features/arm/usbmisc-imx-add-module_device_table.patch
|
||||
features/arm/imx53-qsb-usb-power.patch
|
||||
features/arm/sunxi-emac/0001-net-Add-EMAC-ethernet-driver-found-on-Allwinner-A10-.patch
|
||||
features/arm/sunxi-emac/0002-net-Add-MDIO-bus-driver-for-the-Allwinner-EMAC.patch
|
||||
features/arm/sunxi-emac/0003-ARM-sun4i-Add-muxing-options-for-the-ethernet-contro.patch
|
||||
features/arm/sunxi-emac/0004-ARM-sunxi-Add-EMAC-controller-node-to-sun4i-DTSI.patch
|
||||
features/arm/sunxi-emac/0005-ARM-cubieboard-Enable-ethernet-EMAC-support-in-dts.patch
|
||||
features/arm/sunxi-emac/0006-ARM-sunxi-Add-EMAC-Controller-to-Hackberry-dt.patch
|
||||
features/arm/sunxi-emac/0007-net-sun4i-emac-fix-a-typo-in-emac_probe.patch
|
||||
features/arm/sunxi-emac/0008-net-sun4i-emac-remove-erroneous-assignment.patch
|
||||
features/arm/sunxi-emac/0009-net-sun4i-emac-Remove-redundant-platform_set_drvdata.patch
|
||||
features/arm/sunxi-emac/0010-net-sun4i-emac-Staticize-local-symbols.patch
|
||||
|
||||
# Miscellaneous features
|
||||
features/all/x86-memtest-WARN-if-bad-RAM-found.patch
|
||||
features/all/efi-autoload-efivars.patch
|
||||
|
||||
# alx driver bug fixes (and some cleanup)
|
||||
bugfix/all/alx-treat-flow-control-correctly-in-alx_set_pausepar.patch
|
||||
bugfix/all/alx-fix-100mbit-half-duplex-speed-translation.patch
|
||||
bugfix/all/alx-make-sizes-unsigned.patch
|
||||
bugfix/all/alx-separate-link-speed-duplex-fields.patch
|
||||
bugfix/all/alx-fix-MAC-address-alignment-problem.patch
|
||||
bugfix/all/alx-fix-ethtool-support-code.patch
|
||||
bugfix/all/alx-remove-WoL-support.patch
|
||||
bugfix/all/alx-fix-lockdep-annotation.patch
|
||||
bugfix/all/xen-blkback-Check-device-permissions-before-allowing.patch
|
||||
|
|
Loading…
Reference in New Issue