Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4946892ybv; Mon, 17 Feb 2020 09:01:16 -0800 (PST) X-Google-Smtp-Source: APXvYqwyLRIC4NLttWMtNLr4WnMc1fofSFZSmDqUMRXqoN8sGsLEfICoCadw2r4bPvs7ork5r51E X-Received: by 2002:a9d:3bc4:: with SMTP id k62mr13285480otc.186.1581958876503; Mon, 17 Feb 2020 09:01:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581958876; cv=none; d=google.com; s=arc-20160816; b=W+UJZlzy0yPHg8MFTBN44GWkQPKPBdXwP0N2LMVmw6f6F3lcqMXS8qEt/shchHBUl3 nbsXu0+CSJCla48U6jdwYH5TNxUgk9ieWsufukI0CLxIMiYVYov58c4YDNIC/ZGPHFvv EFLj+rIhXruLTqUrqs/tqrADgoL6rz2t6FuIyQDuJuxLc2hf4o/r7Iw2pd/BkMqrxSAp F2YigafB2C/rnMtzxRFvUeptAhYcMjGfUKdMsFHU6bAAnDBEdqKRWjY9WFCZ3/tSHuaA j1NESTekCyDBFL9iR4dliP3hK0M0rzhKN/WMjpdQfx/WuQXfwVFw6J8ICgmUl41vqwU6 GnEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+dYalRSbOahcygIG/bZllcSeh3ymAP3k2AyUse0dYCI=; b=Ng0p5qjfrxXZTaJXh/+LRf6YFl3vnq1u3d5SG++JDd02ra1quO8T8qyq1e9V3+AeP/ URrdCorvOpk7EiXqUR96XM/E8Gg21EQMOOi6JhL7hl/iyGjjmTpKR5N/LBXrRAW5dm/b UDlEurHnDoSYGrYidsXQcXuEqbcRan9B/vtwp+DRepT3cj9wk46qstI5+NTMJ5V6sqJE IAItabwxfMeOpjLAV/eMjjAdhxF7YlciWOZGcgYn+07XzyxxOaydmkWFwAvHLXbv42qx /7tYWIv9t9M21zDytGKhC9leKl0g+QTLXVkxtZ4B7wqzqmuV+GfPN+TuLmdkQbEB7JNM MwSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mII34r67; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l17si404663otq.59.2020.02.17.09.01.03; Mon, 17 Feb 2020 09:01:16 -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=@linaro.org header.s=google header.b=mII34r67; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729257AbgBQQsD (ORCPT + 99 others); Mon, 17 Feb 2020 11:48:03 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:43272 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728024AbgBQQsD (ORCPT ); Mon, 17 Feb 2020 11:48:03 -0500 Received: by mail-pg1-f195.google.com with SMTP id u12so9120098pgb.10 for ; Mon, 17 Feb 2020 08:48:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+dYalRSbOahcygIG/bZllcSeh3ymAP3k2AyUse0dYCI=; b=mII34r67/bufhqQd9dQqCetitoqHTrrbW8vRZnRPg1PwUkd8tJ+8Mr9084zNVxlzib 3eua/qF0W6iJnkf8IokoO56nKIcoKjslAX9TSz5rfujDwzvMlTseZms//itB13ofLcD3 gL0Dp869sIiemJpyWxNXuX29oPqTYwUI3cKdOe61cmflx30o1nNgxDBvbsbfdUGqTZPB Nfik4yKH5vQA0JpniYGamAhEIzL74N6Jzkw/EPnT0elR5oLnt8gx35VUnFNEiRDpZQJe kObADUG9G7Zf+mudNN4VvOfvQW5u6eiA9TQFXxT7Zjt/wW3+whiNuUBf5NKoD2Sbkbuh OClQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+dYalRSbOahcygIG/bZllcSeh3ymAP3k2AyUse0dYCI=; b=ZB63owvxhIprz42Z1EzIEV9W9NFd5TbtrkXX852MdRIZANmvfsCY+XnxmgTnknp1Hm FlDaXMBvMNUpVptRoqsryEtD8xThgdAlcnWVWivsO03IBgcsIyRsie1HRmzoDTROmeXI MBnTaY+4bmd8G9dh4lOIFf85dnpSOtuNLXbrJBScH66TE1SAke9KKt8FDzpg+3DKa90K sVaIyv7oDFhF5nNNq1uz2FAyOnk9w0MxmGLfpvDwK/y8ElHxqy+cjHpF0XlPM24A0kUX puTI58o9YhpARU29D4SMVPg6m6ZO1OUllevbwNCQcziwcE8RsqQ41M2cRLz2SyUFIMPe GvPQ== X-Gm-Message-State: APjAAAWAI8IfQUEMIZmMVgFCq6k8YD/6o7saIP3SaRRaSnZ1zuW+28vD Qz3/zH2CWgkIlF1MZWx81trD X-Received: by 2002:a17:90a:30e8:: with SMTP id h95mr21154101pjb.30.1581958081234; Mon, 17 Feb 2020 08:48:01 -0800 (PST) Received: from Mani-XPS-13-9360 ([2409:4072:48d:3349:2df9:3778:ccac:a356]) by smtp.gmail.com with ESMTPSA id ev5sm19278pjb.4.2020.02.17.08.47.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2020 08:48:00 -0800 (PST) Date: Mon, 17 Feb 2020 22:17:51 +0530 From: Manivannan Sadhasivam To: Arnd Bergmann Cc: gregkh , smohanad@codeaurora.org, Jeffrey Hugo , Kalle Valo , Bjorn Andersson , hemantk@codeaurora.org, linux-arm-msm , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 11/16] bus: mhi: core: Add support for data transfer Message-ID: <20200217164751.GA7305@Mani-XPS-13-9360> References: <20200131135009.31477-1-manivannan.sadhasivam@linaro.org> <20200131135009.31477-12-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, On Mon, Feb 17, 2020 at 05:13:37PM +0100, Arnd Bergmann wrote: > On Fri, Jan 31, 2020 at 2:51 PM Manivannan Sadhasivam > wrote: > > > @@ -648,6 +715,31 @@ static int parse_ch_cfg(struct mhi_controller *mhi_cntrl, > > mhi_chan->db_cfg.pollcfg = ch_cfg->pollcfg; > > mhi_chan->xfer_type = ch_cfg->data_type; > > > > + switch (mhi_chan->xfer_type) { > > + case MHI_BUF_RAW: > > + mhi_chan->gen_tre = mhi_gen_tre; > > + mhi_chan->queue_xfer = mhi_queue_buf; > > + break; > > + case MHI_BUF_SKB: > > + mhi_chan->queue_xfer = mhi_queue_skb; > > + break; > > + case MHI_BUF_SCLIST: > > + mhi_chan->gen_tre = mhi_gen_tre; > > + mhi_chan->queue_xfer = mhi_queue_sclist; > > + break; > > + case MHI_BUF_NOP: > > + mhi_chan->queue_xfer = mhi_queue_nop; > > + break; > > + case MHI_BUF_DMA: > > + case MHI_BUF_RSC_DMA: > > + mhi_chan->queue_xfer = mhi_queue_dma; > > + break; > > + default: > > + dev_err(mhi_cntrl->dev, > > + "Channel datatype not supported\n"); > > + goto error_chan_cfg; > > + } > > + > > While looking through the driver to see how the DMA gets handled, I came > across the multitude of mhi_queue_* functions, which seems like a > layering violation to me, given that they are all implemented by the > core code as well, and the client driver needs to be aware of > which one to call. Are you able to lift these out of the common interface > and make the client driver call these directly, or maybe provide a direct > interface based on mhi_buf_info to replace these? > It sounds reasonable to me. Let me discuss this internally with Qcom guys to see if they have any objections. Thanks, Mani > Arnd