From patchwork Wed May 19 05:46:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 442369 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp985967jac; Tue, 18 May 2021 22:47:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrbWs4oEtDMwlWP+7Z8Sm28Zwy6G4KY7PF9P6Te40Txf41BKNEX552MlQ2ZkKhaYwmO8GA X-Received: by 2002:a17:906:6c96:: with SMTP id s22mr10703775ejr.468.1621403238723; Tue, 18 May 2021 22:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621403238; cv=none; d=google.com; s=arc-20160816; b=LC4qWzK554eTF8dKI2vYYXvKoS59GpzcY6DRLGbNdVakCeCGA2W29dUXyXn8IyW+O5 nKkbGYvQFz21a9sEF6dz27SO7+jLl7++gnImWpmi8JuZ+fxYTLM3hFYOwOygJA8QNawr s4HzxZbyeTY3HcJST9+6BQkz6scltB1XLg4yjxNYSccIRu1zt6vuJNAtHOGjTN21jfWl Q0bjYSq2OswQpaYPGJK5JCSH1kG3fsD+JKfZBNvFDoDgPQs2ichvwpsfioQ56JZklBPw iMKDnYQ1jxI2JtAro+1cpTCp9IuidYvdp5HI6BzMehWEQDg3z5tWgVCFDFc95ZTCDsmt QxDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=hi6WjBXzska5K8FmtBouIggwiytU0GYq4xvkaSVfBaU=; b=M23OaYnTOmTj7sNeC6N1au0lFjzlE0S4Xuns3YDwnKqx+O777XKKSMv6BMumv676wV rdcpEhOd5sKrJzieaKiXfdPv54BZkhrAmTy08cr9Y/gPFh2HME29vcnSOvpdjfhinYxR FqWYfVb0OvkjmvbC7qlfu5+YI8Ph84AMeAXDBtSlHEqCLFnGFBSIjSustlWJNMiPMPkX EXD+sWyYrAss5qOWTLI+RD04RXC9fPW+YFXFe93LalOLJIbaO94GrbbHsmpM7DYxkPwe sdZIducgn6LkRIONkyTwb4ijUC08mmL9IsrgozDmOhg7MolwIeF/1njfTH1h9Dhc1xzg 7XWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wX80A9BK; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id w10si14284613ejv.652.2021.05.18.22.47.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 22:47:18 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wX80A9BK; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3A09382E2B; Wed, 19 May 2021 07:46:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="wX80A9BK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1B62682E1E; Wed, 19 May 2021 07:46: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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) (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 AEFAA82D10 for ; Wed, 19 May 2021 07:46:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masami.hiramatsu@linaro.org Received: by mail-pg1-x535.google.com with SMTP id l70so8677164pga.1 for ; Tue, 18 May 2021 22:46:40 -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 :user-agent:mime-version:content-transfer-encoding; bh=hi6WjBXzska5K8FmtBouIggwiytU0GYq4xvkaSVfBaU=; b=wX80A9BKH9J8uppfe49gSI/+QMzAxPX7KWS9SaP485N6HDyOBIsE2g767eiFvH5xom nnb2db/7AX3kLAPwUEmNVI0nFARkyBEFSaBi9khj8+ntTpDZ5I5l2B2IZ1WEGTi5YOE6 8uvqROvTAL/btxdVYH4cww4bZQMLmLULIZUy2h8Le/uXbO+DU3HQxBQCm40CDW2/5EP7 mQgPM/qiHghZ5E8ohjxaFUbh9Xaa7d6aPYrptrGMuYhKs+vMMqYBQPm7nGeAcrjz6ldK FvRkGM2N84tZ2H8cbkxjV+6ySQYdFyS338uA+5hUTRdq1Rjb/CpSYI5DsGWX0J1J7laY x8sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=hi6WjBXzska5K8FmtBouIggwiytU0GYq4xvkaSVfBaU=; b=lY8XbYGZGrLm9q42j6uHPLiLW9BKLosmq1aynT0Xfy74g7dYv/xFTwcE95DHBO7ies GQXWSbRHkQAA9tgP/H6T6BZavEYtnr7vu61sfsOcUgOXggFTtPB/uIE4fMAQcfIPjKIZ lvUnXP9Q4ZqlaErTM1F4AGICUioLH935kkutGWJJPgJYStvVclvIG8Yv7T9PM9adO3yx pfcr01sxyseLTypQiUMBtb+bUYTXTuG5VRYv4Pb63GTyxXN/2BCLyVEMrNLCoMih9a1A rI7iwWEkYaoqhdyWd88pUVCpN54KVmwxsqcViRVsyChEIXDZFmVoGaZeja4S+LW9PNNL pRUg== X-Gm-Message-State: AOAM5334pNMi6qOSPP9G7i4O0K+XsbAhc69GoZ/OAabmC8Nj/zhFWbs1 Agp4GJK782SP5UkNO4tBU1q3Ig== X-Received: by 2002:a63:6cc:: with SMTP id 195mr9175146pgg.401.1621403199197; Tue, 18 May 2021 22:46:39 -0700 (PDT) Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp. [210.141.244.193]) by smtp.gmail.com with ESMTPSA id c83sm8114760pfb.10.2021.05.18.22.46.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 22:46:38 -0700 (PDT) From: Masami Hiramatsu To: Peng Fan , Simon Glass , Tom Rini , Heinrich Schuchardt , Alexander Graf , Jagan Teki , Vignesh R , Joe Hershberger , Ramon Fried , Sughosh Ganu Cc: Masami Hiramatsu , Jassi Brar , Ilias Apalodimas , Masahisa Kojima , Takahiro Akashi , Tim Harvey , Bin Meng , u-boot@lists.denx.de, Jaehoon Chung Subject: [PATCH v4 12/14] dfu_mtd: Ignore non-implemented lock device failure Date: Wed, 19 May 2021 14:46:34 +0900 Message-Id: <162140319389.47256.629728945246178860.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <162140306116.47256.6799058439792039400.stgit@localhost> References: <162140306116.47256.6799058439792039400.stgit@localhost> User-Agent: StGit/0.19 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.102.4 at phobos.denx.de X-Virus-Status: Clean Ignore the non-implemented lock device failure on writing mtd via DFU. Without this fix, DFU write shows an error on such device even if it succeeded, because dfu->write_medium returns -EOPNOTSUPP. Signed-off-by: Masami Hiramatsu Cc: Lukasz Majewski --- drivers/dfu/dfu_mtd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/dfu/dfu_mtd.c b/drivers/dfu/dfu_mtd.c index ca67585a7e..e58302c32d 100644 --- a/drivers/dfu/dfu_mtd.c +++ b/drivers/dfu/dfu_mtd.c @@ -152,6 +152,8 @@ static int mtd_block_op(enum dfu_op op, struct dfu_entity *dfu, ret = mtd_lock(mtd, lock_ofs, lock_len); if (ret && ret != -EOPNOTSUPP) printf("MTD device lock failed\n"); + if (ret == -EOPNOTSUPP) + ret = 0; } return ret; }