<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/scsi/scsi_pm.c, branch linux-3.8.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.8.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.8.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2012-11-30T09:26:48Z</updated>
<entry>
<title>[SCSI] scsi_pm: use callbacks from dev_pm_ops for scsi devices</title>
<updated>2012-11-30T09:26:48Z</updated>
<author>
<name>Aaron Lu</name>
</author>
<published>2012-11-09T07:27:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=80d2fd48cca2a0de806c3130551744a04ad5b80b'/>
<id>urn:sha1:80d2fd48cca2a0de806c3130551744a04ad5b80b</id>
<content type='text'>
Use of pm_message_t is deprecated and device driver is not supposed
to use that. This patch migrates the SCSI bus level pm callbacks
to call device's pm callbacks defined in its driver's dev_pm_ops.

This is achieved by finding out which device pm callback should be used
in bus callback function, and then pass that callback function pointer
as a param to the scsi_bus_{suspend,resume}_common routine, which will
further pass that callback to scsi_dev_type_{suspend,resume} after
proper handling.

The special case for freeze in scsi_bus_suspend_common is not necessary
since there is no high level SCSI driver has implemented freeze, so no
need to runtime resume the device if it is in runtime suspended state
for system freeze, just return like the system suspend/hibernate case.

Since only sd has implemented drv-&gt;suspend/drv-&gt;resume, and I'll update
sd driver to use the new callbacks in the following patch, there is no
need to fallback to call drv-&gt;suspend/drv-&gt;resume if dev_pm_ops is NULL.

Signed-off-by: Aaron Lu &lt;aaron.lu@intel.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Acked-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</content>
</entry>
<entry>
<title>[SCSI] Revert "[SCSI] runtime resume parent for child's system-resume"</title>
<updated>2012-11-30T09:25:37Z</updated>
<author>
<name>Aaron Lu</name>
</author>
<published>2012-11-09T07:27:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9c31d8e1319e0d3f85673c7119a10700bf03f77a'/>
<id>urn:sha1:9c31d8e1319e0d3f85673c7119a10700bf03f77a</id>
<content type='text'>
This reverts commit 28fd00d42cca178638f51c08efa986a777c24a4b.

With commit 88d26136a256576e444db312179e17af6dd0ea87 (PM: Prevent
runtime suspend during system resume), this patch is no longer needed.

Signed-off-by: Aaron Lu &lt;aaron.lu@intel.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Acked-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</content>
</entry>
<entry>
<title>[SCSI] Revert "[SCSI] scsi_pm: set device runtime state before parent suspended"</title>
<updated>2012-11-30T09:24:43Z</updated>
<author>
<name>Aaron Lu</name>
</author>
<published>2012-11-09T07:27:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=63347905dbc105bf4921c5e24e128b5819b74c9f'/>
<id>urn:sha1:63347905dbc105bf4921c5e24e128b5819b74c9f</id>
<content type='text'>
This reverts commit 33a2285d96b5e7b9500612ec623bf4313397bb53.

With commit 88d26136a256576e444db312179e17af6dd0ea87 (PM: Prevent
runtime suspend during system resume), this patch is no longer needed.

Signed-off-by: Aaron Lu &lt;aaron.lu@intel.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Acked-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</content>
</entry>
<entry>
<title>[SCSI] scsi_pm: set device runtime state before parent suspended</title>
<updated>2012-07-20T07:58:55Z</updated>
<author>
<name>Lin Ming</name>
</author>
<published>2012-07-06T04:06:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=33a2285d96b5e7b9500612ec623bf4313397bb53'/>
<id>urn:sha1:33a2285d96b5e7b9500612ec623bf4313397bb53</id>
<content type='text'>
There is a race in scsi_bus_resume_common when set device's runtime
state to active after pm_runtime_put_sync(dev-&gt;parent).

Parent device may have been suspended so pm_runtime_set_active(dev) will
fail with -EBUSY.

Signed-off-by: Lin Ming &lt;ming.m.lin@intel.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</content>
</entry>
<entry>
<title>[SCSI] scsi_pm: resume device if suspend failed</title>
<updated>2012-05-22T10:09:50Z</updated>
<author>
<name>Aaron Lu</name>
</author>
<published>2012-05-15T06:43:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d20ec597cba1e8ea407c9a7c668a9e04fc057c83'/>
<id>urn:sha1:d20ec597cba1e8ea407c9a7c668a9e04fc057c83</id>
<content type='text'>
For scsi devices which use scsi bus runtime callback, runtime suspend
will call scsi_dev_type_suspend, and if the drv-&gt;suspend failed, the
device will still be in active state. But since scsi_device_quiesce is
called, the device will not be able to respond any more commands.
So add a check here to see if err occured, if so, bring the device back
to normal state with scsi_device_resume.

Signed-off-by: Aaron Lu &lt;aaron.lu@amd.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</content>
</entry>
<entry>
<title>[SCSI] sd: limit the scope of the async probe domain</title>
<updated>2012-05-17T08:10:46Z</updated>
<author>
<name>Dan Williams</name>
</author>
<published>2012-03-23T00:05:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a7a20d103994fd760766e6c9d494daa569cbfe06'/>
<id>urn:sha1:a7a20d103994fd760766e6c9d494daa569cbfe06</id>
<content type='text'>
sd injects and synchronizes probe work on the global kernel-wide domain.
This runs into conflict with PM that wants to perform resume actions in
async context:

[  494.237079] INFO: task kworker/u:3:554 blocked for more than 120 seconds.
[  494.294396] "echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  494.360809] kworker/u:3     D 0000000000000000     0   554      2 0x00000000
[  494.420739]  ffff88012e4d3af0 0000000000000046 ffff88013200c160 ffff88012e4d3fd8
[  494.484392]  ffff88012e4d3fd8 0000000000012500 ffff8801394ea0b0 ffff88013200c160
[  494.548038]  ffff88012e4d3ae0 00000000000001e3 ffffffff81a249e0 ffff8801321c5398
[  494.611685] Call Trace:
[  494.632649]  [&lt;ffffffff8149dd25&gt;] schedule+0x5a/0x5c
[  494.674687]  [&lt;ffffffff8104b968&gt;] async_synchronize_cookie_domain+0xb6/0x112
[  494.734177]  [&lt;ffffffff810461ff&gt;] ? __init_waitqueue_head+0x50/0x50
[  494.787134]  [&lt;ffffffff8131a224&gt;] ? scsi_remove_target+0x48/0x48
[  494.837900]  [&lt;ffffffff8104b9d9&gt;] async_synchronize_cookie+0x15/0x17
[  494.891567]  [&lt;ffffffff8104ba49&gt;] async_synchronize_full+0x54/0x70  &lt;-- here we wait for async contexts to complete
[  494.943783]  [&lt;ffffffff8104b9f5&gt;] ? async_synchronize_full_domain+0x1a/0x1a
[  495.002547]  [&lt;ffffffffa00114b1&gt;] sd_remove+0x2c/0xa2 [sd_mod]
[  495.051861]  [&lt;ffffffff812fe94f&gt;] __device_release_driver+0x86/0xcf
[  495.104807]  [&lt;ffffffff812fe9bd&gt;] device_release_driver+0x25/0x32  &lt;-- here we take device_lock()

[  853.511341] INFO: task kworker/u:4:549 blocked for more than 120 seconds.
[  853.568693] "echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  853.635119] kworker/u:4     D ffff88013097b5d0     0   549      2 0x00000000
[  853.695129]  ffff880132773c40 0000000000000046 ffff880130790000 ffff880132773fd8
[  853.758990]  ffff880132773fd8 0000000000012500 ffff88013288a0b0 ffff880130790000
[  853.822796]  0000000000000246 0000000000000040 ffff88013097b5c8 ffff880130790000
[  853.886633] Call Trace:
[  853.907631]  [&lt;ffffffff8149dd25&gt;] schedule+0x5a/0x5c
[  853.949670]  [&lt;ffffffff8149cc44&gt;] __mutex_lock_common+0x220/0x351
[  854.001225]  [&lt;ffffffff81304bd7&gt;] ? device_resume+0x58/0x1c4
[  854.049082]  [&lt;ffffffff81304bd7&gt;] ? device_resume+0x58/0x1c4
[  854.097011]  [&lt;ffffffff8149ce48&gt;] mutex_lock_nested+0x2f/0x36   &lt;-- here we wait for device_lock()
[  854.145591]  [&lt;ffffffff81304bd7&gt;] device_resume+0x58/0x1c4
[  854.192066]  [&lt;ffffffff81304d61&gt;] async_resume+0x1e/0x45
[  854.237019]  [&lt;ffffffff8104bc93&gt;] async_run_entry_fn+0xc6/0x173  &lt;-- ...while running in async context

Provide a 'scsi_sd_probe_domain' so that async probe actions actions can
be flushed without regard for the state of PM, and allow for the resume
path to handle devices that have transitioned from SDEV_QUIESCE to
SDEV_DEL prior to resume.

Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
[alan: uplevel scsi_sd_probe_domain, clarify scsi_device_resume]
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
[jejb: remove unneeded config guards in include file]
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</content>
</entry>
<entry>
<title>[SCSI] scsi_pm: Fix bug in the SCSI power management handler</title>
<updated>2012-02-18T14:54:19Z</updated>
<author>
<name>Alan Stern</name>
</author>
<published>2012-02-17T21:25:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fea6d607e154cf96ab22254ccb48addfd43d4cb5'/>
<id>urn:sha1:fea6d607e154cf96ab22254ccb48addfd43d4cb5</id>
<content type='text'>
This patch (as1520) fixes a bug in the SCSI layer's power management
implementation.

LUN scanning can be carried out asynchronously in do_scan_async(), and
sd uses an asynchronous thread for the time-consuming parts of disk
probing in sd_probe_async().  Currently nothing coordinates these
async threads with system sleep transitions; they can and do attempt
to continue scanning/probing SCSI devices even after the host adapter
has been suspended.  As one might expect, the outcome is not ideal.

This is what the "prepare" stage of system suspend was created for.
After the prepare callback has been called for a host, target, or
device, drivers are not allowed to register any children underneath
them.  Currently the SCSI prepare callback is not implemented; this
patch rectifies that omission.

For SCSI hosts, the prepare routine calls scsi_complete_async_scans()
to wait until async scanning is finished.  It might be slightly more
efficient to wait only until the host in question has been scanned,
but there's currently no way to do that.  Besides, during a sleep
transition we will ultimately have to wait until all the host scanning
has finished anyway.

For SCSI devices, the prepare routine calls async_synchronize_full()
to wait until sd probing is finished.  The routine does nothing for
SCSI targets, because asynchronous target scanning is done only as
part of host scanning.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
CC: &lt;stable@kernel.org&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</content>
</entry>
<entry>
<title>[SCSI] runtime resume parent for child's system-resume</title>
<updated>2012-01-09T00:14:59Z</updated>
<author>
<name>Lin Ming</name>
</author>
<published>2011-12-22T06:50:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=28fd00d42cca178638f51c08efa986a777c24a4b'/>
<id>urn:sha1:28fd00d42cca178638f51c08efa986a777c24a4b</id>
<content type='text'>
[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-&gt;parent) at the start of the
system-resume procedure and pm_runtime_put_sync(dev-&gt;parent) at the
end.

Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Lin Ming &lt;ming.m.lin@intel.com&gt;
Signed-off-by: Jeff Garzik &lt;jgarzik@redhat.com&gt;
</content>
</entry>
<entry>
<title>[SCSI] check runtime PM status in system PM</title>
<updated>2012-01-09T00:14:57Z</updated>
<author>
<name>Lin Ming</name>
</author>
<published>2011-12-05T01:20:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=286405167e815adc4ae0132214246a350b0208bc'/>
<id>urn:sha1:286405167e815adc4ae0132214246a350b0208bc</id>
<content type='text'>
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: Lin Ming &lt;ming.m.lin@intel.com&gt;
Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Jeff Garzik &lt;jgarzik@redhat.com&gt;
</content>
</entry>
<entry>
<title>scsi: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required</title>
<updated>2011-10-31T23:31:23Z</updated>
<author>
<name>Paul Gortmaker</name>
</author>
<published>2011-05-27T13:37:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=09703660edf83b8b6d175440bf745f30580d85ab'/>
<id>urn:sha1:09703660edf83b8b6d175440bf745f30580d85ab</id>
<content type='text'>
For the basic SCSI infrastructure files that are exporting symbols
but not modules themselves, add in the basic export.h header file
to allow the exports.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
</feed>
