Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp198216rdd; Tue, 9 Jan 2024 00:54:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IFq2aDFQspVYFuEkA8sIXurTK0c7LnlAg5w9NUvpkeeA0xA6dq4eemj2/q5WWvcgGfmulcP X-Received: by 2002:a50:99d6:0:b0:557:bef:7c50 with SMTP id n22-20020a5099d6000000b005570bef7c50mr2649261edb.34.1704790461081; Tue, 09 Jan 2024 00:54:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704790461; cv=pass; d=google.com; s=arc-20160816; b=OWrHZFua+Q46+alcC1YpYdhvFojsfvMOAG9cJIDNzhsrYukchhTwg80URX0napLh+Q ELOOMYkDgFYrWcs3KmksMbKwCMgeWxURGMwHP78+FCU42p2MN5ZbAwTrFq9BLdbLBEgh f7W1G0DNb78YptssuN7bddoVU0QyKfpWJcR3lzWaF3F5W8Di2ygmmf2ik6sTRG3udr0D lVMIdjXtJfuhnZDeXYsaycBw05d6tHzmJivq/FnIpV8tY4aPwcy679iRKhJr+VjDU7d7 HaAQ2fezjp5A0GwZDMdN71j1ycZkgPKekl70k0p7v+bggA+Wx2aXeNhtyYV1EIbKv/Ve NqIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:content-language:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=JbSE8flAdRznmxyS3t+R0q1HUNjtRrGgOBwc5VEB2vo=; fh=9CrIz3GDEOVxklXWigEpV7PEll6osraBiv0cKxcpvX0=; b=P5n93yoFA/r56HdM/OW8RGUaT7bK8VCx8I+YxJpKecBE8z8rSKfb3J6udO+zhbHZek pSBhLcvtoTmWsuIWvYzoww+rmgs7eqUBPpurGMjJXCKOWB6rD/YRv3LqOSLBqPaALFV6 MWxNxeaAfm4hdARKurikWpLBBpt8IwJTy05v+VYWKKzTyFust5GUyhYp9WrLl1wxGkRT pqtLNoT+5ZMeaqX9QNBwur84DqSNYnOoup5GO4YXckBnge4peDYqv4/wGiDH1ENifK+a nItKj4VQLF12QaJqkRAaNCJs44x1wBW8qIuWhVwEzJ69e32wN8XjeGLaS1865gA0TfQI fZ2w== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=cixtech.com dkim=pass dkdomain=cixtech.com dmarc=pass fromdomain=cixtech.com); spf=pass (google.com: domain of linux-kernel+bounces-20622-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20622-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h17-20020a056402095100b0054c392acb7asi576979edz.281.2024.01.09.00.54.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 00:54:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20622-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=cixtech.com dkim=pass dkdomain=cixtech.com dmarc=pass fromdomain=cixtech.com); spf=pass (google.com: domain of linux-kernel+bounces-20622-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20622-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A76C31F259C1 for ; Tue, 9 Jan 2024 08:54:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 688772EB1C; Tue, 9 Jan 2024 08:53:52 +0000 (UTC) Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2047.outbound.protection.outlook.com [40.107.117.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 84CFB2E842; Tue, 9 Jan 2024 08:53:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=cixtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cixtech.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kBfYeZmk00xg98Z5Smg/dcaZynMPHK6q/7ygTQfdzx64zzlL6uDYyk24TDdgnkQO7B3oA/96/40QwNo49E7Bmz1UNfZMdEEPfQk3OBQ2HVzBc7iQfyodZIJNom53K7XJRUBlUuuptFqHGyI6XPdZJBpBP/dWVZXxuS2Akiq9gGFJueVkosgz7+8OptxLHv/xo9KwYcz9a36BVat8HvnCIRFyLjQ853QWcWIQpBv3DUkzOAYXG4L9RxBMJS3PNV8+63O+cbG/DxP80bN6AubCzqgv6xcDMO7RteNUCkaxDKACeIKcClbcK7AXxgOgPwpSUDFa4hOs1CQVXOqViDzDhQ== 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=JbSE8flAdRznmxyS3t+R0q1HUNjtRrGgOBwc5VEB2vo=; b=oZr0pcT7KQc9xODsrxueDhPz84T3lkyLfW7af335Reo0PWECKmFCI63d2X3U9/tTh9pbvJmFezDW9NbUjRsiSrVJcXlOGTnXP8lTDremI69ZV7Nkcdm5aq0Ilynu/dnO4aSLBzi9NStbYQ8Euj0SkGMgxZTmGnkfZClwXk48vAOkQUdf/OGbO7TYmiErn+a+WgOYJmugX4ESKSW6lSqraQumQJnO4OeWM25EwRtutKKbmroitzje1vc9rzFXGL2BuoYU6y7bMzm6WroBzB1MRunxo1uGT1/+WBYTVu5z2Rn0CBkAHaSQJhhCWu/6oIF757KMoeupopxbRBATpXKI3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cixtech.com; dmarc=pass action=none header.from=cixtech.com; dkim=pass header.d=cixtech.com; arc=none Received: from SEYPR06MB6278.apcprd06.prod.outlook.com (2603:1096:101:143::5) by SEZPR06MB5558.apcprd06.prod.outlook.com (2603:1096:101:cc::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.23; Tue, 9 Jan 2024 08:53:42 +0000 Received: from SEYPR06MB6278.apcprd06.prod.outlook.com ([fe80::c5a4:6868:b1f2:43a6]) by SEYPR06MB6278.apcprd06.prod.outlook.com ([fe80::c5a4:6868:b1f2:43a6%4]) with mapi id 15.20.7159.020; Tue, 9 Jan 2024 08:53:41 +0000 From: "Joakim Zhang" To: "andersson@kernel.org" , "mathieu.poirier@linaro.org" , "arnaud.pouliquen@foss.st.com" CC: "linux-remoteproc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , cix-kernel-upstream Subject: RE: [PATCH V3] remoteproc: virtio: Fix wdg cannot recovery remote processor Thread-Topic: [PATCH V3] remoteproc: virtio: Fix wdg cannot recovery remote processor Thread-Index: AQHaMKsZ01O1wcUzFk6tbyQ7iXca0rDRTy1A Date: Tue, 9 Jan 2024 08:53:41 +0000 Message-ID: References: <20231217053659.3245745-1-joakim.zhang@cixtech.com> In-Reply-To: <20231217053659.3245745-1-joakim.zhang@cixtech.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cixtech.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SEYPR06MB6278:EE_|SEZPR06MB5558:EE_ x-ms-office365-filtering-correlation-id: 0895bf3b-b749-4669-25f2-08dc10f07ad0 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Jgr1FYvTeMjfHXcyBMVD2I8b7QMjADjbCimhUZaD3JPG4gwnq4+fGy9RBnWH1/WnG9naO30Th7jKL+WfZrd9uXaQ77TOq7SUgsvtKUqWKvKVahn/od4M703bPZeLswa3erOIa6net4Ruv/SeJ3XAg+IBdsAlDNWOX6oJoA0qEH9oSdw0KVPtxBLkHVawS6yrPaYjqawHYGHT3H8tQfEix2a0ydcBKP5CZowAf6EzReYSfO5JTGGAlcY5DyHUIWE7ahd6vw0IjIGN9D3cB6059CnB0R278Mp/q7If/X5Xs1p8iTmfoUc7UimhnP1cu8OemEAtRV5kRJVlRYvT8Q6Dcx7lUXiDIzggzfZyVO/ilcoawso6/OoWpkcsVrLp2GWpcqpL3LqH4+TX6SoAoVy39R5s5HIPesz6ZgNMJbYIczKNEF6uqptZqaRG7Gq+ER1Rfmq6WbWDI6oO6F0Dw+NchyVc5n9QjDOc6LWqzQWyU/IhA5VRE5hTI23KS+GL81Y4owVG4khtdHEDTZT09d7JzhYyvhVynGJCOvQrxJ4AKeyZG1BGcuwOL7RpKlZHalIktHziXfMhKqeJ1ApydXqrATNmlBgnzynOMoiURbFzmM58xKC2UFHrmFAVizlg4GB2 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEYPR06MB6278.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(376002)(396003)(366004)(346002)(39840400004)(230922051799003)(1800799012)(451199024)(186009)(64100799003)(83380400001)(41300700001)(7696005)(6506007)(53546011)(71200400001)(9686003)(55016003)(38070700009)(86362001)(33656002)(8676002)(8936002)(316002)(110136005)(54906003)(76116006)(66946007)(122000001)(107886003)(2906002)(478600001)(5660300002)(26005)(64756008)(38100700002)(66446008)(4326008)(66556008)(66476007)(52536014);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?IWIrZjMKL8SlfkHvMt2GfSHhVL5ffQ2cBn1++9EoSPB27hfL+WHsFch2Jb8d?= =?us-ascii?Q?c0aP5yCOr4M3Nrg1t0xdyQmxmLgrbd9OmPkUYseD2dqZVOQMhu2pVs7W+L/c?= =?us-ascii?Q?R1mGZ/nHiIrdQNJJpB9TyA2489dB2wY8iDvq0YQZ+V/uz5ZlC0G476fiT0fE?= =?us-ascii?Q?VrPTHcmfebJgbj33a242WZcVBi3cjCeT9Zej2RLM9dLmebLr43UeZuw2p/he?= =?us-ascii?Q?Zknio4C4VfTD5U1wML1G3kyxZgvEnOBdQ/VUlk5LCSoqlRRUjZEeiBvqdrgZ?= =?us-ascii?Q?x+SSRdQg9O3eCY1ym3QuW7sb4jQ2M2Gc1LyBZH2zqndulZNMvrgNIjQsxel+?= =?us-ascii?Q?dvF1Mer5Hqw/6abFSQ22p/dEtzNNrCY9xKaBUYW94p2UEIKVjb9TVmfdfvr/?= =?us-ascii?Q?8sew3KU9CToBr6n/8EAJEj4NNzfG/dj0kdWmxmdK7T/BbXoxsAXSbY62cN9j?= =?us-ascii?Q?bg51k733mEq5lFIgSzSr2BpVAPYiBRM8ENkxZjdR8Zlix8ZhmqlrS84Rfgph?= =?us-ascii?Q?pdn38gdiJZ41o3RurgadGHIUR+LFBE2JzYgBI12DUeBYFrFpjrJDnDphE5dA?= =?us-ascii?Q?CTutXENRmEDlWc0uPHrJvX9wlPDVCrdBhdCbE/KcHQmvqLsgMUnUBSUYcr6o?= =?us-ascii?Q?ICzecIma3dZxXBNW2THCuogaGPl/QmSlAMBvtVNM6T/PbWMW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26l5w+FesgdSmAle?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: cixtech.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SEYPR06MB6278.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0895bf3b-b749-4669-25f2-08dc10f07ad0 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jan 2024 08:53:41.8018 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0409f77a-e53d-4d23-943e-ccade7cb4811 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 1Ok34s5xBWSSJ5eg0v/KVUNAjruZiQcB9OkEFmSlg/0RB8PwqyfyfrJlm6ioTj5Kq9vXTp5J2VkUcMFFO4kd2lNq35qYO/iRiNbCrtPg0r0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5558 Kindly Ping... On Sunday, December 17, 2023 1:37 PM, Joakim Zhang wrote: > Recovery remote processor failed when wdg irq received: > [ 0.842574] remoteproc remoteproc0: crash detected in cix-dsp-rproc: t= ype > watchdog > [ 0.842750] remoteproc remoteproc0: handling crash #1 in cix-dsp-rproc > [ 0.842824] remoteproc remoteproc0: recovering cix-dsp-rproc > [ 0.843342] remoteproc remoteproc0: stopped remote processor cix-dsp- > rproc > [ 0.847901] rproc-virtio rproc-virtio.0.auto: Failed to associate buff= er > [ 0.847979] remoteproc remoteproc0: failed to probe subdevices for cix= - > dsp-rproc: -16 >=20 > The reason is that dma coherent mem would not be released when recovering > the remote processor, due to rproc_virtio_remove() would not be called, > where the mem released. It will fail when it try to allocate and associat= e buffer > again. >=20 > Releasing reserved memory from rproc_virtio_dev_release(), instead of > rproc_virtio_remove(). >=20 > Fixes: 1d7b61c06dc3 ("remoteproc: virtio: Create platform device for the > remoteproc_virtio") > Signed-off-by: Joakim Zhang > --- > ChangeLogs: > V1->V2: > * the same for of_reserved_mem_device_release() > V2->V3: > * release reserved memory in rproc_virtio_dev_release() > --- > drivers/remoteproc/remoteproc_virtio.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/remoteproc/remoteproc_virtio.c > b/drivers/remoteproc/remoteproc_virtio.c > index 83d76915a6ad..25b66b113b69 100644 > --- a/drivers/remoteproc/remoteproc_virtio.c > +++ b/drivers/remoteproc/remoteproc_virtio.c > @@ -351,6 +351,9 @@ static void rproc_virtio_dev_release(struct device > *dev) >=20 > kfree(vdev); >=20 > + of_reserved_mem_device_release(&rvdev->pdev->dev); > + dma_release_coherent_memory(&rvdev->pdev->dev); > + > put_device(&rvdev->pdev->dev); > } >=20 > @@ -584,9 +587,6 @@ static void rproc_virtio_remove(struct > platform_device *pdev) > rproc_remove_subdev(rproc, &rvdev->subdev); > rproc_remove_rvdev(rvdev); >=20 > - of_reserved_mem_device_release(&pdev->dev); > - dma_release_coherent_memory(&pdev->dev); > - > put_device(&rproc->dev); > } >=20 > -- > 2.25.1