1. 28 4月, 2009 19 次提交
    • T
      ide-pm: don't abuse rq->data · 765139ef
      Tejun Heo 提交于
      Impact: cleanup rq->data usage
      
      ide-pm uses rq->data to carry pointer to struct request_pm_state
      through request queue and rq->special is used to carray pointer to
      local struct ide_cmd, which isn't necessary.  Use rq->special for
      request_pm_state instead and use local ide_cmd in
      ide_start_power_step().
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      765139ef
    • T
      ide-cd,atapi: use bio for internal commands · 02e7cf8f
      Tejun Heo 提交于
      Impact: unify request data buffer handling
      
      rq->data is used mostly to pass kernel buffer through request queue
      without using bio.  There are only a couple of places which still do
      this in kernel and converting to bio isn't difficult.
      
      This patch converts ide-cd and atapi to use bio instead of rq->data
      for request sense and internal pc commands.  With previous change to
      unify sense request handling, this is relatively easily achieved by
      adding blk_rq_map_kern() during sense_rq prep and PC issue.
      
      If blk_rq_map_kern() fails for sense, the error is deferred till sense
      issue and aborts the failed command which triggered the sense.  Note
      that this is a slim possibility as sense prep is done on each command
      issue, so for the above condition to actually trigger, all preps since
      the last sense issue till the issue of the request which would require
      a sense should fail.
      
      * do_request functions might sleep now.  This should be okay as ide
        request_fn - do_ide_request() - is invoked only from make_request
        and plug work.  Make sure this is the case by adding might_sleep()
        to do_ide_request().
      
      * Functions which access the read sense data before the sense request
        is complete now should access bio_data(sense_rq->bio) as the sense
        buffer might have been copied during blk_rq_map_kern().
      
      * ide-tape updated to map sg.
      
      * cdrom_do_block_pc() now doesn't have to deal with REQ_TYPE_ATA_PC
        special case.  Simplified.
      
      * tp_ops->output/input_data path dropped from ide_pc_intr().
      Signed-off-by: NTejun Heo <tj@kernel.org>
      02e7cf8f
    • B
      ide-atapi: convert ide-{floppy,tape} to using preallocated sense buffer · 06875320
      Borislav Petkov 提交于
      Since we're issuing REQ_TYPE_SENSE now we need to allow those types of
      rqs in the ->do_request callbacks. As a future improvement, sense_len
      assignment might be unified across all ATAPI devices. Borislav to
      check with specs and test.
      
      As a result, get rid of ide_queue_pc_head() and
      drive->request_sense_rq.
      
      tj: * Init request sense ide_atapi_pc from sense request.  In the
            longer timer, it would probably better to fold
            ide_create_request_sense_cmd() into its only current user -
            ide_floppy_get_format_progress().
      
          * ide_retry_pc() no longer takes @disk.
      
      CC: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      CC: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NBorislav Petkov <petkovbb@gmail.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      06875320
    • B
      ide-cd: convert to using generic sense request · c457ce87
      Borislav Petkov 提交于
      Preallocate a sense request in the ->do_request method and reinitialize
      it only on demand, in case it's been consumed in the IRQ handler path.
      The reason for this is that we don't want to be mapping rq to bio in
      the IRQ path and introduce all kinds of unnecessary hacks to the block
      layer.
      
      tj: * Both user and kernel PC requests expect sense data to be stored
            in separate storage other than drive->sense_data.  Copy sense
            data to rq->sense on completion if rq->sense is not NULL.  This
            fixes bogus sense data on PC requests.
      
      As a result, remove cdrom_queue_request_sense.
      
      CC: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      CC: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NBorislav Petkov <petkovbb@gmail.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      c457ce87
    • B
      ide: add helpers for preparing sense requests · e69d800f
      Borislav Petkov 提交于
      This is in preparation of removing the queueing of a sense request out
      of the IRQ handler path.
      
      Use struct request_sense as a general sense buffer for all ATAPI
      devices ide-{floppy,tape,cd}.
      
      tj: * blk_get_request(__GFP_WAIT) can't be called from do_request() as
            it can cause deadlock.  Converted to use inline struct request
            and blk_rq_init().
      
          * Added xfer / cdb len selection depending on device type.
      
          * All sense prep logics folded into ide_prep_sense() which never
            fails.
      
          * hwif->rq clearing and sense_rq used handling moved into
            ide_queue_sense_rq().
      
          * blk_rq_map_kern() conversion is moved to later patch.
      
      CC: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      CC: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NBorislav Petkov <petkovbb@gmail.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      e69d800f
    • T
      ide-cd: don't abuse rq->buffer · 1f181d2b
      Tejun Heo 提交于
      Impact: rq->buffer usage cleanup
      
      ide-cd uses rq->buffer to carry pointer to the original request when
      issuing REQUEST_SENSE.  Use rq->special instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      1f181d2b
    • T
      ide-atapi: don't abuse rq->buffer · ac0b0113
      Tejun Heo 提交于
      Impact: rq->buffer usage cleanup
      
      ide-atapi uses rq->buffer as private opaque value for internal special
      requests.  rq->special isn't used for these cases (the only case where
      rq->special is used is for ide-tape rw requests).  Use rq->special
      instead.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      ac0b0113
    • T
      ide-taskfile: don't abuse rq->buffer · d868ca24
      Tejun Heo 提交于
      Impact: rq->buffer usage cleanup
      
      ide_raw_taskfile() directly uses rq->buffer to carry pointer to the
      data buffer.  This complicates both block interface and ide backend
      request handling.  Use blk_rq_map_kern() instead and drop special
      handling for REQ_TYPE_ATA_TASKFILE from ide_map_sg().
      
      Note that REQ_RW setting is moved upwards as blk_rq_map_kern() uses it
      to initialize bio rw flag.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      d868ca24
    • T
      ide-floppy: block pc always uses bio · 8968932e
      Tejun Heo 提交于
      Impact: remove unnecessary code path
      
      Block pc requests always use bio and rq->data is always NULL.  No need
      to worry about !rq->bio cases in idefloppy_block_pc_cmd().  Note that
      ide-atapi uses ide_pio_bytes() for bio PIO transfer which handle sg
      fine.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      8968932e
    • T
      ide-cd: clear sense buffer before issuing request sense · 59a4f6f3
      Tejun Heo 提交于
      Impact: code simplification
      
      ide_cd_request_sense_fixup() clears the tail of the sense buffer if
      the device didn't completely fill it.  This patch makes
      cdrom_queue_request_sense() clear the sense buffer before issuing the
      command instead of clearing it afterwards.  This simplifies code and
      eases future changes.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      59a4f6f3
    • T
      ide kill unused ide_cmd->special · 214ae191
      Tejun Heo 提交于
      Impact: removal of unused field
      
      No one uses ide_cmd->special anymore.  Kill it.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      214ae191
    • T
      ide: don't set REQ_SOFTBARRIER · b2963ac1
      Tejun Heo 提交于
      ide doesn't have to worry about REQ_SOFTBARRIER.  Don't set it.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      b2963ac1
    • T
      ide: use blk_run_queue() instead of blk_start_queueing() · 220d06b5
      Tejun Heo 提交于
      blk_start_queueing() is being phased out in favor of
      [__]blk_run_queue().  Switch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      220d06b5
    • T
      ide-tape: remove back-to-back REQUEST_SENSE detection · 0de57fb9
      Tejun Heo 提交于
      Impact: fix an oops which always triggers
      
      ide_tape_issue_pc() assumed drive->pc isn't NULL on invocation when
      checking for back-to-back request sense issues but drive->pc can be
      NULL and even when it's not NULL, it's not safe to dereference it once
      the previous command is complete because pc could have been freed or
      was on stack.  Kill back-to-back REQUEST_SENSE detection.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      0de57fb9
    • T
      block: clear req->errors on bio completion only for fs requests · 924cec77
      Tejun Heo 提交于
      Impact: subtle behavior change
      
      For fs requests, rq is only carrier of bios and rq error status as a
      whole doesn't mean much.  This is the reason why rq->errors is being
      cleared on each partial completion of a request as on each partial
      completion the error status is transferred to the respective bios.
      
      For pc requests, rq->errors is used to carry error status to the
      issuer and thus __end_that_request_first() doesn't clear it on such
      cases.
      
      The condition was fine till now as only fs and pc requests have used
      bio and thus the bio completion path.  However, future changes will
      unify data accesses to bio and all non fs users care about rq error
      status.  Clear rq->errors on bio completion only for fs requests.
      
      In general, the implicit clearing is a bit too subtle especially as
      the meaning of rq->errors is completely dependent on low level
      drivers.  Unifying / cleaning up rq->errors usage and letting llds
      manage it would be better.  TODO comment added.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NJens Axboe <axboe@kernel.dk>
      924cec77
    • A
      loop: use BIO list management functions · e686307f
      Akinobu Mita 提交于
      Now that the bio list management stuff is generic, convert loop to use
      bio lists instead of its own private bio list implementation.
      
      Cc:  Jens Axboe <axboe@kernel.dk>
      Cc: Christoph Hellwig <hch@infradead.org>
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      e686307f
    • T
      hd: fix locking · e93b9fb7
      Tejun Heo 提交于
      hd dance around local irq and HD_IRQ enable without achieving much.
      It ends up transferring data from irq handler with both local irq and
      HD_IRQ disabled.  The only place it actually does something is while
      transferring the first block of a request which it does with HD_IRQ
      disabled but local irq enabled.
      
      Unfortunately, the dancing is horribly broken from locking POV.  IRQ
      and timeout handlers access block queue without grabbing the queue
      lock and running the driver in SMP configuration crashes the whole
      machine pretty quickly.
      
      Remove meaningless irq enable/disable dancing and add proper locking
      in issue, irq and timeout paths.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      e93b9fb7
    • B
      mg_disk: fix CONFIG_LBD=y warning · 7090a0a9
      Bartlomiej Zolnierkiewicz 提交于
      drivers/block/mg_disk.c: In function ‘mg_dump_status’:
      drivers/block/mg_disk.c:265: warning: format ‘%ld’ expects type ‘long int’, but
      argument 2 has type ‘sector_t’
      
      [ Impact: kill build warning ]
      
      Cc: unsik Kim <donari75@gmail.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      7090a0a9
    • T
      mg_disk: fix locking · ac2ff946
      Tejun Heo 提交于
      IRQ and timeout handlers call functions which expect locked queue lock
      without locking it.  Fix it.
      
      While at it, convert 0s used as null pointer constant to NULLs.
      
      [ Impact: fix locking, cleanup ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: unsik Kim <donari75@gmail.com>
      ac2ff946
  2. 27 4月, 2009 11 次提交
  3. 25 4月, 2009 6 次提交
  4. 24 4月, 2009 4 次提交
    • L
      Merge branch 'fixes-for-linus' of git://git.monstr.eu/linux-2.6-microblaze · 9f5a6912
      Linus Torvalds 提交于
      * 'fixes-for-linus' of git://git.monstr.eu/linux-2.6-microblaze:
        microblaze: add parameter to microblaze_read()
        microblaze: Use CFLAGS_KERNEL instead of CFLAGS
        microblaze: Add STATE_SAVE_ARG_SPACE for noMMU kernel too
        microblaze: Do not check use_dcache
        microblaze: Do not use PVR configuration for broken MB version
        microblaze: Fix USR1/2 pvr printing message
        microblaze: iowrite upon timeout
        microblaze: Correspond CONFIG...PCMP in Makefile/Kconfig
        microblaze: Remove redundant variable
        microblaze: Move start_thread to process.c
        microblaze: Add missing preadv and pwritev syscalls
        microblaze: Add missing declaration for die and _exception func
        microblaze: Remove sparse error in traps.c
        microblaze: Move task_pt_regs up
        microblaze: Rename kernel_mode to pt_mode in pt_regs
        microblaze: Remove uncache shadow condition
        microblaze: Remove while(1) loop from show_regs function
        microblaze: Remove unneded per cpu SYSCALL_SAVE variable
      9f5a6912
    • L
      Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 · ef54b1bb
      Linus Torvalds 提交于
      * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (34 commits)
        ACPI, i915: Register ACPI video even when not modesetting
        Revert "ACPICA: delete check for AML access to port 0x81-83"
        I/O port protection: update for windows compatibility.
        sony-laptop: always try to unblock rfkill on load
        sony-laptop: fix bogus error message display on resume
        ACPI: EC: Fix ACPI EC resume non-query interrupt message
        sony-laptop: SNC input event 38 fix
        sony-laptop: SNC 127 Initialization Fix
        sony-laptop: Duplicate SNC 127 Event Fix
        ACPI: prevent processor.max_cstate=0 boot crash
        ACPI/hpet: prevent boot hang when hpet=force used on ICH-4M
        ACPI: delete obsolete "bus master activity" proc field
        ACPI: idle: mark_tsc_unstable() at init-time, not run-time
        ACPI: add /sys/firmware/acpi/interrupts/sci_not counter
        ACPI video: fix an error when the brightness levels on AC and on Battery are same
        acpi-cpufreq: Do not let get_measured perf depend on internal variable
        acpi-cpufreq: style-only: add parens to math expression
        acpi-cpufreq: Cleanup: Use printk_once
        x86, acpi_cpufreq: Fix the NULL pointer dereference in get_measured_perf
        thinkpad-acpi: bump up version to 0.23
        ...
      ef54b1bb
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu · 9fe9293d
      Linus Torvalds 提交于
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
        m68knommu: update the default config for the ColdFire 5407C3 board
        m68knommu: update the default config for the ColdFire 5307C3 board
        m68knommu: update the default config for the ColdFire 5257EVB board
        m68knommu: update the default config for the ColdFire 5249EVB.
        m68knommu: add a defconfig for the ColdFire M5272C3 board
        m68knommu: update the defconfig for the ColdFire 5208evb board
        m68knommu: fix DMA support for ColdFire
        m68knommu: remove unused kernel stats offsets
        m68knommu: fix missing .data.cacheline_aligned section
        m68knommu: Fixed GPIO pin initialization for CONFIG_M5271 FEC.
      9fe9293d
    • L
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · a4277bf1
      Linus Torvalds 提交于
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: Fix potential inode allocation soft lockup in Orlov allocator
        ext4: Make the extent validity check more paranoid
        jbd: use SWRITE_SYNC_PLUG when writing synchronous revoke records
        jbd2: use SWRITE_SYNC_PLUG when writing synchronous revoke records
        ext4: really print the find_group_flex fallback warning only once
      a4277bf1