27 Feb, 2009

11 commits


26 Feb, 2009

29 commits

  • On occasion, the request will apparently have more segments than we
    fit into the ring. Jens says:

    > The second problem is that the block layer then appears to create one
    > too many segments, but from the dump it has rq->nr_phys_segments ==
    > BLKIF_MAX_SEGMENTS_PER_REQUEST. I suspect the latter is due to
    > xen-blkfront not handling the merging on its own. It should check that
    > the new page doesn't form part of the previous page. The
    > rq_for_each_segment() iterates all single bits in the request, not dma
    > segments. The "easiest" way to do this is to call blk_rq_map_sg() and
    > then iterate the mapped sg list. That will give you what you are
    > looking for.

    > Here's a test patch, compiles but otherwise untested. I spent more
    > time figuring out how to enable XEN than to code it up, so YMMV!
    > Probably the sg list wants to be put inside the ring and only
    > initialized on allocation, then you can get rid of the sg on stack and
    > sg_init_table() loop call in the function. I'll leave that, and the
    > testing, to you.

    [Moved sg array into info structure, and initialize once. -J]

    Signed-off-by: Jens Axboe
    Signed-off-by: Jeremy Fitzhardinge

    Jens Axboe
     
  • blk_recalc_rq_segments() requires a request structure passed in, which
    we don't have from blk_recount_segments(). So the latter allocates one on
    the stack, using > 400 bytes of stack for that. This can cause us to spill
    over one page of stack from ext4 at least:

    0) 4560 400 blk_recount_segments+0x43/0x62
    1) 4160 32 bio_phys_segments+0x1c/0x24
    2) 4128 32 blk_rq_bio_prep+0x2a/0xf9
    3) 4096 32 init_request_from_bio+0xf9/0xfe
    4) 4064 112 __make_request+0x33c/0x3f6
    5) 3952 144 generic_make_request+0x2d1/0x321
    6) 3808 64 submit_bio+0xb9/0xc3
    7) 3744 48 submit_bh+0xea/0x10e
    8) 3696 368 ext4_mb_init_cache+0x257/0xa6a [ext4]
    9) 3328 288 ext4_mb_regular_allocator+0x421/0xcd9 [ext4]
    10) 3040 160 ext4_mb_new_blocks+0x211/0x4b4 [ext4]
    11) 2880 336 ext4_ext_get_blocks+0xb61/0xd45 [ext4]
    12) 2544 96 ext4_get_blocks_wrap+0xf2/0x200 [ext4]
    13) 2448 80 ext4_da_get_block_write+0x6e/0x16b [ext4]
    14) 2368 352 mpage_da_map_blocks+0x7e/0x4b3 [ext4]
    15) 2016 352 ext4_da_writepages+0x2ce/0x43c [ext4]
    16) 1664 32 do_writepages+0x2d/0x3c
    17) 1632 144 __writeback_single_inode+0x162/0x2cd
    18) 1488 96 generic_sync_sb_inodes+0x1e3/0x32b
    19) 1392 16 sync_sb_inodes+0xe/0x10
    20) 1376 48 writeback_inodes+0x69/0xb3
    21) 1328 208 balance_dirty_pages_ratelimited_nr+0x187/0x2f9
    22) 1120 224 generic_file_buffered_write+0x1d4/0x2c4
    23) 896 176 __generic_file_aio_write_nolock+0x35f/0x393
    24) 720 80 generic_file_aio_write+0x6c/0xc8
    25) 640 80 ext4_file_write+0xa9/0x137 [ext4]
    26) 560 320 do_sync_write+0xf0/0x137
    27) 240 48 vfs_write+0xb3/0x13c
    28) 192 64 sys_write+0x4c/0x74
    29) 128 128 system_call_fastpath+0x16/0x1b

    Split the segment counting out into a __blk_recalc_rq_segments() helper
    to avoid allocating an onstack request just for checking the physical
    segment count.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • If reset_devices is set for kexec, then cciss will delay 30 seconds
    since the old 5i controller _may_ need that long to recover. Replace
    the long sleep with incremental sleep and tests to reduce the 30 seconds
    to worst case for 5i, so that other controllers will proceed quickly.

    Reviewed-by: Mike Miller
    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • Add documentation for register_blkdev() function and for the parameters.

    Signed-off-by: Márton Németh
    Cc: Greg Kroah-Hartman
    Signed-off-by: Jens Axboe

    Márton Németh
     
  • Newer gcc throw this warning:

    fs/bio.c: In function ?bio_alloc_bioset?:
    fs/bio.c:305: warning: ?p? may be used uninitialized in this function

    since it cannot figure out that 'p' is only ever used if 'bs' is non-NULL.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • This fixes a regression introduced by commit
    a4e22f02f5b6518c1484faea1f88d81802b9feac ("powerpc: Update 64bit
    __copy_tofrom_user() using CPU_FTR_UNALIGNED_LD_STD").

    The same bug that existed in the 64bit memcpy() also exists here so fix
    it here too. The fix is the same as that applied to memcpy() with the
    addition of fixes for the exception handling code required for
    __copy_tofrom_user().

    This stops us reading beyond the end of the source region we were told
    to copy.

    Signed-off-by: Mark Nelson
    Signed-off-by: Benjamin Herrenschmidt

    Mark Nelson
     
  • This fixes a regression introduced by commit
    25d6e2d7c58ddc4a3b614fc5381591c0cfe66556 ("powerpc: Update 64bit memcpy()
    using CPU_FTR_UNALIGNED_LD_STD").

    This commit allowed CPUs that have the CPU_FTR_UNALIGNED_LD_STD CPU
    feature bit present to do the memcpy() with unaligned load doubles. But,
    along with this came a bug where our final load double would read bytes
    beyond a page boundary and into the next (unmapped) page. This was caught
    by enabling CONFIG_DEBUG_PAGEALLOC,

    The fix was to read only the number of bytes that we need to store rather
    than reading a full 8-byte doubleword and storing only a portion of that.

    In order to minimise the amount of existing code touched we use the
    original do_tail for the src_unaligned case.

    Below is an example of the regression, as reported by Sachin Sant:

    Unable to handle kernel paging request for data at address 0xc00000003f380000
    Faulting instruction address: 0xc000000000039574
    cpu 0x1: Vector: 300 (Data Access) at [c00000003baf3020]
    pc: c000000000039574: .memcpy+0x74/0x244
    lr: d00000000244916c: .ext3_xattr_get+0x288/0x2f4 [ext3]
    sp: c00000003baf32a0
    msr: 8000000000009032
    dar: c00000003f380000
    dsisr: 40000000
    current = 0xc00000003e54b010
    paca = 0xc000000000a53680
    pid = 1840, comm = readahead
    enter ? for help
    [link register ] d00000000244916c .ext3_xattr_get+0x288/0x2f4 [ext3]
    [c00000003baf32a0] d000000002449104 .ext3_xattr_get+0x220/0x2f4 [ext3]
    (unreliab
    le)
    [c00000003baf3390] d00000000244a6e8 .ext3_xattr_security_get+0x40/0x5c [ext3]
    [c00000003baf3400] c000000000148154 .generic_getxattr+0x74/0x9c
    [c00000003baf34a0] c000000000333400 .inode_doinit_with_dentry+0x1c4/0x678
    [c00000003baf3560] c00000000032c6b0 .security_d_instantiate+0x50/0x68
    [c00000003baf35e0] c00000000013c818 .d_instantiate+0x78/0x9c
    [c00000003baf3680] c00000000013ced0 .d_splice_alias+0xf0/0x120
    [c00000003baf3720] d00000000243e05c .ext3_lookup+0xec/0x134 [ext3]
    [c00000003baf37c0] c000000000131e74 .do_lookup+0x110/0x260
    [c00000003baf3880] c000000000134ed0 .__link_path_walk+0xa98/0x1010
    [c00000003baf3970] c0000000001354a0 .path_walk+0x58/0xc4
    [c00000003baf3a20] c000000000135720 .do_path_lookup+0x138/0x1e4
    [c00000003baf3ad0] c00000000013645c .path_lookup_open+0x6c/0xc8
    [c00000003baf3b70] c000000000136780 .do_filp_open+0xcc/0x874
    [c00000003baf3d10] c0000000001251e0 .do_sys_open+0x80/0x140
    [c00000003baf3dc0] c00000000016aaec .compat_sys_open+0x24/0x38
    [c00000003baf3e30] c00000000000855c syscall_exit+0x0/0x40

    Signed-off-by: Benjamin Herrenschmidt

    Mark Nelson
     
  • When we introduced VSX, we changed the way FPRs are stored in the
    thread_struct. Unfortunately we missed the load/store float double
    alignment handler code when updating how we access FPRs in the
    thread_struct.

    Below fixes this and merges the little/big endian case.

    Signed-off-by: Michael Neuling
    Signed-off-by: Benjamin Herrenschmidt

    Michael Neuling
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
    ALSA: emu10k1 - Fix digital/analog switch on audigy2 ZS
    ALSA: hda - Quirk for Acer Aspire 6530G
    ALSA: hda - add another MacBook Pro 3,1 SSID
    ALSA: fix excessive background noise introduced by OSS emulation rate shrink
    ALSA: aw2: do not grab every saa7146 based device
    ALSA: hda - Fix parse of init_verbs sysfs entry
    ALSA: pcxhr.h replace signed one-bit bitfields

    Linus Torvalds
     
  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
    [IA64] Don't go beyond iosapic_intr_info's arraysize
    [IA64] Do not go beyond ARRAY_SIZE of unw.hash
    [IA64] enable setting DMAR on by default

    Linus Torvalds
     
  • * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
    [libata] pata_legacy: for VLB 32bit PIO don't try tricks with slop
    [libata] pata_amd: program FIFO
    sata_mv: fix SoC interrupt breakage
    pata_it821x: resume from hibernation fails with RAID volume

    Linus Torvalds
     
  • These devices are generally used with ATA anyway and it seems that some
    ATAPI will need us to issue the right number of words. Therefore as we
    can't switch mid burst on VLB devices we should only use 32bit I/O for
    suitable block sizes.

    Signed-off-by: Andrew Morton
    Signed-off-by: Jeff Garzik

    Alan Cox
     
  • With 32bit PIO we can use the posted write buffers, but only for 32bit I/O
    cycles. This means we must disable the FIFO for ATAPI where a final 16bit
    cycle may occur.

    Rework the FIFO logic so that we disable the FIFO then selectively
    re-enable it when we set the timings on AMD devices. Also fix a case
    where we scribbled on PCI config 0x41 of Nvidia chips when we shouldn't.

    Signed-off-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Jeff Garzik

    Alan Cox
     
  • For some reason, sata_mv doesn't clear interrupt status during init
    when it's running on an SoC host adapter. If the bootloader has
    touched the SATA controller before starting Linux, Linux can end up
    enabling the SATA interrupt with events pending, which will cause the
    interrupt to be marked as spurious and then be disabled, which then
    breaks all further accesses to the controller.

    This patch makes the SoC path clear interrupt status on init like in
    the non-SoC case.

    Signed-off-by: Lennert Buytenhek
    Signed-off-by: Mark Lord
    Signed-off-by: Jeff Garzik

    Mark Lord
     
  • Hibernation didn't work for me since I started to use IT8212 controller.
    I did some debugging (booting with no_console_suspend init=/bin/sh).

    Found that resume fails (2.6.28) with "serial number mismatch 'some
    garbage' != 'some other garbage'" and "revalidation failed" messages.
    That's because the controller firmware fills different serial number in
    the IDENTIFY every boot.

    The patch below fixes the resume simply clearing the serial number. The
    proper fix would be probably to fill in the serial number of the RAID
    volume instead. I assume that there must be something like that stored on
    the drives but I don't know where.

    Fix resume on pata_it821x RAID volume by clearing the serial number in
    IDENTIFY data, which is otherwise different on each boot.

    Signed-off-by: Ondrej Zary
    Acked-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Jeff Garzik

    Ondrej Zary
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6:
    ide: fix refcounting in device drivers
    ide-cd: document capacity hack
    it821x: remove dead URL
    atiixp: fix missing parentheses
    amd74xx: device/vendor confusion
    ide: ide.c 'clear' fix, update "ide=nodma" documentation

    Linus Torvalds
     
  • Each time I exit Firefox, /proc/meminfo's Committed_AS goes down almost
    400 kB: OVERCOMMIT_NEVER would be allowing overcommits it should
    prohibit.

    Commit fc8744adc870a8d4366908221508bb113d8b72ee "Stop playing silly
    games with the VM_ACCOUNT flag" changed shmem_file_setup() to set the
    shmem file's VM_ACCOUNT flag according to VM_NORESERVE not being set in
    the vma flags; but did so only _after_ the shmem_acct_size(flags, size)
    call which is expected to pre-account a shared anonymous object.

    It's all clearer if we switch shmem.c over to use VM_NORESERVE
    throughout in place of !VM_ACCOUNT.

    But I very nearly sent in a patch which mistakenly removed the
    accounting from tmpfs files: shmem_get_inode()'s memset was good for not
    setting VM_ACCOUNT, but now it needs to set VM_NORESERVE.

    Rather than setting that by default, then perhaps clearing it again in
    shmem_file_setup(), let's pass it as a flag to shmem_get_inode(): that
    allows us to remove the #ifdef CONFIG_SHMEM from shmem_file_setup().

    Signed-off-by: Hugh Dickins
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • vi arch/ia64/kernel/iosapic.c +142
    static struct iosapic_intr_info {
    ...
    } iosapic_intr_info[NR_IRQS];

    But at line 510 we have:
    for (i = 0; i </

    Signed-off-by: Roel Kluin
    Signed-off-by: Tony Luck

    Roel Kluin
     
  • static struct {

    ... :114
    unsigned short hash[UNW_HASH_SIZE];

    ... :2152
    for (index = 0; index </

    Signed-off-by: Roel Kluin
    Signed-off-by: Tony Luck

    Roel Kluin
     
  • The previous commit which introduced the DMAR_DEFAULT_ON setting in
    drivers/pci/dmar.c neglected to add the ability for ia64 to enable
    the IOMMU by default. Rectify that mistake, doh!

    Signed-off-by: Kyle McMartin
    Signed-off-by: Tony Luck

    Kyle McMartin
     
  • During host driver module removal del_gendisk() results in a final
    put on drive->gendev and freeing the drive by drive_release_dev().

    Convert device drivers from using struct kref to use struct device
    so device driver's object holds reference on ->gendev and prevents
    drive from prematurely going away.

    Also fix ->remove methods to not erroneously drop reference on a
    host driver by using only put_device() instead of ide*_put().

    Reported-by: Stanislaw Gruszka
    Tested-by: Stanislaw Gruszka
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • Just copy the comment from drivers/scsi/sr.c::sr_done()
    (from which the capacity hack has been originated).

    Cc: Borislav Petkov
    Acked-by: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • Fix missing parentheses so PIO/DMA timings for master device on the
    second channel are programmed correctly (IOW "8 0 24 16" offset values
    should be used instead of the current "8 0 16 16").

    [ The bug went unnoticed because after PIO/DMA timings get programmed
    incorrectly for the third device they are overwritten with timings
    for the fourth device and since BIOS should also program timings for
    the third device everything should work fine until suspend/resume
    cycle or user requested transfer mode changes. ]

    Signed-off-by: Roel Kluin
    Cc: Sergei Shtylyov
    Cc: Andrew Morton
    [bart: update patch description]
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Roel Kluin
     
  • Device and vendor ids were confused

    Signed-off-by: Roel Kluin
    Cc: Andrew Morton
    Acked-by: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Roel Kluin
     
  • Documentation/kernel-parameters.txt
    - ide=nodma is no longer valid.

    drivers/ide/Kconfig
    - The module is ide-core.ko not ide.

    drivers/ide/ide.c
    - It took me a while to figure out what the arguments %d.%d:%d to nodma
    module parameter ment, so I added a comment to each.
    - Added a comment to each of the sscanf lines.
    - There is a bug, if j is 0 it would previously clear all the other bits
    except the current device, changed in three different places.
    mask &= (1 << i) should be mask &= ~(1 << i).

    Signed-off-by: David Fries
    [bart: s/disk/device/ in ide.c, beautify patch description]
    Signed-off-by: Bartlomiej Zolnierkiewicz

    David Fries
     
  • * 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
    drm/i915: convert DRM_ERROR to DRM_DEBUG in phys object pwrite path
    drm/i915: make hw page ioremap use ioremap_wc
    drm: edid revision 0 is valid
    drm: Correct unbalanced drm_vblank_put() during mode setting.
    drm: disable encoders before re-routing them
    drm: Fix ordering of bit fields in EDID structure leading huge vsync values.
    drm: Fix shifts of EDID vsync offset/width fields.
    drm/i915: handle bogus VBT panel timing
    drm/i915: remove PLL debugging messages

    Linus Torvalds
     
  • * 'for-linus' of git://neil.brown.name/md:
    md: avoid races when stopping resync.
    md/raid10: Don't call bitmap_cond_end_sync when we are doing recovery.
    md/raid10: Don't skip more than 1 bitmap-chunk at a time during recovery.

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
    sparc64: Fix crashes in jbusmc_print_dimm()

    Linus Torvalds