From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116034 invoked by alias); 12 Jan 2017 16:23:51 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 116022 invoked by uid 89); 12 Jan 2017 16:23:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*i:sk:b94a8bc, H*f:sk:b94a8bc, H*MI:sk:b94a8bc X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Jan 2017 16:23:49 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6CC8D12B27; Thu, 12 Jan 2017 16:23:49 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0CGNmMX013637; Thu, 12 Jan 2017 11:23:48 -0500 Subject: Re: [PATCH, v2] Add command to erase all flash memory regions To: Luis Machado , gdb-patches@sourceware.org References: <1483988641-27277-1-git-send-email-lgustavo@codesourcery.com> <84c7a2e2-ca66-a7ea-1a84-c355559a47b9@redhat.com> From: Pedro Alves Message-ID: Date: Thu, 12 Jan 2017 16:23:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-01/txt/msg00242.txt.bz2 On 01/11/2017 06:55 PM, Luis Machado wrote: > On 01/10/2017 12:22 PM, Pedro Alves wrote: >> I was wondering how this is supposed to work if the command >> is interrupted w/ ctrl-c midway. If the command is interrupted before >> sending the vFlashDone RSP command, then it seems to me that the stub >> is doing to get confused, since it seems there's no RSP command to >> mean "I'm starting a batch of flash operations from scratch, forget >> any stale list of pending vFlashWrite/vFlashErase ops you may have. >> Am I missing something that prevents that from happening? > > Yeah, that scenario can indeed happen if one interrupts the flash > programming midway. It is a bit of an oversight in the design of this > functionality i think. > > The target stub, as it is today, will not be too confused about this. > The memory regions will be appended to a list and the stub will wait for > the vFlashDone packet to commit the changes. > > The way the commit process is implemented will attempt to combine > writes/deletions in a single operation. So, in the worst case, the stub > will only execute these operations next time it sees vFlashDone. > > Not ideal, but it is how it works nowadays. Hmm, indeed. Not as bad as I first though. Thanks. -- Pedro Alves