Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1147226pxb; Thu, 24 Mar 2022 13:45:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytg+S0//j12a1a14CjZpZ4lI6Sn2vyl4Sq0h/rAIHMFugsCUWZfEEb6DdJJnH4lIda6zGz X-Received: by 2002:a05:6a00:174d:b0:4f6:67e3:965 with SMTP id j13-20020a056a00174d00b004f667e30965mr7027167pfc.39.1648154727996; Thu, 24 Mar 2022 13:45:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1648154727; cv=pass; d=google.com; s=arc-20160816; b=mJ31AFfIfp8NAp5sNThUJn5TuAABfOh/JUiAnoaTUNsVIyFu5kovn68xIPHYYdAnm4 CR4/9SsnABv8vMbU6wQc0SLdZZocU4eTPGBWpJqkCZgofwF6CffNJcgbB6W8ElacrwZH +piOpKR1v6uZQtMXte1cwvePO3ol4aMAh/4bT7WqfBGk9xmoms3W1bva7biCsUNTRd98 ccqaHXBZ1PHwwR8uiil079pmoFkIfiBkzQZODLWBaKOdWnslp2csUu4LwjCvz/2skhAg V0ifBC+qFQZeubqAZDG9f1I90EZsK5WaAuUr/IVoXXJXqQgLfAvb6mo4luVbK71mPxf2 1LmA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=uQCsPgOtAKUKy5ZM213P5+aKzX1dWckhC4Y3d3SSAw0=; b=h2MQMWd3yksObUmtqaIuZAiikrLCVWhrXlJQafPwUthNl8b6No5Xp+mELYSIAgvpMp juYikyIzMHgEhmvIf9YtOTPpwL0+1ejrjF3nZCVnAk/en2caal/8xcaw7qeeHyuD1hm/ Rq9dLge7juX+zkMLpLDUPjOIX54ABqoNBoR2txLRYyJaeAYcb2T5ZDxIt3S9UrMsWfAQ cVdIMe9cG3y4bfCXMH+xKPCEZCRyIz1ebABJL3UUr8RZfvBftCkkmilS1sUL6/hDUgcm W0gPi7Hi6xwwKvn/t7NsCYDqHAvchRXzSNqYMZ4vKzleadmvzdQV+X6e1Pk2HzeXv6EI bWhQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=LWkJL5sr; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nv18-20020a17090b1b5200b001c6acf13720si3930007pjb.128.2022.03.24.13.45.13; Thu, 24 Mar 2022 13:45:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=LWkJL5sr; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241256AbiCWDnz (ORCPT + 99 others); Tue, 22 Mar 2022 23:43:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230188AbiCWDnu (ORCPT ); Tue, 22 Mar 2022 23:43:50 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2054.outbound.protection.outlook.com [40.107.20.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E4296C970; Tue, 22 Mar 2022 20:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HOGEJ2efITHp6g/6cG4ImYgOIRzce75+Q/Qd9NfRGRzh1ilPDMYFd/YN6RdrQsYw0hJcHI1tV83FZX6ZJmaXRJhujeSZWTrheROBMlDhVM8Rx1T3QnEUavvixg1vl5gcw4NovgjwwOyZCyMnVjidqpvv4AI/QQPnvD9Uvb7p+W8po9WL08XW6pgkZDUm8rBCLQXg4GToLUXsDw9JYzszw6BFsnvQAIZGZyvSbRj7bIEbQSTr9lZPxIfa5ri/7ZYGsH50dihMWbvdWUZFaiy6APOfA3/DHNdiLsyNbG38Vu+IFm2ZVkQoo/uyj9i0QzvzJJnf3bt3lBQGDZzCXwQFKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uQCsPgOtAKUKy5ZM213P5+aKzX1dWckhC4Y3d3SSAw0=; b=aD6dQVGEQ60ngCWqbWgnz5oQwGlsLPD+Kg/iXhaylmhOPXl9SSjJUGywRcRVsTNOdk1s9cTikZeqzNc/Zy7GwvwV9RBL0OOf9pc+gSCsRfQ2acsVkDAozko38GjCEKvMOBW6HwT/7nU++ESuBMOd6nsROO7FPlHrJBpsiGpgj7IwuFmg+C6grsYediEYU51uPvC4FguIk7Q+mTlDWsfBoC2kGwT8fNZbrMl7i324Zu3NN3miUNsvr1FHyiSflOK8peGNvu+4E5c3xarPuQJm9A4B2p52qoDetvndG0oO/IHBBSuvKKzdArCS9kixRGqMp1opAjjwvpOjKKX/LglR6w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uQCsPgOtAKUKy5ZM213P5+aKzX1dWckhC4Y3d3SSAw0=; b=LWkJL5srTx83aQpvHS7f2e8p++J14rOy14ReAA4q5ZEzhWvdlxj/zPicLhqm0ao9QGRgEge7+1dNiIPDl8H06TVrP2ta6lhnF3UYNIVEj+DoQ3OOtXH9/r4CV3kX/BDBNpDvdx3MXKxU8zpgWtohPrOI5LfkeuSDYTn4DTx365U= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by AM0PR04MB6868.eurprd04.prod.outlook.com (2603:10a6:208:18c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17; Wed, 23 Mar 2022 03:42:18 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::1d8b:d8d8:ca2b:efff]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::1d8b:d8d8:ca2b:efff%3]) with mapi id 15.20.5102.016; Wed, 23 Mar 2022 03:42:18 +0000 From: "Peng Fan (OSS)" To: bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, arnaud.pouliquen@foss.st.com Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com Subject: [PATCH V4 0/2] remoteproc: support self recovery Date: Wed, 23 Mar 2022 11:44:03 +0800 Message-Id: <20220323034405.976643-1-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR06CA0111.apcprd06.prod.outlook.com (2603:1096:1:1d::13) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a46af7fc-9ee6-46a8-48cf-08da0c7f20de X-MS-TrafficTypeDiagnostic: AM0PR04MB6868:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9hIv0D64w5y+knjfAo0dzyorPrGzB5F6qcdBCeW4f2rTEdl0jqL+LFrsoA68oCqIxZPw/TvWs7arl3z1BSIYV45c/9fCmPbJZBlgrMX/9tpwsVOKkxmgtcO+y03K3cViSpvZxk7yV0TpXb47TdZqOLOPJhwmmqI4nDh5p6fO68l7wvpNqNs71U6B1rC5bQoxo0lzH0r8AQoO+D16NGvpUp8ZWBPoYR3iG1xp+6MsmKEOJwKk7M8/TB+ipCsJ+UxYWojw8qrIzHTkmBJ+RqXiUOtgk+ezc3UczdC2XFUjqp1REqzNAoLchzz6CKClZtoZY0S8ix5WfndW6V6mp4a65bBxnzTZoVGq/ycaszOMW7LjGyH3r3lGW+lsVT33DgUiN9fwvYTv7RtUujYr2WctbpUGI36n9kJXJjx0i3jnrgvkZ6o3uT8aUYbyijKD4dSnQrnbS1RRnHNqR95fhybj5YJ+HQKafhlB95nSvh7J5blbsYULZ/Fvu+B3owRbhStvyG0pQdFD3eHsmibCXjsMpIB20ExPEzwD3sxNDEEVRx9An2BpraVCqmRc/0+qU8xR3PC2N72WqJEkpzBkED+ODT275JA4XX+wn8TUMMqOiQGSTbNVHzVig/OIOAil4BX0UEBy47S4EgWPP5h0XsNUqiKieGmRNKi8tFuMu/3jCmsVoISP5LlEUcgvZGc9ycX7dWplMFt9gmVInDK+ERfUIKnQvy/xIGI2uQfrZ2QVq/tdT7CFQwJd/O+E5EQeT9zolS4nIchxgMK7PMMdueMyLKxL/k/ieOvn69oaKRitTQ0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(83380400001)(52116002)(38350700002)(38100700002)(26005)(186003)(6512007)(8936002)(2616005)(5660300002)(2906002)(66476007)(66556008)(66946007)(966005)(508600001)(6486002)(6506007)(6666004)(316002)(1076003)(86362001)(8676002)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Yd8wJiXfOjHxpSVi8OJhjMhZoWj5Uw5cqX0iQ5Mvgrq0H5oAkb3odwHC8Px0?= =?us-ascii?Q?x8GcRIAfKhs48SjmmQ3a1l+v1ye6vBmK3aAau7Xp/Yv8XC0nYsGfMgFRMK/t?= =?us-ascii?Q?6vhxgGaEaK6t561+i1/ZZxTwH5rUjZcQgD+iv/bv972dqjlE508TDoC02GYh?= =?us-ascii?Q?i8KfceiXyoFkqS/Nh0A8f3lJpHRfbJMmX7SkI4Ivmv+BCJ/efwvyB+5lYOxz?= =?us-ascii?Q?KQaf9bSYQF+3yMiYoNTEzo0+yxuFvbI7+2J/qfbgxz/ufAfFZtXe7jQaCQT+?= =?us-ascii?Q?vs5lgHac9o6ZAQTU8idykp1wVbWdjVtHjYksiT1zxu4zYY7+qUQybHNois4f?= =?us-ascii?Q?W/FmN9Qt/weeqThcNslobRYAZV19s+ghKVWk18J7BTcakisoFwV8lR68CQLV?= =?us-ascii?Q?jOsMOYuaF9iqqNn/MOurlz2bDU5F32iWCL+Xi2sLtDdAn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Lawgl3bPvepLXuzHatvvvRGFBMvNJxsHqhD/O+YDrgBDu?= =?us-ascii?Q?vRO8SJo3owsfalJCr+BhUAKoT7fFDb/UpoeEbJVBb3FnbLQ5YE1hFpZGry1L?= =?us-ascii?Q?iVFeXsNg9wosQgQnKnx3S4L5BNgU6KTz?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a46af7fc-9ee6-46a8-48cf-08da0c7f20de X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2022 03:42:18.3957 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /IIQyJQSFrheZKk0VEtbe7W7+jNuAQGfaNkzvnPfZCCKFRWy232iwzAHPR3BzcaWLlPhc/ZrKhL3rHMxefL0TQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6868 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peng Fan V4: Based on Bjorn's comments on V2-2 Move the rproc_has_feature/rproc_set_feature to remoteproc_internal.h and Keep rproc_features still in remoteproc.h, because we use RPROC_MAX_FEATURES to declare bitmap. Update commit log for patch 2/2, and add comments V3: Resend the wrong labeled patchset https://patchwork.kernel.org/project/linux-remoteproc/list/?series=621311 Write a cover-letter To i.MX8QM/QXP, they have a M4 core self-recovery capability without Linux loading firmware. The self recovery is done by SCU(System Control Unit). Current remoteproc framework only support Linux help recovery remote processor(stop, loading firmware, start). This patchset is support remote processor self recovery(attach recovery). In order to avoid introducing a new variable(bool support_self_recovery), patch 1 introduce a new function, rproc_has_feature to make code easy to extend, cleaner, such as we could move "bool has_iommu" to rproc_has_feature(rproc, RPROC_FEAT_IOMMU). Patch 2 is introduce a new function rproc_attach_recovery for self recovery, the original logic move to rproc_firmware_recovery meaning needs linux to help recovery. V2-version 2: https://patchwork.kernel.org/project/linux-remoteproc/list/?series=621311 Introduce rproc_has_feature V2-version 1: https://patchwork.kernel.org/project/linux-remoteproc/patch/20220126085120.3397450-1-peng.fan@oss.nxp.com/ Nothing change in V2. Only move this patch out from https://patchwork.kernel.org/project/linux-remoteproc/list/?series=604364 Peng Fan (2): remoteproc: introduce rproc features remoteproc: support attach recovery after rproc crash drivers/remoteproc/remoteproc_core.c | 67 +++++++++++++++++------- drivers/remoteproc/remoteproc_internal.h | 10 ++++ include/linux/remoteproc.h | 7 +++ 3 files changed, 65 insertions(+), 19 deletions(-) -- 2.25.1