Linux 2.6.18.2
Subsystems (40)
We (the -stable team) are announcing the release of the 2.6.18.2 kernel.
The diffstat and short summary of the fixes are below.
I'll also be replying to this message with a copy of the patch between 2.6.18.1 and 2.6.18.2, as it is (barely) small enough to do so.
The updated 2.6.18.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.18.y.git
and can be browsed at the normal kernel.org git web browser:
www.kernel.org/git/
(note: the main -stable git tree update will lag a half-day or so for this one, use git://git.kernel.org/pub/scm/linux/kernel/git/chrisw/linux-2.6.18.y.git for now)
thanks,
-chris
--------
Makefile | 2 arch/i386/Kconfig.cpu | 3 arch/i386/kernel/alternative.c | 4 arch/powerpc/Kconfig | 9 + arch/powerpc/configs/pseries_defconfig | 1 arch/s390/Kconfig | 4 arch/s390/lib/Makefile | 1 arch/s390/lib/div64.c | 151 ++++++++++++++++++++++ arch/sparc64/kernel/central.c | 4 arch/sparc64/kernel/of_device.c | 33 +++- arch/sparc64/kernel/pci_common.c | 29 +--- arch/sparc64/kernel/pci_iommu.c | 2 arch/sparc64/kernel/pci_sabre.c | 23 ++- arch/sparc64/kernel/prom.c | 30 ++-- arch/um/include/kern_util.h | 1 arch/um/os-Linux/sys-i386/tls.c | 2 arch/um/os-Linux/tls.c | 2 arch/um/sys-x86_64/stub_segv.c | 1 arch/x86_64/kernel/time.c | 2 block/ll_rw_blk.c | 24 +++ drivers/block/DAC960.c | 2 drivers/char/hw_random/intel-rng.c | 186 ++++++++++++++++++++++++++-- drivers/char/watchdog/sc1200wdt.c | 9 + drivers/ide/pci/generic.c | 6 drivers/infiniband/hw/mthca/mthca_cq.c | 7 + drivers/infiniband/hw/mthca/mthca_qp.c | 19 ++ drivers/infiniband/hw/mthca/mthca_srq.c | 8 + drivers/infiniband/ulp/ipoib/ipoib_ib.c | 4 drivers/isdn/capi/capidrv.c | 3 drivers/isdn/hisax/config.c | 6 drivers/isdn/i4l/isdn_common.c | 9 - drivers/isdn/icn/icn.c | 3 drivers/isdn/isdnloop/isdnloop.c | 3 drivers/isdn/pcbit/drv.c | 16 +- drivers/macintosh/via-pmu-backlight.c | 2 drivers/md/md.c | 1 drivers/md/multipath.c | 2 drivers/md/raid10.c | 2 drivers/media/dvb/b2c2/flexcop-fe-tuner.c | 2 drivers/media/dvb/frontends/dvb-pll.c | 3 drivers/media/video/cx88/cx88-dvb.c | 14 +- drivers/media/video/saa7134/saa7134-dvb.c | 4 drivers/net/sky2.c | 83 ++++++------ drivers/net/sky2.h | 2 drivers/net/wireless/bcm43xx/bcm43xx_main.c | 8 + drivers/pci/quirks.c | 27 ---- drivers/rtc/rtc-max6902.c | 2 drivers/scsi/aic7xxx/aic7xxx_osm.c | 21 ++- drivers/serial/serial_core.c | 9 + drivers/serial/serial_cs.c | 12 - drivers/usb/core/devio.c | 26 ++- drivers/usb/core/notify.c | 3 drivers/usb/core/usb.h | 1 fs/fuse/dir.c | 30 +++- fs/fuse/file.c | 12 + fs/fuse/inode.c | 5 fs/jfs/jfs_imap.c | 4 fs/nfs/dir.c | 14 +- fs/splice.c | 6 include/asm-generic/audit_change_attr.h | 4 include/asm-generic/audit_dir_write.h | 4 include/asm-s390/div64.h | 48 ------- include/linux/mmzone.h | 12 + include/linux/serial_core.h | 1 kernel/posix-cpu-timers.c | 27 +++- kernel/taskstats.c | 15 +- lib/audit.c | 2 mm/memory.c | 9 + mm/page_alloc.c | 4 mm/vmscan.c | 63 ++++++--- mm/vmstat.c | 2 net/bluetooth/rfcomm/tty.c | 3 net/core/skbuff.c | 9 - net/decnet/af_decnet.c | 4 net/ipv4/tcp_cubic.c | 6 net/ipv6/ip6_flowlabel.c | 2 net/sctp/input.c | 3 net/sunrpc/svcsock.c | 2 sound/core/hwdep.c | 3 sound/core/info.c | 5 sound/core/rtctimer.c | 17 ++ sound/pci/au88x0/au88x0.c | 1 sound/pci/emu10k1/emu10k1_main.c | 4 sound/ppc/keywest.c | 3 sound/usb/usx2y/usbusx2yaudio.c | 18 -- sound/usb/usx2y/usx2yhwdeppcm.c | 17 -- 86 files changed, 851 insertions(+), 341 deletions(-)
Summary of changes from v2.6.18.1 to v2.6.18.2
============================================
Akinobu Mita:
Watchdog: sc1200wdt - fix missing pnp_unregister_driver()
Al Viro:
fix missing ifdefs in syscall classes hookup for generic targets
Alan Cox:
JMB 368 PATA detection
Alan Stern:
usbfs: private mutex for open, release, and remove
Amol Lad:
sound/pci/au88x0/au88x0.c: ioremap balanced with iounmap
Andi Kleen:
x86-64: Fix C3 timer test
Andy Whitcroft:
Reintroduce NODES_SPAN_OTHER_NODES for powerpc
Arnaud Patard:
ALSA: emu10k1: Fix outl() in snd_emu10k1_resume_regs()
Arthur Kepner:
IB/mthca: Use mmiowb after doorbell ring
Brian King:
SCSI: DAC960: PCI id table fixup
Chris Wright:
Linux 2.6.18.2
Clemens Ladisch:
ALSA: snd_rtctimer: handle RTC interrupts with a tasklet
Dave Kleikamp:
JFS: pageno needs to be long
David Miller:
SPARC64: Fix central/FHC bus handling on Ex000 systems.
SPARC64: Fix memory corruption in pci_4u_free_consistent().
SPARC64: Fix PCI memory space root resource on Hummingbird.
David Woodhouse:
Fix uninitialised spinlock in via-pmu-backlight code.
Doug Ledford:
SCSI: aic7xxx: pause sequencer before touching SBLKCTL
Eli Cohen:
IPoIB: Rejoin all multicast groups after a port event
Florin Malita:
ALSA: Dereference after free in snd_hwdep_release()
Francisco Larramendi:
rtc-max6902: month conversion fix
Herbert Xu:
NET: Fix skb_segment() handling of fully linear SKBs
SCTP: Always linearise packet on input
James Bottomley:
SCSI: aic7xxx: avoid checking SBLKCTL register for certain cards
James Morris:
IPV6: fix lockup via /proc/net/ip6_flowlabel [CVE-2006-5619]
Jan Beulich:
fix Intel RNG detection
Jeff Garzik:
ISDN: check for userspace copy faults
ISDN: fix drivers, by handling errors thrown by ->readstat()
Jens Axboe:
splice: fix pipe_to_file() ->prepare_write() error path
Karsten Wiese:
ALSA: Fix bug in snd-usb-usx2y's usX2Y_pcms_lock_check()
ALSA: Repair snd-usb-usx2y for usb 2.6.18
PCI: Remove quirk_via_abnormal_poweroff
Marcel Holtmann:
Bluetooth: Check if DLC is still attached to the TTY
Martin Bligh:
vmscan: Fix temp_priority race
Use min of two prio settings in calculating distress for reclaim
Martin Schwidefsky:
__div64_32 for 31 bit.
Michael Buesch:
bcm43xx: fix watchdog timeouts.
Michael Krufky:
DVB: fix dvb_pll_attach for mt352/zl10353 in cx88-dvb, and nxt200x
Miklos Szeredi:
fuse: fix hang on SMP
NeilBrown:
md: Fix bug where spares don't always get rebuilt properly when they become live.
md: Fix calculation of ->degraded for multipath and raid10
knfsd: Fix race that can disable NFS server.
md: check bio address after mapping through partitions.
Oleg Nesterov:
fill_tgid: fix task_struct leak and possible oops
Paolo 'Blaisorblade' Giarrusso:
uml: fix processor selection to exclude unsupported processors and features
uml: remove warnings added by previous -stable patch
Patrick McHardy:
Fix sfuzz hanging on 2.6.18
Russell King:
SERIAL: Fix resume handling bug
SERIAL: Fix oops when removing suspended serial port
Stephen Hemminger:
sky2: MSI test race and message
sky2: pause parameter adjustment
sky2: turn off PHY IRQ on shutdown
sky2: accept multicast pause frames
sky2: GMAC pause frame
sky2: 88E803X transmit lockup (2.6.18)
tcp: cubic scaling error
Suresh Siddha:
mm: fix a race condition under SMC + COW
Takashi Iwai:
ALSA: powermac - Fix Oops when conflicting with aoa driver
ALSA: Fix re-use of va_list
Thomas Gleixner:
posix-cpu-timers: prevent signal delivery starvation
Trond Myklebust:
NFS: nfs_lookup - don't hash dentry when optimising away the lookup
Ulrich Drepper:
uml: make Uml compile on FC6 kernel headers
Zachary Amsden:
Fix potential interrupts during alternative patching
Makefile +1 -1
@@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 18 -EXTRAVERSION = .1 +EXTRAVERSION = .2 NAME=Avast! A bilge rat! # *DOCUMENTATION*
arch/i386/Kconfig.cpu +2 -1
@@ -7,6 +7,7 @@ choice config M386 bool "386" + depends on !UML ---help--- This is the processor type of your CPU. This information is used for optimizing purposes. In order to compile a kernel that can run on
@@ -301,7 +302,7 @@ config X86_USE_PPRO_CHECKSUM config X86_USE_3DNOW bool - depends on MCYRIXIII || MK7 || MGEODE_LX + depends on (MCYRIXIII || MK7 || MGEODE_LX) && !UML default y config X86_OOSTORE
arch/i386/kernel/alternative.c +4 -0
@@ -344,6 +344,7 @@ #endifvoid __init alternative_instructions (void ) { +unsigned long flags;if (no_replacement) {printk (KERN_INFO "(SMP-)alternatives turned off\n" ); free_init_pages("SMP alternatives",
@@ -351,6 +352,8 @@ void __init alternative_instructions(voi (unsigned long)__smp_alt_end);return ; } + +local_irq_save (flags);apply_alternatives (__alt_instructions, __alt_instructions_end);/* switch to patch-once-at-boottime-only mode and free the
@@ -386,4 +389,5 @@ #ifdef CONFIG_SMP alternatives_smp_switch(0); }#endif +local_irq_restore (flags); }
arch/powerpc/Kconfig +9 -0
@@ -729,6 +729,15 @@ config ARCH_MEMORY_PROBE def_bool y depends on MEMORY_HOTPLUG +# Some NUMA nodes have memory ranges that span +# other nodes. Even though a pfn is valid and +# between a node's start and end pfns, it may not +# reside on that node. See memmap_init_zone() +# for details. +config NODES_SPAN_OTHER_NODES + def_bool y + depends on NEED_MULTIPLE_NODES + config PPC_64K_PAGES bool "64k page size" depends on PPC64
arch/powerpc/configs/pseries_defconfig +1 -0
@@ -184,6 +184,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_MIGRATION=y CONFIG_RESOURCES_64BIT=y CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y +CONFIG_NODES_SPAN_OTHER_NODES=y # CONFIG_PPC_64K_PAGES is not set CONFIG_SCHED_SMT=y CONFIG_PROC_DEVICETREE=y
arch/s390/Kconfig +4 -0
@@ -51,6 +51,10 @@ config 64BIT Select this option if you have a 64 bit IBM zSeries machine and want to use the 64 bit addressing mode. +config 32BIT + bool + default y if !64BIT + config SMP bool "Symmetric multi-processing support" ---help---
arch/s390/lib/Makefile +1 -0
@@ -7,3 +7,4 @@ EXTRA_AFLAGS := -traditional lib-y += delay.o string.o lib-y += $(if $(CONFIG_64BIT),uaccess64.o,uaccess.o) lib-$(CONFIG_SMP) += spinlock.o +lib-$(CONFIG_32BIT) += div64.o
arch/s390/lib/div64.c new file +151 -0
151 lines not on this page · raw message
arch/sparc64/kernel/central.c +4 -0
@@ -126,6 +126,10 @@ static void probe_other_fhcs(void)int board;u32 tmp; +if (dp->parent && + dp->parent->parent !=NULL ) +continue ; + fhc = (struct linux_fhc *)central_alloc_bootmem (sizeof (struct linux_fhc ));if (fhc ==NULL )
arch/sparc64/kernel/of_device.c +24 -9
@@ -398,16 +398,22 @@ static void of_bus_sbus_count_cells(stru *sizec =1 ; } -static int of_bus_sbus_map (u32 *addr,const u32 *range,int na,int ns,int pna) -{ -return of_bus_default_map (addr, range, na, ns, pna); -} - -static unsigned int of_bus_sbus_get_flags (u32 *addr) +/* +* FHC/Central bus specific translator. +* +* This is just needed to hard-code the address and size cell +* counts. 'fhc' and 'central' nodes lack the #address-cells and +* #size-cells properties, and if you walk to the root on such +* Enterprise boxes all you'll get is a #size-cells of 2 which is +* not what we want to use. +*/ +static int of_bus_fhc_match (struct device_node *np) { -return IORESOURCE_MEM ; +return !strcmp (np->name,"fhc" ) || + !strcmp (np->name,"central" ); } +#define of_bus_fhc_count_cells of_bus_sbus_count_cells/* * Array of bus specific translators
@@ -429,8 +435,17 @@ static struct of_bus of_busses[] = { .addr_prop_name = "reg", .match = of_bus_sbus_match, .count_cells = of_bus_sbus_count_cells, - .map = of_bus_sbus_map, - .get_flags = of_bus_sbus_get_flags, + .map = of_bus_default_map, + .get_flags = of_bus_default_get_flags, + }, +/* FHC */ + { + .name = "fhc", + .addr_prop_name = "reg", + .match = of_bus_fhc_match, + .count_cells = of_bus_fhc_count_cells, + .map = of_bus_default_map, + .get_flags = of_bus_default_get_flags, },/* Default */ {
arch/sparc64/kernel/pci_common.c +10 -19
@@ -330,19 +330,6 @@ #endifreturn res; } -static int __init pdev_resource_collisions_expected (struct pci_dev *pdev) -{ -if (pdev->vendor !=PCI_VENDOR_ID_SUN ) -return 0 ; - -if (pdev->device ==PCI_DEVICE_ID_SUN_RIO_EBUS || - pdev->device ==PCI_DEVICE_ID_SUN_RIO_1394 || - pdev->device ==PCI_DEVICE_ID_SUN_RIO_USB ) -return 1 ; - -return 0 ; -} -static void __init pdev_record_assignments (struct pci_pbm_info *pbm,struct pci_dev *pdev) {
@@ -400,19 +387,23 @@ static void __init pdev_record_assignmen pbm->parent->resource_adjust (pdev, res, root);if (request_resource (root, res) <0 ) { +int rnum; +/* OK, there is some conflict. But this is fine * since we'll reassign it in the fixup pass. * -* We notify the user that OBP made an error if it -* is a case we don't expect. +* Do not print the warning for ROM resources +* as such a conflict is quite common and +* harmless as the ROM bar is disabled. */ -if (!pdev_resource_collisions_expected (pdev)) { -printk (KERN_ERR "PCI: Address space collision on region %ld " + rnum = (res - &pdev->resource[0 ]); +if (rnum !=PCI_ROM_RESOURCE ) +printk (KERN_ERR "PCI: Resource collision, " +"region %d " "[%016lx:%016lx] of device %s\n" , - (res - &pdev->resource[0 ]), + rnum, res->start, res->end,pci_name (pdev)); - } } } }
arch/sparc64/kernel/pci_iommu.c +1 -1
@@ -281,7 +281,7 @@ static void pci_4u_free_consistent(strucspin_lock_irqsave (&iommu->lock, flags); -free_npages (iommu, dvma, npages); +free_npages (iommu, dvma - iommu->page_table_map_base, npages);spin_unlock_irqrestore (&iommu->lock, flags);
arch/sparc64/kernel/pci_sabre.c +19 -4
@@ -1196,7 +1196,7 @@ static void pbm_register_toplevel_resour &pbm->mem_space); } -static void sabre_pbm_init (struct pci_controller_info *p,struct device_node *dp,u32 dma_begin) +static void sabre_pbm_init (struct pci_controller_info *p,struct device_node *dp,u32 dma_start,u32 dma_end) {struct pci_pbm_info *pbm;struct device_node *node;
@@ -1261,6 +1261,8 @@ static void sabre_pbm_init(struct pci_co node = node->sibling; }if (simbas_found ==0 ) { +struct resource *rp; +/* No APBs underneath, probably this is a hummingbird * system. */
@@ -1302,8 +1304,10 @@ static void sabre_pbm_init(struct pci_co pbm->io_space.end = pbm->io_space.start + (1UL <<24 ) -1UL ; pbm->io_space.flags =IORESOURCE_IO ; - pbm->mem_space.start = p->pbm_A.controller_regs +SABRE_MEMSPACE ; - pbm->mem_space.end = pbm->mem_space.start + (unsigned long )dma_begin -1UL ; + pbm->mem_space.start = + (p->pbm_A.controller_regs +SABRE_MEMSPACE ); + pbm->mem_space.end = + (pbm->mem_space.start + ((1UL <<32UL ) -1UL )); pbm->mem_space.flags =IORESOURCE_MEM ;if (request_resource (&ioport_resource, &pbm->io_space) <0 ) {
@@ -1315,6 +1319,17 @@ static void sabre_pbm_init(struct pci_coprom_halt (); } + rp =kmalloc (sizeof (*rp),GFP_KERNEL ); +if (!rp) { +prom_printf ("Cannot allocate IOMMU resource.\n" ); +prom_halt (); + } + rp->name ="IOMMU" ; + rp->start = pbm->mem_space.start + (unsigned long ) dma_start; + rp->end = pbm->mem_space.start + (unsigned long ) dma_end -1UL ; + rp->flags =IORESOURCE_BUSY ; +request_resource (&pbm->mem_space, rp); +pci_register_legacy_regions (&pbm->io_space, &pbm->mem_space); }
@@ -1450,5 +1465,5 @@ void sabre_init(struct device_node *dp,/* * Look for APB underneath. */ -sabre_pbm_init (p, dp, vdma[0 ]); +sabre_pbm_init (p, dp, vdma[0 ], vdma[0 ] + vdma[1 ]); }
arch/sparc64/kernel/prom.c +15 -15
@@ -1080,23 +1080,22 @@ static void sun4v_vdev_irq_trans_init(ststatic void irq_trans_init (struct device_node *dp) { -const char *model;#ifdef CONFIG_PCI +const char *model;int i;#endif +#ifdef CONFIG_PCI model =of_get_property (dp,"model" ,NULL );if (!model) model =of_get_property (dp,"compatible" ,NULL ); -if (!model) -return ; - -#ifdef CONFIG_PCI -for (i =0 ; i <ARRAY_SIZE (pci_irq_trans_table); i++) { -struct irq_trans *t = &pci_irq_trans_table[i]; +if (model) { +for (i =0 ; i <ARRAY_SIZE (pci_irq_trans_table); i++) { +struct irq_trans *t = &pci_irq_trans_table[i]; -if (!strcmp (model, t->name)) -return t->init (dp); +if (!strcmp (model, t->name)) +return t->init (dp); + } }#endif #ifdef CONFIG_SBUS
@@ -1104,8 +1103,9 @@ #ifdef CONFIG_SBUS !strcmp(dp->name, "sbi"))return sbus_irq_trans_init (dp);#endif -if (!strcmp (dp->name,"central" )) -return central_irq_trans_init (dp->child); +if (!strcmp (dp->name,"fhc" ) && + !strcmp (dp->parent->name,"central" )) +return central_irq_trans_init (dp);if (!strcmp (dp->name,"virtual-devices" ))return sun4v_vdev_irq_trans_init (dp); }
@@ -1517,7 +1517,7 @@ static char * __init get_one_property(phreturn buf; } -static struct device_node *__init create_node (phandle node) +static struct device_node *__init create_node (phandle node,struct device_node *parent) {struct device_node *dp;
@@ -1526,6 +1526,7 @@ static struct device_node * __init creat dp =prom_early_alloc (sizeof (*dp)); dp->unique_id = unique_id++; + dp->parent = parent;kref_init (&dp->kref);
@@ -1544,12 +1545,11 @@ static struct device_node * __init build {struct device_node *dp; - dp =create_node (node); + dp =create_node (node, parent);if (dp) { *(*nextp) = dp; *nextp = &dp->allnext; - dp->parent = parent; dp->path_component_name =build_path_component (dp); dp->full_name =build_full_name (dp);
@@ -1565,7 +1565,7 @@ void __init prom_build_devicetree(void) {struct device_node **nextp; - allnodes =create_node (prom_root_node); + allnodes =create_node (prom_root_node,NULL ); allnodes->path_component_name ="" ; allnodes->full_name ="/" ;
arch/um/include/kern_util.h +0 -1
@@ -6,7 +6,6 @@#ifndef __KERN_UTIL_H__#define __KERN_UTIL_H__ -#include "linux/threads.h" #include "sysdep/ptrace.h" #include "sysdep/faultinfo.h"
arch/um/os-Linux/sys-i386/tls.c +2 -0
@@ -1,4 +1,6 @@#include <errno.h> +#include <sys/syscall.h> +#include <unistd.h> #include <linux/unistd.h> #include "sysdep/tls.h" #include "user_util.h"
arch/um/os-Linux/tls.c +2 -0
@@ -1,6 +1,8 @@#include <errno.h> #include <sys/ptrace.h> +#include <sys/syscall.h> #include <asm/ldt.h> +#include <unistd.h> #include "sysdep/tls.h" #include "uml-config.h"
arch/um/sys-x86_64/stub_segv.c +0 -1
@@ -5,7 +5,6 @@#include <stddef.h> #include <signal.h> -#include <linux/compiler.h> #include <asm/unistd.h> #include "uml-config.h" #include "sysdep/sigcontext.h"
arch/x86_64/kernel/time.c +1 -1
@@ -960,7 +960,7 @@ #endifif (boot_cpu_data.x86_vendor ==X86_VENDOR_INTEL ) {#ifdef CONFIG_ACPI /* But TSC doesn't tick in C3 so don't use it there */ -if (acpi_fadt.length >0 && acpi_fadt.plvl3_lat <100 ) +if (acpi_fadt.length >0 && acpi_fadt.plvl3_lat <1000 )return 1 ;#endif return 0 ;
block/ll_rw_blk.c +20 -4
@@ -3021,6 +3021,7 @@ void generic_make_request(struct bio *bi {request_queue_t *q;sector_t maxsector; +sector_t old_sector;int ret, nr_sectors =bio_sectors (bio);dev_t old_dev;
@@ -3049,7 +3050,7 @@ void generic_make_request(struct bio *bi* NOTE: we don't repeat the blk_size check for each new device. * Stacking drivers are expected to know what they are doing. */ - maxsector =-1 ; + old_sector =-1 ; old_dev =0 ; do { char b[BDEVNAME_SIZE];
@@ -3083,15 +3084,30 @@ end_io:*/ blk_partition_remap (bio); -if (maxsector !=-1 ) +if (old_sector !=-1 )blk_add_trace_remap (q, bio, old_dev, bio->bi_sector, - maxsector); + old_sector);blk_add_trace_bio (q, bio,BLK_TA_QUEUE ); - maxsector = bio->bi_sector; + old_sector = bio->bi_sector; old_dev = bio->bi_bdev->bd_dev; + maxsector = bio->bi_bdev->bd_inode->i_size >>9 ; +if (maxsector) { +sector_t sector = bio->bi_sector; + +if (maxsector < nr_sectors || maxsector - nr_sectors < sector) { +/* +* This may well happen - partitions are not checked +* to make sure they are within the size of the +* whole device. +*/ +handle_bad_sector (bio); + goto end_io; + } + } + ret = q->make_request_fn (q, bio); }while (ret); }
drivers/block/DAC960.c +1 -1
@@ -7115,7 +7115,7 @@ static struct pci_device_id DAC960_id_ta { .vendor = PCI_VENDOR_ID_MYLEX, .device = PCI_DEVICE_ID_MYLEX_DAC960_GEM, - .subvendor = PCI_ANY_ID, + .subvendor = PCI_VENDOR_ID_MYLEX, .subdevice = PCI_ANY_ID, .driver_data = (unsigned long) &DAC960_GEM_privdata, },
drivers/char/hw_random/intel-rng.c +177 -9
217 lines not on this page · raw message
drivers/char/watchdog/sc1200wdt.c +7 -2
@@ -392,7 +392,7 @@ #endifif (io ==-1 ) { printk(KERN_ERR PFX "io parameter must be specified\n"); ret = -EINVAL ; - goto out_clean; + goto out_pnp; }#if definedCONFIG_PNP
@@ -405,7 +405,7 @@ #endifif (!request_region (io, io_len,SC1200_MODULE_NAME )) { printk(KERN_ERR PFX "Unable to register IO port %#x\n", io); ret = -EBUSY ; - goto out_clean; + goto out_pnp; } ret =sc1200wdt_probe ();
@@ -435,6 +435,11 @@ out_rbt: out_io:release_region (io, io_len); +out_pnp: +#if definedCONFIG_PNP +if (isapnp) +pnp_unregister_driver (&scl200wdt_pnp_driver); +#endif goto out_clean; }
drivers/ide/pci/generic.c +4 -2
@@ -242,8 +242,10 @@ static int __devinit generic_init_one(st (!(PCI_FUNC(dev->devfn) & 1))) goto out; -if (dev->vendor ==PCI_VENDOR_ID_JMICRON &&PCI_FUNC (dev->devfn) !=1 ) - goto out; +if (dev->vendor ==PCI_VENDOR_ID_JMICRON ) { +if (dev->device !=PCI_DEVICE_ID_JMICRON_JMB368 &&PCI_FUNC (dev->devfn) !=1 ) + goto out; + }if (dev->vendor !=PCI_VENDOR_ID_JMICRON ) {pci_read_config_word (dev,PCI_COMMAND , &command);
drivers/infiniband/hw/mthca/mthca_cq.c +7 -0
@@ -39,6 +39,8 @@#include <linux/init.h> #include <linux/hardirq.h> +#include <asm/io.h> +#include <rdma/ib_pack.h> #include "mthca_dev.h"
@@ -210,6 +212,11 @@ static inline void update_cons_index(strmthca_write64 (doorbell, dev->kar +MTHCA_CQ_DOORBELL ,MTHCA_GET_DOORBELL_LOCK (&dev->doorbell_lock)); +/* +* Make sure doorbells don't leak out of CQ spinlock +* and reach the HCA out of order: +*/ +mmiowb (); } }
drivers/infiniband/hw/mthca/mthca_qp.c +19 -0
@@ -39,6 +39,8 @@ #include <linux/init.h>#include <linux/string.h> #include <linux/slab.h> +#include <asm/io.h> +#include <rdma/ib_verbs.h> #include <rdma/ib_cache.h> #include <rdma/ib_pack.h>
@@ -1730,6 +1732,11 @@ out:mthca_write64 (doorbell, dev->kar +MTHCA_SEND_DOORBELL ,MTHCA_GET_DOORBELL_LOCK (&dev->doorbell_lock)); +/* +* Make sure doorbells don't leak out of SQ spinlock +* and reach the HCA out of order: +*/ +mmiowb (); } qp->sq.next_ind = ind;
@@ -1849,6 +1856,12 @@ out: qp->rq.next_ind = ind; qp->rq.head += nreq; +/* +* Make sure doorbells don't leak out of RQ spinlock and reach +* the HCA out of order: +*/ +mmiowb (); +spin_unlock_irqrestore (&qp->rq.lock, flags);return err; }
@@ -2110,6 +2123,12 @@ out: MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); } +/* +* Make sure doorbells don't leak out of SQ spinlock and reach +* the HCA out of order: +*/ +mmiowb (); +spin_unlock_irqrestore (&qp->sq.lock, flags);return err; }
drivers/infiniband/hw/mthca/mthca_srq.c +8 -0
@@ -35,6 +35,8 @@#include <linux/slab.h> #include <linux/string.h> +#include <asm/io.h> +#include "mthca_dev.h" #include "mthca_cmd.h" #include "mthca_memfree.h"
@@ -593,6 +595,12 @@ int mthca_tavor_post_srq_recv(struct ib_ MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); } +/* +* Make sure doorbells don't leak out of SRQ spinlock and +* reach the HCA out of order: +*/ +mmiowb (); +spin_unlock_irqrestore (&srq->lock, flags);return err; }
drivers/infiniband/ulp/ipoib/ipoib_ib.c +3 -1
@@ -619,8 +619,10 @@ void ipoib_ib_dev_flush(void *_dev)* The device could have been brought down between the start and when * we get here, don't bring it back up if it's not configured up */ -if (test_bit (IPOIB_FLAG_ADMIN_UP , &priv->flags)) +if (test_bit (IPOIB_FLAG_ADMIN_UP , &priv->flags)) {ipoib_ib_dev_up (dev); +ipoib_mcast_restart_task (dev); + }mutex_lock (&priv->vlan_mutex);
drivers/isdn/capi/capidrv.c +2 -1
@@ -1907,7 +1907,8 @@ static int if_readstat(u8 __user *buf, i }for (p=buf, count=0 ; count < len; p++, count++) { -put_user (*card->q931_read++, p); +if (put_user (*card->q931_read++, p)) +return -EFAULT ;if (card->q931_read > card->q931_end) card->q931_read = card->q931_buf; }
drivers/isdn/hisax/config.c +4 -2
@@ -631,7 +631,8 @@ static int HiSax_readstatus(u_char __use count = cs->status_end - cs->status_read +1 ;if (count >= len) count = len; -copy_to_user (p, cs->status_read, count); +if (copy_to_user (p, cs->status_read, count)) +return -EFAULT ; cs->status_read += count;if (cs->status_read > cs->status_end) cs->status_read = cs->status_buf;
@@ -642,7 +643,8 @@ static int HiSax_readstatus(u_char __use cnt =HISAX_STATUS_BUFSIZE ; else cnt = count; -copy_to_user (p, cs->status_read, cnt); +if (copy_to_user (p, cs->status_read, cnt)) +return -EFAULT ; p += cnt; cs->status_read += cnt %HISAX_STATUS_BUFSIZE ; count -= cnt;
drivers/isdn/i4l/isdn_common.c +6 -3
@@ -1134,9 +1134,12 @@ isdn_read(struct file *file, char __userif (dev->drv[drvidx]->interface->readstat) {if (count > dev->drv[drvidx]->stavail) count = dev->drv[drvidx]->stavail; - len = dev->drv[drvidx]->interface-> -readstat (buf, count, drvidx, -isdn_minor2chan (minor)); + len = dev->drv[drvidx]->interface->readstat (buf, count, + drvidx,isdn_minor2chan (minor)); +if (len <0 ) { + retval = len; + goto out; + } }else { len =0 ; }
drivers/isdn/icn/icn.c +2 -1
@@ -1010,7 +1010,8 @@ icn_readstatus(u_char __user *buf, int lfor (p = buf, count =0 ; count < len; p++, count++) {if (card->msg_buf_read == card->msg_buf_write)return count; -put_user (*card->msg_buf_read++, p); +if (put_user (*card->msg_buf_read++, p)) +return -EFAULT ;if (card->msg_buf_read > card->msg_buf_end) card->msg_buf_read = card->msg_buf; }
drivers/isdn/isdnloop/isdnloop.c +2 -1
@@ -451,7 +451,8 @@ isdnloop_readstatus(u_char __user *buf,for (p = buf, count =0 ; count < len; p++, count++) {if (card->msg_buf_read == card->msg_buf_write)return count; -put_user (*card->msg_buf_read++, p); +if (put_user (*card->msg_buf_read++, p)) +return -EFAULT ;if (card->msg_buf_read > card->msg_buf_end) card->msg_buf_read = card->msg_buf; }
drivers/isdn/pcbit/drv.c +10 -6
@@ -725,23 +725,27 @@ static int pcbit_stat(u_char __user *bufif (stat_st < stat_end) { -copy_to_user (buf, statbuf + stat_st, len); +if (copy_to_user (buf, statbuf + stat_st, len)) +return -EFAULT ; stat_st += len; }else {if (len >STATBUF_LEN - stat_st) { -copy_to_user (buf, statbuf + stat_st, -STATBUF_LEN - stat_st); -copy_to_user (buf, statbuf, - len - (STATBUF_LEN - stat_st)); +if (copy_to_user (buf, statbuf + stat_st, +STATBUF_LEN - stat_st)) +return -EFAULT ; +if (copy_to_user (buf, statbuf, + len - (STATBUF_LEN - stat_st))) +return -EFAULT ; stat_st = len - (STATBUF_LEN - stat_st); }else { -copy_to_user (buf, statbuf + stat_st, len); +if (copy_to_user (buf, statbuf + stat_st, len)) +return -EFAULT ; stat_st += len;
drivers/macintosh/via-pmu-backlight.c +1 -1
@@ -16,7 +16,7 @@ #include <asm/prom.h>#define MAX_PMU_LEVEL 0xFFstatic struct backlight_properties pmu_backlight_data; -static spinlock_t pmu_backlight_lock; +static DEFINE_SPINLOCK (pmu_backlight_lock);static int sleeping;static u8 bl_curve[FB_BACKLIGHT_LEVELS ];
drivers/md/md.c +1 -0
@@ -1994,6 +1994,7 @@ static mdk_rdev_t *md_import_device(dev_kobject_init (&rdev->kobj); rdev->desc_nr =-1 ; + rdev->saved_raid_disk =-1 ; rdev->flags =0 ; rdev->data_offset =0 ; rdev->sb_events =0 ;
drivers/md/multipath.c +1 -1
@@ -480,7 +480,7 @@ static int multipath_run (mddev_t *mddev mdname(mddev)); goto out_free_conf; } - mddev->degraded = conf->raid_disks = conf->working_disks; + mddev->degraded = conf->raid_disks - conf->working_disks; conf->pool =mempool_create_kzalloc_pool (NR_RESERVED_BUFS ,sizeof (struct multipath_bh ));
drivers/md/raid10.c +1 -1
@@ -2042,7 +2042,7 @@ static int run(mddev_t *mddev) disk = conf->mirrors + i;if (!disk->rdev || - !test_bit (In_sync, &rdev->flags)) { + !test_bit (In_sync, &disk->rdev->flags)) { disk->head_position =0 ; mddev->degraded++; }
drivers/media/dvb/b2c2/flexcop-fe-tuner.c +1 -1
@@ -527,7 +527,7 @@ int flexcop_frontend_init(struct flexcop/* try the air atsc 2nd generation (nxt2002) */ if ((fc->fe =nxt200x_attach (&samsung_tbmv_config, &fc->i2c_adap)) !=NULL ) { fc->dev_type =FC_AIR_ATSC2 ; -dvb_pll_attach (fc->fe,0x61 , &fc->i2c_adap, &dvb_pll_samsung_tbmv); +dvb_pll_attach (fc->fe,0x61 ,NULL , &dvb_pll_samsung_tbmv);info ("found the nxt2002 at i2c address: 0x%02x" ,samsung_tbmv_config.demod_address); }else /* try the air atsc 3nd generation (lgdt3303) */
drivers/media/dvb/frontends/dvb-pll.c +3 -0
@@ -493,6 +493,9 @@ static int dvb_pll_sleep(struct dvb_fronint i;int result; +if (priv->i2c ==NULL ) +return -EINVAL ; +for (i =0 ; i < priv->pll_desc->count; i++) {if (priv->pll_desc->entries[i].limit ==0 )break ;
drivers/media/video/cx88/cx88-dvb.c +7 -7
@@ -576,7 +576,7 @@ #ifdef HAVE_MT352 &dev->core->i2c_adap);if (dev->dvb.frontend !=NULL ) {dvb_pll_attach (dev->dvb.frontend,0x60 , - &dev->core->i2c_adap, +NULL , &dvb_pll_thomson_dtt7579);break ; }
@@ -587,7 +587,7 @@ #ifdef HAVE_ZL10353 &dev->core->i2c_adap);if (dev->dvb.frontend !=NULL ) {dvb_pll_attach (dev->dvb.frontend,0x60 , - &dev->core->i2c_adap, +NULL , &dvb_pll_thomson_dtt7579); }#endif
@@ -600,7 +600,7 @@ #ifdef HAVE_MT352 &dev->core->i2c_adap);if (dev->dvb.frontend !=NULL ) {dvb_pll_attach (dev->dvb.frontend,0x61 , - &dev->core->i2c_adap, +NULL , &dvb_pll_thomson_dtt7579);break ; }
@@ -611,7 +611,7 @@ #ifdef HAVE_ZL10353 &dev->core->i2c_adap);if (dev->dvb.frontend !=NULL ) {dvb_pll_attach (dev->dvb.frontend,0x61 , - &dev->core->i2c_adap, +NULL , &dvb_pll_thomson_dtt7579); }#endif
@@ -623,7 +623,7 @@ #ifdef HAVE_MT352 &dev->core->i2c_adap);if (dev->dvb.frontend !=NULL ) {dvb_pll_attach (dev->dvb.frontend,0x61 , - &dev->core->i2c_adap, +NULL , &dvb_pll_lg_z201); }break ;
@@ -634,7 +634,7 @@ #ifdef HAVE_MT352 &dev->core->i2c_adap);if (dev->dvb.frontend !=NULL ) {dvb_pll_attach (dev->dvb.frontend,0x61 , - &dev->core->i2c_adap, +NULL , &dvb_pll_unknown_1); }break ;
@@ -757,7 +757,7 @@ #ifdef HAVE_NXT200X &dev->core->i2c_adap);if (dev->dvb.frontend !=NULL ) {dvb_pll_attach (dev->dvb.frontend,0x61 , - &dev->core->i2c_adap, +NULL , &dvb_pll_tuv1236d); }break ;
drivers/media/video/saa7134/saa7134-dvb.c +2 -2
@@ -1158,13 +1158,13 @@ #ifdef HAVE_NXT200Xcase SAA7134_BOARD_AVERMEDIA_AVERTVHD_A180 : dev->dvb.frontend =nxt200x_attach (&avertvhda180, &dev->i2c_adap);if (dev->dvb.frontend) { -dvb_pll_attach (dev->dvb.frontend,0x61 , &dev->i2c_adap, &dvb_pll_tdhu2); +dvb_pll_attach (dev->dvb.frontend,0x61 ,NULL , &dvb_pll_tdhu2); }break ;case SAA7134_BOARD_KWORLD_ATSC110 : dev->dvb.frontend =nxt200x_attach (&kworldatsc110, &dev->i2c_adap);if (dev->dvb.frontend) { -dvb_pll_attach (dev->dvb.frontend,0x61 , &dev->i2c_adap, &dvb_pll_tuv1236d); +dvb_pll_attach (dev->dvb.frontend,0x61 ,NULL , &dvb_pll_tuv1236d); }break ;#endif
drivers/net/sky2.c +42 -41
179 lines not on this page · raw message
drivers/net/sky2.h +1 -1
@@ -1566,7 +1566,7 @@ enum {GMR_FS_ANY_ERR =GMR_FS_RX_FF_OV |GMR_FS_CRC_ERR |GMR_FS_FRAGMENT |GMR_FS_LONG_ERR | -GMR_FS_MII_ERR |GMR_FS_BAD_FC | +GMR_FS_MII_ERR |GMR_FS_GOOD_FC |GMR_FS_BAD_FC | GMR_FS_UN_SIZE | GMR_FS_JABBER, };
drivers/net/wireless/bcm43xx/bcm43xx_main.c +8 -0
@@ -3165,7 +3165,15 @@ static void bcm43xx_periodic_work_handle badness =estimate_periodic_work_badness (bcm->periodic_state);mutex_lock (&bcm->mutex); + +/* We must fake a started transmission here, as we are going to +* disable TX. If we wouldn't fake a TX, it would be possible to +* trigger the netdev watchdog, if the last real TX is already +* some time on the past (slightly less than 5secs) +*/ + bcm->net_dev->trans_start = jiffies;netif_tx_disable (bcm->net_dev); +spin_lock_irqsave (&bcm->irq_lock, flags);if (badness >BADNESS_LIMIT ) {/* Periodic work will take a long time, so we want it to
drivers/pci/quirks.c +0 -27
@@ -685,33 +685,6 @@ static void __devinit quirk_vt82c598_id( }DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_VIA ,PCI_DEVICE_ID_VIA_82C597_0 , quirk_vt82c598_id ); -#ifdef CONFIG_ACPI_SLEEP - -/* -* Some VIA systems boot with the abnormal status flag set. This can cause -* the BIOS to re-POST the system on resume rather than passing control -* back to the OS. Clear the flag on boot -*/ -static void __devinit quirk_via_abnormal_poweroff (struct pci_dev *dev) -{ -u32 reg; - -acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK ,ACPI_REGISTER_PM1_STATUS , - ®); - -if (reg &0x800 ) { -printk ("Clearing abnormal poweroff flag\n" ); -acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK , -ACPI_REGISTER_PM1_STATUS , - (u16 )0x800 ); - } -} - -DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_VIA ,PCI_DEVICE_ID_VIA_8235 , quirk_via_abnormal_poweroff); -DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_VIA ,PCI_DEVICE_ID_VIA_8237 , quirk_via_abnormal_poweroff); - -#endif -/* * CardBus controllers have a legacy base address that enables them * to respond as i82365 pcmcia controllers. We don't want them to
drivers/rtc/rtc-max6902.c +1 -1
@@ -137,7 +137,7 @@ static int max6902_get_datetime(struct d dt->tm_min =BCD2BIN (chip->buf[2 ]); dt->tm_hour =BCD2BIN (chip->buf[3 ]); dt->tm_mday =BCD2BIN (chip->buf[4 ]); - dt->tm_mon =BCD2BIN (chip->buf[5 ] -1 ); + dt->tm_mon =BCD2BIN (chip->buf[5 ]) -1 ; dt->tm_wday =BCD2BIN (chip->buf[6 ]); dt->tm_year =BCD2BIN (chip->buf[7 ]);
drivers/scsi/aic7xxx/aic7xxx_osm.c +17 -4
@@ -2539,15 +2539,28 @@ #endifstatic void ahc_linux_get_signalling (struct Scsi_Host *shost) {struct ahc_softc *ahc = *(struct ahc_softc **)shost->hostdata; -u8 mode =ahc_inb (ahc,SBLKCTL ); +unsigned long flags; +u8 mode; -if (mode &ENAB40 ) -spi_signalling (shost) =SPI_SIGNAL_LVD ; -else if (mode &ENAB20 ) +if (!(ahc->features &AHC_ULTRA2 )) { +/* non-LVD chipset, may not have SBLKCTL reg */ spi_signalling (shost) = ahc->features &AHC_HVD ?SPI_SIGNAL_HVD :SPI_SIGNAL_SE ; +return ; + } + +ahc_lock (ahc, &flags); +ahc_pause (ahc); + mode =ahc_inb (ahc,SBLKCTL ); +ahc_unpause (ahc); +ahc_unlock (ahc, &flags); + +if (mode &ENAB40 ) +spi_signalling (shost) =SPI_SIGNAL_LVD ; +else if (mode &ENAB20 ) +spi_signalling (shost) =SPI_SIGNAL_SE ;else spi_signalling (shost) =SPI_SIGNAL_UNKNOWN ; }
drivers/serial/serial_core.c +7 -2
@@ -1932,6 +1932,9 @@ int uart_suspend_port(struct uart_driverif (state->info && state->info->flags &UIF_INITIALIZED ) {const struct uart_ops *ops = port->ops; + state->info->flags = (state->info->flags & ~UIF_INITIALIZED ) + |UIF_SUSPENDED ; +spin_lock_irq (&port->lock); ops->stop_tx (port); ops->set_mctrl (port,0 );
@@ -1991,7 +1994,7 @@ int uart_resume_port(struct uart_driverconsole_start (port->cons); } -if (state->info && state->info->flags &UIF_INITIALIZED ) { +if (state->info && state->info->flags &UIF_SUSPENDED ) {const struct uart_ops *ops = port->ops;int ret;
@@ -2003,15 +2006,17 @@ int uart_resume_port(struct uart_driver ops->set_mctrl (port, port->mctrl); ops->start_tx (port);spin_unlock_irq (&port->lock); + state->info->flags |=UIF_INITIALIZED ; }else {/* * Failed to resume - maybe hardware went away? * Clear the "initialized" flag so we won't try * to call the low level drivers shutdown method. */ - state->info->flags &= ~UIF_INITIALIZED ;uart_shutdown (state); } + + state->info->flags &= ~UIF_SUSPENDED ; }mutex_unlock (&state->mutex);
drivers/serial/serial_cs.c +5 -7
@@ -185,14 +185,12 @@ static int serial_suspend(struct pcmcia_static int serial_resume (struct pcmcia_device *link) { -if (pcmcia_dev_present (link)) { -struct serial_info *info = link->priv; -int i; +struct serial_info *info = link->priv; +int i; -for (i =0 ; i < info->ndev; i++) -serial8250_resume_port (info->line[i]); -wakeup_card (info); - } +for (i =0 ; i < info->ndev; i++) +serial8250_resume_port (info->line[i]); +wakeup_card (info);return 0 ; }
drivers/usb/core/devio.c +15 -11
@@ -59,6 +59,9 @@ #define USB_MAXBUS 64#define USB_DEVICE_MAX USB_MAXBUS * 128static struct class *usb_device_class; +/* Mutual exclusion for removal, open, and release */ +DEFINE_MUTEX (usbfs_mutex); +struct async {struct list_head asynclist;struct dev_state *ps;
@@ -541,15 +544,13 @@ static int usbdev_open(struct inode *inostruct dev_state *ps;int ret; -/* -* no locking necessary here, as chrdev_open has the kernel lock -* (still acquire the kernel lock for safety) -*/ +/* Protect against simultaneous removal or release */ +mutex_lock (&usbfs_mutex); + ret = -ENOMEM ;if (!(ps =kmalloc (sizeof (struct dev_state ),GFP_KERNEL ))) - goto out_nolock; + goto out; -lock_kernel (); ret = -ENOENT ;/* check if we are called from a real node or usbfs */ if (imajor (inode) ==USB_DEVICE_MAJOR )
@@ -579,9 +580,8 @@ static int usbdev_open(struct inode *inolist_add_tail (&ps->list, &dev->filelist); file->private_data = ps; out: -unlock_kernel (); - out_nolock: -return ret; +mutex_unlock (&usbfs_mutex); +return ret; }static int usbdev_release (struct inode *inode,struct file *file)
@@ -591,7 +591,12 @@ static int usbdev_release(struct inode *unsigned int ifnum;usb_lock_device (dev); + +/* Protect against simultaneous open */ +mutex_lock (&usbfs_mutex);list_del_init (&ps->list); +mutex_unlock (&usbfs_mutex); +for (ifnum =0 ; ps->ifclaimed && ifnum <8 *sizeof (ps->ifclaimed); ifnum++) {if (test_bit (ifnum, &ps->ifclaimed))
@@ -600,9 +605,8 @@ static int usbdev_release(struct inode *destroy_all_async (ps);usb_unlock_device (dev);usb_put_dev (dev); - ps->dev =NULL ;kfree (ps); -return 0 ; +return 0 ; }static int proc_control (struct dev_state *ps,void __user *arg)
drivers/usb/core/notify.c +3 -0
@@ -50,8 +50,11 @@ void usb_notify_add_device(struct usb_devoid usb_notify_remove_device (struct usb_device *udev) { +/* Protect against simultaneous usbfs open */ +mutex_lock (&usbfs_mutex);blocking_notifier_call_chain (&usb_notifier_list,USB_DEVICE_REMOVE , udev); +mutex_unlock (&usbfs_mutex); }void usb_notify_add_bus (struct usb_bus *ubus)
drivers/usb/core/usb.h +1 -0
@@ -59,6 +59,7 @@ static inline int is_active(struct usb_iextern const char *usbcore_name;/* usbfs stuff */ +extern struct mutex usbfs_mutex;extern struct usb_driver usbfs_driver;extern struct file_operations usbfs_devices_fops;extern struct file_operations usbfs_device_file_operations;
fs/fuse/dir.c +21 -9
@@ -935,14 +935,30 @@ static void iattr_to_fattr(struct iattr } } +static void fuse_vmtruncate (struct inode *inode,loff_t offset) +{ +struct fuse_conn *fc =get_fuse_conn (inode); +int need_trunc; + +spin_lock (&fc->lock); + need_trunc = inode->i_size > offset; +i_size_write (inode, offset); +spin_unlock (&fc->lock); + +if (need_trunc) { +struct address_space *mapping = inode->i_mapping; +unmap_mapping_range (mapping, offset +PAGE_SIZE -1 ,0 ,1 ); +truncate_inode_pages (mapping, offset); + } +} +/* * Set attributes, and at the same time refresh them. * * Truncation is slightly complicated, because the 'truncate' request * may fail, in which case we don't want to touch the mapping. -* vmtruncate() doesn't allow for this case. So do the rlimit -* checking by hand and call vmtruncate() only after the file has -* actually been truncated. +* vmtruncate() doesn't allow for this case, so do the rlimit checking +* and the actual truncation by hand. */ static int fuse_setattr (struct dentry *entry,struct iattr *attr) {
@@ -993,12 +1009,8 @@ static int fuse_setattr(struct dentry *emake_bad_inode (inode); err = -EIO ; }else { -if (is_truncate) { -loff_t origsize =i_size_read (inode); -i_size_write (inode, outarg.attr.size); -if (origsize > outarg.attr.size) -vmtruncate (inode, outarg.attr.size); - } +if (is_truncate) +fuse_vmtruncate (inode, outarg.attr.size);fuse_change_attributes (inode, &outarg.attr); fi->i_time =time_to_jiffies (outarg.attr_valid, outarg.attr_valid_nsec);
fs/fuse/file.c +9 -3
@@ -481,8 +481,10 @@ static int fuse_commit_write(struct file err = -EIO ;if (!err) { pos += count; -if (pos >i_size_read (inode)) +spin_lock (&fc->lock); +if (pos > inode->i_size)i_size_write (inode, pos); +spin_unlock (&fc->lock);if (offset ==0 && to ==PAGE_CACHE_SIZE ) {clear_page_dirty (page);
@@ -586,8 +588,12 @@ static ssize_t fuse_direct_io(struct fil }fuse_put_request (fc, req);if (res >0 ) { -if (write && pos >i_size_read (inode)) -i_size_write (inode, pos); +if (write) { +spin_lock (&fc->lock); +if (pos > inode->i_size) +i_size_write (inode, pos); +spin_unlock (&fc->lock); + } *ppos = pos; }fuse_invalidate_attr (inode);
fs/fuse/inode.c +4 -1
@@ -109,6 +109,7 @@ static int fuse_remount_fs(struct super_void fuse_change_attributes (struct inode *inode,struct fuse_attr *attr) { +struct fuse_conn *fc =get_fuse_conn (inode);if (S_ISREG (inode->i_mode) &&i_size_read (inode) != attr->size)invalidate_inode_pages (inode->i_mapping);
@@ -117,7 +118,9 @@ void fuse_change_attributes(struct inode inode->i_nlink = attr->nlink; inode->i_uid = attr->uid; inode->i_gid = attr->gid; +spin_lock (&fc->lock);i_size_write (inode, attr->size); +spin_unlock (&fc->lock); inode->i_blksize =PAGE_CACHE_SIZE ; inode->i_blocks = attr->blocks; inode->i_atime.tv_sec = attr->atime;
@@ -131,7 +134,7 @@ void fuse_change_attributes(struct inodestatic void fuse_init_inode (struct inode *inode,struct fuse_attr *attr) { inode->i_mode = attr->mode &S_IFMT ; -i_size_write (inode, attr->size); + inode->i_size = attr->size;if (S_ISREG (inode->i_mode)) {fuse_init_common (inode);fuse_init_file_inode (inode);
fs/jfs/jfs_imap.c +2 -2
@@ -318,7 +318,7 @@ int diRead(struct inode *ip)struct inomap *imap;int block_offset;int inodes_left; -uint pageno; +unsigned long pageno;int rel_inode;jfs_info ("diRead: ino = %ld" , ip->i_ino);
@@ -606,7 +606,7 @@ int diWrite(tid_t tid, struct inode *ip)int block_offset;int inodes_left;struct metapage *mp; -uint pageno; +unsigned long pageno;int rel_inode;int dioffset;struct inode *ipimap;
fs/nfs/dir.c +11 -3
@@ -902,9 +902,15 @@ static struct dentry *nfs_lookup(structlock_kernel (); -/* If we're doing an exclusive create, optimize away the lookup */ -if (nfs_is_exclusive_create (dir, nd)) - goto no_entry; +/* +* If we're doing an exclusive create, optimize away the lookup +* but don't hash the dentry. +*/ +if (nfs_is_exclusive_create (dir, nd)) { +d_instantiate (dentry,NULL ); + res =NULL ; + goto out_unlock; + } error =NFS_PROTO (dir)->lookup (dir, &dentry->d_name, &fhandle, &fattr);if (error == -ENOENT )
@@ -1156,6 +1162,8 @@ int nfs_instantiate(struct dentry *dentrif (IS_ERR (inode)) goto out_err;d_instantiate (dentry, inode); +if (d_unhashed (dentry)) +d_rehash (dentry);return 0 ; out_err:d_drop (dentry);
fs/splice.c +3 -3
@@ -607,7 +607,7 @@ find_page: ret = -ENOMEM ; page =page_cache_alloc_cold (mapping);if (unlikely (!page)) - goto out_nomem; + goto out_ret;/* * This will also lock the page
@@ -666,7 +666,7 @@ find_page:if (sd->pos + this_len > isize)vmtruncate (mapping->host, isize); - goto out; + goto out_ret; }if (buf->page != page) {
@@ -698,7 +698,7 @@ find_page: out:page_cache_release (page);unlock_page (page); -out_nomem: +out_ret:return ret; }
include/asm-generic/audit_change_attr.h +4 -0
@@ -1,16 +1,20 @@ __NR_chmod, __NR_fchmod, +#ifdef __NR_chown __NR_chown, __NR_fchown, __NR_lchown, +#endif __NR_setxattr, __NR_lsetxattr, __NR_fsetxattr, __NR_removexattr, __NR_lremovexattr, __NR_fremovexattr, +#ifdef __NR_fchownat __NR_fchownat, __NR_fchmodat, +#endif #ifdef __NR_chown32 __NR_chown32, __NR_fchown32,
include/asm-generic/audit_dir_write.h +4 -0
@@ -1,14 +1,18 @@ __NR_rename, __NR_mkdir, __NR_rmdir, +#ifdef __NR_creat __NR_creat, +#endif __NR_link, __NR_unlink, __NR_symlink, __NR_mknod, +#ifdef __NR_mkdirat __NR_mkdirat, __NR_mknodat, __NR_unlinkat, __NR_renameat, __NR_linkat, __NR_symlinkat, +#endif
include/asm-s390/div64.h +0 -48
49 lines not on this page · raw message
include/linux/mmzone.h +7 -5
@@ -200,13 +200,9 @@ #endif* under - it drives the swappiness decision: whether to unmap mapped * pages. * -* temp_priority is used to remember the scanning priority at which -* this zone was successfully refilled to free_pages == pages_high. -* -* Access to both these fields is quite racy even on uniprocessor. But +* Access to both this field is quite racy even on uniprocessor. But * it is expected to average out OK. */ -int temp_priority;int prev_priority;
@@ -632,6 +628,12 @@ #define sparse_init() do {} while (0)#define sparse_index_init (_sec, _nid) do {} while (0)#endif /* CONFIG_SPARSEMEM */ +#ifdef CONFIG_NODES_SPAN_OTHER_NODES +#define early_pfn_in_nid (pfn, nid) (early_pfn_to_nid(pfn) == (nid)) +#else +#define early_pfn_in_nid (pfn, nid) (1) +#endif +#ifndef early_pfn_valid#define early_pfn_valid (pfn) (1)#endif
include/linux/serial_core.h +1 -0
@@ -319,6 +319,7 @@ #define UIF_CHECK_CD ((__force uif_t) (#define UIF_CTS_FLOW ((__force uif_t) (1 << 26))#define UIF_NORMAL_ACTIVE ((__force uif_t) (1 << 29))#define UIF_INITIALIZED ((__force uif_t) (1 << 31)) +#define UIF_SUSPENDED ((__force uif_t) (1 << 30))int blocked_open;
kernel/posix-cpu-timers.c +21 -6
@@ -88,6 +88,19 @@ static inline union cpu_time_count cpu_t }/* +* Divide and limit the result to res >= 1 +* +* This is necessary to prevent signal delivery starvation, when the result of +* the division would be rounded down to 0. +*/ +static inline cputime_t cputime_div_non_zero (cputime_t time,unsigned long div) +{ +cputime_t res =cputime_div (time, div); + +return max_t (cputime_t, res,1 ); +} + +/* * Update expiry time from increment, and increase overrun count, * given the current clock sample. */
@@ -483,8 +496,8 @@ static void process_timer_rebalance(struBUG ();break ;case CPUCLOCK_PROF : - left =cputime_div (cputime_sub (expires.cpu, val.cpu), - nthreads); + left =cputime_div_non_zero (cputime_sub (expires.cpu, val.cpu), + nthreads); do { if (likely(!(t->flags & PF_EXITING))) { ticks = cputime_add(prof_ticks(t), left);
@@ -498,8 +511,8 @@ static void process_timer_rebalance(stru }while (t != p);break ;case CPUCLOCK_VIRT : - left =cputime_div (cputime_sub (expires.cpu, val.cpu), - nthreads); + left =cputime_div_non_zero (cputime_sub (expires.cpu, val.cpu), + nthreads); do { if (likely(!(t->flags & PF_EXITING))) { ticks = cputime_add(virt_ticks(t), left);
@@ -515,6 +528,7 @@ static void process_timer_rebalance(strucase CPUCLOCK_SCHED : nsleft = expires.sched - val.sched;do_div (nsleft, nthreads); + nsleft = max_t(unsigned long long, nsleft, 1); do { if (likely(!(t->flags & PF_EXITING))) { ns = t->sched_time + nsleft;
@@ -1159,12 +1173,13 @@ static void check_process_timers(struct prof_left =cputime_sub (prof_expires, utime); prof_left =cputime_sub (prof_left, stime); - prof_left =cputime_div (prof_left, nthreads); + prof_left =cputime_div_non_zero (prof_left, nthreads); virt_left =cputime_sub (virt_expires, utime); - virt_left =cputime_div (virt_left, nthreads); + virt_left =cputime_div_non_zero (virt_left, nthreads);if (sched_expires) { sched_left = sched_expires - sched_time;do_div (sched_left, nthreads); + sched_left = max_t(unsigned long long, sched_left, 1); }else { sched_left =0 ; }
kernel/taskstats.c +9 -6
@@ -229,14 +229,17 @@ static int fill_tgid(pid_t tgid, struct }else get_task_struct (first); -/* Start with stats from dead tasks */ -spin_lock_irqsave (&first->signal->stats_lock, flags); -if (first->signal->stats) -memcpy (stats, first->signal->stats,sizeof (*stats)); -spin_unlock_irqrestore (&first->signal->stats_lock, flags); tsk = first;read_lock (&tasklist_lock); +/* Start with stats from dead tasks */ +if (first->signal) { +spin_lock_irqsave (&first->signal->stats_lock, flags); +if (first->signal->stats) +memcpy (stats, first->signal->stats,sizeof (*stats)); +spin_unlock_irqrestore (&first->signal->stats_lock, flags); + } + do { if (tsk->exit_state == EXIT_ZOMBIE && thread_group_leader(tsk)) continue;
@@ -256,7 +259,7 @@ static int fill_tgid(pid_t tgid, struct* Accounting subsytems can also add calls here to modify * fields of taskstats. */ - +put_task_struct (first);return 0 ; }
lib/audit.c +2 -0
@@ -28,8 +28,10 @@ int audit_classify_syscall(int abi, unsiswitch (syscall) {case __NR_open:return 2 ; +#ifdef __NR_openatcase __NR_openat:return 3 ; +#endif #ifdef __NR_socketcallcase __NR_socketcall:return 4 ;
mm/memory.c +8 -1
@@ -1551,7 +1551,14 @@ gotten: entry =mk_pte (new_page, vma->vm_page_prot); entry =maybe_mkwrite (pte_mkdirty (entry), vma);lazy_mmu_prot_update (entry); -ptep_establish (vma, address, page_table, entry); +/* +* Clear the pte entry and flush it first, before updating the +* pte with the new entry. This will avoid a race condition +* seen in the presence of one thread doing SMC and another +* thread doing COW. +*/ +ptep_clear_flush (vma, address, page_table); +set_pte_at (mm, address, page_table, entry);update_mmu_cache (vma, address, entry);lru_cache_add_active (new_page);page_add_new_anon_rmap (new_page, vma, address);
mm/page_alloc.c +3 -1
@@ -1673,6 +1673,8 @@ void __meminit memmap_init_zone(unsignedfor (pfn = start_pfn; pfn < end_pfn; pfn++) {if (!early_pfn_valid (pfn))continue ; +if (!early_pfn_in_nid (pfn, nid)) +continue ; page =pfn_to_page (pfn);set_page_links (page, zone, nid, pfn);init_page_count (page);
@@ -2019,7 +2021,7 @@ #endif zone->zone_pgdat = pgdat; zone->free_pages =0 ; - zone->temp_priority = zone->prev_priority =DEF_PRIORITY ; + zone->prev_priority =DEF_PRIORITY ;zone_pcp_init (zone);INIT_LIST_HEAD (&zone->active_list);
mm/vmscan.c +45 -18
151 lines not on this page · raw message
mm/vmstat.c +0 -2
@@ -586,11 +586,9 @@ #endifseq_printf (m,"\n all_unreclaimable: %u" "\n prev_priority: %i" -"\n temp_priority: %i" "\n start_pfn: %lu" , zone->all_unreclaimable, zone->prev_priority, - zone->temp_priority, zone->zone_start_pfn);spin_unlock_irqrestore (&zone->lock, flags);seq_putc (m,'\n' );
net/bluetooth/rfcomm/tty.c +3 -0
@@ -748,6 +748,9 @@ static void rfcomm_tty_set_termios(strucBT_DBG ("tty %p termios %p" , tty, old); +if (!dev) +return ; +/* Handle turning off CRTSCTS */ if ((old->c_cflag &CRTSCTS ) && !(new->c_cflag &CRTSCTS ))BT_DBG ("Turning off CRTSCTS unsupported" );
net/core/skbuff.c +4 -5
@@ -1945,7 +1945,7 @@ struct sk_buff *skb_segment(struct sk_bu do { struct sk_buff *nskb; skb_frag_t *frag; - int hsize, nsize; + int hsize; int k; int size;
@@ -1956,11 +1956,10 @@ struct sk_buff *skb_segment(struct sk_bu hsize =skb_headlen (skb) - offset;if (hsize <0 ) hsize =0 ; - nsize = hsize + doffset; -if (nsize > len + doffset || !sg) - nsize = len + doffset; +if (hsize > len || !sg) + hsize = len; - nskb =alloc_skb (nsize + headroom,GFP_ATOMIC ); + nskb =alloc_skb (hsize + doffset + headroom,GFP_ATOMIC );if (unlikely (!nskb)) goto err;
net/decnet/af_decnet.c +3 -1
@@ -1177,8 +1177,10 @@ static int dn_getname(struct socket *socif (peer) {if ((sock->state !=SS_CONNECTED && sock->state !=SS_CONNECTING ) && - scp->accept_mode ==ACC_IMMED ) + scp->accept_mode ==ACC_IMMED ) { +release_sock (sk);return -ENOTCONN ; + }memcpy (sa, &scp->peer,sizeof (struct sockaddr_dn )); }else {
net/ipv4/tcp_cubic.c +3 -3
@@ -190,7 +190,7 @@ static inline void bictcp_update(struct*/ /* change the unit from HZ to bictcp_HZ */ - t = ((tcp_time_stamp + ca->delay_min - ca->epoch_start) + t = ((tcp_time_stamp + (ca->delay_min>>3 ) - ca->epoch_start) <<BICTCP_HZ ) /HZ ;if (t < ca->bic_K)/* t - K */
@@ -259,7 +259,7 @@ static inline void measure_delay(struct (s32)(tcp_time_stamp - ca->epoch_start) < HZ)return ; - delay = tcp_time_stamp - tp->rx_opt.rcv_tsecr; + delay = (tcp_time_stamp - tp->rx_opt.rcv_tsecr)<<3 ;if (delay ==0 ) delay =1 ;
@@ -366,7 +366,7 @@ static int __init cubictcp_register(void beta_scale =8 *(BICTCP_BETA_SCALE +beta)/3 / (BICTCP_BETA_SCALE - beta); - cube_rtt_scale = (bic_scale <<3 ) /10 ;/* 1024*c/rtt */ + cube_rtt_scale = (bic_scale *10 );/* 1024*c/rtt */ /* calculate the "K" for (wmax-cwnd) = c/rtt * K^3 * so K = cubic_root( (wmax-cwnd)*rtt/c )
net/ipv6/ip6_flowlabel.c +2 -0
@@ -587,6 +587,8 @@ static struct ip6_flowlabel *ip6fl_get_nwhile (!fl) {if (++state->bucket <=FL_HASH_MASK ) fl = fl_ht[state->bucket]; +else +break ; }return fl; }
net/sctp/input.c +3 -0
@@ -135,6 +135,9 @@ int sctp_rcv(struct sk_buff *skb)SCTP_INC_STATS_BH (SCTP_MIB_INSCTPPACKS ); +if (skb_linearize (skb)) + goto discard_it; + sh = (struct sctphdr *) skb->h.raw;/* Pull up the IP and SCTP headers. */
net/sunrpc/svcsock.c +1 -1
@@ -902,7 +902,7 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp)return 0 ; } -if (test_bit (SK_CONN , &svsk->sk_flags)) { +if (svsk->sk_sk->sk_state ==TCP_LISTEN ) {svc_tcp_accept (svsk);svc_sock_received (svsk);return 0 ;
sound/core/hwdep.c +2 -1
@@ -158,6 +158,7 @@ static int snd_hwdep_release(struct inod {int err = -ENXIO ;struct snd_hwdep *hw = file->private_data; +struct module *mod = hw->card->module;mutex_lock (&hw->open_mutex);if (hw->ops.release) { err = hw->ops.release (hw, file);
@@ -167,7 +168,7 @@ static int snd_hwdep_release(struct inod hw->used--;snd_card_file_remove (hw->card, file);mutex_unlock (&hw->open_mutex); -module_put (hw->card->module); +module_put (mod);return err; }
sound/core/info.c +4 -1
@@ -119,7 +119,10 @@ int snd_iprintf(struct snd_info_buffer * len = buffer->len - buffer->size;va_start (args, fmt);for (;;) { - res =vsnprintf (buffer->buffer + buffer->curr, len, fmt, args); +va_list ap; +va_copy (ap, args); + res =vsnprintf (buffer->buffer + buffer->curr, len, fmt, ap); +va_end (ap);if (res < len)break ; err =resize_info_buffer (buffer, buffer->len +PAGE_SIZE );
sound/core/rtctimer.c +14 -3
@@ -50,7 +50,9 @@ static int rtctimer_stop(struct snd_time* The hardware dependent description for this timer. */ static struct snd_timer_hardware rtc_hw = { - .flags =SNDRV_TIMER_HW_FIRST |SNDRV_TIMER_HW_AUTO , + .flags =SNDRV_TIMER_HW_AUTO | +SNDRV_TIMER_HW_FIRST | +SNDRV_TIMER_HW_TASKLET , .ticks =100000000L ,/* FIXME: XXX */ .open = rtctimer_open, .close = rtctimer_close,
@@ -60,6 +62,7 @@ static struct snd_timer_hardware rtc_hwstatic int rtctimer_freq =RTC_FREQ ;/* frequency */ static struct snd_timer *rtctimer; +static struct tasklet_struct rtc_tasklet;static rtc_task_t rtc_task;
@@ -81,6 +84,7 @@ rtctimer_close(struct snd_timer *t)rtc_task_t *rtc = t->private_data;if (rtc) {rtc_unregister (rtc); +tasklet_kill (&rtc_tasklet); t->private_data =NULL ; }return 0 ;
@@ -105,12 +109,17 @@ rtctimer_stop(struct snd_timer *timer)return 0 ; } +static void rtctimer_tasklet (unsigned long data) +{ +snd_timer_interrupt ((struct snd_timer *)data,1 ); +} +/* * interrupt */ static void rtctimer_interrupt (void *private_data) { -snd_timer_interrupt (private_data,1 ); +tasklet_hi_schedule (private_data); }
@@ -139,9 +148,11 @@ static int __init rtctimer_init(void) timer->hw = rtc_hw; timer->hw.resolution =NANO_SEC / rtctimer_freq; +tasklet_init (&rtc_tasklet, rtctimer_tasklet, (unsigned long )timer); +/* set up RTC callback */ rtc_task.func = rtctimer_interrupt; - rtc_task.private_data = timer; + rtc_task.private_data = &rtc_tasklet; err =snd_timer_global_register (timer);if (err <0 ) {
sound/pci/au88x0/au88x0.c +1 -0
@@ -128,6 +128,7 @@ static int snd_vortex_dev_free(struct sn// Take down PCI interface. synchronize_irq (vortex->irq);free_irq (vortex->irq, vortex); +iounmap (vortex->mmio);pci_release_regions (vortex->pci_dev);pci_disable_device (vortex->pci_dev);kfree (vortex);
sound/pci/emu10k1/emu10k1_main.c +2 -2
@@ -1460,8 +1460,8 @@ void snd_emu10k1_resume_regs(struct snd_/* resore for spdif */ if (emu->audigy) -outl (emu->port +A_IOCFG , emu->saved_a_iocfg); -outl (emu->port +HCFG , emu->saved_hcfg); +outl (emu->saved_a_iocfg, emu->port +A_IOCFG ); +outl (emu->saved_hcfg, emu->port +HCFG ); val = emu->saved_ptr;for (reg = saved_regs; *reg !=0xff ; reg++)
sound/ppc/keywest.c +3 -0
@@ -117,6 +117,9 @@ int __init snd_pmac_tumbler_post_init(vo {int err; +if (!keywest_ctx || !keywest_ctx->client) +return -ENXIO ; +if ((err = keywest_ctx->init_client (keywest_ctx)) <0 ) {snd_printk (KERN_ERR "tumbler: %i :cannot initialize the MCS\n" , err);return err;
sound/usb/usx2y/usbusx2yaudio.c +6 -12
@@ -322,7 +322,7 @@ static void i_usX2Y_urb_complete(structusX2Y_error_urb_status (usX2Y, subs, urb);return ; } -if (likely ((0xFFFF & urb->start_frame) == usX2Y->wait_iso_frame)) +if (likely (urb->start_frame == usX2Y->wait_iso_frame)) subs->completed_urb = urb;else {usX2Y_error_sequence (usX2Y, subs, urb);
@@ -335,13 +335,9 @@ static void i_usX2Y_urb_complete(struct atomic_read(&capsubs->state) >= state_PREPARED && (playbacksubs->completed_urb || atomic_read(&playbacksubs->state) < state_PREPARED)) { -if (!usX2Y_usbframe_complete (capsubs, playbacksubs, urb->start_frame)) { -if (nr_of_packs () <= urb->start_frame && - urb->start_frame <= (2 *nr_of_packs () -1 ))// uhci and ohci - usX2Y->wait_iso_frame = urb->start_frame -nr_of_packs (); -else - usX2Y->wait_iso_frame +=nr_of_packs (); - }else { +if (!usX2Y_usbframe_complete (capsubs, playbacksubs, urb->start_frame)) + usX2Y->wait_iso_frame +=nr_of_packs (); +else {snd_printdd ("\n" );usX2Y_clients_stop (usX2Y); }
@@ -495,7 +491,6 @@ static int usX2Y_urbs_start(struct snd_uif (subs !=NULL &&atomic_read (&subs->state) >= state_PREPARED) goto start; } - usX2Y->wait_iso_frame =-1 ; start:usX2Y_subs_startup (subs);
@@ -516,10 +511,9 @@ static int usX2Y_urbs_start(struct snd_usnd_printk (KERN_ERR "cannot submit datapipe for urb %d, err = %d\n" , i, err); err = -EPIPE ; goto cleanup; - }else { -if (0 > usX2Y->wait_iso_frame) + }else +if (i ==0 ) usX2Y->wait_iso_frame = urb->start_frame; - } urb->transfer_flags =0 ; }else {atomic_set (&subs->state, state_STARTING1);
sound/usb/usx2y/usx2yhwdeppcm.c +6 -11
@@ -243,7 +243,7 @@ static void i_usX2Y_usbpcm_urb_complete(usX2Y_error_urb_status (usX2Y, subs, urb);return ; } -if (likely ((0xFFFF & urb->start_frame) == usX2Y->wait_iso_frame)) +if (likely (urb->start_frame == usX2Y->wait_iso_frame)) subs->completed_urb = urb;else {usX2Y_error_sequence (usX2Y, subs, urb);
@@ -256,13 +256,9 @@ static void i_usX2Y_usbpcm_urb_complete(if (capsubs->completed_urb &&atomic_read (&capsubs->state) >= state_PREPARED && (NULL == capsubs2 || capsubs2->completed_urb) && (playbacksubs->completed_urb ||atomic_read (&playbacksubs->state) < state_PREPARED)) { -if (!usX2Y_usbpcm_usbframe_complete (capsubs, capsubs2, playbacksubs, urb->start_frame)) { -if (nr_of_packs () <= urb->start_frame && - urb->start_frame <= (2 *nr_of_packs () -1 ))// uhci and ohci - usX2Y->wait_iso_frame = urb->start_frame -nr_of_packs (); -else - usX2Y->wait_iso_frame +=nr_of_packs (); - }else { +if (!usX2Y_usbpcm_usbframe_complete (capsubs, capsubs2, playbacksubs, urb->start_frame)) + usX2Y->wait_iso_frame +=nr_of_packs (); +else {snd_printdd ("\n" );usX2Y_clients_stop (usX2Y); }
@@ -433,7 +429,6 @@ static int usX2Y_usbpcm_urbs_start(strucif (subs !=NULL &&atomic_read (&subs->state) >= state_PREPARED) goto start; } - usX2Y->wait_iso_frame =-1 ; start:usX2Y_usbpcm_subs_startup (subs);
@@ -459,7 +454,7 @@ static int usX2Y_usbpcm_urbs_start(struc goto cleanup; }else {snd_printdd ("%i\n" , urb->start_frame); -if (0 > usX2Y->wait_iso_frame) +if (u ==0 ) usX2Y->wait_iso_frame = urb->start_frame; } urb->transfer_flags =0 ;
@@ -632,7 +627,7 @@ static int usX2Y_pcms_lock_check(structfor (s =0 ; s <2 ; ++s) {struct snd_pcm_substream *substream; substream = pcm->streams[s].substream; -if (SUBSTREAM_BUSY (substream)) +if (substream &&SUBSTREAM_BUSY (substream)) err = -EBUSY ; } }