1. 16 9月, 2009 2 次提交
    • G
      Driver core: move dev_get/set_drvdata to drivers/base/dd.c · b4028437
      Greg Kroah-Hartman 提交于
      No one should directly access the driver_data field, so remove the field
      and make it private.  We dynamically create the private field now if it
      is needed, to handle drivers that call get/set before they are
      registered with the driver core.
      
      Also update the copyright notices on these files while we are there.
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b4028437
    • A
      Driver core: add new device to bus's list before probing · 2023c610
      Alan Stern 提交于
      This patch (as1271) affects when new devices get linked into their
      bus's list of devices.  Currently this happens after probing, and it
      doesn't happen at all if probing fails.  Clearly this is wrong,
      because at that point quite a few symbolic links have already been
      created in sysfs.  We are committed to adding the device, so it should
      be linked into the bus's list regardless.
      
      In addition, this needs to happen before the uevent announcing the new
      device gets issued.  Otherwise user programs might try to access the
      device before it has been added to the bus.
      
      To fix both these problems, the patch moves the call to
      klist_add_tail() forward from bus_attach_device() to bus_add_device().
      Since bus_attach_device() now does nothing but probe for drivers, it
      has been renamed to bus_probe_device().  And lastly, the kerneldoc is
      updated.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      
      
      2023c610
  2. 15 9月, 2009 20 次提交
  3. 14 9月, 2009 8 次提交
  4. 12 9月, 2009 10 次提交
    • 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
    • B
      [SCSI] libsrp: fix memory leak in srp_ring_free() · afffd3da
      Bart Van Assche 提交于
      This patch fixes a memory leak in the libsrp function srp_ring_free().
      It is not documented whether or not this function should free the ring
      pointer itself. But the source code of the callers of this function
      (srp_target_alloc() and srp_target_free()) makes it clear that
      srp_ring_free() should deallocate the ring pointer itself. Furthermore,
      the patch below makes srp_ring_free() deallocate all memory allocated by
      srp_ring_alloc().
      
      This patch affects the ibmvstgt driver, which is the only in-tree driver
      that calls the srp_ring_free() function (indirectly).
      Signed-off-by: NBart Van Assche <bart.vanassche@gmail.com>
      Acked-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Stable Tree <stable@kernel.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      afffd3da
    • M
      [SCSI] libiscsi, bnx2i: make bound ep check common · 661134ad
      Mike Christie 提交于
      bnx2i currently has a check for if a ep is properly bound, so if
      iscsi_queuecommand/xmit_task is called while there is no ep
      we will not queue IO.
      
      be2iscsi sends IO from queuecommand/xmit_task like how bnx2i does
      and needs a similar test. This patch has us just use the suspend_bit
      test for this.
      
      When ep_poll has succeeed iscsid will call conn_bind, the LLD will
      then call iscsi_conn_bind which will clear the suspend bit.
      When ep_disconnect is called (or if there is a conn error) we set
      the suspend bit. For the ep_disconnect case I am adding a helper
      in this patch that will take the session lock to make sure
      iscsi_queuecommand/xmit_task is not running and it will set
      the suspend bit.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJayamohan Kallickal <jayamohank@serverengines.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      661134ad
    • M
      [SCSI] libiscsi: add completion function for drivers that do not need pdu processing · 4c0ba5d2
      Mike Christie 提交于
      beiscsi does not need the iscsi scsi cmd processing. It does not
      even get this info on the completion path. This adds a function
      to just update the sequencing numbers and complete a task.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJayamohan Kallickal <jayamohank@serverengines.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      4c0ba5d2
    • M
      [SCSI] scsi_dh_rdac: changes for rdac debug logging · dd784edc
      Moger, Babu 提交于
      Patch to add debugging stuff for rdac device handler.
      - Added a bit mask "module parameter" rdac_logging with 2 bits for each type
        of logging.
      - currently defined only two types of logging(failover and sense logging). Can
        be enhanced later if required.
      - By default only failover logging is enabled which is equivalent of current
        logging.
      Signed-off-by: NBabu Moger <babu.moger@lsi.com>
      Reviewed-by: NVijay Chauhan <vijay.chauhan@lsi.com>
      Reviewed-by: NBob Stankey <Robert.stankey@lsi.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      dd784edc
    • M
      [SCSI] scsi_dh_rdac: changes to collect the rdac debug information during the initialization · 1527666e
      Moger, Babu 提交于
      Adding the code to read the debug information during initialization. This
      patch collects the information about storage and controllers during
      rdac_activate.
      Signed-off-by: NBabu Moger <babu.moger@lsi.com>
      Reviewed-by: NVijay Chauhan <vijay.chauhan@lsi.com>
      Reviewed-by: NBob Stankey <Robert.stankey@lsi.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      1527666e
    • M
      [SCSI] scsi_dh_rdac: move the init code from rdac_activate to rdac_bus_attach · 87b79a53
      Moger, Babu 提交于
      Moving the initialization code from rdac_activate to rdac_bus_attach which is
      more efficient.  We don't have to collect all the information during every
      activate.
      Signed-off-by: NBabu Moger <babu.moger@lsi.com>
      Reviewed-by: NVijay Chauhan <vijay.chauhan@lsi.com>
      Reviewed-by: NBob Stankey <Robert.stankey@lsi.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      87b79a53
    • M
      [SCSI] sg: fix oops in the error path in sg_build_indirect() · e71044ee
      Michal Schmidt 提交于
      When the allocation fails in sg_build_indirect(), an oops happens in
      the error path. It's caused by an obvious typo.
      Signed-off-by: NMichal Schmidt <mschmidt@redhat.com>
      Reported-by: NBob Tracy <rct@gherkin.frus.com>
      Acked-by: NDouglas Gilbert <dgilbert@interlog.com>
      Cc: Stable Tree <stable@kernel.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      e71044ee
    • K
      [SCSI] mptsas : Bump version to 3.04.12 · b437b956
      Kashyap, Desai 提交于
      Bump version to 3.04.12
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      b437b956
    • K
      [SCSI] mptsas : FW event thread and scsi mid layer deadlock in SYNCHRONIZE CACHE command · 9766096d
      Kashyap, Desai 提交于
      Normally In HBA reset path MPT driver will flush existing work in current work
      queue (mpt/0) . This is just a dummy activity for MPT driver point of
      view, since HBA reset will turn off Work queue events.
      
      It means we will simply returns from work queue without doing anything.
      But for the case where Work is already done (half the way), we have to have
      that work to be done.
      
      Considering above condition we stuck forever since Deadlock in scsi midlayer
      and MPT driver. sd_sync_cache() will wait forever since HBA is not in
      Running state, and it will never come into Running state since
      sd_sync_cache() is called from HBA reset context.
      Now new code will not wait for half cooked work to be finished
      before returning from HBA reset.
      
      Once we are out of HBA reset, EH thread will change host state to running from
      recovery and work waiting for running state of HBA will be finished.
      New code is turning ON firmware event from another special work called
      Rescan toplogy.
      Signed-off-by: NKashyap Desai <kashyap.desai@lsi.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      9766096d