From patchwork Wed Mar 23 03:44:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 12789422 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7DF9C433F5 for ; Wed, 23 Mar 2022 03:42:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234539AbiCWDnw (ORCPT ); Tue, 22 Mar 2022 23:43:52 -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 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: Yd8wJiXfOjHxpSVi8OJhjMhZoWj5Uw5cqX0iQ5Mvgrq0H5oAkb3odwHC8Px0x8GcRIAfKhs48SjmmQ3a1l+v1ye6vBmK3aAau7Xp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YwcvJksywf/ZpQj9swsWikLV7bOEkP9wm7+ClzolRzJ5Z5hTyWvzrAZtdZTegf9kHTJL6VfQ+mbU5EbPBG4EuIGauGcQDLi28ikOEH92mkFMIBkCEKYHdhmVEYs/gqHELKdIwZY+T472j+CFlsw+l0KTnLawgl3bPvepLXuzHatvvvRGFBMvNJxsHqhD/O+YDrgBDuvRO8SJo3owsfalJCr+BhUAKoT7fFDb/UpoeEbJVBb3FnbLQ5YE1hFpZGry1LiVFeXsNg9wosQgQnKnx3S4L5BNgU6KTz 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 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@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(-)