From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDSQn-00053K-Iu for qemu-devel@nongnu.org; Thu, 16 Jun 2016 04:13:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDSQj-0003jI-8y for qemu-devel@nongnu.org; Thu, 16 Jun 2016 04:13:40 -0400 Received: from 15.mo3.mail-out.ovh.net ([87.98.150.177]:54902) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDSQj-0003j6-2A for qemu-devel@nongnu.org; Thu, 16 Jun 2016 04:13:37 -0400 Received: from player772.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo3.mail-out.ovh.net (Postfix) with ESMTP id 3D46DFF87D9 for ; Thu, 16 Jun 2016 10:13:36 +0200 (CEST) References: <1465998071-7355-1-git-send-email-marcin.krzeminski@nokia.com> <1465998071-7355-5-git-send-email-marcin.krzeminski@nokia.com> <576251AB.7030600@kaod.org> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: <57625FAB.3060708@kaod.org> Date: Thu, 16 Jun 2016 10:13:31 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 4/9] m25p80: Introduce COLLECTING_VAR_LEN_DATA state. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Krzeminski, Marcin (Nokia - PL/Wroclaw)" , "qemu-devel@nongnu.org" Cc: "crosthwaitepeter@gmail.com" , "pawel.lenkow@itlen.com" , "peter.maydell@linaro.org" On 06/16/2016 09:43 AM, Krzeminski, Marcin (Nokia - PL/Wroclaw) wrote: >=20 >=20 >> -----Original Message----- >> From: C=E9dric Le Goater [mailto:clg@kaod.org] >> Sent: Thursday, June 16, 2016 9:14 AM >> To: Krzeminski, Marcin (Nokia - PL/Wroclaw) >> ; qemu-devel@nongnu.org >> Cc: crosthwaitepeter@gmail.com; pawel.lenkow@itlen.com; >> peter.maydell@linaro.org >> Subject: Re: [PATCH 4/9] m25p80: Introduce COLLECTING_VAR_LEN_DATA >> state. >> >> On 06/15/2016 03:41 PM, marcin.krzeminski@nokia.com wrote: >>> From: Marcin Krzeminski >>> >>> Some flash allows to stop read at any time. >>> Allow framework to support this. >>> >>> Signed-off-by: Marcin Krzeminski >>> --- >>> hw/block/m25p80.c | 5 +++++ >>> 1 file changed, 5 insertions(+) >>> >>> diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index >>> 6910c52..ca1f882 100644 >>> --- a/hw/block/m25p80.c >>> +++ b/hw/block/m25p80.c >>> @@ -330,6 +330,7 @@ typedef enum { >>> STATE_PAGE_PROGRAM, >>> STATE_READ, >>> STATE_COLLECTING_DATA, >>> + STATE_COLLECTING_VAR_LEN_DATA, >>> STATE_READING_DATA, >>> } CMDState; >>> >>> @@ -872,6 +873,9 @@ static int m25p80_cs(SSISlave *ss, bool select) >>> Flash *s =3D M25P80(ss); >>> >>> if (select) { >>> + if (s->state =3D=3D STATE_COLLECTING_VAR_LEN_DATA) { >>> + complete_collecting_data(s); >>> + } >> >> So for example, we could trigger an erase without a completed address = ? >> >> C. > Yes if you explicitly want that. This is new state and you need to go > into it in decode_new_cmd. > For now this is only used in WRSR command only. OK. I see and I understand the use in that case. Reviewed-by: C=E9dric Le Goater C. >=20 > Thanks, > Marcin >> >>> s->len =3D 0; >>> s->pos =3D 0; >>> s->state =3D STATE_IDLE; >>> @@ -905,6 +909,7 @@ static uint32_t m25p80_transfer8(SSISlave *ss, >> uint32_t tx) >>> break; >>> >>> case STATE_COLLECTING_DATA: >>> + case STATE_COLLECTING_VAR_LEN_DATA: >>> s->data[s->len] =3D (uint8_t)tx; >>> s->len++; >>> >=20