From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj3M5-0005Km-Hr for qemu-devel@nongnu.org; Thu, 24 Mar 2016 07:23:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aj3M0-0000sb-JE for qemu-devel@nongnu.org; Thu, 24 Mar 2016 07:23:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj3M0-0000sX-DS for qemu-devel@nongnu.org; Thu, 24 Mar 2016 07:23:04 -0400 References: <1458728792-15779-1-git-send-email-den@openvz.org> <1458728792-15779-2-git-send-email-den@openvz.org> <56F2FDE5.5020908@redhat.com> <56F3B249.50605@virtuozzo.com> From: Paolo Bonzini Message-ID: <56F3CE14.80300@redhat.com> Date: Thu, 24 Mar 2016 12:23:00 +0100 MIME-Version: 1.0 In-Reply-To: <56F3B249.50605@virtuozzo.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/3] ide: don't loose pending dma state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Butsykin , "Denis V. Lunev" , qemu-devel@nongnu.org Cc: John Snow On 24/03/2016 10:24, Pavel Butsykin wrote: >> For extra points, make ide_handle_rw_error convert IDE_DMA_* to >> IDE_RETRY_* so that the callers only need to pass in IDE_RETRY_DMA >> > You mean to do something like that: > > ide_handle_rw_error(s, -ret, s->dma_cmd | IDE_RETRY_DMA) Just ide_handle_rw_error(s, -ret, IDE_RETRY_DMA) and in ide_handle_rw_error if (op == IDE_RETRY_DMA) { if (s->dma_cmd == IDE_DMA_READ) op |= IDE_RETRY_READ; else if (s->dma_cmd == IDE_DMA_TRIM) op |= IDE_RETRY_TRIM; } But I'm not sure anymore this is a good idea. However, if it works, using dma_cmd would be better than using the dma_cb. Paolo