From owner-svn-src-all@freebsd.org Sat Feb 17 18:30:25 2018 Return-Path: Delivered-To: svn-src-all@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 B956EF01CFD; Sat, 17 Feb 2018 18:30:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B1BF8D48E; Sat, 17 Feb 2018 18:30:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 662632055C; Sat, 17 Feb 2018 18:30:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1HIUPmc078726; Sat, 17 Feb 2018 18:30:25 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HIUPKb078725; Sat, 17 Feb 2018 18:30:25 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201802171830.w1HIUPKb078725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 17 Feb 2018 18:30:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329463 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 329463 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 18:30:25 -0000 Author: manu Date: Sat Feb 17 18:30:25 2018 New Revision: 329463 URL: https://svnweb.freebsd.org/changeset/base/329463 Log: aw_mmc: Only change the clock if it has really changed This also seems to fix problem when booting Pine64 from the mmc. Tested On: Pine64 Tested On: Pine64-LTS Modified: head/sys/arm/allwinner/aw_mmc.c Modified: head/sys/arm/allwinner/aw_mmc.c ============================================================================== --- head/sys/arm/allwinner/aw_mmc.c Sat Feb 17 18:00:01 2018 (r329462) +++ head/sys/arm/allwinner/aw_mmc.c Sat Feb 17 18:30:25 2018 (r329463) @@ -117,6 +117,7 @@ struct aw_mmc_softc { int32_t aw_vdd; regulator_t aw_reg_vmmc; regulator_t aw_reg_vqmmc; + unsigned int aw_clock; /* Fields required for DMA access. */ bus_addr_t aw_dma_desc_phys; @@ -939,8 +940,8 @@ aw_mmc_update_ios(device_t bus, device_t child) reg &= ~AW_MMC_CTRL_DDR_MOD_SEL; AW_MMC_WRITE_4(sc, AW_MMC_GCTL, reg); - if (ios->clock) { - clock = ios->clock; + if (ios->clock && ios->clock != sc->aw_clock) { + sc->aw_clock = clock = ios->clock; /* Disable clock */ error = aw_mmc_update_clock(sc, 0);