From patchwork Thu Feb 11 23:46: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: 381057 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp2495589jah; Thu, 11 Feb 2021 15:49:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJzBNuTAfOZMaVkGM7UnxqrfW5q1TcD9n3VkOC0Jj8bAkiENFsnX9RkKx6qJ4H7xar0ujQrs X-Received: by 2002:a05:6402:17aa:: with SMTP id j10mr635805edy.184.1613087367749; Thu, 11 Feb 2021 15:49:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613087367; cv=none; d=google.com; s=arc-20160816; b=1AqtJEXxC6iPy9kU5aBiCzU3cUq/TdOhPBaEzUNm4fnJcKKCwbDefrkR0lgEf8rTHE 0olSEzX0JvqWAoZFhncglPfngwR5WjtD8wDYobsOl/1JfDZFqjni4qYZ2+re1KBWUHE2 If8ZEs9hmVJ50ZMZf7TkP2EKsYmbErnP2evryhWRGrZ5+eqy4PSwWuFRi6kgBdPSet+r JLwEKjkXLS0tUjURfkj9PHSH060JHajBXL5XnOc1IUxgtZBf/Pr93oFkTzbgY9KYR36e KsrVaJSHEhtlW5ciKImxfugZIuQ6/eZi4ALt1DRo05G3ms0P6lw+D+FIOB3QKIwmoL40 W0Vg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=EkrytJ9LzBZQeMfRS4wLQprxHkYkItxpKGh4h54tQFM=; b=v7E3Pwn85GDSxDFH23sjQaVZMMcsBF30nzqxmc17pPB1/ic62mKGoDR3mPjeUgPPTX q9GAu/Yd5zlqK+Gl23YpJLazRujMz5nE2Sgf8ssArzyu2R1H0sRLAlmoe6GhPraodHaN NQL7yN1cIELnVXzJmLSvLKj+a3/8Wo5GtsoSLdiiMLGKl4h4Lm702r0VTCR4sjXTKlrW 5iLwYr+bz8eUHWb0dJjGMr5Yv5d5APW2EekThu6lfF69YbZRqVlRlNv4k7+d2KcQKlaQ pIwr+nXshuL9M8xKo8Nk2WHj1XXljGBUuF3k9LPR3FFH/LjH/90kRINrcD2N+oku/z9u UC3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Oc6IEf1N; 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.49.27; Thu, 11 Feb 2021 15:49:27 -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=Oc6IEf1N; 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 S230326AbhBKXsI (ORCPT + 6 others); Thu, 11 Feb 2021 18:48:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230238AbhBKXrN (ORCPT ); Thu, 11 Feb 2021 18:47:13 -0500 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 873D7C0613D6 for ; Thu, 11 Feb 2021 15:46:29 -0800 (PST) Received: by mail-pg1-x52f.google.com with SMTP id o63so5061790pgo.6 for ; Thu, 11 Feb 2021 15:46:29 -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=EkrytJ9LzBZQeMfRS4wLQprxHkYkItxpKGh4h54tQFM=; b=Oc6IEf1NnavzFlmiOhR4OVBYD33muPM4q1z/iKRkQxt10gl+5ZoYuYo4/r1DKNyJmr MFC0GIIU2/Iu+3D3DukC25EvTRCx8CmpnbdMRW7aEuF9TdVJ3uj2rBtpM4kC/9MpiVcJ iI9iz8yoavYbxR25JET4iDGqfdYM3adlNpGNfckZQerBIq5BTRSvZSZWFbP17KG7WaIS wpLXhupm8CNI5EEgwCqu4fQ5gNIkAFg0znnBU5Nl29aNqia6lr7UhMAWXbHD7xNqldgI PZNGT0D7eXzdcWvMy8bsun/XvdOeU2Ir0wXRc4XHe07F1CakLCO+D6Sy/b9g4i8ynBne Jmig== 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=EkrytJ9LzBZQeMfRS4wLQprxHkYkItxpKGh4h54tQFM=; b=OIn74+NBBzYvWoBYWaVStBKVYw9C54U3TL1aYnCT6W/pBs2Ex6lBcn9nDMb778KFtW ZMAyGGWZS88OLtdbWCILSYpXsvrGgSFDTB6WWNStUetRyBPoasz+Mv2K8UCEbo2k4Amh MkWYcZoiM+9BO9D7asvQYUzMXPosTANwQ6l16xbGkpFsXzagYuJuxPPkQ8pjpZ276tuj AutSgrBhvY4dsbc0M6hb9JT0qPV6jFafitOMe5hGmYtA/nMgbW8JiHPVWYijZif/1ke8 fbXRsSflCddD1vAEGthXhR24nRm+Ykh4bRhFBaeSXvRYUgDkMms6l7OweH3HXS7KlBk8 GXBA== X-Gm-Message-State: AOAM531ePwYC3hTrBS0IEr3IuRIIKH1nwxNkDmq7SJrmw3QJGOjY+fv/ ZVyxb5+GeTTwbUBCM2fcCYShTXtEU4LwuA== X-Received: by 2002:a63:ff57:: with SMTP id s23mr563333pgk.90.1613087189038; Thu, 11 Feb 2021 15:46:29 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 15:46:28 -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 00/19] remoteproc: Add support for detaching a remote processor Date: Thu, 11 Feb 2021 16:46:08 -0700 Message-Id: <20210211234627.2669674-1-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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 enhancement is the setup of a clean resource table when a remote processor is detached from. I have tested scenarios where the processor is detached and re-attached when booted from an external entity and the remoteproc core. I was also able to confirm that removing the platform driver of a detached remote processor works. Re-attaching the remote processor after re-inserting the platorm driver also works properly. Applies cleanly on rproc-next (43d3f2c715ce). Thanks, Mathieu Arnaud POULIQUEN (1): remoteproc: stm32: Move memory parsing to rproc_ops Mathieu Poirier (18): dt-bindings: remoteproc: Add bindind to support autonomous processors remoteproc: Re-check state in rproc_shutdown() 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 remoteproc: Add return value to function rproc_shutdown() remoteproc: Properly deal with a kernel panic when attached remoteproc: Properly deal with a stop request when attached remoteproc: Properly deal with a start request when attached remoteproc: Properly deal with detach request remoteproc: Refactor rproc delete and cdev release path .../bindings/remoteproc/remoteproc-core.yaml | 27 ++ drivers/remoteproc/remoteproc_cdev.c | 32 +- drivers/remoteproc/remoteproc_core.c | 307 ++++++++++++++++-- drivers/remoteproc/remoteproc_elf_loader.c | 24 +- drivers/remoteproc/remoteproc_internal.h | 10 + drivers/remoteproc/remoteproc_sysfs.c | 20 +- drivers/remoteproc/stm32_rproc.c | 168 +++++----- include/linux/remoteproc.h | 27 +- 8 files changed, 465 insertions(+), 150 deletions(-) create mode 100644 Documentation/devicetree/bindings/remoteproc/remoteproc-core.yaml -- 2.25.1