From owner-svn-src-all@freebsd.org Fri Jun 19 18:14:45 2020 Return-Path: Delivered-To: svn-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 A2432335716; Fri, 19 Jun 2020 18:14:45 +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.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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pRm53f0nz4bqf; Fri, 19 Jun 2020 18:14:45 +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 7828B1F589; Fri, 19 Jun 2020 18:14:45 +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 05JIEjZt056626; Fri, 19 Jun 2020 18:14:45 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JIEj5q056625; Fri, 19 Jun 2020 18:14:45 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006191814.05JIEj5q056625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jun 2020 18:14:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362402 - stable/12/sys/dev/mmc X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12/sys/dev/mmc X-SVN-Commit-Revision: 362402 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.33 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: Fri, 19 Jun 2020 18:14:45 -0000 Author: manu Date: Fri Jun 19 18:14:45 2020 New Revision: 362402 URL: https://svnweb.freebsd.org/changeset/base/362402 Log: MFC r360007: Revert r359965 This cause board without a cd-gpio to not schedule a card detection. Modified: stable/12/sys/dev/mmc/mmc_fdt_helpers.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mmc/mmc_fdt_helpers.c ============================================================================== --- stable/12/sys/dev/mmc/mmc_fdt_helpers.c Fri Jun 19 18:10:39 2020 (r362401) +++ stable/12/sys/dev/mmc/mmc_fdt_helpers.c Fri Jun 19 18:14:45 2020 (r362402) @@ -217,7 +217,7 @@ cd_card_task(void *arg, int pending __unused) /* * Card detect setup. */ -static bool +static void cd_setup(struct mmc_fdt_helper *helper, phandle_t node) { int pincaps; @@ -237,7 +237,7 @@ cd_setup(struct mmc_fdt_helper *helper, phandle_t node helper->cd_disabled = true; if (bootverbose) device_printf(dev, "Non-removable media\n"); - return (false); + return; } /* @@ -250,14 +250,14 @@ cd_setup(struct mmc_fdt_helper *helper, phandle_t node */ if (gpio_pin_get_by_ofw_property(dev, node, "cd-gpios", &helper->cd_pin)) - return (false); + return; if (gpio_pin_getcaps(helper->cd_pin, &pincaps) != 0 || !(pincaps & GPIO_PIN_INPUT)) { device_printf(dev, "Cannot read card-detect gpio pin; " "setting card-always-present flag.\n"); helper->cd_disabled = true; - return (false); + return; } /* @@ -314,8 +314,6 @@ without_interrupts: device_get_nameunit(helper->cd_pin->dev), helper->cd_pin->pin, cd_mode_str); } - - return (true); } /* @@ -357,16 +355,14 @@ mmc_fdt_gpio_setup(device_t dev, phandle_t node, struc helper->dev = dev; helper->cd_handler = handler; + cd_setup(helper, node); wp_setup(helper, node); - if (cd_setup(helper, node)) { - /* - * Schedule a card detection - */ - taskqueue_enqueue_timeout_sbt(taskqueue_swi_giant, - &helper->cd_delayed_task, mstosbt(500), 0, C_PREL(2)); - } - + /* + * Schedule a card detection + */ + taskqueue_enqueue_timeout_sbt(taskqueue_swi_giant, + &helper->cd_delayed_task, mstosbt(500), 0, C_PREL(2)); return (0); }