---
name: "blk_pre_runtime_suspend"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/blk_pre_runtime_suspend"
---

# blk\_pre\_runtime\_suspend(9)

Pre runtime suspend check

## NAME

blk\_pre\_runtime\_suspend - Pre runtime suspend check

## SYNOPSIS

**int blk\_pre\_runtime\_suspend(struct request\_queue \*** *q***);**

## ARGUMENTS

*q*

the queue of the device

## DESCRIPTION

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's status will be updated to SUSPENDING and the driver can proceed to suspend the device.

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.

This function should be called near the start of the device's runtime\_suspend callback.

## RETURN

0 - OK to runtime suspend the device -EBUSY - Device should not be runtime suspended

## COPYRIGHT
