Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2056914rbb; Tue, 27 Feb 2024 09:16:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVGcdgmX6G0sh04PTCSrQjxJczE7wOe+/aXpf0zxiwnORa2sHU9Id7WvsRGDCPWnxjtH1CEqsPATqli0rrtWUZ2nPub6T6HNZiGOSlagQ== X-Google-Smtp-Source: AGHT+IFeW7YQlms3RNGpvH7TPlA1qfAFtLwO27WfgCnKj70gBd/LtVPzdsGnV2qQKuKBVYu4CPvj X-Received: by 2002:a17:903:186:b0:1db:f389:2deb with SMTP id z6-20020a170903018600b001dbf3892debmr11466360plg.17.1709054162481; Tue, 27 Feb 2024 09:16:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709054162; cv=pass; d=google.com; s=arc-20160816; b=Z5ZZ1wnQCEfaKiKg6xGCbHmb4yxnwD6AYb27J+Xyh1P0RC4p7BUKNmqlDv0NQIRu1g 2RmM08jmFDEPKmXX2KBsi2ioxUApxK5fFoCUDaYhkxSrqeTXTZnswP3RlEze3JheoKxe NVpOPrxtp7rmywHnWWH1cFAkRCD5gcr+0pCITcMJz9rRQDoOmqSPtE89aZEQ7hv7Ta+i 8pplEcU0+KS/UvVNtzYRSUDeLHePqTYZ4xl+LgeZM2wcaT5Ai6GU+46PRsBZ3YYJI8Lf Xn6p++RRYbo33fTLrkLJnMrwaRrZ1w5bDw4UrNFEzioAbATA9WOCrFWPUMqz8RxER/mC DYOA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=o4T8k/GzPwrI1R62VQXBd8xMeTbbVe30Wb070cxDcDU=; fh=HzJxxhgAahKDQ6PESSDV/TT3gBC/PFdO9KlO+oshCcE=; b=wEPslLiEATssP6WA3eT7vhStNTr4GnVxc1tb+qDq8A59gfQFgQU3NZoKgFA+3ft2qG PkQhMOL1XlvU/sZVe0IgVwtN7IMcm4c5yRZpZY4V+O80T840ODQNT3iDCdR1XZOa6AJJ BfT0+3atxc5GmKDnJHAZZlXHB7dZUCLznSLv3h0RBxuebpu68Da+eDkPJv3+riYmO+gi suvyHZaIaLa4aGWdb4d1C7Pc9ir+aGxtao6Cx4MNGhPXnRv4USydMCyjZt9JIacsvITh qvc0lFP9GCTTVIxXN9MDoyDy53R8aMOhW7svUFXKqvbzb+F6QbbhdQrh+VrTeGwuL+Pe dFIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gZVjHAAr; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-83677-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83677-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id b12-20020a170902e94c00b001dc38eea422si1660278pll.403.2024.02.27.09.16.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 09:16:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83677-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gZVjHAAr; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-83677-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83677-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5C41028E6DD for ; Tue, 27 Feb 2024 17:08:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 059934EB30; Tue, 27 Feb 2024 17:08:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gZVjHAAr" Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A05BA4E1CB for ; Tue, 27 Feb 2024 17:08:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709053713; cv=none; b=GUupyQdTiP9iszIHhQARVNaVzJbZx8vhu1pvUwdJLuAHA89vxvGg0SLFTEA6YsRjWAZBXVMrEtOiNXnskQq1YtYZjiNKVTJYIQ9V6cuzpxdrpZ6JHK0TMx7iOp1SxoNiYNo3Di9xxUFRCMryk1wSfVx88fz2pso+XZtNKOXniNU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709053713; c=relaxed/simple; bh=PGntO9HZ7nB0drpm+YsqMGgrsQ12kaan0DEUm5AB9oE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QI8c8u4ZA4giaKPfAVkZZ6CX9+Cqmfet1cKNJmuyfCXnK9ln0l6ml89F6gUziP9UlM/tFS1ctttu9iwaOowHpEuL8Lbx2I72wG6TpCzS1vIFKT9gSPk83IwhEYnuR5U+YnvhB9tRZ/sLblCustJe7VhYEGIO8gTd8T1AF789I30= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=gZVjHAAr; arc=none smtp.client-ip=209.85.215.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-5ce6b5e3c4eso3408625a12.2 for ; Tue, 27 Feb 2024 09:08:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709053711; x=1709658511; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=o4T8k/GzPwrI1R62VQXBd8xMeTbbVe30Wb070cxDcDU=; b=gZVjHAArdA1qHhB5tPwJNuEElRgcuFXxI3u79W0AyDEzRagA1YMjeSYMV4650yCiHp koKQYjLCkbBTdZoCqvOhDpCK0py6n65bzF2MZMa2vG0JBxuoMQRFtUVXfzmbwmA5+gPX b8ab/l48e9VyujtsZwxODNvK1IuT70I5julGqt61lHJKRvveuBNIgnE6IoVrVTh/v1is ua1ZLg8CEZgubVnaavnQQMezPyL6N69pDOZqtB0FfJ3nxiKRigBeQgJDSHw7JwJ1lIYr ymywXd9oPWR/Hrf7yCrVewge/FzWsC4h12F+MhraxhChKpyf1DjInqOzVRwM03C1DI5Y tzYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709053711; x=1709658511; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=o4T8k/GzPwrI1R62VQXBd8xMeTbbVe30Wb070cxDcDU=; b=Z49VpDMAh8ZLccI/gLe7IWXG17mP2UghKAJB4FmKFnO6mM28dnvYMHrS28G/87ucPY zBXbpHFkwpyrXuXBjsvaNdSgGICeGweJPcnuWCypeVhOyjmtTqU7W8Y/lcCVurv5Yr9u 7q/yowVLNq6AKE3SnqGCND0WrmIDUc5klu0rYS1vT3rLBym9bcUN9Yfo7LdtSkiT1e/e lyHvBboiCBa2NY0fRqKrGU2RwwTSPk8ziPoficaVxDRNkeREyBXPQuNNrSelYz4H4Jt+ TM0rRvST2AWsT9GdYZD9MgvXj4ekk3oUMAUS7EM7JQ6fYoXEJI4asRWG4kkgt8TP1ca4 BF/A== X-Forwarded-Encrypted: i=1; AJvYcCUvNOrK/ETwCfiGw9Nx7X7rido2pf94VvaDB0m5zR9NiSWaPslQ3uzd/Kjrb0inlzhjkwztBCnm44Dx0tp7wk/7FmuCNiaGR5ajNnTZ X-Gm-Message-State: AOJu0YzoRg9f1j1PZ7bJTw5cFgo7vNhVJzMJlvqfk0nfX/egG/Bv24TJ TX9tzZIoUOMqYqh6TQI0dF/XZuSCoGZZ0o4nEpX2gfXkyQKdyXskC5Ze7HV67fc= X-Received: by 2002:a17:90a:b014:b0:299:5d2c:9aa1 with SMTP id x20-20020a17090ab01400b002995d2c9aa1mr7690525pjq.5.1709053710806; Tue, 27 Feb 2024 09:08:30 -0800 (PST) Received: from p14s ([2604:3d09:148c:c800:77b:bbfe:c3af:16dc]) by smtp.gmail.com with ESMTPSA id nb12-20020a17090b35cc00b00296fd5e0de1sm8797823pjb.34.2024.02.27.09.08.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 09:08:30 -0800 (PST) Date: Tue, 27 Feb 2024 10:08:27 -0700 From: Mathieu Poirier To: noman pouigt Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: Re: Audio dsp recovery using remoteproc Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Good day, On Fri, Feb 16, 2024 at 03:29:56PM -0800, noman pouigt wrote: > mailbox to dsp_1 is currently modeling platform pcm driver. > mailbox to dsp_2 is also doing the same. > > Platform driver callbacks cause IPC to be sent to dsp's. > Lifecycle of two dsp's are managed by separate remoteproc > drivers. Single sound card is exposed. > > Separate watchdog interrupts from the corresponding dsp's > are connected to remoteproc to manage crashing of the > individual dsp's. How can I restart both the dsp when either > of them crashes using the kernel device model? Remoteproc > driver currently only restarts the crashed dsp instead of restarting > both the dsp. It is needed to bring up the hardware in a consistent > state as both the dsp's are connected to a common hardware. > Ok > I thought of making a virtual parent remoteproc device > and then managing individual dsp as a subdevice of that parent device > but remoteproc device node is associated with the individual elf file i.e. > it can manage only a single dsp. You are on the right track but perhaps not fully aware of what is already done for multi core remote processors. I suggest you have a thorough look at TI's K3R5 driver[1] and one of it's DTB[2]. In the DTB each remote processor loads a different firmware file, which seems to be what you are looking for. Thanks, Mathieu [1]. https://elixir.bootlin.com/linux/v6.8-rc6/source/drivers/remoteproc/ti_k3_r5_remoteproc.c [2]. https://elixir.bootlin.com/linux/v6.8-rc6/source/arch/arm64/boot/dts/ti/k3-am65-mcu.dtsi#L397 > > How can I model remoteproc drivers using linux device model so that when either > of them crashes both the dsp's get reloaded by the remoteproc framework. > > MailBox ---- DSP_1 --- > | | > Linux ------ common_hw -> speaker/mic > | | > MailBox ---- DSP_2 --- >