From owner-svn-src-head@freebsd.org Tue Jul 18 19:50:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3424FD9EAEB; Tue, 18 Jul 2017 19:50:04 +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 mx1.freebsd.org (Postfix) with ESMTPS id E913981851; Tue, 18 Jul 2017 19:50:03 +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 v6IJo3Xg016046; Tue, 18 Jul 2017 19:50:03 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IJo3b6016045; Tue, 18 Jul 2017 19:50:03 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201707181950.v6IJo3b6016045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 18 Jul 2017 19:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321172 - 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: 321172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 19:50:04 -0000 Author: manu Date: Tue Jul 18 19:50:02 2017 New Revision: 321172 URL: https://svnweb.freebsd.org/changeset/base/321172 Log: Allwinner EHCI: Do not fail if we cannot get a phy If we cannot get a phy, do not detach the driver, some boards have phy always enabled and not exposed. While here do not release the clocks if we fails as we release them in a10_ehci_detach. Tested-on: OrangePi-One Modified: head/sys/arm/allwinner/a10_ehci.c Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Tue Jul 18 19:00:15 2017 (r321171) +++ head/sys/arm/allwinner/a10_ehci.c Tue Jul 18 19:50:02 2017 (r321172) @@ -226,16 +226,13 @@ a10_ehci_attach(device_t self) } /* Enable USB PHY */ - err = phy_get_by_ofw_name(self, 0, "usb", &aw_sc->phy); - if (err != 0) { - device_printf(self, "Could not get phy\n"); - goto error; + if (phy_get_by_ofw_name(self, 0, "usb", &aw_sc->phy) == 0) { + err = phy_enable(self, aw_sc->phy); + if (err != 0) { + device_printf(self, "Could not enable phy\n"); + goto error; + } } - err = phy_enable(self, aw_sc->phy); - if (err != 0) { - device_printf(self, "Could not enable phy\n"); - goto error; - } /* Enable passby */ reg_value = A10_READ_4(sc, SW_USB_PMU_IRQ_ENABLE); @@ -263,10 +260,6 @@ a10_ehci_attach(device_t self) return (0); error: - if (aw_sc->clk != NULL) { - clk_disable(aw_sc->clk); - clk_release(aw_sc->clk); - } a10_ehci_detach(self); return (ENXIO); }