From patchwork Tue Oct 13 18:45:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 54864 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id AA14323001 for ; Tue, 13 Oct 2015 18:46:52 +0000 (UTC) Received: by wicgb1 with SMTP id gb1sf15015437wic.3 for ; Tue, 13 Oct 2015 11:46:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=fiKd393bd+eKZo9Lhx7vXFZtmVhC/0wXjkfWpvvL63U=; b=KrN5MwtOMkbUVEq8QA9e+wIAs3ScuW4LliGveBI3RewCJNxMg1fM65wxnupLK1mnot rA4T+PjMnISl1NpvyACGvEJ/RHQ1zuDh1DN/IEmnAqBAR5piGHX4OoSzgfF8jTN9VW7O 4IBaUmXoQrRij57y3zd6j2eRqkhFARJbEeH5EwCecedtsZMcUGcjnr1wnvuil2ts3gCL nVnx2Fi+4A6YR9O1XEKKFAunxROgsPTPSzDTs8UazNaWf71ClVyR2FyrqPnJu6PdqrtQ psT6a3M4fRyjI2QK97YOlFt9ysESLxZ1eQzL1cnvM128FCXhwWpqofxZgRa3ygtIHku9 VyHg== X-Gm-Message-State: ALoCoQnKxB4gNm9JSRpxu8xzhxjCwHy2rALEjdrBNtGnJDnhBz/W1FT3HIE8b9URH8l63hBVec8C X-Received: by 10.112.12.132 with SMTP id y4mr7286309lbb.0.1444762011874; Tue, 13 Oct 2015 11:46:51 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.159.82 with SMTP id i79ls625200lfe.102.gmail; Tue, 13 Oct 2015 11:46:51 -0700 (PDT) X-Received: by 10.25.158.84 with SMTP id h81mr10635777lfe.58.1444762011700; Tue, 13 Oct 2015 11:46:51 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id g128si2986004lfb.137.2015.10.13.11.46.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Oct 2015 11:46:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbbck17 with SMTP id ck17so30677128lbb.1 for ; Tue, 13 Oct 2015 11:46:51 -0700 (PDT) X-Received: by 10.112.151.106 with SMTP id up10mr16361504lbb.106.1444762011579; Tue, 13 Oct 2015 11:46:51 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp2291827lbq; Tue, 13 Oct 2015 11:46:50 -0700 (PDT) X-Received: by 10.68.194.133 with SMTP id hw5mr32489658pbc.25.1444762010387; Tue, 13 Oct 2015 11:46:50 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rz9si6956268pac.15.2015.10.13.11.46.50; Tue, 13 Oct 2015 11:46:50 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752103AbbJMSqs (ORCPT + 30 others); Tue, 13 Oct 2015 14:46:48 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:58863 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbbJMSqp (ORCPT ); Tue, 13 Oct 2015 14:46:45 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id t9DIjhaw021950; Tue, 13 Oct 2015 13:45:43 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t9DIjgmX002335; Tue, 13 Oct 2015 13:45:42 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Tue, 13 Oct 2015 13:45:43 -0500 Received: from ula0868495.am.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id t9DIjdjG006981; Tue, 13 Oct 2015 13:45:42 -0500 From: Murali Karicheri To: , , , , , , , , , , , , Subject: [PATCH v3 3/3] soc: ti: qmss: make acc queue support optional in the driver Date: Tue, 13 Oct 2015 14:45:43 -0400 Message-ID: <1444761943-726-4-git-send-email-m-karicheri2@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1444761943-726-1-git-send-email-m-karicheri2@ti.com> References: <1444761943-726-1-git-send-email-m-karicheri2@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: m-karicheri2@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , acc channels are available only if accumulator PDSP is loaded and running in the SoC. As this requires firmware and user may not have firmware in the file system, make the accumulator queue support available in qmss driver optional. To use accumulator queus user needs to add firmware to the file system and boot up kernel. Signed-off-by: Murali Karicheri --- v3: no change from v2 v2: new patch Documentation/arm/keystone/knav-qmss.txt | 6 ++++++ drivers/soc/ti/knav_qmss.h | 2 ++ drivers/soc/ti/knav_qmss_acc.c | 10 ++++++++-- drivers/soc/ti/knav_qmss_queue.c | 20 +++++++++++++++----- 4 files changed, 31 insertions(+), 7 deletions(-) diff --git a/Documentation/arm/keystone/knav-qmss.txt b/Documentation/arm/keystone/knav-qmss.txt index da34a5b..fcdb9fd 100644 --- a/Documentation/arm/keystone/knav-qmss.txt +++ b/Documentation/arm/keystone/knav-qmss.txt @@ -48,3 +48,9 @@ in the file system and boot up the kernel. User would see "firmware file ks2_qmss_pdsp_acc48.bin downloaded for PDSP" in the boot up log if loading of firmware to PDSP is successful. + +Use of accumulated queues requires the firmware image to be present in the +file system. The driver doesn't acc queues to the supported queue range if +PDSP is not running in the SoC. The API call fails if there is a queue open +request to an acc queue and PDSP is not running. So make sure to copy firmware +to file system before using these queue types. diff --git a/drivers/soc/ti/knav_qmss.h b/drivers/soc/ti/knav_qmss.h index c31b8d8..6ff936c 100644 --- a/drivers/soc/ti/knav_qmss.h +++ b/drivers/soc/ti/knav_qmss.h @@ -137,6 +137,8 @@ struct knav_pdsp_info { u32 __iomem *iram; u32 id; struct list_head list; + bool loaded; + bool started; }; struct knav_qmgr_info { diff --git a/drivers/soc/ti/knav_qmss_acc.c b/drivers/soc/ti/knav_qmss_acc.c index b98fe56..d2d48f2 100644 --- a/drivers/soc/ti/knav_qmss_acc.c +++ b/drivers/soc/ti/knav_qmss_acc.c @@ -486,8 +486,8 @@ struct knav_range_ops knav_acc_range_ops = { * Return 0 on success or error */ int knav_init_acc_range(struct knav_device *kdev, - struct device_node *node, - struct knav_range_info *range) + struct device_node *node, + struct knav_range_info *range) { struct knav_acc_channel *acc; struct knav_pdsp_info *pdsp; @@ -530,6 +530,12 @@ int knav_init_acc_range(struct knav_device *kdev, return -EINVAL; } + if (!pdsp->started) { + dev_err(kdev->dev, "pdsp id %d not started for range %s\n", + info->pdsp_id, range->name); + return -ENODEV; + } + info->pdsp = pdsp; channels = range->num_queues; if (of_get_property(node, "multi-queue", NULL)) { diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c index 06d9de8..f3a0b6a 100644 --- a/drivers/soc/ti/knav_qmss_queue.c +++ b/drivers/soc/ti/knav_qmss_queue.c @@ -1504,6 +1504,8 @@ static int knav_queue_stop_pdsp(struct knav_device *kdev, dev_err(kdev->dev, "timed out on pdsp %s stop\n", pdsp->name); return ret; } + pdsp->loaded = false; + pdsp->started = false; return 0; } @@ -1592,16 +1594,24 @@ static int knav_queue_start_pdsps(struct knav_device *kdev) int ret; knav_queue_stop_pdsps(kdev); - /* now load them all */ + /* now load them all. We return success even if pdsp + * is not loaded as acc channels are optional on having + * firmware availability in the system. We set the loaded + * and stated flag and when initialize the acc range, check + * it and init the range only if pdsp is started. + */ for_each_pdsp(kdev, pdsp) { ret = knav_queue_load_pdsp(kdev, pdsp); - if (ret < 0) - return ret; + if (!ret) + pdsp->loaded = true; } for_each_pdsp(kdev, pdsp) { - ret = knav_queue_start_pdsp(kdev, pdsp); - WARN_ON(ret); + if (pdsp->loaded) { + ret = knav_queue_start_pdsp(kdev, pdsp); + if (!ret) + pdsp->started = true; + } } return 0; }