From owner-dev-commits-src-all@freebsd.org Wed Sep 29 12:59:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1433D673A84; Wed, 29 Sep 2021 12:59:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKGg1056Qz3hbX; Wed, 29 Sep 2021 12:59:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6F2B18900; Wed, 29 Sep 2021 12:59:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TCxekL035492; Wed, 29 Sep 2021 12:59:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TCxeJP035491; Wed, 29 Sep 2021 12:59:40 GMT (envelope-from git) Date: Wed, 29 Sep 2021 12:59:40 GMT Message-Id: <202109291259.18TCxeJP035491@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 4a331971d2f1 - main - mmc: Fix regression in 8a8166e5bcfb breaking Stratix 10 boot MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a331971d2f1083f35b87197da0614fa3e0e53cb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 12:59:41 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=4a331971d2f1083f35b87197da0614fa3e0e53cb commit 4a331971d2f1083f35b87197da0614fa3e0e53cb Author: Jessica Clarke AuthorDate: 2021-09-29 12:59:13 +0000 Commit: Jessica Clarke CommitDate: 2021-09-29 12:59:13 +0000 mmc: Fix regression in 8a8166e5bcfb breaking Stratix 10 boot The refactoring in 8a8166e5bcfb introduced a functional change that breaks booting on the Stratix 10, hanging when it should be attaching da0. Previously OF_getencprop was called with a pointer to host->f_max, so if it wasn't present then the existing value was left untouched, but after that commit it will instead clobber the value with 0. The dwmmc driver, as used on the Stratix 10, sets a default value before calling mmc_fdt_parse and so was broken by this functional change. It appears that aw_mmc also does the same thing, so was presumably also broken on some boards. Fixes: 8a8166e5bcfb ("mmc: switch mmc_helper to device_ api") Reviewed by: manu, mw Differential Revision: https://reviews.freebsd.org/D32209 --- sys/dev/mmc/mmc_helpers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/mmc/mmc_helpers.c b/sys/dev/mmc/mmc_helpers.c index 0e1e16666367..1a90f291fc47 100644 --- a/sys/dev/mmc/mmc_helpers.c +++ b/sys/dev/mmc/mmc_helpers.c @@ -105,9 +105,9 @@ mmc_parse(device_t dev, struct mmc_helper *helper, struct mmc_host *host) * if it's not present based on the clock that the mmc controller * operates on */ - max_freq = 0; - device_get_property(dev, "max-frequency", &max_freq, sizeof(uint64_t)); - host->f_max = max_freq; + if (device_get_property(dev, "max-frequency", &max_freq, + sizeof(uint64_t)) > 0) + host->f_max = max_freq; if (device_has_property(dev, "broken-cd")) helper->props |= MMC_PROP_BROKEN_CD;