From owner-freebsd-arm@FreeBSD.ORG Thu Mar 3 01:24:42 2011 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7DED106566B for ; Thu, 3 Mar 2011 01:24:42 +0000 (UTC) (envelope-from gja@ansley.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9C8348FC1A for ; Thu, 3 Mar 2011 01:24:42 +0000 (UTC) Received: by ywf9 with SMTP id 9so212870ywf.13 for ; Wed, 02 Mar 2011 17:24:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ansley.com; s=google; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=GXTF84SU1fLce0xDBwEAFErIBNsLzzpEZNdfZezp7ko=; b=jszsdFHqk4JkJjFKEgV/5xstr5qzcHapaClG/7K79uy8TYzMxOWhC+fn57W26l1vz9 2hImdOLvjz5A9T10B2NsdwzXbQxJepy9nWtoD3ARBh7vBVleXB4gmI50GQc64RbwXqRs CggM/KCzkTMVuAKxm/dj02Ip7EW/Uj9QS2xQw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=ansley.com; s=google; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; b=HP4IkPWUflvh+G9D48LgCooe+6QvllUcI0he4BNHiduLI6McCNfizCxYFBPhoM797C YVpJD0nSsVXQm6M5VXwGLwHSklsOKltU3Czhap/csQLbnr1gHxHaOboxUbDoDQJLgX2I +mRHFJvb4M732js7kIYHO9gMNQ5oWmwCejZi8= Received: by 10.236.108.178 with SMTP id q38mr599224yhg.81.1299113798854; Wed, 02 Mar 2011 16:56:38 -0800 (PST) Received: from gregmbp.internal.ansley.com (99-135-104-139.lightspeed.tukrga.sbcglobal.net [99.135.104.139]) by mx.google.com with ESMTPS id f31sm383387yhc.13.2011.03.02.16.56.37 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 Mar 2011 16:56:38 -0800 (PST) Sender: Greg Ansley Message-ID: <4D6EE744.5050100@ansley.com> Date: Wed, 02 Mar 2011 19:56:36 -0500 From: Greg Ansley User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: freebsd-arm@freebsd.org References: <201103030040.p230eBIt023558@freefall.freebsd.org> In-Reply-To: <201103030040.p230eBIt023558@freefall.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: arm/155214: [patch] MMC/SD IO slow on Atmel ARM with modern large SD cards X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Mar 2011 01:24:43 -0000 On 3/2/11 7:40 PM, Ian Lepore wrote: > The following reply was made to PR arm/155214; it has been noted by GNATS. > > From: Ian Lepore > To: ticso@cicely.de > Cc: FreeBSD-gnats-submit@freebsd.org > Subject: Re: arm/155214: [patch] MMC/SD IO slow on Atmel ARM with modern > large SD cards > Date: Wed, 02 Mar 2011 17:21:09 -0700 > > On Thu, 2011-03-03 at 00:52 +0100, Bernd Walter wrote: > > On Wed, Mar 02, 2011 at 02:53:18PM -0700, Ian Lepore wrote: > > > > > > >Number: 155214 > > > >Category: arm > > > >Synopsis: [patch] MMC/SD IO slow on Atmel ARM with modern large SD cards > > > >Confidential: no > > > >Severity: serious > > > >Priority: medium > > > >Responsible: freebsd-arm > > > >State: open > > > >Quarter: > > > >Keywords: > > > >Date-Required: > > > >Class: sw-bug > > > >Submitter-Id: current-users > > > >Arrival-Date: Wed Mar 02 22:10:10 UTC 2011 > > > >Closed-Date: > > > >Last-Modified: > > > >Originator: Ian Lepore > > > >Release: FreeBSD 8.2-RC3 arm > > > >Organization: > > > none > > > >Environment: > > > FreeBSD dvb 8.2-RC3 FreeBSD 8.2-RC3 #49: Tue Feb 15 22:52:14 UTC 2011 root@revolution.hippie.lan:/usr/obj/arm/usr/src/sys/DVB arm > > > > > > Included patch is against -current even though the problem was first seen on > > > 8.2-RC3 > > > > > > The problem was seen on AT91RM9200 hardware, but presumably also affects the > > > SAM9 series which uses the same driver code. > > > > > > >Description: > > > With the latest generation of large-capacity SD cards, write speeds as low as > > > 20 kbytes/sec are seen. These modern cards have erase-block sizes as large as > > > 8192K (compared to 32K typical on previous generations). The at91_mci driver > > > does only single-sector IO; apparently this requires the SD card to internally > > > perform an expensive read-erase-modify-write cycle for each 512 byte block > > > written to the card. > > > > The complete details of this problem are completely known. > > However the RM9200 has many hardware problems to be worked around and > > so far noone actually did. > > Your patch is quite large, so I would like to ask you explicitly: > > Did you test your patch with an AT91RM9200 system? > > You did enable multisector support for reading and (more important) for > > writing? > > But you didn't activate 4bit mode? > > With 4bit mode there is no hardware bug, but when the driver was written > > is was just done in a lazy way because activating 4bit on SD cards require > > special handling - in the meantime the SD layer itself was extracted and > > has 4bit support, but the at91_mci driver was never updated to use that. > > > > PS: I'm very pleased to see your work since SD write speed was a > > major show stopper for some applications > > > > Yes, the patch is large, partly because I included comments about the > hardware problems I found and how the code works around them (and also > to help the next person understand the flow). > > My changes support multi-sector IO for both reads and writes. > > The company I work for uses the AT91RM9200 on custom-designed boards in > 8 products, all with substantially similar board designs. So far we've > tested these changes on 4 of them, with no problems found. > > I have not tested with 4-bit enabled; I wasn't aware (but in retrospect > I probably should have assumed) that the hardware bugs are different > with 4-bit enabled. I'm not even sure our hardware design carries all 4 > lines to the card; I'll look at the schematics and if they're connected > I'll see about testing that mode. (And if they're not I'll see about > having our designers wire up all 4 lines on future designs.) > > I also haven't tested with the SAM9-series, because I don't have that > hardware available. (I hope to convince our hardware designers to > migrate us to SAM9 this year.) > With the current code (prepatch) 4bit mode is known to work at least on the SAM9G20 with kernel option AT91_MCI_HAS_4WIRE. I'll be working on the SAM9G20 in the next few days and I can test the patch on both a RM9200 (1 bit only) and on a couple of SAM9G20 designs with 4bit hardware. Greg