Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 24 Aug 2010 01:30:30 +0000 (18:30 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 24 Aug 2010 01:30:30 +0000 (18:30 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (27 commits)
  netfilter: fix CONFIG_COMPAT support
  isdn/avm: fix build when PCMCIA is not enabled
  header: fix broken headers for user space
  e1000e: don't check for alternate MAC addr on parts that don't support it
  e1000e: disable ASPM L1 on 82573
  ll_temac: Fix poll implementation
  netxen: fix a race in netxen_nic_get_stats()
  qlnic: fix a race in qlcnic_get_stats()
  irda: fix a race in irlan_eth_xmit()
  net: sh_eth: remove unused variable
  netxen: update version 4.0.74
  netxen: fix inconsistent lock state
  vlan: Match underlying dev carrier on vlan add
  ibmveth: Fix opps during MTU change on an active device
  ehea: Fix synchronization between HW and SW send queue
  bnx2x: Update bnx2x version to 1.52.53-4
  bnx2x: Fix PHY locking problem
  rds: fix a leak of kernel memory
  netlink: fix compat recvmsg
  netfilter: fix userspace header warning
  ...

1  2 
drivers/net/Kconfig
drivers/net/ehea/ehea.h
drivers/net/ehea/ehea_main.c
drivers/net/ll_temac_main.c

diff --combined drivers/net/Kconfig
index 5a6895320b48a8d7774acfb4e6b239713cc6bd9d,fe581566cb266231cd051ee1593ae35d82f49022..2cc81a54cbf322a49ccbf474f5d41f654faf109d
@@@ -484,7 -484,7 +484,7 @@@ config XTENSA_XT2000_SONI
  
  config MIPS_AU1X00_ENET
        tristate "MIPS AU1000 Ethernet support"
 -      depends on SOC_AU1X00
 +      depends on MIPS_ALCHEMY
        select PHYLIB
        select CRC32
        help
@@@ -914,7 -914,7 +914,7 @@@ config SMC91
        tristate "SMC 91C9x/91C1xxx support"
        select CRC32
        select MII
 -      depends on ARM || REDWOOD_5 || REDWOOD_6 || M32R || SUPERH || \
 +      depends on ARM || M32R || SUPERH || \
                MIPS || BLACKFIN || MN10300 || COLDFIRE
        help
          This is a driver for SMC's 91x series of Ethernet chipsets,
          The module will be called smc91x.  If you want to compile it as a
          module, say M here and read <file:Documentation/kbuild/modules.txt>.
  
+ config PXA168_ETH
+       tristate "Marvell pxa168 ethernet support"
+       depends on CPU_PXA168
+       select PHYLIB
+       help
+         This driver supports the pxa168 Ethernet ports.
+         To compile this driver as a module, choose M here. The module
+         will be called pxa168_eth.
  config NET_NETX
        tristate "NetX Ethernet support"
        select MII
diff --combined drivers/net/ehea/ehea.h
index 99a929964e3cebde15667e59d913debd6d205b20,2ce67f6152cd53a0c02325c743cc040bc9e7bbde..1846623c6ae65d18b6223ada9be4531809f64a99
@@@ -40,7 -40,7 +40,7 @@@
  #include <asm/io.h>
  
  #define DRV_NAME      "ehea"
- #define DRV_VERSION   "EHEA_0105"
+ #define DRV_VERSION   "EHEA_0106"
  
  /* eHEA capability flags */
  #define DLPAR_PORT_ADD_REM 1
@@@ -400,6 -400,7 +400,7 @@@ struct ehea_port_res 
        u32 poll_counter;
        struct net_lro_mgr lro_mgr;
        struct net_lro_desc lro_desc[MAX_LRO_DESCRIPTORS];
+       int sq_restart_flag;
  };
  
  
  
  struct ehea_adapter {
        u64 handle;
 -      struct of_device *ofdev;
 +      struct platform_device *ofdev;
        struct ehea_port *port[EHEA_MAX_PORTS];
        struct ehea_eq *neq;       /* notification event queue */
        struct tasklet_struct neq_tasklet;
@@@ -465,7 -466,7 +466,7 @@@ struct ehea_port 
        struct net_device *netdev;
        struct net_device_stats stats;
        struct ehea_port_res port_res[EHEA_MAX_PORT_RES];
 -      struct of_device  ofdev; /* Open Firmware Device */
 +      struct platform_device  ofdev; /* Open Firmware Device */
        struct ehea_mc_list *mc_list;    /* Multicast MAC addresses */
        struct vlan_group *vgrp;
        struct ehea_eq *qp_eq;
index 897719b49f96859b11a1f01f4f45e46c03c4cd71,adb5994c125f1f5b5113c3c7c8f0b36f189e05d4..a333b42111b8c2ba20b92eca94bf5648704c4f9a
@@@ -107,10 -107,10 +107,10 @@@ struct ehea_fw_handle_array ehea_fw_han
  struct ehea_bcmc_reg_array ehea_bcmc_regs;
  
  
 -static int __devinit ehea_probe_adapter(struct of_device *dev,
 +static int __devinit ehea_probe_adapter(struct platform_device *dev,
                                        const struct of_device_id *id);
  
 -static int __devexit ehea_remove(struct of_device *dev);
 +static int __devexit ehea_remove(struct platform_device *dev);
  
  static struct of_device_id ehea_device_table[] = {
        {
@@@ -776,6 -776,53 +776,53 @@@ static int ehea_proc_rwqes(struct net_d
        return processed;
  }
  
+ #define SWQE_RESTART_CHECK 0xdeadbeaff00d0000ull
+ static void reset_sq_restart_flag(struct ehea_port *port)
+ {
+       int i;
+       for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+               struct ehea_port_res *pr = &port->port_res[i];
+               pr->sq_restart_flag = 0;
+       }
+ }
+ static void check_sqs(struct ehea_port *port)
+ {
+       struct ehea_swqe *swqe;
+       int swqe_index;
+       int i, k;
+       for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+               struct ehea_port_res *pr = &port->port_res[i];
+               k = 0;
+               swqe = ehea_get_swqe(pr->qp, &swqe_index);
+               memset(swqe, 0, SWQE_HEADER_SIZE);
+               atomic_dec(&pr->swqe_avail);
+               swqe->tx_control |= EHEA_SWQE_PURGE;
+               swqe->wr_id = SWQE_RESTART_CHECK;
+               swqe->tx_control |= EHEA_SWQE_SIGNALLED_COMPLETION;
+               swqe->tx_control |= EHEA_SWQE_IMM_DATA_PRESENT;
+               swqe->immediate_data_length = 80;
+               ehea_post_swqe(pr->qp, swqe);
+               while (pr->sq_restart_flag == 0) {
+                       msleep(5);
+                       if (++k == 100) {
+                               ehea_error("HW/SW queues out of sync");
+                               ehea_schedule_port_reset(pr->port);
+                               return;
+                       }
+               }
+       }
+       return;
+ }
  static struct ehea_cqe *ehea_proc_cqes(struct ehea_port_res *pr, int my_quota)
  {
        struct sk_buff *skb;
  
                cqe_counter++;
                rmb();
+               if (cqe->wr_id == SWQE_RESTART_CHECK) {
+                       pr->sq_restart_flag = 1;
+                       swqe_av++;
+                       break;
+               }
                if (cqe->status & EHEA_CQE_STAT_ERR_MASK) {
                        ehea_error("Bad send completion status=0x%04X",
                                   cqe->status);
@@@ -2675,8 -2729,10 +2729,10 @@@ static void ehea_flush_sq(struct ehea_p
                int k = 0;
                while (atomic_read(&pr->swqe_avail) < swqe_max) {
                        msleep(5);
-                       if (++k == 20)
+                       if (++k == 20) {
+                               ehea_error("WARNING: sq not flushed completely");
                                break;
+                       }
                }
        }
  }
@@@ -2917,6 -2973,7 +2973,7 @@@ static void ehea_rereg_mrs(struct work_
                                        port_napi_disable(port);
                                        mutex_unlock(&port->port_lock);
                                }
+                               reset_sq_restart_flag(port);
                        }
  
                        /* Unregister old memory region */
                                                mutex_lock(&port->port_lock);
                                                port_napi_enable(port);
                                                ret = ehea_restart_qps(dev);
+                                               check_sqs(port);
                                                if (!ret)
                                                        netif_wake_queue(dev);
                                                mutex_unlock(&port->port_lock);
@@@ -3376,7 -3434,7 +3434,7 @@@ static ssize_t ehea_remove_port(struct 
  static DEVICE_ATTR(probe_port, S_IWUSR, NULL, ehea_probe_port);
  static DEVICE_ATTR(remove_port, S_IWUSR, NULL, ehea_remove_port);
  
 -int ehea_create_device_sysfs(struct of_device *dev)
 +int ehea_create_device_sysfs(struct platform_device *dev)
  {
        int ret = device_create_file(&dev->dev, &dev_attr_probe_port);
        if (ret)
        return ret;
  }
  
 -void ehea_remove_device_sysfs(struct of_device *dev)
 +void ehea_remove_device_sysfs(struct platform_device *dev)
  {
        device_remove_file(&dev->dev, &dev_attr_probe_port);
        device_remove_file(&dev->dev, &dev_attr_remove_port);
  }
  
 -static int __devinit ehea_probe_adapter(struct of_device *dev,
 +static int __devinit ehea_probe_adapter(struct platform_device *dev,
                                        const struct of_device_id *id)
  {
        struct ehea_adapter *adapter;
@@@ -3492,7 -3550,7 +3550,7 @@@ out
        return ret;
  }
  
 -static int __devexit ehea_remove(struct of_device *dev)
 +static int __devexit ehea_remove(struct platform_device *dev)
  {
        struct ehea_adapter *adapter = dev_get_drvdata(&dev->dev);
        int i;
index c7b624711f5ecfc51981845857bda27ef264fa3e,09b813f1c3cdc09af9a036a3825e95123c8fb6a4..bdf2149e529689b1135603904da6343fcbbbebc2
@@@ -159,7 -159,7 +159,7 @@@ static void temac_dma_dcr_out(struct te
   * temac_dcr_setup - If the DMA is DCR based, then setup the address and
   * I/O  functions
   */
 -static int temac_dcr_setup(struct temac_local *lp, struct of_device *op,
 +static int temac_dcr_setup(struct temac_local *lp, struct platform_device *op,
                                struct device_node *np)
  {
        unsigned int dcrs;
   * temac_dcr_setup - This is a stub for when DCR is not supported,
   * such as with MicroBlaze
   */
 -static int temac_dcr_setup(struct temac_local *lp, struct of_device *op,
 +static int temac_dcr_setup(struct temac_local *lp, struct platform_device *op,
                                struct device_node *np)
  {
        return -1;
@@@ -902,8 -902,8 +902,8 @@@ temac_poll_controller(struct net_devic
        disable_irq(lp->tx_irq);
        disable_irq(lp->rx_irq);
  
-       ll_temac_rx_irq(lp->tx_irq, lp);
-       ll_temac_tx_irq(lp->rx_irq, lp);
+       ll_temac_rx_irq(lp->tx_irq, ndev);
+       ll_temac_tx_irq(lp->rx_irq, ndev);
  
        enable_irq(lp->tx_irq);
        enable_irq(lp->rx_irq);
@@@ -952,7 -952,7 +952,7 @@@ static const struct attribute_group tem
  };
  
  static int __init
 -temac_of_probe(struct of_device *op, const struct of_device_id *match)
 +temac_of_probe(struct platform_device *op, const struct of_device_id *match)
  {
        struct device_node *np;
        struct temac_local *lp;
        return rc;
  }
  
 -static int __devexit temac_of_remove(struct of_device *op)
 +static int __devexit temac_of_remove(struct platform_device *op)
  {
        struct net_device *ndev = dev_get_drvdata(&op->dev);
        struct temac_local *lp = netdev_priv(ndev);