NetBSD Problem Report #48855
From www@NetBSD.org Fri May 30 21:04:44 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
(using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id C4003A6512
for <gnats-bugs@gnats.NetBSD.org>; Fri, 30 May 2014 21:04:44 +0000 (UTC)
Message-Id: <20140530210443.4A02BA6524@mollari.NetBSD.org>
Date: Fri, 30 May 2014 21:04:43 +0000 (UTC)
From: yunixx@gmail.com
Reply-To: yunixx@gmail.com
To: gnats-bugs@NetBSD.org
Subject: i2cscan on RPi NetBSD build finds device for all addresses
X-Send-Pr-Version: www-1.0
>Number: 48855
>Category: port-arm
>Synopsis: i2cscan on RPi NetBSD build finds device for all addresses
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: thorpej
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri May 30 21:05:00 +0000 2014
>Closed-Date:
>Last-Modified: Fri Aug 06 13:50:16 +0000 2021
>Originator: Yunis Mustafa
>Release: evbarm-earmhf 201405181900Z
>Organization:
>Environment:
NetBSD rpi 6.99.42 NetBSD 6.99.42 (RPI) #0: Sun May 18 20:34:46 UTC 2014 builds@b44.netbsd.org:/home/builds/ab/HEAD/evbarm-earmhf/201405181900Z-obj/home/builds/ab/HEAD/src/sys/arch/evbarm/compile/RPI evbarm
>Description:
i2cscan /dev/iic0 (or iic1) erroneously detects devices and prints out the following for pretty much every address:
/dev/iic0: found device at 0x09
/dev/iic0: found device at 0x0a
/dev/iic0: found device at 0x0b
/dev/iic0: found device at 0x0d
/dev/iic0: found device at 0x0e
/dev/iic0: found device at 0x0f
/dev/iic0: found device at 0x10
/dev/iic0: found device at 0x11
/dev/iic0: found device at 0x12
/dev/iic0: found device at 0x13
/dev/iic0: found device at 0x14
/dev/iic0: found device at 0x15
/dev/iic0: found device at 0x16
/dev/iic0: found device at 0x17
/dev/iic0: found device at 0x18
/dev/iic0: found device at 0x19
/dev/iic0: found device at 0x1a
/dev/iic0: found device at 0x1b
/dev/iic0: found device at 0x1c
/dev/iic0: found device at 0x1d
/dev/iic0: found device at 0x1e
/dev/iic0: found device at 0x1f
/dev/iic0: found device at 0x20
/dev/iic0: found device at 0x21
/dev/iic0: found device at 0x22
/dev/iic0: found device at 0x23
/dev/iic0: found device at 0x24
/dev/iic0: found device at 0x25
/dev/iic0: found device at 0x26
/dev/iic0: found device at 0x27
/dev/iic0: found device at 0x29
/dev/iic0: found device at 0x2a
/dev/iic0: found device at 0x2b
/dev/iic0: found device at 0x2c
/dev/iic0: found device at 0x2d
/dev/iic0: found device at 0x2e
/dev/iic0: found device at 0x2f
/dev/iic0: found device at 0x38
/dev/iic0: found device at 0x39
/dev/iic0: found device at 0x3a
/dev/iic0: found device at 0x3b
/dev/iic0: found device at 0x3c
/dev/iic0: found device at 0x3d
/dev/iic0: found device at 0x3e
/dev/iic0: found device at 0x3f
/dev/iic0: found device at 0x40
/dev/iic0: found device at 0x41
/dev/iic0: found device at 0x42
/dev/iic0: found device at 0x43
/dev/iic0: found device at 0x44
/dev/iic0: found device at 0x45
/dev/iic0: found device at 0x46
/dev/iic0: found device at 0x47
/dev/iic0: found device at 0x4c
/dev/iic0: found device at 0x4d
/dev/iic0: found device at 0x4e
/dev/iic0: found device at 0x4f
/dev/iic0: found device at 0x60
/dev/iic0: found device at 0x62
/dev/iic0: found device at 0x63
/dev/iic0: found device at 0x64
/dev/iic0: found device at 0x65
/dev/iic0: found device at 0x66
/dev/iic0: found device at 0x67
/dev/iic0: found device at 0x68
/dev/iic0: found device at 0x69
/dev/iic0: found device at 0x6a
/dev/iic0: found device at 0x6b
/dev/iic0: found device at 0x6c
/dev/iic0: found device at 0x6d
/dev/iic0: found device at 0x6e
/dev/iic0: found device at 0x6f
/dev/iic0: found device at 0x70
/dev/iic0: found device at 0x71
/dev/iic0: found device at 0x72
/dev/iic0: found device at 0x73
/dev/iic0: found device at 0x74
/dev/iic0: found device at 0x75
/dev/iic0: found device at 0x76
/dev/iic0: found device at 0x77
/dev/iic0: 80 devices found
>How-To-Repeat:
i2cscan /dev/iic0
on a Raspberry Pi
>Fix:
On further debugging, it seems that the iic_smbus_quick_write() used by i2cscan.c to detect the devices returns success erroneously for some reason.
If iic_smbus_receive_byte() is used instead to detect the devices, it correctly detects only the actual devices connected to the i2c bus (at least in my testing with an i2c device with address 0x11)
>Release-Note:
>Audit-Trail:
From: "Jonathan A. Kollasch" <jakllsch@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/48855 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
Modified Files:
src/sys/arch/arm/broadcom: bcm2835_bsc.c
Log Message:
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-From-To: open->feedback
State-Changed-By: gutteridge@NetBSD.org
State-Changed-When: Sun, 02 Feb 2020 01:42:18 +0000
State-Changed-Why:
It looks like this was addressed back in 2015. Is this still an issue for you?
State-Changed-From-To: feedback->closed
State-Changed-By: gutteridge@NetBSD.org
State-Changed-When: Sun, 01 Mar 2020 03:11:48 +0000
State-Changed-Why:
Assuming fixed, and feedback timeout.
From: Dave Tyson <dtyson@anduin.org.uk>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: kern/48855
Date: Fri, 06 Aug 2021 10:45:33 +0000
It looks like this bug has not been fixed. I tried a very recent current
snapshot evbarm-earmv6hf and the problem still exists:
NetBSD 9.99.87 (RPI) #0: Thu Aug 5 00:16:36 UTC 2021
Welcome to NetBSD!
This is a development snapshot of NetBSD for testing -- user beware!
Bug reports: https://www.NetBSD.org/support/send-pr.html
Donations to the NetBSD Foundation: https://www.NetBSD.org/donations/
$ su -
rpi# i2cscan iic0
iic0: found device at 0x09
iic0: found device at 0x0a
iic0: found device at 0x0b
iic0: found device at 0x0d
iic0: found device at 0x0e
iic0: found device at 0x0f
iic0: found device at 0x10
iic0: found device at 0x11
iic0: found device at 0x12
iic0: found device at 0x13
iic0: found device at 0x14
iic0: found device at 0x15
iic0: found device at 0x16
iic0: found device at 0x17
iic0: found device at 0x18
iic0: found device at 0x19
iic0: found device at 0x1a
iic0: found device at 0x1b
iic0: found device at 0x1c
iic0: found device at 0x1d
iic0: found device at 0x1e
iic0: found device at 0x1f
iic0: found device at 0x20
iic0: found device at 0x21
iic0: found device at 0x22
iic0: found device at 0x23
iic0: found device at 0x24
iic0: found device at 0x25
iic0: found device at 0x26
iic0: found device at 0x27
iic0: found device at 0x29
iic0: found device at 0x2a
iic0: found device at 0x2b
iic0: found device at 0x2c
iic0: found device at 0x2d
iic0: found device at 0x2e
iic0: found device at 0x2f
iic0: found device at 0x38
iic0: found device at 0x39
iic0: found device at 0x3a
iic0: found device at 0x3b
iic0: found device at 0x3c
iic0: found device at 0x3d
iic0: found device at 0x3e
iic0: found device at 0x3f
iic0: found device at 0x40
iic0: found device at 0x41
iic0: found device at 0x42
iic0: found device at 0x43
iic0: found device at 0x44
iic0: found device at 0x45
iic0: found device at 0x46
iic0: found device at 0x47
iic0: found device at 0x4c
iic0: found device at 0x4d
iic0: found device at 0x4e
iic0: found device at 0x4f
iic0: found device at 0x50
iic0: found device at 0x60
iic0: found device at 0x62
iic0: found device at 0x63
iic0: found device at 0x64
iic0: found device at 0x65
iic0: found device at 0x66
iic0: found device at 0x67
iic0: found device at 0x68
iic0: found device at 0x69
iic0: found device at 0x6a
iic0: found device at 0x6b
iic0: found device at 0x6c
iic0: found device at 0x6d
iic0: found device at 0x6e
iic0: found device at 0x6f
iic0: found device at 0x70
iic0: found device at 0x71
iic0: found device at 0x72
iic0: found device at 0x73
iic0: found device at 0x74
iic0: found device at 0x75
iic0: found device at 0x76
iic0: found device at 0x77
iic0: 81 devices found
This is with no devices attached to the i2c bus.
I will do a bit more testing on this platform, but want to try out current
snapshots on the banana pi/orange pi first.
Dave
Responsible-Changed-From-To: port-arm-maintainer->thorpej
Responsible-Changed-By: thorpej@NetBSD.org
Responsible-Changed-When: Fri, 06 Aug 2021 13:50:16 +0000
Responsible-Changed-Why:
I'm working on some i2c changes.
State-Changed-From-To: closed->open
State-Changed-By: thorpej@NetBSD.org
State-Changed-When: Fri, 06 Aug 2021 13:50:16 +0000
State-Changed-Why:
originator notes bug still exists.
>Unformatted:
(Contact us)
$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.