Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3551707ybf; Tue, 3 Mar 2020 08:01:09 -0800 (PST) X-Google-Smtp-Source: ADFU+vu8KTjOas+I/tg4igwTrkN6tr9NDrsfsB16NWbcCg5thSJOJbL7Xo/AMIOpyAXVxe/Zf1M6 X-Received: by 2002:a05:6808:6ca:: with SMTP id m10mr2859205oih.63.1583251269288; Tue, 03 Mar 2020 08:01:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583251269; cv=none; d=google.com; s=arc-20160816; b=suMoTZVh/B/Ft0EJuKhDPkWPYEvLGiwm33VwEa/KvtpHiNeAqXgSsmd+7P0s+zKE46 IvHiqgBVUlVMIArCGweUxar1Txt+WKivRex3rP70ndFgyqXa+R/w9hRa14/EONOsXqZX dLBty9twMta2m90YtV8MdQCxLlouMMiWSp2HJg/leLjW8DX8w664KHrNZaBiXEAvQZGE EgNVovb00s82c1Qtja3RRVAatZfmdLo6EW/9fL3tBAXTnWk2Nuj6yHWT2dHRBhFiYX5H u2O0i3TjyjdxNq+3QHkgo2OyRKVhtkY6pLv8zgnqmTCLWNxc0V8Iuj8hyrQnzwEgeoI9 stSQ== 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=6yB7awomhhSLM8b43Luq3et8NngDIS5f4GAy/rRpWIU=; b=KetUoBuPlsM2Wx0zkBHIetI9LNJSqZ8QWOvpjnP8hHDi1eR/9zEe3LPyjgK2/4gmce ExrnVjclkBXzEFoWgEWi4HUJ52d4/98vMi9ofBNURijKkhP2a8RRxvTNPGptS0A+DWBC ZVcFoDLKvyvAc8EhxCBODP8+czRCIXlACv2JZ7SL6LVJCekhyj2QadMbSI+mWhPSfLLa LK7GoFzXWaODuBJCI6bmMQmds7pnlOwn5OLwI6fNjVlRl7xw44slNBPpluKs+y+6DPFa GZGl4WX+rnkr7DsLiNYOxD1BDUgaz/bwEZyvVv5qcCzIpFfAUN9tpSvVWkuEgpC06Zgs Rv2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ApyQXlpE; 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 s8si8094046oic.7.2020.03.03.08.00.53; Tue, 03 Mar 2020 08:01:09 -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=ApyQXlpE; 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 S1730295AbgCCP4w (ORCPT + 99 others); Tue, 3 Mar 2020 10:56:52 -0500 Received: from mail-il1-f195.google.com ([209.85.166.195]:35561 "EHLO mail-il1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730223AbgCCP4v (ORCPT ); Tue, 3 Mar 2020 10:56:51 -0500 Received: by mail-il1-f195.google.com with SMTP id g126so3205407ilh.2 for ; Tue, 03 Mar 2020 07:56:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6yB7awomhhSLM8b43Luq3et8NngDIS5f4GAy/rRpWIU=; b=ApyQXlpE8POx42t2ZK44WczRod93oLbrJoAUnYmysEi2A62FXsk5hY7jg6HAN3z7wd 5o+O8hWQzrApCc5V/Dc8fkFS/RZ4uoC7bfraBY1MPfaHoz6lKJGjeb/xORyr2D6nDQp2 e4raLMcI62LVufcwIsI7ZEuGx+Mp+CMWnjthVAxgwS7TAdeO83hm06RS3HphkYmreFf+ 1poY1DTFBD8EAq9PJ7inPxcqRUIxmsWhnqSnlq6qRt4KZa5O8txC5pezaYc3AzthF5fb q13MlRx3DZNCF/zy04POG0xYjaPo+VlkiQjxSTfeQt3hUNp3GIEOSz76w76C3AaTDseh RKmg== 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=6yB7awomhhSLM8b43Luq3et8NngDIS5f4GAy/rRpWIU=; b=gNPsKnOk1AqjxIjRaU88npRD9wcTdXmLD3oZLwCBwsV8To4MK3tlEVT7aGm5GJcuqP LJ4YBjwuVO21HHZBTNMwS80PDLKkRx5U69CSmD9B9ifNw3J+NRvTEh7wwK/1rjwFu7+T oWcdm6h5hBfDVkkTbJ479KwbuQi7OUp6uFMffyerajq+kbjl4aNO8iQYVEp6zcRlu3a4 eaROwQgxC5TAKlavU8sXf1tIzDA+FyCiWl07JRscMIL12fUS0+eA1xOYLZ6h/TF3n/ni bYY+CTrKWqijhOpgAMwwtbOz27MyTNbcTG628cv0JxPksmpYMv8aKe8vcy7y7YB/d/Av 8+pg== X-Gm-Message-State: ANhLgQ2Ey3Xw4SNrCy99IXgcO7C1ya4+zGZ60V8EZZIsfcthu0EMEv8j CKzXoVBBJYyGb2l3cDp0ulcDwh/BEX6y1ekLeS/f8Q== X-Received: by 2002:a92:6610:: with SMTP id a16mr3592900ilc.140.1583251010762; Tue, 03 Mar 2020 07:56:50 -0800 (PST) MIME-Version: 1.0 References: <20200228110804.25822-1-nikita.shubin@maquefel.me> <20200302214317.GI210720@yoga> In-Reply-To: <20200302214317.GI210720@yoga> From: Mathieu Poirier Date: Tue, 3 Mar 2020 08:56:40 -0700 Message-ID: Subject: Re: [PATCH] remoteproc: error on kick missing To: Bjorn Andersson Cc: nikita.shubin@maquefel.me, Nikita Shubin , Ohad Ben-Cohen , linux-remoteproc , 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 Mon, 2 Mar 2020 at 14:43, Bjorn Andersson wrote: > > On Mon 02 Mar 09:44 PST 2020, Mathieu Poirier wrote: > > > Hi Nikita, > > > > On Fri, 28 Feb 2020 at 04:07, wrote: > > > > > > From: Nikita Shubin > > > > > > .kick method not set in rproc_ops will result in: > > > > > > 8<--- cut here --- > > > Unable to handle kernel NULL pointer dereference > > > > > > in rproc_virtio_notify, after firmware loading. > > > > There wasn't any kernel stack trace? What platform was this observed > > on? I'm afraid we won't be able to move forward with this patch > > without one, or more information on what is happening. > > > > > > > > refuse to register an rproc-induced virtio device if no kick method was > > > defined for rproc. > > > > > > Signed-off-by: Nikita Shubin > > > --- > > Nikita, please include "v2" in the subject and add here (below the ---) > short summary of what changes since v1. > > > > drivers/remoteproc/remoteproc_virtio.c | 7 +++++++ > > > 1 file changed, 7 insertions(+) > > > > > > diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c > > > index 8c07cb2ca8ba..31a62a0b470e 100644 > > > --- a/drivers/remoteproc/remoteproc_virtio.c > > > +++ b/drivers/remoteproc/remoteproc_virtio.c > > > @@ -334,6 +334,13 @@ int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id) > > > struct rproc_mem_entry *mem; > > > int ret; > > > > > > + if (rproc->ops->kick == NULL) { > > > + ret = -EINVAL; > > > + dev_err(dev, ".kick method not defined for %s", > > > + rproc->name); > > > + goto out; > > > + } > > > > I think it would be better to use WARN_ONCE() in rproc_virtio_notify() > > than prevent a virtio device from being added. But again I will need > > more information on this case to know for sure. > > > > I reviewed v1 and afaict there's no way rproc->ops->kick would change > and that things wouldn't work without a kick. Yes, a "v2" tag and a little bit of history would have helped. We came to the same conclusion - I couldn't see either how things would work without a kick(), especially if an rvdev with virtio queues is used. Reviewed-by: Mathieu Poirier > > So I requested that it should be checked during initialization instead. > Please let me know if I missed some case. > > Regards, > Bjorn > > > Thanks, > > Mathieu > > > > > + > > > /* Try to find dedicated vdev buffer carveout */ > > > mem = rproc_find_carveout_by_name(rproc, "vdev%dbuffer", rvdev->index); > > > if (mem) { > > > -- > > > 2.24.1 > > >