NetBSD Problem Report #48932
From www@NetBSD.org Sat Jun 21 01:20:16 2014
Received: from mail.netbsd.org (mail.netbsd.org [126.96.36.199])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id 72177A5816
for <gnats-bugs@gnats.NetBSD.org>; Sat, 21 Jun 2014 01:20:13 +0000 (UTC)
Date: Sat, 21 Jun 2014 01:20:10 +0000 (UTC)
Subject: Raspberry Pi i2c ioctl returns success even though i2c slave device NACKed
>Synopsis: Raspberry Pi i2c ioctl returns success even though i2c slave device NACKed
>Arrival-Date: Sat Jun 21 01:25:00 +0000 2014
>Closed-Date: Thu Nov 04 06:49:10 +0000 2021
>Last-Modified: Thu Nov 04 06:49:10 +0000 2021
>Originator: Yunis Mustafa
NetBSD rpi 6.99.42 NetBSD 6.99.42 (RPI) #0: Sun May 18 20:34:46 UTC 2014 email@example.com:/home/builds/ab/HEAD/evbarm-earmhf/201405181900Z-obj/home/builds/ab/HEAD/src/sys/arch/evbarm/compile/RPI evbarm
i2c bus protocol analyzer capture shows that the i2cscan utility's ioctl(I2C_OP_WRITE_WITH_STOP) was NACK-ed (well, devices with most of those addresses don't exist), but the ioctl returned success. This is causing the i2cscan utility to detect phantom devices which do not exist.
This was observed with my own application talking to an i2c slave device I am using. The problem I have with this is that my slave device will NACK when it is busy, but I cannot programmatically detect this and retry the write request because the ioctl will return success even when the actual write operation was NACK-ed/failed.
I have i2c capture screenshots which show the i2c data for further information. Not sure how to load the screen shots to this PR though.
- Setup I2C Bus Capture (I use saleae product)
- Run "i2cscan /dev/iic1"
- Obserce the i2c bus capture output - notice NACKs for devices which do not exist.
- But i2cscan will print that device was found for that address.
From: "Jonathan A. Kollasch" <firstname.lastname@example.org>
Subject: PR/48932 CVS commit: src/sys/arch/arm/broadcom
Date: Sat, 24 Jan 2015 00:23:37 +0000
Module Name: src
Committed By: jakllsch
Date: Sat Jan 24 00:23:37 UTC 2015
Catch NAKs from the device more often.
Should fix PR#48855 and maybe PR#48932.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/broadcom/bcm2835_bsc.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-When: Sun, 12 Jun 2016 03:33:21 +0000
Did the commit (almost a year and a half ago now (!)) fix the problem?
State-Changed-When: Thu, 04 Nov 2021 06:49:10 +0000
Timeout on feedback. Issue likely fixed.
Please raise a new PR if problems persist.
$NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.