From patchwork Thu Jul 11 15:56:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11040361 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9D21C13A4 for ; Thu, 11 Jul 2019 15:57:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EAF528B20 for ; Thu, 11 Jul 2019 15:57:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8324428B22; Thu, 11 Jul 2019 15:57: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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E18EE28B25 for ; Thu, 11 Jul 2019 15:57:33 +0000 (UTC) Received: from localhost ([::1]:43020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlbRs-0004GX-Lb for patchwork-qemu-devel@patchwork.kernel.org; Thu, 11 Jul 2019 11:57:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33274) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlbRh-0003eo-Md for qemu-devel@nongnu.org; Thu, 11 Jul 2019 11:57:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hlbRg-0006NY-Go for qemu-devel@nongnu.org; Thu, 11 Jul 2019 11:57:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33688) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hlbRb-0006Jn-D2; Thu, 11 Jul 2019 11:57:15 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 922CC3082E64; Thu, 11 Jul 2019 15:57:12 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-150.brq.redhat.com [10.40.204.150]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0A1B95D9CC; Thu, 11 Jul 2019 15:57:06 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: "Dr . David Alan Gilbert" , qemu-devel@nongnu.org Date: Thu, 11 Jul 2019 17:56:58 +0200 Message-Id: <20190711155703.15627-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 11 Jul 2019 15:57:12 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH-for-4.1 v4 0/5] hw/block/pflash_cfi01: Add DeviceReset() handler X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The pflash device lacks a reset() function. When a machine is resetted, the flash might be in an inconsistent state, leading to unexpected behavior: https://bugzilla.redhat.com/show_bug.cgi?id=1678713 Resolve this issue by adding a DeviceReset() handler. Fix also two minor issues, and clean a bit the codebase. Since v1: https://lists.gnu.org/archive/html/qemu-devel/2019-05/msg00962.html - addressed Laszlo review comments Since v2: - consider migration (Laszlo, Peter) Since v3: - more reliable migration (Dave) - dropped patches 6-9 not required for next release $ git backport-diff -u v3 Key: [----] : patches are identical [####] : number of functional differences between upstream/downstream patch [down] : patch is downstream-only The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively 001/5:[----] [--] 'hw/block/pflash_cfi01: Removed an unused timer' 002/5:[0048] [FC] 'hw/block/pflash_cfi01: Use the correct READ_ARRAY value' 003/5:[----] [--] 'hw/block/pflash_cfi01: Extract pflash_mode_read_array()' 004/5:[----] [--] 'hw/block/pflash_cfi01: Start state machine as READY to accept commands' 005/5:[----] [--] 'hw/block/pflash_cfi01: Add the DeviceReset() handler' Regards, Phil. Philippe Mathieu-Daudé (5): hw/block/pflash_cfi01: Removed an unused timer hw/block/pflash_cfi01: Use the correct READ_ARRAY value hw/block/pflash_cfi01: Extract pflash_mode_read_array() hw/block/pflash_cfi01: Start state machine as READY to accept commands hw/block/pflash_cfi01: Add the DeviceReset() handler hw/block/pflash_cfi01.c | 109 +++++++++++++++++++++++++++------------- hw/block/trace-events | 1 + 2 files changed, 75 insertions(+), 35 deletions(-)