1. 09 Jul, 2007 12 commits
    • David Teigland's avatar
      [DLM] add lock timeouts and warnings [2/6] · 3ae1acf9
      David Teigland authored
      New features: lock timeouts and time warnings.  If the DLM_LKF_TIMEOUT
      flag is set, then the request/conversion will be canceled after waiting
      the specified number of centiseconds (specified per lock).  This feature
      is only available for locks requested through libdlm (can be enabled for
      kernel dlm users if there's a use for it.)
      
      If the new DLM_LSFL_TIMEWARN flag is set when creating the lockspace, then
      a warning message will be sent to userspace (using genetlink) after a
      request/conversion has been waiting for a given number of centiseconds
      (configurable per node).  The time warnings will be used in the future
      to do deadlock detection in userspace.
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      3ae1acf9
    • David Teigland's avatar
      [DLM] block scand during recovery [1/6] · 85e86edf
      David Teigland authored
      Don't let dlm_scand run during recovery since it may try to do a resource
      directory removal while the directory nodes are changing.
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      85e86edf
    • Josef Bacik's avatar
      [DLM] keep dlm from panicing when traversing rsb list in debugfs · 916297aa
      Josef Bacik authored
      This problem was originally reported against GFS6.1, but the same issue exists
      in upstream DLM.  This patch keeps the rsb iterator assigning under the rsbtbl
      list lock.  Each time we process an rsb we grab a reference to it to make sure
      it is not freed out from underneath us, and then put it when we get the next rsb
      in the list or move onto another list.
      Signed-off-by: default avatarJosef Bacik <jwhiter@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      916297aa
    • Abhijith Das's avatar
      [GFS2] Quotas non-functional - fix bug · 2a87ab08
      Abhijith Das authored
      This patch fixes an error in the quota code where a 'struct
      gfs2_quota_lvb*' was being passed to gfs2_adjust_quota() instead of a
      'struct gfs2_quota_data*'. Also moved 'struct gfs2_quota_lvb' from
      fs/gfs2/incore.h to include/linux/gfs2_ondisk.h as per Steve's suggestion.
      Signed-off-by: default avatarAbhijith Das <adas@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      2a87ab08
    • Steven Whitehouse's avatar
      [GFS2] Clean up inode number handling · dbb7cae2
      Steven Whitehouse authored
      This patch cleans up the inode number handling code. The main difference
      is that instead of looking up the inodes using a struct gfs2_inum_host
      we now use just the no_addr member of this structure. The tests relating
      to no_formal_ino can then be done by the calling code. This has
      advantages in that we want to do different things in different code
      paths if the no_formal_ino doesn't match. In the NFS patch we want to
      return -ESTALE, but in the ->lookup() path, its a bug in the fs if the
      no_formal_ino doesn't match and thus we can withdraw in this case.
      
      In order to later fix bz #201012, we need to be able to look up an inode
      without knowing no_formal_ino, as the only information that is known to
      us is the on-disk location of the inode in question.
      
      This patch will also help us to fix bz #236099 at a later date by
      cleaning up a lot of the code in that area.
      
      There are no user visible changes as a result of this patch and there
      are no changes to the on-disk format either.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      dbb7cae2
    • Steven Whitehouse's avatar
      [GFS2] Reduce size of struct gdlm_lock · 41d7db0a
      Steven Whitehouse authored
      This patch removes the completion (which is rather large) from struct
      gdlm_lock in favour of using the wait_on_bit() functions. We don't need
      to add any extra fields to the structure to do this, so we save 32 bytes
      (on x86_64) per structure. This adds up to quite a lot when we may
      potentially have millions of these lock structures,
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      Acked-by: default avatarDavid Teigland <teigland@redhat.com>
      41d7db0a
    • Robert Peterson's avatar
      [GFS2] Addendum patch 2 for gfs2_grow · cd81a4ba
      Robert Peterson authored
      This addendum patch 2 corrects three things:
      
      1. It fixes a stupid mistake in the previous addendum that broke gfs2.
         Ref: https://www.redhat.com/archives/cluster-devel/2007-May/msg00162.html
      2. It fixes a problem that Dave Teigland pointed out regarding the
         external declarations in ops_address.h being in the wrong place.
      3. It recasts a couple more %llu printks to (unsigned long long)
         as requested by Steve Whitehouse.
      
      I would have loved to put this all in one revised patch, but there was
      a rush to get some patches for RHEL5.	Therefore, the previous patches
      were applied to the git tree "as is" and therefore, I'm posting another
      addendum.  Sorry.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      cd81a4ba
    • Nate Diller's avatar
      [GFS2] use zero_user_page · 0507ecf5
      Nate Diller authored
      Use zero_user_page() instead of open-coding it.
      Signed-off-by: default avatarNate Diller <nate.diller@gmail.com>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      0507ecf5
    • Robert Peterson's avatar
      [GFS2] Kernel changes to support new gfs2_grow command (part 2) · 6c53267f
      Robert Peterson authored
      To avoid code redundancy, I separated out the operational "guts" into
      a new function called read_rindex_entry.  Then I made two functions:
      the closer-to-original gfs2_ri_update (without the special condition
      checks) and gfs2_ri_update_special that's designed with that condition
      in mind.  (I don't like the name, but if you have a suggestion, I'm
      all ears).
      
      Oh, and there's an added benefit:  we don't need all the ugly gotos
      anymore.  ;)
      
      This patch has been tested with gfs2_fsck_hellfire (which runs for
      three and a half hours, btw).
      Signed-off-By: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      6c53267f
    • Robert Peterson's avatar
      [GFS2] kernel changes to support new gfs2_grow command · 7ae8fa84
      Robert Peterson authored
      This is another revision of my gfs2 kernel patch that allows
      gfs2_grow to function properly.
      
      Steve Whitehouse expressed some concerns about the previous
      patch and I restructured it based on his comments.
      The previous patch was doing the statfs_change at file close time,
      under its own transaction.  The current patch does the statfs_change
      inside the gfs2_commit_write function, which keeps it under the
      umbrella of the inode transaction.
      
      I can't call ri_update to re-read the rindex file during the
      transaction because the transaction may have outstanding unwritten
      buffers attached to the rgrps that would be otherwise blown away.
      So instead, I created a new function, gfs2_ri_total, that will
      re-read the rindex file just to total the file system space
      for the sake of the statfs_change.  The ri_update will happen
      later, when gfs2 realizes the version number has changed, as it
      happened before my patch.
      
      Since the statfs_change is happening at write_commit time and there
      may be multiple writes to the rindex file for one grow operation.
      So one consequence of this restructuring is that instead of getting
      one kernel message to indicate the change, you may see several.
      For example, before when you did a gfs2_grow, you'd get a single
      message like:
      
      GFS2: File system extended by 247876 blocks (968MB)
      
      Now you get something like:
      
      GFS2: File system extended by 207896 blocks (812MB)
      GFS2: File system extended by 39980 blocks (156MB)
      
      This version has also been successfully run against the hours-long
      "gfs2_fsck_hellfire" test that does several gfs2_grow and gfs2_fsck
      while interjecting file system damage.  It does this repeatedly
      under a variety Resource Group conditions.
      Signed-off-By: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      7ae8fa84
    • Satyam Sharma's avatar
      [DLM] fix a couple of races · 3168b078
      Satyam Sharma authored
      Fix two races in fs/dlm/config.c:
      
      (1) Grab the configfs subsystem semaphore before calling
      config_group_find_obj() in get_space(). This solves a potential race
      between get_space() and concurrent mkdir(2) or rmdir(2).
      
      (2) Grab a reference on the found config_item _while_ holding the configfs
      subsystem semaphore in get_comm(), and not after it. This solves a
      potential race between get_comm() and concurrent rmdir(2).
      Signed-off-by: default avatarSatyam Sharma <ssatyam@cse.iitk.ac.in>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      3168b078
    • Benjamin Marzinski's avatar
      [GFS2] flush the glock completely in inode_go_sync · b524fe64
      Benjamin Marzinski authored
      Fix for bz #231910
      When filemap_fdatawrite() is called on the inode mapping in data=ordered mode,
      it will add the glock to the log. In inode_go_sync(), if you do the
      gfs2_log_flush() before this, after the filemap_fdatawrite() call, the glock
      and its associated data buffers will be on the log again. This means you can
      demote a lock from exclusive, without having it flushed from the log. The
      attached patch simply moves the gfs2_log_flush up to after the
      filemap_fdatawrite() call.
      
      Originally, I tried moving the gfs2_log_flush to after gfs2_meta_sync(), but
      that caused me to trip the following assert.
      
      GFS2: fsid=cypher-36:test.0: fatal: assertion "!buffer_busy(bh)" failed
      GFS2: fsid=cypher-36:test.0:   function = gfs2_ail_empty_gl, file = fs/gfs2/glops.c, line = 61
      
      It appears that gfs2_log_flush() puts some of the glocks buffers in the busy
      state and the filemap_fdatawrite() call is necessary to flush them. This makes
      me worry slightly that a related problem could happen because of moving the
      gfs2_log_flush() after the initial filemap_fdatawrite(), but I assume that
      gfs2_ail_empty_gl() would catch that case as well.
      Signed-off-by: default avatarBenjamin E. Marzinski <bmarzins@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      b524fe64
  2. 08 Jul, 2007 6 commits
  3. 07 Jul, 2007 4 commits
    • Adrian Bunk's avatar
      DLM must depend on SYSFS · 95511ad4
      Adrian Bunk authored
      The dependency of DLM on SYSFS got lost in
      commit 6ed7257b resulting in the
      following compile error with CONFIG_DLM=y, CONFIG_SYSFS=n:
      
      <--  snip  -->
      
      ...
        LD      .tmp_vmlinux1
      fs/built-in.o: In function `dlm_lockspace_init':
      /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/fs/dlm/lockspace.c:231: undefined reference to `kernel_subsys'
      fs/built-in.o: In function `configfs_init':
      /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/fs/configfs/mount.c:143: undefined reference to `kernel_subsys'
      make[1]: *** [.tmp_vmlinux1] Error 1
      
      <--  snip  -->
      Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      95511ad4
    • Dave Jones's avatar
      Clean up E7520/7320/7525 quirk printk. · 38377be8
      Dave Jones authored
      The printk level in this printk is bogus, as the previous printk
      didn't have a terminating \n resulting in ..
      
      Intel E7520/7320/7525 detected.<6>Disabling irq balancing and affinity
      
      It also never printed a \n at all in the case where we didn't do
      the quirk.
      
      Change it to only make noise if it actually does something useful.
      Signed-off-by: default avatarDave Jones <davej@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      38377be8
    • Adrian Bunk's avatar
      include/linux/kallsyms.h must #include <linux/errno.h> · 40e48eed
      Adrian Bunk authored
      This patch fixes the following 2.6.22 regression with CONFIG_KALLSYMS=n:
      
      <--  snip  -->
      
      ...
        CC      arch/m32r/kernel/traps.o
      In file included from /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/arch/m32r/kernel/traps.c:14:
      /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/include/linux/kallsyms.h: In function 'lookup_symbol_name':
      /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/include/linux/kallsyms.h:66: error: 'ERANGE' undeclared (first use in this function)
      /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/include/linux/kallsyms.h:66: error: (Each undeclared identifier is reported only once
      /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/include/linux/kallsyms.h:66: error: for each function it appears in.)
      /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/include/linux/kallsyms.h: In function 'lookup_symbol_attrs':
      /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/include/linux/kallsyms.h:71: error: 'ERANGE' undeclared (first use in this function)
      make[2]: *** [arch/m32r/kernel/traps.o] Error 1
      
      <--  snip  -->
      Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      40e48eed
    • David Woodhouse's avatar
      Fix use-after-free oops in Bluetooth HID. · 1c39858b
      David Woodhouse authored
      When cleaning up HIDP sessions, we currently close the ACL connection
      before deregistering the input device. Closing the ACL connection
      schedules a workqueue to remove the associated objects from sysfs, but
      the input device still refers to them -- and if the workqueue happens to
      run before the input device removal, the kernel will oops when trying to
      look up PHYSDEVPATH for the removed input device.
      
      Fix this by deregistering the input device before closing the
      connections.
      Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
      Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1c39858b
  4. 06 Jul, 2007 18 commits
    • Christoph Lameter's avatar
      slub: remove useless EXPORT_SYMBOL · d23cf676
      Christoph Lameter authored
      kmem_cache_open is static. EXPORT_SYMBOL was leftover from some earlier
      time period where kmem_cache_open was usable outside of slub.
      
      (Fixes powerpc build error)
      Signed-off-by: default avatarChrsitoph Lameter <clameter@sgi.com>
      Cc: Johannes Berg <johannes@sipsolutions.net>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d23cf676
    • maximilian attems's avatar
      MAINTAINERS new kernel janitors ml · c3000e03
      maximilian attems authored
      davem kindly moved the list from osdl to vger.
      Signed-of-by: default avatarmaximilian attems <max@stro.at>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c3000e03
    • Andres Salomon's avatar
      GEODE: reboot fixup for geode machines with CS5536 boards · 95069f89
      Andres Salomon authored
      Writing to MSR 0x51400017 forces a hard reset on CS5536-based machines,
      this has the reboot fixup do just that if such a board is detected.
      Acked-by: default avatarJordan Crouse <jordan.crouse@amd.com>
      Signed-off-by: default avatarAndres Salomon <dilinger@debian.org>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Andi Kleen <ak@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      95069f89
    • Linus Torvalds's avatar
      Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 · 1feb17e2
      Linus Torvalds authored
      * 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
        [NETPOLL]: Fixups for 'fix soft lockup when removing module'
        [NET]: net/core/netevent.c should #include <net/netevent.h>
        [NETFILTER]: nf_conntrack_h323: add checking of out-of-range on choices' index values
        [NET] skbuff: remove export of static symbol
        SCTP: Add scope_id validation for link-local binds
        SCTP: Check to make sure file is valid before setting timeout
        SCTP: Fix thinko in sctp_copy_laddrs()
      1feb17e2
    • Linus Torvalds's avatar
      Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus · dadde13a
      Linus Torvalds authored
      * 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
        [MIPS] Fix scheduling latency issue on 24K, 34K and 74K cores
        [MIPS] Add macros to encode processor revisions.
        [MIPS] RM7000: Enable ICACHE_REFILLS_WORKAROUND_WAR.
        [MIPS] SMTC: Fix cut'n'paste bug in Kconfig.debug
        [MIPS] Change libgcc-style functions from lib-y to obj-y
        [MIPS] Fix timer/performance interrupt detection
        [MIPS] AP/SP: Avoid triggering the 34K E125 performance issue
        [MIPS] 64-bit TO_PHYS_MASK macro for RM9000 processors
      dadde13a
    • Peter Zijlstra's avatar
      mm: fixup /proc/vmstat output · 23c1fb52
      Peter Zijlstra authored
      Line up the vmstat_text with zone_stat_item
      
      enum zone_stat_item {
      	/* First 128 byte cacheline (assuming 64 bit words) */
      	NR_FREE_PAGES,
      	NR_INACTIVE,
      	NR_ACTIVE,
      
      We current have nr_active and nr_inactive reversed.
      
      [ "OK with patch, though using initializers canbe handy to prevent such
         things in future:
      
      	static const char * const vmstat_text[] = {
      		[NR_FREE_PAGES] = "nr_free_pages",
      		..."
      							 - Alexey ]
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      23c1fb52
    • Yoann Padioleau's avatar
      potential compiler error, irqfunc caller sites update · 0da2f0f1
      Yoann Padioleau authored
      In 7d12e780 David Howells performed
      this evolution:
       "IRQ: Maintain regs pointer globally rather than passing to IRQ handlers"
      
      He correctly updated many of the function definitions that were using this
      extra regs pointer parameter but forgot to update some caller sites of
      those functions.  The reason the modifications was not properly done on all
      drivers is that some drivers were rarely compiled because they are for
      AMIGA, or that some code sites were inside #ifdefs where the option is not
      set or inside #if 0.
      
      Here is the semantic patch that found the occurences
      and fixed the problem.
      
      @ rule1 @
      identifier fn;
      identifier irq, dev_id;
      typedef irqreturn_t;
      @@
      
      static irqreturn_t fn(int irq, void *dev_id)
      {
         ...
      }
      
      @@
      identifier rule1.fn;
      expression E1, E2, E3;
      @@
      
       fn(E1, E2
      -   ,E3
         )
      Signed-off-by: default avatarYoann Padioleau <padator@wanadoo.fr>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jeff Garzik <jeff@garzik.org>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0da2f0f1
    • Vivek Goyal's avatar
      i386: es7000 build breakage fix · 071922c0
      Vivek Goyal authored
      o Commit 1833d6bc broke the build if
        compiled with CONFIG_ES7000=y and CONFIG_X86_GENERICARCH=n
      
      arch/i386/kernel/built-in.o(.init.text+0x4fa9): In function `acpi_parse_madt':
      : undefined reference to `acpi_madt_oem_check'
      arch/i386/kernel/built-in.o(.init.text+0x7406): In function `smp_read_mpc':
      : undefined reference to `mps_oem_check'
      arch/i386/kernel/built-in.o(.init.text+0x8990): In function
      `connect_bsp_APIC':
      : undefined reference to `enable_apic_mode'
      make: *** [.tmp_vmlinux1] Error 1
      
      o Fix the build issue. Provided the definitions of missing functions.
      
      o Don't have ES7000 machine. Only compile tested.
      
      Cc: Len Brown <lenb@kernel.org>
      Cc: Natalie Protasevich <protasnb@gmail.com>
      Cc: Roland Dreier <rolandd@cisco.com>
      Cc: Andi Kleen <ak@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      071922c0
    • Bjorn Helgaas's avatar
      PNP SMCf010 quirk: work around Toshiba Portege 4000 ACPI issues · 41a53114
      Bjorn Helgaas authored
      When we enable the SMCf010 IR device, the Toshiba Portege 4000 BIOS claims
      the device is working, but it really isn't configured correctly.  The BIOS
      *will* configure it, but only if we call _SRS after (1) reversing the order
      of the SIR and FIR I/O port regions and (2) changing the IRQ from
      active-high to active-low.
      
      This patch addresses the 2.6.22 regression:
          "no irda0 interface (2.6.21 was OK), smsc does not find chip"
      
      I tested this on a Portege 4000.  The smsc-ircc2 driver correctly detects
      the device, and "irattach irda0 -s && irdadump" shows transmitted and
      received packets.
      Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
      Cc: Andrey Borzenkov <arvidjaar@mail.ru>
      Cc: Samuel Ortiz <samuel@sortiz.org>
      Cc: "Linus Walleij (LD/EAB)" <linus.walleij@ericsson.com>
      Cc: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
      Cc: Adam Belay <ambx1@neo.rr.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      41a53114
    • Alexander Graf's avatar
      fix logic error in ipc compat semctl() · d57d9731
      Alexander Graf authored
      When calling a semctl(IPC_STAT) without IPC_64 the check if the memory is
      unevaluated.  This patch fixes this.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d57d9731
    • David Woodhouse's avatar
      x86_64: fix headers_install · 0db19c41
      David Woodhouse authored
      A bug in headers_install for ARCH=x86_64 yields an asm/ directory full of
      files all of which are using the same #ifdef guard, "__ASM_STUB_" with no
      postfix.  So the second and later asm files #included in the same C file
      (often through standard headers like ioctl.h) yields no symbols.
      
      Strangeness with the Ubuntu 'tell me if I support something that's not
      explcitly mentioned in POSIX, and I'll strip it out' shell, I believe.
      
      We don't need the 'export' but we do need a semicolon at the end of the
      FNAME line:
      Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
      Signed-off-by: default avatarRob Landley <rob@landley.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0db19c41
    • Loic Prylli's avatar
      MTRR: Fix race causing set_mtrr to go into infinite loop · d25c1ba2
      Loic Prylli authored
      Processors synchronization in set_mtrr requires the .gate field to be set
      after .count field is properly initialized.  Without an explicit barrier,
      the compiler was reordering those memory stores.  That was sometimes
      causing a processor (in ipi_handler) to see the .gate change and decrement
      .count before the latter is set by set_mtrr() (which then hangs in a
      infinite loop with irqs disabled).
      Signed-off-by: default avatarLoic Prylli <loic@myri.com>
      Cc: Andi Kleen <ak@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d25c1ba2
    • Jason Wessel's avatar
      i386: fix regression, endless loop in ptrace singlestep over an int80 · 1e2e99f0
      Jason Wessel authored
      The commit 635cf99a introduced a
      regression.  Executing a ptrace single step after certain int80
      accesses will infinitely loop and never advance the PC.
      
      The TIF_SINGLESTEP check should be done on the return from the syscall
      and not before it.
      
      I loops on each single step on the pop right after the int80 which writes out
      to the console.  At that point you can issue as many single steps as you want
      and it will not advance any further.
      
      The test case is below:
      
      /* Test whether singlestep through an int80 syscall works.
       */
      #define _GNU_SOURCE
      #include <stdio.h>
      #include <unistd.h>
      #include <fcntl.h>
      #include <sys/ptrace.h>
      #include <sys/wait.h>
      #include <sys/mman.h>
      #include <asm/user.h>
      #include <string.h>
      
      static int child, status;
      static struct user_regs_struct regs;
      
      static void do_child()
      {
      	char str[80] = "child: int80 test\n";
      
      	ptrace(PTRACE_TRACEME, 0, 0, 0);
      	kill(getpid(), SIGUSR1);
      	write(fileno(stdout),str,strlen(str));
      	asm ("int $0x80" : : "a" (20)); /* getpid */
      }
      
      static void do_parent()
      {
      	unsigned long eip, expected = 0;
      again:
      	waitpid(child, &status, 0);
      	if (WIFEXITED(status) || WIFSIGNALED(status))
      		return;
      
      	if (WIFSTOPPED(status)) {
      		ptrace(PTRACE_GETREGS, child, 0, &regs);
      		eip = regs.eip;
      		if (expected)
      			fprintf(stderr, "child stop @ %08lx, expected %08lx %s\n",
      					eip, expected,
      					eip == expected ? "" : " <== ERROR");
      
      		if (*(unsigned short *)eip == 0x80cd) {
      			fprintf(stderr, "int 0x80 at %08x\n", (unsigned int)eip);
      			expected = eip + 2;
      		} else
      			expected = 0;
      
      		ptrace(PTRACE_SINGLESTEP, child, NULL, NULL);
      	}
      	goto again;
      }
      
      int main(int argc, char * const argv[])
      {
      	child = fork();
      	if (child)
      		do_parent();
      	else
      		do_child();
      	return 0;
      }
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Cc: <stable@kernel.org>
      Cc: Chuck Ebbert <76306.1226@compuserve.com>
      Acked-by: default avatarAndi Kleen <ak@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1e2e99f0
    • Michael Ellerman's avatar
      Fix elf_core_dump() when writing arch specific notes (spu coredumps) · ef7320ed
      Michael Ellerman authored
      elf_core_dump() supports dumping arch specific ELF notes, via the #define
      ELF_CORE_WRITE_EXTRA_NOTES.  Currently the only user of this is the powerpc
      spu coredump code.
      
      There is a bug in the handling of foffset WRT the arch notes, which causes
      us to erroneously increment foffset by the size of the arch notes, leaving
      a block of zeroes in the file, and causing all subsequent data in the file
      to be at <supposed position> + <arch note size>.  eg:
      
        LOAD  0x050000 0x00100000 0x00000000 0x20000 0x20000 R E 0x10000
      
      Tells us we should have a chunk of data at 0x50000.  The truth is the data
      is at 0x90dbc = 0x50000 + 0x40dbc (the size of the arch notes).
      
      This bug prevents gdb from reading the core file correctly.
      
      The simplest fix is to simply remember the size of the arch notes, and add
      it to foffset after we've written the arch notes.  The only drawback is
      that if the arch code doesn't write as many bytes as it said it would, we
      end up with a broken core dump again.  For now I think that's a reasonable
      requirement.
      
      Tested on a Cell blade, gdb no longer complains about the core file being
      bogus.
      
      While I'm here I should point out that the spu coredump code does not work
      if we're dumping to a pipe - we'll have to wait for 23 to fix that.
      Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: default avatarPaul Mackerras <paulus@samba.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ef7320ed
    • Ralf Baechle's avatar
      [MIPS] Fix scheduling latency issue on 24K, 34K and 74K cores · 4b3e975e
      Ralf Baechle authored
      The idle loop goes to sleep using the WAIT instruction if !need_resched().
      This has is suffering from from a race condition that if if just after
      need_resched has returned 0 an interrupt might set TIF_NEED_RESCHED but
      we've just completed the test so go to sleep anyway.  This would be
      trivial to fix by just disabling interrupts during that sequence as in:
      
              local_irq_disable();
              if (!need_resched())
                      __asm__("wait");
              local_irq_enable();
      
      but the processor architecture leaves it undefined if a processor calling
      WAIT with interrupts disabled will ever restart its pipeline and indeed
      some processors have made use of the freedom provided by the architecture
      definition.  This has been resolved and the Config7.WII bit indicates that
      the use of WAIT is safe on 24K, 24KE and 34K cores.  It also is safe on
      74K starting revision 2.1.0 so enable the use of WAIT with interrupts
      disabled for 74K based on a c0_prid of at least that.
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      4b3e975e
    • Ralf Baechle's avatar
      [MIPS] Add macros to encode processor revisions. · fde97822
      Ralf Baechle authored
      Older processors used to encode processor version and revision in two
      4-bit bitfields, the 4K seems to simply count up and even newer MTI cores
      have switched to use the 8-bits as 3:3:2 bitfield with the last field as
      the patch number.
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      fde97822
    • Ralf Baechle's avatar
      [MIPS] RM7000: Enable ICACHE_REFILLS_WORKAROUND_WAR. · 075c733e
      Ralf Baechle authored
      The RM7000 processors and the E9000 cores have a bug (though PMC-Sierra
      opposes it being called that) where invalid instructions in the same
      I-cache line worth of instructions being fetched may case spurious
      exceptions.
      
      The workaround for this was only enabled for E9000 cores; enable it also
      for all RM7000-based platforms.
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      075c733e
    • Ralf Baechle's avatar
      [MIPS] SMTC: Fix cut'n'paste bug in Kconfig.debug · 9349075a
      Ralf Baechle authored
      This effectivly turned the SMTC_IDLE_HOOK_DEBUG debug option into a no-op.
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      9349075a