From owner-freebsd-bugs@freebsd.org Tue Sep 25 12:35:19 2018 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8006010B10AF for ; Tue, 25 Sep 2018 12:35:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 166338FEE9 for ; Tue, 25 Sep 2018 12:35:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id CF4A610B10AC; Tue, 25 Sep 2018 12:35:18 +0000 (UTC) Delivered-To: bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD6B910B10AB for ; Tue, 25 Sep 2018 12:35:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4980D8FEE6 for ; Tue, 25 Sep 2018 12:35:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 8E184690B for ; Tue, 25 Sep 2018 12:35:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w8PCZH3G092017 for ; Tue, 25 Sep 2018 12:35:17 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w8PCZHT3092012 for bugs@FreeBSD.org; Tue, 25 Sep 2018 12:35:17 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 231713] mmc_calculate_clock() does not work properly for cards with bus_timing_normal only Date: Tue, 25 Sep 2018 12:35:17 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: sebastian.huber@embedded-brains.de X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Sep 2018 12:35:19 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231713 Bug ID: 231713 Summary: mmc_calculate_clock() does not work properly for cards with bus_timing_normal only Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: sebastian.huber@embedded-brains.de We have static int mmc_calculate_clock(struct mmc_softc *sc) { ... /* * HS400 must be tuned in HS200 mode, so in case of HS400 we begin * with HS200 following the sequence as described in "6.6.2.2 HS200 * timing mode selection" of the eMMC specification v5.1, too, and * switch to max_timing later. HS400ES requires no tuning and, thu= s, * can be switch to directly, but requires the same detour via high * speed mode as does HS400 (see mmc_switch_to_hs400()). */ hs400 =3D max_timing =3D=3D bus_timing_mmc_hs400; timing =3D hs400 =3D=3D true ? bus_timing_mmc_hs200 : max_timing; for (i =3D 0; i < sc->child_count; i++) { ivar =3D device_get_ivars(sc->child_list[i]); if ((ivar->timings & ~(1 << bus_timing_normal)) =3D=3D 0) continue; ... /* Set clock (must be done before initial tuning). */ mmcbr_set_clock(dev, max_dtr); mmcbr_update_ios(dev); ... } (void)mmc_select_card(sc, 0); return (max_dtr); } So, for cards with ivar->timings =3D=3D bus_timing_normal the mmcbr_set_clo= ck(dev, max_dtr) is not called. This way the clock stays at SD_MMC_CARD_ID_FREQUENC= Y =3D=3D 400kHz. I think this problem was introduced with: commit 398d5fc6afb7ce20f0cf9ecc4fe286e72afdbf29 Author: marius Date: Sun Jul 23 16:11:47 2017 +0000 o Add support for eMMC HS200 and HS400 bus speed modes at 200 MHz to sdhci(4), mmc(4) and mmcsd(4). For the most part, this consists of: --=20 You are receiving this mail because: You are the assignee for the bug.=