From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUZ8l-0000Sl-5Q for qemu-devel@nongnu.org; Wed, 16 May 2012 03:59:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SUZ8f-0004cZ-2h for qemu-devel@nongnu.org; Wed, 16 May 2012 03:59:22 -0400 Received: from e28smtp04.in.ibm.com ([122.248.162.4]:54732) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUZ8c-0004aX-5C for qemu-devel@nongnu.org; Wed, 16 May 2012 03:59:16 -0400 Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 16 May 2012 13:29:01 +0530 Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q4G7wxnS4063584 for ; Wed, 16 May 2012 13:28:59 +0530 Received: from d28av05.in.ibm.com (loopback [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q4GDTSMF013395 for ; Wed, 16 May 2012 23:29:29 +1000 Message-ID: <4FB35E40.8010503@linux.vnet.ibm.com> Date: Wed, 16 May 2012 15:58:56 +0800 From: Zhi Hui Li MIME-Version: 1.0 References: <1337073445-9679-1-git-send-email-zhihuili@linux.vnet.ibm.com> <1337073445-9679-3-git-send-email-zhihuili@linux.vnet.ibm.com> <4FB22171.7050104@redhat.com> In-Reply-To: <4FB22171.7050104@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 2/3 v6] Replace bdrv_* to bdrv_aio_* functions in DMA mode in fdc.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: zhihuili@cn.ibm.com, =?UTF-8?B?SGVydsOpIFBvdXNzaW5lYXU=?= , qemu-devel@nongnu.org On 2012年05月15日 17:27, Paolo Bonzini wrote: > Il 15/05/2012 11:17, Li Zhi Hui ha scritto: >> Signed-off-by: Paolo Bonzini >> Signed-off-by: Li Zhi Hui >> --- >> hw/fdc.c | 313 +++++++++++++++++++++++++++++++++++++++++-------------------- >> 1 files changed, 210 insertions(+), 103 deletions(-) > > To reviewers, this is obviously missing migration support. :) > Yes, you are right. I am sorry that I am a newer, I don't know more about migration, so I want to send some simple code first . > It is also missing a good commit message. It should say that the > support in the existing code for scan commands has a lot of "weirdness", > for example: > > - if ((ret< 0&& fdctrl->data_dir == FD_DIR_SCANL) || > - (ret> 0&& fdctrl->data_dir == FD_DIR_SCANH)) { > - status2 = 0x00; > - goto end_transfer; > > ... > > - end_transfer: > - len = fdctrl->data_pos - start_pos; > - FLOPPY_DPRINTF("end transfer %d %d %d\n", > - fdctrl->data_pos, len, fdctrl->data_len); > - if (fdctrl->data_dir == FD_DIR_SCANE || > - fdctrl->data_dir == FD_DIR_SCANL || > - fdctrl->data_dir == FD_DIR_SCANH) > - status2 = FD_SR2_SEH; > > which blindly overwrites status2. Hence the new code was not written > based on it. However, the new code is untested as far as I know. > Ok, I will add the commit message. >> + if (fdctrl->data_dir == FD_DIR_SCANE || >> + fdctrl->data_dir == FD_DIR_SCANL || >> + fdctrl->data_dir == FD_DIR_SCANH) { >> + fdctrl->dma_status2 = FD_SR2_SEH; >> + } > > This should be FD_SR2_SNS (Spec for the FDC is at > http://www.cepece.info/amstrad/docs/i8272/8272sp.htm: "If the conditions > for scan are not met between the the starting sector (as specified by R) > and the last sector on the cylinder (EOT), then the FDC sets the SN > (Scan Not Satisfied) flag of Status Register 2 to a 1 (high), and > terminates the Scan Command"). > ok. Thank you very much for your feedback. :)