Author: mav
Date: Mon Jun 17 14:55:02 2013
New Revision: 251850
URL: http://svnweb.freebsd.org/changeset/base/251850

Log:
  MFC r251661:
  Replicate r242422 from ata(4) to mvs(4):
  Only four specific ATA PIO commands transfer several sectors per DRQ block
  (interrupt).  All other ATA PIO commands transfer one sector or 512 bytes
  at one time.  Hardcode these exceptions in mvs(4).
  This fixes timeout of READ LOG EXT command used by `smartctl -x /dev/adaX`.
  Also it fixes timeout of DOWNLOAD_MICROCODE on `camcontrol fwdownload`.

Modified:
  stable/9/sys/dev/mvs/mvs.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/mvs/mvs.c
==============================================================================
--- stable/9/sys/dev/mvs/mvs.c  Mon Jun 17 14:52:39 2013        (r251849)
+++ stable/9/sys/dev/mvs/mvs.c  Mon Jun 17 14:55:02 2013        (r251850)
@@ -894,7 +894,7 @@ mvs_legacy_intr(device_t dev, int poll)
                    if (ccb->ataio.dxfer_len > ch->donecount) {
                        /* Set this transfer size according to HW capabilities 
*/
                        ch->transfersize = min(ccb->ataio.dxfer_len - 
ch->donecount,
-                           ch->curr[ccb->ccb_h.target_id].bytecount);
+                           ch->transfersize);
                        /* If data write command - put them */
                        if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) {
                                if (mvs_wait(dev, ATA_S_DRQ, ATA_S_BUSY, 1000) 
< 0) {
@@ -1344,8 +1344,14 @@ mvs_legacy_execute_transaction(struct mv
                        return;
                }
                ch->donecount = 0;
-               ch->transfersize = min(ccb->ataio.dxfer_len,
-                   ch->curr[port].bytecount);
+               if (ccb->ataio.cmd.command == ATA_READ_MUL ||
+                   ccb->ataio.cmd.command == ATA_READ_MUL48 ||
+                   ccb->ataio.cmd.command == ATA_WRITE_MUL ||
+                   ccb->ataio.cmd.command == ATA_WRITE_MUL48) {
+                       ch->transfersize = min(ccb->ataio.dxfer_len,
+                           ch->curr[port].bytecount);
+               } else
+                       ch->transfersize = min(ccb->ataio.dxfer_len, 512);
                if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE)
                        ch->fake_busy = 1;
                /* If data write command - output the data */
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to