From patchwork Sat Aug 29 01:08:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 7094151 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C56FBBEEC1 for ; Sat, 29 Aug 2015 01:14:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DFFF620987 for ; Sat, 29 Aug 2015 01:14:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1862C2096F for ; Sat, 29 Aug 2015 01:14:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZVUdY-0007jR-66; Sat, 29 Aug 2015 01:08:52 +0000 Received: from mail.kmu-office.ch ([2a02:418:6a02::a2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZVUdV-0007iO-7H for linux-arm-kernel@lists.infradead.org; Sat, 29 Aug 2015 01:08:50 +0000 Received: from trochilidae.toradex.int (75-146-58-181-Washington.hfc.comcastbusiness.net [75.146.58.181]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 8922C5C132C; Sat, 29 Aug 2015 03:07:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=agner.ch; s=dkim; t=1440810472; bh=N50ySb/QN+waxaF/ffr3k+0Ig5JZyCzuMkKSjGSP9cw=; h=From:To:Cc:Subject:Date:From; b=C+hVNFNbYU3G7EeZMyPToQlcnapqAIwxmDzvX+EXS+7DwNV+FCjG04+qh9a+m9nyQ /fh99JheKTpXSjevFk8/1OVrFrIphVG36M6Eyew4D3mTUd6o00r9wq8udCqrLK32NW dQCLEr+Gk7iJPh43AGglGwmA8w6oAKcZJ2A8NA0E= From: Stefan Agner To: ohad@wizery.com Subject: [PATCH] remoteproc: report error if resource table doesn't exist Date: Fri, 28 Aug 2015 18:08:19 -0700 Message-Id: <1440810499-24327-1-git-send-email-stefan@agner.ch> X-Mailer: git-send-email 2.5.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150828_180849_427364_3C029653 X-CRM114-Status: GOOD ( 12.06 ) X-Spam-Score: -2.0 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Agner , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, if the resource table is completely missing in the firmware, powering up the remoteproc fails silently. Add a message indicating that the resource table is missing in the firmware. Signed-off-by: Stefan Agner Acked-by: Suman Anna --- Hi Ohad, I am currently working on remoteproc support for Freescale Vybrid's secondary Cortex-M4 core. I stumbled upon this rough spot since the little test firmware I am using now does not have a resource table yet. This also opens up a more general question: Is it mandatory to have a resource table in the firmware? Theoretically a remoteproc could also work completely independent, all what would be used from the remoteproc framework is the loading and starting capabilities... -- Stefan drivers/remoteproc/remoteproc_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 8b3130f..29db8b3 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -823,8 +823,10 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw) /* look for the resource table */ table = rproc_find_rsc_table(rproc, fw, &tablesz); - if (!table) + if (!table) { + dev_err(dev, "Failed to find resource table\n"); goto clean_up; + } /* Verify that resource table in loaded fw is unchanged */ if (rproc->table_csum != crc32(0, table, tablesz)) {