Author: mav
Date: Thu Oct 22 03:30:39 2020
New Revision: 366922
URL: https://svnweb.freebsd.org/changeset/base/366922

Log:
  Pass lower 3 bits of sector_count for FPDMA commands.
  
  When this code was written those bits were N/A, but now the lowest bit
  is Rebuild Assist Recovery Control (RARC).
  
  MFC after:    1 month

Modified:
  head/sys/dev/ahci/ahci.c
  head/sys/dev/mvs/mvs.c
  head/sys/dev/siis/siis.c

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c    Thu Oct 22 01:05:34 2020        (r366921)
+++ head/sys/dev/ahci/ahci.c    Thu Oct 22 03:30:39 2020        (r366922)
@@ -2578,10 +2578,10 @@ ahci_setup_fis(struct ahci_channel *ch, struct ahci_cm
                fis[9] = ccb->ataio.cmd.lba_mid_exp;
                fis[10] = ccb->ataio.cmd.lba_high_exp;
                fis[11] = ccb->ataio.cmd.features_exp;
+               fis[12] = ccb->ataio.cmd.sector_count;
                if (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) {
-                       fis[12] = tag << 3;
-               } else {
-                       fis[12] = ccb->ataio.cmd.sector_count;
+                       fis[12] &= 0xf8;
+                       fis[12] |= tag << 3;
                }
                fis[13] = ccb->ataio.cmd.sector_count_exp;
                fis[15] = ATA_A_4BIT;

Modified: head/sys/dev/mvs/mvs.c
==============================================================================
--- head/sys/dev/mvs/mvs.c      Thu Oct 22 01:05:34 2020        (r366921)
+++ head/sys/dev/mvs/mvs.c      Thu Oct 22 03:30:39 2020        (r366922)
@@ -1493,7 +1493,8 @@ mvs_execute_transaction(struct mvs_slot *slot)
                crqb->cmd[i++] = ccb->ataio.cmd.features;
                crqb->cmd[i++] = 0x11;
                if (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) {
-                       crqb->cmd[i++] = slot->tag << 3;
+                       crqb->cmd[i++] = (slot->tag << 3) |
+                           (ccb->ataio.cmd.sector_count & 0x07);
                        crqb->cmd[i++] = 0x12;
                } else {
                        crqb->cmd[i++] = ccb->ataio.cmd.sector_count_exp;

Modified: head/sys/dev/siis/siis.c
==============================================================================
--- head/sys/dev/siis/siis.c    Thu Oct 22 01:05:34 2020        (r366921)
+++ head/sys/dev/siis/siis.c    Thu Oct 22 03:30:39 2020        (r366922)
@@ -1723,13 +1723,12 @@ siis_setup_fis(device_t dev, struct siis_cmd *ctp, uni
                fis[9] = ccb->ataio.cmd.lba_mid_exp;
                fis[10] = ccb->ataio.cmd.lba_high_exp;
                fis[11] = ccb->ataio.cmd.features_exp;
+               fis[12] = ccb->ataio.cmd.sector_count;
                if (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) {
-                       fis[12] = tag << 3;
-                       fis[13] = 0;
-               } else {
-                       fis[12] = ccb->ataio.cmd.sector_count;
-                       fis[13] = ccb->ataio.cmd.sector_count_exp;
+                       fis[12] &= 0xf8;
+                       fis[12] |= tag << 3;
                }
+               fis[13] = ccb->ataio.cmd.sector_count_exp;
                fis[15] = ATA_A_4BIT;
                if (ccb->ataio.ata_flags & ATA_FLAG_AUX) {
                        fis[16] =  ccb->ataio.aux        & 0xff;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to