]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/dtor/input
authorLinus Torvalds <torvalds@g5.osdl.org>
Sun, 6 Aug 2006 16:12:49 +0000 (09:12 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 6 Aug 2006 16:12:49 +0000 (09:12 -0700)
* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/dtor/input: (24 commits)
  Input: ati_remote - use msec instead of jiffies
  Input: ati_remote - add missing input_sync()
  Input: ati_remote - relax permissions sysfs module parameters
  Input: ati_remote - make filter time a module parameter
  Input: atkbd - restore repeat rate when resuming
  Input: trackpoint - activate protocol when resuming
  Input: logips2pp - fix button mapping for MX300
  Input: keyboard - change to use kzalloc
  Input: serio/gameport - check whether driver core calls succeeded
  Input: spaceball - make 4000FLX Lefty work
  Input: keyboard - simplify emulate_raw() implementation
  Input: keyboard - remove static variable and clean up initialization
  Input: hiddev - use standard list implementation
  Input: add missing handler->start() call
  Input: HID - fix potential out-of-bound array access
  Input: fix list iteration in input_release_device()
  Input: iforce - add Trust Force Feedback Race Master support
  Input: iforce - check array bounds before accessing elements
  Input: libps2 - warn instead of oopsing when passed bad arguments
  Input: fm801-gp - fix use after free
  ...

59 files changed:
Documentation/sysctl/kernel.txt
MAINTAINERS
arch/sh/kernel/cpu/sh4/sq.c
arch/x86_64/kernel/smp.c
drivers/acpi/acpi_memhotplug.c
drivers/char/hvsi.c
drivers/char/hw_random/omap-rng.c
drivers/edac/edac_mc.h
drivers/i2c/busses/scx200_acb.c
drivers/ieee1394/sbp2.c
drivers/isdn/hardware/eicon/divasync.h
drivers/md/linear.c
drivers/pnp/pnpacpi/rsparser.c
drivers/video/aty/aty128fb.c
drivers/video/au1100fb.c
fs/befs/linuxvfs.c
fs/reiserfs/file.c
fs/reiserfs/inode.c
fs/reiserfs/ioctl.c
fs/udf/ialloc.c
fs/ufs/balloc.c
fs/ufs/util.c
include/linux/debug_locks.h
include/linux/sched.h
include/linux/vmstat.h
include/net/red.h
kernel/fork.c
kernel/futex.c
kernel/futex_compat.c
kernel/power/process.c
kernel/printk.c
kernel/resource.c
lib/spinlock_debug.c
mm/fadvise.c
mm/memory_hotplug.c
net/bridge/br_netlink.c
net/ipv4/tcp_input.c
net/lapb/lapb_iface.c
net/llc/af_llc.c
net/llc/llc_sap.c
net/sched/sch_api.c
net/sunrpc/cache.c
sound/aoa/codecs/snd-aoa-codec-toonie.c
sound/aoa/core/snd-aoa-gpio-feature.c
sound/aoa/core/snd-aoa-gpio-pmf.c
sound/core/oss/mixer_oss.c
sound/core/oss/pcm_oss.c
sound/core/seq/seq_device.c
sound/core/sgbuf.c
sound/drivers/vx/vx_pcm.c
sound/pci/echoaudio/echoaudio.c
sound/pci/emu10k1/emu10k1_main.c
sound/pci/emu10k1/irq.c
sound/ppc/awacs.c
sound/ppc/daca.c
sound/ppc/keywest.c
sound/ppc/powermac.c
sound/ppc/tumbler.c
sound/usb/usbaudio.c

index b0c7ab93dcb92db3423690382d5d4f8fc4507849..7345c338080a6548dcaf765b7e7423431ea47cdd 100644 (file)
@@ -211,9 +211,8 @@ Controls the kernel's behaviour when an oops or BUG is encountered.
 
 0: try to continue operation
 
-1: delay a few seconds (to give klogd time to record the oops output) and
-   then panic.  If the `panic' sysctl is also non-zero then the machine will
-   be rebooted.
+1: panic immediatly.  If the `panic' sysctl is also non-zero then the
+   machine will be rebooted.
 
 ==============================================================
 
index bac3f706f75e0f19a1b0faebf83ee2372744642d..e3e1515ba5a9065308e588b5fa2e480bcd039132 100644 (file)
@@ -298,6 +298,13 @@ L: info-linux@geode.amd.com
 W:     http://www.amd.com/us-en/ConnectivitySolutions/TechnicalResources/0,,50_2334_2452_11363,00.html
 S:     Supported
 
+AOA (Apple Onboard Audio) ALSA DRIVER
+P:     Johannes Berg
+M:     johannes@sipsolutions.net
+L:     linuxppc-dev@ozlabs.org
+L:     alsa-devel@alsa-project.org
+S:     Maintained
+
 APM DRIVER
 P:     Stephen Rothwell
 M:     sfr@canb.auug.org.au
@@ -2641,6 +2648,14 @@ M:       dbrownell@users.sourceforge.net
 L:     spi-devel-general@lists.sourceforge.net
 S:     Maintained
 
+STABLE BRANCH:
+P:     Greg Kroah-Hartman
+M:     greg@kroah.com
+P:     Chris Wright
+M:     chrisw@sous-sol.org
+L:     stable@kernel.org
+S:     Maintained
+
 TPM DEVICE DRIVER
 P:     Kylene Hall
 M:     kjhall@us.ibm.com
index 781dbb11c03894b56e04668a0311a63c99fbb47b..b09805f3ee23799e8a78379856211d2b967a30f0 100644 (file)
@@ -421,18 +421,22 @@ static struct miscdevice sq_dev = {
 
 static int __init sq_api_init(void)
 {
+       int ret;
        printk(KERN_NOTICE "sq: Registering store queue API.\n");
 
-#ifdef CONFIG_PROC_FS
        create_proc_read_entry("sq_mapping", 0, 0, sq_mapping_read_proc, 0);
-#endif
 
-       return misc_register(&sq_dev);
+       ret = misc_register(&sq_dev);
+       if (ret)
+               remove_proc_entry("sq_mapping", NULL);
+
+       return ret;
 }
 
 static void __exit sq_api_exit(void)
 {
        misc_deregister(&sq_dev);
+       remove_proc_entry("sq_mapping", NULL);
 }
 
 module_init(sq_api_init);
index 5a1c0a3bf87262c027c327773628e93e58194188..06af6ca601295e8253b95b999435710fdc8672e2 100644 (file)
@@ -203,7 +203,7 @@ int __cpuinit init_smp_flush(void)
 {
        int i;
        for_each_cpu_mask(i, cpu_possible_map) {
-               spin_lock_init(&per_cpu(flush_state.tlbstate_lock, i));
+               spin_lock_init(&per_cpu(flush_state, i).tlbstate_lock);
        }
        return 0;
 }
index 81e970adeab3b3cc6d5e47d32e69381693240943..b0d4b147b19eab7155452c818e5947716bf4b0bd 100644 (file)
@@ -129,11 +129,15 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
        struct acpi_memory_info *info, *n;
 
 
+       if (!list_empty(&mem_device->res_list))
+               return 0;
+
        status = acpi_walk_resources(mem_device->device->handle, METHOD_NAME__CRS,
                                     acpi_memory_get_resource, mem_device);
        if (ACPI_FAILURE(status)) {
                list_for_each_entry_safe(info, n, &mem_device->res_list, list)
                        kfree(info);
+               INIT_LIST_HEAD(&mem_device->res_list);
                return -EINVAL;
        }
 
@@ -230,17 +234,10 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
         * (i.e. memory-hot-remove function)
         */
        list_for_each_entry(info, &mem_device->res_list, list) {
-               u64 start_pfn, end_pfn;
-
-               start_pfn = info->start_addr >> PAGE_SHIFT;
-               end_pfn = (info->start_addr + info->length - 1) >> PAGE_SHIFT;
-
-               if (pfn_valid(start_pfn) || pfn_valid(end_pfn)) {
-                       /* already enabled. try next area */
+               if (info->enabled) { /* just sanity check...*/
                        num_enabled++;
                        continue;
                }
-
                result = add_memory(node, info->start_addr, info->length);
                if (result)
                        continue;
index 41db8060e8f791502c51bb559ffbfa4881327e5c..017f755632a3455d1a2223d2b1cd01006477d990 100644 (file)
@@ -311,7 +311,8 @@ static void hvsi_recv_control(struct hvsi_struct *hp, uint8_t *packet,
                                /* CD went away; no more connection */
                                pr_debug("hvsi%i: CD dropped\n", hp->index);
                                hp->mctrl &= TIOCM_CD;
-                               if (!(hp->tty->flags & CLOCAL))
+                               /* If userland hasn't done an open(2) yet, hp->tty is NULL. */
+                               if (hp->tty && !(hp->tty->flags & CLOCAL))
                                        *to_hangup = hp->tty;
                        }
                        break;
@@ -986,10 +987,7 @@ static void hvsi_write_worker(void *arg)
                start_j = 0;
 #endif /* DEBUG */
                wake_up_all(&hp->emptyq);
-               if (test_bit(TTY_DO_WRITE_WAKEUP, &hp->tty->flags)
-                               && hp->tty->ldisc.write_wakeup)
-                       hp->tty->ldisc.write_wakeup(hp->tty);
-               wake_up_interruptible(&hp->tty->write_wait);
+               tty_wakeup(hp->tty);
        }
 
 out:
index 819516b35a79394deb31eb419e5be7d8d0524575..a01d796d1eeb3624a4f55537d604cc9dba1cb1e3 100644 (file)
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/random.h>
+#include <linux/clk.h>
 #include <linux/err.h>
-#include <linux/device.h>
+#include <linux/platform_device.h>
 #include <linux/hw_random.h>
 
 #include <asm/io.h>
-#include <asm/hardware/clock.h>
 
 #define RNG_OUT_REG            0x00            /* Output register */
 #define RNG_STAT_REG           0x04            /* Status register
@@ -52,7 +52,7 @@
 
 static void __iomem *rng_base;
 static struct clk *rng_ick;
-static struct device *rng_dev;
+static struct platform_device *rng_dev;
 
 static u32 omap_rng_read_reg(int reg)
 {
@@ -83,9 +83,8 @@ static struct hwrng omap_rng_ops = {
        .data_read      = omap_rng_data_read,
 };
 
-static int __init omap_rng_probe(struct device *dev)
+static int __init omap_rng_probe(struct platform_device *pdev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
        struct resource *res, *mem;
        int ret;
 
@@ -95,16 +94,14 @@ static int __init omap_rng_probe(struct device *dev)
         */
        BUG_ON(rng_dev);
 
-       if (cpu_is_omap24xx()) {
+       if (cpu_is_omap24xx()) {
                rng_ick = clk_get(NULL, "rng_ick");
                if (IS_ERR(rng_ick)) {
-                       dev_err(dev, "Could not get rng_ick\n");
+                       dev_err(&pdev->dev, "Could not get rng_ick\n");
                        ret = PTR_ERR(rng_ick);
                        return ret;
-               }
-               else {
-                       clk_use(rng_ick);
-               }
+               } else
+                       clk_enable(rng_ick);
        }
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -117,7 +114,7 @@ static int __init omap_rng_probe(struct device *dev)
        if (mem == NULL)
                return -EBUSY;
 
-       dev_set_drvdata(dev, mem);
+       dev_set_drvdata(&pdev->dev, mem);
        rng_base = (u32 __iomem *)io_p2v(res->start);
 
        ret = hwrng_register(&omap_rng_ops);
@@ -127,25 +124,25 @@ static int __init omap_rng_probe(struct device *dev)
                return ret;
        }
 
-       dev_info(dev, "OMAP Random Number Generator ver. %02x\n",
+       dev_info(&pdev->dev, "OMAP Random Number Generator ver. %02x\n",
                omap_rng_read_reg(RNG_REV_REG));
        omap_rng_write_reg(RNG_MASK_REG, 0x1);
 
-       rng_dev = dev;
+       rng_dev = pdev;
 
        return 0;
 }
 
-static int __exit omap_rng_remove(struct device *dev)
+static int __exit omap_rng_remove(struct platform_device *pdev)
 {
-       struct resource *mem = dev_get_drvdata(dev);
+       struct resource *mem = dev_get_drvdata(&pdev->dev);
 
        hwrng_unregister(&omap_rng_ops);
 
        omap_rng_write_reg(RNG_MASK_REG, 0x0);
 
        if (cpu_is_omap24xx()) {
-               clk_unuse(rng_ick);
+               clk_disable(rng_ick);
                clk_put(rng_ick);
        }
 
@@ -157,18 +154,16 @@ static int __exit omap_rng_remove(struct device *dev)
 
 #ifdef CONFIG_PM
 
-static int omap_rng_suspend(struct device *dev, pm_message_t message, u32 level)
+static int omap_rng_suspend(struct platform_device *pdev, pm_message_t message)
 {
        omap_rng_write_reg(RNG_MASK_REG, 0x0);
-
        return 0;
 }
 
-static int omap_rng_resume(struct device *dev, pm_message_t message, u32 level)
+static int omap_rng_resume(struct platform_device *pdev)
 {
        omap_rng_write_reg(RNG_MASK_REG, 0x1);
-
-       return 1;
+       return 0;
 }
 
 #else
@@ -179,9 +174,11 @@ static int omap_rng_resume(struct device *dev, pm_message_t message, u32 level)
 #endif
 
 
-static struct device_driver omap_rng_driver = {
-       .name           = "omap_rng",
-       .bus            = &platform_bus_type,
+static struct platform_driver omap_rng_driver = {
+       .driver = {
+               .name           = "omap_rng",
+               .owner          = THIS_MODULE,
+       },
        .probe          = omap_rng_probe,
        .remove         = __exit_p(omap_rng_remove),
        .suspend        = omap_rng_suspend,
@@ -193,12 +190,12 @@ static int __init omap_rng_init(void)
        if (!cpu_is_omap16xx() && !cpu_is_omap24xx())
                return -ENODEV;
 
-       return driver_register(&omap_rng_driver);
+       return platform_driver_register(&omap_rng_driver);
 }
 
 static void __exit omap_rng_exit(void)
 {
-       driver_unregister(&omap_rng_driver);
+       platform_driver_unregister(&omap_rng_driver);
 }
 
 module_init(omap_rng_init);
index bf6ab8a8d5ed8700dce391de101a03b60ee72987..a1cfd4e3c97df8e3454112bda619446b69623b9a 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/rcupdate.h>
 #include <linux/completion.h>
 #include <linux/kobject.h>
+#include <linux/platform_device.h>
 
 #define EDAC_MC_LABEL_LEN      31
 #define MC_PROC_NAME_MAX_LEN 7
index ced309ff056fa123d3a0022dfcc7d7530b60d491..eae9e81be375acecb2a697fd23b7afdcab944b6a 100644 (file)
@@ -232,7 +232,7 @@ static void scx200_acb_poll(struct scx200_acb_iface *iface)
        unsigned long timeout;
 
        timeout = jiffies + POLL_TIMEOUT;
-       while (time_before(jiffies, timeout)) {
+       while (1) {
                status = inb(ACBST);
 
                /* Reset the status register to avoid the hang */
@@ -242,7 +242,10 @@ static void scx200_acb_poll(struct scx200_acb_iface *iface)
                        scx200_acb_machine(iface, status);
                        return;
                }
-               yield();
+               if (time_after(jiffies, timeout))
+                       break;
+               cpu_relax();
+               cond_resched();
        }
 
        dev_err(&iface->adapter.dev, "timeout in state %s\n",
index aaa74f293aaf4279353c77404ba9f38ac2c98663..b08755e2e68f31115ff11920f598835001ea0bd3 100644 (file)
@@ -2515,6 +2515,9 @@ static int sbp2scsi_slave_configure(struct scsi_device *sdev)
                sdev->skip_ms_page_8 = 1;
        if (scsi_id->workarounds & SBP2_WORKAROUND_FIX_CAPACITY)
                sdev->fix_capacity = 1;
+       if (scsi_id->ne->guid_vendor_id == 0x0010b9 && /* Maxtor's OUI */
+           (sdev->type == TYPE_DISK || sdev->type == TYPE_RBC))
+               sdev->allow_restart = 1;
        return 0;
 }
 
index 0a5be7f969f212e494912f8e1a6db7b0bdaec58e..af3eb9e795b500faba4eaa15eca11152b54c8872 100644 (file)
@@ -256,7 +256,6 @@ typedef struct
 #define NO_ORDER_CHECK_MASK 0x00000010
 #define LOW_CHANNEL_MASK 0x00000020
 #define NO_HSCX30_MASK  0x00000040
-#define MODE_MASK   0x00000080
 #define SET_BOARD   0x00001000
 #define SET_CRC4   0x00030000
 #define SET_L1_TRISTATE  0x00040000
index ff83c9b5979e5feb0c433b4e3a118344e479a5cc..b99c19c7eb2237e6f6583530c849bcfcaa2887c2 100644 (file)
@@ -162,7 +162,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
                goto out;
        }
 
-       min_spacing = mddev->array_size;
+       min_spacing = conf->array_size;
        sector_div(min_spacing, PAGE_SIZE/sizeof(struct dev_info *));
 
        /* min_spacing is the minimum spacing that will fit the hash
@@ -171,7 +171,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
         * that is larger than min_spacing as use the size of that as
         * the actual spacing
         */
-       conf->hash_spacing = mddev->array_size;
+       conf->hash_spacing = conf->array_size;
        for (i=0; i < cnt-1 ; i++) {
                sector_t sz = 0;
                int j;
@@ -228,7 +228,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
        curr_offset = 0;
        i = 0;
        for (curr_offset = 0;
-            curr_offset < mddev->array_size;
+            curr_offset < conf->array_size;
             curr_offset += conf->hash_spacing) {
 
                while (i < mddev->raid_disks-1 &&
index 21226888185789f24d112b32ab78d1b76e63d458..dc79b0a0059f6206c22dd6a611c591d62b83aa7a 100644 (file)
@@ -173,6 +173,9 @@ pnpacpi_parse_allocated_address_space(struct pnp_resource_table *res_table,
                return;
        }
 
+       if (p->producer_consumer == ACPI_PRODUCER)
+               return;
+
        if (p->resource_type == ACPI_MEMORY_RANGE)
                pnpacpi_parse_allocated_memresource(res_table,
                                p->minimum, p->address_length);
@@ -252,9 +255,14 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
                break;
 
        case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
+               if (res->data.ext_address64.producer_consumer == ACPI_PRODUCER)
+                       return AE_OK;
                break;
 
        case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
+               if (res->data.extended_irq.producer_consumer == ACPI_PRODUCER)
+                       return AE_OK;
+
                for (i = 0; i < res->data.extended_irq.interrupt_count; i++) {
                        pnpacpi_parse_allocated_irqresource(res_table,
                                res->data.extended_irq.interrupts[i],
index 8b08121b390bf979a9272792725fd4efb8ada9a6..3e827e04a2aab4de2c3081486ff07ef89dbecea0 100644 (file)
@@ -1913,9 +1913,6 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
        u8 chip_rev;
        u32 dac;
 
-       if (!par->vram_size)    /* may have already been probed */
-               par->vram_size = aty_ld_le32(CONFIG_MEMSIZE) & 0x03FFFFFF;
-
        /* Get the chip revision */
        chip_rev = (aty_ld_le32(CONFIG_CNTL) >> 16) & 0x1F;
 
@@ -2028,9 +2025,6 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
 
        aty128_init_engine(par);
 
-       if (register_framebuffer(info) < 0)
-               return 0;
-
        par->pm_reg = pci_find_capability(pdev, PCI_CAP_ID_PM);
        par->pdev = pdev;
        par->asleep = 0;
@@ -2040,6 +2034,9 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
        aty128_bl_init(par);
 #endif
 
+       if (register_framebuffer(info) < 0)
+               return 0;
+
        printk(KERN_INFO "fb%d: %s frame buffer device on %s\n",
               info->node, info->fix.id, video_card);
 
@@ -2089,7 +2086,6 @@ static int __devinit aty128_probe(struct pci_dev *pdev, const struct pci_device_
        par = info->par;
 
        info->pseudo_palette = par->pseudo_palette;
-       info->fix = aty128fb_fix;
 
        /* Virtualize mmio region */
        info->fix.mmio_start = reg_addr;
index a92a91fef16fc303d0aa393c4af607a063e305a2..f25d5d648333cb6665529154aeaec90184da02b5 100644 (file)
@@ -156,7 +156,7 @@ int au1100fb_setmode(struct au1100fb_device *fbdev)
 
                        info->fix.visual = FB_VISUAL_TRUECOLOR;
                        info->fix.line_length = info->var.xres_virtual << 1; /* depth=16 */
-       }
+               }
        } else {
                /* mono */
                info->fix.visual = FB_VISUAL_MONO10;
@@ -164,20 +164,16 @@ int au1100fb_setmode(struct au1100fb_device *fbdev)
        }
 
        info->screen_size = info->fix.line_length * info->var.yres_virtual;
+       info->var.rotate = ((fbdev->panel->control_base&LCD_CONTROL_SM_MASK) \
+                               >> LCD_CONTROL_SM_BIT) * 90;
 
        /* Determine BPP mode and format */
-       fbdev->regs->lcd_control = fbdev->panel->control_base |
-                           ((info->var.rotate/90) << LCD_CONTROL_SM_BIT);
-
-       fbdev->regs->lcd_intenable = 0;
-       fbdev->regs->lcd_intstatus = 0;
-
+       fbdev->regs->lcd_control = fbdev->panel->control_base;
        fbdev->regs->lcd_horztiming = fbdev->panel->horztiming;
-
        fbdev->regs->lcd_verttiming = fbdev->panel->verttiming;
-
        fbdev->regs->lcd_clkcontrol = fbdev->panel->clkcontrol_base;
-
+       fbdev->regs->lcd_intenable = 0;
+       fbdev->regs->lcd_intstatus = 0;
        fbdev->regs->lcd_dmaaddr0 = LCD_DMA_SA_N(fbdev->fb_phys);
 
        if (panel_is_dual(fbdev->panel)) {
@@ -206,6 +202,8 @@ int au1100fb_setmode(struct au1100fb_device *fbdev)
 
        /* Resume controller */
        fbdev->regs->lcd_control |= LCD_CONTROL_GO;
+       mdelay(10);
+       au1100fb_fb_blank(VESA_NO_BLANKING, info);
 
        return 0;
 }
index fcaeead9696b135f6481ff93afd7829980d53e5e..50cfca5c7efd570588d549a5f23f9f5650fd360d 100644 (file)
@@ -512,7 +512,11 @@ befs_utf2nls(struct super_block *sb, const char *in,
        wchar_t uni;
        int unilen, utflen;
        char *result;
-       int maxlen = in_len; /* The utf8->nls conversion can't make more chars */
+       /* The utf8->nls conversion won't make the final nls string bigger
+        * than the utf one, but if the string is pure ascii they'll have the
+        * same width and an extra char is needed to save the additional \0
+        */
+       int maxlen = in_len + 1;
 
        befs_debug(sb, "---> utf2nls()");
 
@@ -588,7 +592,10 @@ befs_nls2utf(struct super_block *sb, const char *in,
        wchar_t uni;
        int unilen, utflen;
        char *result;
-       int maxlen = 3 * in_len;
+       /* There're nls characters that will translate to 3-chars-wide UTF-8
+        * characters, a additional byte is needed to save the final \0
+        * in special cases */
+       int maxlen = (3 * in_len) + 1;
 
        befs_debug(sb, "---> nls2utf()\n");
 
index f318b58510fd896b2b68c04fadb5ca6af5daa3fc..1627edd50810b94df2f4003479092022c9952d9d 100644 (file)
@@ -48,8 +48,8 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp)
                return 0;
        }
 
-       reiserfs_write_lock(inode->i_sb);
        mutex_lock(&inode->i_mutex);
+       reiserfs_write_lock(inode->i_sb);
        /* freeing preallocation only involves relogging blocks that
         * are already in the current transaction.  preallocation gets
         * freed at the end of each transaction, so it is impossible for
index 12dfdcfbee3dfb8666712f81fb8ca28f203568cb..52f1e2136546f215f7bd13ea403735222a621e46 100644 (file)
@@ -39,14 +39,10 @@ void reiserfs_delete_inode(struct inode *inode)
 
        /* The = 0 happens when we abort creating a new inode for some reason like lack of space.. */
        if (!(inode->i_state & I_NEW) && INODE_PKEY(inode)->k_objectid != 0) {  /* also handles bad_inode case */
-               mutex_lock(&inode->i_mutex);
-
                reiserfs_delete_xattrs(inode);
 
-               if (journal_begin(&th, inode->i_sb, jbegin_count)) {
-                       mutex_unlock(&inode->i_mutex);
+               if (journal_begin(&th, inode->i_sb, jbegin_count))
                        goto out;
-               }
                reiserfs_update_inode_transaction(inode);
 
                err = reiserfs_delete_object(&th, inode);
@@ -57,12 +53,8 @@ void reiserfs_delete_inode(struct inode *inode)
                if (!err) 
                        DQUOT_FREE_INODE(inode);
 
-               if (journal_end(&th, inode->i_sb, jbegin_count)) {
-                       mutex_unlock(&inode->i_mutex);
+               if (journal_end(&th, inode->i_sb, jbegin_count))
                        goto out;
-               }
-
-               mutex_unlock(&inode->i_mutex);
 
                /* check return value from reiserfs_delete_object after
                 * ending the transaction
@@ -2348,6 +2340,7 @@ static int reiserfs_write_full_page(struct page *page,
        unsigned long end_index = inode->i_size >> PAGE_CACHE_SHIFT;
        int error = 0;
        unsigned long block;
+       sector_t last_block;
        struct buffer_head *head, *bh;
        int partial = 0;
        int nr = 0;
@@ -2395,10 +2388,19 @@ static int reiserfs_write_full_page(struct page *page,
        }
        bh = head;
        block = page->index << (PAGE_CACHE_SHIFT - s->s_blocksize_bits);
+       last_block = (i_size_read(inode) - 1) >> inode->i_blkbits;
        /* first map all the buffers, logging any direct items we find */
        do {
-               if ((checked || buffer_dirty(bh)) && (!buffer_mapped(bh) ||
-                                                     (buffer_mapped(bh)
+               if (block > last_block) {
+                       /*
+                        * This can happen when the block size is less than
+                        * the page size.  The corresponding bytes in the page
+                        * were zero filled above
+                        */
+                       clear_buffer_dirty(bh);
+                       set_buffer_uptodate(bh);
+               } else if ((checked || buffer_dirty(bh)) &&
+                          (!buffer_mapped(bh) || (buffer_mapped(bh)
                                                       && bh->b_blocknr ==
                                                       0))) {
                        /* not mapped yet, or it points to a direct item, search
index 745c8810089512e0b9a77d6f3847ea7683500037..a986b5e1e288c8dd47eca5ea525c9cfe2fc26b77 100644 (file)
@@ -116,12 +116,12 @@ static int reiserfs_unpack(struct inode *inode, struct file *filp)
        if (REISERFS_I(inode)->i_flags & i_nopack_mask) {
                return 0;
        }
-       reiserfs_write_lock(inode->i_sb);
 
        /* we need to make sure nobody is changing the file size beneath
         ** us
         */
        mutex_lock(&inode->i_mutex);
+       reiserfs_write_lock(inode->i_sb);
 
        write_from = inode->i_size & (blocksize - 1);
        /* if we are on a block boundary, we are already unpacked.  */
index 3873c672cb4c0ce09b63a5d06801ddeba029b800..33323473e3c43edfbd53a16014f3bf313d580ac4 100644 (file)
@@ -75,6 +75,12 @@ struct inode * udf_new_inode (struct inode *dir, int mode, int * err)
        }
        *err = -ENOSPC;
 
+       UDF_I_UNIQUE(inode) = 0;
+       UDF_I_LENEXTENTS(inode) = 0;
+       UDF_I_NEXT_ALLOC_BLOCK(inode) = 0;
+       UDF_I_NEXT_ALLOC_GOAL(inode) = 0;
+       UDF_I_STRAT4096(inode) = 0;
+
        block = udf_new_block(dir->i_sb, NULL, UDF_I_LOCATION(dir).partitionReferenceNum,
                start, err);
        if (*err)
@@ -84,11 +90,6 @@ struct inode * udf_new_inode (struct inode *dir, int mode, int * err)
        }
 
        mutex_lock(&sbi->s_alloc_mutex);
-       UDF_I_UNIQUE(inode) = 0;
-       UDF_I_LENEXTENTS(inode) = 0;
-       UDF_I_NEXT_ALLOC_BLOCK(inode) = 0;
-       UDF_I_NEXT_ALLOC_GOAL(inode) = 0;
-       UDF_I_STRAT4096(inode) = 0;
        if (UDF_SB_LVIDBH(sb))
        {
                struct logicalVolHeaderDesc *lvhd;
index b01804baa120f630c1fe2480a970086e96e58cde..b82381475779b59ecdd52685eafc05db391d6bb2 100644 (file)
@@ -248,7 +248,7 @@ static void ufs_change_blocknr(struct inode *inode, unsigned int baseblk,
 
                if (likely(cur_index != index)) {
                        page = ufs_get_locked_page(mapping, index);
-                       if (IS_ERR(page))
+                       if (!page || IS_ERR(page)) /* it was truncated or EIO */
                                continue;
                } else
                        page = locked_page;
index 337cf2c46d109f1e9c9cef3492ed2dd26bffe07e..22f820a9b15c782dace5e86fc2a6bf9d9ad74ab0 100644 (file)
@@ -251,12 +251,12 @@ struct page *ufs_get_locked_page(struct address_space *mapping,
 {
        struct page *page;
 
-try_again:
        page = find_lock_page(mapping, index);
        if (!page) {
                page = read_cache_page(mapping, index,
                                       (filler_t*)mapping->a_ops->readpage,
                                       NULL);
+
                if (IS_ERR(page)) {
                        printk(KERN_ERR "ufs_change_blocknr: "
                               "read_cache_page error: ino %lu, index: %lu\n",
@@ -266,6 +266,14 @@ try_again:
 
                lock_page(page);
 
+               if (unlikely(page->mapping == NULL)) {
+                       /* Truncate got there first */
+                       unlock_page(page);
+                       page_cache_release(page);
+                       page = NULL;
+                       goto out;
+               }
+
                if (!PageUptodate(page) || PageError(page)) {
                        unlock_page(page);
                        page_cache_release(page);
@@ -275,15 +283,8 @@ try_again:
                               mapping->host->i_ino, index);
 
                        page = ERR_PTR(-EIO);
-                       goto out;
                }
        }
-
-       if (unlikely(!page->mapping || !page_has_buffers(page))) {
-               unlock_page(page);
-               page_cache_release(page);
-               goto try_again;/*we really need these buffers*/
-       }
 out:
        return page;
 }
index 6a7047851e48b8174ffa0360e95e056a5d9921fa..88dafa246d87a968b61163ad500dd7da2d5bb812 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __LINUX_DEBUG_LOCKING_H
 #define __LINUX_DEBUG_LOCKING_H
 
+struct task_struct;
+
 extern int debug_locks;
 extern int debug_locks_silent;
 
index 6afa72e080cb7665bc4be600db1b4fe382460ccd..6674fc1e51bf3dfe0677633e489231a91c271dac 100644 (file)
@@ -1557,6 +1557,14 @@ static inline void freeze(struct task_struct *p)
        p->flags |= PF_FREEZE;
 }
 
+/*
+ * Sometimes we may need to cancel the previous 'freeze' request
+ */
+static inline void do_not_freeze(struct task_struct *p)
+{
+       p->flags &= ~PF_FREEZE;
+}
+
 /*
  * Wake up a frozen process
  */
index 1ab806c47514e5e6a468063f37fa4fcb1ce9c038..2d9b1b60798aca15f99c9fe46afe5587f1605b6e 100644 (file)
@@ -41,23 +41,23 @@ DECLARE_PER_CPU(struct vm_event_state, vm_event_states);
 
 static inline void __count_vm_event(enum vm_event_item item)
 {
-       __get_cpu_var(vm_event_states.event[item])++;
+       __get_cpu_var(vm_event_states).event[item]++;
 }
 
 static inline void count_vm_event(enum vm_event_item item)
 {
-       get_cpu_var(vm_event_states.event[item])++;
+       get_cpu_var(vm_event_states).event[item]++;
        put_cpu();
 }
 
 static inline void __count_vm_events(enum vm_event_item item, long delta)
 {
-       __get_cpu_var(vm_event_states.event[item]) += delta;
+       __get_cpu_var(vm_event_states).event[item] += delta;
 }
 
 static inline void count_vm_events(enum vm_event_item item, long delta)
 {
-       get_cpu_var(vm_event_states.event[item]) += delta;
+       get_cpu_var(vm_event_states).event[item] += delta;
        put_cpu();
 }
 
index 5ccdbb3d4722ab400281b3692db23f0a212a14f3..a4eb37946f2cdf1c63f22cc19341a88e6bd76cca 100644 (file)
@@ -212,7 +212,7 @@ static inline unsigned long red_calc_qavg_from_idle_time(struct red_parms *p)
                 * Seems, it is the best solution to
                 * problem of too coarse exponent tabulation.
                 */
-               us_idle = (p->qavg * us_idle) >> p->Scell_log;
+               us_idle = (p->qavg * (u64)us_idle) >> p->Scell_log;
 
                if (us_idle < (p->qavg >> 1))
                        return p->qavg - us_idle;
index 1b0f7b1e088189a53d531e038b1dce75ad3f7a6a..aa36c43783cc01f296eb1c755cc4f17b51b55ccc 100644 (file)
@@ -1387,8 +1387,10 @@ long do_fork(unsigned long clone_flags,
 
                if (clone_flags & CLONE_VFORK) {
                        wait_for_completion(&vfork);
-                       if (unlikely (current->ptrace & PT_TRACE_VFORK_DONE))
+                       if (unlikely (current->ptrace & PT_TRACE_VFORK_DONE)) {
+                               current->ptrace_message = nr;
                                ptrace_notify ((PTRACE_EVENT_VFORK_DONE << 8) | SIGTRAP);
+                       }
                }
        } else {
                free_pid(pid);
index dda2049692a23dff47633c7e0394526ff0398289..c2b2e0b83abf520a5a170252e8d56e4659443448 100644 (file)
@@ -948,6 +948,7 @@ static int unqueue_me(struct futex_q *q)
        /* In the common case we don't take the spinlock, which is nice. */
  retry:
        lock_ptr = q->lock_ptr;
+       barrier();
        if (lock_ptr != 0) {
                spin_lock(lock_ptr);
                /*
index d1aab1a452ccd338f12d325e681e6010ddab7dd9..c5cca3f65cb776f2757e4bd5eeb167a4f84f6ffd 100644 (file)
@@ -39,7 +39,7 @@ void compat_exit_robust_list(struct task_struct *curr)
 {
        struct compat_robust_list_head __user *head = curr->compat_robust_list;
        struct robust_list __user *entry, *pending;
-       unsigned int limit = ROBUST_LIST_LIMIT, pi;
+       unsigned int limit = ROBUST_LIST_LIMIT, pi, pip;
        compat_uptr_t uentry, upending;
        compat_long_t futex_offset;
 
@@ -59,10 +59,10 @@ void compat_exit_robust_list(struct task_struct *curr)
         * if it exists:
         */
        if (fetch_robust_entry(&upending, &pending,
-                              &head->list_op_pending, &pi))
+                              &head->list_op_pending, &pip))
                return;
        if (upending)
-               handle_futex_death((void *)pending + futex_offset, curr, pi);
+               handle_futex_death((void *)pending + futex_offset, curr, pip);
 
        while (compat_ptr(uentry) != &head->list) {
                /*
index b2a5f671d6cd3f2d164e44ad20ad7780a7e00377..72e72d2c61e6e412106c2e58733087b9ba16ac81 100644 (file)
@@ -66,13 +66,25 @@ static inline void freeze_process(struct task_struct *p)
        }
 }
 
+static void cancel_freezing(struct task_struct *p)
+{
+       unsigned long flags;
+
+       if (freezing(p)) {
+               pr_debug("  clean up: %s\n", p->comm);
+               do_not_freeze(p);
+               spin_lock_irqsave(&p->sighand->siglock, flags);
+               recalc_sigpending_tsk(p);
+               spin_unlock_irqrestore(&p->sighand->siglock, flags);
+       }
+}
+
 /* 0 = success, else # of processes that we failed to stop */
 int freeze_processes(void)
 {
        int todo, nr_user, user_frozen;
        unsigned long start_time;
        struct task_struct *g, *p;
-       unsigned long flags;
 
        printk( "Stopping tasks: " );
        start_time = jiffies;
@@ -85,6 +97,10 @@ int freeze_processes(void)
                                continue;
                        if (frozen(p))
                                continue;
+                       if (p->state == TASK_TRACED && frozen(p->parent)) {
+                               cancel_freezing(p);
+                               continue;
+                       }
                        if (p->mm && !(p->flags & PF_BORROWED_MM)) {
                                /* The task is a user-space one.
                                 * Freeze it unless there's a vfork completion
@@ -126,13 +142,7 @@ int freeze_processes(void)
                do_each_thread(g, p) {
                        if (freezeable(p) && !frozen(p))
                                printk(KERN_ERR "  %s\n", p->comm);
-                       if (freezing(p)) {
-                               pr_debug("  clean up: %s\n", p->comm);
-                               p->flags &= ~PF_FREEZE;
-                               spin_lock_irqsave(&p->sighand->siglock, flags);
-                               recalc_sigpending_tsk(p);
-                               spin_unlock_irqrestore(&p->sighand->siglock, flags);
-                       }
+                       cancel_freezing(p);
                } while_each_thread(g, p);
                read_unlock(&tasklist_lock);
                return todo;
index 65ca0688f86f1b78fafd144671a17015b2fd1525..1149365e989edee40639bda0cd6865204e05cc89 100644 (file)
@@ -799,6 +799,9 @@ void release_console_sem(void)
                up(&secondary_console_sem);
                return;
        }
+
+       console_may_schedule = 0;
+
        for ( ; ; ) {
                spin_lock_irqsave(&logbuf_lock, flags);
                wake_klogd |= log_start - log_end;
@@ -812,7 +815,6 @@ void release_console_sem(void)
                local_irq_restore(flags);
        }
        console_locked = 0;
-       console_may_schedule = 0;
        up(&console_sem);
        spin_unlock_irqrestore(&logbuf_lock, flags);
        if (wake_klogd && !oops_in_progress && waitqueue_active(&log_wait)) {
index 0dd3a857579e4fe1b9aae9463aac4717e149eaa9..46286434af8066af359143df81244e0c3024de19 100644 (file)
@@ -244,6 +244,7 @@ int find_next_system_ram(struct resource *res)
 
        start = res->start;
        end = res->end;
+       BUG_ON(start >= end);
 
        read_lock(&resource_lock);
        for (p = iomem_resource.child; p ; p = p->sibling) {
@@ -254,15 +255,17 @@ int find_next_system_ram(struct resource *res)
                        p = NULL;
                        break;
                }
-               if (p->start >= start)
+               if ((p->end >= start) && (p->start < end))
                        break;
        }
        read_unlock(&resource_lock);
        if (!p)
                return -1;
        /* copy data */
-       res->start = p->start;
-       res->end = p->end;
+       if (res->start < p->start)
+               res->start = p->start;
+       if (res->end > p->end)
+               res->end = p->end;
        return 0;
 }
 #endif
index 3d9c4dc965ed5d3f90173eff828da22fac0ccb4b..58c577dd82e5240e551d151b73ea31c55de8c309 100644 (file)
@@ -162,6 +162,7 @@ static void rwlock_bug(rwlock_t *lock, const char *msg)
 
 #define RWLOCK_BUG_ON(cond, lock, msg) if (unlikely(cond)) rwlock_bug(lock, msg)
 
+#if 0          /* __write_lock_debug() can lock up - maybe this can too? */
 static void __read_lock_debug(rwlock_t *lock)
 {
        int print_once = 1;
@@ -184,12 +185,12 @@ static void __read_lock_debug(rwlock_t *lock)
                }
        }
 }
+#endif
 
 void _raw_read_lock(rwlock_t *lock)
 {
        RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic");
-       if (unlikely(!__raw_read_trylock(&lock->raw_lock)))
-               __read_lock_debug(lock);
+       __raw_read_lock(&lock->raw_lock);
 }
 
 int _raw_read_trylock(rwlock_t *lock)
@@ -235,6 +236,7 @@ static inline void debug_write_unlock(rwlock_t *lock)
        lock->owner_cpu = -1;
 }
 
+#if 0          /* This can cause lockups */
 static void __write_lock_debug(rwlock_t *lock)
 {
        int print_once = 1;
@@ -257,12 +259,12 @@ static void __write_lock_debug(rwlock_t *lock)
                }
        }
 }
+#endif
 
 void _raw_write_lock(rwlock_t *lock)
 {
        debug_write_lock_before(lock);
-       if (unlikely(!__raw_write_trylock(&lock->raw_lock)))
-               __write_lock_debug(lock);
+       __raw_write_lock(&lock->raw_lock);
        debug_write_lock_after(lock);
 }
 
index 60a5d55e51d949588cc60fb5ed8f138b37f372ad..168c78a121bb0f67835dabcae5e3f4edb74e8e7d 100644 (file)
@@ -73,7 +73,6 @@ asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
                file->f_ra.ra_pages = bdi->ra_pages * 2;
                break;
        case POSIX_FADV_WILLNEED:
-       case POSIX_FADV_NOREUSE:
                if (!mapping->a_ops->readpage) {
                        ret = -EINVAL;
                        break;
@@ -94,6 +93,8 @@ asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
                if (ret > 0)
                        ret = 0;
                break;
+       case POSIX_FADV_NOREUSE:
+               break;
        case POSIX_FADV_DONTNEED:
                if (!bdi_write_congested(mapping->backing_dev_info))
                        filemap_flush(mapping);
index 01c9fb97c619135edce3431d265e397f49113b58..c37319542b700a92339fdfc4427a5fc4d6fa2ee4 100644 (file)
@@ -52,6 +52,9 @@ static int __add_section(struct zone *zone, unsigned long phys_start_pfn)
        int nr_pages = PAGES_PER_SECTION;
        int ret;
 
+       if (pfn_valid(phys_start_pfn))
+               return -EEXIST;
+
        ret = sparse_add_one_section(zone, phys_start_pfn, nr_pages);
 
        if (ret < 0)
@@ -76,15 +79,22 @@ int __add_pages(struct zone *zone, unsigned long phys_start_pfn,
 {
        unsigned long i;
        int err = 0;
+       int start_sec, end_sec;
+       /* during initialize mem_map, align hot-added range to section */
+       start_sec = pfn_to_section_nr(phys_start_pfn);
+       end_sec = pfn_to_section_nr(phys_start_pfn + nr_pages - 1);
 
-       for (i = 0; i < nr_pages; i += PAGES_PER_SECTION) {
-               err = __add_section(zone, phys_start_pfn + i);
+       for (i = start_sec; i <= end_sec; i++) {
+               err = __add_section(zone, i << PFN_SECTION_SHIFT);
 
-               /* We want to keep adding the rest of the
-                * sections if the first ones already exist
+               /*
+                * EEXIST is finally dealed with by ioresource collision
+                * check. see add_memory() => register_memory_resource()
+                * Warning will be printed if there is collision.
                 */
                if (err && (err != -EEXIST))
                        break;
+               err = 0;
        }
 
        return err;
@@ -156,7 +166,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
        res.flags = IORESOURCE_MEM; /* we just need system ram */
        section_end = res.end;
 
-       while (find_next_system_ram(&res) >= 0) {
+       while ((res.start < res.end) && (find_next_system_ram(&res) >= 0)) {
                start_pfn = (unsigned long)(res.start >> PAGE_SHIFT);
                nr_pages = (unsigned long)
                            ((res.end + 1 - res.start) >> PAGE_SHIFT);
@@ -213,10 +223,9 @@ static void rollback_node_hotadd(int nid, pg_data_t *pgdat)
 }
 
 /* add this memory to iomem resource */
-static void register_memory_resource(u64 start, u64 size)
+static struct resource *register_memory_resource(u64 start, u64 size)
 {
        struct resource *res;
-
        res = kzalloc(sizeof(struct resource), GFP_KERNEL);
        BUG_ON(!res);
 
@@ -228,7 +237,18 @@ static void register_memory_resource(u64 start, u64 size)
                printk("System RAM resource %llx - %llx cannot be added\n",
                (unsigned long long)res->start, (unsigned long long)res->end);
                kfree(res);
+               res = NULL;
        }
+       return res;
+}
+
+static void release_memory_resource(struct resource *res)
+{
+       if (!res)
+               return;
+       release_resource(res);
+       kfree(res);
+       return;
 }
 
 
@@ -237,8 +257,13 @@ int add_memory(int nid, u64 start, u64 size)
 {
        pg_data_t *pgdat = NULL;
        int new_pgdat = 0;
+       struct resource *res;
        int ret;
 
+       res = register_memory_resource(start, size);
+       if (!res)
+               return -EEXIST;
+
        if (!node_online(nid)) {
                pgdat = hotadd_new_pgdat(nid, start);
                if (!pgdat)
@@ -268,14 +293,13 @@ int add_memory(int nid, u64 start, u64 size)
                BUG_ON(ret);
        }
 
-       /* register this memory as resource */
-       register_memory_resource(start, size);
-
        return ret;
 error:
        /* rollback pgdat allocation and others */
        if (new_pgdat)
                rollback_node_hotadd(nid, pgdat);
+       if (res)
+               release_memory_resource(res);
 
        return ret;
 }
index 06abb6634f5be777a374c389b1d4778cb79ee210..53086fb75089346c0fd8658a0d2edcc41d9324ce 100644 (file)
@@ -85,7 +85,7 @@ void br_ifinfo_notify(int event, struct net_bridge_port *port)
                goto err_out;
 
        err = br_fill_ifinfo(skb, port, current->pid, 0, event, 0);
-       if (err)
+       if (err < 0)
                goto err_kfree;
 
        NETLINK_CB(skb).dst_group = RTNLGRP_LINK;
index 738dad9f7d498d40538aa77c3161900353470c7a..104af5d5bcbcb75f84ffaee403f830743fc0a982 100644 (file)
@@ -3541,7 +3541,8 @@ void tcp_cwnd_application_limited(struct sock *sk)
        if (inet_csk(sk)->icsk_ca_state == TCP_CA_Open &&
            sk->sk_socket && !test_bit(SOCK_NOSPACE, &sk->sk_socket->flags)) {
                /* Limited by application or receiver window. */
-               u32 win_used = max(tp->snd_cwnd_used, 2U);
+               u32 init_win = tcp_init_cwnd(tp, __sk_dst_get(sk));
+               u32 win_used = max(tp->snd_cwnd_used, init_win);
                if (win_used < tp->snd_cwnd) {
                        tp->snd_ssthresh = tcp_current_ssthresh(sk);
                        tp->snd_cwnd = (tp->snd_cwnd + win_used) >> 1;
index d504eed416f6a468fb95c7d8da9aa2cebdf3813a..7e6bc41eeb216df942fcaf4b0575a1d4e26a6d05 100644 (file)
@@ -238,11 +238,13 @@ int lapb_setparms(struct net_device *dev, struct lapb_parms_struct *parms)
                goto out_put;
 
        if (lapb->state == LAPB_STATE_0) {
-               if (((parms->mode & LAPB_EXTENDED) &&
-                    (parms->window < 1 || parms->window > 127)) ||
-                   (parms->window < 1 || parms->window > 7))
-                       goto out_put;
-
+               if (parms->mode & LAPB_EXTENDED) {
+                       if (parms->window < 1 || parms->window > 127)
+                               goto out_put;
+               } else {
+                       if (parms->window < 1 || parms->window > 7)
+                               goto out_put;
+               }
                lapb->mode    = parms->mode;
                lapb->window  = parms->window;
        }
index d6cfe84d521ba9fdb9e7321e03d6c9c754f19ed1..2652ead96c64e329b7c2f929316d1324d8aecfd5 100644 (file)
@@ -784,24 +784,20 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,
                copied += used;
                len -= used;
 
-               if (used + offset < skb->len)
-                       continue;
-
                if (!(flags & MSG_PEEK)) {
                        sk_eat_skb(sk, skb, 0);
                        *seq = 0;
                }
+
+               /* For non stream protcols we get one packet per recvmsg call */
+               if (sk->sk_type != SOCK_STREAM)
+                       goto copy_uaddr;
+
+               /* Partial read */
+               if (used + offset < skb->len)
+                       continue;
        } while (len > 0);
 
-       /* 
-        * According to UNIX98, msg_name/msg_namelen are ignored
-        * on connected socket. -ANK
-        * But... af_llc still doesn't have separate sets of methods for
-        * SOCK_DGRAM and SOCK_STREAM :-( So we have to do this test, will
-        * eventually fix this tho :-) -acme
-        */
-       if (sk->sk_type == SOCK_DGRAM)
-               goto copy_uaddr;
 out:
        release_sock(sk);
        return copied;
index 20c4eb5c1ac6829f425382d87cb1d3d52052865b..42eb0c3a97804aa3726999107da0cf65a8cd16a5 100644 (file)
@@ -51,10 +51,10 @@ void llc_save_primitive(struct sock *sk, struct sk_buff* skb, u8 prim)
 {
        struct sockaddr_llc *addr;
 
-       if (skb->sk->sk_type == SOCK_STREAM) /* See UNIX98 */
-               return;
        /* save primitive for use by the user. */
        addr              = llc_ui_skb_cb(skb);
+
+       memset(addr, 0, sizeof(*addr));
        addr->sllc_family = sk->sk_family;
        addr->sllc_arphrd = skb->dev->type;
        addr->sllc_test   = prim == LLC_TEST_PRIM;
index c7844bacbbcbb3770804ff1d2e0afb7a18ce3ead..a19eff12cf78b9013d66f070153c869f8242b151 100644 (file)
@@ -430,7 +430,7 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp)
        }
 #endif
 
-       err = -EINVAL;
+       err = -ENOENT;
        if (ops == NULL)
                goto err_out;
 
index 7026b0866b7b0d50b0003b15bb14fde24a569a65..00cb388ece032cec8aeba948bb97c0e653eede5e 100644 (file)
@@ -71,7 +71,12 @@ struct cache_head *sunrpc_cache_lookup(struct cache_detail *detail,
        new = detail->alloc();
        if (!new)
                return NULL;
+       /* must fully initialise 'new', else
+        * we might get lose if we need to
+        * cache_put it soon.
+        */
        cache_init(new);
+       detail->init(new, key);
 
        write_lock(&detail->hash_lock);
 
@@ -85,7 +90,6 @@ struct cache_head *sunrpc_cache_lookup(struct cache_detail *detail,
                        return tmp;
                }
        }
-       detail->init(new, key);
        new->next = *head;
        *head = new;
        detail->entries++;
index bcc555647e79677a2759f9b9e5079501ef0eff87..3c7d1d8a9a6f3f2568c40502e886a3d6e7ccd6ff 100644 (file)
@@ -51,6 +51,13 @@ static struct transfer_info toonie_transfers[] = {
        {}
 };
 
+static int toonie_usable(struct codec_info_item *cii,
+                        struct transfer_info *ti,
+                        struct transfer_info *out)
+{
+       return 1;
+}
+
 #ifdef CONFIG_PM
 static int toonie_suspend(struct codec_info_item *cii, pm_message_t state)
 {
@@ -69,6 +76,7 @@ static struct codec_info toonie_codec_info = {
        .sysclock_factor = 256,
        .bus_factor = 64,
        .owner = THIS_MODULE,
+       .usable = toonie_usable,
 #ifdef CONFIG_PM
        .suspend = toonie_suspend,
        .resume = toonie_resume,
@@ -79,19 +87,20 @@ static int toonie_init_codec(struct aoa_codec *codec)
 {
        struct toonie *toonie = codec_to_toonie(codec);
 
+       /* nothing connected? what a joke! */
+       if (toonie->codec.connected != 1)
+               return -ENOTCONN;
+
        if (aoa_snd_device_new(SNDRV_DEV_LOWLEVEL, toonie, &ops)) {
                printk(KERN_ERR PFX "failed to create toonie snd device!\n");
                return -ENODEV;
        }
 
-       /* nothing connected? what a joke! */
-       if (toonie->codec.connected != 1)
-               return -ENOTCONN;
-
        if (toonie->codec.soundbus_dev->attach_codec(toonie->codec.soundbus_dev,
                                                     aoa_get_card(),
                                                     &toonie_codec_info, toonie)) {
                printk(KERN_ERR PFX "error creating toonie pcm\n");
+               snd_device_free(aoa_get_card(), toonie);
                return -ENODEV;
        }
 
index 7ae0c0bdfad8fec28e49f4bb3cde0c18e5c3ee9d..f69d33357a28777eab460943bcec783bd52d70c6 100644 (file)
@@ -112,7 +112,10 @@ static struct device_node *get_gpio(char *name,
 
 static void get_irq(struct device_node * np, int *irqptr)
 {
-       *irqptr = irq_of_parse_and_map(np, 0);
+       if (np)
+               *irqptr = irq_of_parse_and_map(np, 0);
+       else
+               *irqptr = NO_IRQ;
 }
 
 /* 0x4 is outenable, 0x1 is out, thus 4 or 5 */
@@ -322,7 +325,7 @@ static int ftr_set_notify(struct gpio_runtime *rt,
                return -EINVAL;
        }
 
-       if (irq == -1)
+       if (irq == NO_IRQ)
                return -ENODEV;
 
        mutex_lock(&notif->mutex);
index 3d57fd1aec4b6888c6d4664015404425143c6285..2836c3218391c549156e0b3e53048daf6ec64cd1 100644 (file)
@@ -18,7 +18,7 @@ static void pmf_gpio_set_##name(struct gpio_runtime *rt, int on)\
                                                        \
        if (unlikely(!rt)) return;                              \
        rc = pmf_call_function(rt->node, #name "-mute", &args); \
-       if (rc)                                                 \
+       if (rc && rc != -ENODEV)                                \
                printk(KERN_WARNING "pmf_gpio_set_" #name       \
                " failed, rc: %d\n", rc);                       \
        rt->implementation_private &= ~(1<<bit);                \
index 71b5080fa66d0dc603785046fcb001a341da9f74..75a9505c744556551f2e12c090e3eb2c03f4d789 100644 (file)
@@ -988,13 +988,12 @@ static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer, struct snd_mix
        if (ptr->index == 0 && (kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0)) != NULL) {
                struct snd_ctl_elem_info *uinfo;
 
-               uinfo = kmalloc(sizeof(*uinfo), GFP_KERNEL);
+               uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL);
                if (! uinfo) {
                        up_read(&mixer->card->controls_rwsem);
                        return -ENOMEM;
                }
                        
-               memset(uinfo, 0, sizeof(*uinfo));
                if (kctl->info(kctl, uinfo)) {
                        up_read(&mixer->card->controls_rwsem);
                        return 0;
index f5ff4f4a16ee0b7964599c49f1311176dc7a6aa1..472fce0ee0e8111210e68ead84424f4f477635f2 100644 (file)
@@ -2228,6 +2228,8 @@ static int snd_pcm_oss_open_file(struct file *file,
        for (idx = 0; idx < 2; idx++) {
                if (setup[idx].disable)
                        continue;
+               if (! pcm->streams[idx].substream_count)
+                       continue; /* no matching substream */
                if (idx == SNDRV_PCM_STREAM_PLAYBACK) {
                        if (! (f_mode & FMODE_WRITE))
                                continue;
index 4260de90f36fb39468d7a623649f7f7486a4ab9c..102ff548ce6931df6ec5e946c5df04138cb63734 100644 (file)
@@ -372,10 +372,9 @@ static struct ops_list * create_driver(char *id)
 {
        struct ops_list *ops;
 
-       ops = kmalloc(sizeof(*ops), GFP_KERNEL);
+       ops = kzalloc(sizeof(*ops), GFP_KERNEL);
        if (ops == NULL)
                return ops;
-       memset(ops, 0, sizeof(*ops));
 
        /* set up driver entry */
        strlcpy(ops->id, id, sizeof(ops->id));
index 6e4d4ab34632f009e3507e3ffc932066a2d3f567..c30669f14ac0f2f386ba524aae4eaba5add06c03 100644 (file)
@@ -68,21 +68,18 @@ void *snd_malloc_sgbuf_pages(struct device *device,
 
        dmab->area = NULL;
        dmab->addr = 0;
-       dmab->private_data = sgbuf = kmalloc(sizeof(*sgbuf), GFP_KERNEL);
+       dmab->private_data = sgbuf = kzalloc(sizeof(*sgbuf), GFP_KERNEL);
        if (! sgbuf)
                return NULL;
-       memset(sgbuf, 0, sizeof(*sgbuf));
        sgbuf->dev = device;
        pages = snd_sgbuf_aligned_pages(size);
        sgbuf->tblsize = sgbuf_align_table(pages);
-       sgbuf->table = kmalloc(sizeof(*sgbuf->table) * sgbuf->tblsize, GFP_KERNEL);
+       sgbuf->table = kcalloc(sgbuf->tblsize, sizeof(*sgbuf->table), GFP_KERNEL);
        if (! sgbuf->table)
                goto _failed;
-       memset(sgbuf->table, 0, sizeof(*sgbuf->table) * sgbuf->tblsize);
-       sgbuf->page_table = kmalloc(sizeof(*sgbuf->page_table) * sgbuf->tblsize, GFP_KERNEL);
+       sgbuf->page_table = kcalloc(sgbuf->tblsize, sizeof(*sgbuf->page_table), GFP_KERNEL);
        if (! sgbuf->page_table)
                goto _failed;
-       memset(sgbuf->page_table, 0, sizeof(*sgbuf->page_table) * sgbuf->tblsize);
 
        /* allocate each page */
        for (i = 0; i < pages; i++) {
index c4af84995d0544b1173b2152be2c0ab46ab09001..7e65a103fbb2f357ebbf59789cbac13c81aea8f5 100644 (file)
@@ -1252,18 +1252,15 @@ static int vx_init_audio_io(struct vx_core *chip)
        chip->audio_info = rmh.Stat[1];
 
        /* allocate pipes */
-       chip->playback_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_outs, GFP_KERNEL);
+       chip->playback_pipes = kcalloc(chip->audio_outs, sizeof(struct vx_pipe *), GFP_KERNEL);
        if (!chip->playback_pipes)
                return -ENOMEM;
-       chip->capture_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_ins, GFP_KERNEL);
+       chip->capture_pipes = kcalloc(chip->audio_ins, sizeof(struct vx_pipe *), GFP_KERNEL);
        if (!chip->capture_pipes) {
                kfree(chip->playback_pipes);
                return -ENOMEM;
        }
 
-       memset(chip->playback_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_outs);
-       memset(chip->capture_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_ins);
-
        preferred = chip->ibl.size;
        chip->ibl.size = 0;
        vx_set_ibl(chip, &chip->ibl); /* query the info */
index 27a8dbe6f6a8ad9aadf564b40a2b6c368c7f5bc4..c3dafa29054f96c618c1c824830ec06623c47014 100644 (file)
@@ -236,9 +236,9 @@ static int pcm_open(struct snd_pcm_substream *substream,
        chip = snd_pcm_substream_chip(substream);
        runtime = substream->runtime;
 
-       if (!(pipe = kmalloc(sizeof(struct audiopipe), GFP_KERNEL)))
+       pipe = kzalloc(sizeof(struct audiopipe), GFP_KERNEL);
+       if (!pipe)
                return -ENOMEM;
-       memset(pipe, 0, sizeof(struct audiopipe));
        pipe->index = -1;               /* Not configured yet */
 
        /* Set up hw capabilities and contraints */
index f9b5c3dc3b346ac51bb5f9e0543d85268475fd50..79f24cdf5fbf0b121b6c7564325d8983e89e86d1 100644 (file)
@@ -936,6 +936,17 @@ static struct snd_emu_chip_details emu_chip_details[] = {
         .ca0151_chip = 1,
         .spk71 = 1,
         .spdif_bug = 1} ,
+       /* Dell OEM/Creative Labs Audigy 2 ZS */
+       /* See ALSA bug#1365 */
+       {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10031102,
+        .driver = "Audigy2", .name = "Audigy 2 ZS [SB0353]",
+        .id = "Audigy2",
+        .emu10k2_chip = 1,
+        .ca0102_chip = 1,
+        .ca0151_chip = 1,
+        .spk71 = 1,
+        .spdif_bug = 1,
+        .ac97_chip = 1} ,
        {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10021102,
         .driver = "Audigy2", .name = "Audigy 2 Platinum [SB0240P]", 
         .id = "Audigy2",
index a8b31286b6db773de31d7157f5df84683d0779b3..1076af4c36696cf2572fe5f1c8b034639c43905f 100644 (file)
@@ -37,9 +37,13 @@ irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        int handled = 0;
 
        while ((status = inl(emu->port + IPR)) != 0) {
-               //printk("emu10k1 irq - status = 0x%x\n", status);
+               //snd_printk(KERN_INFO "emu10k1 irq - status = 0x%x\n", status);
                orig_status = status;
                handled = 1;
+               if ((status & 0xffffffff) == 0xffffffff) {
+                       snd_printk(KERN_INFO "snd-emu10k1: Suspected sound card removal\n");
+                       break;
+               }
                if (status & IPR_PCIERROR) {
                        snd_printk(KERN_ERR "interrupt: PCI error\n");
                        snd_emu10k1_intr_disable(emu, INTE_PCIERRORENABLE);
index 82d791be74993574aa8b3865b23ca269e90adb16..05dabe4546587d53d597ae5e57e169e8de30afa1 100644 (file)
@@ -801,11 +801,10 @@ snd_pmac_awacs_init(struct snd_pmac *chip)
        chip->revision = (in_le32(&chip->awacs->codec_stat) >> 12) & 0xf;
 #ifdef PMAC_AMP_AVAIL
        if (chip->revision == 3 && chip->has_iic && CHECK_CUDA_AMP()) {
-               struct awacs_amp *amp = kmalloc(sizeof(*amp), GFP_KERNEL);
+               struct awacs_amp *amp = kzalloc(sizeof(*amp), GFP_KERNEL);
                if (! amp)
                        return -ENOMEM;
                chip->mixer_data = amp;
-               memset(amp, 0, sizeof(*amp));
                chip->mixer_free = awacs_amp_free;
                awacs_amp_set_vol(amp, 0, 63, 63, 0); /* mute and zero vol */
                awacs_amp_set_vol(amp, 1, 63, 63, 0);
index 46eebf5610e39386cd3fc72eb40ccba456380d80..57202b0f033ecf977e121bf732a1834c17f6f5dd 100644 (file)
@@ -258,10 +258,9 @@ int __init snd_pmac_daca_init(struct snd_pmac *chip)
                request_module("i2c-powermac");
 #endif /* CONFIG_KMOD */       
 
-       mix = kmalloc(sizeof(*mix), GFP_KERNEL);
+       mix = kzalloc(sizeof(*mix), GFP_KERNEL);
        if (! mix)
                return -ENOMEM;
-       memset(mix, 0, sizeof(*mix));
        chip->mixer_data = mix;
        chip->mixer_free = daca_cleanup;
        mix->amp_on = 1; /* default on */
index fb05938dcbd91c5a6f75e4191c1f74835010f4b0..59482a4cd44641ecd8d9ab253c128c93ae1dd3a3 100644 (file)
@@ -64,11 +64,10 @@ static int keywest_attach_adapter(struct i2c_adapter *adapter)
        if (strncmp(i2c_device_name(adapter), "mac-io", 6))
                return 0; /* ignored */
 
-       new_client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
+       new_client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
        if (! new_client)
                return -ENOMEM;
 
-       memset(new_client, 0, sizeof(*new_client));
        new_client->addr = keywest_ctx->addr;
        i2c_set_clientdata(new_client, keywest_ctx);
        new_client->adapter = adapter;
index fa9a44ab487e8a35a46e0a4086849943719c5f5f..2264574fa06b7c317252653f75068f5e841a6235 100644 (file)
@@ -181,21 +181,14 @@ static int __init alsa_card_pmac_init(void)
        if ((err = platform_driver_register(&snd_pmac_driver)) < 0)
                return err;
        device = platform_device_register_simple(SND_PMAC_DRIVER, -1, NULL, 0);
-       if (!IS_ERR(device)) {
-               if (platform_get_drvdata(device))
-                       return 0;
-               platform_device_unregister(device);
-               err = -ENODEV;
-       } else
-               err = PTR_ERR(device);
-       platform_driver_unregister(&snd_pmac_driver);
-       return err;
+       return 0;
 
 }
 
 static void __exit alsa_card_pmac_exit(void)
 {
-       platform_device_unregister(device);
+       if (!IS_ERR(device))
+               platform_device_unregister(device);
        platform_driver_unregister(&snd_pmac_driver);
 }
 
index 692c6117767859f3749602372b0cb61112466ece..84f6b19c07ca0c38f7c4057bb7a87ef3fd8b74b8 100644 (file)
@@ -1316,10 +1316,9 @@ int __init snd_pmac_tumbler_init(struct snd_pmac *chip)
                request_module("i2c-powermac");
 #endif /* CONFIG_KMOD */       
 
-       mix = kmalloc(sizeof(*mix), GFP_KERNEL);
+       mix = kzalloc(sizeof(*mix), GFP_KERNEL);
        if (! mix)
                return -ENOMEM;
-       memset(mix, 0, sizeof(*mix));
        mix->headphone_irq = -1;
 
        chip->mixer_data = mix;
index d32d83d970cc9807f0fc19d31f35f5cb8d49104e..1b7f499c549da7f2457bbff3f7c3e1ab63cf7e40 100644 (file)
@@ -2260,10 +2260,9 @@ static int add_audio_endpoint(struct snd_usb_audio *chip, int stream, struct aud
        }
 
        /* create a new pcm */
-       as = kmalloc(sizeof(*as), GFP_KERNEL);
+       as = kzalloc(sizeof(*as), GFP_KERNEL);
        if (! as)
                return -ENOMEM;
-       memset(as, 0, sizeof(*as));
        as->pcm_index = chip->pcm_devs;
        as->chip = chip;
        as->fmt_type = fp->fmt_type;
@@ -2633,13 +2632,12 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
                        csep = NULL;
                }
 
-               fp = kmalloc(sizeof(*fp), GFP_KERNEL);
+               fp = kzalloc(sizeof(*fp), GFP_KERNEL);
                if (! fp) {
                        snd_printk(KERN_ERR "cannot malloc\n");
                        return -ENOMEM;
                }
 
-               memset(fp, 0, sizeof(*fp));
                fp->iface = iface_no;
                fp->altsetting = altno;
                fp->altset_idx = i;