From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Ball Subject: Re: When bus width detection procedure takes place, kernel cannot lock on correct bus width Date: Fri, 22 Mar 2013 13:06:45 -0400 Message-ID: <87wqszl5y2.fsf@octavius.laptop.org> References: <87ip4qdybr.fsf@octavius.laptop.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from void.printf.net ([89.145.121.20]:34060 "EHLO void.printf.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161016Ab3CVRGu (ORCPT ); Fri, 22 Mar 2013 13:06:50 -0400 In-Reply-To: <87ip4qdybr.fsf@octavius.laptop.org> (Chris Ball's message of "Sun, 17 Mar 2013 08:07:20 -0400") Sender: linux-mmc-owner@vger.kernel.org List-Id: linux-mmc@vger.kernel.org To: elad.yi@gmail.com Cc: linux-mmc@vger.kernel.org, Philip Rakity Hi, On Sun, Mar 17 2013, Chris Ball wrote: > I've been working on a bringup of an new board in Harmonic Inc. > This board uses Sandisk iNand eMMC flash. > I've noticed that the mmc driver keeps detecting 1 bit width although HW > supports 4 bit, looked into it, and found the problem. In line 571 at mmc.c: > There is: > /* only compare read only fields */ > err = !((card->ext_csd.raw_partition_support == > bw_ext_csd[EXT_CSD_PARTITION_SUPPORT]) && > (card->ext_csd.raw_erased_mem_count == > bw_ext_csd[EXT_CSD_ERASED_MEM_CONT]) && > (card->ext_csd.rev == > bw_ext_csd[EXT_CSD_REV]) && > (card->ext_csd.raw_ext_csd_structure == > ... > > The problem is that raw_partition_support is not the same when setting width of > 4 bits instead of 1 bit, and shouldn't be compared at all although it is read > only. > this should be changed to: > /* only compare read only fields */ > err = !((card->ext_csd.raw_erased_mem_count == > bw_ext_csd[EXT_CSD_ERASED_MEM_CONT]) && > (card->ext_csd.rev == > bw_ext_csd[EXT_CSD_REV]) && > (card->ext_csd.raw_ext_csd_structure == > ... Philip, what do you think? Thanks, - Chris. -- Chris Ball One Laptop Per Child