From patchwork Thu Feb 11 23:46:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 381067 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp2495879jah; Thu, 11 Feb 2021 15:50:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJx20y6HRLLVeDAtDDO3XlYLnrfygJ5FPSJ8po6DTVGaqB8SnagMkTNKjwVAgkW6XTvFN7cm X-Received: by 2002:a05:6402:5:: with SMTP id d5mr598749edu.121.1613087403030; Thu, 11 Feb 2021 15:50:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613087403; cv=none; d=google.com; s=arc-20160816; b=k8f/P8Ux6vL3+scwHMgPkoWKCli5kBcKP1c67h+wARdYwiEZq9aWHJf3hh/6dzJarT Hi1k2uclPHXis0RYKzPPmxZw9t/yTmd/G0HkkcHq6ZfQlHN9MQpd1Q8AZBQQLLtbyzHi kNZLA0UX6jXyRwkWBDMXGPvqt+t1R+JdDNrE7u79iCdkng+gVsh9Nz+cHmRvOpRG9zzc yYjfraF4azOgWNVlso0+epqFKV/KN4z9BjZnQf5FcWbYXBJQ1LFyEPfrvjrx2Icjt+ik MutsIuj7HJYvhLGdMJTQZIGL0wIflArE8UXvEo0Nl/iW4QmzS7S5gC+WSqgN2BfNb8Gh gkfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XYqKe5JHKTsf6qqgvmLT8SEOr6JSbsFQUrC6la75+Tk=; b=bsWK7A6Z15Ct+X1JKRFLtdhnywOzgK6zR7Mx7oGS4OiNiT+vy5ZQVS58a1VnZgRHG7 kvB/P1qZAHb2OfiBiPL4Vn7nT+i0OPWlFLCQn2gxyTxUVi0e8O6RvP0en9ykSW/Hhcm9 qB87L7K9e9nJPKoDrLzOgoY29Qt6B+Ja7N2EZdYSBeo0Lx4CK6iCs8dCxUjTFHiDVrvb LS4S3oIli68CyFJKM627+aZ/VNaCZuO/9wjUDBw6YFrJ37tNwHdBEKKWFNzyUtbf4iTx 0hxG4JsGGqcEb4IcowBgaI585lCz0BLc+VQHDVdVOQ95BMYiS+I8I3PpK9BUXWW5WM8C U+bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JdchHoa7; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 ot7si4969638ejb.88.2021.02.11.15.50.02; Thu, 11 Feb 2021 15:50:03 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-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=JdchHoa7; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S230363AbhBKXt6 (ORCPT + 6 others); Thu, 11 Feb 2021 18:49:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230049AbhBKXs4 (ORCPT ); Thu, 11 Feb 2021 18:48:56 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4177DC061A31 for ; Thu, 11 Feb 2021 15:46:39 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id gb24so4368636pjb.4 for ; Thu, 11 Feb 2021 15:46:39 -0800 (PST) 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=XYqKe5JHKTsf6qqgvmLT8SEOr6JSbsFQUrC6la75+Tk=; b=JdchHoa7ZVlV5+MdQYZdmvDbjBv5SZjvgzlftSjTAhzph9zIe1p3ew7E3tWtnmAOCq lGFo9sYQDG5tnaXPXoZoXsJxuAle5HmFzbLqhh5pCtluiiaK/nbN+MUixIqVYE1eRGEi s//hd0GCI6nxFs6WVeTc6uH8o7x8Utj9y18AWzaus3ak/KiN0BCqKInCWbXLoN0saB/Q 7pU7ki04U0wtCaOK8bWw4dxnxDblsoe+jjI6+AA9VDTHoH/s1R3Joa3bhSsR9Z0MWlG7 5+gNu0rtYfxoa5iH/WSEg6d4ZrebBa+a7T4Zg2pg01qVMSMJgBVdiUvOlVKwmkMcUU7L zTpg== 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=XYqKe5JHKTsf6qqgvmLT8SEOr6JSbsFQUrC6la75+Tk=; b=f0JZo0YniA2MuMkQHXUPewugKv5w6nqsOU8AxKSCNu8LGgiwLLmzP+MuUVYxeM8GU5 PonCisiF3y49OSORZxi0lRTGOglOt2/A4KKL1HulqpsffQQW0W5ZNqUldcmM991Y8TQV JVtRV2wSPpYKpAXU6M8fJEwE5+042nCOGN4vb0b9wC+KcXpCIS4pDrmCwuYnJUghiNab 1fcIkXvSM0cpHzP4CVQJYosyv1bwzBK7atijlcpxU9vd+mMTMUuVaFS//VsBqDGnykrF li6mP3xeqA5eEH70xtOTP4mGuQVewhVWa8AO3Wsn/Cc0rCV2TldIcqho6CJPpOR/8yz9 6tjQ== X-Gm-Message-State: AOAM532sqZpcL2CjEdWhKXWWhD0fnVDh2OWrM+tCb2Qiih6LP2ogRg8J 8px1RPfUguBoRvZPsCt7un1/Sw== X-Received: by 2002:a17:902:8c8f:b029:e0:1663:fd34 with SMTP id t15-20020a1709028c8fb02900e01663fd34mr489602plo.84.1613087198802; Thu, 11 Feb 2021 15:46:38 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id iq6sm5932740pjb.6.2021.02.11.15.46.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 15:46:38 -0800 (PST) From: Mathieu Poirier To: ohad@wizery.com, bjorn.andersson@linaro.org, arnaud.pouliquen@st.com Cc: robh+dt@kernel.org, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 10/19] remoteproc: Add new detach() remoteproc operation Date: Thu, 11 Feb 2021 16:46:18 -0700 Message-Id: <20210211234627.2669674-11-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211234627.2669674-1-mathieu.poirier@linaro.org> References: <20210211234627.2669674-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add an new detach() operation in order to support scenarios where the remoteproc core is going away but the remote processor is kept operating. This could be the case when the system is rebooted or when the platform driver is removed. Signed-off-by: Mathieu Poirier Reviewed-by: Peng Fan Reviewed-by: Arnaud Pouliquen --- include/linux/remoteproc.h | 2 ++ 1 file changed, 2 insertions(+) -- 2.25.1 diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index 51538a7d120d..eff55ec72e80 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -361,6 +361,7 @@ enum rsc_handling_status { * @start: power on the device and boot it * @stop: power off the device * @attach: attach to a device that his already powered up + * @detach: detach from a device, leaving it powered up * @kick: kick a virtqueue (virtqueue id given as a parameter) * @da_to_va: optional platform hook to perform address translations * @parse_fw: parse firmware to extract information (e.g. resource table) @@ -385,6 +386,7 @@ struct rproc_ops { int (*start)(struct rproc *rproc); int (*stop)(struct rproc *rproc); int (*attach)(struct rproc *rproc); + int (*detach)(struct rproc *rproc); void (*kick)(struct rproc *rproc, int vqid); void * (*da_to_va)(struct rproc *rproc, u64 da, size_t len); int (*parse_fw)(struct rproc *rproc, const struct firmware *fw);