Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp156128rwb; Wed, 28 Sep 2022 00:24:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4ikTb6Ic4+UUeYJZRLOtCukDQin2QVoMrbSQyGClqAwie4NLvOM4wilm7dtjiZHBcYYMhI X-Received: by 2002:a17:90b:4b50:b0:205:d7c0:a50d with SMTP id mi16-20020a17090b4b5000b00205d7c0a50dmr7891890pjb.87.1664349865078; Wed, 28 Sep 2022 00:24:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664349865; cv=pass; d=google.com; s=arc-20160816; b=WwsgPRSSeLSwAPp0XLpxO0WIN/3TSFB18e0ZzO8BCcTDBE0CbgDpHN99b+jDqXEfVg 4Sg8BvPxkGp3x+eYzKhGxvJGGu6YsL7+SiUpd961AcpqclMIycEwS9sXEgzXF/gim7dA ZXEGTB2xZ+pSYZg3qRfnf+xJLOB/KELZsAwVzjzHjax/cBmgLAuZD+PAWgIjy0v8W9m+ b85i76rLsCtS9MHowVPQcXjwrDm0ysZg8uE8EW19jMJoFMJ7SbdoKxhA1Zyw9AV53Umz 6Ed30+pMTbkh40/ilDGpz5WtcOpgKKPf/rf9RqquF2onDnZHigaEpdH/vZKLI96Sni2+ MYpQ== 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 :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=XzCGSg7WHskMIZWexZjRHkHNDGnM8fdzryLyFcL0mtQ=; b=cMX29uBuyDcFECDZypuYG5Up7ywSPhCn2AjZMFL4VxpoCI061c+j/7CcEsoEGy6W4d Rphh2GaMYGal5w6d0AVl3HolvCEdLL9iFH4HJySwPR6ErK6NWPUQgmEVkxyPdX3egWX/ fvvGaqk5seh9BRInSFX1hXxQzPhk6+slLddplCSsliQwECppmAQ4npjZtxrpcvdSNM/W XGJP/bHMPUx27N5UU9Fy7H8Zc/TyDLCunF8cZj0+JxtmPZ5aTSfM+0Gs8eSw6vF6furN DHQYQZrRcr0QBaGVFN/nUuZLYSKjHlUGt0J7g5OUiG5IsZ9JBy8n0BouhRVwQBJD92gF OMyg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=Q5e3jjHE; 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 ip11-20020a17090b314b00b00205b38a17casi1772940pjb.9.2022.09.28.00.24.13; Wed, 28 Sep 2022 00:24:25 -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=Q5e3jjHE; 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 S233383AbiI1Gwz (ORCPT + 99 others); Wed, 28 Sep 2022 02:52:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233349AbiI1Gw3 (ORCPT ); Wed, 28 Sep 2022 02:52:29 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140043.outbound.protection.outlook.com [40.107.14.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A29CE48E96; Tue, 27 Sep 2022 23:50:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BZIEt1B2M0izQMxGgXy5HviycwVe5RIdcMOFvNW0HhbB7dKm2ULNOrx6LKVzEuu/av3XmTRnWECAPOmsUFF1k9RH0o+BF8yMDOqTn22+9PXiLufkMZFYgwFkf8hLooJUY6muCYxNqbmXSkHLko2zyoP8tntKYg0zPYkz1LPROMtkYKI/+92nVrPUYcdGIzW58Z1tmlGJkDoIrP6eEnN2zxYI9MjiABtkf44dGTcqlNUbeeLwFZ0FfpUL0FwoaZavWXegtSJdmd0yBftPtuM5GYkeqyAeuusFJGZFvSBupzCwX0QQ7utaAiYcTgZA+SN6DQhxx3p02gaJROcYKWmoVg== 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=XzCGSg7WHskMIZWexZjRHkHNDGnM8fdzryLyFcL0mtQ=; b=RGImwpghj01mFv1bOGOFCFGMgTXT3fzHn6UCDgdAG/WWicbU2GUnaNUrG64WMtI47+OXrEZVfpv98iFMQTMQXY07Q8NWFe89QZbsmv80wlpj46UzW0KQlv3swNqSGPO5Umz9wbjBzne3iw8fWho7pceyXTI9n3t5iLiqBtH5O5WbjXp0eZ/SrFbKISAj2P5DVZ8PxpV8PyDhjH3OFzgJL4LwUsVDzGkeSi/4mV/E5j9nLVLErDggObbOdTXULzk1/Pp4W56AOo8uW6DuGS/LbLVOTAmU4Ni+2oi3wiZ2R1667l+joo9MeXLw+DNnOt5o59+KZAPGhesl8BMqbxEjdA== 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=XzCGSg7WHskMIZWexZjRHkHNDGnM8fdzryLyFcL0mtQ=; b=Q5e3jjHESiWYPDDMNMcrOgw0P/XcqvZYZQHOKciaPyx/woWjrsAoOQ+Y86UwQNiZHESM8rdO+mdBCdH+1xyriW5L8VHir8RzKUdaysxmpx8Wcq1N+j6JPXWdpZF0z+Bh/YQrCvEjqo9hWVzFYHdTuSGSdJXL+ygBCNiBJCL0LhQ= 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 PAXPR04MB8927.eurprd04.prod.outlook.com (2603:10a6:102:20e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17; Wed, 28 Sep 2022 06:49:54 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::1eb:dcf:8fd7:867]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::1eb:dcf:8fd7:867%5]) with mapi id 15.20.5654.025; Wed, 28 Sep 2022 06:49:54 +0000 Message-ID: Date: Wed, 28 Sep 2022 14:49:38 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.0 Subject: Re: [PATCH V7 2/2] remoteproc: support attach recovery after rproc crash Content-Language: en-US To: Mathieu Poirier , Arnaud POULIQUEN Cc: Peng Fan , Bjorn Andersson , "bjorn.andersson@linaro.org" , "linux-remoteproc@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20220705011527.2849057-1-peng.fan@oss.nxp.com> <20220705011527.2849057-3-peng.fan@oss.nxp.com> <20220926220610.GA2817947@p14s> <6aae3d16-0570-793d-4bf8-0a0fddb00be9@foss.st.com> <20220927174438.GA2883698@p14s> From: Peng Fan In-Reply-To: <20220927174438.GA2883698@p14s> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SG2PR02CA0020.apcprd02.prod.outlook.com (2603:1096:3:17::32) 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-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|PAXPR04MB8927:EE_ X-MS-Office365-Filtering-Correlation-Id: 874701cd-1814-4890-9147-08daa11da633 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KoHaJYNUd4qJJI5BxwiH0ilJE/NQsiXGbi2vOkVoNng73ahYc+X/ORH3dvM9KhbIozg2U0mlUbHNkG0SVunxP1AoaT+66CtNyDC2yiceuUlPftZ1NbVwbZXCbANTUY3468ujVUDgIWL5VMUL60cg4RWF3D/0trjAlZ+XKY1MJvqBsal1tzO+z74R9EXoaxhaEu9ZYuqDR1jAP1INQfOmyYcZM1OaIxrEo47NN60OYu7ELbLedPl5cOOw+rs28t3QSqjX4VXixaST/dc1s/txav4tpYjKVSh/+HXAUCcc8uht54bzPsgu5lXYIrH7rnC9O5Y7SfQGDsLOLgYYf9hj65jAexwG72JaFEi2DStqsLJkhD0MIrits7GQJNb0e6Onb3saNsMAQzI2zTG0TCq/scG7eHPiPyohVc8WbFacNcx5dbmQ87+toLybySUF1JSL1ttVe7/siKz29jNknaM/hnJy5WTUL+0jAkFjSmt77ZyLtoQ3UXjm6ox1gilyGeDaSl2G8KhMFhJLuiUpNp+G9Huo5900AXt1lEecOtKxvZko4/6sDvL3V91IVwQF+vCt1APYAolu0hzQFisZIv1S4ZMCFmvrNPIpzOImGO0nwHPhfKQ3H2fjynoN40nGMqrxvNgqRMhkYe4uxBQ3I22R7cMLVujrf4wo0VysZB3AJQsBiiuSH/BJzm/8Q16m8umqhM9WB6Q9E85Mh8u0QgxhV2muufuyDAVhyjbiKN1K6BWaNMwWLh6ulhFke87pMGWRj41ItYH0JvS5K7YSmPebkM5lXk5FdcDZfyZ3vqwH0E4OVg6xg+HN/UeHwwn1Bv0a 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:(13230022)(4636009)(136003)(366004)(376002)(39860400002)(396003)(346002)(451199015)(478600001)(41300700001)(52116002)(53546011)(4326008)(8676002)(66556008)(66476007)(66946007)(83380400001)(6666004)(6506007)(38100700002)(38350700002)(8936002)(5660300002)(54906003)(110136005)(6486002)(2906002)(31696002)(44832011)(316002)(86362001)(186003)(31686004)(66899015)(2616005)(6512007)(26005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ck43dzNNTlhJY2R2ZjA0NWE2R2l5bWJzaHZHNmN0QUZKeGd1UGhTNnF4ZmdU?= =?utf-8?B?VzkycmQxZGhia1hGQW83U05TWnp3N1A2TnV0eTBJVWZHM3VVMXVtRElXQjNU?= =?utf-8?B?RVNsaWpxOEFHR3hKdTdMWWFuQmdlVkpSR3dSM05aM0FVRnpCL2Q3NGYrazJL?= =?utf-8?B?M0NNQkQ4NmlXVUpGNitQSEc1QUxzL3hQc0xqc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?B?SGQ5cEdPalNhL2I3NVEyZDNXU3ZHQ3NzdnRoWTZod2srNjhUZDMxSDZDeEEr?= =?utf-8?B?WklYUndJU1Z5MmZKUkhZNTNhN1lubnB6Q0krZCtxbnlVRERvMCtJeXpTVzJH?= =?utf-8?Q?F+Na9duXrHpqHqWyLZlkAuwA2?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 874701cd-1814-4890-9147-08daa11da633 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2022 06:49:54.2467 (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: VytRUVYnV9DiUuMC34ZYKqX5e3eEpRJQqTo//jv0j2+4BWtYjNt4BFDI+IbPCr0as0E9DlNKWV9Ic6rOhXQXEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8927 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS 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 On 9/28/2022 1:44 AM, Mathieu Poirier wrote: > On Tue, Sep 27, 2022 at 10:10:31AM +0200, Arnaud POULIQUEN wrote: >> Hi, >> >> On 9/27/22 05:03, Peng Fan wrote: >>> Hi Mathieu, >>> >>>> Subject: Re: [PATCH V7 2/2] remoteproc: support attach recovery after rproc >>>> crash >>>> >>>> On Tue, Jul 05, 2022 at 09:15:27AM +0800, Peng Fan (OSS) wrote: >>>>> From: Peng Fan >>>>> >>>>> Current logic only support main processor to stop/start the remote >>>>> processor after crash. However to SoC, such as i.MX8QM/QXP, the remote >>>>> processor could do attach recovery after crash and trigger watchdog to >>>>> reboot itself. It does not need main processor to load image, or >>>>> stop/start remote processor. >>>>> >>>>> Introduce two functions: rproc_attach_recovery, rproc_boot_recovery >>>>> for the two cases. Boot recovery is as before, let main processor to >>>>> help recovery, while attach recovery is to recover itself without help. >>>>> To attach recovery, we only do detach and attach. >>>>> >>>>> Acked-by: Arnaud Pouliquen >>>>> Signed-off-by: Peng Fan >>>>> --- >>>>> drivers/remoteproc/remoteproc_core.c | 62 >>>>> +++++++++++++++++++--------- >>>>> 1 file changed, 43 insertions(+), 19 deletions(-) >>>>> >>>>> diff --git a/drivers/remoteproc/remoteproc_core.c >>>>> b/drivers/remoteproc/remoteproc_core.c >>>>> index ed374c8bf14a..ef5b9310bc83 100644 >>>>> --- a/drivers/remoteproc/remoteproc_core.c >>>>> +++ b/drivers/remoteproc/remoteproc_core.c >>>>> @@ -1884,6 +1884,45 @@ static int __rproc_detach(struct rproc *rproc) >>>>> return 0; >>>>> } >>>>> >>>>> +static int rproc_attach_recovery(struct rproc *rproc) { >>>>> + int ret; >>>>> + >>>>> + ret = __rproc_detach(rproc); >>>>> + if (ret) >>>>> + return ret; >>>> >>>> I thought there was a specific reason to _not_ call rproc->ops->coredump() >>>> for processors that have been attached to but looking at the STM32 and >>>> IMX_DSP now, it would seem logical to do so. Am I missing something? >>> >>> ATTACH RECOVERY is to support recovery without help from Linux, >>> >>> STM32 and IMX_DSP, both require linux to load image and start remote >>> core. So the two cases should not enable feature: >>> RPROC_FEAT_ATTACH_ON_RECOVERY >>> >>> Also considering the recovery is out of linux control, actually when linux >>> start dump, remote core may already recovered. >> >> I asked myself the same question. Indeed how to manage a core dump if the >> remote processor restarts autonomously. >> The answer doesn't seem obvious because it seems to be platform specific. >> >> For time being on STM32 we consider that the remoteproc memory can be corrupted >> so we don't plan to enable the feature by default even if the hardware allows it. >> >> If we implement it, I would see 2 use cases: >> - no core dump, the remote processor restart autonomously (need to manage the >> VIRTIO_CONFIG_S_NEEDS_RESET in resource table vdev for resynchronization) >> - core dump and the Linux stm32 driver handle the reset of the remote >> processor core to be able to perform the core dump (no firmware loading) >> >> What about dealing with the coredump in a separate thread, based on a concrete >> use case/need? > > Definitely, we can deal with that later. > > Peng - please send me a rebase as quickly as possible. Mathieu, Just send out V8 rebased on linux-next/master tag: next-20220927 Thanks, Peng. > >> >> Regards, >> Arnaud >> >>> >>>> >>>> And this set will need a rebase. >>> >>> I'll do the rebase and send V8 if the upper explanation could eliminate >>> your concern. >>> >>> Thanks, >>> Peng. >>> >>>> >>>> Thanks, >>>> Mathieu >>>> >>>>> + >>>>> + return __rproc_attach(rproc); >>>>> +} >>>>> + >>>>> +static int rproc_boot_recovery(struct rproc *rproc) { >>>>> + const struct firmware *firmware_p; >>>>> + struct device *dev = &rproc->dev; >>>>> + int ret; >>>>> + >>>>> + ret = rproc_stop(rproc, true); >>>>> + if (ret) >>>>> + return ret; >>>>> + >>>>> + /* generate coredump */ >>>>> + rproc->ops->coredump(rproc); >>>>> + >>>>> + /* load firmware */ >>>>> + ret = request_firmware(&firmware_p, rproc->firmware, dev); >>>>> + if (ret < 0) { >>>>> + dev_err(dev, "request_firmware failed: %d\n", ret); >>>>> + return ret; >>>>> + } >>>>> + >>>>> + /* boot the remote processor up again */ >>>>> + ret = rproc_start(rproc, firmware_p); >>>>> + >>>>> + release_firmware(firmware_p); >>>>> + >>>>> + return ret; >>>>> +} >>>>> + >>>>> /** >>>>> * rproc_trigger_recovery() - recover a remoteproc >>>>> * @rproc: the remote processor >>>>> @@ -1898,7 +1937,6 @@ static int __rproc_detach(struct rproc *rproc) >>>>> */ >>>>> int rproc_trigger_recovery(struct rproc *rproc) { >>>>> - const struct firmware *firmware_p; >>>>> struct device *dev = &rproc->dev; >>>>> int ret; >>>>> >>>>> @@ -1912,24 +1950,10 @@ int rproc_trigger_recovery(struct rproc >>>>> *rproc) >>>>> >>>>> dev_err(dev, "recovering %s\n", rproc->name); >>>>> >>>>> - ret = rproc_stop(rproc, true); >>>>> - if (ret) >>>>> - goto unlock_mutex; >>>>> - >>>>> - /* generate coredump */ >>>>> - rproc->ops->coredump(rproc); >>>>> - >>>>> - /* load firmware */ >>>>> - ret = request_firmware(&firmware_p, rproc->firmware, dev); >>>>> - if (ret < 0) { >>>>> - dev_err(dev, "request_firmware failed: %d\n", ret); >>>>> - goto unlock_mutex; >>>>> - } >>>>> - >>>>> - /* boot the remote processor up again */ >>>>> - ret = rproc_start(rproc, firmware_p); >>>>> - >>>>> - release_firmware(firmware_p); >>>>> + if (rproc_has_feature(rproc, RPROC_FEAT_ATTACH_ON_RECOVERY)) >>>>> + ret = rproc_attach_recovery(rproc); >>>>> + else >>>>> + ret = rproc_boot_recovery(rproc); >>>>> >>>>> unlock_mutex: >>>>> mutex_unlock(&rproc->lock); >>>>> -- >>>>> 2.25.1 >>>>>