From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Wed, 13 Oct 2010 21:57:17 +0200 Subject: [U-Boot] [PATCH V3] mmc: seperate block number into small parts for multi-write cmd In-Reply-To: <1286811544-9312-1-git-send-email-leiwen@marvell.com> References: <20101011113513.A4B571508A2@gemini.denx.de> <1286811544-9312-1-git-send-email-leiwen@marvell.com> Message-ID: <20101013195717.5A4271365CC@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Lei Wen, In message <1286811544-9312-1-git-send-email-leiwen@marvell.com> you wrote: > Constraint the mmc framework to only send no more than 65535 > blocks in one go during the multi-write command. This constraint > comes due to the limitation of 16bit width block counter register > at some hardware. ... > @@ -123,7 +111,6 @@ mmc_bwrite(int dev_num, ulong start, lbaint_t blkcnt, const void*src) > data.flags = MMC_DATA_WRITE; > > err = mmc_send_cmd(mmc, &cmd, &data); > - > if (err) { > printf("mmc write failed\n\r"); > return err; Please don;t drop this empty line. > + do { > + /* The 65535 constraint comes from some hardware has > + * only 16 bit width block number counter */ Incorrect multi-line comment style. > + cur = (blocks_todo > 65535) ? 65535 : blocks_todo; > + if(mmc_write_blocks(mmc, start, cur, src) != cur) > + return -1; > + blocks_todo -= cur; > + start += cur; > + src += cur * mmc->write_bl_len; > + } while (blocks_todo > 0); > return blkcnt; Please add a blank line before the "return". Thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The games have always strengthened us. Death becomes a familiar pattern. We don't fear it as you do. -- Proconsul Marcus Claudius, "Bread and Circuses", stardate 4041.2