1. 06 9月, 2010 1 次提交
  2. 11 8月, 2010 1 次提交
    • H
      scsi/sd.c: quiet all sparse noise · 439d77f7
      H Hartley Sweeten 提交于
      In sd_store_cache_type the symbol 'len' is declared twice.  Remove the
      second declaration to quiet the following sparse warning.
      
      warning: symbol 'len' shadows an earlier one
      
      In sd_probe the variable 'index' is declared as a u32.  This variable is
      used in a call to ida_get_new which is expecting an int *.  Make the
      variable an int to quiet the following sparse warning.
      
      warning: incorrect type in argument 2 (different signedness)
      
      There are 4 symbols in the file that are not exported and produce
      the following sparse warnings.
      
      warning: symbol 'sd_cdb_cache' was not declared. Should it be static?
      warning: symbol 'sd_cdb_pool' was not declared. Should it be static?
      warning: symbol 'sd_read_protection_type' was not declared. Should it be static?
      warning: symbol 'sd_read_app_tag_own' was not declared. Should it be static?
      
      Make them static to quiet the warnings.
      Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
      Cc: James E.J. Bottomley <James.Bottomley@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      439d77f7
  3. 08 8月, 2010 13 次提交
  4. 28 7月, 2010 1 次提交
    • A
      [SCSI] sd: add support for runtime PM · 478a8a05
      Alan Stern 提交于
      This patch (as1399) adds runtime-PM support to the sd driver.  The
      support is unsophisticated: If a SCSI disk device is mounted, or if
      its device file is held open, then the device will not be
      runtime-suspended; otherwise it will (provided userspace gives
      permission by writing "auto" to the sysfs power/control attribute).
      
      In order to make this work, a dev_set_drvdata() call had to be moved
      from sd_probe_async() to sd_probe().  Also, a few lines of code were
      changed to use a local variable instead of recalculating the address
      of an embedded struct device.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      478a8a05
  5. 03 6月, 2010 1 次提交
  6. 06 5月, 2010 1 次提交
  7. 12 4月, 2010 2 次提交
  8. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  9. 16 3月, 2010 1 次提交
  10. 03 3月, 2010 1 次提交
  11. 20 2月, 2010 1 次提交
  12. 09 2月, 2010 2 次提交
  13. 19 1月, 2010 1 次提交
  14. 10 12月, 2009 1 次提交
  15. 02 10月, 2009 2 次提交
  16. 22 9月, 2009 1 次提交
  17. 12 9月, 2009 1 次提交
    • J
      [SCSI] fix oops during scsi scanning · ea038f63
      James Bottomley 提交于
      Chris Webb reported:
        p0# uname -a
        Linux f7ea8425-d45b-490f-a738-d181d0df6963.host.elastichosts.com 2.6.30.4-elastic-lon-p #2 SMP PREEMPT Thu Aug 20 14:30:50 BST 2009 x86_64 Intel(R) Xeon(R) CPU E5420 @ 2.50GHz GenuineIntel GNU/Linux
        p0# zgrep SCAN_ASYNC /proc/config.gz
        # CONFIG_SCSI_SCAN_ASYNC is not set
      
        p0# cat /var/log/kern/2009-08-20
        [...]
        15:27:10.485 kernel: scsi9 : iSCSI Initiator over TCP/IP
        15:27:11.493 kernel: scsi 9:0:0:0: RAID              IET      Controller       0001 PQ: 0 ANSI: 5
        15:27:11.493 kernel: scsi 9:0:0:0: Attached scsi generic sg6 type 12
        15:27:11.495 kernel: scsi 9:0:0:1: Direct-Access     IET      VIRTUAL-DISK     0001 PQ: 0 ANSI: 5
        15:27:11.495 kernel: sd 9:0:0:1: Attached scsi generic sg7 type 0
        15:27:11.495 kernel: sd 9:0:0:1: [sdg] 4194304 512-byte hardware sectors: (2.14 GB/2.00 GiB)
        15:27:11.495 kernel: sd 9:0:0:1: [sdg] Write Protect is off
        15:27:11.495 kernel: sd 9:0:0:1: [sdg] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
        15:27:13.012 kernel: sdg:<6>scsi 9:0:0:1: [sdg] Unhandled error code
        15:27:13.012 kernel: scsi 9:0:0:1: [sdg] Result: hostbyte=0x07 driverbyte=0x00
        15:27:13.012 kernel: end_request: I/O error, dev sdg, sector 0
        15:27:13.012 kernel: Buffer I/O error on device sdg, logical block 0
        15:27:13.012 kernel: ldm_validate_partition_table(): Disk read failed.
        15:27:13.012 kernel: unable to read partition table
        15:27:13.014 kernel: BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
        15:27:13.014 kernel: IP: [<ffffffff803f0d77>] disk_part_iter_next+0x74/0xfd
        15:27:13.014 kernel: PGD 82ad0b067 PUD 82cd7e067 PMD 0 
        15:27:13.014 kernel: Oops: 0000 [#1] PREEMPT SMP 
        15:27:13.014 kernel: last sysfs file: /sys/devices/platform/host9/session4/iscsi_session/session4/ifacename
        15:27:13.014 kernel: CPU 5 
        15:27:13.014 kernel: Modules linked in:
        15:27:13.014 kernel: Pid: 13999, comm: async/0 Not tainted 2.6.30.4-elastic-lon-p #2 X7DBN
        15:27:13.014 kernel: RIP: 0010:[<ffffffff803f0d77>]  [<ffffffff803f0d77>] disk_part_iter_next+0x74/0xfd
        15:27:13.014 kernel: RSP: 0018:ffff88066afa3dd0  EFLAGS: 00010246
        15:27:13.014 kernel: RAX: ffff88082b58a000 RBX: ffff88066afa3e00 RCX: 0000000000000000
        15:27:13.014 kernel: RDX: 0000000000000000 RSI: ffff88082b58a000 RDI: 0000000000000000
        15:27:13.014 kernel: RBP: ffff88066afa3df0 R08: ffff88066afa2000 R09: ffff8806a204f000
        15:27:13.014 kernel: R10: 000000fb12c7d274 R11: ffff8806c2bf0628 R12: ffff88066afa3e00
        15:27:13.014 kernel: R13: ffff88082c829a00 R14: 0000000000000000 R15: ffff8806bc50c920
        15:27:13.014 kernel: FS:  0000000000000000(0000) GS:ffff88002818a000(0000) knlGS:0000000000000000
        15:27:13.014 kernel: CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
        15:27:13.014 kernel: CR2: 0000000000000010 CR3: 000000082ade3000 CR4: 00000000000426e0
        15:27:13.014 kernel: DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
        15:27:13.014 kernel: DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
        15:27:13.014 kernel: Process async/0 (pid: 13999, threadinfo ffff88066afa2000, task ffff8806c2bf05e0)
        15:27:13.014 kernel: Stack:
        15:27:13.014 kernel: 0000000000000000 ffff88066afa3e00 ffff88066afa3e00 ffff88082c829a00
        15:27:13.014 kernel: ffff88066afa3e40 ffffffff80306feb ffff88082b58a000 0000000000000000
        15:27:13.014 kernel: 0000000000000001 ffff8806bc50c920 ffff88066afa3e40 ffff88082b58a000
        15:27:13.014 kernel: Call Trace:
        15:27:13.014 kernel: [<ffffffff80306feb>] register_disk+0x122/0x13a
        15:27:13.014 kernel: [<ffffffff803f0b0f>] add_disk+0xaa/0x106
        15:27:13.014 kernel: [<ffffffff80493609>] sd_probe_async+0x198/0x25b
        15:27:13.014 kernel: [<ffffffff80270482>] async_thread+0x10c/0x20d
        15:27:13.014 kernel: [<ffffffff802545ff>] ? default_wake_function+0x0/0xf
        15:27:13.014 kernel: [<ffffffff80270376>] ? async_thread+0x0/0x20d
        15:27:13.014 kernel: [<ffffffff8026ad89>] kthread+0x55/0x80
        15:27:13.014 kernel: [<ffffffff8022be6a>] child_rip+0xa/0x20
        15:27:13.014 kernel: [<ffffffff8026ad34>] ? kthread+0x0/0x80
        15:27:13.014 kernel: [<ffffffff8022be60>] ? child_rip+0x0/0x20
        15:27:13.014 kernel: Code: c8 ff 80 e1 0c b9 00 00 00 00 0f 44 c1 41 83 cd ff 48 8d 7a 20 48 be ff ff ff ff 08 00 00 00 48 b9 00 00 00 00 08 00 00 00 eb 50 <8b> 42 10 41 bd 01 00 00 00 eb db 4c 63 c2 4e 8d 04 c7 4d 8b 20 
        15:27:13.015 kernel: RIP  [<ffffffff803f0d77>] disk_part_iter_next+0x74/0xfd
        15:27:13.015 kernel: RSP <ffff88066afa3dd0>
        15:27:13.015 kernel: CR2: 0000000000000010
        15:27:13.015 kernel: ---[ end trace 6104b56ef5590e25 ]---
      
      The problem is caused because the async scanning split in sd.c doesn't hold
      any reference to the device when it kicks off the async piece.  What's
      happening is that an iSCSI disconnect is destorying the device again *before*
      the async sd scanning thread even starts.  Fix this by taking a reference
      before starting the thread and dropping it again when the thread completes.
      Reported-by: NChris Webb <chris@arachsys.com>
      Cc: Stable Tree <stable@kernel.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      ea038f63
  18. 31 7月, 2009 1 次提交
  19. 22 6月, 2009 1 次提交
  20. 21 6月, 2009 3 次提交
  21. 09 6月, 2009 1 次提交
  22. 23 5月, 2009 1 次提交
  23. 11 5月, 2009 1 次提交
    • T
      block: convert to pos and nr_sectors accessors · 83096ebf
      Tejun Heo 提交于
      With recent cleanups, there is no place where low level driver
      directly manipulates request fields.  This means that the 'hard'
      request fields always equal the !hard fields.  Convert all
      rq->sectors, nr_sectors and current_nr_sectors references to
      accessors.
      
      While at it, drop superflous blk_rq_pos() < 0 test in swim.c.
      
      [ Impact: use pos and nr_sectors accessors ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
      Tested-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NGrant Likely <grant.likely@secretlab.ca>
      Tested-by: NAdrian McMenamin <adrian@mcmen.demon.co.uk>
      Acked-by: NAdrian McMenamin <adrian@mcmen.demon.co.uk>
      Acked-by: NMike Miller <mike.miller@hp.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Cc: Borislav Petkov <petkovbb@googlemail.com>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Eric Moore <Eric.Moore@lsi.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Pete Zaitcev <zaitcev@redhat.com>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Paul Clements <paul.clements@steeleye.com>
      Cc: Tim Waugh <tim@cyberelk.net>
      Cc: Jeff Garzik <jgarzik@pobox.com>
      Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
      Cc: Alex Dubov <oakad@yahoo.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Dario Ballabio <ballabio_dario@emc.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: unsik Kim <donari75@gmail.com>
      Cc: Laurent Vivier <Laurent@lvivier.info>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      83096ebf