1. 16 1月, 2012 6 次提交
  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 11 次提交