You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The firmware driver is applied for v4.2, so we can start to use it.
Looking at the thermal driver I wonder if this retry loop is necessary?
I haven't seen any other use of the mailbox where this is done.
staticintbcm2835_get_temp_or_max(structthermal_zone_device*thermal_dev, unsigned long*temp, unsignedtag_id)
{
intresult=-1, retry=3;
print_debug("IN");
*temp=0;
while (result!=0&&retry-->0) {
/* wipe all previous message data */memset(&bcm2835_data.msg, 0, sizeofbcm2835_data.msg);
/* prepare message */bcm2835_data.msg.msg_size=sizeofbcm2835_data.msg;
bcm2835_data.msg.tag.buffer_size=8;
bcm2835_data.msg.tag.tag_id=tag_id;
/* send the message */result=bcm_mailbox_property(&bcm2835_data.msg, sizeofbcm2835_data.msg);
print_debug("Got %stemperature as %u (%d,%x)\n", tag_id==VC_TAG_GET_MAX_TEMP ? "max ":"", (uint)bcm2835_data.msg.tag.val, result, bcm2835_data.msg.request_code);
if (!(bcm2835_data.msg.request_code&0x80000000))
result=-1;
}
/* check if it was all ok and return the rate in milli degrees C */if (result==0)
*temp= (uint)bcm2835_data.msg.tag.val;
elseprint_err("Failed to get temperature! (%x:%d)\n", tag_id, result);
print_debug("OUT");
returnresult;
}
The text was updated successfully, but these errors were encountered:
I did add that (over 2 years ago). A github issue reported occasional spurious readings (along with an mailbox error code). At the time retying was a quick fix. Not the right fix.
I've a suspicion this may have been fixed on the firmware side since then. I'm suspecting a latch_try (non-blocking mutex) with error if someone else was calling the function.
The firmware driver is applied for v4.2, so we can start to use it.
Looking at the thermal driver I wonder if this retry loop is necessary?
I haven't seen any other use of the mailbox where this is done.
The text was updated successfully, but these errors were encountered: