Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1922713ybv; Thu, 6 Feb 2020 12:20:02 -0800 (PST) X-Google-Smtp-Source: APXvYqypXx02Qt2wJZ/PyHW0rBK55fi7xK9USbtQJSxQ8UMugMzhxxsFI58HgkIg2PHw34+oH5vo X-Received: by 2002:a05:6830:1304:: with SMTP id p4mr26397237otq.327.1581020401848; Thu, 06 Feb 2020 12:20:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581020401; cv=none; d=google.com; s=arc-20160816; b=kXDmuT+YM8vFaExN+2aDrpOccqpterEd7Lgl1ZaoMJjiOKdQivPziDAD55CKobeLR7 6WARpwiPSPD0q5OMFYAp0/IhsqOtZj2DeuMvqG3ndyO0VGLtU1byHsNGWUP9GhHRMNrH oIuIGnFuRYcgACnRSxD8qwNW4nPUbGpg5x12haqtN0QXaaq/YqI7lcuqE7VXs2ui5BkC EXOQoxuaAlZRNUOabosk4LCQgyTL70R6RcIiGypSZiQD5hIn5iO0wQZHqeqo0whIK6LV 9Ow3idFKHAr9Iwk62akEKJt/Yk1RF8IZ4dXdY5rtw8BepQBULrFvA+CU1S9tachxFdjm xyxQ== 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=DFN1Km4dCQkq+GGDV1xBpaMwWsOvVlBXIU+KU1SLC/A=; b=eDnkBYf9F/4A6Y12YbF58LKZ6BdOel6ZarC0jNYHAncYOxAg1t6DiKkLb7a6FmkdQT PJfB3LrYksni/BiGVQkE+NMdBR+jm42WPXHdEQXynlqt+gF0Z3egkQaNhgZW06w8eS3s jEisL4MExo4BObiq0H3TRSN1BCYn5RFfSElRWAusQjE4FtxezN6c0Qktc8BzZWb+tzXX v2zdz3k0EVDD54x/oWdUJFuiUAAGYpbKh2zqqJwOfeIqcCPRe1ufuJJe1trXX4hZO5kO m4ENDgYNKlwduKeh0/60iroPky+2SSDGluo8ROV8sosInhZ4jphvo2BM4BF+AxGvS1Ad 3DuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H0XeMD+6; 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 p28si388659oth.296.2020.02.06.12.19.49; Thu, 06 Feb 2020 12:20:01 -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=H0XeMD+6; 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 S1727897AbgBFUSc (ORCPT + 99 others); Thu, 6 Feb 2020 15:18:32 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:45335 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727698AbgBFUSb (ORCPT ); Thu, 6 Feb 2020 15:18:31 -0500 Received: by mail-pg1-f194.google.com with SMTP id b9so3293654pgk.12 for ; Thu, 06 Feb 2020 12:18:31 -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=DFN1Km4dCQkq+GGDV1xBpaMwWsOvVlBXIU+KU1SLC/A=; b=H0XeMD+6iXBq9rEwF2gPODpAdg7UWIGBJwq+XhYAMmhdeZK7LPstfFxROA6MwmBBI5 FbSSsifLyu2EKf+pzBKjbm4GgsS8kE//QjYl8OgteVwPzJSQ2ZnYETTxJ82hMHli9Kn0 G/oovqUZhD8W4nl3PmX651ZoKidu2pxfnVltxCWwcaAB8W98heEjoB6LDmQLakjPJXH/ pHVUEagfwfWpQgtbqRxS4rTNDkkCySUp6CKmIgyEsF6yOBeygw0Mbyn+udmfHiHRjBtl 0zwUavbb4UeZ14UwzO+qo4JgGq0EECucDU++DamE8lml01QYSgwmKxY1Uk/rUQy7/DGL YoLg== 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=DFN1Km4dCQkq+GGDV1xBpaMwWsOvVlBXIU+KU1SLC/A=; b=ZCjlL7LZEh4Bsp/OVcr/KCgnbWNcUXNAmUmT35ZkWjZpzIih1N0jbJIv+tkUl8ryhf KosO73G+Ve1wi4KGMRBZwnezQcDC3JOujVs2a1ISauqfWfmGYAozpc6DI9Xk6+Kj8KSu nkJe+ST+n0RkC+LGTE4HOls4xnDkbgvDVFu7yIT1QFucQnJWSsvy+tTAvAH0sHSaMfvX /HT54y7lQx+up/bBkdITUDWg6xAcfJdhSTR719qA4RA4SneJK52GzJqmoOImrDSTqKMv Oq7la235zn/7JjanXdzGxIuBC9Z58bQsCs2/KjVH6mfLhlOsMg4a45RWQROr6szJ/+9a jjaA== X-Gm-Message-State: APjAAAVmjBTwnoBTGQyhJ7jeum4NA+4F0DlHZYSpRCG8Ln57Tw+gH8X5 rH3Otag80dZHg/Ho02qIsifqig== X-Received: by 2002:a63:3688:: with SMTP id d130mr5660071pga.422.1581020310775; Thu, 06 Feb 2020 12:18:30 -0800 (PST) Received: from yoga (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id b130sm265441pga.4.2020.02.06.12.18.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2020 12:18:30 -0800 (PST) Date: Thu, 6 Feb 2020 12:18:27 -0800 From: Bjorn Andersson To: Nikita Shubin Cc: Ohad Ben-Cohen , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] remoteproc: warn on kick missing Message-ID: <20200206201827.GP2514@yoga> References: <20200206055419.15897-1-NShubin@topcon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200206055419.15897-1-NShubin@topcon.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 05 Feb 21:54 PST 2020, Nikita Shubin wrote: > .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. > > At least a warning needed on attempt to call missing method. Is this not a fatal error only happening during development? In which case the NULL pointer dereference will come with an oops with sufficient information to pinpoint what's going on? Regards, Bjorn > > Signed-off-by: Nikita Shubin > --- > drivers/remoteproc/remoteproc_virtio.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c > index 8c07cb2ca8ba..77a81f331e3f 100644 > --- a/drivers/remoteproc/remoteproc_virtio.c > +++ b/drivers/remoteproc/remoteproc_virtio.c > @@ -32,6 +32,12 @@ static bool rproc_virtio_notify(struct virtqueue *vq) > > dev_dbg(&rproc->dev, "kicking vq index: %d\n", notifyid); > > + if (unlikely(rproc->ops->kick == NULL)) { > + WARN_ONCE(rproc->ops->kick == NULL, ".kick method not defined for %s", > + rproc->name); > + return false; > + } > + > rproc->ops->kick(rproc, notifyid); > return true; > } > -- > 2.24.1 > > Confidentiality Notice: This message (including attachments) is a private communication solely for use of the intended recipient(s). If you are not the intended recipient(s) or believe you received this message in error, notify the sender immediately and then delete this message. Any other use, retention, dissemination or copying is prohibited and may be a violation of law, including the Electronic Communication Privacy Act of 1986. ??