534 DMA KVA cache attributes incorrect
Reviewed by: Garrett D'Amore <
[email protected]>
Reviewed by: Albert Lee <
[email protected]>
Approved by: Eric Schrock <
[email protected]>
--- a/usr/src/uts/common/os/sunddi.c Mon Jun 20 07:27:51 2011 -0700
+++ b/usr/src/uts/common/os/sunddi.c Thu Jun 23 11:00:11 2011 -0700
@@ -7332,6 +7332,24 @@
if (*handlep == NULL)
return (DDI_FAILURE);
+/* SPARC mappings are always cacheable, as SPARC guarantees cache coherency. */
+#ifndef __sparc
+ /* Transform attributes into correct cache flags. */
+ if ((flags & IOMEM_DATA_MASK) == 0) {
+ switch (accattrp->devacc_attr_dataorder) {
+ case DDI_STRICTORDER_ACC:
+ flags |= IOMEM_DATA_UNCACHED;
+ break;
+ case DDI_MERGING_OK_ACC:
+ flags |= IOMEM_DATA_UC_WR_COMBINE;
+ break;
+ default:
+ flags |= IOMEM_DATA_CACHED;
+ break;
+ }
+ }
+#endif
+
/* check if the cache attributes are supported */
if (i_ddi_check_cache_attr(flags) == B_FALSE)
return (DDI_FAILURE);