Re: RESEND:i2c-eg20t: fix race between i2c init and interrupt enable

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

 





在 2016/9/17 4:04, Wolfram Sang 写道:
after testing last patch, replacing request_irq() location is not a
good idea,it might produce a little time windows ,in which the interrupts
occurring inside  will be omitted.

the new patch adds a check point on interrupt handler in case field
'pch_base_address' has not been initialed.
What about using two for-loops in probe like this pseudo code?

for (all_channels)
	do_initialization

request_irq()

for (all_channels)
	register_adapter


This seems to me the correct order and most readable solution.
if we use two for-loops, we would have to put pch_i2c_init on the second loop in order to avoid littel interval, in which the interrupts occuring inside will be omitted.
it seems to me so uncomfortable. how do you like it?

for (all_channels)
	do_initialization

request_irq()

for (all_channels) {
	 pch_i2c_init  /* Enable interrupts at end of function*/
	 register_adapter
}

Yadi

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux