Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2495023ybf; Mon, 2 Mar 2020 09:46:02 -0800 (PST) X-Google-Smtp-Source: ADFU+vvpiCrBE1E+L5LjS6/kx5Uq5StdM7S+V5e6Ce4lBvM12Ch4698yBUbiTiwGIgsy4y+fUI+L X-Received: by 2002:a05:6830:134c:: with SMTP id r12mr274132otq.126.1583171162158; Mon, 02 Mar 2020 09:46:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583171162; cv=none; d=google.com; s=arc-20160816; b=s4sL1ry0VpiiV33K6GOZwTvQlO8eQcBHwL4yfq7v+3GesVebFWj4uaksEdLkmzuANb XhJnb9hnC+1e7AsvHqfoXsS/61K40x/J3kVqAVUaBtQpuV4pLG6UAv4aTvpzyL6z00eI RzCN/N0YsLlUC5u19RQUubRuL1RLmxP35F+uMgtiY5kLjjKo0Mthp55xQkUA8cs1pXic eIue9eG83sZ81O5GDAp9sNsTyYmHUMjQjqYrITQu7eg5VuSUrdcUArANftikbaCEPe77 aypyHeM9/69iKItjfI19KuJ2kVdz4BQk25UNh7RjH8xdZ8c8pMaJo22kGqkaHrJlODI7 El9w== 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=sboKaEzAb8dDo8ic4Txr+gqE6z2BPnl5/jyRIrg2YGs=; b=I435xvSxOrnqKGgfd9B6uHitYe5OpzXu0J5fnEGPA8Bomv68beXR0RtfFP+GqCYtD5 2irfiMsMHA2sAZxqA0gnfRAIGixEbzrnxdF6vzn+CKbtzjKPQwMm9ls0zHPbfwVBne1w wCfdryC+Q15rrZYVfkJ3bEPBHAN+oPMWowDDlzUdVTuKrV0m+EK3oufiB5i8SYVwFQp1 jgvGRtE5+H7pVQZYaZ2H4vPuzzybUAvR6LUHNp/0Y3ofQtqffexUBgQfLGZcXs6ZmGu2 7HQmwr2CIoWmTNUkzwAedE4+oERSAuX9qDnylxl+vMCjS7y+DS8oB5pGCl+lBNXCkXfT 3fXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vqYRGb9r; 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 m6si6721136oim.30.2020.03.02.09.45.50; Mon, 02 Mar 2020 09:46:02 -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=vqYRGb9r; 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 S1727463AbgCBRpI (ORCPT + 99 others); Mon, 2 Mar 2020 12:45:08 -0500 Received: from mail-il1-f196.google.com ([209.85.166.196]:33129 "EHLO mail-il1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727196AbgCBRpI (ORCPT ); Mon, 2 Mar 2020 12:45:08 -0500 Received: by mail-il1-f196.google.com with SMTP id r4so283859iln.0 for ; Mon, 02 Mar 2020 09:45:07 -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=sboKaEzAb8dDo8ic4Txr+gqE6z2BPnl5/jyRIrg2YGs=; b=vqYRGb9r7GpichkDcc8O4hlFY3pp72EXr8zLy4oOuHUN9wWnR8g5FD1EvQfGOVvqkY sRuF1ADlrISNDfp5JyFqoNVDLijFdF7aFGLcAaWcfNq4oe0r6gU9hLFYpuT1ickVklCn CLdpu7ULXNDWB9LlrtmXXRyNXJV7rolmIRoH8Ul0nXYVzZ3M0hpPq6Bsr3VdXLXBHVUP FENYOFAJwEpnilVvYgKSOV/FOVjGchZD2DwFoJ+v23lmQOhqLzX2VjFcvj9QRFgQpLX5 BwfvicC0Ih7eg5Lp2vOptMvGRAEWXlh57bcb/4UJhBVhkn0Y2oOvC8ny6tDMLTYib2os /Z5w== 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=sboKaEzAb8dDo8ic4Txr+gqE6z2BPnl5/jyRIrg2YGs=; b=Ubs2EqyLL/ln5G8T8Mbba46/Y44b1sVf50RZVwLfXnYvkAvAFwMj5frKxJip9G9Zz/ i3ECFwVKFdXB5SFblm/US28a6lLm0pMCCDdebZseTSzFhb6zZDq16O3HSwt1UN8s/mIH DGvEFPED7wBv71xLq+kP/HO15eEE/nSy375gNTupOzjH4ibDdmTO3JUhIuxzTB+tWQnG xwJsQsiiKOTklxwJX+8lvD+0+MVw8SU0794OcWqz1XY5j7t8Oq5fAlZG5B1FWkFEww2u w3YLIKG+x2liguC3phSEVOX9XWdMUt+fAoT44GGMFdq8kqhCQm4hbJiB3zBVnYJ1bpl7 q74A== X-Gm-Message-State: ANhLgQ15fCd2Y8CajB4ND7shYLtqmgsa/mnxFAZpw20XGCvS5IwiR/Xv Cu8JTLjUUlr/LRKEYnkI6cnsMBjTkyJ/LR/eqylGOvaQ X-Received: by 2002:a05:6e02:eb4:: with SMTP id u20mr708304ilj.57.1583171107274; Mon, 02 Mar 2020 09:45:07 -0800 (PST) MIME-Version: 1.0 References: <20200228110804.25822-1-nikita.shubin@maquefel.me> In-Reply-To: <20200228110804.25822-1-nikita.shubin@maquefel.me> From: Mathieu Poirier Date: Mon, 2 Mar 2020 10:44:56 -0700 Message-ID: Subject: Re: [PATCH] remoteproc: error on kick missing To: nikita.shubin@maquefel.me Cc: Nikita Shubin , Ohad Ben-Cohen , Bjorn Andersson , 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 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 > --- > 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. 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 >