Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4911108ybv; Mon, 17 Feb 2020 08:16:54 -0800 (PST) X-Google-Smtp-Source: APXvYqxXoSbSyPUsKoHc2fXWphseQlOg0U9yNQiL07jND1rFdlPiL3qs/+d3HGnW3eAF4q0yETfV X-Received: by 2002:a9d:624e:: with SMTP id i14mr12889893otk.371.1581956214267; Mon, 17 Feb 2020 08:16:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581956214; cv=none; d=google.com; s=arc-20160816; b=jdb2j00rZcW2kywD4g9oLucK5Cew8DJ4Odiu2FaLF3HOWs33w0PWCIUcM4uhhPuDUn h9ZkbJQ5JKaRDEkr147YzMPGtIRQnoVwrbq7Fw5i6lilNE4EJzkKI2sjIeOVaFFcqvlz 6goA2U9BJtzfK5XpRF5c+2sLyI12fiMMqob7lG24dHOSp7PcMPqGe1YcfWpe8hMA/lm0 x6hkHXVP5WKbikQYCNfFyo8n+yQNSL4jqEuU3sDv+UbS4n/WBcfVRObwGwojizpgfPYV VuzBMpZDHI2NN+fMwbq36OAJjW2HPTE+vpIKMK3x+4IMAqsu8PiFxwctUgDVSV59q2R+ J3GQ== 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; bh=tGm2j//p04jOGVjD42P8hUh3b1TfVxSbe9+ulXgFIAk=; b=wvowxdDo8D66AgAYX6dhW1HLS6PIAPFAHFwtNxu0+lZyMyJSxkqNeJwLdOqsEP09i1 Xsx+4N1bOMLG/Fshl5UbADxJSnavi0sliz7qMyhTUd2JONYjSksxgKcmizWIe9Vz2W1f nztxXidkVDnCxlEpXUsqhXzIRPnyuxij31xzVnYN3FHIHWK6UADHSuOcS8BdglpQ9Kai e1PvxNmUK8acG5n74/xO0dvfCXECKclN1gbRcf7gR0y9Aw/a5cH7h0BX9TMkASP6J5GZ 91O7Rou8xVrqe2g9kHcaDeU+JIL4gv9o8ADjpu1eu+sJHEfHmiLmN/9xB1MmRGEBX8XB 1q0w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f16si7172491oib.269.2020.02.17.08.16.42; Mon, 17 Feb 2020 08:16:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728087AbgBQQN4 (ORCPT + 99 others); Mon, 17 Feb 2020 11:13:56 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:51501 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726879AbgBQQNz (ORCPT ); Mon, 17 Feb 2020 11:13:55 -0500 Received: from mail-qk1-f179.google.com ([209.85.222.179]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPSA (Nemesis) id 1MjjOl-1jj40H0Ug7-00lCVz; Mon, 17 Feb 2020 17:13:54 +0100 Received: by mail-qk1-f179.google.com with SMTP id b7so16649892qkl.7; Mon, 17 Feb 2020 08:13:53 -0800 (PST) X-Gm-Message-State: APjAAAV975bfiCQe/Wz/vCDY+evKlNrgNFxaN0lqQiKNhrL599vlysZr lU9DaaimsZVvrYI4LvTLBFp9AZUarqFuAkiUjjw= X-Received: by 2002:a37:e409:: with SMTP id y9mr15169463qkf.352.1581956032902; Mon, 17 Feb 2020 08:13:52 -0800 (PST) MIME-Version: 1.0 References: <20200131135009.31477-1-manivannan.sadhasivam@linaro.org> <20200131135009.31477-12-manivannan.sadhasivam@linaro.org> In-Reply-To: <20200131135009.31477-12-manivannan.sadhasivam@linaro.org> From: Arnd Bergmann Date: Mon, 17 Feb 2020 17:13:37 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 11/16] bus: mhi: core: Add support for data transfer To: Manivannan Sadhasivam Cc: gregkh , smohanad@codeaurora.org, Jeffrey Hugo , Kalle Valo , Bjorn Andersson , hemantk@codeaurora.org, linux-arm-msm , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:EBlLmQcY5WAk8oxakAHM07INbyDmmQkMgamLnBJq5di+FAtxhga BKfH7CyuIFyvwcSnP8glnfsooiLGmbbDpV2RbGVRB7qUCacKbvOPoXY10P8U6C2XmWpxC69 HwJvf0Mm37dJy/VPLvvqi0dzu7VuWFnPpQhr54z0fFwFDdeDyKhpT1etjSF9Vmw508lkS5H Cc7cb4y0BgLa/iQ2eSVjg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:linODcjJZeI=:0KG5tqodBxiKTUcee1zCcm 8OrUvD5xLQsr9ZHspgCc/L73edSFP/BYx1xdn3HIRyIpsmyyZ0Tv9qWTKf288U83Loh0d6TUB PQUahOQNiYeOD26ca3mga2CuKMyOf84BZyFWJm2Z6gztDboNtP5IW9wpT8FOcMuGppQni9o8g 5am/K5XL8QHelwEBGCcAjQQZZwMKzPVXyIrjc+eXPj9yX+MI8DPmJCBMY/25DKMOtj5wYA5dh Uj6J5etYHAHptefOBdu/wKHvzlnya3YW6AqnViiA5dk07rvfZBL/uHxUsu49fGIQO1W2XOuUJ XK4XA4GpPvZyWyKCX1rGIsS5fxyYFtoRxotTNSMSRCfgnI+pAeq6rCd63xfOFa9hsF6E0IPwD uk9cw8OgS5XurOEKOtyACDzbwc2me7/0ZI1rOx8AR/6HGfbQfpM2wgM/T3E58NTlHYE9dXWbR LoEl5bPkB7mZq63Ovo5+zSeYc+zJKQD45FFZguCAsjURV+82shT/vtmPhgiL8NhteMAOVzX14 ACfLp7WRMabKfWDdIL3EwNinWfjKbXnMaDrBpVQnrXqaJh7abPBCXZxiU8ft2dzoTkftprXTQ Hp7p7VwJpSNRLEqLB8CBis+AgvQsBw53nKcOQCY+d1xzr9B1AnlV3wXSAxxTERYD6Quae6PqD rb8xcpjxhydw+Qfke9hnMA242W6ns6CdFGRrMKsR2kWk5dWxeV0HeCRc196NmZmbT6+ZLV4/w JRjXntoB6luvnqreBn3Kw9/gtFm8qliyNtCj4CquktvpoVnICPeWkPRDj5FMnWU3cBLpzZ7fa XNWT8DWMEjfbVV2+5rHcCFnoCZTJP7ThuOED7RfsgOvMsKKIZc= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Arnd