1. 07 3月, 2012 3 次提交
  2. 04 3月, 2012 1 次提交
  3. 02 3月, 2012 6 次提交
    • A
      Block: use a freezable workqueue for disk-event polling · 62d3c543
      Alan Stern 提交于
      This patch (as1519) fixes a bug in the block layer's disk-events
      polling.  The polling is done by a work routine queued on the
      system_nrt_wq workqueue.  Since that workqueue isn't freezable, the
      polling continues even in the middle of a system sleep transition.
      
      Obviously, polling a suspended drive for media changes and such isn't
      a good thing to do; in the case of USB mass-storage devices it can
      lead to real problems requiring device resets and even re-enumeration.
      
      The patch fixes things by creating a new system-wide, non-reentrant,
      freezable workqueue and using it for disk-events polling.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: <stable@kernel.org>
      Acked-by: NTejun Heo <tj@kernel.org>
      Acked-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      62d3c543
    • D
      drivers/block/DAC960: fix -Wuninitialized warning · cecd353a
      Danny Kukawka 提交于
      Set CommandMailbox with memset before use it. Fix for:
      
      drivers/block/DAC960.c: In function ‘DAC960_V1_EnableMemoryMailboxInterface’:
      arch/x86/include/asm/io.h:61:1: warning: ‘CommandMailbox.Bytes[12]’
       may be used uninitialized in this function [-Wuninitialized]
      drivers/block/DAC960.c:1175:30: note: ‘CommandMailbox.Bytes[12]’
       was declared here
      Signed-off-by: NDanny Kukawka <danny.kukawka@bisect.de>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      cecd353a
    • D
      drivers/block/DAC960: fix DAC960_V2_IOCTL_Opcode_T -Wenum-compare warning · bca505f1
      Danny Kukawka 提交于
      Fixed compiler warning:
      
      comparison between ‘DAC960_V2_IOCTL_Opcode_T’ and ‘enum <anonymous>’
      
      Renamed enum, added a new enum for SCSI_10.CommandOpcode in
      DAC960_V2_ProcessCompletedCommand().
      Signed-off-by: NDanny Kukawka <danny.kukawka@bisect.de>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      bca505f1
    • S
      block: fix __blkdev_get and add_disk race condition · 9f53d2fe
      Stanislaw Gruszka 提交于
      The following situation might occur:
      
      __blkdev_get:			add_disk:
      
      				register_disk()
      get_gendisk()
      
      disk_block_events()
      	disk->ev == NULL
      
      				disk_add_events()
      
      __disk_unblock_events()
      	disk->ev != NULL
      	--ev->block
      
      Then we unblock events, when they are suppose to be blocked. This can
      trigger events related block/genhd.c warnings, but also can crash in
      sd_check_events() or other places.
      
      I'm able to reproduce crashes with the following scripts (with
      connected usb dongle as sdb disk).
      
      <snip>
      DEV=/dev/sdb
      ENABLE=/sys/bus/usb/devices/1-2/bConfigurationValue
      
      function stop_me()
      {
      	for i in `jobs -p` ; do kill $i 2> /dev/null ; done
      	exit
      }
      
      trap stop_me SIGHUP SIGINT SIGTERM
      
      for ((i = 0; i < 10; i++)) ; do
      	while true; do fdisk -l $DEV  2>&1 > /dev/null ; done &
      done
      
      while true ; do
      echo 1 > $ENABLE
      sleep 1
      echo 0 > $ENABLE
      done
      </snip>
      
      I use the script to verify patch fixing oops in sd_revalidate_disk
      http://marc.info/?l=linux-scsi&m=132935572512352&w=2
      Without Jun'ichi Nomura patch titled "Fix NULL pointer dereference in
      sd_revalidate_disk" or this one, script easily crash kernel within
      a few seconds. With both patches applied I do not observe crash.
      Unfortunately after some time (dozen of minutes), script will hung in:
      
      [ 1563.906432]  [<c08354f5>] schedule_timeout_uninterruptible+0x15/0x20
      [ 1563.906437]  [<c04532d5>] msleep+0x15/0x20
      [ 1563.906443]  [<c05d60b2>] blk_drain_queue+0x32/0xd0
      [ 1563.906447]  [<c05d6e00>] blk_cleanup_queue+0xd0/0x170
      [ 1563.906454]  [<c06d278f>] scsi_free_queue+0x3f/0x60
      [ 1563.906459]  [<c06d7e6e>] __scsi_remove_device+0x6e/0xb0
      [ 1563.906463]  [<c06d4aff>] scsi_forget_host+0x4f/0x60
      [ 1563.906468]  [<c06cd84a>] scsi_remove_host+0x5a/0xf0
      [ 1563.906482]  [<f7f030fb>] quiesce_and_remove_host+0x5b/0xa0 [usb_storage]
      [ 1563.906490]  [<f7f03203>] usb_stor_disconnect+0x13/0x20 [usb_storage]
      
      Anyway I think this patch is some step forward.
      
      As drawback, I do not teardown on sysfs file create error, because I do
      not know how to nullify disk->ev (since it can be used). However add_disk
      error handling practically does not exist too, and things will work
      without this sysfs file, except events will not be exported to user
      space.
      Signed-off-by: NStanislaw Gruszka <sgruszka@redhat.com>
      Acked-by: NTejun Heo <tj@kernel.org>
      Cc: stable@kernel.org
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      9f53d2fe
    • M
      block: Fix setting bio flags in drivers (sd_dif/floppy) · 12ebffd1
      Muthukumar R 提交于
      Fix setting bio flags in drivers (sd_dif/floppy).
      Signed-off-by: NMuthukumar R <muthur@gmail.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      12ebffd1
    • J
      block: Fix NULL pointer dereference in sd_revalidate_disk · fe316bf2
      Jun'ichi Nomura 提交于
      Since 2.6.39 (1196f8b8), when a driver returns -ENOMEDIUM for open(),
      __blkdev_get() calls rescan_partitions() to remove
      in-kernel partition structures and raise KOBJ_CHANGE uevent.
      
      However it ends up calling driver's revalidate_disk without open
      and could cause oops.
      
      In the case of SCSI:
      
        process A                  process B
        ----------------------------------------------
        sys_open
          __blkdev_get
            sd_open
              returns -ENOMEDIUM
                                   scsi_remove_device
                                     <scsi_device torn down>
            rescan_partitions
              sd_revalidate_disk
                <oops>
      Oopses are reported here:
      http://marc.info/?l=linux-scsi&m=132388619710052
      
      This patch separates the partition invalidation from rescan_partitions()
      and use it for -ENOMEDIUM case.
      Reported-by: NHuajun Li <huajun.li.lee@gmail.com>
      Signed-off-by: NJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Acked-by: NTejun Heo <tj@kernel.org>
      Cc: stable@kernel.org
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      fe316bf2
  4. 15 2月, 2012 8 次提交
    • T
      block: exit_io_context() should call elevator_exit_icq_fn() · 621032ad
      Tejun Heo 提交于
      While updating locking, b2efa052 "block, cfq: unlink
      cfq_io_context's immediately" moved elevator_exit_icq_fn() invocation
      from exit_io_context() to the final ioc put.  While this doesn't cause
      catastrophic failure, it effectively removes task exit notification to
      elevator and cause noticeable IO performance degradation with CFQ.
      
      On task exit, CFQ used to immediately expire the slice if it was being
      used by the exiting task as no more IO would be issued by the task;
      however, after b2efa052, the notification is lost and disk could sit
      idle needlessly, leading to noticeable IO performance degradation for
      certain workloads.
      
      This patch renames ioc_exit_icq() to ioc_destroy_icq(), separates
      elevator_exit_icq_fn() invocation into ioc_exit_icq() and invokes it
      from exit_io_context().  ICQ_EXITED flag is added to avoid invoking
      the callback more than once for the same icq.
      
      Walking icq_list from ioc side and invoking elevator callback requires
      reverse double locking.  This may be better implemented using RCU;
      unfortunately, using RCU isn't trivial.  e.g. RCU protection would
      need to cover request_queue and queue_lock switch on cleanup makes
      grabbing queue_lock from RCU unsafe.  Reverse double locking should
      do, at least for now.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-and-bisected-by: NShaohua Li <shli@kernel.org>
      LKML-Reference: <CANejiEVzs=pUhQSTvUppkDcc2TNZyfohBRLygW5zFmXyk5A-xQ@mail.gmail.com>
      Tested-by: NShaohua Li <shaohua.li@intel.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      621032ad
    • T
      block: simplify ioc_release_fn() · 2274b029
      Tejun Heo 提交于
      Reverse double lock dancing in ioc_release_fn() can be simplified by
      just using trylock on the queue_lock and back out from ioc lock on
      trylock failure.  Simplify it.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Tested-by: NShaohua Li <shaohua.li@intel.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      2274b029
    • T
      block: replace icq->changed with icq->flags · d705ae6b
      Tejun Heo 提交于
      icq->changed was used for ICQ_*_CHANGED bits.  Rename it to flags and
      access it under ioc->lock instead of using atomic bitops.
      ioc_get_changed() is added so that the changed part can be fetched and
      cleared as before.
      
      icq->flags will be used to carry other flags.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Tested-by: NShaohua Li <shaohua.li@intel.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      d705ae6b
    • L
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator · 7ada1dd6
      Linus Torvalds 提交于
      One small bug fix from Axel plus a fix for a build failure in unrealistic
      but commonly built configs which for some reason manage to survive for
      an awfully long time in -next without any reports.
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
        regulator: Fix getting voltage in max8649_enable_time()
        regulator: Fix mc13xxx regulator modular build (again)
      7ada1dd6
    • L
      Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc · ebf4bcbd
      Linus Torvalds 提交于
      Quoth BenH:
       "Here are a few powerpc fixes for 3.3, all pretty trivial.  I also
        added the patch to define GET_IP/SET_IP so we can use some more
        asm-generic goodness."
      
      * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
        powerpc/pseries/eeh: Fix crash when error happens during device probe
        powerpc/pseries: Fix partition migration hang in stop_topology_update
        powerpc/powernv: Disable interrupts while taking phb->lock
        powerpc: Fix WARN_ON in decrementer_check_overflow
        powerpc/wsp: Fix IRQ affinity setting
        powerpc: Implement GET_IP/SET_IP
        powerpc/wsp: Permanently enable PCI class code workaround
      ebf4bcbd
    • L
      Merge tag 'mmc-fixes-for-3.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc · 8b36ac50
      Linus Torvalds 提交于
      MMC fixes for 3.3-rc4:
       * The most visible fix here is against a regression introduced in 3.3-rc1
         that ran cards in Ultra High Speed mode even when they failed to initialize
         in that mode, leading to lower-speed cards failing to mount.
       * A lockdep warning introduced in 3.3-rc1 is fixed.
       * Various other small driver fixes, most notably for a NULL dereference
         when using highmem with dw_mmc.
      
      * tag 'mmc-fixes-for-3.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
        mmc: dw_mmc: Fix PIO mode with support of highmem
        mmc: atmel-mci: save and restore sdioirq when soft reset is performed
        mmc: block: Init ro_lock sysfs attr to fix lockdep warnings
        mmc: sh_mmcif: fix late delayed work initialisation
        mmc: tmio_mmc: fix card eject during IO with DMA
        mmc: core: Fix comparison issue in mmc_compare_ext_csds
        mmc: core: Fix PowerOff Notify suspend/resume
        mmc: sdhci-pci: set Medfield SDIO as non-removable
        mmc: core: add the capability for broken voltage
        mmc: core: Fix low speed mmc card detection failure
        mmc: esdhc: set the timeout to the max value
        mmc: esdhc: add PIO mode support
        mmc: core: Ensure clocks are always enabled before host interaction
        mmc: of_mmc_spi: fix little endian support
        mmc: core: UHS sdio card that fails should not exceed 50MHz
        mmc: esdhc: fix errors when booting kernel on Freescale eSDHC version 2.3
      8b36ac50
    • L
      Merge tag 'stable/for-linus-fixes-3.3-rc3' of... · 694ce18e
      Linus Torvalds 提交于
      Merge tag 'stable/for-linus-fixes-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
      
      Two fixes for VCPU offlining; One to fix the string format exposed
      by the xen-pci[front|back] to conform to the one used in majority of
      PCI drivers; Two fixes to make the code more resilient to invalid
      configurations.
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      
      * tag 'stable/for-linus-fixes-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
        xenbus_dev: add missing error check to watch handling
        xen/pci[front|back]: Use %d instead of %1x for displaying PCI devfn.
        xen pvhvm: do not remap pirqs onto evtchns if !xen_have_vector_callback
        xen/smp: Fix CPU online/offline bug triggering a BUG: scheduling while atomic.
        xen/bootup: During bootup suppress XENBUS: Unable to read cpu state
      694ce18e
    • L
      Merge tag 'sound-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 13d26193
      Linus Torvalds 提交于
      sound fixes for 3.3-rc4
      
      Basically all small fixes suited as rc4: a few HD-audio regression fixes,
      a stable fix for an old Dell laptop with intel8x0, and a simple fix for
      ASoC fsi.
      
      * tag 'sound-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: intel8x0: Fix default inaudible sound on Gateway M520
        ALSA: hda - Fix silent speaker output on Acer Aspire 6935
        ALSA: hda - Fix initialization of secondary capture source on VT1705
        ASoC: fsi: fixup fsi_pointer() calculation method
        ALSA: hda - Fix mute-LED VREF value for new HP laptops
      13d26193
  5. 14 2月, 2012 22 次提交