NetBSD Problem Report #57898

From www@netbsd.org  Fri Feb  2 12:39:32 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 3EB311A9238
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  2 Feb 2024 12:39:32 +0000 (UTC)
Message-Id: <20240202123929.C106F1A9239@mollari.NetBSD.org>
Date: Fri,  2 Feb 2024 12:39:29 +0000 (UTC)
From: oshima-ya@yagoto-urayama.jp
Reply-To: oshima-ya@yagoto-urayama.jp
To: gnats-bugs@NetBSD.org
Subject: i2cscan(8) hang-up and cannot use iic(4) on Raspberry Pi4 or 400 with GENERIC64 acpi
X-Send-Pr-Version: www-1.0

>Number:         57898
>Category:       port-evbarm
>Synopsis:       i2cscan(8) hang-up and cannot use iic(4) on Raspberry Pi4 or 400 with GENERIC64 acpi
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    port-evbarm-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 02 12:40:00 +0000 2024
>Originator:     Yaushi Oshima
>Release:        10.0_RC3
>Organization:
none
>Environment:
NetBSD nable 10.0_RC3 NetBSD 10.0_RC3 (GENERIC64) #0: Tue Jan 16 08:28:51 UTC 2024  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/evbarm/compile/GENERIC64 evbarm
>Description:
i2cscan(8) detects many non-exists devices and hang-up on NetBSD/evbarm aarch64 with Raspberry Pi4 (UEFI-acpi).

Kernel detect (in dmesg):  
 bsciic0 at acpi0 (I2C1, BCM2841-1): mem 0xfe804000-0xfe80401f irq 149
 iic0 at bsciic0: I2C bus
 bsciic1 at acpi0 (I2C2, BCM2841-2): mem 0xfe805000-0xfe80501f irq 149
 iic1 at bsciic1: I2C bus

Run i2cscan as bellow. then it detects many devices even though no device connected, and it never ends after scanning 0x30.
# 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: scanning 0x30
(no response)
^C
(no response)

Kernel and another shell works after this, but this process is not able to terminate by any interrupt (include kill -9) 

# ps ax | grep i2cscan
14258 pts/2  D+     0:00.01 i2cscan iic0
# kill -9 14258
# ps ax | grep i2cscan
14258 pts/2  D+     0:00.01 i2cscan iic0

It is the same on /dev/iic1 

I want to connect RTC module on RasPi4/400, but  impossible now.

Additional information:
Boot type: UEFI from GPT partition on USB-SSD, and device tree is ACPI
Dtb file: use bcm2711-rpi-4-b.dtb (RasPi4) orbcm2711-rpi-400.dtb(RasPi400)  copied from /boot/dtb/braodcom to EFI partition.

sysctl machdep:
# sysctl machdep
machdep.firmware_revision = 0
machdep.board_model = 0
machdep.board_revision = 0
machdep.serial = 0
machdep.dmi.system-vendor = Raspberry Pi Foundation
machdep.dmi.system-product = Raspberry Pi 4 Model B
machdep.dmi.system-version = D03115
machdep.dmi.system-serial = 0000D83ADD0A9708
machdep.dmi.system-uuid = 00d03115-0000-0000-0000-d83add0a9708
machdep.dmi.bios-vendor = https://github.com/pftf/RPi4
machdep.dmi.bios-version = UEFI Firmware v1.35
machdep.dmi.bios-date = 20230605
machdep.dmi.board-vendor = Sony UK
machdep.dmi.board-product = Raspberry Pi 4 Model B
machdep.dmi.board-version = D03115
machdep.dmi.board-serial = 0000D83ADD0A9708
machdep.dmi.board-asset-tag =
machdep.dmi.chassis-vendor = Sony UK
machdep.dmi.chassis-version = Raspberry Pi 4 Model B
machdep.dmi.chassis-serial = 0000D83ADD0A9708
machdep.dmi.chassis-asset-tag =
machdep.dmi.processor-vendor = Broadcom
machdep.dmi.processor-version = BCM2711 (ARM Cortex-A72)
machdep.dmi.processor-frequency = 600 MHz
machdep.tagged_address = 0
machdep.pan = 0
machdep.pac = 0
machdep.bti = 0
machdep.hafdbs = 0
machdep.smbios = 0x370e0000
machdep.cpu.frequency.target = 600
machdep.cpu.frequency.current = 600
machdep.cpu.frequency.min = 600
machdep.cpu.frequency.max = 1800
machdep.cpu.frequency.available = 600 1800

Full dmesg:
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
    2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013,
    2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023,
    2024
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 10.0_RC3 (GENERIC64) #0: Tue Jan 16 08:28:51 UTC 2024
        mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/evbarm/compile/GENERIC64
total memory = 8025 MB
avail memory = 7736 MB
entropy: ready
timecounter: Timecounters tick every 10.000 msec
Kernelized RAIDframe activated
armfdt0 (root)
armfdt0: using EFI runtime services for RTC
simplebus0 at armfdt0: Raspberry Pi Foundation Raspberry Pi 4 Model B
simplebus1 at simplebus0
acpifdt0 at simplebus0
acpifdt0: SMBIOS rev. 3.3.0 @ 0x370d0000
ACPI: RSDP 0x0000000033A20018 000024 (v02 RPIFDN)
ACPI: XSDT 0x0000000033A2FE98 000074 (v01 RPIFDN RPI4     00000200      01000013)
ACPI: FACP 0x0000000033A2E998 000114 (v06 RPIFDN RPI4     00000200 EDK2 00000300)
ACPI: DSDT 0x0000000033A27518 0022D9 (v02 RPIFDN RPI      00000002 INTL 20200925)
ACPI: CSRT 0x0000000033A2FA98 000169 (v00 RPIFDN RPI4     00000200 EDK2 00000300)
ACPI: DBG2 0x0000000033A2FD18 000061 (v00 RPIFDN RPI4     00000200 EDK2 00000300)
ACPI: GTDT 0x0000000033A2F998 000068 (v03 RPIFDN RPI4     00000200 EDK2 00000300)
ACPI: IORT 0x0000000033A2F598 0000B7 (v00 RPIFDN RPI4     00000200 EDK2 00000300)
ACPI: APIC 0x0000000033A2F698 000184 (v05 RPIFDN RPI4     00000200 EDK2 00000300)
ACPI: PPTT 0x0000000033A2EB18 000184 (v02 RPIFDN RPI4     00000200 EDK2 00000300)
ACPI: SSDT 0x0000000033A2ED98 000277 (v02 RPIFDN RPI4EMMC 00000002 INTL 20200925)
ACPI: SSDT 0x0000000033A2F198 000244 (v05 RPIFDN RPI4XHCI 00000002 INTL 20200925)
ACPI: BGRT 0x0000000033A2FE18 000038 (v01 INTEL  EDK2     00000002      01000013)
ACPI: 3 ACPI AML tables successfully acquired and loaded
acpi0 at acpifdt0: Intel ACPICA 20221020
acpi0: X/RSDT: OemId <RPIFDN,RPI4    ,00000200>, AslId <    ,01000013>
cpu0 at acpi0: Arm Cortex-A72 r0p3 (v8-A), id 0x0
cpu0: package 0, core 0, smt 0
cpu0: IC enabled, DC enabled, EL0/EL1 stack Alignment check enabled
cpu0: Cache Writeback Granule 16B, Exclusives Reservation Granule 16B
cpu0: Dcache line 64, Icache line 64, DIC=0, IDC=0, LoUU=1, LoC=2, LoUIS=1
cpu0: L1 48KB/64B 3-way (256 set) PIPT Instruction cache
cpu0: L1 32KB/64B 2-way (256 set) PIPT Data cache
cpu0: L2 1024KB/64B 16-way (1024 set) PIPT Unified cache
cpu0: revID=0x0, PMCv3, 4k table, 64k table, 16bit ASID
cpu0: auxID=0x10000, FP, CRC32, NEON, rounding, NaN propagation, denormals, 32x64bitRegs, Fused Multiply-Add
cpu1 at acpi0: Arm Cortex-A72 r0p3 (v8-A), id 0x1
cpu1: package 0, core 1, smt 0
cpu1: IC enabled, DC enabled, EL0/EL1 stack Alignment check enabled
cpu1: Cache Writeback Granule 16B, Exclusives Reservation Granule 16B
cpu1: Dcache line 64, Icache line 64, DIC=0, IDC=0, LoUU=1, LoC=2, LoUIS=1
cpu1: L1 48KB/64B 3-way (256 set) PIPT Instruction cache
cpu1: L1 32KB/64B 2-way (256 set) PIPT Data cache
cpu1: L2 1024KB/64B 16-way (1024 set) PIPT Unified cache
cpu1: revID=0x0, PMCv3, 4k table, 64k table, 16bit ASID
cpu1: auxID=0x10000, FP, CRC32, NEON, rounding, NaN propagation, denormals, 32x64bitRegs, Fused Multiply-Add
cpu2 at acpi0: Arm Cortex-A72 r0p3 (v8-A), id 0x2
cpu2: package 0, core 2, smt 0
cpu2: IC enabled, DC enabled, EL0/EL1 stack Alignment check enabled
cpu2: Cache Writeback Granule 16B, Exclusives Reservation Granule 16B
cpu2: Dcache line 64, Icache line 64, DIC=0, IDC=0, LoUU=1, LoC=2, LoUIS=1
cpu2: L1 48KB/64B 3-way (256 set) PIPT Instruction cache
cpu2: L1 32KB/64B 2-way (256 set) PIPT Data cache
cpu2: L2 1024KB/64B 16-way (1024 set) PIPT Unified cache
cpu2: revID=0x0, PMCv3, 4k table, 64k table, 16bit ASID
cpu2: auxID=0x10000, FP, CRC32, NEON, rounding, NaN propagation, denormals, 32x64bitRegs, Fused Multiply-Add
cpu3 at acpi0: Arm Cortex-A72 r0p3 (v8-A), id 0x3
cpu3: package 0, core 3, smt 0
cpu3: IC enabled, DC enabled, EL0/EL1 stack Alignment check enabled
cpu3: Cache Writeback Granule 16B, Exclusives Reservation Granule 16B
cpu3: Dcache line 64, Icache line 64, DIC=0, IDC=0, LoUU=1, LoC=2, LoUIS=1
cpu3: L1 48KB/64B 3-way (256 set) PIPT Instruction cache
cpu3: L1 32KB/64B 2-way (256 set) PIPT Data cache
cpu3: L2 1024KB/64B 16-way (1024 set) PIPT Unified cache
cpu3: revID=0x0, PMCv3, 4k table, 64k table, 16bit ASID
cpu3: auxID=0x10000, FP, CRC32, NEON, rounding, NaN propagation, denormals, 32x64bitRegs, Fused Multiply-Add
gic0 at acpi0: GIC
armgic0 at gic0: Generic Interrupt Controller, 256 sources (247 valid)
armgic0: 16 Priorities, 224 SPIs, 7 PPIs, 16 SGIs
gtmr0 at acpi0: irq 27
armgtmr0 at gtmr0: Generic Timer (54000 kHz, virtual)
timecounter: Timecounter "armgtmr0" frequency 54000000 Hz quality 500
PEPD (BCM2854) at acpi0 not configured
CPU0 (ACPI0007) at acpi0 not configured
CPU1 (ACPI0007) at acpi0 not configured
CPU2 (ACPI0007) at acpi0 not configured
CPU3 (ACPI0007) at acpi0 not configured
USB0 (BCM2848) at acpi0 not configured
GPU0 (BCM2850) at acpi0 not configured
bcmmbox0 at acpi0 (RPIQ, BCM2849-0): mem 0xfe00b880-0xfe00b8a3 irq 65
vcmbox0 at bcmmbox0
vchiq0 at acpi0 (VCIQ, BCM2835-0): mem 0xfe00b840-0xfe00b84f irq 66
VCSM (BCM2856) at acpi0 not configured
GPI0 (BCM2845) at acpi0 not configured
bsciic0 at acpi0 (I2C1, BCM2841-1): mem 0xfe804000-0xfe80401f irq 149
iic0 at bsciic0: I2C bus
bsciic1 at acpi0 (I2C2, BCM2841-2): mem 0xfe805000-0xfe80501f irq 149
iic1 at bsciic1: I2C bus
SPI0 (BCM2838) at acpi0 not configured
SPI1 (BCM2839) at acpi0 not configured
PWM0 (BCM2844) at acpi0 not configured
plcom0 at acpi0 (URT0, BCM2837-4): mem 0xfe201000-0xfe201fff irq 153
com0 at acpi0 (URTM, BCM2836-0): mem 0xfe215000-0xfe21506f irq 125
com0: BCM AUX UART, 1-byte FIFO
BTH0 (BCM2EA6) at acpi0 not configured
RHPX (MSFT8000) at acpi0 not configured
sdhc0 at acpi0 (SDC1, BCM2847-0): mem 0xfe300000-0xfe3000ff irq 158
genet0 at acpi0 (ETH0, BCM6E4E-0): mem 0xfd580000-0xfd58ffff irq 189,190
genet0: GENETv5.0
genet0: Ethernet address d8:3a:dd:0a:97:08
brgphy0 at genet0 phy 1: BCM54213PE 1000BASE-T media interface, rev. 2
brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
EC00 (PNP0C06) at acpi0 not configured
acpitz0 at acpi0 (TZ00): cpu0 cpu1 cpu2 cpu3
acpitz0: levels: critical 90.0 C, hot 85.0 C, passive 80.0 C, passive cooling
sdhc1 at acpi0 (SDC3, BRCME88C-1): mem 0xfe340000-0xfe3400ff irq 158
xhci0 at acpi0 (XHC0, PNP0D10-0): mem 0x600000000-0x600000fff irq 175
xhci0: 64-bit DMA
xhci0: xHCI version 1.0
usb0 at xhci0: USB revision 3.0
usb1 at xhci0: USB revision 2.0
sdhc0: SDHC 3.0, rev 153, caps <01210000/00000000>, PIO, 250000 kHz, HS 3.3V, re-tuning mode 1, 1024 byte blocks
sdmmc0 at sdhc0 slot 0
sdhc1: SDHC 3.0, rev 16, caps <45ee6432/0000a525>, PIO, 100000 kHz, embedded slot, HS 3.3V, re-tuning mode 3, 2048 byte blocks
sdmmc1 at sdhc1 slot 0
genfb0 at simplebus1: Simple Framebuffer (1920x1080 32-bpp @ 0x3e2fe000)
genfb0: framebuffer at 0x3e2fe000, size 1920x1080, depth 32, stride 7680
wsdisplay0 at genfb0 kbdmux 1: console (default, vt100 emulation)
wsmux1: connecting to wsdisplay0
wsdisplay0: screen 1-3 added (default, vt100 emulation)
timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
uhub0 at usb0: NetBSD (0x0000) xHCI root hub (0x0000), class 9/0, rev 3.00/1.00, addr 0
uhub0: 4 ports with 4 removable, self powered
uhub1 at usb1: NetBSD (0x0000) xHCI root hub (0x0000), class 9/0, rev 2.00/1.00, addr 0
uhub1: 1 port with 1 removable, self powered
cpu0: PMU interrupting on irq 48
cpu1: PMU interrupting on irq 49
cpu2: PMU interrupting on irq 50
cpu3: PMU interrupting on irq 51
IPsec: Initialized Security Association Processing.
sdmmc1: autoconfiguration error: couldn't enable card: 60
sdmmc0: 4-bit width, 50.000 MHz
sdmmc0: SDIO function
bwfm0 at sdmmc0 function 1
(manufacturer 0x2d0, product 0xa9a6) at sdmmc0 function 2 not configured
(manufacturer 0x2d0, product 0xa9a6, standard function interface code 0x2) at sdmmc0 function 3 not configured
uhub2 at uhub1 port 1: vendor 2109 (0x2109) USB2.0 Hub (0x3431), class 9/0, rev 2.10/4.21, addr 1
uhub2: single transaction translator
uhub2: 4 ports with 4 removable, self powered
umass0 at uhub0 port 1 configuration 1 interface 0
umass0: ELECOM (0x056e) ESD-EPK (0x6a14), rev 3.20/1.10, addr 2
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets, 1 lun per target
sd0 at scsibus0 target 0 lun 0: <ELECOM, ESD-EPK, PMAP> disk fixed
sd0: fabricating a geometry
sd0: 465 GB, 476940 cyl, 64 head, 32 sec, 512 bytes/sect x 976773168 sectors
sd0: fabricating a geometry
sd0: GPT GUID: a74b84b2-ab92-4a23-9468-a7069d94c1b4
dk0 at sd0: "EFI", 262144 blocks at 128, type: msdos
dk1 at sd0: "NetBSD root", 843055104 blocks at 262272, type: ffs
dk2 at sd0: "NetBSD swap", 133445760 blocks at 843317376, type: swap
uhidev0 at uhub2 port 3 configuration 1 interface 0
uhidev0: Telink (0x248a) Wireless Receiver (0x8367), rev 1.10/1.00, addr 3, iclass 3/1
uhidev0: 5 report ids
ums0 at uhidev0 reportid 1: 5 buttons and Z dir
wsmouse0 at ums0 mux 0
uhid0 at uhidev0 reportid 3: input=4, output=0, feature=0
uhid1 at uhidev0 reportid 4: input=1, output=0, feature=0
uhid2 at uhidev0 reportid 5: input=0, output=0, feature=7
uhidev1 at uhub2 port 3 configuration 1 interface 1
uhidev1: Telink (0x248a) Wireless Receiver (0x8367), rev 1.10/1.00, addr 3, iclass 3/1
ukbd0 at uhidev1
wskbd0 at ukbd0: console keyboard, using wsdisplay0
swwdog0: software watchdog initialized
WARNING: 1 error while detecting hardware; check system log.
boot device: dk1
root on dk1 dumps on dk2
root file system type: ffs
kern.module.path=/stand/evbarm/10.0/modules
WARNING: clock lost 230 days
WARNING: using filesystem time
WARNING: CHECK AND RESET THE DATE!
vchiq: vchiq_init_state: slot_zero = 0xffffc00267306000, is_master = 0
vchiq: local ver 8 (min 3), remote ver 8.
vcaudio0 at vchiq0: auds
notice: vchiq_get_state: g_state.remote->initialised != 1 (0)
vchiq: vchiq_initialise: videocore initialized after 1 retries
bwfm0: Firmware file default:    brcmfmac43455-sdio.bin
bwfm0: Firmware file model-spec: brcmfmac43455-sdio.Raspberry Pi 4 Model B.bin
bwfm0: Found Firmware file: brcmfmac43455-sdio.Raspberry Pi 4 Model B.bin
audio0 at vcaudio0: playback
audio0: slinear_le:16 -> slinear_le:16 2ch 48000Hz, blk 7680 bytes (40ms) for playback
spkr0 at audio0: PC Speaker (synthesized)
wsbell at spkr0 not configured
bwfm0: NVRAM file default:    brcmfmac43455-sdio.txt
bwfm0: NVRAM file model-spec: brcmfmac43455-sdio.Raspberry Pi 4 Model B.txt
bwfm0: Found NVRAM file: brcmfmac43455-sdio.Raspberry Pi 4 Model B.txt
bwfm0: CLM file default:    brcmfmac43455-sdio.clm_blob
bwfm0: CLM file model-spec: brcmfmac43455-sdio.Raspberry Pi 4 Model B.clm_blob
bwfm0: Found CLM file: brcmfmac43455-sdio.Raspberry Pi 4 Model B.clm_blob
bwfm0: CHIPACTIVE
bwfm0: address **:**:**:**:97:09
bwfm0: wl0: Mar  1 2015 07:29:38 version 7.45.18 (r538002) FWID 01-6a2c8ad4
wsdisplay0: screen 4 added (default, vt100 emulation)
>How-To-Repeat:
1. Boot GENERIC64 on RaspberryPi4 (UEFI device-tree: acpi) 
2. Run i2cscan iic0 or iic1 
>Fix:
unknown

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.