Re: Two separate i2c transfers

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

 



Hi Wolfram,

W dniu 15.05.2020 o 09:53, Wolfram Sang pisze:
>
> http://patchwork.ozlabs.org/project/linux-i2c/list/?series=95793
> 
> (Do you use this driver or a custom one?)

Unfortunatly not right now. For historical reasons we have a custom one but I would like to move to this upstream one in
near future.

> 
> I'd think that the PCA9641 driver should return -EBUSY if another master
> is active, so we'd have the lock on that level. But I may be totally
> missing some detail here.

That is a good point however right now the logic in i2c-mux.c is like this:

ret = muxc->select(muxc, priv->chan_id);
if (ret >= 0)
    ret = i2c_transfer(parent, msgs, num);
if (muxc->deselect)
	muxc->deselect(muxc, priv->chan_id);

So this does not really solve my problem - even if we do get the lock by calling select(), we will simply release it as
soon as our i2c_transfer() is finished (and will let the other master take it, breaking atomicity of the two operations
I need to perform on target device) and this is exactly what I need to avoid.

BTW the deselect is called regardless of the return code of select() - even if it returns an error. I'm not sure if this
might cause some problems (unbalanced numer of select/deselect operation) but I find it a little odd. Is this deliberate?

Best regards,
Krzysztof Adamski



[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