Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150460
b: refs/heads/master
c: 45ea4ea
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed May 25, 2009
1 parent 7955cb0 commit 5236dbc
Show file tree
Hide file tree
Showing 47 changed files with 416 additions and 253 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a2e2322d83df82a57ba456cfa604c8b8f7b04670
refs/heads/master: 45ea4ea2af358fe316c918381c7868f9418cad09
6 changes: 3 additions & 3 deletions trunk/arch/arm/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
return err;
}

static inline void restart_syscall(struct pt_regs *regs)
static inline void setup_syscall_restart(struct pt_regs *regs)
{
regs->ARM_r0 = regs->ARM_ORIG_r0;
regs->ARM_pc -= thumb_mode(regs) ? 2 : 4;
Expand Down Expand Up @@ -567,7 +567,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
}
/* fallthrough */
case -ERESTARTNOINTR:
restart_syscall(regs);
setup_syscall_restart(regs);
}
}

Expand Down Expand Up @@ -691,7 +691,7 @@ static int do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall)
if (regs->ARM_r0 == -ERESTARTNOHAND ||
regs->ARM_r0 == -ERESTARTSYS ||
regs->ARM_r0 == -ERESTARTNOINTR) {
restart_syscall(regs);
setup_syscall_restart(regs);
}
}
single_step_set(current);
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/avr32/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
return err;
}

static inline void restart_syscall(struct pt_regs *regs)
static inline void setup_syscall_restart(struct pt_regs *regs)
{
if (regs->r12 == -ERESTART_RESTARTBLOCK)
regs->r8 = __NR_restart_syscall;
Expand Down Expand Up @@ -296,7 +296,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset, int syscall)
}
/* fall through */
case -ERESTARTNOINTR:
restart_syscall(regs);
setup_syscall_restart(regs);
}
}

Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/net/chelsio/cphy.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,11 @@ static inline int simple_mdio_write(struct cphy *cphy, int reg,
}

/* Convenience initializer */
static inline void cphy_init(struct cphy *phy, adapter_t *adapter,
static inline void cphy_init(struct cphy *phy, struct net_device *dev,
int phy_addr, struct cphy_ops *phy_ops,
const struct mdio_ops *mdio_ops)
{
struct adapter *adapter = netdev_priv(dev);
phy->adapter = adapter;
phy->ops = phy_ops;
if (mdio_ops) {
Expand All @@ -150,12 +151,13 @@ static inline void cphy_init(struct cphy *phy, adapter_t *adapter,
phy->mdio.mdio_read = mdio_ops->read;
phy->mdio.mdio_write = mdio_ops->write;
}
phy->mdio.dev = dev;
}

/* Operations of the PHY-instance factory */
struct gphy {
/* Construct a PHY instance with the given PHY address */
struct cphy *(*create)(adapter_t *adapter, int phy_addr,
struct cphy *(*create)(struct net_device *dev, int phy_addr,
const struct mdio_ops *mdio_ops);

/*
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/net/chelsio/mv88e1xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,15 +353,16 @@ static struct cphy_ops mv88e1xxx_ops = {
.get_link_status = mv88e1xxx_get_link_status,
};

static struct cphy *mv88e1xxx_phy_create(adapter_t *adapter, int phy_addr,
static struct cphy *mv88e1xxx_phy_create(struct net_device *dev, int phy_addr,
const struct mdio_ops *mdio_ops)
{
struct adapter *adapter = netdev_priv(dev);
struct cphy *cphy = kzalloc(sizeof(*cphy), GFP_KERNEL);

if (!cphy)
return NULL;

cphy_init(cphy, adapter, phy_addr, &mv88e1xxx_ops, mdio_ops);
cphy_init(cphy, dev, phy_addr, &mv88e1xxx_ops, mdio_ops);

/* Configure particular PHY's to run in a different mode. */
if ((board_info(adapter)->caps & SUPPORTED_TP) &&
Expand Down
21 changes: 11 additions & 10 deletions trunk/drivers/net/chelsio/mv88x201x.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ static int mv88x201x_reset(struct cphy *cphy, int wait)
static int mv88x201x_interrupt_enable(struct cphy *cphy)
{
/* Enable PHY LASI interrupts. */
cphy_mdio_write(cphy, MDIO_MMD_PMAPMD, 0x9002, 0x1);
cphy_mdio_write(cphy, MDIO_MMD_PMAPMD, MDIO_PMA_LASI_CTRL,
MDIO_PMA_LASI_LSALARM);

/* Enable Marvell interrupts through Elmer0. */
if (t1_is_asic(cphy->adapter)) {
Expand All @@ -102,7 +103,7 @@ static int mv88x201x_interrupt_enable(struct cphy *cphy)
static int mv88x201x_interrupt_disable(struct cphy *cphy)
{
/* Disable PHY LASI interrupts. */
cphy_mdio_write(cphy, MDIO_MMD_PMAPMD, 0x9002, 0x0);
cphy_mdio_write(cphy, MDIO_MMD_PMAPMD, MDIO_PMA_LASI_CTRL, 0x0);

/* Disable Marvell interrupts through Elmer0. */
if (t1_is_asic(cphy->adapter)) {
Expand All @@ -122,9 +123,9 @@ static int mv88x201x_interrupt_clear(struct cphy *cphy)

#ifdef MV88x2010_LINK_STATUS_BUGS
/* Required to read twice before clear takes affect. */
cphy_mdio_read(cphy, MDIO_MMD_PMAPMD, 0x9003, &val);
cphy_mdio_read(cphy, MDIO_MMD_PMAPMD, 0x9004, &val);
cphy_mdio_read(cphy, MDIO_MMD_PMAPMD, 0x9005, &val);
cphy_mdio_read(cphy, MDIO_MMD_PMAPMD, MDIO_PMA_LASI_RXSTAT, &val);
cphy_mdio_read(cphy, MDIO_MMD_PMAPMD, MDIO_PMA_LASI_TXSTAT, &val);
cphy_mdio_read(cphy, MDIO_MMD_PMAPMD, MDIO_PMA_LASI_STAT, &val);

/* Read this register after the others above it else
* the register doesn't clear correctly.
Expand All @@ -135,12 +136,12 @@ static int mv88x201x_interrupt_clear(struct cphy *cphy)
/* Clear link status. */
cphy_mdio_read(cphy, MDIO_MMD_PMAPMD, MDIO_STAT1, &val);
/* Clear PHY LASI interrupts. */
cphy_mdio_read(cphy, MDIO_MMD_PMAPMD, 0x9005, &val);
cphy_mdio_read(cphy, MDIO_MMD_PMAPMD, MDIO_PMA_LASI_STAT, &val);

#ifdef MV88x2010_LINK_STATUS_BUGS
/* Do it again. */
cphy_mdio_read(cphy, MDIO_MMD_PMAPMD, 0x9003, &val);
cphy_mdio_read(cphy, MDIO_MMD_PMAPMD, 0x9004, &val);
cphy_mdio_read(cphy, MDIO_MMD_PMAPMD, MDIO_PMA_LASI_RXSTAT, &val);
cphy_mdio_read(cphy, MDIO_MMD_PMAPMD, MDIO_PMA_LASI_TXSTAT, &val);
#endif

/* Clear Marvell interrupts through Elmer0. */
Expand Down Expand Up @@ -208,7 +209,7 @@ static struct cphy_ops mv88x201x_ops = {
MDIO_DEVS_PHYXS | MDIO_DEVS_WIS),
};

static struct cphy *mv88x201x_phy_create(adapter_t *adapter, int phy_addr,
static struct cphy *mv88x201x_phy_create(struct net_device *dev, int phy_addr,
const struct mdio_ops *mdio_ops)
{
u32 val;
Expand All @@ -217,7 +218,7 @@ static struct cphy *mv88x201x_phy_create(adapter_t *adapter, int phy_addr,
if (!cphy)
return NULL;

cphy_init(cphy, adapter, phy_addr, &mv88x201x_ops, mdio_ops);
cphy_init(cphy, dev, phy_addr, &mv88x201x_ops, mdio_ops);

/* Commands the PHY to enable XFP's clock. */
cphy_mdio_read(cphy, MDIO_MMD_PCS, 0x8300, &val);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/chelsio/my3126.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,15 @@ static struct cphy_ops my3126_ops = {
MDIO_DEVS_PHYXS),
};

static struct cphy *my3126_phy_create(adapter_t *adapter,
static struct cphy *my3126_phy_create(struct net_device *dev,
int phy_addr, const struct mdio_ops *mdio_ops)
{
struct cphy *cphy = kzalloc(sizeof (*cphy), GFP_KERNEL);

if (!cphy)
return NULL;

cphy_init(cphy, adapter, phy_addr, &my3126_ops, mdio_ops);
cphy_init(cphy, dev, phy_addr, &my3126_ops, mdio_ops);
INIT_DELAYED_WORK(&cphy->phy_update, my3216_poll);
cphy->bmsr = 0;

Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/net/chelsio/subr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1135,14 +1135,13 @@ int __devinit t1_init_sw_modules(adapter_t *adapter,
struct cmac *mac;
int phy_addr = bi->mdio_phybaseaddr + i;

adapter->port[i].phy = bi->gphy->create(adapter, phy_addr,
bi->mdio_ops);
adapter->port[i].phy = bi->gphy->create(adapter->port[i].dev,
phy_addr, bi->mdio_ops);
if (!adapter->port[i].phy) {
CH_ERR("%s: PHY %d initialization failed\n",
adapter->name, i);
goto error;
}
adapter->port[i].phy->mdio.dev = adapter->port[i].dev;

adapter->port[i].mac = mac = bi->gmac->create(adapter, i);
if (!mac) {
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/cxgb3/ael1002.c
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,8 @@ static int ael2005_reset(struct cphy *phy, int wait)
int err;
unsigned int lasi_ctrl;

err = t3_mdio_read(phy, MDIO_MMD_PMAPMD, LASI_CTRL, &lasi_ctrl);
err = t3_mdio_read(phy, MDIO_MMD_PMAPMD, MDIO_PMA_LASI_CTRL,
&lasi_ctrl);
if (err)
return err;

Expand Down
10 changes: 0 additions & 10 deletions trunk/drivers/net/cxgb3/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -521,16 +521,6 @@ enum {
MAC_RXFIFO_SIZE = 32768
};

/* LASI control and status registers */
enum {
RX_ALARM_CTRL = 0x9000,
TX_ALARM_CTRL = 0x9001,
LASI_CTRL = 0x9002,
RX_ALARM_STAT = 0x9003,
TX_ALARM_STAT = 0x9004,
LASI_STAT = 0x9005
};

/* PHY loopback direction */
enum {
PHY_LOOPBACK_TX = 1,
Expand Down
14 changes: 8 additions & 6 deletions trunk/drivers/net/cxgb3/t3_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,29 +472,31 @@ int t3_set_phy_speed_duplex(struct cphy *phy, int speed, int duplex)

int t3_phy_lasi_intr_enable(struct cphy *phy)
{
return t3_mdio_write(phy, MDIO_MMD_PMAPMD, LASI_CTRL, 1);
return t3_mdio_write(phy, MDIO_MMD_PMAPMD, MDIO_PMA_LASI_CTRL,
MDIO_PMA_LASI_LSALARM);
}

int t3_phy_lasi_intr_disable(struct cphy *phy)
{
return t3_mdio_write(phy, MDIO_MMD_PMAPMD, LASI_CTRL, 0);
return t3_mdio_write(phy, MDIO_MMD_PMAPMD, MDIO_PMA_LASI_CTRL, 0);
}

int t3_phy_lasi_intr_clear(struct cphy *phy)
{
u32 val;

return t3_mdio_read(phy, MDIO_MMD_PMAPMD, LASI_STAT, &val);
return t3_mdio_read(phy, MDIO_MMD_PMAPMD, MDIO_PMA_LASI_STAT, &val);
}

int t3_phy_lasi_intr_handler(struct cphy *phy)
{
unsigned int status;
int err = t3_mdio_read(phy, MDIO_MMD_PMAPMD, LASI_STAT, &status);
int err = t3_mdio_read(phy, MDIO_MMD_PMAPMD, MDIO_PMA_LASI_STAT,
&status);

if (err)
return err;
return (status & 1) ? cphy_cause_link_change : 0;
return (status & MDIO_PMA_LASI_LSALARM) ? cphy_cause_link_change : 0;
}

static const struct adapter_info t3_adap_info[] = {
Expand Down Expand Up @@ -3864,11 +3866,11 @@ int t3_prep_adapter(struct adapter *adapter, const struct adapter_info *ai,
return -EINVAL;
}

p->phy.mdio.dev = adapter->port[i];
ret = pti->phy_prep(&p->phy, adapter, ai->phy_base_addr + j,
ai->mdio_ops);
if (ret)
return ret;
p->phy.mdio.dev = adapter->port[i];
mac_prep(&p->mac, adapter, j);

/*
Expand Down
12 changes: 9 additions & 3 deletions trunk/drivers/net/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,11 @@ void igb_down(struct igb_adapter *adapter)
igb_reset(adapter);
igb_clean_all_tx_rings(adapter);
igb_clean_all_rx_rings(adapter);
#ifdef CONFIG_IGB_DCA

/* since we reset the hardware DCA settings were cleared */
igb_setup_dca(adapter);
#endif
}

void igb_reinit_locked(struct igb_adapter *adapter)
Expand Down Expand Up @@ -1457,9 +1462,6 @@ static int __devinit igb_probe(struct pci_dev *pdev,
if (dca_add_requester(&pdev->dev) == 0) {
adapter->flags |= IGB_FLAG_DCA_ENABLED;
dev_info(&pdev->dev, "DCA enabled\n");
/* Always use CB2 mode, difference is masked
* in the CB driver. */
wr32(E1000_DCA_CTRL, E1000_DCA_CTRL_DCA_MODE_CB2);
igb_setup_dca(adapter);
}
#endif
Expand Down Expand Up @@ -3771,11 +3773,15 @@ static void igb_update_tx_dca(struct igb_ring *tx_ring)

static void igb_setup_dca(struct igb_adapter *adapter)
{
struct e1000_hw *hw = &adapter->hw;
int i;

if (!(adapter->flags & IGB_FLAG_DCA_ENABLED))
return;

/* Always use CB2 mode, difference is masked in the CB driver. */
wr32(E1000_DCA_CTRL, E1000_DCA_CTRL_DCA_MODE_CB2);

for (i = 0; i < adapter->num_tx_queues; i++) {
adapter->tx_ring[i].cpu = -1;
igb_update_tx_dca(&adapter->tx_ring[i]);
Expand Down
24 changes: 4 additions & 20 deletions trunk/drivers/net/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,9 @@ static void ixgbe_setup_dca(struct ixgbe_adapter *adapter)
if (!(adapter->flags & IXGBE_FLAG_DCA_ENABLED))
return;

/* always use CB2 mode, difference is masked in the CB driver */
IXGBE_WRITE_REG(&adapter->hw, IXGBE_DCA_CTRL, 2);

for (i = 0; i < adapter->num_tx_queues; i++) {
adapter->tx_ring[i].cpu = -1;
ixgbe_update_tx_dca(adapter, &adapter->tx_ring[i]);
Expand All @@ -432,9 +435,6 @@ static int __ixgbe_notify_dca(struct device *dev, void *data)
/* if we're already enabled, don't do it again */
if (adapter->flags & IXGBE_FLAG_DCA_ENABLED)
break;
/* Always use CB2 mode, difference is masked
* in the CB driver. */
IXGBE_WRITE_REG(&adapter->hw, IXGBE_DCA_CTRL, 2);
if (dca_add_requester(dev) == 0) {
adapter->flags |= IXGBE_FLAG_DCA_ENABLED;
ixgbe_setup_dca(adapter);
Expand Down Expand Up @@ -2767,27 +2767,14 @@ void ixgbe_down(struct ixgbe_adapter *adapter)

netif_carrier_off(netdev);

#ifdef CONFIG_IXGBE_DCA
if (adapter->flags & IXGBE_FLAG_DCA_ENABLED) {
adapter->flags &= ~IXGBE_FLAG_DCA_ENABLED;
dca_remove_requester(&adapter->pdev->dev);
}

#endif
if (!pci_channel_offline(adapter->pdev))
ixgbe_reset(adapter);
ixgbe_clean_all_tx_rings(adapter);
ixgbe_clean_all_rx_rings(adapter);

#ifdef CONFIG_IXGBE_DCA
/* since we reset the hardware DCA settings were cleared */
if (dca_add_requester(&adapter->pdev->dev) == 0) {
adapter->flags |= IXGBE_FLAG_DCA_ENABLED;
/* always use CB2 mode, difference is masked
* in the CB driver */
IXGBE_WRITE_REG(hw, IXGBE_DCA_CTRL, 2);
ixgbe_setup_dca(adapter);
}
ixgbe_setup_dca(adapter);
#endif
}

Expand Down Expand Up @@ -5354,9 +5341,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
#ifdef CONFIG_IXGBE_DCA
if (dca_add_requester(&pdev->dev) == 0) {
adapter->flags |= IXGBE_FLAG_DCA_ENABLED;
/* always use CB2 mode, difference is masked
* in the CB driver */
IXGBE_WRITE_REG(hw, IXGBE_DCA_CTRL, 2);
ixgbe_setup_dca(adapter);
}
#endif
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/net/mlx4/en_cq.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq)
*cq->mcq.arm_db = 0;
memset(cq->buf, 0, cq->buf_size);

if (!cq->is_tx)
cq->size = priv->rx_ring[cq->ring].actual_size;

err = mlx4_cq_alloc(mdev->dev, cq->size, &cq->wqres.mtt, &mdev->priv_uar,
cq->wqres.db.dma, &cq->mcq, cq->vector, cq->is_tx);
if (err)
Expand Down
Loading

0 comments on commit 5236dbc

Please sign in to comment.