1. 05 8月, 2008 5 次提交
    • K
      mlock() fix return values · a477097d
      KOSAKI Motohiro 提交于
      Halesh says:
      
      Please find the below testcase provide to test mlock.
      
      Test Case :
      ===========================
      
      #include <sys/resource.h>
      #include <stdio.h>
      #include <sys/stat.h>
      #include <sys/types.h>
      #include <unistd.h>
      #include <sys/mman.h>
      #include <fcntl.h>
      #include <errno.h>
      #include <stdlib.h>
      
      int main(void)
      {
        int fd,ret, i = 0;
        char *addr, *addr1 = NULL;
        unsigned int page_size;
        struct rlimit rlim;
      
        if (0 != geteuid())
        {
         printf("Execute this pgm as root\n");
         exit(1);
        }
      
        /* create a file */
        if ((fd = open("mmap_test.c",O_RDWR|O_CREAT,0755)) == -1)
        {
         printf("cant create test file\n");
         exit(1);
        }
      
        page_size = sysconf(_SC_PAGE_SIZE);
      
        /* set the MEMLOCK limit */
        rlim.rlim_cur = 2000;
        rlim.rlim_max = 2000;
      
        if ((ret = setrlimit(RLIMIT_MEMLOCK,&rlim)) != 0)
        {
         printf("Cant change limit values\n");
         exit(1);
        }
      
        addr = 0;
        while (1)
        {
        /* map a page into memory each time*/
        if ((addr = (char *) mmap(addr,page_size, PROT_READ |
      PROT_WRITE,MAP_SHARED,fd,0)) == MAP_FAILED)
        {
         printf("cant do mmap on file\n");
         exit(1);
        }
      
        if (0 == i)
          addr1 = addr;
        i++;
        errno = 0;
        /* lock the mapped memory pagewise*/
        if ((ret = mlock((char *)addr, 1500)) == -1)
        {
         printf("errno value is %d\n", errno);
         printf("cant lock maped region\n");
         exit(1);
        }
        addr = addr + page_size;
       }
      }
      ======================================================
      
      This testcase results in an mlock() failure with errno 14 that is EFAULT,
      but it has nowhere been specified that mlock() will return EFAULT.  When I
      tested the same on older kernels like 2.6.18, I got the correct result i.e
      errno 12 (ENOMEM).
      
      I think in source code mlock(2), setting errno ENOMEM has been missed in
      do_mlock() , on mlock_fixup() failure.
      
      SUSv3 requires the following behavior frmo mlock(2).
      
      [ENOMEM]
          Some or all of the address range specified by the addr and
          len arguments does not correspond to valid mapped pages
          in the address space of the process.
      
      [EAGAIN]
          Some or all of the memory identified by the operation could not
          be locked when the call was made.
      
      This rule isn't so nice and slighly strange.  but many people think
      POSIX/SUS compliance is important.
      Reported-by: NHalesh Sadashiv <halesh.sadashiv@ap.sony.com>
      Tested-by: NHalesh Sadashiv <halesh.sadashiv@ap.sony.com>
      Signed-off-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      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>
      a477097d
    • G
      atmel_spi: fix hang due to missed interrupt · dc329442
      Gerard Kam 提交于
      For some time my at91sam9260 board with JFFS2 on serial flash (m25p80)
      would hang when accessing the serial flash and SPI bus.  Slowing the SPI
      clock down to 9 MHz reduced the occurrence of the hang from "always"
      during boot to a nuisance level that allowed other SW development to
      continue.  Finally had to address this issue when an application stresses
      the I/O to always cause a hang.
      
      Hang seems to be caused by a missed SPI interrupt, so that the task ends
      up waiting forever after calling spi_sync().  The fix has 2 parts.  First
      is to halt the DMA engine before the "current" PDC registers are loaded.
      This ensures that the "next" registers are loaded before the DMA operation
      takes off.  The second part of the fix is a kludge that adds a
      "completion" interrupt in case the ENDRX interrupt for the last segment of
      the DMA chaining operation was missed.
      
      The patch allows the SPI clock for the serial flash to be increased from 9
      MHz to 15 MHz (or more?).  No hangs or SPI overruns were encountered.
      
      Haavard: while this patch does indeed improve things, I still see overruns
      and CRC errors on my NGW100 board when running the DataFlash at 10 MHz.
      However, I think some improvement is better than nothing, so I'm passing
      this on for inclusion in 2.6.27.
      Signed-off-by: NGerard Kam <gerardk5@verizon.net>
      Signed-off-by: NHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
      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>
      dc329442
    • B
      spi: S3C24XX: reset register status on resume. · 5aa6cf30
      Ben Dooks 提交于
      Fix a bug in the spi_s3c24xx driver where it does not reset the registers
      of the hardware when resuming from suspend (this block has been reset over
      suspend).
      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>
      5aa6cf30
    • L
      Revert "UFS: add const to parser token table" · 1a3f7d98
      Linus Torvalds 提交于
      This reverts commit f9247273 (and
      fb2e405f - "fix fs/nfs/nfsroot.c
      compilation" - that fixed a missed conversion).
      
      The changes cause problems for at least the sparc build.  Let's re-do
      them when the exact issues are resolved.
      Requested-by: NAndrew Morton <akpm@linux-foundation.org>
      Requested-by: NSteven Whitehouse <swhiteho@redhat.com>
      Cc: David Miller <davem@davemloft.net>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1a3f7d98
    • L
      Revert "[SCSI] extend the last_sector_bug flag to cover more sectors" · fca082c9
      Linus Torvalds 提交于
      This reverts commit 2b142900, since it
      seems to break some other USB storage devices (at least a JMicron USB to
      ATA bridge).  As such, while it apparently fixes some cardreaders, it
      would need to be made conditional on the exact reader it fixes in order
      to avoid causing regressions.
      
      Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fca082c9
  2. 04 8月, 2008 2 次提交
    • L
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 8f616cd5
      Linus Torvalds 提交于
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: remove write-only variables from ext4_ordered_write_end
        ext4: unexport jbd2_journal_update_superblock
        ext4: Cleanup whitespace and other miscellaneous style issues
        ext4: improve ext4_fill_flex_info() a bit
        ext4: Cleanup the block reservation code path
        ext4: don't assume extents can't cross block groups when truncating
        ext4: Fix lack of credits BUG() when deleting a badly fragmented inode
        ext4: Fix ext4_ext_journal_restart()
        ext4: fix ext4_da_write_begin error path
        jbd2: don't abort if flushing file data failed
        ext4: don't read inode block if the buffer has a write error
        ext4: Don't allow lg prealloc list to be grow large.
        ext4: Convert the usage of NR_CPUS to nr_cpu_ids.
        ext4: Improve error handling in mballoc
        ext4: lock block groups when initializing
        ext4: sync up block and inode bitmap reading functions
        ext4: Allow read/only mounts with corrupted block group checksums
        ext4: Fix data corruption when writing to prealloc area
      8f616cd5
    • L
      Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm · 7e31aa11
      Linus Torvalds 提交于
      * 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm:
        [ARM] 5182/1: pxa: Fix pcm990 compilation
        [ARM] Fix explicit asm(-arm)?/arch-foo references
        [ARM] move include/asm-arm to arch/arm/include/asm
        [ARM] Remove explicit dependency for misc.o from compressed/Makefile
        [ARM] initrd: claim initrd memory exclusively
        [ARM] pxa: add support for L2 outer cache on XScale3 (attempt 2)
        [ARM] 5180/1: at91: Fix at91_nand -> atmel_nand rename fallout
        [ARM] add Sascha Hauer as Freescale i.MX Maintainer
        [ARM] i.MX: add missing clock functions exports
        [ARM] i.MX: remove set_imx_fb_info() export
        [ARM] mx1ads: make mmc platform data available for modules
        [ARM] mx2: add missing Kconfig dependency
      7e31aa11
  3. 03 8月, 2008 8 次提交
  4. 02 8月, 2008 25 次提交