'\" t .\" Title: blk_pre_runtime_suspend .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: July 2017 .\" Manual: Block Devices .\" Source: Kernel Hackers Manual 4.11.6 .\" Language: English .\" .TH "BLK_PRE_RUNTIME_SUSP" "9" "July 2017" "Kernel Hackers Manual 4\&.11\&" "Block Devices" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" blk_pre_runtime_suspend \- Pre runtime suspend check .SH "SYNOPSIS" .HP \w'int\ blk_pre_runtime_suspend('u .BI "int blk_pre_runtime_suspend(struct\ request_queue\ *\ " "q" ");" .SH "ARGUMENTS" .PP \fIstruct request_queue * q\fR .RS 4 the queue of the device .RE .SH "DESCRIPTION" .PP This function will check if runtime suspend is allowed for the device by examining if there are any requests pending in the queue\&. If there are requests pending, the device can not be runtime suspended; otherwise, the queue\*(Aqs status will be updated to SUSPENDING and the driver can proceed to suspend the device\&. .PP For the not allowed case, we mark last busy for the device so that runtime PM core will try to autosuspend it some time later\&. .PP This function should be called near the start of the device\*(Aqs runtime_suspend callback\&. .SH "RETURN" .PP 0 \- OK to runtime suspend the device \-EBUSY \- Device should not be runtime suspended .SH "COPYRIGHT" .br