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 E6EA93368BB for ; Thu, 16 Apr 2026 17:57:30 +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=1776362252; cv=none; b=mkrZV74Lje8P7VHRKqsok0Yc3AYLjaGD2teRHfQ89mlt4meeoxVjW1WeSbdlVJXTQsdqoqCE2CrHQ7uw9Hv9opGTO+h5DwMiWeo/39RgpVteY23HozLe1a6ZhCtTb/3ye84/t7vqXsha+Oc0fHjikzowc/YQKFs+F8ifX4lXYhU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776362252; c=relaxed/simple; bh=sftKnuMKbgr2LYtEm+2TjhHATg50Nz6kkphzeIBb1pg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hhQXbAfzMJ4GcsYwfULI3YdkVRFRfUvgPAZ9y5pYrxmxFM5PNCDf0nuaMDukCvz4lHEWi0CRknBkwYHNzNgkYtvWS48CZIottIJLUbk2SrEXl2QmvUUbdv5tpUOc4fcq5LfQVwThGN5XD7ke17KpDYEZzefaoH7GZXUSwh85XMk= 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=dytrw+zp; 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="dytrw+zp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1776362251; x=1807898251; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sftKnuMKbgr2LYtEm+2TjhHATg50Nz6kkphzeIBb1pg=; b=dytrw+zpwnCXQCI6bmp/aGrGr8IcY5RcBAErpLroEbzgnCEqHLlKlvVG Jq5tXUGG/5RW24yHYYn6wjhE98Tn9/hELmjMNvhUFfTg7bhHMmbGILnB1 gAQhV7n6zKMVzu8fqamQYBXHRL32BRQiQUjsP5JuMxzZItCTSujj+B8WG gbwK6P5opCdQGJfOgunwGFDfysyn5vJub114kVy0pdIqxjGYf7LJkK/9G iUompk3J+yKqIwHETrX9JfTWbeWqxEZl1M6vHfryRyroxGSHRfuLchmcb mfNchxqCi5nb2xI4D1BmRhIdz37//Ogx1COWMNBoLlZzoq5lZAjFkdorb A==; X-CSE-ConnectionGUID: ZuYYXa43QDezs2vW6HkwtA== X-CSE-MsgGUID: bbJDvl4mSGOhjHTuT5fKYA== X-IronPort-AV: E=McAfee;i="6800,10657,11761"; a="94778385" X-IronPort-AV: E=Sophos;i="6.23,181,1770624000"; d="scan'208";a="94778385" 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:30 -0700 X-CSE-ConnectionGUID: t6yEQZbgR+O9DWEwRUK2Ug== X-CSE-MsgGUID: abSEi+MFT5+G4Rq2KJ/R3w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,181,1770624000"; d="scan'208";a="235784564" 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:28 -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 07/16] i3c: mipi-i3c-hci: Complete transfer lists immediately on error Date: Thu, 16 Apr 2026 20:56:55 +0300 Message-ID: <20260416175704.41217-8-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 In DMA mode, transfer lists are currently completed only when the final transfer in the list completes. If an earlier transfer fails, the list is left incomplete and callers wait until timeout. There is no need to wait for a timeout, as the completion path in i3c_hci_process_xfer() already checks for error status. Complete the transfer list as soon as any transfer in the list reports an error. This avoids unnecessary delays and spurious timeouts on error. Complete a transfer list completion immediately there is an error. Signed-off-by: Adrian Hunter --- drivers/i3c/master/mipi-i3c-hci/dma.c | 6 ++++-- drivers/i3c/master/mipi-i3c-hci/hci.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/i3c/master/mipi-i3c-hci/dma.c b/drivers/i3c/master/mipi-i3c-hci/dma.c index 28e4d38f55d3..5eea4fe6ebb3 100644 --- a/drivers/i3c/master/mipi-i3c-hci/dma.c +++ b/drivers/i3c/master/mipi-i3c-hci/dma.c @@ -502,6 +502,8 @@ static int hci_dma_queue_xfer(struct i3c_hci *hci, struct hci_xfer *xfer = xfer_list + i; u32 *ring_data = rh->xfer + rh->xfer_struct_sz * enqueue_ptr; + xfer->completing_xfer = xfer_list + n - 1; + /* store cmd descriptor */ *ring_data++ = xfer->cmd_desc[0]; *ring_data++ = xfer->cmd_desc[1]; @@ -576,8 +578,8 @@ static void hci_dma_xfer_done(struct i3c_hci *hci, struct hci_rh_data *rh) tid, xfer->cmd_tid); /* TODO: do something about it? */ } - if (xfer->completion) - complete(xfer->completion); + if (xfer == xfer->completing_xfer || RESP_STATUS(resp)) + complete(xfer->completing_xfer->completion); if (RESP_STATUS(resp)) hci->enqueue_blocked = true; } diff --git a/drivers/i3c/master/mipi-i3c-hci/hci.h b/drivers/i3c/master/mipi-i3c-hci/hci.h index d630400ec945..eee3e11810dd 100644 --- a/drivers/i3c/master/mipi-i3c-hci/hci.h +++ b/drivers/i3c/master/mipi-i3c-hci/hci.h @@ -104,6 +104,7 @@ struct hci_xfer { struct { /* DMA specific */ struct i3c_dma *dma; + struct hci_xfer *completing_xfer; int ring_number; int ring_entry; }; -- 2.51.0