Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp131403ybz; Fri, 24 Apr 2020 13:05:39 -0700 (PDT) X-Google-Smtp-Source: APiQypJ70igfcLdpPkTp4lvNJugMhNc0S1RtZQsI/1L6pwicoNGVVMtdKg5YD7S6bvtxQl4Kr8Y5 X-Received: by 2002:aa7:cd01:: with SMTP id b1mr9092656edw.163.1587758739754; Fri, 24 Apr 2020 13:05:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587758739; cv=none; d=google.com; s=arc-20160816; b=I30L/ha0C7K+l1CCXLNT3aqVIZgUoUvO23qgxPujChKQh8lf0NxkMyh5FwJafe2y3L a5sxMcuZJS9SogXJk6mYzvLmwF/XtDtDKBhEKTjIfdF7nBHxLGidWjpYw1KRnQ5ZFLMM SLMRqimgbmaaM/nRFaUurZVe9sOuPuFYW+3AZv2fniZ+DKnfmJRM+5He33XwVOMepY8Q DFgXvkXVgbmGgM2fggxUK0LkfPvLzxEHOdT9Y2zRwn6FWdwaac9pE0RfSuTZRw43bbpw newTyUhW0s69TIBOI5TWIkT61U6FzTAVcNKb74J1IJ0efX6e+0bxvhS5TomKNZ8YMXB9 mcLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7WYYSWCoYertzlXmUk0igZ0mJKKLhDAn/b6CFJphVPg=; b=DDvn6NhqGUAjXx4JDbivLcQxUp5h4LZ1nb7m25Xi1sPeb3RHlA5B0uve8crv4JQvFM baSgtBJU0sly4NqkbCjai+JK6n3znv1snzD9UCYEDbCVtzZkHAH5atU3/uZIXhAYb5sK GM0qm5Mu1FreCfgLau4n75sXqadgXmvTJrx72emRvYDSYX/7SDEfl6dZslXtDW+6C3Cd uYG7nBSigM67pmHeJkbDSJOcODC7t2GsG+b+58NkTpeCjTgVOT+8GS2M83CwNaMs7Uoe 0XMi0hNZoOHB+ltGTv/6dPsqgrNHHL2IJE5PLRzs1xyVmRc8EE1gWu0Pu8q4NKohtsSQ HQZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="nt/55U5N"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si4124462edf.133.2020.04.24.13.05.07; Fri, 24 Apr 2020 13:05:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="nt/55U5N"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729376AbgDXUBl (ORCPT + 99 others); Fri, 24 Apr 2020 16:01:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729339AbgDXUBk (ORCPT ); Fri, 24 Apr 2020 16:01:40 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 359DEC09B049 for ; Fri, 24 Apr 2020 13:01:39 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id mq3so4306655pjb.1 for ; Fri, 24 Apr 2020 13:01:39 -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 :mime-version:content-transfer-encoding; bh=7WYYSWCoYertzlXmUk0igZ0mJKKLhDAn/b6CFJphVPg=; b=nt/55U5NI5dfKt9QvTQuHK0Y7/cYI4ooo/5w+CzvNdl9Z8saBzFkI/mr2tSG4RP3rQ pLWXLnh5BcW7YgVEE21CJeNsqmhb/8snQDpxuWsxxHqdm6fgDtTRK8VEanYY38SFcHLx +gcESSvV8mDPrpHO/B1S7ldXHkUrvHZtGRdRRw6qc8w0ynfU5T/DBhddEsHAOwfp6VAr O18fBTcY5nQOWanAv08pgL7f4s0TEs9nPch30CZ7MLNtqDCAvhv50psfcR2gkv+waNPM MCugBIa+HbthMXOflJQ1UX1if3A/VCIfOIWoFxtnQy8TvjPsuVNLDpO3YSACMMcKgsxE aDUA== 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:mime-version:content-transfer-encoding; bh=7WYYSWCoYertzlXmUk0igZ0mJKKLhDAn/b6CFJphVPg=; b=OWx7TJILVjQsWD6KAWYhjiysqlmjyGdH8hZvIlxw55ABSBEQWJv4sjzCG1e9WC+E+w NvitWByosw7THljFwYir89aQDXDMu8B6kSWWIPXqZww/2dYH5jed9Q7B71suFZVSEC/I KhtdzTNKDc7sZYAa6GjRrmuTomcbUVqpiNZ/PzwLBOhIm++MJbR7zyKFywCJ9TK7ua2M gAZDymTON85NafCexHlHFrKnOTOgBxZ85eUk6bATI6PKGmSv6/gmUFUbirk2N6AF63Oy zeCJSI12cVyrtdWU9ruQ/DEZzApHS4pxBEYtO1d4DpPCBsG/x/92RHSKXMCuWkCZSwOa zX5w== X-Gm-Message-State: AGi0PuZgkl/2TBaXzk09s4joILK4z8fhJpQQJxmk5/zJ6jRKDBrNcV/g pBSLTwdzk2PY0fnyGpwUJuFANQ== X-Received: by 2002:a17:90a:498a:: with SMTP id d10mr8507309pjh.194.1587758498612; Fri, 24 Apr 2020 13:01:38 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id o11sm5532224pgd.58.2020.04.24.13.01.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Apr 2020 13:01:38 -0700 (PDT) From: Mathieu Poirier To: bjorn.andersson@linaro.org, ohad@wizery.com Cc: loic.pallardy@st.com, arnaud.pouliquen@st.com, s-anna@ti.com, linux-remoteproc@vger.kernel.org, corbet@lwn.net, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 01/14] remoteproc: Make core operations optional Date: Fri, 24 Apr 2020 14:01:22 -0600 Message-Id: <20200424200135.28825-2-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200424200135.28825-1-mathieu.poirier@linaro.org> References: <20200424200135.28825-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When synchronizing with a remote processor, it is entirely possible that the remoteproc core is not the life cycle manager. In such a case core operations don't exist and should not be called. Signed-off-by: Mathieu Poirier --- drivers/remoteproc/remoteproc_internal.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h index b389dc79da81..59fc871743c7 100644 --- a/drivers/remoteproc/remoteproc_internal.h +++ b/drivers/remoteproc/remoteproc_internal.h @@ -67,7 +67,7 @@ rproc_find_carveout_by_name(struct rproc *rproc, const char *name, ...); static inline int rproc_fw_sanity_check(struct rproc *rproc, const struct firmware *fw) { - if (rproc->ops->sanity_check) + if (rproc->ops && rproc->ops->sanity_check) return rproc->ops->sanity_check(rproc, fw); return 0; @@ -76,7 +76,7 @@ int rproc_fw_sanity_check(struct rproc *rproc, const struct firmware *fw) static inline u64 rproc_get_boot_addr(struct rproc *rproc, const struct firmware *fw) { - if (rproc->ops->get_boot_addr) + if (rproc->ops && rproc->ops->get_boot_addr) return rproc->ops->get_boot_addr(rproc, fw); return 0; @@ -85,7 +85,7 @@ u64 rproc_get_boot_addr(struct rproc *rproc, const struct firmware *fw) static inline int rproc_load_segments(struct rproc *rproc, const struct firmware *fw) { - if (rproc->ops->load) + if (rproc->ops && rproc->ops->load) return rproc->ops->load(rproc, fw); return -EINVAL; @@ -93,7 +93,7 @@ int rproc_load_segments(struct rproc *rproc, const struct firmware *fw) static inline int rproc_parse_fw(struct rproc *rproc, const struct firmware *fw) { - if (rproc->ops->parse_fw) + if (rproc->ops && rproc->ops->parse_fw) return rproc->ops->parse_fw(rproc, fw); return 0; @@ -103,7 +103,7 @@ static inline int rproc_handle_rsc(struct rproc *rproc, u32 rsc_type, void *rsc, int offset, int avail) { - if (rproc->ops->handle_rsc) + if (rproc->ops && rproc->ops->handle_rsc) return rproc->ops->handle_rsc(rproc, rsc_type, rsc, offset, avail); @@ -114,7 +114,7 @@ static inline struct resource_table *rproc_find_loaded_rsc_table(struct rproc *rproc, const struct firmware *fw) { - if (rproc->ops->find_loaded_rsc_table) + if (rproc->ops && rproc->ops->find_loaded_rsc_table) return rproc->ops->find_loaded_rsc_table(rproc, fw); return NULL; -- 2.20.1