Re: [PATCH 2/2] mmc_block: ensure all sectors that do not haveerrors are read

From: Pierre Ossman
Date: Sun Dec 21 2008 - 09:29:34 EST


On Fri, 05 Dec 2008 13:09:11 +0200
Adrian Hunter <ext-adrian.hunter@xxxxxxxxx> wrote:

> @@ -281,6 +289,16 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
> brq.data.sg = mq->sg;
> brq.data.sg_len = mmc_queue_map_sg(mq);
>
> + /*
> + * Some drivers expect the sg list to be the same size as the
> + * request, which it won't be if we have fallen back to do
> + * one sector at a time.
> + */
> + if (disable_multi) {
> + brq.data.sg->length = 512;
> + brq.data.sg_len = 1;
> + }
> +
> mmc_queue_bounce_pre(mq);
>
> mmc_wait_for_req(card->host, &brq.mrq);

Unfortunately, there is no guarantee that the sg list will be sector
aligned. Look at the code removed in f3eb0aaa02 for how to handle this
properly.

Other than that, the patch looks ready to go.

Rgds
--
-- Pierre Ossman

WARNING: This correspondence is being monitored by the
Swedish government. Make sure your server uses encryption
for SMTP traffic and consider using PGP for end-to-end
encryption.

Attachment: signature.asc
Description: PGP signature