From patchwork Tue Feb 23 23:34:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 12101061 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=-11.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 B7D7AC433E6 for ; Tue, 23 Feb 2021 23:36:56 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 67B9A64F21 for ; Tue, 23 Feb 2021 23:36:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 67B9A64F21 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=yLbuUhywB9Dtj+jhb8C5vAxLydagWPHeFNBpz3FuNO4=; b=t5sIEALOHg+s1mWFgzAMHt6knh UnrIrLJXO78mXAJUCcdmU7AqbqGILkCBhOInjCvegObFrOPqWXtJOyN2pWf/ZXapZdBdqLReT9GhK Ydnu41d62CE4jgV2ISng3KCfWNPVociZJihitR9wVHfrF8mfg/Wws23nlmE4LyrdzM0l8h5F/S4MS mlU8uVYzDOydSi0dg5yBTCRg0uVJHLR0XKdCQrtLvgCHuHurLwi531T1soBDRrJT1uj9OM8RAbRcy aVv2UQpYFRvvmx50zILo1EnzLyPPhgY0yhYBhxihSBaop2qUmwfyy6dy29Zn+W4Ljui7APNhGasEZ cEr+zShw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEhDD-0003UI-Dd; Tue, 23 Feb 2021 23:35:27 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEhD6-0003Rk-Rf for linux-arm-kernel@lists.infradead.org; Tue, 23 Feb 2021 23:35:22 +0000 Received: by mail-pj1-x1031.google.com with SMTP id kr16so42317pjb.2 for ; Tue, 23 Feb 2021 15:35:18 -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:mime-version :content-transfer-encoding; bh=SHL5XDAIKj8MSKK6Z+vTePkWS1Indwf4AZBtBlAyi64=; b=KBWghAnPjbcmDLzHTQQy4PpOC2g3Spr7nGT1p3HLpvMZVu/ke5G5tEf+tkyMc7Jboo ivAxl5EHjttgPBa0UmYIe89AYRDLeNi1P1/6VSDFCe9evBg1cDyxEVPs7emDJyHs6Dhr R5dDFRqgP5Nf6mMqpXqi5F4NB5cbmGDJgocrQ2ctRzoZZwV7gVECqgVkygYJRgxfvBce 1t4RBo86MY51bj/RQMz5FbCfBihWCsacxOEawPxkbsoYWQE25jThNUNPaAZRPwkcWb1a JVQ4vTSqwknbEVP5C0U6jz9PRge9UhGF1pUZ7B9R7tu2MR21gF7hPAxRardks5lf7P/w 9V3A== 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:mime-version :content-transfer-encoding; bh=SHL5XDAIKj8MSKK6Z+vTePkWS1Indwf4AZBtBlAyi64=; b=dxljQUnceipMI3Xv3qSOAyj7K5HrPsljf5ySdNA9oZp4OW93h/gn33z9zLXS7gcaFs +kqYfUuRjil94czCHTC1nHy1P0vwVdrx1SOybCbeQmCtrhj1MhzcU4bwWUFQZBAijGLI WT9XO4lmMop/SVFOGiUaoP6xR6rKeNP0HjZeGvCRPbqTTGr02UAEq2QiXUZQZzLd5/Sk YqU1QMa/CbROdtDWcmHjOukfEe9m/UqIeAtrh3wgYz+YeivZdG3hgnfHf+lwIzaoOB/x 2AaGmDGhMQR6zWDwtdeKjsBUoSzLniruyylz5rIv8QTI1ZEDVkxgIqU0EQ73LGW4Hfb4 rHYQ== X-Gm-Message-State: AOAM5313ABEptgbR2mTmkf3UgOseiMoNgvsxp/YtrSQ1r6L1YQOGoIAc fLMZ54xXCdmzHGVShhsd+uI6NA== X-Google-Smtp-Source: ABdhPJwifdDLsrVJqk5R17vjdzA8fqNWlkWyr2tPKLL5zlQQ5O9oaEDIxoxVXdeN+c91+tEOj63K9Q== X-Received: by 2002:a17:90a:ae14:: with SMTP id t20mr1194420pjq.90.1614123317354; Tue, 23 Feb 2021 15:35:17 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id c24sm311999pfd.11.2021.02.23.15.35.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Feb 2021 15:35:16 -0800 (PST) From: Mathieu Poirier To: ohad@wizery.com, bjorn.andersson@linaro.org, arnaud.pouliquen@st.com Subject: [PATCH v6 00/16] remoteproc: Add support for detaching a remote processor Date: Tue, 23 Feb 2021 16:34:59 -0700 Message-Id: <20210223233515.3468677-1-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210223_183521_229070_3E285F03 X-CRM114-Status: GOOD ( 11.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, linux-remoteproc@vger.kernel.org, alexandre.torgue@st.com, mcoquelin.stm32@gmail.com, linux-kernel@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Following the work done here [1], this set provides support for the remoteproc core to release resources associated with a remote processor without having to switch it off. That way a platform driver can be removed or the application processor power cycled while the remote processor is still operating. Modifications for this revision are detailed in the changelog of each patch but the main difference is that going from RPROC_RUNNING -> RPROC_DETACHED is no longer supported to avoid dealing tricky resource table issues. Applies cleanly on rproc-next (e8b4e9a21af7). I will rebase on 5.12-rc1 when it comes out next week. Thanks, Mathieu Arnaud POULIQUEN (1): remoteproc: stm32: Move memory parsing to rproc_ops Mathieu Poirier (15): remoteproc: Remove useless check in rproc_del() remoteproc: Rename function rproc_actuate() remoteproc: Add new RPROC_ATTACHED state remoteproc: Properly represent the attached state remoteproc: Add new get_loaded_rsc_table() to rproc_ops remoteproc: stm32: Move resource table setup to rproc_ops remoteproc: Add new detach() remoteproc operation remoteproc: Introduce function __rproc_detach() remoteproc: Introduce function rproc_detach() remoteproc: Properly deal with the resource table when attached remoteproc: Properly deal with a kernel panic when attached remoteproc: Properly deal with a start request when attached remoteproc: Properly deal with a stop request when attached remoteproc: Properly deal with a detach request when attached remoteproc: Refactor rproc delete and cdev release path drivers/remoteproc/remoteproc_cdev.c | 21 +- drivers/remoteproc/remoteproc_core.c | 263 ++++++++++++++++++++--- drivers/remoteproc/remoteproc_internal.h | 10 + drivers/remoteproc/remoteproc_sysfs.c | 17 +- drivers/remoteproc/stm32_rproc.c | 168 +++++++-------- include/linux/remoteproc.h | 21 +- 6 files changed, 362 insertions(+), 138 deletions(-)