Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d975f309 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-4.3/sg' of git://git.kernel.dk/linux-block

Pull SG updates from Jens Axboe:
 "This contains a set of scatter-gather related changes/fixes for 4.3:

   - Add support for limited chaining of sg tables even for
     architectures that do not set ARCH_HAS_SG_CHAIN.  From Christoph.

   - Add sg chain support to target_rd.  From Christoph.

   - Fixup open coded sg->page_link in crypto/omap-sham.  From
     Christoph.

   - Fixup open coded crypto ->page_link manipulation.  From Dan.

   - Also from Dan, automated fixup of manual sg_unmark_end()
     manipulations.

   - Also from Dan, automated fixup of open coded sg_phys()
     implementations.

   - From Robert Jarzmik, addition of an sg table splitting helper that
     drivers can use"

* 'for-4.3/sg' of git://git.kernel.dk/linux-block:
  lib: scatterlist: add sg splitting function
  scatterlist: use sg_phys()
  crypto/omap-sham: remove an open coded access to ->page_link
  scatterlist: remove open coded sg_unmark_end instances
  crypto: replace scatterwalk_sg_chain with sg_chain
  target/rd: always chain S/G list
  scatterlist: allow limited chaining without ARCH_HAS_SG_CHAIN
parents 52b084d3 f8bcbe62
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1520,7 +1520,7 @@ static int __map_sg_chunk(struct device *dev, struct scatterlist *sg,
		return -ENOMEM;

	for (count = 0, s = sg; count < (size >> PAGE_SHIFT); s = sg_next(s)) {
		phys_addr_t phys = page_to_phys(sg_page(s));
		phys_addr_t phys = sg_phys(s) & PAGE_MASK;
		unsigned int len = PAGE_ALIGN(s->offset + s->length);

		if (!is_coherent &&
+1 −2
Original line number Diff line number Diff line
@@ -61,8 +61,7 @@ static int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl,
	/* FIXME this part of code is untested */
	for_each_sg(sgl, sg, nents, i) {
		sg->dma_address = sg_phys(sg);
		__dma_sync(page_to_phys(sg_page(sg)) + sg->offset,
							sg->length, direction);
		__dma_sync(sg_phys(sg), sg->length, direction);
	}

	return nents;
+1 −1
Original line number Diff line number Diff line
@@ -393,7 +393,7 @@ int blk_rq_map_sg(struct request_queue *q, struct request *rq,
		if (rq->cmd_flags & REQ_WRITE)
			memset(q->dma_drain_buffer, 0, q->dma_drain_size);

		sg->page_link &= ~0x02;
		sg_unmark_end(sg);
		sg = sg_next(sg);
		sg_set_page(sg, virt_to_page(q->dma_drain_buffer),
			    q->dma_drain_size,
+1 −1
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ static int skcipher_alloc_sgl(struct sock *sk)
		sgl->cur = 0;

		if (sg)
			scatterwalk_sg_chain(sg, MAX_SGL_ENTS + 1, sgl->sg);
			sg_chain(sg, MAX_SGL_ENTS + 1, sgl->sg);

		list_add_tail(&sgl->list, &ctx->tsgl);
	}
+2 −2
Original line number Diff line number Diff line
@@ -206,14 +206,14 @@ static void crypto_gcm_init_common(struct aead_request *req)
	sg_set_buf(pctx->src, pctx->auth_tag, sizeof(pctx->auth_tag));
	sg = scatterwalk_ffwd(pctx->src + 1, req->src, req->assoclen);
	if (sg != pctx->src + 1)
		scatterwalk_sg_chain(pctx->src, 2, sg);
		sg_chain(pctx->src, 2, sg);

	if (req->src != req->dst) {
		sg_init_table(pctx->dst, 3);
		sg_set_buf(pctx->dst, pctx->auth_tag, sizeof(pctx->auth_tag));
		sg = scatterwalk_ffwd(pctx->dst + 1, req->dst, req->assoclen);
		if (sg != pctx->dst + 1)
			scatterwalk_sg_chain(pctx->dst, 2, sg);
			sg_chain(pctx->dst, 2, sg);
	}
}

Loading