eeh_reset_slot Kernel Service

Purpose

This service activates, deactivates, or toggles the reset line of a PCI slot.

Syntax

#include <sys/eeh.h>

long eeh_reset_slot(handle, flag)
eeh_handle_t handle;
long flag;

Parameters

Item Description
handle EEH handle obtained from theeeh_init or eeh_init_multifunc kernel services
flag Flag can be either EEH_ACTIVE or EEH_DEACTIVE.

Description

Single-function Drivers: This service activates and deactivates the reset line between the Terminal Bridge and the adapter. The flag argument specifies whether to activate (EEH_ACTIVE) or deactivate (EEH_DEACTIVE) depending upon the required action. To do the reset of a slot, the reset line should be toggled by calling this service twice: once with EEH_ACTIVE followed by a second call with EEH_DEACTIVE. There should be a minimum of 100 milliseconds delay between the activation and deactivation of the signal. The minimum delay is specified by the PCI System Architecture and should be enforced by the single-function driver.

Multifunction Drivers: On a multifunction adapter, the EEH_MASTER for the slot drives error recovery. Therefore, only the EEH_MASTER can call this service. Unlike the single-function driver, the master calls this service only once with the EEH_ACTIVE flag.

For the multi-function drivers, the service first activates and then deactivates the reset signal on the slot. It enforces a 100–millisecond delay between the activation and deactivation as mandated by the PCI System Architecture. After the reset signal is deactivated, the service attempts to reconfigure the bridge on the adpater, if there is one (only applies to the bridged-adapters), after dd_trb_timer seconds specified in eeh_init_multifunc(). At the end of a successful reset and optional bridge recovery, an EEH_DD_RESUME message is broadcast to the slot's multifunction drivers notifying them to resume normal operation. If this service fails, the EEH_DD_DEAD message is broadcast. If failure is due to hardware or firmware, an error is logged.

EEH_SAFE mode: If an EEH_SAFE adapter calls this service, the reset signal is activated but is never deactivated, thereby leaving the adapter in a "permanently unavailable" state. Such an adapter becomes available again if either the PCI hot-plug operation is performed on it or if the partition is rebooted. This service returns EEH_FAIL for an EEH_SAFE driver.

The macro EEH_RESET_SLOT(handle, flag) is provided for device drivers to call this service.

Execution Environment

This kernel service can be called from the process or interrupt environment.

Return Values

Item Description
EEH_SUCC Slot reset activate/deactivate succeeded
EEH_FAIL Failed to activate/deactivate the reset line, nonmaster called the service, or EEH_SAFE mode is active
EEH_BUSY Recovery is already in progress