Re: [PATCH 07/10] vfio: ccw: Introduce the INIT event

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 19 Apr 2018 16:48:10 +0200
Pierre Morel <pmorel@xxxxxxxxxxxxxxxxxx> wrote:

> The VFIO_CCW_EVENT_INIT event allows to export the initial state
> into the FSM.

I don't know, that feels a bit unintuitive to me. I would naively
expect initialization to be done _before_ we activate processing via
the state machine.

> 
> Signed-off-by: Pierre Morel <pmorel@xxxxxxxxxxxxxxxxxx>
> ---
>  drivers/s390/cio/vfio_ccw_drv.c     | 26 +++++++++++---------------
>  drivers/s390/cio/vfio_ccw_fsm.c     | 21 +++++++++++++++++++++
>  drivers/s390/cio/vfio_ccw_ops.c     | 11 -----------
>  drivers/s390/cio/vfio_ccw_private.h |  1 +
>  4 files changed, 33 insertions(+), 26 deletions(-)

>  /*
>   * Device statemachine
>   */
>  fsm_func_t *vfio_ccw_jumptable[NR_VFIO_CCW_STATES][NR_VFIO_CCW_EVENTS] = {
>  	[VFIO_CCW_STATE_NOT_OPER] = {
> +		[VFIO_CCW_EVENT_INIT]		= fsm_init,
>  		[VFIO_CCW_EVENT_NOT_OPER]	= fsm_nop,
>  		[VFIO_CCW_EVENT_SSCH_REQ]	= fsm_io_error,
>  		[VFIO_CCW_EVENT_INTERRUPT]	= fsm_disabled_irq,
>  		[VFIO_CCW_EVENT_SCH_EVENT]	= fsm_nop,
>  	},
>  	[VFIO_CCW_STATE_STANDBY] = {
> +		[VFIO_CCW_EVENT_INIT]		= fsm_nop,
>  		[VFIO_CCW_EVENT_NOT_OPER]	= fsm_notoper,
>  		[VFIO_CCW_EVENT_SSCH_REQ]	= fsm_io_error,
>  		[VFIO_CCW_EVENT_INTERRUPT]	= fsm_irq,
>  		[VFIO_CCW_EVENT_SCH_EVENT]	= fsm_sch_event,
>  	},
>  	[VFIO_CCW_STATE_IDLE] = {
> +		[VFIO_CCW_EVENT_INIT]		= fsm_nop,
>  		[VFIO_CCW_EVENT_NOT_OPER]	= fsm_notoper,
>  		[VFIO_CCW_EVENT_SSCH_REQ]	= fsm_io_request,
>  		[VFIO_CCW_EVENT_INTERRUPT]	= fsm_irq,
>  		[VFIO_CCW_EVENT_SCH_EVENT]	= fsm_sch_event,
>  	},
>  	[VFIO_CCW_STATE_BOXED] = {
> +		[VFIO_CCW_EVENT_INIT]		= fsm_nop,
>  		[VFIO_CCW_EVENT_NOT_OPER]	= fsm_notoper,
>  		[VFIO_CCW_EVENT_SSCH_REQ]	= fsm_io_busy,
>  		[VFIO_CCW_EVENT_INTERRUPT]	= fsm_irq,
>  		[VFIO_CCW_EVENT_SCH_EVENT]	= fsm_sch_event,
>  	},
>  	[VFIO_CCW_STATE_BUSY] = {
> +		[VFIO_CCW_EVENT_INIT]		= fsm_nop,
>  		[VFIO_CCW_EVENT_NOT_OPER]	= fsm_notoper,
>  		[VFIO_CCW_EVENT_SSCH_REQ]	= fsm_io_busy,
>  		[VFIO_CCW_EVENT_INTERRUPT]	= fsm_irq,

...especially as you only call it if in the NOT_OPER state. Why should
this event be generated in any case but in the very beginning?
--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux