EEH user message broadcast

This topic describes the process of coordinating multiple functions in a device by using the kernel services. The user-state and user messages are defined by the caller of these services and the user messages are required to handle all serialization when using these services.

User-state

The Extending Enhanced I/O Error Handling (EEH) framework maintains a user-state that is managed by the participating device drivers in the EEH-shared domain. User-state is defined as a 32-bit field per domain. User-state is initialized to 0 when the domain is first created on the first eeh_init_multifunc() service call for that domain. The bits in the user-state field have no predefined meaning. Their meaning is determined by the participating device drivers. The field might be treated as a bit field or as an unsigned long value. A START bit field message can be defined as 0x010 and the STOP bit field message can be defined as 0x001. An unsigned long value can set START bit field message as 7225 and the STOP bit field message as 7224. The device drivers define and coordinate these states.

User messages

The device drivers define up to 32 user messages. Each message consumes one bit in the 32-bit message field. Only one message is broadcast at a time. All device drivers, including the EEH_INITIATOR driver are called for the message before moving on to the next message. The messages are sent from the leftmost bit to the rightmost bit without any priority. Before starting to broadcast the message, the bit for that message is cleared. This allows the same message to be queued again. If you queue a message more than once before the message is broadcast, it results in only one broadcast for the message. The messages are sent at an INTIODONE priority.

The messages are initialized to 0 when the domain is first created. The bits in the user message field have no predefined meaning. Their meanings are determined by the participating device drivers. The field might be treated only as a bit-field, where, each bit corresponds to a message.

User message session

An user message session is the time between a function call to the eeh_set_and_broadcast_user_state() service, making it the EEH_INITIATOR function, to the time it calls the eeh_clear_user_session() service. During a single session, only the EEH_INITIATOR driver is allowed to call the eeh_set_and_broadcast_user_state() service. The calls to the eeh_set_and_broadcast_user_state() service by the non-EEH_INITIATOR driver return a kerrno based on the EBUSY. The session ends when the EEH_INITIATOR driver calls the eeh_clear_user_session() service, at which point the next function to call the eeh_set_and_broadcast_user_state() service starts the next session and becomes the new EEH_INITIATOR. All the EEH_INITIATOR driver are required to call the eeh_clear_user_session() service to complete their sessions.

The sessions also ends when an EEH event occurs, which clears any pending messages and clears the identity of the EEH_INITIATOR function.

When the eeh_callback service is called for a broadcast, the flags field in the callback message includes an EEH_INITIATOR flag for the EEH_INITIATOR driver , which is the last to receive the message.

It is highly recommended that the EEH_INITIATOR driver calls the eeh_clear_user_session() service before calling the EEH_CLEAR service. If the EEH_INITIATIOR function calls to EEH_CLEAR driver without ending the session, the EEH_CLEAR driver ends the session.

Note: The EEH_INITIATOR driver is defined in the eeh.h file.

Managing the user-state and messages using kernel services

The following new services are created to manage the user messaging framework. These services and their flags are defined in the eeh.h file.