1. 23 9月, 2008 1 次提交
    • F
      timers: fix itimer/many thread hang, v2 · bb34d92f
      Frank Mayhar 提交于
      This is the second resubmission of the posix timer rework patch, posted
      a few days ago.
      
      This includes the changes from the previous resubmittion, which addressed
      Oleg Nesterov's comments, removing the RCU stuff from the patch and
      un-inlining the thread_group_cputime() function for SMP.
      
      In addition, per Ingo Molnar it simplifies the UP code, consolidating much
      of it with the SMP version and depending on lower-level SMP/UP handling to
      take care of the differences.
      
      It also cleans up some UP compile errors, moves the scheduler stats-related
      macros into kernel/sched_stats.h, cleans up a merge error in
      kernel/fork.c and has a few other minor fixes and cleanups as suggested
      by Oleg and Ingo. Thanks for the review, guys.
      Signed-off-by: NFrank Mayhar <fmayhar@google.com>
      Cc: Roland McGrath <roland@redhat.com>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      bb34d92f
  2. 14 9月, 2008 36 次提交
    • I
      timers: fix itimer/many thread hang, cleanups · 5ce73a4a
      Ingo Molnar 提交于
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5ce73a4a
    • I
      timers: fix itimer/many thread hang, fix #2 · 0a8eaa4f
      Ingo Molnar 提交于
      fix the UP build:
      
      In file included from arch/x86/kernel/asm-offsets_32.c:9,
                       from arch/x86/kernel/asm-offsets.c:3:
      include/linux/sched.h: In function ‘thread_group_cputime_clone_thread’:
      include/linux/sched.h:2272: warning: no return statement in function returning non-void
      include/linux/sched.h: In function ‘thread_group_cputime_account_user’:
      include/linux/sched.h:2284: error: invalid type argument of ‘->’ (have ‘struct task_cputime’)
      include/linux/sched.h:2284: error: invalid type argument of ‘->’ (have ‘struct task_cputime’)
      include/linux/sched.h: In function ‘thread_group_cputime_account_system’:
      include/linux/sched.h:2291: error: invalid type argument of ‘->’ (have ‘struct task_cputime’)
      include/linux/sched.h:2291: error: invalid type argument of ‘->’ (have ‘struct task_cputime’)
      include/linux/sched.h: In function ‘thread_group_cputime_account_exec_runtime’:
      include/linux/sched.h:2298: error: invalid type argument of ‘->’ (have ‘struct task_cputime’)
      distcc[14501] ERROR: compile arch/x86/kernel/asm-offsets.c on a/30 failed
      make[1]: *** [arch/x86/kernel/asm-offsets.s] Error 1
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0a8eaa4f
    • I
      timers: fix itimer/many thread hang, fix · 430b5294
      Ingo Molnar 提交于
      fix:
      
       kernel/fork.c:843: error: ‘struct signal_struct’ has no member named ‘sum_sched_runtime’
       kernel/irq/handle.c:117: warning: ‘sparse_irq_lock’ defined but not used
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      430b5294
    • F
      timers: fix itimer/many thread hang · f06febc9
      Frank Mayhar 提交于
      Overview
      
      This patch reworks the handling of POSIX CPU timers, including the
      ITIMER_PROF, ITIMER_VIRT timers and rlimit handling.  It was put together
      with the help of Roland McGrath, the owner and original writer of this code.
      
      The problem we ran into, and the reason for this rework, has to do with using
      a profiling timer in a process with a large number of threads.  It appears
      that the performance of the old implementation of run_posix_cpu_timers() was
      at least O(n*3) (where "n" is the number of threads in a process) or worse.
      Everything is fine with an increasing number of threads until the time taken
      for that routine to run becomes the same as or greater than the tick time, at
      which point things degrade rather quickly.
      
      This patch fixes bug 9906, "Weird hang with NPTL and SIGPROF."
      
      Code Changes
      
      This rework corrects the implementation of run_posix_cpu_timers() to make it
      run in constant time for a particular machine.  (Performance may vary between
      one machine and another depending upon whether the kernel is built as single-
      or multiprocessor and, in the latter case, depending upon the number of
      running processors.)  To do this, at each tick we now update fields in
      signal_struct as well as task_struct.  The run_posix_cpu_timers() function
      uses those fields to make its decisions.
      
      We define a new structure, "task_cputime," to contain user, system and
      scheduler times and use these in appropriate places:
      
      struct task_cputime {
      	cputime_t utime;
      	cputime_t stime;
      	unsigned long long sum_exec_runtime;
      };
      
      This is included in the structure "thread_group_cputime," which is a new
      substructure of signal_struct and which varies for uniprocessor versus
      multiprocessor kernels.  For uniprocessor kernels, it uses "task_cputime" as
      a simple substructure, while for multiprocessor kernels it is a pointer:
      
      struct thread_group_cputime {
      	struct task_cputime totals;
      };
      
      struct thread_group_cputime {
      	struct task_cputime *totals;
      };
      
      We also add a new task_cputime substructure directly to signal_struct, to
      cache the earliest expiration of process-wide timers, and task_cputime also
      replaces the it_*_expires fields of task_struct (used for earliest expiration
      of thread timers).  The "thread_group_cputime" structure contains process-wide
      timers that are updated via account_user_time() and friends.  In the non-SMP
      case the structure is a simple aggregator; unfortunately in the SMP case that
      simplicity was not achievable due to cache-line contention between CPUs (in
      one measured case performance was actually _worse_ on a 16-cpu system than
      the same test on a 4-cpu system, due to this contention).  For SMP, the
      thread_group_cputime counters are maintained as a per-cpu structure allocated
      using alloc_percpu().  The timer functions update only the timer field in
      the structure corresponding to the running CPU, obtained using per_cpu_ptr().
      
      We define a set of inline functions in sched.h that we use to maintain the
      thread_group_cputime structure and hide the differences between UP and SMP
      implementations from the rest of the kernel.  The thread_group_cputime_init()
      function initializes the thread_group_cputime structure for the given task.
      The thread_group_cputime_alloc() is a no-op for UP; for SMP it calls the
      out-of-line function thread_group_cputime_alloc_smp() to allocate and fill
      in the per-cpu structures and fields.  The thread_group_cputime_free()
      function, also a no-op for UP, in SMP frees the per-cpu structures.  The
      thread_group_cputime_clone_thread() function (also a UP no-op) for SMP calls
      thread_group_cputime_alloc() if the per-cpu structures haven't yet been
      allocated.  The thread_group_cputime() function fills the task_cputime
      structure it is passed with the contents of the thread_group_cputime fields;
      in UP it's that simple but in SMP it must also safely check that tsk->signal
      is non-NULL (if it is it just uses the appropriate fields of task_struct) and,
      if so, sums the per-cpu values for each online CPU.  Finally, the three
      functions account_group_user_time(), account_group_system_time() and
      account_group_exec_runtime() are used by timer functions to update the
      respective fields of the thread_group_cputime structure.
      
      Non-SMP operation is trivial and will not be mentioned further.
      
      The per-cpu structure is always allocated when a task creates its first new
      thread, via a call to thread_group_cputime_clone_thread() from copy_signal().
      It is freed at process exit via a call to thread_group_cputime_free() from
      cleanup_signal().
      
      All functions that formerly summed utime/stime/sum_sched_runtime values from
      from all threads in the thread group now use thread_group_cputime() to
      snapshot the values in the thread_group_cputime structure or the values in
      the task structure itself if the per-cpu structure hasn't been allocated.
      
      Finally, the code in kernel/posix-cpu-timers.c has changed quite a bit.
      The run_posix_cpu_timers() function has been split into a fast path and a
      slow path; the former safely checks whether there are any expired thread
      timers and, if not, just returns, while the slow path does the heavy lifting.
      With the dedicated thread group fields, timers are no longer "rebalanced" and
      the process_timer_rebalance() function and related code has gone away.  All
      summing loops are gone and all code that used them now uses the
      thread_group_cputime() inline.  When process-wide timers are set, the new
      task_cputime structure in signal_struct is used to cache the earliest
      expiration; this is checked in the fast path.
      
      Performance
      
      The fix appears not to add significant overhead to existing operations.  It
      generally performs the same as the current code except in two cases, one in
      which it performs slightly worse (Case 5 below) and one in which it performs
      very significantly better (Case 2 below).  Overall it's a wash except in those
      two cases.
      
      I've since done somewhat more involved testing on a dual-core Opteron system.
      
      Case 1: With no itimer running, for a test with 100,000 threads, the fixed
      	kernel took 1428.5 seconds, 513 seconds more than the unfixed system,
      	all of which was spent in the system.  There were twice as many
      	voluntary context switches with the fix as without it.
      
      Case 2: With an itimer running at .01 second ticks and 4000 threads (the most
      	an unmodified kernel can handle), the fixed kernel ran the test in
      	eight percent of the time (5.8 seconds as opposed to 70 seconds) and
      	had better tick accuracy (.012 seconds per tick as opposed to .023
      	seconds per tick).
      
      Case 3: A 4000-thread test with an initial timer tick of .01 second and an
      	interval of 10,000 seconds (i.e. a timer that ticks only once) had
      	very nearly the same performance in both cases:  6.3 seconds elapsed
      	for the fixed kernel versus 5.5 seconds for the unfixed kernel.
      
      With fewer threads (eight in these tests), the Case 1 test ran in essentially
      the same time on both the modified and unmodified kernels (5.2 seconds versus
      5.8 seconds).  The Case 2 test ran in about the same time as well, 5.9 seconds
      versus 5.4 seconds but again with much better tick accuracy, .013 seconds per
      tick versus .025 seconds per tick for the unmodified kernel.
      
      Since the fix affected the rlimit code, I also tested soft and hard CPU limits.
      
      Case 4: With a hard CPU limit of 20 seconds and eight threads (and an itimer
      	running), the modified kernel was very slightly favored in that while
      	it killed the process in 19.997 seconds of CPU time (5.002 seconds of
      	wall time), only .003 seconds of that was system time, the rest was
      	user time.  The unmodified kernel killed the process in 20.001 seconds
      	of CPU (5.014 seconds of wall time) of which .016 seconds was system
      	time.  Really, though, the results were too close to call.  The results
      	were essentially the same with no itimer running.
      
      Case 5: With a soft limit of 20 seconds and a hard limit of 2000 seconds
      	(where the hard limit would never be reached) and an itimer running,
      	the modified kernel exhibited worse tick accuracy than the unmodified
      	kernel: .050 seconds/tick versus .028 seconds/tick.  Otherwise,
      	performance was almost indistinguishable.  With no itimer running this
      	test exhibited virtually identical behavior and times in both cases.
      
      In times past I did some limited performance testing.  those results are below.
      
      On a four-cpu Opteron system without this fix, a sixteen-thread test executed
      in 3569.991 seconds, of which user was 3568.435s and system was 1.556s.  On
      the same system with the fix, user and elapsed time were about the same, but
      system time dropped to 0.007 seconds.  Performance with eight, four and one
      thread were comparable.  Interestingly, the timer ticks with the fix seemed
      more accurate:  The sixteen-thread test with the fix received 149543 ticks
      for 0.024 seconds per tick, while the same test without the fix received 58720
      for 0.061 seconds per tick.  Both cases were configured for an interval of
      0.01 seconds.  Again, the other tests were comparable.  Each thread in this
      test computed the primes up to 25,000,000.
      
      I also did a test with a large number of threads, 100,000 threads, which is
      impossible without the fix.  In this case each thread computed the primes only
      up to 10,000 (to make the runtime manageable).  System time dominated, at
      1546.968 seconds out of a total 2176.906 seconds (giving a user time of
      629.938s).  It received 147651 ticks for 0.015 seconds per tick, still quite
      accurate.  There is obviously no comparable test without the fix.
      Signed-off-by: NFrank Mayhar <fmayhar@google.com>
      Cc: Roland McGrath <roland@redhat.com>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f06febc9
    • L
      Merge master.kernel.org:/home/rmk/linux-2.6-arm · 6bfb09a1
      Linus Torvalds 提交于
      * master.kernel.org:/home/rmk/linux-2.6-arm:
        [ARM] Fix PCI_DMA_BUS_IS_PHYS for ARM
        [ARM] 5247/1: tosa: SW_EAR_IN support
        [ARM] 5246/1: tosa: add proper clock alias for tc6393xb clock
        [ARM] 5245/1: Fix warning about unused return value in drivers/pcmcia
        [ARM] OMAP: Fix MMC device data
        imx serial: fix rts handling for non imx1 based hardware
        imx serial: set RXD mux bit on i.MX27 and i.MX31
        i.MX serial: fix init failure
        pcm037: add rts/cts support for serial port
      6bfb09a1
    • L
      Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev · 7c22a3d8
      Linus Torvalds 提交于
      * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
        [libata] LBA28/LBA48 off-by-one bug in ata.h
        sata_inic162x: enable LED blinking
        ata: duplicate variable sparse warning
      7c22a3d8
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 · 0cb60efd
      Linus Torvalds 提交于
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
        PCI: re-add debug prints for unmodified BARs
        PCI: fix pciehp_free_irq()
        PCI Hotplug: fakephp: fix deadlock... again
        PCI: Fix printk warnings in setup-bus.c
        PCI: Fix printk warnings in probe.c
        PCI/iommu: blacklist DMAR on Intel G31/G33 chipsets
      0cb60efd
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 · c19e8080
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
        niu: panic on reset
        netlink: fix overrun in attribute iteration
        [Bluetooth] Fix regression from using default link policy
        ath9k: Assign seq# when mac80211 requests this
      c19e8080
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 · 344a7829
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
        sparc: Fix user_regset 'n' field values.
        sparc64: Fix PCI error interrupt registry on PSYCHO.
        sparc32: Fix function signature of of_bus_sbus_get_flags().
        sparc64: Fix interrupt register calculations on Psycho and Sabre.
      344a7829
    • A
      memstick: fix MSProHG 8-bit interface mode support · 8e82f8c3
      Alex Dubov 提交于
      - 8-bit interface mode never worked properly.  The only adapter I have
        which supports the 8b mode (the Jmicron) had some problems with its
        clock wiring and they discovered it only now.  We also discovered that
        ProHG media is more sensitive to the ordering of initialization
        commands.
      
      - Make the driver fall back to highest supported mode instead of always
        falling back to serial.  The driver will attempt the switch to 8b mode
        for any new MSPro card, but not all of them support it.  Previously,
        these new cards ended up in serial mode, which is not the best idea
        (they work fine with 4b, after all).
      
      - Edit some macros for better conformance to Sony documentation
      Signed-off-by: NAlex Dubov <oakad@yahoo.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8e82f8c3
    • A
      rescan_partitions(): make device capacity errors non-fatal · 8d99f83b
      Andrew Morton 提交于
      Herton Krzesinski reports that the error-checking changes in
      04ebd4ae ("block/ioctl.c and
      fs/partition/check.c: check value returned by add_partition") cause his
      buggy USB camera to no longer mount.  "The camera is an Olympus X-840.
      The original issue comes from the camera itself: its format program
      creates a partition with an off by one error".
      
      Buggy devices happen.  It is better for the kernel to warn and to proceed
      with the mount.
      Reported-by: NHerton Ronaldo Krzesinski <herton@mandriva.com.br>
      Cc: Abdel Benamrouche <draconux@gmail.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: David Brownell <david-b@pacbell.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8d99f83b
    • B
      spi_s3c24xx: fix section warning · 42cde430
      Ben Dooks 提交于
      Fix the section mismatch warning generated by the incorrect naming of
      s3c24xx_spidrv which should be s3c24xx_spi_driver:
      
      WARNING: drivers/spi/spi_s3c24xx.o(.data+0x4):
        Section mismatch in reference from the variable s3c24xx_spidrv
        to the (unknown reference) .exit.text:(unknown)
      Signed-off-by: NBen Dooks <ben-linux@fluff.org>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      42cde430
    • H
      atmel_lcdfb: disable LCD and DMA engines when suspending · 3aa04f1b
      Haavard Skinnemoen 提交于
      When suspending the system with atmel_lcdfb enabled, I sometimes see
      this:
      
      	atmel_lcdfb atmel_lcdfb.0: FIFO underflow 0x10
      
      Which can be explained by the fact that we're not stopping the LCD
      controller and its DMA engine when suspending, we're just gating the
      clocks to them.
      
      There's another potential issue which may be harder to trigger but
      much more nasty: If we gate the clocks at _just_ the right moment,
      e.g. when the DMA engine is doing a bus transaction, we may cause the
      DMA engine to violate the system bus protocol and cause a lockup.
      
      Avoid these issues by shutting down the LCD controller before entering
      suspend (and restarting it when resuming). This prevents the underrun
      from happening in the first place, and prevents whatever nastiness is
      happening when the bus clock stops in the middle of a DMA transfer.
      Signed-off-by: NHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
      Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3aa04f1b
    • R
      ia64: fix panic during `modprobe -r xpc' · 8275d102
      Robin Holt 提交于
      If you are on ia64 and you modprobe xpc then modprobe -r xpc, you
      immediately get a panic.  xpc depends on xp which depends on gru for a
      symbol.  That symbol is only used when we are running on UV hardware.
      
      Currently, the GRU driver detects we are not on UV hardware and does no
      initializing.  It does not do the same check when unloading.  As a result,
      the gru driver attempts to tear down stuff that was not setup.
      
      This is a simple two-line workaround to get us through this release.  Once
      2.6.28 is opened, we need to rework the symbols that xp is depending on
      from gru so the gru driver can properly fail to load when hardware is not
      available.
      Signed-off-by: NRobin Holt <holt@sgi.com>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8275d102
    • M
      MAINTAINERS: fix USB VIDEO CLASS mail list address · ecc9a04d
      Ming Lei 提交于
      It should be linux-uvc-devel@lists.berlios.de.
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ecc9a04d
    • D
      Documentation/ABI: /sys/class/gpio · 9f986a8c
      David Brownell 提交于
      Provide summary ABI docs about the /sys/class/gpio files.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9f986a8c
    • M
      mm: mark the correct zone as full when scanning zonelists · 5bead2a0
      Mel Gorman 提交于
      The iterator for_each_zone_zonelist() uses a struct zoneref *z cursor when
      scanning zonelists to keep track of where in the zonelist it is.  The
      zoneref that is returned corresponds to the the next zone that is to be
      scanned, not the current one.  It was intended to be treated as an opaque
      list.
      
      When the page allocator is scanning a zonelist, it marks elements in the
      zonelist corresponding to zones that are temporarily full.  As the
      zonelist is being updated, it uses the cursor here;
      
        if (NUMA_BUILD)
              zlc_mark_zone_full(zonelist, z);
      
      This is intended to prevent rescanning in the near future but the zoneref
      cursor does not correspond to the zone that has been found to be full.
      This is an easy misunderstanding to make so this patch corrects the
      problem by changing zoneref cursor to be the current zone being scanned
      instead of the next one.
      Signed-off-by: NMel Gorman <mel@csn.ul.ie>
      Cc: Andy Whitcroft <apw@shadowen.org>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: <stable@kernel.org>		[2.6.26.x]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5bead2a0
    • N
      pxa2xx_spi: dma bugfixes · 7e964455
      Ned Forrester 提交于
      Fixes two DMA bugs in the pxa2xx_spi driver.  The first bug is in all
      versions of this driver; the second was introduced in the 2.6.20 kernel,
      and prevents using the driver with chips like m25p16 flash (which can
      issue large DMA reads).
      
       1. Zero length transfers are permitted for use to insert timing,
          but pxa2xx_spi.c will fail if this is requested in DMA mode.
          Fixed by using programmed I/O (PIO) mode for such transfers.
      
       2. Transfers larger than 8191 are not permitted in DMA mode.  A
          test for length rejects all large transfers regardless of DMA
          or PIO mode.  Worked around by rejecting only large transfers
          with DMA mapped buffers, and forcing all other transfers
          larger than 8191 to use PIO mode.  A rate limited warning is
          issued for DMA transfers forced to PIO mode.
      
      This patch should apply to all kernels back to and including 2.6.20;
      it was test patched against 2.6.20.  An additional patch would be
      required for older kernels, but those versions are very buggy anyway.
      Signed-off-by: NNed Forrester <nforrester@whoi.edu>
      Cc: Vernon Sauder <vernoninhand@gmail.com>
      Cc: Eric Miao <eric.y.miao@gmail.com>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: <stable@kernel.org>		[2.6.25.x, 2.6.26.x]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7e964455
    • N
      pxa2xx_spi: chipselect bugfixes · 8423597d
      Ned Forrester 提交于
      Fixes several chipselect bugs in the pxa2xx_spi driver.  These bugs are in
      all versions of this driver and prevent using it with chips like m25p16
      flash.
      
       1. The spi_transfer.cs_change flag is handled too early:
          before spi_transfer.delay_usecs applies, thus making the
          delay ineffective at holding chip select.
      
       2. spi_transfer.delay_usecs is ignored on the last transfer
          of a message (likewise not holding chipselect long enough).
      
       3. If spi_transfer.cs_change is set on the last transfer, the
          chip select is always disabled, instead of the intended
          meaning: optionally holding chip select enabled for the
          next message.
      
      Those first three bugs were fixed with a relocation of delays
      and chip select de-assertions.
      
       4. If a message has the cs_change flag set on the last transfer,
          and had the chip select stayed enabled as requested (see 3,
          above), it would not have been disabled if the next message is
          for a different chip.  Fixed by dropping chip select regardless
          of cs_change at end of a message, if there is no next message
          or if the next message is for a different chip.
      
      This patch should apply to all kernels back to and including 2.6.20;
      it was test patched against 2.6.20.  An additional patch would be
      required for older kernels, but those versions are very buggy anyway.
      Signed-off-by: NNed Forrester <nforrester@whoi.edu>
      Cc: Vernon Sauder <vernoninhand@gmail.com>
      Cc: Eric Miao <eric.y.miao@gmail.com>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: <stable@kernel.org>		[2.6.25.x, 2.6.26.x]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8423597d
    • P
      spi_mpc83xx: reject invalid transfer sizes · aa77d96b
      Peter Korsgaard 提交于
      Error out on transfer length != multiple of bytes per word with -EINVAL.
      Fixes a buffer overrun crash if length < bytes per word.
      Signed-off-by: NPeter Korsgaard <jacmet@sunsite.dk>
      Acked-by: NJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      aa77d96b
    • P
      spi_mpc83xx: fix clockrate calculation for low speed · 53604dbe
      Peter Korsgaard 提交于
      Commit a61f5345 (spi_mpc83xx clockrate fixes) broke clockrate calculation
      for low speeds.  SPMODE_DIV16 should be set if the divider is higher than
      64, not only if the divider gets clipped to 1024.
      
      Furthermore, the clipping check was off by a factor 16 as well.
      Signed-off-by: NPeter Korsgaard <jacmet@sunsite.dk>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      53604dbe
    • H
      mm: ifdef Quicklists in /proc/meminfo · d7a3e495
      Hugh Dickins 提交于
      A "Quicklists:          0 kB" line has just started appearing in
      /proc/meminfo, but most architectures (including x86) don't have
      them configured, so #ifdef it, like the highmem lines.
      
      And those architectures which do have quicklists configured are
      using them for page tables: so let's place it next to PageTables.
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Acked-by: NChristoph Lameter <cl@linux-foundation.org>
      Acked-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d7a3e495
    • E
      bfs: fix Lockdep warning · 1558182f
      Eric Sesterhenn 提交于
      This fixes:
      
        =============================================
        [ INFO: possible recursive locking detected ]
        2.6.27-rc5-00283-g70bb0896 #68
        ---------------------------------------------
        touch/6855 is trying to acquire lock:
         (&info->bfs_lock){--..}, at: [<c02262f5>] bfs_delete_inode+0x9e/0x18c
      
        but task is already holding lock:
         (&info->bfs_lock){--..}, at: [<c0226c00>] bfs_create+0x45/0x187
      
        other info that might help us debug this:
        2 locks held by touch/6855:
         #0:  (&type->i_mutex_dir_key#5){--..}, at: [<c018ad13>] do_filp_open+0x10b/0x62f
         #1:  (&info->bfs_lock){--..}, at: [<c0226c00>] bfs_create+0x45/0x187
      
        stack backtrace:
        Pid: 6855, comm: touch Not tainted 2.6.27-rc5-00283-g70bb0896 #68
         [<c013e769>] validate_chain+0x458/0x9f4
         [<c013bece>] ? trace_hardirqs_off+0xb/0xd
         [<c013f36b>] __lock_acquire+0x666/0x6e0
         [<c013f440>] lock_acquire+0x5b/0x77
         [<c02262f5>] ? bfs_delete_inode+0x9e/0x18c
         [<c06aab74>] mutex_lock_nested+0xbc/0x234
         [<c02262f5>] ? bfs_delete_inode+0x9e/0x18c
         [<c02262f5>] ? bfs_delete_inode+0x9e/0x18c
         [<c02262f5>] bfs_delete_inode+0x9e/0x18c
         [<c0226257>] ? bfs_delete_inode+0x0/0x18c
         [<c01925e1>] generic_delete_inode+0x94/0xfe
         [<c019265d>] generic_drop_inode+0x12/0x12f
         [<c0191b7e>] iput+0x4b/0x4e
         [<c0226d1e>] bfs_create+0x163/0x187
         [<c0188b42>] vfs_create+0xa6/0x114
         [<c018adb5>] do_filp_open+0x1ad/0x62f
         [<c0107cdc>] ? native_sched_clock+0x82/0x96
         [<c06ac309>] ? _spin_unlock+0x27/0x3c
         [<c019379e>] ? alloc_fd+0xbf/0xc9
         [<c06ae2f4>] ? sub_preempt_count+0x9d/0xab
         [<c019379e>] ? alloc_fd+0xbf/0xc9
         [<c0180391>] do_sys_open+0x42/0xb8
         [<c041d564>] ? trace_hardirqs_on_thunk+0xc/0x10
         [<c0180449>] sys_open+0x1e/0x26
         [<c01038bd>] sysenter_do_call+0x12/0x31
         =======================
      
      The problem is that we don't unlock the bfs->lock mutex before calling
      iput (we do in the other cases).
      Signed-off-by: NEric Sesterhenn <snakebyte@gmx.de>
      Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1558182f
    • H
      coredump_filter: add description of bit 4 · b261dfea
      Hidehiro Kawai 提交于
      There is no description of bit 4 of coredump_filter in the
      documentation.  This patch adds it.
      Signed-off-by: NHidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
      Cc: Roland McGrath <roland@redhat.com>
      Cc: Mel Gorman <mel@csn.ul.ie>
      Acked-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b261dfea
    • L
      cpuset: hotplug documentation fix · 02499431
      Li Zefan 提交于
      If all the cpus in a cpuset are offlined, the tasks in it will be moved to
      the nearest ancestor with non-empty cpus.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: NPaul Jackson <pj@sgi.com>
      Cc: Paul Menage <menage@google.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      02499431
    • L
      cpuset: avoid changing cpuset's cpus when -errno returned · 4e74339a
      Li Zefan 提交于
      After the patch:
      
      commit 0b2f630a
      Author: Miao Xie <miaox@cn.fujitsu.com>
      Date:   Fri Jul 25 01:47:21 2008 -0700
      
          cpusets: restructure the function update_cpumask() and update_nodemask()
      
      It might happen that 'echo 0 > /cpuset/sub/cpus' returned failure but 'cpus'
      has been changed, because cpus was changed before calling heap_init() which
      may return -ENOMEM.
      
      This patch restores the orginal behavior.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: NPaul Menage <menage@google.com>
      Cc: Paul Jackson <pj@sgi.com>
      Cc: Miao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4e74339a
    • H
      include/linux/ioport.h: add missing macro argument for devm_release_* family · dea420ce
      Hiroshi DOYU 提交于
      akpm: these have no callers at this time, but they shall soon, so let's
      get them right.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NHiroshi DOYU <Hiroshi.DOYU@nokia.com>
      Cc: Tony Lindgren <tony@atomide.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      dea420ce
    • A
      proc: more debugging for "already registered" case · 665020c3
      Alexey Dobriyan 提交于
      Print parent directory name as well.
      
      The aim is to catch non-creation of parent directory when proc_mkdir will
      return NULL and all subsequent registrations go directly in /proc instead
      of intended directory.
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      [ Fixed insane printk string while at it.  - Linus ]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      665020c3
    • T
      [libata] LBA28/LBA48 off-by-one bug in ata.h · 97b697a1
      Taisuke Yamada 提交于
      I recently bought 3 HGST P7K500-series 500GB SATA drives and
      had trouble accessing the block right on the LBA28-LBA48 border.
      Here's how it fails (same for all 3 drives):
      
        # dd if=/dev/sdc bs=512 count=1 skip=268435455 > /dev/null
        dd: reading `/dev/sdc': Input/output error
        0+0 records in
        0+0 records out
        0 bytes (0 B) copied, 0.288033 seconds, 0.0 kB/s
        # dmesg
        ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
        ata1.00: BMDMA stat 0x25
        ata1.00: cmd c8/00:08:f8:ff:ff/00:00:00:00:00/ef tag 0 dma 4096 in
        res 51/04:08:f8:ff:ff/00:00:00:00:00/ef Emask 0x1 (device error)
        ata1.00: status: { DRDY ERR }
        ata1.00: error: { ABRT }
        ata1.00: configured for UDMA/33
        ata1: EH complete
        ...
      
      After some investigations, it turned out this seems to be caused
      by misinterpretation of the ATA specification on LBA28 access.
      Following part is the code in question:
      
        === include/linux/ata.h ===
        static inline int lba_28_ok(u64 block, u32 n_block)
        {
          /* check the ending block number */
          return ((block + n_block - 1) < ((u64)1 << 28)) && (n_block <= 256);
        }
      
      HGST drive (sometimes) fails with LBA28 access of {block = 0xfffffff,
      n_block = 1}, and this behavior seems to be comformant. Other drives,
      including other HGST drives are not that strict, through.
      
      >From the ATA specification:
      (http://www.t13.org/Documents/UploadedDocuments/project/d1410r3b-ATA-ATAPI-6.pdf)
      
        8.15.29  Word (61:60): Total number of user addressable sectors
        This field contains a value that is one greater than the total number
        of user addressable sectors (see 6.2). The maximum value that shall
        be placed in this field is 0FFFFFFFh.
      
      So the driver shouldn't use the value of 0xfffffff for LBA28 request
      as this exceeds maximum user addressable sector. The logical maximum
      value for LBA28 is 0xffffffe.
      
      The obvious fix is to cut "- 1" part, and the patch attached just do
      that. I've been using the patched kernel for about a month now, and
      the same fix is also floating on the net for some time. So I believe
      this fix works reliably.
      
      Just FYI, many Windows/Intel platform users also seems to be struck
      by this, and HGST has issued a note pointing to Intel ICH8/9 driver.
      
        "28-bit LBA command is being used to access LBAs 29-bits in length"
      http://www.hitachigst.com/hddt/knowtree.nsf/cffe836ed7c12018862565b000530c74/b531b8bce8745fb78825740f00580e23
      
      Also, *BSDs seems to have similar fix included sometime around ~2004,
      through I have not checked out exact portion of the code.
      Signed-off-by: NTaisuke Yamada <tai@rakugaki.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      97b697a1
    • B
      sata_inic162x: enable LED blinking · 99580664
      Bob Stewart 提交于
      Enable LED blinking.
      Signed-off-by: NBob Stewart <bob@evoria.net>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      99580664
    • S
      ata: duplicate variable sparse warning · da3ceb22
      Stephen Hemminger 提交于
      drivers/ata/ata_piix.c:1502:7: warning: symbol 'rc' shadows an earlier one
      Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      da3ceb22
    • R
      [ARM] Fix PCI_DMA_BUS_IS_PHYS for ARM · 88c381bf
      Russell King 提交于
      PCI_DMA_BUS_IS_PHYS was defined to be zero, which meant we ignored
      the DMA mask for IDE and SCSI transfers.  This is wrong - we have
      no DMA translation hardware.  We want to obey DMA masks so that the
      block layer performs bouncing itself.
      Reported-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      88c381bf
    • R
    • D
    • D
      [ARM] 5246/1: tosa: add proper clock alias for tc6393xb clock · 7bdb22c9
      Dmitry Baryshkov 提交于
      Add clock alias for clock that is used by tc6393xb device on tosa.
      As that chip plays pretty major part in tosa life and is currently
      disabled, this is 2.4.27 material.
      Signed-off-by: NDmitry Baryshkov <dbaryshkov@gmail.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      7bdb22c9
    • J
      [ARM] 5245/1: Fix warning about unused return value in drivers/pcmcia · 632480ea
      Jürgen Schindele 提交于
      Fix warning when compiling "drivers/pcmcia/soc-common.c"
      The return value of the function "device_create_file"
      was not used / assigned.
      Signed-off-by: NJrgen Schindele <linux@schindele.name>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      632480ea
  3. 13 9月, 2008 3 次提交