Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755984Ab1FOQ0S (ORCPT ); Wed, 15 Jun 2011 12:26:18 -0400 Received: from sh.osrg.net ([192.16.179.4]:50759 "EHLO sh.osrg.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755219Ab1FOQ0Q (ORCPT ); Wed, 15 Jun 2011 12:26:16 -0400 Date: Thu, 16 Jun 2011 01:25:21 +0900 To: shawn.guo@linaro.org Cc: linux-kernel@vger.kernel.org, dan.j.williams@intel.com, vinod.koul@intel.com, linux@arm.linux.org.uk, fujita.tomonori@lab.ntt.co.jp, cjb@laptop.org, gregkh@suse.de, linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, patches@linaro.org Subject: Re: [PATCH v3] dmaengine: add new dma API for max_segment_number From: FUJITA Tomonori In-Reply-To: <1308139721-4008-1-git-send-email-shawn.guo@linaro.org> References: <1308139721-4008-1-git-send-email-shawn.guo@linaro.org> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20110616012124M.fujita.tomonori@lab.ntt.co.jp> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (sh.osrg.net [192.16.179.4]); Thu, 16 Jun 2011 01:25:24 +0900 (JST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2079 Lines: 37 On Wed, 15 Jun 2011 20:08:41 +0800 Shawn Guo wrote: > Like dma_set(get)_max_seg_size for max_segment_size, the patch adds > max_segment_number into device_dma_parameters and creates the > corresponding dmaengine API dma_set(get)_max_seg_number for it. > > Here is the user story that tells the need of the new api. The > mxs-mmc is the mmc host controller for Freescale MXS architecture. > There are a pair of mmc host specific parameters max_seg_size and > max_segs that mxs-mmc host driver needs to tell mmc core, so that > mmc core can know how big each data segment could be and how many > segments could be handled one time in a scatter list by host driver. > > The mxs-mmc driver is one user of dmaengine mxs-dma, and it will call > mxs-dma to transfer data in scatter list. That is to say mxs-mmc has > no idea of what max_seg_size and max_segs should be, because they are > all mxs-dma capability parameters, and mxs-mmc needs to query them > from mxs-dma. > > Right now, there is well defined dma api (dma_get_max_seg_size) for > mmc to query max_seg_size from dma driver, but the one for max_segs > is missing. That's why mxs-mmc driver has to hard-code it. > > The mxs-mmc is just one example to demonstrate the need of the new > api, and there are other mmc host drivers (mxcmmc on imx-dma is > another example) and possibly even other dmaengine users need this > new api to know the maximum segments that dma driver can handle per > dma call. As I wrote earlier, SCSI midlayer sets this parameter in a different way (storing this in SCSI specific data structure). If you add a new generic API for this parameter, please make sure that the API works well for the others that already do the same differently. That is, please send this to linux-scsi too (and discuss with SCSI maintainer). -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/