Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2689445ybf; Mon, 2 Mar 2020 13:44:03 -0800 (PST) X-Google-Smtp-Source: ADFU+vudnWNMEMReKLuY8f9DJ2qc2tA0E+nuZR2iDXzvWzPOTace5vur8Tu2GOLOURLH9DC8Z2lS X-Received: by 2002:aca:c5ca:: with SMTP id v193mr362477oif.62.1583185443077; Mon, 02 Mar 2020 13:44:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583185443; cv=none; d=google.com; s=arc-20160816; b=YQaoDqSqf7tBKYeRQsLxmaEauqy19s4HGu+Xy9dknsahDhWWlLVbrzMzvkfFeNpeYo Dgt5PovgFE6mQAMK566t6FOjaEH+IF5qLWCRJIQEde0aJcoastrOWPrdaQKhvKWZFD51 fLyNaIxQCQwgHA2KhdU+Z02bFMhoL0HDzbWIRedNIlQft+67L98mF4De0uZOmQNfG7P+ A+kv8VBRDjv1T+ZY2WPWJ35MvYHDZKqoHXSZotmvEG4rqHlRbmfR5jIGkmSGEToHTKEU Qm/sIPM072Jsxb39cZlUFJsRiL92T0FgwcaBHQ5D0Buc7VusqQfG0nH9xWYrn5TQ8E4f nsJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=4dlwidJa8gDEE3TMB16QWBVQS+uPEhVk5tCpDd5ZLJM=; b=Kd7AZny9OFMrpW1paamT0Zg4W6a/kORsGakpK2KEGtOnANz9mLK0aJmymoXaH7VN/e I3XvVQOKIALmUADgLLIWBLzxn0MYCz7zz7h8Tmy5oqj14wrtWImSB/vqexvouy6P+BUu fBCfnbxQyspR8rsn0n5AOwPczLCTjKrRjZTK2Hxj3yRIxnXkz6nW8uy0PbLcy0CzaeCU Vm3NaiyCbSf3Wjypu+LNl1I3vRyhK0ySjBmyXmhj4SYzZpRvPTgPCGDoFyQ92tEbpLml WYhuiR5N60Vi5IwoQFGkBFpAHooY6YLwcwKFPnGnmbJUwauUUvcQDSu/DH3k79RxtvOM NZBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vEXELDoo; 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 l11si2863325oth.235.2020.03.02.13.43.50; Mon, 02 Mar 2020 13:44:03 -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=vEXELDoo; 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 S1726810AbgCBVnW (ORCPT + 99 others); Mon, 2 Mar 2020 16:43:22 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:42982 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726695AbgCBVnW (ORCPT ); Mon, 2 Mar 2020 16:43:22 -0500 Received: by mail-pf1-f196.google.com with SMTP id f5so344558pfk.9 for ; Mon, 02 Mar 2020 13:43:21 -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; bh=4dlwidJa8gDEE3TMB16QWBVQS+uPEhVk5tCpDd5ZLJM=; b=vEXELDoob+J8VQsf8H5NR7WHeynlggYFMF78SSlMvgD2RMO3pCCAnjZ3ehbZ0aldd5 dvf/XYY1VurmRTOGDqrCs5Ogc4X3lhwKDoyakd25opm8rk2WQu/n3OVQmXgFFXpRzAqm +dfu3sriNNRUBMscl3Wkk6oEhhSCH4rNiD0wvwA7kcGQyNILwyp+ZryAv146IdGKnkag 3EGku1T/MjyHVFIoP/tJUePzmBZb1HpgqR8OE5hqsOBz0N3SMhpLwySFMHBZLjrBZjCW DqdDnDcev7344FrO0mGzQ3J0ow2S6Et9x5hDZFr+bHFGvsTWU22EoCVmuaq2YYQTzRrQ esMg== 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; bh=4dlwidJa8gDEE3TMB16QWBVQS+uPEhVk5tCpDd5ZLJM=; b=TDfZQVvCE6oPVHHuUOpkC0hSSSNpWllAYFCz5623H2+8E4RzsemuimEJj7Vwo62/7b sKsG7UX9o60ImekzoN8mM9F05kTCR69bh99Acb7uakk2uYo0kFXfnQTpAW1ax6Dpbi6k ZWj2ltQmAdkJ/VeJymdpK3Q/UarCMFnIkdIQ6fjPoGMQDHgDa60WQA0uL1laXdyBvn8m X7odKiuGe82TaiROQerDVTkK2JL0rDXFOUt5MDoDJAeQyXMXROvqw2UqmaQLv306raE/ rlQQWbXoZTx82FAob7cXhdaEkNBT0Ho6QE+DF9b3gF4Ihn1/OThhWy0seqtnuAN0SIJM 3nGA== X-Gm-Message-State: ANhLgQ2TiJ2w7YMAspeE5V91dWMOYMQ2FX18aaH9ML8wKEqjtuHqSxz5 le7LhnEl8iciUiQvqNOz+9a+PA== X-Received: by 2002:a63:9549:: with SMTP id t9mr876417pgn.346.1583185401237; Mon, 02 Mar 2020 13:43:21 -0800 (PST) Received: from yoga (pat_11.qualcomm.com. [192.35.156.11]) by smtp.gmail.com with ESMTPSA id y197sm23281150pfc.79.2020.03.02.13.43.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2020 13:43:20 -0800 (PST) Date: Mon, 2 Mar 2020 13:43:17 -0800 From: Bjorn Andersson To: Mathieu Poirier Cc: nikita.shubin@maquefel.me, Nikita Shubin , Ohad Ben-Cohen , linux-remoteproc , Linux Kernel Mailing List Subject: Re: [PATCH] remoteproc: error on kick missing Message-ID: <20200302214317.GI210720@yoga> References: <20200228110804.25822-1-nikita.shubin@maquefel.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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 > >