Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6804279ybx; Mon, 11 Nov 2019 15:11:31 -0800 (PST) X-Google-Smtp-Source: APXvYqyEZGfyWs61MO9dlK7oYNCrPOGwOyH8gX+zXwA35kRFAxqDSeqj3u+2SEyRMK0bvJPk2TaH X-Received: by 2002:a50:c191:: with SMTP id m17mr29551099edf.259.1573513891147; Mon, 11 Nov 2019 15:11:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573513891; cv=none; d=google.com; s=arc-20160816; b=DktOxkiMg7fSi4f66KG4vhnoBGRYzGxX1MIEa1aKF0mSqD9fF9PxQiglBHbFhH+00p 7UNl/Iy46wsJoeXqtCtMPPf1rtBKjKSpfDek4Mk7CPPGoGFIRUdt9umnpD/cH2UlsQQP ExO5UXi0933A4fPIm5ZInWSM62l+KKs3WagVTWNRCmBX65P8Umm8OfIJ0LF7iw+DmxHw DjC5Ze7ilvlqvpnjegHHl/x8yNlQiHAdZ/m1VNSX2rXmuJOwrGYU1WjZsUxx8MUqRaE7 ovBu9T8OIS8qsPzjs397Gl4PKmgkG8gnfFePwFns2Cr5onq/pSAlf1a0Mp71wbiMWYbl 8FbA== 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=tWeesDpDIKQpiy9KR8LKYyLg9H0SvGAo1V8+RtWjNIQ=; b=n5lypRO816zgKDey6XfEdVxj+zSK7aR33/1rlh+4bGDYtNsxYAUTFEesU9YecbM+ws zDNwgu9v5Q1iWeFLFc8D3RLe4395cHZ46tuuA5c7tXhG9dLSXUqrNKyC0JKa1op/Sz76 0caNr3KmtNnw15EI16hBV/va2mmR7gVKM+dISvRBDsd+J4nmiv85uK18EBKBxIt0bvx/ j6cE8xGgGHZeHhEOw4w83Wzo+V87YmxE4iFijmwmXp5dBWJ0n0Jx9XQ8bQZZoeEZPzt/ Swq1+IaT2g/GpUREcv2KzGipWf0vQp3MePwLWAt607sfYBnHs8UZfEv6A0fQYUBJB+vz 0VAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rWtyLPCI; 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 y38si13038407edb.87.2019.11.11.15.11.06; Mon, 11 Nov 2019 15:11:31 -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=rWtyLPCI; 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 S1726981AbfKKXK3 (ORCPT + 99 others); Mon, 11 Nov 2019 18:10:29 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:39714 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726834AbfKKXK2 (ORCPT ); Mon, 11 Nov 2019 18:10:28 -0500 Received: by mail-pl1-f196.google.com with SMTP id o9so8473122plk.6 for ; Mon, 11 Nov 2019 15:10:27 -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=tWeesDpDIKQpiy9KR8LKYyLg9H0SvGAo1V8+RtWjNIQ=; b=rWtyLPCIGyCdKarivLzqhQAJ+Hfooyus39lh21jI8xk1IYdM21EMyAhyCiMAj6XU88 YHLkNv8fVvIZ3efdtCk8MC9ENjAuY75QGb92jJ9eWgZzeVmOmV6etIloPQOvhoKPytwU tdOsNkLLNnRJK7Yn8Glfv43FVt5EhmxeNqWuKKWoAjcQdRMMcJbNiRh0EcraR6vw7s+i KHwWFP2ROBBWbeDY/9Ub0aQ29J4YyF5s7sjGRMoHM4ItZh5loT9UqfcfTH1o7CLuFfzx lTdWaY6ydbeL1yhm2XLyeaVjzDiaoTGPeIDVV/PMsf2zuXu1ITVhz4muProW2lYrqDPq L1Bw== 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=tWeesDpDIKQpiy9KR8LKYyLg9H0SvGAo1V8+RtWjNIQ=; b=ZwSrysUNNzlUplM/nXiJnwbb49w5m2071dOupvIYhzBxicxnCVe6AWoTz86I82zU+E fcVevNUyGsIK1lXuHwnCaE5bluYJNGumFOfyRHjNFA+bzQBS6pXdXS+RL03Q814ae4iz o0r4FmEL4kaA3WwukzuiuDTJy3GA02tW0V//8iyyRZ0t/eV5HzZ6O2gXZQYuUxCgcn6z wXSPrA59U/kbcGbeJtRbpY6hbexlXJVLUgWebv8nME4c6HoYGGp3E6OEH6l1Xq3gGwR7 mVPfH7ymoCLqzT7X3KXjvRgO3qlaWDVJQZR3QYq+Z9U+e55S506AXwZcmfKtPGFp+VPC 6bzA== X-Gm-Message-State: APjAAAVUAD2mTJ1tq1kHXarwXI3J3XLeYpDVbAsWEDQS5lqHkUcIfFWV 6TT9jcqxlb30U+toASU+F0jeEQ== X-Received: by 2002:a17:902:bf4b:: with SMTP id u11mr2843807pls.40.1573513826584; Mon, 11 Nov 2019 15:10:26 -0800 (PST) Received: from builder (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id q4sm7296199pgp.30.2019.11.11.15.10.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 15:10:25 -0800 (PST) Date: Mon, 11 Nov 2019 15:10:23 -0800 From: Bjorn Andersson To: Pi-Hsun Shih Cc: Ohad Ben-Cohen , Matthias Brugger , open list , "open list:REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM" , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" Subject: Re: [PATCH v20 3/4] rpmsg: add rpmsg support for mt8183 SCP. Message-ID: <20191111231023.GD3108315@builder> References: <20191014075812.181942-1-pihsun@chromium.org> <20191014075812.181942-4-pihsun@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191014075812.181942-4-pihsun@chromium.org> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 14 Oct 00:58 PDT 2019, Pi-Hsun Shih wrote: > Add a simple rpmsg support for mt8183 SCP, that use IPI / IPC directly. > Hi Pi-Hsun, Sorry for not reviewing this in a timely manner! This looks good, just some very minor comments below. > Signed-off-by: Pi-Hsun Shih [..] > diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c > index f2e5e70a58f2..7896cefb2dc0 100644 > --- a/drivers/remoteproc/mtk_scp.c > +++ b/drivers/remoteproc/mtk_scp.c > @@ -15,6 +15,7 @@ > #include > #include > #include > +#include > > #include "mtk_common.h" > #include "remoteproc_internal.h" > @@ -407,6 +408,31 @@ static void scp_unmap_memory_region(struct mtk_scp *scp) > of_reserved_mem_device_release(scp->dev); > } > > +static struct mtk_rpmsg_info mtk_scp_rpmsg_info = { > + .send_ipi = scp_ipi_send, > + .register_ipi = scp_ipi_register, > + .unregister_ipi = scp_ipi_unregister, These are exported symbols, so unless you see a need to support alternative implementations in the near future just skip the function pointers and call them directly. > + .ns_ipi_id = SCP_IPI_NS_SERVICE, > +}; > + [..] > diff --git a/drivers/rpmsg/mtk_rpmsg.c b/drivers/rpmsg/mtk_rpmsg.c [..] > +static void __ept_release(struct kref *kref) Please make this __mtk_ept_release() to make it clear that this is not a framework function. > +{ > + struct rpmsg_endpoint *ept = container_of(kref, struct rpmsg_endpoint, > + refcount); > + kfree(to_mtk_rpmsg_endpoint(ept)); > +} > + > +static void mtk_rpmsg_ipi_handler(void *data, unsigned int len, void *priv) > +{ > + struct mtk_rpmsg_endpoint *mept = priv; > + struct rpmsg_endpoint *ept = &mept->ept; > + int ret; > + > + ret = (*ept->cb)(ept->rpdev, data, len, ept->priv, ept->addr); > + if (ret) > + dev_warn(&ept->rpdev->dev, "rpmsg handler return error = %d", > + ret); > +} > + > +static struct rpmsg_endpoint * > +__rpmsg_create_ept(struct mtk_rpmsg_rproc_subdev *mtk_subdev, __mtk_create_ept() > + struct rpmsg_device *rpdev, rpmsg_rx_cb_t cb, void *priv, > + u32 id) > +{ Regards, Bjorn