1. 16 1月, 2012 1 次提交
    • J
      [SCSI] scsi_transport_fc: Clear Devloss Callback Done flag in fc_remote_port_rolechg · 0eecee41
      James Smart 提交于
      This patch fixes a bug where devloss is not called on fc_host teardown.
      The issue is seen if the LLDD uses rport_rolechg to add the target role
      to an rport.
      
      When an rport goes away, the LLDD will call fc_remote_port_delete, which
      will start the devloss timer.  If the timer expires, the transport will
      call the devloss callback and set the FC_RPORT_DEVLOSS_CALLBK_DONE flag.
      However, the rport structure is not deleted, it is retained to store the
      SCSI id mappings for the rport in case it comes back. In the scenario
      where it does come back, and the driver calls fc_remote_port_add, but does
      not indicate the "target" role for the rport - the create will clear the
      structure, but forgets to clear FC_RPORT_DEVLOSS_CALLBK_DONE flag (which
      is cleared if it's added with the target role). The secondary call, of
      fc_remote_port_rolechg to add the target role also does not clear the flag.
      Thus, the next time the rport goes away, the resulting devloss timer
      expiration will not call the driver callback as the flag is still set.
      
      This patch adds the FC_RPORT_DEVLOSS_CALLBK_DONE flags to the list of
      those that are cleared upon reuse of the rport structure.
      Signed-off-by: NAlex Iannicelli <alex.iannicelli@emulex.com>
      Signed-off-by: NJames Smart <james.smart@emulex.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      0eecee41
  2. 11 1月, 2012 13 次提交
  3. 09 1月, 2012 5 次提交
    • L
      [SCSI] runtime resume parent for child's system-resume · 28fd00d4
      Lin Ming 提交于
      [Patch description from Alan Stern]
      
      If a child device was runtime-suspended when a system suspend began,
      then there will be nothing to prevent its parent from
      runtime-suspending as soon as it is woken up during the system resume.
      Then when the time comes to resume the child, the resume will fail
      because the parent is already back at low power.
      
      On the other hand, there are some devices which should remain at low
      power across an entire suspend-resume cycle.  The details depend on the
      device and the platform.
      
      This suggests that the PM core is not the right place to solve the
      problem. One possible solution is for the subsystem or device driver
      to call pm_runtime_get_sync(dev->parent) at the start of the
      system-resume procedure and pm_runtime_put_sync(dev->parent) at the
      end.
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NLin Ming <ming.m.lin@intel.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      28fd00d4
    • L
      [SCSI] sd: check runtime PM status in sd_shutdown · 54f57588
      Lin Ming 提交于
      sd_shutdown is called during reboot/poweroff.
      It may fail if parent device, for example, ata port, was runtime suspended.
      
      Fix it by checking runtime PM status of sd.
      Exit immediately if sd was runtime suspended already.
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NLin Ming <ming.m.lin@intel.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      54f57588
    • L
      [SCSI] check runtime PM status in system PM · 28640516
      Lin Ming 提交于
      The only high-level SCSI driver that currently implements runtime PM is
      sd, and sd treats runtime suspend exactly the same as the SUSPEND and
      HIBERNATE stages of system sleep, but not the same as the FREEZE stage.
      
      Therefore, when entering the SUSPEND or HIBERNATE stages of system
      sleep, we can skip the callback to the driver if the device is already
      in runtime suspend.  When entering the FREEZE stage, however, we should
      first issue a runtime resume.  The overhead of doing this is
      negligible, because a suspended drive would be spun up during the THAW
      stage of hibernation anyway.
      Signed-off-by: NLin Ming <ming.m.lin@intel.com>
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      28640516
    • L
      [SCSI] add flag to skip the runtime PM calls on the host · ae0751ff
      Lin Ming 提交于
      With previous change, now the ata port runtime suspend will happen as:
      
      disk suspend --> scsi target suspend --> scsi host suspend --> ata port
      suspend
      
      ata port(parent device) suspend need to schedule scsi EH which will resume
      scsi host(child device). Then the child device resume will in turn make
      parent device resume first. This is kind of recursive.
      
      This patch adds a new flag Scsi_Host::eh_noresume.
      ata port will set this flag to skip the runtime PM calls on scsi host.
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NLin Ming <ming.m.lin@intel.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      ae0751ff
    • J
      drivers/scsi/aacraid/commctrl.c: fix mem leak in aac_send_raw_srb() · 7dd72f51
      Jesper Juhl 提交于
      We leak in drivers/scsi/aacraid/commctrl.c::aac_send_raw_srb() :
      
      We allocate memory:
      
      	...
      	struct user_sgmap* usg;
      	usg = kmalloc(actual_fibsize - sizeof(struct aac_srb)
      	  + sizeof(struct sgmap), GFP_KERNEL);
      
      and then neglect to free it:
      
      	...
      	for (i = 0; i < usg->count; i++) {
      		u64 addr;
      		void* p;
      		if (usg->sg[i].count >
      		    ((dev->adapter_info.options &
      		     AAC_OPT_NEW_COMM) ?
      		      (dev->scsi_host_ptr->max_sectors << 9) :
      		      65536)) {
      			rcode = -EINVAL;
      			goto cleanup;
      	... this 'goto' makes 'usg' go out of scope and leak the memory we
      	    allocated.
      
      Other exits properly kfree(usg), it's just here it is neglected.
      Signed-off-by: NJesper Juhl <jj@chaosbits.net>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7dd72f51
  4. 04 1月, 2012 4 次提交
  5. 02 1月, 2012 1 次提交
  6. 15 12月, 2011 16 次提交