From owner-freebsd-arm@FreeBSD.ORG Wed Feb 11 05:47:27 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CAE5649 for ; Wed, 11 Feb 2015 05:47:27 +0000 (UTC) Received: from feith1.FEITH.COM (feith1.FEITH.COM [192.251.93.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B4E0798 for ; Wed, 11 Feb 2015 05:47:26 +0000 (UTC) Received: from jwlab.FEITH.COM (jwlab.FEITH.COM [192.251.93.16]) by feith1.FEITH.COM (8.14.5+Sun/8.12.9) with ESMTP id t1B5ZBwh025885; Wed, 11 Feb 2015 00:35:11 -0500 (EST) (envelope-from john@jwlab.FEITH.COM) Received: from jwlab.FEITH.COM (localhost [127.0.0.1]) by jwlab.FEITH.COM (8.14.5+Sun/8.14.5) with ESMTP id t1B5ZBBH007721; Wed, 11 Feb 2015 00:35:11 -0500 (EST) Received: (from john@localhost) by jwlab.FEITH.COM (8.14.5+Sun/8.14.5/Submit) id t1B5Z3c7007720; Wed, 11 Feb 2015 00:35:03 -0500 (EST) Date: Wed, 11 Feb 2015 00:35:03 -0500 (EST) From: John Wehle Message-Id: <201502110535.t1B5Z3c7007720@jwlab.FEITH.COM> To: ganbold@gmail.com Subject: Re: Initial Amlogic aml8726-m6 and aml8726-m8 support files MIME-Version: 1.0 Content-Type: text/plain X-DCC--Metrics: feith1; whitelist X-Scanned-By: MIMEDefang 2.67 on 192.251.93.1 Cc: freebsd-arm@freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2015 05:47:27 -0000 Ganbold Tsagaankhuu wrote on Mon Feb 2 07:19:11 UTC 2015: > Maybe making mmc stable is more priority. Try the attached patch. -- John --------------------8<-------------------8<----------------------------- --- sys/arm/amlogic/aml8726/aml8726_mmc.c.ORIGINAL 2015-01-07 00:57:31.000000000 -0500 +++ sys/arm/amlogic/aml8726/aml8726_mmc.c 2015-02-10 23:51:49.000000000 -0500 @@ -353,7 +353,8 @@ aml8726_mmc_intr(void *arg) return; } - if ((isr & AML_MMC_IRQ_STATUS_CMD_BUSY) != 0) { + if ((isr & AML_MMC_IRQ_STATUS_CMD_BUSY) != 0 + && (isr & AML_MMC_IRQ_STATUS_CMD_DONE_IRQ) == 0) { if (mmc_error != MMC_ERR_TIMEOUT) mmc_error = MMC_ERR_FAILED; @@ -431,13 +432,14 @@ aml8726_mmc_intr(void *arg) } /* - * If this command was successfully executed and there's - * a linked stop command, then start the stop command. + * If there's a linked stop command, then start the stop command. + * In order to establish a known state attempt the stop command + * even if the original request encountered an error. */ stop_cmd = (cmd->mrq->stop != cmd) ? cmd->mrq->stop : NULL; - if (stop_cmd != NULL && mmc_error == MMC_ERR_NONE) { + if (stop_cmd != NULL) { mmc_stop_error = aml8726_mmc_start_command(sc, stop_cmd); if (mmc_stop_error == MMC_ERR_NONE) { AML_MMC_UNLOCK(sc); ------------------------------------------------------------------------- | Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com | | John Wehle | Fax: 1-215-540-5495 | | -------------------------------------------------------------------------