From patchwork Wed Mar 10 21:10:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 12129403 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=-12.0 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 A69A3C433DB for ; Wed, 10 Mar 2021 21:12:27 +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 04AD564FC4 for ; Wed, 10 Mar 2021 21:12:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 04AD564FC4 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: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:In-Reply-To:References:List-Owner; bh=YFZwPU6eoLa4ySZeckYWEFmn5XJLsnkMw9l3y3XrP1g=; b=D07kDCFJChx6Y5fXuJTdIjAj3u 193hpi6lSeJAo/5FMfB2cXUBMhALjFW8qrSuik9ofHLnmjKDPWpZMNGXweV+pJArc8B6UTPoe7XFA h7ua0Hc7QB44f0xA3d8HiUG6+z1HrqfnQPraisTbNZPMvaAWMCiFHdvliv4ZF02ubHMeD4mxWnfIr Fa8xVvvbHEwMbvHXtKYOMFyxSMZkwaIg7TiPCL0kTGgRb/uid4dU1t61dQGF4Xm1RtoW84fOaBa4R NBIt7CuKWnI/jhWDvlByj+L1uJURANa1DprC81TGUoQLp9u89bnlZJ6dz+JqJyZr23bHNKMZh3Fa5 v7Tt5WRA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lK66I-007jSq-NZ; Wed, 10 Mar 2021 21:10:38 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lK669-007jQD-Ti for linux-arm-kernel@lists.infradead.org; Wed, 10 Mar 2021 21:10:32 +0000 Received: by mail-pl1-x630.google.com with SMTP id w7so5628334pll.8 for ; Wed, 10 Mar 2021 13:10:28 -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=O30AauLLCCWTiPzSso6IXev67cYW6S1/IqV74YHyhWQ=; b=FriG3dvtnkFMjLm8sZa8Oy0H4+IJZKzMN2i5TDzv3wnwRbG5qEUL5LWRJ+nUqu1crD gAabEJXuCjclUlvnm6CKTratENHDMeCpOXDPFY21F9kuEl9KR22S9Dlen8aJfLovVJB2 GgDI5GLcXg8RUT/EgPnnBJk2KiH6Iv7ij+0HpAa8NKkeKmlFvec6BKB6KvsiSYYvvY6a KJmGWwDCbCXfMF6pGVXZLxcVJAnFS/i8SR0dPsrgClKULwnJ4Zo7SGY7OaGFqgH3OTjx m5+8EJjfv9uJ93aPMOVIRObo2c/bKqQ9KTYR/ObcYBK4hIIsDthRK/FAIlDn85EJ78r4 mBkg== 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=O30AauLLCCWTiPzSso6IXev67cYW6S1/IqV74YHyhWQ=; b=svWHTARvC+Tc8+UBH46Qha0NuvpEarRBtqSd/ndSOU7RFweeYtLoiDVwNbDzcKPfv2 EN/iIIaaqjcP3H/VpynWPe+QIobc3NRM8YQv/epG2STpW/pl6pAIWFeY0Alj18RKHu8E ZVurDPMD21xIl/qtkzkteigMUMfcqqfHbKm+wz7RHbRYVLf3ZLbEoMyiYDErivn4aHzi W4d3f20XUe7mpSNCV5vtca8ogElqelzpoJeLcrnLXSy/3+rA9icJ/yimTQ+yfCatC9/4 TH/+KIdxAQI8gHO5vCYCU/5OPba74afeKJav/WNa2PHz9ODCZ6DORpfAfkH9wkKZ3l68 Zy+Q== X-Gm-Message-State: AOAM531+FG8qnA6OWtiSZ4TzhdOQHGOH2DfqsrndzfHJol8DPp289tR7 fYlTaqt13cWlOaYonTMzNEWZlA== X-Google-Smtp-Source: ABdhPJwzBTPelGYUKqKxucbpmDS8MIjmdhCIWUnH1q2YfqvTIX/zU2DFb2Q6rmajFgiuydqlckaZgQ== X-Received: by 2002:a17:90b:4d0f:: with SMTP id mw15mr5468392pjb.92.1615410627547; Wed, 10 Mar 2021 13:10:27 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id j21sm371508pfc.114.2021.03.10.13.10.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Mar 2021 13:10:26 -0800 (PST) From: Mathieu Poirier To: ohad@wizery.com, bjorn.andersson@linaro.org 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 v7 00/17] remoteproc: Add support for detaching a remote processor Date: Wed, 10 Mar 2021 14:10:08 -0700 Message-Id: <20210310211025.1084636-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-20210310_211030_267426_24C0B98F X-CRM114-Status: GOOD ( 11.31 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. The main difference in this revision is patch 11/16 (in V6). It was split split in two part in order to simplify handling of the resource table when the remote processor is detached or stopped. Other modifications are detailed in the changelog of each patch. Applies cleanly on v5.12-rc2. Thanks, Mathieu Arnaud POULIQUEN (1): remoteproc: stm32: Move memory parsing to rproc_ops Mathieu Poirier (16): 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 detaching remoteproc: Properly deal with the resource table when stopping 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 function rproc_cdev_release() drivers/remoteproc/remoteproc_cdev.c | 21 +- drivers/remoteproc/remoteproc_core.c | 302 ++++++++++++++++++++--- 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, 401 insertions(+), 138 deletions(-)