From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (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 D467C29C33F for ; Thu, 16 Apr 2026 17:57:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776362239; cv=none; b=aFaTT52ymPj1Bfd1/6vlsNzHobuVbpGkj7FsXUSuHUj1QzrUV2N7Rymrv58h1r3d7OUcW1uNv+6EiAa82BatV/nL2abb/mFDAA1f+B3BTHQkxOsDbNNqXafTM1/72qD0N+HcFlxU9Z2hXM0yHbLlFVmcljlUlvJyiZGBvrIjSa4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776362239; c=relaxed/simple; bh=Z4Qbr2ArJ5Ivc+8c4wPA6/J5rPKAKUL1RthHGDqpNIQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WzNVrx6RQn5kp8t1hECUvyyMJxeh/k+6WM87XzhjpKQOxD098vHudirX3+fukNzt/usHcPlssPA9NuQt8oyqYk5EDdhxGtt713sjLaEGxISpL8FU/97Kew6J3gqkRWQRTVBmq32nZ636rgz7wteH2eCW4CGGMz9u3YRQXjmdR4I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=FQIjg3Kz; arc=none smtp.client-ip=198.175.65.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="FQIjg3Kz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1776362237; x=1807898237; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Z4Qbr2ArJ5Ivc+8c4wPA6/J5rPKAKUL1RthHGDqpNIQ=; b=FQIjg3Kzx2T7KV8sISN9l2lWlrJ/G0UchKSl4jXYNzdomCdSZuZCF+J2 EVZCpYgNojffNxL2jdgXw7R2LSoUqvVeSheQ9QTKCagLNR2qbEbpUVUts Xk6aaX5BPLocPu+jFvJLCF18il9x4eG0Spm4fASFAVMfS8rXaOMGtEqwr GqwzAGZnT2JoorWghkUXeKmC+boBcLDJwHRiMw8ITCKlLl0QvgVC2VHDn 9a5JdfIMcDStKsAiG9UsZc24WGNxwWwkX/nC+01QdYSaRrP8r8uzDaNuA R0o7aA7+t0MTnvOmdVY6yZd5Po+6wv9boa9aFqMU1eJjvPbLIZaUp9ES8 Q==; X-CSE-ConnectionGUID: +MblaMFWQIOJR7syvYfsAQ== X-CSE-MsgGUID: g4+wqSUQRHagdhHdF5RYjQ== X-IronPort-AV: E=McAfee;i="6800,10657,11761"; a="94778347" X-IronPort-AV: E=Sophos;i="6.23,181,1770624000"; d="scan'208";a="94778347" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2026 10:57:17 -0700 X-CSE-ConnectionGUID: 9mVuN3hpS9OFxzYFtDpqgA== X-CSE-MsgGUID: Eu0n5YNyT4SQgPVxvuhnUg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,181,1770624000"; d="scan'208";a="235784476" Received: from abityuts-desk.ger.corp.intel.com (HELO ahunter6-desk) ([10.245.244.222]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2026 10:57:16 -0700 From: Adrian Hunter To: alexandre.belloni@bootlin.com Cc: Frank.Li@nxp.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/16] i3c: mipi-i3c-hci: Fix suspend behavior when bus disable falls back to software reset Date: Thu, 16 Apr 2026 20:56:49 +0300 Message-ID: <20260416175704.41217-2-adrian.hunter@intel.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260416175704.41217-1-adrian.hunter@intel.com> References: <20260416175704.41217-1-adrian.hunter@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Content-Transfer-Encoding: 8bit Software reset was introduced as a fallback if bus disable failed. The change was made in 2 places: the cleanup path and the suspend path. For the cleanup path, after software reset the function continues to do cleanup for the current I/O mode. For the suspend path, after software reset the function returns early. However software reset does not reset any Ring Headers in the Host Controller, so returning early is not the right thing to do. Instead, continue to call suspend for the current I/O mode, which for DMA mode will reset any Ring Headers. Note, although Ring Headers should not be active at this stage, performing this reset follows the procedure defined by the specification and keeps the suspend path consistent with the cleanup path. Fixes: 9a258d1336f7 ("i3c: mipi-i3c-hci: Fallback to software reset when bus disable fails") Signed-off-by: Adrian Hunter --- drivers/i3c/master/mipi-i3c-hci/core.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c index b781dbed2165..bb8f2d830b0d 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -765,16 +765,14 @@ int i3c_hci_rpm_suspend(struct device *dev) int ret; ret = i3c_hci_bus_disable(hci); - if (ret) { - /* Fall back to software reset to disable the bus */ + + /* Fall back to software reset to disable the bus */ + if (ret) ret = i3c_hci_software_reset(hci); - i3c_hci_sync_irq_inactive(hci); - return ret; - } hci->io->suspend(hci); - return 0; + return ret; } EXPORT_SYMBOL_GPL(i3c_hci_rpm_suspend); -- 2.51.0