From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80E0CC4332D for ; Fri, 12 Mar 2021 16:26:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 54BF265019 for ; Fri, 12 Mar 2021 16:26:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232575AbhCLQZf (ORCPT ); Fri, 12 Mar 2021 11:25:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232707AbhCLQZF (ORCPT ); Fri, 12 Mar 2021 11:25:05 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42FC1C061574 for ; Fri, 12 Mar 2021 08:25:05 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id s21so5385361pjq.1 for ; Fri, 12 Mar 2021 08:25:05 -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=NSR3WPj9kVNOA3Z+lyfGa5gZK8OdIdz44lqCk0bWIR75Fl1XpX52MaSy+gCFgyriLE lk3wU8lymjl4n+0SAKdE1CIpBYg/f5vhemjcwiFSjYdBfe4sqHxIGz/+vYqBR2OQW3vg IJnDoVl6TVZ2ce64zpgNhkrPkjrEG1Bj5LpvC8HF9FKweSh44nXA9NdTL7tZPeVhj2xi jzPe8ViHhVICXCW919IGffk6+BuRtqZszzqbEDzkTvckOF4FuvM/0L8u7aO16VxXz9GN HEb7ln5+PTDT2fHC8gVGNdXOOrO+SmFIBMggLrCZjvZxAcz2XpQ08fyev+TxEdbqXvEd uVrQ== 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=EahD4a0/MHInT5cTiChOn/18TwXiyX6vwrkgSuNhzUCREDgBgn7Y9tFT1Rn2tw/CBW djVE2FAdCVwSl4d5tDa5NMK9s8fkua7T7aAGF/hZizOirFv/R5KH/XyCUYxt3HfQE9GF D8UFvYv77biceO7+fU3JcRRTn+c0bO4fc03SG/bsKCh7JXlTUpXfXuv+Zb/JgZExBG82 iAA0LzWE88U+z5Iy0+5/vSkzyWbOVlSCCEEPWv96Z2u5caazh2Y0uqKRISYOWduV01nS tJtQ8WkCiHcsnRv9XEG/PIpLrSqOrvN6PBiONANj7MAwsRWk+456WVqzWqd3910tLxHU rMMg== X-Gm-Message-State: AOAM533Qp59hQ8C5qWUNfDCXcgo4U9IAJD6BCaFtRgtgEFOxt0Fi7pgX xFhJ2m+xUz43F/2nts9AxLJOiw== X-Google-Smtp-Source: ABdhPJzBoHcM7FRG/IPPBelrke7jASa1grvRPE7jreUEMZqm67LUJ5ZCN/OtWi+sRjWc0lUdmo0C3A== X-Received: by 2002:a17:902:e806:b029:e5:cb85:dc4d with SMTP id u6-20020a170902e806b02900e5cb85dc4dmr14247156plg.11.1615566304850; Fri, 12 Mar 2021 08:25:04 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id e8sm5899599pgb.35.2021.03.12.08.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 08:25:04 -0800 (PST) From: Mathieu Poirier To: bjorn.andersson@linaro.org, ohad@wizery.com Cc: arnaud.pouliquen@st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v8 08/17] remoteproc: Add new detach() remoteproc operation Date: Fri, 12 Mar 2021 09:24:44 -0700 Message-Id: <20210312162453.1234145-9-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210312162453.1234145-1-mathieu.poirier@linaro.org> References: <20210312162453.1234145-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@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(+) 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); -- 2.25.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29033C433DB for ; Fri, 12 Mar 2021 16:29:14 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8325664FD9 for ; Fri, 12 Mar 2021 16:29:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8325664FD9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CzMzcgDaUMkUJnLc49ucteeFquGTfjxd5Xux9YG6up4=; b=PNJ+ohp+8O1s9PgqqjXY8uSGY 4BZORN8wcz3fO5rzIShc/dJFQKqLELC+03FCK/xY1hfHaLOQgP5oS7FQx24r47nzmA9+AwKlz3B0W dO4Q9MgaLNuRToJ693IDPu181gVtRDqSGyfJzpyMZcC0VyaxmUTc955cvUOHjGgWQH6yB1G/lAHN0 jJCKqF1LdeNzWTSyootp6ufljHnnJfrYIXreNIA7Da+G6gU0l2Lq6gT2SV/K5wzqVTkQGJRG7sCpa GBeaM/qn/dGPrUIdD2oaOOOgtDMZvP/IKwUqlvuF0Yu+4PuKe+gFqWhgX2DWHR6eYDXR6X2IGvK0s iYXpAeK4A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKkdY-00Bxhs-Bc; Fri, 12 Mar 2021 16:27:40 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKkb4-00Bwf7-9u for linux-arm-kernel@lists.infradead.org; Fri, 12 Mar 2021 16:25:08 +0000 Received: by mail-pj1-x1034.google.com with SMTP id mz6-20020a17090b3786b02900c16cb41d63so11304101pjb.2 for ; Fri, 12 Mar 2021 08:25:06 -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=NSR3WPj9kVNOA3Z+lyfGa5gZK8OdIdz44lqCk0bWIR75Fl1XpX52MaSy+gCFgyriLE lk3wU8lymjl4n+0SAKdE1CIpBYg/f5vhemjcwiFSjYdBfe4sqHxIGz/+vYqBR2OQW3vg IJnDoVl6TVZ2ce64zpgNhkrPkjrEG1Bj5LpvC8HF9FKweSh44nXA9NdTL7tZPeVhj2xi jzPe8ViHhVICXCW919IGffk6+BuRtqZszzqbEDzkTvckOF4FuvM/0L8u7aO16VxXz9GN HEb7ln5+PTDT2fHC8gVGNdXOOrO+SmFIBMggLrCZjvZxAcz2XpQ08fyev+TxEdbqXvEd uVrQ== 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=gFcx0mvHMM6Lp0gG10QXMcyOzltYmUnrBJ6RoLG4ceS1MYKaaL244P4vxhXi96hDZa 1yd6ToGycSZq+LLS9Gg8w80miR4beza3+PWXrDUgHeCUIZlcr9LhQM9jW6Md4ohGbm8f ej35S6BQCjSrwO3JYUTPBWHuAQhLftWqnB5WxSUFzsdIotboHR9iaQO0gBcYLiegdxpp ghjajV3KAAmk+3/nxnyP4DQIlvd40h42H8tVfvEOXHnbx/qCdPtVAjj6yBamzkVx54s3 fYRuM+wvx1LLJuaFjkX+8KQ9gYsIFbRtczewq91KqDk2tQgZaNf9124VvZek6tyRQFhc 5KEw== X-Gm-Message-State: AOAM5300enz3xuvoYZPHdJPZzbB3Z3jsocJdnisA4zeRTwlSJZlSFMDI dcvdcVhQyzLJdBst+EXDFS3kPA== X-Google-Smtp-Source: ABdhPJzBoHcM7FRG/IPPBelrke7jASa1grvRPE7jreUEMZqm67LUJ5ZCN/OtWi+sRjWc0lUdmo0C3A== X-Received: by 2002:a17:902:e806:b029:e5:cb85:dc4d with SMTP id u6-20020a170902e806b02900e5cb85dc4dmr14247156plg.11.1615566304850; Fri, 12 Mar 2021 08:25:04 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id e8sm5899599pgb.35.2021.03.12.08.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 08:25:04 -0800 (PST) From: Mathieu Poirier To: bjorn.andersson@linaro.org, ohad@wizery.com Cc: arnaud.pouliquen@st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v8 08/17] remoteproc: Add new detach() remoteproc operation Date: Fri, 12 Mar 2021 09:24:44 -0700 Message-Id: <20210312162453.1234145-9-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210312162453.1234145-1-mathieu.poirier@linaro.org> References: <20210312162453.1234145-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210312_162506_664059_B9C84892 X-CRM114-Status: GOOD ( 12.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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(+) 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); -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel