PERFORCE change 167636 for review

Alexander Motin mav at FreeBSD.org
Sun Aug 23 08:13:33 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=167636

Change 167636 by mav at mav_mavbook on 2009/08/23 08:12:58

	Make SII chips provide bigger max_iosize.

Affected files ...

.. //depot/projects/scottl-camlock/src/sys/dev/ata/chipsets/ata-siliconimage.c#8 edit

Differences ...

==== //depot/projects/scottl-camlock/src/sys/dev/ata/chipsets/ata-siliconimage.c#8 (text+ko) ====

@@ -340,6 +340,7 @@
 	ATA_OUTL(ctlr->r_res2, 0x148 + (unit01 << 7) + (unit10 << 8),(1 << 16));
     }
 
+    ch->dma.max_iosize = (ATA_DMA_ENTRIES - 1) * PAGE_SIZE;
     if (ctlr->chip->cfg2 & SII_BUG) {
 	/* work around errata in early chips */
 	ch->dma.boundary = 8192;
@@ -457,7 +458,7 @@
     u_int32_t control;
 } __packed;
 
-#define ATA_SIIPRB_DMA_ENTRIES		125
+#define ATA_SIIPRB_DMA_ENTRIES		129
 struct ata_siiprb_ata_command {
     struct ata_siiprb_dma_prdentry prd[ATA_SIIPRB_DMA_ENTRIES];
 } __packed;
@@ -556,8 +557,7 @@
     }
 
     /* get a piece of the workspace for this request */
-    prb = (struct ata_siiprb_command *)
-	(ch->dma.work + (sizeof(struct ata_siiprb_command) * request->tag));
+    prb = (struct ata_siiprb_command *)ch->dma.work;
 
     /* clear the prb structure */
     bzero(prb, sizeof(struct ata_siiprb_command));
@@ -595,12 +595,9 @@
     }
 
     /* activate the prb */
-    prb_bus = ch->dma.work_bus +
-	      (sizeof(struct ata_siiprb_command) * request->tag);
-    ATA_OUTL(ctlr->r_res2,
-	     0x1c00 + offset + (request->tag * sizeof(u_int64_t)), prb_bus);
-    ATA_OUTL(ctlr->r_res2,
-	     0x1c04 + offset + (request->tag * sizeof(u_int64_t)), prb_bus>>32);
+    prb_bus = ch->dma.work_bus;
+    ATA_OUTL(ctlr->r_res2, 0x1c00 + offset, prb_bus);
+    ATA_OUTL(ctlr->r_res2, 0x1c04 + offset, prb_bus>>32);
 
     /* start the timeout */
     callout_reset(&request->callout, request->timeout * hz,
@@ -621,7 +618,7 @@
     callout_stop(&request->callout);
     
     prb = (struct ata_siiprb_command *)
-	((u_int8_t *)rman_get_virtual(ctlr->r_res2)+(request->tag << 7)+offset);
+	((u_int8_t *)rman_get_virtual(ctlr->r_res2) + offset);
 
     /* any controller errors flagged ? */
     if ((error = ATA_INL(ctlr->r_res2, 0x1024 + offset))) {
@@ -903,6 +900,7 @@
     /* note start and stop are not used here */
     ch->dma.setprd = ata_siiprb_dmasetprd;
     ch->dma.max_address = BUS_SPACE_MAXADDR;
+    ch->dma.max_iosize = (ATA_SIIPRB_DMA_ENTRIES - 1) * PAGE_SIZE;
 }
 
 ATA_DECLARE_DRIVER(ata_sii);


More information about the p4-projects mailing list