Hi All, I am trying to create new sg list from old list. The new list will have length < 2048. When I populate the new sg list using sg_set_page(). IOMMU starts giving following error. [ 388.463656] DMAR: DRHD: handling fault status reg 2 [ 388.468539] DMAR: [DMA Write] Request device [03:00.0] fault addr ef66d000 [fault reason 05] PTE Write access is not set [ 389.464146] DMAR: DRHD: handling fault status reg 102 [ 389.469203] DMAR: [DMA Write] Request device [03:00.0] fault addr ef65d000 [fault reason 05] PTE Write access is not set Function to create new sg list: { struct scatterlist *newsg, *sg; int i, len, processed = 0; size_t size = 2048; newsg = kmalloc_array(nents, sizeof(struct scatterlist), GFP_KERNEL); if (!newsg) return ERR_PTR(-ENOMEM); sg = newsg; sg_init_table(sg, nents); for (i = 0; i < nents; i++) { len = min_t(u32, sgl->length - processed, 2048); sg_set_page(sg, sg_page(sgl), len, sgl->offset + processed); processed += len; if (processed == sgl->length) { processed = 0; sgl = sg_next(sgl); } sg = sg_next(sg); } return newsg; } Same driver works fine if I disable IOMMU. _______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies