From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSoOV-0002Xz-Gb for qemu-devel@nongnu.org; Mon, 08 Feb 2016 11:10:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSoOU-00016g-Di for qemu-devel@nongnu.org; Mon, 08 Feb 2016 11:10:31 -0500 Date: Mon, 8 Feb 2016 16:10:21 +0000 From: Stefan Hajnoczi Message-ID: <20160208161021.GF31586@stefanha-x1.localdomain> References: <1453225191-11871-1-git-send-email-jsnow@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="L2Brqb15TUChFOBK" Content-Disposition: inline In-Reply-To: <1453225191-11871-1-git-send-email-jsnow@redhat.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v2 0/6] ide: fix atapi software reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: kwolf@redhat.com, pbonzini@redhat.com, stefanha@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org --L2Brqb15TUChFOBK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 19, 2016 at 12:39:45PM -0500, John Snow wrote: > The ATAPI software reset function is implemented somewhat lackadaisically. >=20 > Firstly, it is valid only for ATAPI drives - not HDs. If a HD should > receive this command while BSY, it should be ignored like any other > command instead of aborted. A non-BSY HD is free to abort the command > in the usual fashion to indicate it doesn't understand or doesn't support > that command. >=20 > Second, for drives that should accept a software reset, they should not > "forget" about all pending AIO during the reset. Since a software reset > resets the DRQ and BSY flags, it is possible to 'stack' multiple > concurrent reads using DMA and alternately chaining software reset and > DMA reads. We mustn't reset BSY/DRQ until we are confident that we > have canceled existing AIO. >=20 > Third, the existing software reset routine does not perform a very > rigorous reset. >=20 > This series corrects this by: >=20 > (1) Correcting ide_exec_cmd to correctly ignore, not abort, software > reset commands for ide-hd devices that are busy executing a command. >=20 > (2) Improving the software reset routine to cancel buffered DMA, then > fall back to synchronously waiting for any pending DMA to finish > before returning, insuring that the reset completes sanely. >=20 > (3) Use existing reset routines to comprehensively reset the device. >=20 > Reported-by: Kevin Wolf > Signed-off-by: John Snow >=20 > _________________________________________________________________________= _______ >=20 > For convenience, this branch is available at: > https://github.com/jnsnow/qemu.git branch ide-reset-fix > https://github.com/jnsnow/qemu/tree/ide-reset-fix >=20 > This version is tagged ide-reset-fix-v2: > https://github.com/jnsnow/qemu/releases/tag/ide-reset-fix-v2 >=20 > John Snow (6): > ide: Prohibit RESET on IDE drives > ide: code motion > ide: move buffered DMA cancel to core > ide: replace blk_drain_all by blk_drain > ide: Add silent DRQ cancellation > ide: fix device_reset to not ignore pending AIO >=20 > hw/ide/core.c | 215 ++++++++++++++++++++++++++++++++++++------------= ------ > hw/ide/internal.h | 1 + > hw/ide/pci.c | 36 +-------- > 3 files changed, 144 insertions(+), 108 deletions(-) >=20 > --=20 > 2.4.3 >=20 >=20 Reviewed-by: Stefan Hajnoczi --L2Brqb15TUChFOBK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJWuL3tAAoJEJykq7OBq3PIiRgH/jz56nto/hNYScjhDb8prjK/ D5kn70ei+td9HXopOaS4IZZR/N5wHdfVOMEzY2EgrObW3Ui1EqAb6wHo5BbxPPCx CETYPZHLk9VjFNCeen6uxToj+0L5OE3esHMmqkjE9MHHcFYKutlWVtHiY0PnLmHe QLbipRQprluFRXSu++sDcUD8hlCtgVtuB396mHYR9W++QWjMzJg0f2JK4Z4ayhv8 wKO/ja8gfODVjnenc7dOSw1i1nCikn32dTu1iie58Qn5CR0baVuRdsGPzsFancQq dNmLLZqEp+nn/X7/O+gPlE6wECnC4ShOO19zNENqFHnM96fSfOg/AXEn1xfwnRI= =fal6 -----END PGP SIGNATURE----- --L2Brqb15TUChFOBK--