From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (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 529E63A544D for ; Mon, 13 Apr 2026 10:07:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776074857; cv=none; b=dl389wqDwzDVNYj/Wu0iyOMB1r+ozQAjVssVApBkV+YsX2b63lB2GHvdhTlksFPLbrjX2Zp+cjCAaCeboUrZ8FnZdFnA+6ucb1d+ka845NVZozxn4f6yx0Ze+UrKfnSSI8v7ZlUh4d4zUtOZulzPgxhMU2FtLtvKTTZ+s9iUXC4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776074857; c=relaxed/simple; bh=Mwmud0ptvuHV+QGGbUoP8Aq9HWXBoreRMpco68h7Q1o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CsV5am6jXYJF9Y9XMIF6Fjfujp4+pk4WIVaKGbN+jriLdmOjJy/dm5VrBcjo5h+IUUvan3PxxnZM5rQHLkda0D8kTIlaig1qx9ZmSRq1WiQLsyC6dBYlFe+QJlCDVSRpsS74bZyhG3GkzlZ43U2MVbxQBd+IVt8OmdoNAQ2QYrk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nacJeyKy; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nacJeyKy" Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-82cf636dac8so1889780b3a.3 for ; Mon, 13 Apr 2026 03:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776074855; x=1776679655; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ee0L/AD5HlNBkYL/vdO0qzIztqPcV8bZs1PfoNLBo+U=; b=nacJeyKyUF3e0dvnpIk23EmlEC+zDeld6l9s+WMfw6PMURANCex9cS0tF42flYHvwJ nBAVbx3UJHUKtnT5FIT26J7rJXuUefpxO0f0OEtN5Of9zNSGjmNXjc7Yhx+5aGSRu9fa Q7LFmJ5ggrGCBzJEAKv75CJ1VUdPwSGDl0QozQ4+We/lZLQ//5Y4QJ0Q0JEcUl2rdftS q/oCsaJ/oUlta0XfgUREQyi7bXaItqfOGTkP/7WRfShpqUAzcXHyTIZ229cOWgb4w1s9 6f1296plzbPH1Uve6ysm5M5H6RRmYWydQsYSxav6PS73+6LqQA7wOA8mYjC9U/J/2ZlB Goug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776074855; x=1776679655; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ee0L/AD5HlNBkYL/vdO0qzIztqPcV8bZs1PfoNLBo+U=; b=DcztdexGl8bYVlcqZTxIuALX7uhms9gpHKmzkqsfcSFD4kuKb13MJ2o/2e1zgttSTe bLZQfjG9AL7A2hIUFglXg9DImvamppTxjqLTi4OA5FnXLsL7jJ4OYkCxivFutvdl/pWB jvC9cuY1jRntIvqVuw17K2pboZHufLlTHlckWOARjdOFf9ThKz8DskR6glQq+5+iwPwd buwGOiuJ44+o5fTkMHfSMn8Pp3JeLHDDLRmJgGTH3tDn3u0AdcstFS1vVQMKHM6BVrf4 B4ICPJlWckAoJxgbYFEhcZSkbniuVj7wyZC2c3XMkvZBH+cJ/x7StzfJNaxq7YCARL5G gqYg== X-Forwarded-Encrypted: i=1; AFNElJ/eIdtrADrRpasd55qem87UxN1HgwpqhRwZMpWwz8bSkfBkuLhJxWRc4SNEQOHSooVUtTXZ7Yw/02SWlAg=@vger.kernel.org X-Gm-Message-State: AOJu0YyRH35tdvJnol8zWha5J7auc6OD/G0wRGoybw54HgZH7Uxd6ZJY 5AqG8FmzKIvubCe11ZFAImaBWKuH6/pamFNVgHvOUCN5L9YODEHCevl2 X-Gm-Gg: AeBDietR78m/SeD7OV0z/RTyazo4Nyjlfua6AB2YKfJWoNidhY7s73sFgkCWyjltsLP LyI3c19q3b1eyZY+TPfzKOwzHHAipDGWCmTbecqS5PhZgYSxXSy6IzFMaWB8jk2H4O8vzO1Bx1S GjrPmhsPVWyVpjNkxWswqbbq/S0WAN6szo7Z9aLxSDSV7soOraX3tNUAlSaIt44RFYlYnO7rH/0 usv3bBYbNT1AB6T+4sVqGrSW+SWQ8ct/ULWdVNjCp2rq/FdZq2H66vUgFyu8Yd41nio83Th25pG FnUiZIMhkiahUy7JOjd0C/0tvsZlgcqDFbT4QU8H4sDw+7TyyivFeUj4g+Dn4HVGyXXyCludcAZ fyGX1GbFr6f4+0N925rz7Zc17L66rJWkxm7UgUT6u1+mwzsJGKyidTHywSndAs0NqEfB6KvqObp J4uPcM/D5OnCkATnG+a5VdC4WIxLKvOLFy/uhbH7+e1LzMd39FTcQlsnI5LA== X-Received: by 2002:a05:6a00:1785:b0:82f:24e:6a3d with SMTP id d2e1a72fcca58-82f0c26b5e1mr14138598b3a.3.1776074854673; Mon, 13 Apr 2026 03:07:34 -0700 (PDT) Received: from phuc-desktop.. ([183.91.15.56]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82f0c50a8f7sm10232140b3a.56.2026.04.13.03.07.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2026 03:07:34 -0700 (PDT) From: phucduc.bui@gmail.com To: kuninori.morimoto.gx@renesas.com, broonie@kernel.org Cc: lgirdwood@gmail.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, perex@perex.cz, tiwai@suse.com, linux-sound@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, bui duc phuc Subject: [PATCH v2 2/6] ASoC: renesas: fsi: Fix hang by enabling SPU clock Date: Mon, 13 Apr 2026 17:06:56 +0700 Message-ID: <20260413100700.30995-3-phucduc.bui@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260413100700.30995-1-phucduc.bui@gmail.com> References: <20260413100700.30995-1-phucduc.bui@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: bui duc phuc Enable/disable the shared SPU clock in hw startup/shutdown. Without this, accessing FSI registers may hang the system. Suggested-by: Kuninori Morimoto Signed-off-by: bui duc phuc --- Changes in v2: - Move SPU clock enable/disable handling from fsi_dai_startup/shutdown to fsi_hw_startup/shutdown sound/soc/renesas/fsi.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sound/soc/renesas/fsi.c b/sound/soc/renesas/fsi.c index 196ec7bac33d..109e06b5f32d 100644 --- a/sound/soc/renesas/fsi.c +++ b/sound/soc/renesas/fsi.c @@ -1492,6 +1492,18 @@ static int fsi_hw_startup(struct fsi_priv *fsi, struct device *dev) { u32 data = 0; + int ret = 0; + /* enable spu clock */ + mutex_lock(&fsi->master->clk_lock); + if (fsi->master->clk_spu && fsi->master->spu_count++ == 0) { + ret = clk_prepare_enable(fsi->master->clk_spu); + if (ret < 0) { + fsi->master->spu_count--; + mutex_unlock(&fsi->master->clk_lock); + return ret; + } + } + mutex_unlock(&fsi->master->clk_lock); /* clock setting */ if (fsi_is_clk_master(fsi)) @@ -1549,6 +1561,11 @@ static int fsi_hw_shutdown(struct fsi_priv *fsi, /* stop master clock */ if (fsi_is_clk_master(fsi)) return fsi_clk_disable(dev, fsi); + /* stop spu clock */ + mutex_lock(&fsi->master->clk_lock); + if (fsi->master->clk_spu && --fsi->master->spu_count == 0) + clk_disable_unprepare(fsi->master->clk_spu); + mutex_unlock(&fsi->master->clk_lock); return 0; } -- 2.43.0