From patchwork Fri Jan 25 07:21:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuo-Jung Su X-Patchwork-Id: 215568 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7B9B42C008D for ; Fri, 25 Jan 2013 18:22:31 +1100 (EST) Received: from localhost ([::1]:55134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TydcL-00073f-JH for incoming@patchwork.ozlabs.org; Fri, 25 Jan 2013 02:22:29 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tydc7-00072j-FS for qemu-devel@nongnu.org; Fri, 25 Jan 2013 02:22:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tydc2-0008WN-Bf for qemu-devel@nongnu.org; Fri, 25 Jan 2013 02:22:15 -0500 Received: from mail-pb0-f54.google.com ([209.85.160.54]:53849) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tydc2-0008WJ-4y for qemu-devel@nongnu.org; Fri, 25 Jan 2013 02:22:10 -0500 Received: by mail-pb0-f54.google.com with SMTP id rr4so48723pbb.41 for ; Thu, 24 Jan 2013 23:22:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=FFsNpVpk9c0YorJvIQ6K1qHt+Dy+Ith5eQA7QlF+6z4=; b=eM9L1NiXMomS67qZxswub8o2LlPIY8uADkkXKUXHrMoQ5Qo5/Q6PoAVQIhNKdCRxyA WH/xA2Dv2RaBaZT65roFbzQqFh318HZTmyp/ktUyAxED2BkN0HwmlmTQv+5V0vJPFWCG dEMZjuiECfgte0ijZFSnn+XFtQeO4LfNknfzUAzYu2uB1Hd8nN4yxCOSKrzdOASm0pc1 TKGtca0zSw0aOiJCWR3s4wnyFVxe8VslC5CM1UlXGQnK07UjDIIEoiTTPW4e/zZkUmIe QJ+TGO2zAZ+hETmYcivmJSY11rrYqv1JpKxUisSmq7iTsYJnEWlf/wlB+G30IvzG5qYt Zl/g== X-Received: by 10.68.220.6 with SMTP id ps6mr11952882pbc.80.1359098529435; Thu, 24 Jan 2013 23:22:09 -0800 (PST) Received: from localhost.localdomain ([220.132.37.35]) by mx.google.com with ESMTPS id pv8sm169312pbc.26.2013.01.24.23.22.07 (version=TLSv1 cipher=DES-CBC3-SHA bits=168/168); Thu, 24 Jan 2013 23:22:08 -0800 (PST) From: Kuo-Jung Su To: qemu-devel@nongnu.org Date: Fri, 25 Jan 2013 15:21:32 +0800 Message-Id: <1359098492-11044-1-git-send-email-dantesu@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1358490020-18061-2-git-send-email-dantesu@faraday-tech.com> References: <1358490020-18061-2-git-send-email-dantesu@faraday-tech.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.160.54 Cc: balrog@zabor.org, Kuo-Jung Su Subject: [Qemu-devel] [PATCH v2] hw/nand.c: bug fix to erase operation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Kuo-Jung Su The s->addr should be reset along with the s->addrlen, or it might contains the previous address at last address cycle, and causes problem to nand erase operation. Signed-off-by: Kuo-Jung Su Cc: balrog@zabor.org --- Changes for v2: - coding style fix --- hw/nand.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/nand.c b/hw/nand.c index 4ddb22b..cbc45cc 100644 --- a/hw/nand.c +++ b/hw/nand.c @@ -510,6 +510,7 @@ void nand_setio(DeviceState *dev, uint32_t value) nand_command(s); if (s->cmd != NAND_CMD_RANDOMREAD2) { + s->addr = 0; s->addrlen = 0; } }