Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1584601img; Wed, 27 Feb 2019 01:47:32 -0800 (PST) X-Google-Smtp-Source: AHgI3IY+C5NpsEHB3iNAvIneU2vdoXp9oVM/Wv5A/rr3rteryVbcrfFQjrS32jTSwEWFityJ7MVO X-Received: by 2002:a62:e005:: with SMTP id f5mr800407pfh.64.1551260852874; Wed, 27 Feb 2019 01:47:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551260852; cv=none; d=google.com; s=arc-20160816; b=tLIs4Pw1iFKrRTWiecgqFYnVRGJ3pTQfzOBAkzoREQ0TMcWZlCF8FvMxLH5aFjjdON XGO79wdRed/RwjFCvt5H6a8MxxzgypfAWomm9n2WmoT2S47Nlq3Y10ftP+tVFaGz1dgI ZJ8yDzMaonb7B6QI0AWnqsbzQ/EytpI+Qv3Jwsqv7G3HgXoeAzVSr7z96XA3G7EKPnHI Fwpo5LsPVLiy1SQCIm0WO7Vzh7pu8W2URm6JTsFTTn1BDQOLMeEJRZc5bGnhhmXoAbh4 E5F29LOgcOMdJzq+Ic34XWppUT2BTbF8eHyyCjXUrLY7rz3M0N5N+/LBxKV08PvPx2Tj z3vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=nU1pvTeBxjZYzI6/p0pwBDVfOXSIrni5hGMGrU+WiLI=; b=LRqOKp5WS/GKypHtfJYiJxpS8B+VyNp8JZiqtjTLLptTZC3TucluGUEgS+Hh+myLqi lhS4uA44sHx3yJGYA4ZxsEI9PubLSt1QujILTC7SW4r+8ZPOWT2y+6Xci8lTqJyFC8sm 87o3jnj96SgR6efbMJygRx+FUeBg3yaHIqZ1U35ClK7K3WwgjU1jUJuJgUoQpkbJbSZf n++O+BGLrPNLyyGVEYJGrew0YoFCrmeRVvLf1SQuWNjCNCmwk6dGwNjgnn/670E0BGIN ItxMOvTblW+RO/CbqddsP/FxwYzL8PZoWLmcEQa6cetEhxvVG8UvH1a9mW6ex5Ah9Hrt Rtqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tNtyrsX3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z20si15196681pfl.3.2019.02.27.01.47.17; Wed, 27 Feb 2019 01:47:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tNtyrsX3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729360AbfB0Jpp (ORCPT + 99 others); Wed, 27 Feb 2019 04:45:45 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:42170 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725881AbfB0Jpo (ORCPT ); Wed, 27 Feb 2019 04:45:44 -0500 Received: by mail-pf1-f193.google.com with SMTP id n74so7747517pfi.9 for ; Wed, 27 Feb 2019 01:45:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nU1pvTeBxjZYzI6/p0pwBDVfOXSIrni5hGMGrU+WiLI=; b=tNtyrsX3IjGr5fKO/ZZcYPioVVqgoStdfUrRcBhUPyzVLo8pQAI6iTQzN4d2m5VQjb C2zxdOP11Me0m7rGTjtRtvYgSy8Trz8FL53yjBUp73c7kE9GpKxOSL5KIVdg9HgABeGX 7o7DE7FcWSfhY7S9s1+Usvvjn1fhFEKHdQdFqdieOysjDN5czqg3T0ij6+vkMfoLpeFU rlH4Yo0Qj346ZxVlOMJcU0ASgvHLIRAkiZ5dGBzWEGPmENjv4+iSMfHuOtnChOQNtam2 tG4etv9c/E5APNsbmEHTdK4XRLOv3L99DB7RQCzRD7MxyIfe1QDH92sLay5Fwy4Tyo5R +0mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nU1pvTeBxjZYzI6/p0pwBDVfOXSIrni5hGMGrU+WiLI=; b=sqIihWXvKDL0S6E4eE9hksvTOZ0hGproWyBQ7rn84703aDxcWqBJlntRrqQq4SoTu0 1q9NFJ+4El88Unr+ASed8saUJtqYmiZk3OJ4LSi0HbIPUQi5dsJr5tekBuiRFI6j1Ocu xWw6Fke6IbQtOdcnVcTmEQzVgu+580Qde3L7LKwmGZcL3cVuyTGGFeUzl3imtDDRlTLn JV0qi6vOx5jLMQvfT6pmQk9ulN8K+kMS3El/yFqFmRSGG9i8WW/b9LCERsDFwFTgKteu 29+lhQSjqULH5ZOODnNi5SykPDJd1V8axcyBo7dYEI0IJslfqEW7YG8fZfgSVFs19kDc UBUw== X-Gm-Message-State: AHQUAuYv33XXQ7jdylXIFq+xykPykDF+Ws7s2EHRlpQVwWiUzGCJGpbI fh1zTijNu8hGUChESGoHunv4fD2Ob8yh/4CjkiE= X-Received: by 2002:a63:2907:: with SMTP id p7mr2084676pgp.161.1551260743601; Wed, 27 Feb 2019 01:45:43 -0800 (PST) MIME-Version: 1.0 References: <20190227085050.30000-1-alexandru.ardelean@analog.com> In-Reply-To: <20190227085050.30000-1-alexandru.ardelean@analog.com> From: Andy Shevchenko Date: Wed, 27 Feb 2019 11:45:31 +0200 Message-ID: Subject: Re: [PATCH] lib/scatterlist: introduce sg_nents_for_dma() helper To: Alexandru Ardelean Cc: Jens Axboe , Anshuman Khandual , bhole_prashant_q7@lab.ntt.co.jp, Kees Cook , john.fastabend@gmail.com, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 27, 2019 at 10:51 AM Alexandru Ardelean wrote: > > From: Andy Shevchenko > > Sometimes the user needs to split each entry on the mapped scatter list > due to DMA length constrains. This helper returns a number of entities > assuming that each of them is not bigger than supplied maximum length. > > Signed-off-by: Andy Shevchenko > Signed-off-by: Alexandru Ardelean Hmm... Usually we don't accept generic API without users. Do you have any use case in mind? > Patch was sent in 2016 initially to the DMA engine sub-system. > Link: > https://patchwork.kernel.org/patch/9389821/ > This was part of a larger series: > https://patchwork.kernel.org/project/linux-dmaengine/list/?q=sg_nents_for_dma&archive=both&series=&submitter=&delegate=&state=* > > I'm not sure if this is supposed to go into DMAEngine or lib/scatterlist. > It doesn't look like lib/scatterlist is managed by DMAEngine, so (by using > the `get_maintainers.pl` script) I'm sending this patch to this group of > parties. The problem the patch tried to solve is much deeper and correct solution should be more generic, i.e. each channel should provide a set of parameters, such as DMA segment size, to the users (via DMA engine API) and users should prepare the SG list according to the limits of the channel. In that case we don't need to re-split/re-allocate given SG list at all, which would simplify DMA slave drivers and their users. We discussed this topic back in 2016 with Vinod on LPC, but seems it's not critical to solve. My case is to improve DMA performance for 8250 UART. -- With Best Regards, Andy Shevchenko