From patchwork Thu Oct 20 02:40:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 78382 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp560529qge; Wed, 19 Oct 2016 19:40:59 -0700 (PDT) X-Received: by 10.99.56.65 with SMTP id h1mr5409662pgn.166.1476931259244; Wed, 19 Oct 2016 19:40:59 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n8si39636407pgc.26.2016.10.19.19.40.58; Wed, 19 Oct 2016 19:40:59 -0700 (PDT) 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; 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 dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934057AbcJTCkl (ORCPT + 27 others); Wed, 19 Oct 2016 22:40:41 -0400 Received: from mail-pf0-f181.google.com ([209.85.192.181]:36084 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933864AbcJTCka (ORCPT ); Wed, 19 Oct 2016 22:40:30 -0400 Received: by mail-pf0-f181.google.com with SMTP id e6so26528661pfk.3 for ; Wed, 19 Oct 2016 19:40:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=anmFFEhfXuNE0JcHP21awQo+tFdRNNgvivG5BnJbFPU=; b=RRLA6bE8Vzr7EE0qWwoTw9VHeDP6cXoZJdTcZGjvo0h8s6Cy05BlpbqtdFcoY4i1Zw IcPhxBKh8N8DErkNJ9b85h1Xusw36KhChnYneaycniJwuU0iLiHeiEr8VTevrjFclWrD pUPNmPjDInbs0Uu/WZ2mBxx6vR3jrlJML4klU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=anmFFEhfXuNE0JcHP21awQo+tFdRNNgvivG5BnJbFPU=; b=ddh+A6PmDt/Ot7R9V2/5miswiKJtusVsM9aTAPYhfrDeGstt+tO7h002tJu9g4KPED o8l3r4bFY09oR5lF6C9l+pX5DjDz9ldOAnOR6atqQLx41g/4SJd/0X2B0YtKMxVbOKc/ P+qNL8NTrJgGeOl8RTqlBRXHQauO8DQZcc9OrLmnz0JPf302oRbHA72QsYWMWHSKJdlK 9uEWCtFO5ApeSpgWf/WbPpIzheI7ERpTY+aBBUjMNZP277djT8OgpF4cPZi7b6obBAuX FfDS4atOPB53LlVJZOHjEA5huAmG/uJSOOXif7t6xNSygdUyUfK1+IuK27k/SLn5RIX8 WkbQ== X-Gm-Message-State: AA6/9RmNSM/tCveEeDbnC8/mT+/am22+xIUohrEOAPDfV7orqbiVv9Me9rcFJSmF6nTYP0K8 X-Received: by 10.98.13.20 with SMTP id v20mr17055007pfi.80.1476931230072; Wed, 19 Oct 2016 19:40:30 -0700 (PDT) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id s85sm66780616pfi.17.2016.10.19.19.40.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Oct 2016 19:40:29 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/11] remoteproc: Update max_notifyid as we allocate vrings Date: Wed, 19 Oct 2016 19:40:10 -0700 Message-Id: <1476931212-1806-10-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1476931212-1806-1-git-send-email-bjorn.andersson@linaro.org> References: <1476931212-1806-1-git-send-email-bjorn.andersson@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Vrings are now allocated as we parse the resource table, before we boot the rproc or register any virtio devices, so it's safe to bump max_notifyid as part of this process. Signed-off-by: Bjorn Andersson --- drivers/remoteproc/remoteproc_core.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) -- 2.5.0 diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index c242ca016496..57f12421fdd2 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -236,6 +236,10 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i) } notifyid = ret; + /* Potentially bump max_notifyid */ + if (notifyid > rproc->max_notifyid) + rproc->max_notifyid = notifyid; + dev_dbg(dev, "vring%d: va %p dma %pad size 0x%x idr %d\n", i, va, &dma, size, notifyid); @@ -719,15 +723,6 @@ static int rproc_handle_carveout(struct rproc *rproc, return ret; } -static int rproc_count_vrings(struct rproc *rproc, struct fw_rsc_vdev *rsc, - int offset, int avail) -{ - /* Summarize the number of notification IDs */ - rproc->max_notifyid += rsc->num_of_vrings; - - return 0; -} - /* * A lookup table for resource handlers. The indices are defined in * enum fw_resource_type. @@ -736,7 +731,7 @@ static rproc_handle_resource_t rproc_loading_handlers[RSC_LAST] = { [RSC_CARVEOUT] = (rproc_handle_resource_t)rproc_handle_carveout, [RSC_DEVMEM] = (rproc_handle_resource_t)rproc_handle_devmem, [RSC_TRACE] = (rproc_handle_resource_t)rproc_handle_trace, - [RSC_VDEV] = (rproc_handle_resource_t)rproc_count_vrings, + [RSC_VDEV] = NULL, }; static rproc_handle_resource_t rproc_vdev_handler[RSC_LAST] = {