akira215 / RaspberryPi-w1_module

Works kernel module w1_therm
2 stars 2 forks source link

therm_bulk_read not working when other (non w1_therm) w1 devices are present #1

Open bublath opened 3 years ago

bublath commented 3 years ago

While testing multiple one-wire devices I detected the issue that echo trigger >therm_bulk_read that typically will take ~1 second (still don't understand why it can't do this asynchronously and return right away) will return immediately and not trigger conversions (cat w1_slave on any device takes ~1 second which with working bulk_read will returns instantly). I could reproduce this with both adding a DS2423 and a DS2438 device (single or both). Once the devices get removed it starts working again.

I'm using kernel 5.10.63-v7l+ on a fully updated Raspbian buster on a Raspberry Pi 4

akira215 commented 2 years ago

I assume that the bulk read command is colliding with other device activity. Sysfs could not be asynchronous, if required, you need to access direct register.

bublath commented 2 years ago

If it would collide with activity, it would probably sometimes work and sometimes not, wouldn't it? For me it is always failing, which makes me rather assume that bulk_read tries to access other devices than w1_therm and fails (since they don't support this).

As for asyncronous: My understanding of bulk_read is, that it puts a trigger and you then need to read therm_bulk_read to find out if all your conversions are finished. However even putting the trigger takes almost 1s (pretty much the conversion time with precision 12) before the "echo trigger > therm_bulk_read" returns. Shouldn't this just trigger the conversions and return instantly?

Just trying to understand this (I need to work around this anyway).