From patchwork Wed Oct 14 14:17:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 54954 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id C8BD723012 for ; Wed, 14 Oct 2015 14:18:20 +0000 (UTC) Received: by wicgb1 with SMTP id gb1sf27449209wic.3 for ; Wed, 14 Oct 2015 07:18:20 -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=MOEghwRlXonbnZMCGuN9myJmSPbXJL/jixbL7W7VCdk=; b=Gg8SZ60QnQQC5b+GqhWcRsqRphK7iru7nY3ODpDC108UC+iNI3LwkksF6PPk3cr8wX q7g176uwpIARkqJ16q7bKIeicQiV3+Q0nx7JjSp2vza59b1vJJZUM2nMum4TJZ0QJeQI m/n8WCb0vtXdPVvPbn2HCxhuLI1M7giufAsNcs2+u/SGHk2DzWoOu8QOiG2Ivs+jwmzz Zz4a0Z//5najwPJxfrEoNKdzsGvp9AGZGQ9IT9/suw/bBtA2Jx3I1dYVRtBT6MRNAvmS 21+TqZlYAVa2NGOtTLs29t8hhKzwYI/v1unJzfvGQw1HnyXdqRSqOHA2LNQLNz0BpWIz Uiwg== X-Gm-Message-State: ALoCoQl93RO9e8gE/JwF72cJl2gRaUQu1lO8LqH6AHWTmA6V5/6DNAPebeCRSvigzshPkzYDtbbV X-Received: by 10.112.202.165 with SMTP id kj5mr831607lbc.5.1444832298900; Wed, 14 Oct 2015 07:18:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.39.6 with SMTP id n6ls41135lfn.36.gmail; Wed, 14 Oct 2015 07:18:18 -0700 (PDT) X-Received: by 10.112.148.38 with SMTP id tp6mr1767389lbb.110.1444832298403; Wed, 14 Oct 2015 07:18:18 -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 ml15si5720007lbb.48.2015.10.14.07.18.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2015 07:18:18 -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 ck17so47603601lbb.1 for ; Wed, 14 Oct 2015 07:18:18 -0700 (PDT) X-Received: by 10.112.151.106 with SMTP id up10mr1785180lbb.106.1444832298218; Wed, 14 Oct 2015 07:18:18 -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 w3csp39775lbq; Wed, 14 Oct 2015 07:18:17 -0700 (PDT) X-Received: by 10.66.61.205 with SMTP id s13mr3947061par.96.1444832297075; Wed, 14 Oct 2015 07:18:17 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rx10si13667320pab.2.2015.10.14.07.18.16; Wed, 14 Oct 2015 07:18:17 -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 S1753938AbbJNOSN (ORCPT + 30 others); Wed, 14 Oct 2015 10:18:13 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:56468 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753869AbbJNOSH (ORCPT ); Wed, 14 Oct 2015 10:18:07 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id t9EEHIQP001229; Wed, 14 Oct 2015 09:17:18 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t9EEHIWd030221; Wed, 14 Oct 2015 09:17:18 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Wed, 14 Oct 2015 09:17:18 -0500 Received: from ula0868495.am.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t9EEHBsG007638; Wed, 14 Oct 2015 09:17:16 -0500 From: Murali Karicheri To: , , , , , , , , , , , , Subject: [PATCH v4 3/3] soc: ti: qmss: make acc queue support optional in the driver Date: Wed, 14 Oct 2015 10:17:15 -0400 Message-ID: <1444832235-15263-4-git-send-email-m-karicheri2@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1444832235-15263-1-git-send-email-m-karicheri2@ti.com> References: <1444832235-15263-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 --- v4: no change from v3 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; }