Date: Fri, 16 Nov 2012 03:07:27 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243127 - stable/9/sys/dev/ata Message-ID: <201211160307.qAG37RaT005951@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Fri Nov 16 03:07:27 2012 New Revision: 243127 URL: http://svnweb.freebsd.org/changeset/base/243127 Log: MFC r242422: 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 ata(4) with ATA_CAM option. This fixes timeout of READ LOG EXT command used by `smartctl -x /dev/adaX`. Modified: stable/9/sys/dev/ata/ata-all.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ata/ata-all.c ============================================================================== --- stable/9/sys/dev/ata/ata-all.c Fri Nov 16 03:05:27 2012 (r243126) +++ stable/9/sys/dev/ata/ata-all.c Fri Nov 16 03:07:27 2012 (r243127) @@ -1501,6 +1501,14 @@ ata_cam_begin_transaction(device_t dev, request->flags |= ATA_R_READ; if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) request->flags |= ATA_R_WRITE; + 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) { + request->transfersize = min(request->bytecount, + ch->curr[ccb->ccb_h.target_id].bytecount); + } else + request->transfersize = min(request->bytecount, 512); } else { request->data = ccb->csio.data_ptr; request->bytecount = ccb->csio.dxfer_len; @@ -1517,9 +1525,9 @@ ata_cam_begin_transaction(device_t dev, request->flags |= ATA_R_READ; if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) request->flags |= ATA_R_WRITE; + request->transfersize = min(request->bytecount, + ch->curr[ccb->ccb_h.target_id].bytecount); } - request->transfersize = min(request->bytecount, - ch->curr[ccb->ccb_h.target_id].bytecount); request->retries = 0; request->timeout = (ccb->ccb_h.timeout + 999) / 1000; callout_init_mtx(&request->callout, &ch->state_mtx, CALLOUT_RETURNUNLOCKED);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211160307.qAG37RaT005951>