From nobody Tue Jan 09 10:36:32 2024 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T8S671Bylz57413 for ; Tue, 9 Jan 2024 10:36:47 +0000 (UTC) (envelope-from soren.schmidt@gmail.com) Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T8S66240Fz4Yhv for ; Tue, 9 Jan 2024 10:36:46 +0000 (UTC) (envelope-from soren.schmidt@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=UgEhN25N; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of soren.schmidt@gmail.com designates 2a00:1450:4864:20::12e as permitted sender) smtp.mailfrom=soren.schmidt@gmail.com Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-50eabbc3dccso2802040e87.2 for ; Tue, 09 Jan 2024 02:36:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704796604; x=1705401404; darn=freebsd.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=SygKvWvzEjLljys5EXVoC9J5fxVrmtCOq2Jl1uNMb2g=; b=UgEhN25NnKXLA3ByRqGfhKtfwl8IQ2trk3OrxgEuhhVL7chtbLCx4IG1J9HnvvD9dg igvJhvxUK81p/rTMg1sBLubiBFyfd5siH+aW10k5ShqoBgFDFjvdtP66SAk5/kpfem8O 5pODl5g/M6a3N6UGw6U3gQwST+TfK4n7p8fUFYESB2LobSgRvGW5hx0vKuxkz1n1Z5EB L3i9vjCofbfg3jvf7mrsVNSnJUkaE4mt42mg+Mv+Djh3GU+kNU0cG5iJi9eL1z2a492+ hOgk9RGH35iKeclhthB5PxroNqE1TXeoRat65Vu6NyVb7YYqyvJ06S7Otk0P3BlfHW6/ 3VHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704796604; x=1705401404; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SygKvWvzEjLljys5EXVoC9J5fxVrmtCOq2Jl1uNMb2g=; b=xTGEJ7zw+2Ft2GdHNEHBoMm48M2OsWVx+eFah02YAMFPNM/nK4UjVZoKhAtqAzw3Kc 2xCj2abqHH1t807ig2whE/URFNAivtnQIb3hUquWyN2F1XV23/icPLH9Ox/8c7YvGJfU hii7tkoBaKqhWjAIdjxQXufZ/CcP7BsbKca6C0lADlND9WGkvwzqLoMJ65rHSf4ib0vC Rl/5C5OmMqjVdHFfs7rpddrjK0eVyGBFJ0MfXkX+sN21rfALzQKu/e2EGEkoyAjaoGPZ Vb/Uc1MrNYDzZWK0gpdQ675WD8fDPl4hrtQyUItMVIOdLTJL8yynIrdu/0I1Pzi1L1CH wQnw== X-Gm-Message-State: AOJu0YzUzH1kBqm6Y2RxdMk5RZzqS4Y2tUeAXohoC21InTanaornuRTT JMd9/Emafc6+rlaGiRzDsu6/mKXEK7c= X-Google-Smtp-Source: AGHT+IHFjZYlWefabFkZ1wCCluSW3TgNfFJeOHZpDHg1syOXhfp2es569hgX3LA4VMv0giuH98OosQ== X-Received: by 2002:a05:6512:b14:b0:50e:6f89:a149 with SMTP id w20-20020a0565120b1400b0050e6f89a149mr1418734lfu.11.1704796603390; Tue, 09 Jan 2024 02:36:43 -0800 (PST) Received: from smtpclient.apple ([85.27.186.9]) by smtp.gmail.com with ESMTPSA id dc9-20020a170906c7c900b00a2a4bd50588sm894062ejb.147.2024.01.09.02.36.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2024 02:36:42 -0800 (PST) From: =?utf-8?Q?S=C3=B8ren_Schmidt?= Message-Id: <49DE81A1-7DF5-48BF-A334-961A73B91E53@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_F8AECE7F-C308-49AB-AE34-8F2C3C2992E6" List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: MMCCAM hang Date: Tue, 9 Jan 2024 11:36:32 +0100 In-Reply-To: Cc: "Bjoern A. Zeeb" , Warner Losh To: "freebsd-arm@freebsd.org" References: X-Mailer: Apple Mail (2.3731.700.6) X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.16 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.997]; R_MIXED_CHARSET(0.83)[subject]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; TAGGED_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_DN_EQ_ADDR_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::12e:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-arm@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; APPLE_MAILER_COMMON(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-Rspamd-Queue-Id: 4T8S66240Fz4Yhv --Apple-Mail=_F8AECE7F-C308-49AB-AE34-8F2C3C2992E6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 28 Dec 2023, at 02.08, Warner Losh wrote: > On Wed, Dec 27, 2023, 4:55=E2=80=AFPM Bjoern A. Zeeb = > = wrote: >> Hi, >>=20 >> sdhci_fsl_fdt0: Desired SD/MMC freq: 50000000, actual: 50000000; base = 700000000 prescale 1 divisor 14 >> GEOM: new disk sdda0 >> sdda0 at sdhci_slot0 bus 0 scbus0 target 0 lun 0 >> sdda0: Relative addr: 00000002 >> Card features: >> Card random: unblocking device. >> GEOM: new disk sdda0boot0 >> memory OCR: 00ff8080 >> sdda0: Serial Number ....... >> sdda0: MMCHC .................................. by 17 0x0000 >> GEOM: new disk sdda0boot1 >> uhub0: 2 ports with 2 removable, self powered >>=20 >> at which point basically anything hangs. In auto-boot it is >> before/during file-system checks. >> In single user mode camcontrol devlist will show sdda0 >> but >>=20 >> root@:/ # gpart show sdda0 >> load: 6.06 cmd: gpart 24 [g_waitfor_event] 1.28r 0.00u 0.00s 0% = 2088k >> {forever} >>=20 >>=20 >> Unclear at which point I broke to debugger and this is where it seems = to >> hang: >>=20 >> db> trace 100088 >> Tracing pid 4 tid 100088 td 0xffff0000dc527000 >> ipi_stop() at ipi_stop+0x34 >> arm_gic_v3_intr() at arm_gic_v3_intr+0xe4 >> intr_irq_handler() at intr_irq_handler+0x80 >> handle_el1h_irq() at handle_el1h_irq+0x14 >> --- interrupt >> spinlock_exit() at spinlock_exit+0x44 >> callout_reset_sbt_on() at callout_reset_sbt_on+0x210 >> sdhci_cam_action() at sdhci_cam_action+0x284 >> xpt_run_devq() at xpt_run_devq+0x4c8 >> xpt_action_default() at xpt_action_default+0x470 >> sddastart() at sddastart+0x1bc >> xpt_run_allocq() at xpt_run_allocq+0xa8 >> xpt_done_process() at xpt_done_process+0x610 >> xpt_done_td() at xpt_done_td+0x1a8 >> fork_exit() at fork_exit+0x8c >> fork_trampoline() at fork_trampoline+0x18 >>=20 >>=20 >> Anyone an idea? >=20 >=20 >=20 > Looks like deadlock with another thread. Anybody else in the time = keeping / callout code? I think this is related to the MMC driver having issues (MMCCAM or not). If I try to use a MMC sdcard on any of my rk35X8 boards as the disk = device it will eventually hang on first access to the MMC controlled = media. I thought I had an issue here with my dev setup but clealy I'm not alone = :) -- S=C3=B8ren Schmidt sos@deepcore.dk / sos@freebsd.org "So much code to hack, so little time" --Apple-Mail=_F8AECE7F-C308-49AB-AE34-8F2C3C2992E6 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On 28 Dec 2023, = at 02.08, Warner Losh <imp@bsdimp.com> wrote:
On Wed, Dec 27, 2023, 4:55=E2=80=AFPM Bjoern A. = Zeeb <bzeeb-lists@lists.zabbadoz.= net> wrote:
Hi,

sdhci_fsl_fdt0: Desired SD/MMC freq: = 50000000, actual: 50000000; base 700000000 prescale 1 divisor = 14
GEOM: new disk sdda0
sdda0 at sdhci_slot0 bus 0 scbus0 target 0 = lun 0
sdda0: Relative addr: 00000002
Card features: <MMC Memory = High-Capacity>
Card random: unblocking device.
GEOM: new disk = sdda0boot0
memory OCR: 00ff8080
sdda0: Serial Number = .......
sdda0: MMCHC .................................. by 17 = 0x0000
GEOM: new disk sdda0boot1
uhub0: 2 ports with 2 removable, = self powered

at which point basically anything hangs.  In = auto-boot it is
before/during file-system checks.
In single user = mode camcontrol devlist will show sdda0
but

root@:/ # gpart = show sdda0
load: 6.06  cmd: gpart 24 [g_waitfor_event] 1.28r = 0.00u 0.00s 0% 2088k
{forever}


Unclear at which point I = broke to debugger and this is where it seems to
hang:

db> = trace 100088
Tracing pid 4 tid 100088 td = 0xffff0000dc527000
ipi_stop() at ipi_stop+0x34
arm_gic_v3_intr() = at arm_gic_v3_intr+0xe4
intr_irq_handler() at = intr_irq_handler+0x80
handle_el1h_irq() at = handle_el1h_irq+0x14
--- interrupt
spinlock_exit() at = spinlock_exit+0x44
callout_reset_sbt_on() at = callout_reset_sbt_on+0x210
sdhci_cam_action() at = sdhci_cam_action+0x284
xpt_run_devq() at = xpt_run_devq+0x4c8
xpt_action_default() at = xpt_action_default+0x470
sddastart() at = sddastart+0x1bc
xpt_run_allocq() at = xpt_run_allocq+0xa8
xpt_done_process() at = xpt_done_process+0x610
xpt_done_td() at = xpt_done_td+0x1a8
fork_exit() at fork_exit+0x8c
fork_trampoline() = at fork_trampoline+0x18


Anyone an = idea?


Looks like deadlock with = another thread. Anybody else in the time keeping / callout = code?

I think this is = related to the MMC driver having issues (MMCCAM or not).
If I = try to use a MMC sdcard on any of my rk35X8 boards as the disk device it = will eventually hang on first access to the MMC controlled = media.
I thought I had an issue here with my dev setup but = clealy I'm not alone :)

--
S=C3=B8ren = Schmidt
sos@deepcore.dk / sos@freebsd.org
"So much code to hack, so little = time"

= --Apple-Mail=_F8AECE7F-C308-49AB-AE34-8F2C3C2992E6--