]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'sh/for-2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 16 Dec 2008 17:47:58 +0000 (09:47 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 16 Dec 2008 17:47:58 +0000 (09:47 -0800)
* 'sh/for-2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh: Disable GENERIC_HARDIRQS_NO__DO_IRQ for unconverted platforms.
  sh: maple: Do not pass SLAB_POISON to kmem_cache_create()

27 files changed:
Documentation/arm/mem_alignment
MAINTAINERS
arch/arm/common/sa1111.c
arch/arm/kernel/armksyms.c
arch/arm/kernel/traps.c
arch/arm/mach-pxa/include/mach/reset.h
arch/arm/mm/fault.c
arch/ia64/hp/sim/Kconfig
arch/powerpc/mm/hugetlbpage.c
arch/powerpc/mm/numa.c
arch/powerpc/platforms/cell/axon_msi.c
drivers/acpi/toshiba_acpi.c
drivers/net/e1000e/ich8lan.c
drivers/net/sungem.c
drivers/pcmcia/bfin_cf_pcmcia.c
include/linux/netdevice.h
include/linux/smp.h
kernel/cgroup.c
mm/migrate.c
mm/slob.c
net/core/netpoll.c
net/ipv4/netfilter/nf_nat_rule.c
net/ipv4/tcp_vegas.c
net/ipv6/ndisc.c
net/netlabel/netlabel_unlabeled.c
net/phonet/pep-gprs.c
net/sched/sch_netem.c

index d145ccca169a37aa3ff42b06c734d9068525d9d7..c7c7a114c78c795c702f8543c57c7558466a9a4b 100644 (file)
@@ -24,7 +24,7 @@ real bad - it changes the behaviour of all unaligned instructions in user
 space, and might cause programs to fail unexpectedly.
 
 To change the alignment trap behavior, simply echo a number into
-/proc/sys/debug/alignment.  The number is made up from various bits:
+/proc/cpu/alignment.  The number is made up from various bits:
 
 bit            behavior when set
 ---            -----------------
index 24741de12a39b8d680974f385770842e0b376bf0..09ed704f4dda336ddcea7ca28e7a301e3011dde1 100644 (file)
@@ -1527,10 +1527,10 @@ W:      http://ebtables.sourceforge.net/
 S:     Maintained
 
 ECRYPT FILE SYSTEM
-P:     Mike Halcrow, Phillip Hellewell
-M:     mhalcrow@us.ibm.com, phillip@hellewell.homeip.net
-L:     ecryptfs-devel@lists.sourceforge.net
-W:     http://ecryptfs.sourceforge.net/
+P:     Tyler Hicks, Dustin Kirkland
+M:     tyhicks@linux.vnet.ibm.com, kirkland@canonical.com
+L:     ecryptfs-devel@lists.launchpad.net
+W:     https://launchpad.net/ecryptfs
 S:     Supported
 
 EDAC-CORE
index 47ccec95f3e867ce5141f7e0db7bdb7f2e57667d..ef12794c3c68f7f2d6be4ec3dcda643540ed091d 100644 (file)
@@ -630,7 +630,7 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq)
                return -ENOMEM;
 
        sachip->clk = clk_get(me, "SA1111_CLK");
-       if (!sachip->clk) {
+       if (IS_ERR(sachip->clk)) {
                ret = PTR_ERR(sachip->clk);
                goto err_free;
        }
index c74f766ffc124406e56ab76918db8bdf4c1e30ec..23af3c972c9a7d202c0a71a340e29067d4ac8d74 100644 (file)
@@ -115,6 +115,8 @@ EXPORT_SYMBOL(__strnlen_user);
 EXPORT_SYMBOL(__strncpy_from_user);
 
 #ifdef CONFIG_MMU
+EXPORT_SYMBOL(copy_page);
+
 EXPORT_SYMBOL(__copy_from_user);
 EXPORT_SYMBOL(__copy_to_user);
 EXPORT_SYMBOL(__clear_user);
@@ -181,8 +183,6 @@ EXPORT_SYMBOL(_find_first_bit_be);
 EXPORT_SYMBOL(_find_next_bit_be);
 #endif
 
-EXPORT_SYMBOL(copy_page);
-
 #ifdef CONFIG_FUNCTION_TRACER
 EXPORT_SYMBOL(mcount);
 #endif
index 57e6874d0b809a21a27afe21d436fa8dca9046e9..79abc4ddc0cf602cf8ae77728fefd8d2080ea826 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/personality.h>
 #include <linux/kallsyms.h>
 #include <linux/delay.h>
+#include <linux/hardirq.h>
 #include <linux/init.h>
 #include <linux/uaccess.h>
 
index 7b8842cfa5fce30753914f538a0d125d2d1a349d..31e6a7b6ad80d27f055b9ce49da0b7e036e06755 100644 (file)
@@ -12,9 +12,8 @@ extern void clear_reset_status(unsigned int mask);
 
 /**
  * init_gpio_reset() - register GPIO as reset generator
- *
- * @gpio - gpio nr
- * @output - set gpio as out/low instead of input during normal work
+ * @gpio: gpio nr
+ * @output: set gpio as out/low instead of input during normal work
  */
 extern int init_gpio_reset(int gpio, int output);
 
index 2df8d9facf5741c060bb9f028c93b7c3bbe33a6e..22c9530e91e2fd8568fa78e1e5aec95ed7a72a24 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/module.h>
 #include <linux/signal.h>
 #include <linux/mm.h>
+#include <linux/hardirq.h>
 #include <linux/init.h>
 #include <linux/kprobes.h>
 #include <linux/uaccess.h>
index f92306bbedb848eb146ece3afde7729abdddac13..8d513a8c5266b4db31ef1cb6fd6eb75777c7dda3 100644 (file)
@@ -4,6 +4,7 @@ menu "HP Simulator drivers"
 
 config HP_SIMETH
        bool "Simulated Ethernet "
+       depends on NET
 
 config HP_SIMSERIAL
        bool "Simulated serial driver support"
index 7bbf4e4ed4306b3a395906b6307808df326fb7cf..f0c3b88d50fa5a5f98847bd1914be1881885af9d 100644 (file)
@@ -507,6 +507,9 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
 {
        struct hstate *hstate = hstate_file(file);
        int mmu_psize = shift_to_mmu_psize(huge_page_shift(hstate));
+
+       if (!mmu_huge_psizes[mmu_psize])
+               return -EINVAL;
        return slice_get_unmapped_area(addr, len, flags, mmu_psize, 1, 0);
 }
 
index a8397bbad3d4d54a5cd50ae9ee201118c767d1d4..cf81049e1e51a0ce98d0ebdf9b7a74d5901de211 100644 (file)
@@ -901,10 +901,17 @@ static void mark_reserved_regions_for_nid(int nid)
                        if (end_pfn > node_ar.end_pfn)
                                reserve_size = (node_ar.end_pfn << PAGE_SHIFT)
                                        - (start_pfn << PAGE_SHIFT);
-                       dbg("reserve_bootmem %lx %lx nid=%d\n", physbase,
-                               reserve_size, node_ar.nid);
-                       reserve_bootmem_node(NODE_DATA(node_ar.nid), physbase,
-                                               reserve_size, BOOTMEM_DEFAULT);
+                       /*
+                        * Only worry about *this* node, others may not
+                        * yet have valid NODE_DATA().
+                        */
+                       if (node_ar.nid == nid) {
+                               dbg("reserve_bootmem %lx %lx nid=%d\n",
+                                       physbase, reserve_size, node_ar.nid);
+                               reserve_bootmem_node(NODE_DATA(node_ar.nid),
+                                               physbase, reserve_size,
+                                               BOOTMEM_DEFAULT);
+                       }
                        /*
                         * if reserved region is contained in the active region
                         * then done.
@@ -929,7 +936,6 @@ static void mark_reserved_regions_for_nid(int nid)
 void __init do_init_bootmem(void)
 {
        int nid;
-       unsigned int i;
 
        min_low_pfn = 0;
        max_low_pfn = lmb_end_of_DRAM() >> PAGE_SHIFT;
index 442cf36aa172920b355710e65a68624d43293d33..0ce45c2b42f8eb67a1ea5156fcf476bdb3f3924a 100644 (file)
@@ -413,6 +413,9 @@ static int axon_msi_probe(struct of_device *device,
                        MSIC_CTRL_IRQ_ENABLE | MSIC_CTRL_ENABLE |
                        MSIC_CTRL_FIFO_SIZE);
 
+       msic->read_offset = dcr_read(msic->dcr_host, MSIC_WRITE_OFFSET_REG)
+                               & MSIC_FIFO_SIZE_MASK;
+
        device->dev.platform_data = msic;
 
        ppc_md.setup_msi_irqs = axon_msi_setup_msi_irqs;
index 25f531d892deacbb5082b0696f0ba460c48a5494..40e60fc2e596daead5c656396aa84fca0587868b 100644 (file)
@@ -824,32 +824,36 @@ static int __init toshiba_acpi_init(void)
                        toshiba_acpi_exit();
                        return -ENOMEM;
                }
-       }
 
-       /* Register input device for kill switch */
-       toshiba_acpi.poll_dev = input_allocate_polled_device();
-       if (!toshiba_acpi.poll_dev) {
-               printk(MY_ERR "unable to allocate kill-switch input device\n");
-               toshiba_acpi_exit();
-               return -ENOMEM;
-       }
-       toshiba_acpi.poll_dev->private = &toshiba_acpi;
-       toshiba_acpi.poll_dev->poll = bt_poll_rfkill;
-       toshiba_acpi.poll_dev->poll_interval = 1000; /* msecs */
-
-       toshiba_acpi.poll_dev->input->name = toshiba_acpi.rfk_name;
-       toshiba_acpi.poll_dev->input->id.bustype = BUS_HOST;
-       toshiba_acpi.poll_dev->input->id.vendor = 0x0930; /* Toshiba USB ID */
-       set_bit(EV_SW, toshiba_acpi.poll_dev->input->evbit);
-       set_bit(SW_RFKILL_ALL, toshiba_acpi.poll_dev->input->swbit);
-       input_report_switch(toshiba_acpi.poll_dev->input, SW_RFKILL_ALL, TRUE);
-       input_sync(toshiba_acpi.poll_dev->input);
-
-       ret = input_register_polled_device(toshiba_acpi.poll_dev);
-       if (ret) {
-               printk(MY_ERR "unable to register kill-switch input device\n");
-               toshiba_acpi_exit();
-               return ret;
+               /* Register input device for kill switch */
+               toshiba_acpi.poll_dev = input_allocate_polled_device();
+               if (!toshiba_acpi.poll_dev) {
+                       printk(MY_ERR
+                              "unable to allocate kill-switch input device\n");
+                       toshiba_acpi_exit();
+                       return -ENOMEM;
+               }
+               toshiba_acpi.poll_dev->private = &toshiba_acpi;
+               toshiba_acpi.poll_dev->poll = bt_poll_rfkill;
+               toshiba_acpi.poll_dev->poll_interval = 1000; /* msecs */
+
+               toshiba_acpi.poll_dev->input->name = toshiba_acpi.rfk_name;
+               toshiba_acpi.poll_dev->input->id.bustype = BUS_HOST;
+               /* Toshiba USB ID */
+               toshiba_acpi.poll_dev->input->id.vendor = 0x0930;
+               set_bit(EV_SW, toshiba_acpi.poll_dev->input->evbit);
+               set_bit(SW_RFKILL_ALL, toshiba_acpi.poll_dev->input->swbit);
+               input_report_switch(toshiba_acpi.poll_dev->input,
+                                   SW_RFKILL_ALL, TRUE);
+               input_sync(toshiba_acpi.poll_dev->input);
+
+               ret = input_register_polled_device(toshiba_acpi.poll_dev);
+               if (ret) {
+                       printk(MY_ERR
+                              "unable to register kill-switch input device\n");
+                       toshiba_acpi_exit();
+                       return ret;
+               }
        }
 
        return 0;
index 523b9716a543aec21d923b58a07cd5162b3edab3..d115a6d30f29c0b3acb81c8038c6215993980e8d 100644 (file)
@@ -1893,12 +1893,17 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
                ctrl |= E1000_CTRL_PHY_RST;
        }
        ret_val = e1000_acquire_swflag_ich8lan(hw);
+       /* Whether or not the swflag was acquired, we need to reset the part */
        hw_dbg(hw, "Issuing a global reset to ich8lan");
        ew32(CTRL, (ctrl | E1000_CTRL_RST));
        msleep(20);
 
-       /* release the swflag because it is not reset by hardware reset */
-       e1000_release_swflag_ich8lan(hw);
+       if (!ret_val) {
+               /* release the swflag because it is not reset by
+                * hardware reset
+                */
+               e1000_release_swflag_ich8lan(hw);
+       }
 
        ret_val = e1000e_get_auto_rd_done(hw);
        if (ret_val) {
index 1349e419673ca348dbe5aa22b3b5b27f1a1056dd..fed7eba65ead6268e292eddc66c73905d8e263c7 100644 (file)
@@ -1142,6 +1142,70 @@ static int gem_start_xmit(struct sk_buff *skb, struct net_device *dev)
        return NETDEV_TX_OK;
 }
 
+static void gem_pcs_reset(struct gem *gp)
+{
+       int limit;
+       u32 val;
+
+       /* Reset PCS unit. */
+       val = readl(gp->regs + PCS_MIICTRL);
+       val |= PCS_MIICTRL_RST;
+       writel(val, gp->regs + PCS_MIICTRL);
+
+       limit = 32;
+       while (readl(gp->regs + PCS_MIICTRL) & PCS_MIICTRL_RST) {
+               udelay(100);
+               if (limit-- <= 0)
+                       break;
+       }
+       if (limit <= 0)
+               printk(KERN_WARNING "%s: PCS reset bit would not clear.\n",
+                      gp->dev->name);
+}
+
+static void gem_pcs_reinit_adv(struct gem *gp)
+{
+       u32 val;
+
+       /* Make sure PCS is disabled while changing advertisement
+        * configuration.
+        */
+       val = readl(gp->regs + PCS_CFG);
+       val &= ~(PCS_CFG_ENABLE | PCS_CFG_TO);
+       writel(val, gp->regs + PCS_CFG);
+
+       /* Advertise all capabilities except assymetric
+        * pause.
+        */
+       val = readl(gp->regs + PCS_MIIADV);
+       val |= (PCS_MIIADV_FD | PCS_MIIADV_HD |
+               PCS_MIIADV_SP | PCS_MIIADV_AP);
+       writel(val, gp->regs + PCS_MIIADV);
+
+       /* Enable and restart auto-negotiation, disable wrapback/loopback,
+        * and re-enable PCS.
+        */
+       val = readl(gp->regs + PCS_MIICTRL);
+       val |= (PCS_MIICTRL_RAN | PCS_MIICTRL_ANE);
+       val &= ~PCS_MIICTRL_WB;
+       writel(val, gp->regs + PCS_MIICTRL);
+
+       val = readl(gp->regs + PCS_CFG);
+       val |= PCS_CFG_ENABLE;
+       writel(val, gp->regs + PCS_CFG);
+
+       /* Make sure serialink loopback is off.  The meaning
+        * of this bit is logically inverted based upon whether
+        * you are in Serialink or SERDES mode.
+        */
+       val = readl(gp->regs + PCS_SCTRL);
+       if (gp->phy_type == phy_serialink)
+               val &= ~PCS_SCTRL_LOOP;
+       else
+               val |= PCS_SCTRL_LOOP;
+       writel(val, gp->regs + PCS_SCTRL);
+}
+
 #define STOP_TRIES 32
 
 /* Must be invoked under gp->lock and gp->tx_lock. */
@@ -1168,6 +1232,9 @@ static void gem_reset(struct gem *gp)
 
        if (limit <= 0)
                printk(KERN_ERR "%s: SW reset is ghetto.\n", gp->dev->name);
+
+       if (gp->phy_type == phy_serialink || gp->phy_type == phy_serdes)
+               gem_pcs_reinit_adv(gp);
 }
 
 /* Must be invoked under gp->lock and gp->tx_lock. */
@@ -1324,7 +1391,7 @@ static int gem_set_link_modes(struct gem *gp)
                   gp->phy_type == phy_serdes) {
                u32 pcs_lpa = readl(gp->regs + PCS_MIILP);
 
-               if (pcs_lpa & PCS_MIIADV_FD)
+               if ((pcs_lpa & PCS_MIIADV_FD) || gp->phy_type == phy_serdes)
                        full_duplex = 1;
                speed = SPEED_1000;
        }
@@ -1488,6 +1555,9 @@ static void gem_link_timer(unsigned long data)
                        val = readl(gp->regs + PCS_MIISTAT);
 
                if ((val & PCS_MIISTAT_LS) != 0) {
+                       if (gp->lstate == link_up)
+                               goto restart;
+
                        gp->lstate = link_up;
                        netif_carrier_on(gp->dev);
                        (void)gem_set_link_modes(gp);
@@ -1708,61 +1778,8 @@ static void gem_init_phy(struct gem *gp)
                if (gp->phy_mii.def && gp->phy_mii.def->ops->init)
                        gp->phy_mii.def->ops->init(&gp->phy_mii);
        } else {
-               u32 val;
-               int limit;
-
-               /* Reset PCS unit. */
-               val = readl(gp->regs + PCS_MIICTRL);
-               val |= PCS_MIICTRL_RST;
-               writel(val, gp->regs + PCS_MIICTRL);
-
-               limit = 32;
-               while (readl(gp->regs + PCS_MIICTRL) & PCS_MIICTRL_RST) {
-                       udelay(100);
-                       if (limit-- <= 0)
-                               break;
-               }
-               if (limit <= 0)
-                       printk(KERN_WARNING "%s: PCS reset bit would not clear.\n",
-                              gp->dev->name);
-
-               /* Make sure PCS is disabled while changing advertisement
-                * configuration.
-                */
-               val = readl(gp->regs + PCS_CFG);
-               val &= ~(PCS_CFG_ENABLE | PCS_CFG_TO);
-               writel(val, gp->regs + PCS_CFG);
-
-               /* Advertise all capabilities except assymetric
-                * pause.
-                */
-               val = readl(gp->regs + PCS_MIIADV);
-               val |= (PCS_MIIADV_FD | PCS_MIIADV_HD |
-                       PCS_MIIADV_SP | PCS_MIIADV_AP);
-               writel(val, gp->regs + PCS_MIIADV);
-
-               /* Enable and restart auto-negotiation, disable wrapback/loopback,
-                * and re-enable PCS.
-                */
-               val = readl(gp->regs + PCS_MIICTRL);
-               val |= (PCS_MIICTRL_RAN | PCS_MIICTRL_ANE);
-               val &= ~PCS_MIICTRL_WB;
-               writel(val, gp->regs + PCS_MIICTRL);
-
-               val = readl(gp->regs + PCS_CFG);
-               val |= PCS_CFG_ENABLE;
-               writel(val, gp->regs + PCS_CFG);
-
-               /* Make sure serialink loopback is off.  The meaning
-                * of this bit is logically inverted based upon whether
-                * you are in Serialink or SERDES mode.
-                */
-               val = readl(gp->regs + PCS_SCTRL);
-               if (gp->phy_type == phy_serialink)
-                       val &= ~PCS_SCTRL_LOOP;
-               else
-                       val |= PCS_SCTRL_LOOP;
-               writel(val, gp->regs + PCS_SCTRL);
+               gem_pcs_reset(gp);
+               gem_pcs_reinit_adv(gp);
        }
 
        /* Default aneg parameters */
@@ -2680,6 +2697,21 @@ static int gem_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
                cmd->speed = 0;
                cmd->duplex = cmd->port = cmd->phy_address =
                        cmd->transceiver = cmd->autoneg = 0;
+
+               /* serdes means usually a Fibre connector, with most fixed */
+               if (gp->phy_type == phy_serdes) {
+                       cmd->port = PORT_FIBRE;
+                       cmd->supported = (SUPPORTED_1000baseT_Half |
+                               SUPPORTED_1000baseT_Full |
+                               SUPPORTED_FIBRE | SUPPORTED_Autoneg |
+                               SUPPORTED_Pause | SUPPORTED_Asym_Pause);
+                       cmd->advertising = cmd->supported;
+                       cmd->transceiver = XCVR_INTERNAL;
+                       if (gp->lstate == link_up)
+                               cmd->speed = SPEED_1000;
+                       cmd->duplex = DUPLEX_FULL;
+                       cmd->autoneg = 1;
+               }
        }
        cmd->maxtxpkt = cmd->maxrxpkt = 0;
 
index bb7338863fb9aabeedfbb941b59f026176919673..b59d4115d20f541e5176ba309cb694687c1c1d17 100644 (file)
@@ -334,6 +334,6 @@ static void __exit bfin_cf_exit(void)
 module_init(bfin_cf_init);
 module_exit(bfin_cf_exit);
 
-MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>")
+MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
 MODULE_DESCRIPTION("BFIN CF/PCMCIA Driver");
 MODULE_LICENSE("GPL");
index 9d77b1d7dca806e540838d27bbc632961a340f0e..e26f54952892e9c46be142344e36ceb37f19f6f0 100644 (file)
@@ -319,6 +319,7 @@ enum
 {
        NAPI_STATE_SCHED,       /* Poll is scheduled */
        NAPI_STATE_DISABLE,     /* Disable pending */
+       NAPI_STATE_NPSVC,       /* Netpoll - don't dequeue from poll_list */
 };
 
 extern void __napi_schedule(struct napi_struct *n);
@@ -1497,6 +1498,12 @@ static inline void netif_rx_complete(struct net_device *dev,
 {
        unsigned long flags;
 
+       /*
+        * don't let napi dequeue from the cpu poll list
+        * just in case its running on a different cpu
+        */
+       if (unlikely(test_bit(NAPI_STATE_NPSVC, &napi->state)))
+               return;
        local_irq_save(flags);
        __netif_rx_complete(dev, napi);
        local_irq_restore(flags);
index 3f9a60043a975617a3b8217f8e69b24751c13e01..6e7ba16ff454f878d28315c02f66572b9734bd09 100644 (file)
@@ -146,6 +146,8 @@ static inline void smp_send_reschedule(int cpu) { }
 })
 #define smp_call_function_mask(mask, func, info, wait) \
                        (up_smp_call_function(func, info))
+#define smp_call_function_many(mask, func, info, wait) \
+                       (up_smp_call_function(func, info))
 static inline void init_call_single_data(void)
 {
 }
index fe00b3b983a86387332234703217abb1d28ca202..8185a0f09594fd904ca2ab032dca27013708ff1c 100644 (file)
@@ -702,7 +702,7 @@ static int rebind_subsystems(struct cgroupfs_root *root,
         * any child cgroups exist. This is theoretically supportable
         * but involves complex error handling, so it's being left until
         * later */
-       if (!list_empty(&cgrp->children))
+       if (root->number_of_cgroups > 1)
                return -EBUSY;
 
        /* Process each subsystem */
index d8f07667fc8045e6690ab74a6e58806c7093ed7c..037b0967c1e3b40cda18e57a775d61867bafb95f 100644 (file)
@@ -998,7 +998,7 @@ static void do_pages_stat_array(struct mm_struct *mm, unsigned long nr_pages,
                unsigned long addr = (unsigned long)(*pages);
                struct vm_area_struct *vma;
                struct page *page;
-               int err;
+               int err = -EFAULT;
 
                vma = find_vma(mm, addr);
                if (!vma)
index cb675d1267914dc263100b9c4a9ea5eb20fefa48..bf7e8fc3aed806542e44cc7b1d222d9e2b56dc3a 100644 (file)
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -535,7 +535,7 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
        struct kmem_cache *c;
 
        c = slob_alloc(sizeof(struct kmem_cache),
-               flags, ARCH_KMALLOC_MINALIGN, -1);
+               GFP_KERNEL, ARCH_KMALLOC_MINALIGN, -1);
 
        if (c) {
                c->name = name;
index 6c7af390be0a515cfb1d09d2db79f16776e0dbe4..dadac6281f20392d0431d80a9001a6169ab94ca7 100644 (file)
@@ -133,9 +133,11 @@ static int poll_one_napi(struct netpoll_info *npinfo,
 
        npinfo->rx_flags |= NETPOLL_RX_DROP;
        atomic_inc(&trapped);
+       set_bit(NAPI_STATE_NPSVC, &napi->state);
 
        work = napi->poll(napi, budget);
 
+       clear_bit(NAPI_STATE_NPSVC, &napi->state);
        atomic_dec(&trapped);
        npinfo->rx_flags &= ~NETPOLL_RX_DROP;
 
index bea54a685109ed3b6fa1fe3f621fb7522ceb2de8..8d489e746b21cb513d0d1b49b3984b514f6e634c 100644 (file)
@@ -61,7 +61,7 @@ static struct
 static struct xt_table nat_table = {
        .name           = "nat",
        .valid_hooks    = NAT_VALID_HOOKS,
-       .lock           = __RW_LOCK_UNLOCKED(__nat_table.lock),
+       .lock           = __RW_LOCK_UNLOCKED(nat_table.lock),
        .me             = THIS_MODULE,
        .af             = AF_INET,
 };
index 7cd22262de3af3fa0f2917eefaea885c068855ac..a453aac91bd3b740ef44363ef10e5be5390bf6dc 100644 (file)
 
 #include "tcp_vegas.h"
 
-/* Default values of the Vegas variables, in fixed-point representation
- * with V_PARAM_SHIFT bits to the right of the binary point.
- */
-#define V_PARAM_SHIFT 1
-static int alpha = 2<<V_PARAM_SHIFT;
-static int beta  = 4<<V_PARAM_SHIFT;
-static int gamma = 1<<V_PARAM_SHIFT;
+static int alpha = 2;
+static int beta  = 4;
+static int gamma = 1;
 
 module_param(alpha, int, 0644);
-MODULE_PARM_DESC(alpha, "lower bound of packets in network (scale by 2)");
+MODULE_PARM_DESC(alpha, "lower bound of packets in network");
 module_param(beta, int, 0644);
-MODULE_PARM_DESC(beta, "upper bound of packets in network (scale by 2)");
+MODULE_PARM_DESC(beta, "upper bound of packets in network");
 module_param(gamma, int, 0644);
 MODULE_PARM_DESC(gamma, "limit on increase (scale by 2)");
 
@@ -172,49 +168,13 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
                return;
        }
 
-       /* The key players are v_beg_snd_una and v_beg_snd_nxt.
-        *
-        * These are so named because they represent the approximate values
-        * of snd_una and snd_nxt at the beginning of the current RTT. More
-        * precisely, they represent the amount of data sent during the RTT.
-        * At the end of the RTT, when we receive an ACK for v_beg_snd_nxt,
-        * we will calculate that (v_beg_snd_nxt - v_beg_snd_una) outstanding
-        * bytes of data have been ACKed during the course of the RTT, giving
-        * an "actual" rate of:
-        *
-        *     (v_beg_snd_nxt - v_beg_snd_una) / (rtt duration)
-        *
-        * Unfortunately, v_beg_snd_una is not exactly equal to snd_una,
-        * because delayed ACKs can cover more than one segment, so they
-        * don't line up nicely with the boundaries of RTTs.
-        *
-        * Another unfortunate fact of life is that delayed ACKs delay the
-        * advance of the left edge of our send window, so that the number
-        * of bytes we send in an RTT is often less than our cwnd will allow.
-        * So we keep track of our cwnd separately, in v_beg_snd_cwnd.
-        */
-
        if (after(ack, vegas->beg_snd_nxt)) {
                /* Do the Vegas once-per-RTT cwnd adjustment. */
-               u32 old_wnd, old_snd_cwnd;
-
-
-               /* Here old_wnd is essentially the window of data that was
-                * sent during the previous RTT, and has all
-                * been acknowledged in the course of the RTT that ended
-                * with the ACK we just received. Likewise, old_snd_cwnd
-                * is the cwnd during the previous RTT.
-                */
-               old_wnd = (vegas->beg_snd_nxt - vegas->beg_snd_una) /
-                       tp->mss_cache;
-               old_snd_cwnd = vegas->beg_snd_cwnd;
 
                /* Save the extent of the current window so we can use this
                 * at the end of the next RTT.
                 */
-               vegas->beg_snd_una  = vegas->beg_snd_nxt;
                vegas->beg_snd_nxt  = tp->snd_nxt;
-               vegas->beg_snd_cwnd = tp->snd_cwnd;
 
                /* We do the Vegas calculations only if we got enough RTT
                 * samples that we can be reasonably sure that we got
@@ -252,22 +212,14 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
                         *
                         * This is:
                         *     (actual rate in segments) * baseRTT
-                        * We keep it as a fixed point number with
-                        * V_PARAM_SHIFT bits to the right of the binary point.
                         */
-                       target_cwnd = ((u64)old_wnd * vegas->baseRTT);
-                       target_cwnd <<= V_PARAM_SHIFT;
-                       do_div(target_cwnd, rtt);
+                       target_cwnd = tp->snd_cwnd * vegas->baseRTT / rtt;
 
                        /* Calculate the difference between the window we had,
                         * and the window we would like to have. This quantity
                         * is the "Diff" from the Arizona Vegas papers.
-                        *
-                        * Again, this is a fixed point number with
-                        * V_PARAM_SHIFT bits to the right of the binary
-                        * point.
                         */
-                       diff = (old_wnd << V_PARAM_SHIFT) - target_cwnd;
+                       diff = tp->snd_cwnd * (rtt-vegas->baseRTT) / vegas->baseRTT;
 
                        if (diff > gamma && tp->snd_ssthresh > 2 ) {
                                /* Going too fast. Time to slow down
@@ -282,16 +234,13 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
                                 * truncation robs us of full link
                                 * utilization.
                                 */
-                               tp->snd_cwnd = min(tp->snd_cwnd,
-                                                  ((u32)target_cwnd >>
-                                                   V_PARAM_SHIFT)+1);
+                               tp->snd_cwnd = min(tp->snd_cwnd, (u32)target_cwnd+1);
 
                        } else if (tp->snd_cwnd <= tp->snd_ssthresh) {
                                /* Slow start.  */
                                tcp_slow_start(tp);
                        } else {
                                /* Congestion avoidance. */
-                               u32 next_snd_cwnd;
 
                                /* Figure out where we would like cwnd
                                 * to be.
@@ -300,26 +249,17 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
                                        /* The old window was too fast, so
                                         * we slow down.
                                         */
-                                       next_snd_cwnd = old_snd_cwnd - 1;
+                                       tp->snd_cwnd--;
                                } else if (diff < alpha) {
                                        /* We don't have enough extra packets
                                         * in the network, so speed up.
                                         */
-                                       next_snd_cwnd = old_snd_cwnd + 1;
+                                       tp->snd_cwnd++;
                                } else {
                                        /* Sending just as fast as we
                                         * should be.
                                         */
-                                       next_snd_cwnd = old_snd_cwnd;
                                }
-
-                               /* Adjust cwnd upward or downward, toward the
-                                * desired value.
-                                */
-                               if (next_snd_cwnd > tp->snd_cwnd)
-                                       tp->snd_cwnd++;
-                               else if (next_snd_cwnd < tp->snd_cwnd)
-                                       tp->snd_cwnd--;
                        }
 
                        if (tp->snd_cwnd < 2)
index 172438320eec74287b045cd6b784bb3de0b38b0f..d0f54d18e19b92de1407eb9a36fed5344363d01d 100644 (file)
@@ -912,8 +912,13 @@ static void ndisc_recv_na(struct sk_buff *skb)
                   is invalid, but ndisc specs say nothing
                   about it. It could be misconfiguration, or
                   an smart proxy agent tries to help us :-)
+
+                  We should not print the error if NA has been
+                  received from loopback - it is just our own
+                  unsolicited advertisement.
                 */
-               ND_PRINTK1(KERN_WARNING
+               if (skb->pkt_type != PACKET_LOOPBACK)
+                       ND_PRINTK1(KERN_WARNING
                           "ICMPv6 NA: someone advertises our address on %s!\n",
                           ifp->idev->dev->name);
                in6_ifa_put(ifp);
index 90c8506a0aac913afd2ad4d62d0d234039fc9315..8c03080321784fe7fee76ec1ea2ebd3d85187765 100644 (file)
@@ -562,7 +562,6 @@ static int netlbl_unlhsh_remove_addr4(struct net *net,
                                      const struct in_addr *mask,
                                      struct netlbl_audit *audit_info)
 {
-       int ret_val = 0;
        struct netlbl_af4list *list_entry;
        struct netlbl_unlhsh_addr4 *entry;
        struct audit_buffer *audit_buf;
@@ -577,7 +576,7 @@ static int netlbl_unlhsh_remove_addr4(struct net *net,
        if (list_entry != NULL)
                entry = netlbl_unlhsh_addr4_entry(list_entry);
        else
-               ret_val = -ENOENT;
+               entry = NULL;
 
        audit_buf = netlbl_audit_start_common(AUDIT_MAC_UNLBL_STCDEL,
                                              audit_info);
@@ -588,19 +587,21 @@ static int netlbl_unlhsh_remove_addr4(struct net *net,
                                          addr->s_addr, mask->s_addr);
                if (dev != NULL)
                        dev_put(dev);
-               if (entry && security_secid_to_secctx(entry->secid,
-                                                     &secctx,
-                                                     &secctx_len) == 0) {
+               if (entry != NULL &&
+                   security_secid_to_secctx(entry->secid,
+                                            &secctx, &secctx_len) == 0) {
                        audit_log_format(audit_buf, " sec_obj=%s", secctx);
                        security_release_secctx(secctx, secctx_len);
                }
-               audit_log_format(audit_buf, " res=%u", ret_val == 0 ? 1 : 0);
+               audit_log_format(audit_buf, " res=%u", entry != NULL ? 1 : 0);
                audit_log_end(audit_buf);
        }
 
-       if (ret_val == 0)
-               call_rcu(&entry->rcu, netlbl_unlhsh_free_addr4);
-       return ret_val;
+       if (entry == NULL)
+               return -ENOENT;
+
+       call_rcu(&entry->rcu, netlbl_unlhsh_free_addr4);
+       return 0;
 }
 
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
@@ -624,7 +625,6 @@ static int netlbl_unlhsh_remove_addr6(struct net *net,
                                      const struct in6_addr *mask,
                                      struct netlbl_audit *audit_info)
 {
-       int ret_val = 0;
        struct netlbl_af6list *list_entry;
        struct netlbl_unlhsh_addr6 *entry;
        struct audit_buffer *audit_buf;
@@ -638,7 +638,7 @@ static int netlbl_unlhsh_remove_addr6(struct net *net,
        if (list_entry != NULL)
                entry = netlbl_unlhsh_addr6_entry(list_entry);
        else
-               ret_val = -ENOENT;
+               entry = NULL;
 
        audit_buf = netlbl_audit_start_common(AUDIT_MAC_UNLBL_STCDEL,
                                              audit_info);
@@ -649,19 +649,21 @@ static int netlbl_unlhsh_remove_addr6(struct net *net,
                                          addr, mask);
                if (dev != NULL)
                        dev_put(dev);
-               if (entry && security_secid_to_secctx(entry->secid,
-                                                     &secctx,
-                                                     &secctx_len) == 0) {
+               if (entry != NULL &&
+                   security_secid_to_secctx(entry->secid,
+                                            &secctx, &secctx_len) == 0) {
                        audit_log_format(audit_buf, " sec_obj=%s", secctx);
                        security_release_secctx(secctx, secctx_len);
                }
-               audit_log_format(audit_buf, " res=%u", ret_val == 0 ? 1 : 0);
+               audit_log_format(audit_buf, " res=%u", entry != NULL ? 1 : 0);
                audit_log_end(audit_buf);
        }
 
-       if (ret_val == 0)
-               call_rcu(&entry->rcu, netlbl_unlhsh_free_addr6);
-       return ret_val;
+       if (entry == NULL)
+               return -ENOENT;
+
+       call_rcu(&entry->rcu, netlbl_unlhsh_free_addr6);
+       return 0;
 }
 #endif /* IPv6 */
 
index 9978afbd9f2ad5033375df896358f88b929ecfcc..803eeef0aa856877ddced0e45fc283f4641da2ab 100644 (file)
@@ -155,12 +155,13 @@ static void gprs_data_ready(struct sock *sk, int len)
 static void gprs_write_space(struct sock *sk)
 {
        struct gprs_dev *dev = sk->sk_user_data;
+       struct net_device *net = dev->net;
        unsigned credits = pep_writeable(sk);
 
        spin_lock_bh(&dev->tx_lock);
        dev->tx_max = credits;
-       if (credits > skb_queue_len(&dev->tx_queue))
-               netif_wake_queue(dev->net);
+       if (credits > skb_queue_len(&dev->tx_queue) && netif_running(net))
+               netif_wake_queue(net);
        spin_unlock_bh(&dev->tx_lock);
 }
 
@@ -168,6 +169,23 @@ static void gprs_write_space(struct sock *sk)
  * Network device callbacks
  */
 
+static int gprs_open(struct net_device *dev)
+{
+       struct gprs_dev *gp = netdev_priv(dev);
+
+       gprs_write_space(gp->sk);
+       return 0;
+}
+
+static int gprs_close(struct net_device *dev)
+{
+       struct gprs_dev *gp = netdev_priv(dev);
+
+       netif_stop_queue(dev);
+       flush_work(&gp->tx_work);
+       return 0;
+}
+
 static int gprs_xmit(struct sk_buff *skb, struct net_device *net)
 {
        struct gprs_dev *dev = netdev_priv(net);
@@ -254,6 +272,8 @@ static void gprs_setup(struct net_device *net)
        net->tx_queue_len       = 10;
 
        net->destructor         = free_netdev;
+       net->open               = gprs_open;
+       net->stop               = gprs_close;
        net->hard_start_xmit    = gprs_xmit; /* mandatory */
        net->change_mtu         = gprs_set_mtu;
        net->get_stats          = gprs_get_stats;
@@ -318,7 +338,6 @@ int gprs_attach(struct sock *sk)
        dev->sk = sk;
 
        printk(KERN_DEBUG"%s: attached\n", net->name);
-       gprs_write_space(sk); /* kick off TX */
        return net->ifindex;
 
 out_rel:
@@ -341,7 +360,5 @@ void gprs_detach(struct sock *sk)
 
        printk(KERN_DEBUG"%s: detached\n", net->name);
        unregister_netdev(net);
-       flush_scheduled_work();
        sock_put(sk);
-       skb_queue_purge(&dev->tx_queue);
 }
index a11959908d9a68c405114d56c5073c0d77647402..98402f0efa47727677b8d57acfe2ecd7cb9441b2 100644 (file)
@@ -46,9 +46,6 @@
         layering other disciplines.  It does not need to do bandwidth
         control either since that can be handled by using token
         bucket or other rate control.
-
-        The simulator is limited by the Linux timer resolution
-        and will create packet bursts on the HZ boundary (1ms).
 */
 
 struct netem_sched_data {