eeh_clear Kernel Service

Purpose

This service unregisters a slot for an EEH function and removes resources allocated by the eeh_init or eeh_init_multifunc kernel service.

Syntax

#include <sys/eeh.h>

void eeh_clear(handle)
eeh_handle_t handle;

Parameters

Item Description
handle EEH handle obtained from theeeh_init or eeh_init_multifunc kernel services

Description

Single-function Drivers: This service disables EEH function on the slot and frees its eeh_handle.

Multifunction Drivers: For a multifunction adapter driver, this service removes the driver from a list of registered drivers under the same parent bus. This service also disables EEH function on the slot if this is the last driver to unregister and the state of the slot is NORMAL.

All device drivers are required to call eeh_clear before being removed from the system, so that there are no hot plug conflicts. A subsequent adapter might fail in eeh_init_multifunc() on the slot if the eeh_clear kernel service has not cleared the prior device drivers on that slot. A driver can unregister at unconfigure/unload time. The kernel checks the state of the slot when this service is called. If the slot state is neither NORMAL nor DEAD, eeh_clear sleeps until the state returns to one of them.

The macro EEH_CLEAR(handle) is provided for device drivers to call this service. This service is called by a function pointer in the EEH handle.

Execution Environment

This kernel service can only be called from the process environment.

Return Values

This service has no return values.