NetBSD Problem Report #56096

From www@netbsd.org  Wed Apr  7 04:45:25 2021
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 DF0101A923E
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  7 Apr 2021 04:45:24 +0000 (UTC)
Message-Id: <20210407044523.6C46E1A9242@mollari.NetBSD.org>
Date: Wed,  7 Apr 2021 04:45:23 +0000 (UTC)
From: snow@datagirl.xyz
Reply-To: snow@datagirl.xyz
To: gnats-bugs@NetBSD.org
Subject: "sdmmc_mem_enable failed with error 60" until SD card is plugged in
X-Send-Pr-Version: www-1.0

>Number:         56096
>Category:       port-evbarm
>Synopsis:       "sdmmc_mem_enable failed with error 60" until SD card is plugged in
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-evbarm-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 07 04:50:01 +0000 2021
>Last-Modified:  Wed Apr 07 20:15:01 +0000 2021
>Originator:     snow flurry
>Release:        NetBSD-current
>Organization:
>Environment:
NetBSD fairy01 9.99.81 NetBSD 9.99.81 (GENERIC64) #0: Sat Apr  3 07:38:11 UTC 2021  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/evbarm/compile/GENERIC64 evbarm
>Description:
Using a SOPINE module in a Clusterboard booting from eMMC and with no SD card inserted, the following line is printed to the dmesg buffer every second:

sdmmc0: sdmmc_mem_enable failed with error 60

sdmmc0 seems to be referring to the controller associated with the SD card slot. The eMMC module (attached to sdmmc1) works as expected.

Once an SD card is inserted, even when the system is running, the SD card attaches to ld* normally and the error stops printing. sdmmc0 appears to stay quiet even after the SD card is removed.

With a kernel built with SDMMC_DEBUG and DEBUG options enabled, I get the following messages:

sdmmc0: sdmmc_mem_send_op_cond: ocr=0
sdmmc0: sdmmc_mem_send_op_cond: error=60, ocr=0
sdmmc0: switch to MMC mode
sdmmc0: sdmmc_mem_send_op_cond: ocr=0
sdmmc0: sdmmc_mem_send_op_cond: error=60, ocr=0
sdmmc0: couldn't read memory OCR
sdmmc0: sdmmc_mem_enable failed with error 60
>How-To-Repeat:
Using a SOPINE module in slot 1 of Clusterboard, boot NetBSD from eMMC, with SD card slot empty at boot
>Fix:

>Audit-Trail:
From: mlelstv@serpens.de (Michael van Elst)
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: port-evbarm/56096: "sdmmc_mem_enable failed with error 60" until SD card is plugged in
Date: Wed, 7 Apr 2021 06:29:45 -0000 (UTC)

 snow@datagirl.xyz writes:

 >Using a SOPINE module in a Clusterboard booting from eMMC and with no SD card inserted, the following line is printed to the dmesg buffer every second:

 >sdmmc0: sdmmc_mem_enable failed with error 60

 The SDHC controller doesn't detect cards, the driver polls every
 second for a card and fails (without card).

 The error should probably be dropped (like in other functions)
 or converted to a debug message.

 However, the error should have reoccured when the SD card is removed
 again. So something is incomplete in handling the card eject.

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@netbsd.org
Cc: port-evbarm-maintainer@netbsd.org, gnats-admin@netbsd.org,
        netbsd-bugs@netbsd.org, snow@datagirl.xyz
Subject: Re: port-evbarm/56096: "sdmmc_mem_enable failed with error 60" until
 SD card is plugged in
Date: Wed, 7 Apr 2021 11:15:11 +0200

 On Wed, Apr 07, 2021 at 06:30:03AM +0000, Michael van Elst wrote:
 >  The SDHC controller doesn't detect cards, the driver polls every
 >  second for a card and fails (without card).
 >  
 >  The error should probably be dropped (like in other functions)
 >  or converted to a debug message.

 I'd say it should stay; but maybe printed only once.
 I found it usefull to debug hardware issue

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: snow flurry <snow@datagirl.xyz>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: port-evbarm/56096: "sdmmc_mem_enable failed with error 60" until
 SD card is plugged in
Date: Wed, 7 Apr 2021 13:10:06 -0700

 Good to know that message is expected, if not a bit noisy.

 As for the eject not being handled, I did a quick test of reading from
 ld0 when ejected and got the following:

 [ 277.1202253] sunximmc0: host controller timeout, mint=0x00000104
 [ 277.1202253] sunximmc0: unexpected DMA receive interrupt
 [ 277.1350472] ld0c: error reading fsbn 0 (ld0 bn 0; cn 0 tn 0 sn 0), retrying

 This repeats a few times before the mount fails. This occurs even when
 the SD card is reinserted.

 On Wed, Apr 07, 2021 at 06:30:03AM +0000, Michael van Elst wrote:
 > The following reply was made to PR port-evbarm/56096; it has been noted by GNATS.
 > 
 > From: mlelstv@serpens.de (Michael van Elst)
 > To: gnats-bugs@netbsd.org
 > Cc: 
 > Subject: Re: port-evbarm/56096: "sdmmc_mem_enable failed with error 60" until SD card is plugged in
 > Date: Wed, 7 Apr 2021 06:29:45 -0000 (UTC)
 > 
 >  snow@datagirl.xyz writes:
 >  
 >  >Using a SOPINE module in a Clusterboard booting from eMMC and with no SD card inserted, the following line is printed to the dmesg buffer every second:
 >  
 >  >sdmmc0: sdmmc_mem_enable failed with error 60
 >  
 >  The SDHC controller doesn't detect cards, the driver polls every
 >  second for a card and fails (without card).
 >  
 >  The error should probably be dropped (like in other functions)
 >  or converted to a debug message.
 >  
 >  However, the error should have reoccured when the SD card is removed
 >  again. So something is incomplete in handling the card eject.
 >  

NetBSD Home
NetBSD PR Database Search

(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.