From mboxrd@z Thu Jan 1 00:00:00 1970 From: Troy Kisky Date: Mon, 23 Mar 2015 13:08:56 -0700 Subject: [U-Boot] [PATCH 4/6] mmc: Continue polling MMC card for OCR only if it is still not ready In-Reply-To: <000001d0653c$5c8f6950$15ae3bf0$@mentor.com> References: <000001d0653c$5c8f6950$15ae3bf0$@mentor.com> Message-ID: <551072D8.4090802@boundarydevices.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 3/23/2015 12:38 AM, Andrew Gabbasov wrote: > Hi Troy, > >> From: Troy Kisky [mailto:troy.kisky at boundarydevices.com] >> Sent: Friday, March 20, 2015 9:39 PM >> To: Peng.Fan at freescale.com; Gabbasov, Andrew; u-boot at lists.denx.de >> Cc: Eric Nelson >> Subject: Re: [U-Boot] [PATCH 4/6] mmc: Continue polling MMC card for OCR >> only if it is still not ready >> >> [skipped] >> >> Here's another patch that solves the problem a little earlier. It has this >> disadvantage of being slightly bigger, though it makes the code look > better. >> >> https://github.com/boundarydevices/u-boot-imx6/commit/c0260ca >> > > I have a couple of doubts regarding that patch. > > First, my personal taste objects to such duplicating of the code > (I mean setting of version, ocr, rca, etc fields of mmc structure). > If we'll have to change or add anything to these settings, we'll have to > make > the same change in 2 different place, which is error-prone and extremely > inconvenient from maintenance point of view. > > Second, what about SPI mode? Doesn't this patch skip retrieving of OCR > register > with a special command for SPI host case (thus setting ocr field > incorrectly), > if the card comes to ready state with the first attempt? That's a good argument for a subroutine to be doing that work instead of in two places.