From patchwork Wed Jun 15 13:41:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: marcin.krzeminski@nokia.com X-Patchwork-Id: 9178605 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C148D604DB for ; Wed, 15 Jun 2016 14:13:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2E1E27DA4 for ; Wed, 15 Jun 2016 14:13:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7C7827E5A; Wed, 15 Jun 2016 14:13:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7383727DA4 for ; Wed, 15 Jun 2016 14:13:33 +0000 (UTC) Received: from localhost ([::1]:42425 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDBZU-00052G-C6 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 15 Jun 2016 10:13:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDBZ1-0004zv-K0 for qemu-devel@nongnu.org; Wed, 15 Jun 2016 10:13:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDBYx-00019r-T6 for qemu-devel@nongnu.org; Wed, 15 Jun 2016 10:13:02 -0400 Received: from mail-am1on0105.outbound.protection.outlook.com ([157.56.112.105]:20832 helo=emea01-am1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDBYx-00019T-BE for qemu-devel@nongnu.org; Wed, 15 Jun 2016 10:12:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=2KQJUfSx0kXbi21oWM7NW7PL8g6EHXDtV774Ei7AHoU=; b=GQk61Svx5aYImc549nmLv0QYZAtGuapSn1cnmNGA4E/X3i0L929VUoqcTHUGPtwLbXcnTjMTHsIUYnD3ZD3yQKLDCaQua24iNiP/WQgAx85/vdWykizEToxvOJq2goHPM7JMEhlqYAHOobKrq6nrsQFHDNdGtcJvLIEG2S7Yb44= Received: from HE1PR0701CA0036.eurprd07.prod.outlook.com (10.165.214.174) by AM2PR07MB0899.eurprd07.prod.outlook.com (10.161.71.20) with Microsoft SMTP Server (TLS) id 15.1.517.8; Wed, 15 Jun 2016 13:42:45 +0000 Received: from AM1FFO11OLC005.protection.gbl (2a01:111:f400:7e00::196) by HE1PR0701CA0036.outlook.office365.com (2603:10a6:3:5::46) with Microsoft SMTP Server (TLS) id 15.1.517.8 via Frontend Transport; Wed, 15 Jun 2016 13:42:45 +0000 Authentication-Results: spf=pass (sender IP is 131.228.2.240) smtp.mailfrom=nokia.com; nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=pass action=none header.from=nokia.com; Received-SPF: Pass (protection.outlook.com: domain of nokia.com designates 131.228.2.240 as permitted sender) receiver=protection.outlook.com; client-ip=131.228.2.240; helo=mailrelay.int.nokia.com; Received: from mailrelay.int.nokia.com (131.228.2.240) by AM1FFO11OLC005.mail.protection.outlook.com (10.174.64.132) with Microsoft SMTP Server (TLS) id 15.1.511.7 via Frontend Transport; Wed, 15 Jun 2016 13:42:44 +0000 Received: from fihe3nok0734.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id u5FDfn0c004088 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 15 Jun 2016 16:41:49 +0300 Received: from CNU418C7XK.nsn-intra.net ([10.154.155.220]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id u5FDfkX8004036; Wed, 15 Jun 2016 16:41:49 +0300 X-HPESVCS-Source-Ip: 10.154.155.220 From: To: Date: Wed, 15 Jun 2016 15:41:06 +0200 Message-ID: <1465998071-7355-5-git-send-email-marcin.krzeminski@nokia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1465998071-7355-1-git-send-email-marcin.krzeminski@nokia.com> References: <1465998071-7355-1-git-send-email-marcin.krzeminski@nokia.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:131.228.2.240; IPV:NLI; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(7916002)(2980300002)(438002)(189002)(199003)(2950100001)(19580395003)(19580405001)(356003)(77096005)(106466001)(110136002)(229853001)(2351001)(50466002)(97736004)(33646002)(189998001)(11100500001)(8936002)(86152002)(36756003)(16796002)(50226002)(87936001)(68736007)(22756006)(5003940100001)(2906002)(4326007)(76176999)(586003)(48376002)(50986999)(2876002)(86362001)(92566002)(6806005)(5008740100001)(53416004)(8676002)(47776003)(81166006)(81156014); DIR:OUT; SFP:1102; SCL:1; SRVR:AM2PR07MB0899; H:mailrelay.int.nokia.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; CAT:NONE; LANG:en; CAT:NONE; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11OLC005; 1:xSJHAd30ZyCcC8/RwrnZnqDhZQjQwYXTqnqrToKGLV2TCevOfnO8V9CLSA+09xQbCHC9e6UcqJYndaVcrVsVh2+EorYTWqv2Xb9byW4eKSYE2N5LakbKxk9wh2SdxYfK8eHgFIQxl8sWHkIiDbfFN4yQ9R+4FzRaEFWpuzNVRqfb8I/W1S4J7APSCGddvwxo7kJ3deS40YaEEHk8uRgsy4Kk10dCRBw7ucGLBPokt2+AJScYhNpKUjjq4GeD8m7GNyNO9BjjnZiIgAYUd7IbeiwP4oV5ttDDHFdH5HSfWwCW7/8ruUc9n632uLGnIZpcCjoA0L3hdrKUc57L+pfzd5VsiYNEytDUdcSMs3tO1WZMQrh6y6grhAx6t632Gwt8NpQuob4ArouOIJsQX824leoBo58CMRacAdNejSmn1E15CFYA5WdI1Iir9WfJV3/YelfZ5/kqwPba1G1J2sxfPJop09/quRHnZiZLQdHqQYw= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: fe104617-fd8f-4e02-3c30-08d39522ee4c X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0899; 2:bDbqXIYH/rwzZs/1hYWTSPUJSJ0xZAtKvec1ZCf5oMfLwT2d4KXlGpiE2OpQp6zGsY92oqhFAmqpYv3aj6UQThAaL1W9iJn/tT2eFwufm8a1OwfuZ0Us9v0TzIJsJG6plTWzoyTQsIPe4ZHaFNcOIbxb4AHBxPeA6au18hal0+GDWdr6N6ufEFxrrFcZw02x; 3:LOx+OupngAuYrxlr3N+7ef3eYTi/no6s5lCrpBOKP1c1IVyFUm653uzK14IrUxDhqESGyeE18/KrTvZLP3ArGMY+Hu3N1PwWMsP7XklRzvVpUPWozz3DPL9omuKAhbk0kRpimtXkaNloKhLsz/EwKurUUMa0OstmpHs96tm8JC10k0uls1mHO0MR4CsNx+KAFPNaLZabWN/QjJV14IZNNhvVixA2G3IsPHNob01rD6pDiB7LQWmRCApizanKQiQGR+6ET2hXjcqutkPdMU8Zgg== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:AM2PR07MB0899; X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0899;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XsZxk++PKUt0siytIv7IlKva7dXejF7j06kenFhu4kuz+zczHEjgX3H54Iv2H3Cuzk+6Qyj5KapqS8uU5QM0tkCca0U4hxlAAMlRSQzRp8jS6iQx3UOCV0zToH1dU9iQlgICxWb+g2oZlepneDXV/fYLuutUZhkiwFBJYyj9zeslWjd9jorLP4sF1hIsXNO/8E5XLz4SvINLAhQ5OUQLsDRxcOmfbJhNyu3UFe5f6wMsNkk38KVG9CiO+MQZuhMEIdUGT7pJWcyZrMWgo+mM1dGLuuBO3pfsZE3jNoRQnP4a7GycprKaViSKTREl2gadysivpCJj1RioYH4x5JruziruiEZRcXYml+qZj0QTWmCo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(82608151540597); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(10201501046)(3002001); SRVR:AM2PR07MB0899; BCL:0; PCL:0; RULEID:; SRVR:AM2PR07MB0899; X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0899; 4:kRwwiG7P427NPRebBlPAtE3peC1b4aMG1sCtM28pOjRTFb5CV1zX5KIDjfhYT4cSJQZnSOG4IRNRrAhv4vjnTxU1qpDC1JzUMW3gqX4T0UFxquod15zpGBuKL9+1veP6utfdC3JF3kr3D4rEwSM2dbnmw+UlRDaO4uNguyobGMLngRXPq8W5fGMDaILWpuNiLwoEeph5kMDcK7FrECzTg3lYajvq3R8Etq1g15RyBSwXsxPQtu+LpxUblYnnADz7JIPLbNe5byK/5hMkYxs26wBPi5vh8hAxJePJbrsHSEPSmQ4PKX4B5fGT7rPmNdoJrhAwgaYVgkZl6tCe+6OzFqMKIvJH/QSMHRy8b+zfaVGcvnNvCfHPVqGP0U+9PhA7GuVCoEjsQNhdyiewcfRPC7fcN+onnoCcmyncGw+YImnmhLrjHwqt3tnyy4pSw+qWXFNOx2wUETpnTLJ63pnT4Q== X-Forefront-PRVS: 09749A275C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM2PR07MB0899; 23:eqi5pz+2SBLyleaJ2GIJ8RDjE5gLFw95ADa4L1WDi?= =?us-ascii?Q?PMA5qHaEmpAH+TFvgdaAy49VsTtvJvXok352dcbvzkcFKMJA/spUpf/pXI2f?= =?us-ascii?Q?H+a+IoqGGBx30D17tE6ZiruzAGb2fSE1hkor5GIi6fGy1junIericLAm/l2f?= =?us-ascii?Q?8osj6Nx3ozMUgCViTAijSlyndv3DPR07+qjUuXvJMBSMrefZGKlXDG8UZKdx?= =?us-ascii?Q?Kmtwlph2Knp1IVg0vXFPYNsdMka22XV+kyT4m6WkZvZFBwobLUeWXq91XvSB?= =?us-ascii?Q?bTiiZRIVqSN+1YLzdzbDf0aU7SF56ls7fN13azK+F00SqP+liWnBEMKxJOpu?= =?us-ascii?Q?g602jivWoqnu0UcIgVoSIj8BYRXf8RhecYlRXQg+6AOuorWDNw9krDqmsmy+?= =?us-ascii?Q?P3Qu9kdUCwbh9UcWKsqo/Di5MGrigR4KIPQuPxmrCPUhJbtEXI6XlHE+1eep?= =?us-ascii?Q?5LDal/rcLy8Okbmgeb0VBqvi4QefPmW+9owofA8D+kZtGNMLYtDvhvm8pTQB?= =?us-ascii?Q?aqQRNCLnfCLLfoQdlONISNxm3EgoPwvSTnmmWn+yjxA0aYaTHH4vcFa69TXf?= =?us-ascii?Q?FP34eGiawnmVFo+Zgl6oyEQ/hMV/JOg+LF04otzI6WTYxVTfNshh88Lb41B6?= =?us-ascii?Q?YJjyjkerPrO4crmndqlxgjGnfTcebCf+gzdrH8ysHeF00AmG/bXPkc1wUMVH?= =?us-ascii?Q?jBhR70Zhy9UEvDk5tm+W4G0jojf5Oz83TonMR5rCkyca+M7CIrli/NMZczqQ?= =?us-ascii?Q?RWxCu6hPEAnvhZKlglFhWosQ4krg9eYU0+0kgXj8Mm0HbF+i2sLOCSfIk5Zj?= =?us-ascii?Q?FhfoB6YlkgidZvrBT1G+NkWjCXr5LzlDf6A81DI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0/JqGxAZVerpsLB0fub+ykpEC7JRYPylnTwHSMdmWzZf+15TVW3EQZOZvZpbYaIbkG3Bv3KJDxoL46chHQkRG5Q== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2016 13:42:44.7211 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.240]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR07MB0899 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 157.56.112.105 Subject: [Qemu-devel] [PATCH 4/9] m25p80: Introduce COLLECTING_VAR_LEN_DATA state. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, crosthwaitepeter@gmail.com, clg@fr.ibm.com, rfsw-patches@mlist.emea.nsn-intra.net, pawel.lenkow@itlen.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Marcin Krzeminski Some flash allows to stop read at any time. Allow framework to support this. Signed-off-by: Marcin Krzeminski Reviewed-by: Cédric Le Goater --- 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 = M25P80(ss); if (select) { + if (s->state == STATE_COLLECTING_VAR_LEN_DATA) { + complete_collecting_data(s); + } s->len = 0; s->pos = 0; s->state = 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] = (uint8_t)tx; s->len++;