From patchwork Sun Aug 15 14:38:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 177042 Return-path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on void.printf.net X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.9 tests=RCVD_IN_DNSWL_LOW autolearn=disabled version=3.2.5 Envelope-to: chris@printf.net Delivery-date: Sun, 15 Aug 2010 16:49:50 +0100 Received: from lists.laptop.org ([18.85.2.145] helo=mail.laptop.org) by void.printf.net with esmtp (Exim 4.69) (envelope-from ) id 1OkfT3-0003t2-UZ for chris@printf.net; Sun, 15 Aug 2010 16:49:50 +0100 Received: by mail.laptop.org (Postfix) id C1E47240DB; Sun, 15 Aug 2010 11:49:31 -0400 (EDT) Delivered-To: cjb@laptop.org Received: from spam.laptop.org (spam.laptop.org [18.85.46.23]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.laptop.org (Postfix) with ESMTPS id AB759240D9 for ; Sun, 15 Aug 2010 11:49:31 -0400 (EDT) X-ASG-Debug-ID: 1281887388-0b7435710001-zHW3sV Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by spam.laptop.org with ESMTP id gXemBeDqI3BhBZez for ; Sun, 15 Aug 2010 11:49:48 -0400 (EDT) X-Barracuda-Envelope-From: linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758036Ab0HOPtr (ORCPT ); Sun, 15 Aug 2010 11:49:47 -0400 Received: from smtp.nokia.com ([192.100.122.233]:42749 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757815Ab0HOPtq (ORCPT ); Sun, 15 Aug 2010 11:49:46 -0400 Received: from mgw-mx09.nokia.com ([192.100.105.134]) by mgw-mx06.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o7FF4Kbu001127 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 15 Aug 2010 18:04:22 +0300 Received: from vaebh105.NOE.Nokia.com (vaebh105.europe.nokia.com [10.160.244.31]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o7FEct8B019693; Sun, 15 Aug 2010 09:38:58 -0500 Received: from vaepf101.NOE.Nokia.com ([10.160.244.86]) by vaebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.4675); Sun, 15 Aug 2010 17:38:57 +0300 Received: from [10.162.253.100] ([10.162.253.100]) by vaepf101.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.4675); Sun, 15 Aug 2010 17:38:57 +0300 Message-ID: <4C67FC00.8080207@nokia.com> Date: Sun, 15 Aug 2010 17:38:56 +0300 From: Adrian Hunter User-Agent: Thunderbird 2.0.0.24 (X11/20100411) MIME-Version: 1.0 To: Arnd Hannemann CC: "linux-mmc@vger.kernel.org" X-ASG-Orig-Subj: Re: Bug in mmc_test or host driver? Subject: Re: Bug in mmc_test or host driver? References: <4C657FA1.9090705@arndnet.de> In-Reply-To: <4C657FA1.9090705@arndnet.de> X-OriginalArrivalTime: 15 Aug 2010 14:38:57.0104 (UTC) FILETIME=[978CF500:01CB3C87] X-Nokia-AV: Clean Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Barracuda-Connect: vger.kernel.org[209.132.180.67] X-Barracuda-Start-Time: 1281887388 X-Barracuda-URL: http://18.85.46.23:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at laptop.org X-Barracuda-Spam-Score: 0.50 X-Barracuda-Spam-Status: No, SCORE=0.50 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=5.5 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.38043 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c index 5dd8576..4fb8b10 100644 --- a/drivers/mmc/card/mmc_test.c +++ b/drivers/mmc/card/mmc_test.c @@ -1328,6 +1328,10 @@ static int mmc_test_area_init(struct mmc_test_card *test, int erase, int fill) t->max_sz = TEST_AREA_MAX_SIZE; else t->max_sz = (unsigned long)test->card->pref_erase << 9; + if (t->max_sz >> 9 > test->card->host->max_blk_count) + t->max_sz = test->card->host->max_blk_count << 9; + if (min_sz > t->max_sz) + min_sz = t->max_sz; /* * Try to allocate enough memory for the whole area. Less is OK * because the same memory can be mapped into the scatterlist more than