From patchwork Fri Dec 18 17:32:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 345466 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp2334328jai; Fri, 18 Dec 2020 09:33:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNemkk5rHS5qZoxe+At++OtUPrg5h6HpMgMztJkqno1AvpkwEO6maAB9AoCihKVEBTNLTE X-Received: by 2002:a05:6402:1286:: with SMTP id w6mr5523079edv.351.1608312820689; Fri, 18 Dec 2020 09:33:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608312820; cv=none; d=google.com; s=arc-20160816; b=BzaOzfnVgfOe3qplf4RvQOE3Nj0ATLjvN4E8Ph63pAh+IZj4RdY8cshZL1N3r3U9Ta PofTnPd26HZxdoHYPYkbkVEB864m5J7G+IXrz8tpp4IJgMtZEPhERp0oTxXGIDoQCJMU s0PyIbHMVZnBmTcMwBm6wOEoL1HbR++2M6W3Zlq5A2iE5Nm1QuEuwe5WEe3Wgh8AyVFG 3W0rpiKOTAPsckVsk28t+CJeEA0Kme0A5uLE3Hc6REJvyXvYE12e5hVQ4KQX5Kmp+Q6N ntQSIR0Y2B/Qdi2Xm8Lx/cMGz5ZKQA+/PZFLx6zT1oiHkR8IDKO3JFTATXsYCK7uvInw llTw== 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=0fPY+6zn3CRK+yrW/S/jc5rhwI6oFcz+6g11nN4QUqk=; b=jNlx9JOQw76myHjvYA2yT9a1PbyOS427OJ86X93BmF1qvQ1bxvNmNG11oN+ag6Ay8c EE6wvZCYR9LYo6KUo4IjyAu3YsI/q3r5amcEMpKrNSmT3EBiuosYvPidnOUxcUNon4oa 0KhTnmH1PlCbdYTsvyvqnp5JzEJRKsQ8KQEsi6s1X9hpzSsaFcZH+FVa5qSJnM29Gsf6 72fYks3SwqmJBe1T51q1TOa0JbdA6v1nJZP30bPF26AUieiP8pzvY4FyyuA8S88CcEs1 RafGl0QoyNpA0Ii0KzXpdvdFpsA0yDFiM71muBS2lkvNU/URTs6wLTJSq2LKhbVv+FqE 67Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X+DPUFxU; 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 h14si5383818eje.325.2020.12.18.09.33.40; Fri, 18 Dec 2020 09:33:40 -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=X+DPUFxU; 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 S1732317AbgLRRdL (ORCPT + 7 others); Fri, 18 Dec 2020 12:33:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731972AbgLRRdL (ORCPT ); Fri, 18 Dec 2020 12:33:11 -0500 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16A96C061282 for ; Fri, 18 Dec 2020 09:32:31 -0800 (PST) Received: by mail-pf1-x42c.google.com with SMTP id m6so1937255pfm.6 for ; Fri, 18 Dec 2020 09:32:31 -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=0fPY+6zn3CRK+yrW/S/jc5rhwI6oFcz+6g11nN4QUqk=; b=X+DPUFxUuphTyYgif05i8n82F6RIxnwTf4JXGkS9hGnWQWAFLPD7Y5fsHygSK1UX6t cj4ZeDM6VXKPRhjJw2c44KiwUaJB/rwosxHYAahLWap0fxYqIFDpJg9xiBKbPoCO8FD2 0iNn/LAfKrXBj5hWu6RxjZt0H7n4s06KV/hj2I+bb63HoyjfFlbD+NuUWygSlhnWqynV B/y2JvZClwUQyB8suxNXZAhcewXDNKUFmWnvIdEKv821HY1JVMMAVvv7x4NwurqZqLXA 1xzc4+QxzdKRfAJA9kyf72QZvpDctJnaNEtvS4T4lARxsjS0he9WIW9kghxR3Rn1GBDN T+Eg== 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=0fPY+6zn3CRK+yrW/S/jc5rhwI6oFcz+6g11nN4QUqk=; b=tfEBl1410VnUtZFJI7QRDtQb2uyvsLcUYaygrS6S68ouVU2xSNAaSF4ICeioW1jqrL xVzikz6KD6FgFo6NiLshGPwttagNF6B/FgNq/Ac2ZWePZVsQbTybU/OfWlizMGoRvO9U JEltuWIaVqvY9zDX58L8HANXIFTnhGtw5edCDpPKQWW+ZuG32LjE5kIlwL5UgmbKKaxt WGMD9tULKFjwAklisycHMH7y/AHxwk3p+0j1Ts0ZTLaW6vrG9mYkwOG+ZQ4OH51/KG8B BukD8WIw0dBHxiccez3eaEFqJ9maFApApI1xOpBDnIKJAl7bSxqMB5z77yLE+OUGVC1c 40/w== X-Gm-Message-State: AOAM530P9LRf6+bqqbqRQzjKcEqtOU05gIt5HsspXz4j7H2hFQXKFbJw pkMSVfxyG81mS699UB1SRgeHpw== X-Received: by 2002:a05:6a00:2384:b029:19a:eed3:7f42 with SMTP id f4-20020a056a002384b029019aeed37f42mr4976255pfc.4.1608312750240; Fri, 18 Dec 2020 09:32:30 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id l11sm9892957pgt.79.2020.12.18.09.32.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Dec 2020 09:32:29 -0800 (PST) From: Mathieu Poirier To: ohad@wizery.com, bjorn.andersson@linaro.org, robh+dt@kernel.org Cc: arnaud.pouliquen@st.com, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 00/17] remoteproc: Add support for detaching a rproc Date: Fri, 18 Dec 2020 10:32:11 -0700 Message-Id: <20201218173228.2277032-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. Of special interest in this series are patches 5 and 6 where getting the address of the resource table installed by an eternal entity if moved to the core. This is to support scenarios where a remote process has been booted by the core but is being detached. To re-attach the remote processor, the address of the resource table needs to be known at a later time than the platform driver's probe() function. Applies cleanly on v5.10 Thanks, Mathieu [1]. https://lkml.org/lkml/2020/7/14/1600 ---- New for v4: - Made binding description OS agnostic (Rob) - Added functionality to set the external resource table in the core - Fixed a crash when detaching (Arnaud) - Fixed error code propagation in rproc_cdev_relase() and rproc_del() (Arnaud) - Added RB tags Mathieu Poirier (17): 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 get_loaded_rsc_table() remoteproc operation remoteproc: stm32: Move resource table setup to rproc_ops remoteproc: Add new RPROC_ATTACHED state remoteproc: Properly represent the attached state remoteproc: Properly deal with a kernel panic when attached remoteproc: Add new detach() remoteproc operation remoteproc: Introduce function __rproc_detach() remoteproc: Introduce function rproc_detach() remoteproc: Add return value to function rproc_shutdown() 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 | 211 +++++++++++++++--- drivers/remoteproc/remoteproc_internal.h | 8 + drivers/remoteproc/remoteproc_sysfs.c | 20 +- drivers/remoteproc/stm32_rproc.c | 147 ++++++------ include/linux/remoteproc.h | 24 +- 7 files changed, 344 insertions(+), 125 deletions(-) create mode 100644 Documentation/devicetree/bindings/remoteproc/remoteproc-core.yaml -- 2.25.1 Signed-off-by: Arnaud Pouliquen Signed-off-by: Arnaud Pouliquen Signed-off-by: Arnaud Pouliquen