From patchwork Fri Oct 15 14:57:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1541785 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=5wA1FgZ9; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HW8X05g65z9sXM for ; Sat, 16 Oct 2021 01:57:52 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BE77F834E0; Fri, 15 Oct 2021 16:57:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.b="5wA1FgZ9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 126078366B; Fri, 15 Oct 2021 16:57:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F14CE834D6 for ; Fri, 15 Oct 2021 16:57:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-wr1-x434.google.com with SMTP id t2so27029187wrb.8 for ; Fri, 15 Oct 2021 07:57:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20210112.gappssmtp.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eQ4i4M83XpB0hSsD8p2yht+cdb4J4xYn7A4oXj2l2Ok=; b=5wA1FgZ9Ye+G03t/YAB0hB477WAxGL5SVCuUlcLEjd6ft3ejxx60hq8+GHr/b/FAC7 dbFOuNMV9CHgcEgok49T82EG5ReNDGD8UgquHhcaJSsIy7QaoELUM/xCbjIDy2cjqGca HmGoXg2xkdfHwaK1A0pX8Q6UMa1PSaaAkKsV2hbAp69Bfvh2CL9CCj0YD0GkbV1N1L6I Nn9wA4byx6ccKz2INhnFP9HqPhlX6TwsLRRE8FeymOVmUIN4I4XMk2UDe4ymDK0KIbQK c/t3fmNfdrEz0RZp3DeCLAAWJ5a7zGX9yJx+Sx1ZglW3DnRLZ75ibbvGVDiN5MWNZfZ3 FRYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=eQ4i4M83XpB0hSsD8p2yht+cdb4J4xYn7A4oXj2l2Ok=; b=Xn6ugtfaoQlSjevZG0PJsvmOek7frgRNQTWyOoQB1ZA1cWaFLo8V/FDPflWmVkpcvi ibqkHicSKOB65iHYuqfhNHWdHPnLCa7NMdPFZdqt+qmvHc6kms55uQDYX/Qn8ujynSjv Z/msb/NkM6q0D4hsb0SfLwW5gOb2/HCyMxE/8M9S4bNB80+Nw7XMlItgziUkniZ+Eq0U pnZ9oruHX74QhT8mgCw6H/QqoqAuaiQmuJRq1+J+o0m6rQ78TDU0zO0dQK5l/ApcWPWw IWjr1ANGFKqf91rZ4KFhnUEOtfHl3Y6UauBKFGZ2WU/J2rG3fZAZNyQYHK936ofICCmL 1yMA== X-Gm-Message-State: AOAM533bW0FgcxWJBZj+lQuZbKGo15AKo4ZXmnltbJXMYudLhMXD5OTP h8Z2ohnldCYgNQm32OD/awj0yMaKf2E+4g== X-Google-Smtp-Source: ABdhPJxITOQFnBqoUx0NpAXqDiWAtbn4bbHcIg8FYMUN+KvPyMhnkQigVI3piP5WXNAx0z5dOhg9Vg== X-Received: by 2002:a05:6000:551:: with SMTP id b17mr14881547wrf.18.1634309860420; Fri, 15 Oct 2021 07:57:40 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6:f666:9af6:3fed:e53b]) by smtp.gmail.com with ESMTPSA id c3sm3898234wrw.66.2021.10.15.07.57.39 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Oct 2021 07:57:40 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com, adrian.fiergolski@fastree3d.com Cc: Michal Simek , Simon Glass Subject: [PATCH 1/2] firmware: zynqmp: Handle errors from ipi_req properly Date: Fri, 15 Oct 2021 16:57:38 +0200 Message-Id: <7ac4f3b2104f04c72d287c46d1ccbce20f138fd4.1634309856.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean There are multiple errors what can happen in ipi_req but they are not propagated properly. That's why propage all error properly. Signed-off-by: Michal Simek Reviewed-by: Adrian Fiergolski --- drivers/firmware/firmware-zynqmp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c index c22bdca282fc..1391aab0a160 100644 --- a/drivers/firmware/firmware-zynqmp.c +++ b/drivers/firmware/firmware-zynqmp.c @@ -165,6 +165,7 @@ int __maybe_unused xilinx_pm_request(u32 api_id, u32 arg0, u32 arg1, u32 arg2, * firmware API is limited by the SMC call size */ u32 regs[] = {api_id, arg0, arg1, arg2, arg3}; + int ret; if (api_id == PM_FPGA_LOAD) { /* Swap addr_hi/low because of incompatibility */ @@ -174,7 +175,10 @@ int __maybe_unused xilinx_pm_request(u32 api_id, u32 arg0, u32 arg1, u32 arg2, regs[2] = temp; } - ipi_req(regs, PAYLOAD_ARG_CNT, ret_payload, PAYLOAD_ARG_CNT); + ret = ipi_req(regs, PAYLOAD_ARG_CNT, ret_payload, + PAYLOAD_ARG_CNT); + if (ret) + return ret; #else return -EPERM; #endif