From nobody Sun Apr 6 22:11:16 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1736620854; cv=none; d=zohomail.com; s=zohoarc; b=KYI+NuiOGLM09G0dVT8Ta5e+bccjY0pa6c7cw1fd4+F4pEIJdtCsWHapSjAwXOQwVJ6z9aBShrYHFFNc5PjnSqSyoOfO8wFCjoSbptICsY5S+/MUHc4ahODBLSmtvdseAUmFONgkxj7NeNwNzMwqpqbztl0s1efOoMT+7rQIaME= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736620854; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=u9wFgo5Z7UpDwTBLjtHHDdpJs0leNa3i7KXv69IcxWY=; b=lWvPLqgyuXhh1jBWt8NwM0WCD5R31mPkBMpzd5YxOg0MJGcxfI60gEZJK9dmHDDbJM8i1uYYEd8ox5baXNQgHl9OmbVZa/c0toQ97qHU6jOgvzYBq519+O7lAYruyxaz8wZ4nmV0M9umo/zFAW5vdbqTtuKJCdn9s9zODFiWvjk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1736620854862464.28627527896265; Sat, 11 Jan 2025 10:40:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tWgMV-00073P-71; Sat, 11 Jan 2025 13:37:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tWgMS-00071f-Vq; Sat, 11 Jan 2025 13:37:29 -0500 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tWgMO-0003ts-46; Sat, 11 Jan 2025 13:37:28 -0500 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5d3d0205bd5so4483677a12.3; Sat, 11 Jan 2025 10:37:22 -0800 (PST) Received: from Provence.localdomain (dynamic-078-054-101-099.78.54.pool.telefonica.de. [78.54.101.99]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c95af187sm299026666b.142.2025.01.11.10.37.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jan 2025 10:37:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736620641; x=1737225441; darn=nongnu.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=u9wFgo5Z7UpDwTBLjtHHDdpJs0leNa3i7KXv69IcxWY=; b=kZBMhFhiSbMi96giaVv4xGelTwoTaVS21B3iYVCXS15GgB5IeBP78hErx3fCI/5cHB 5CBJQt3FbJjcWsAIDP2l2COh3j2mXzyc2PUsC6K6wXE9JUtk7kcTt+OBf+MVA9ed3cQV 1tvGJjSw+U3eT4qWlrPkSaB4EKF3uiRk9/sfPgskRMQS+bPfCdlJPLTMowOC4FGiA3fa 7KtnwSfRRSN/70bLwWzX5XVDrvYa0+FuYRR4odj/ZbfTC+B2IR9pjvk5daen03uZWpjT mw2E2qutIbwZj1AdzRsseuWvnPoXPISbuwkeZnjmJMZW8cK2HG9f9VPkmZf+m3YG9trF KIjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736620641; x=1737225441; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u9wFgo5Z7UpDwTBLjtHHDdpJs0leNa3i7KXv69IcxWY=; b=JhUVIHeiiAHisvkRrpnsLDIONoVu1hA3Kjqh4RyCVvajAhP/G16RpWolt/cbaZM+/x RQZzJD7LtqVtTx7boAfBTM8TuX+66/hOgRUVL3cHB1cG+y2Ss1WNp6nUIfOfqcimkAHa xfh8Hkv1MvLnV5zbPMOSPqAAu3qRPhoBnvHKpgRH3mKeevmn6qLnMU2SZ7dsaMJa7JT5 psaI2SwgGMywpWqJvkr7oXXnhmiQIIVkjGSrNar2Zry6zkbt/ye9t+vAoTm/HdyrgJNh iOBULlUCA93hxo0y+nMrsIysoWJvtoZwCnla+sUc7qi0on/vM8zJ92Eq7Y4se9Zw07KV r1nQ== X-Forwarded-Encrypted: i=1; AJvYcCUpKX7NV8eCobhfMZmx18rEFqACMJG4f16iFnLbaZzBcT4DAogF6yFRUB8/ALoH8Gp8w+Tf+cwKMg==@nongnu.org, AJvYcCUtK7AOKnRikDeaVvZsm/8TITCNBDF37nAeT5h+nEKcvAiMYy5esYbmQzH6Lnez39bsle5SwueaW+48gQ==@nongnu.org X-Gm-Message-State: AOJu0Yx3OCPu6wJvSp3uMSHbkPOX5wbp2jXAs8S0+egi2Sj3KnJXmBjo Ff8vUO17JMyFQgSTowy5neJV7R8QJ/UdiMPXih81IqfBXjN2rU9La+Pqiw== X-Gm-Gg: ASbGncv47krbHiazpRyROHTgPc4aO9CM7aU+8MyvfjbhuYga9au41K96drTyeRgt2DZ PAGrgfFHVBtxYFD3+FaVn4eZy2RXAZMPbvqnCs8k+CQ5NXBkJqX5PxSKZ5b0RoTqbeNtu4sH8Ey 48mCl5PvIVQ+3a8aKMPdLilqT+oRcktgmKaf7CgtpiBWMgEHzjzHtpUx1ZclCnRvmp5JkarOcT2 R5uZO9On5+cy96D1/UeQ+9Uao4w27VdT3wRXnRLykDVU/FwiLXKv4o/X2VGWzXHSa/U5nKEWcAg sRsK/X3cOazkRy+XjUzBNCSoCACGuk/UOoYJ2tVF+UE= X-Google-Smtp-Source: AGHT+IFGzYj4uYhYKZZWEcNFd+glHbGCDxmWFpsiZrEGmLfJfdMZcF0jihQJuOsjM6OONL2cM5G9+g== X-Received: by 2002:a17:907:787:b0:aae:849f:3255 with SMTP id a640c23a62f3a-ab2ab709e27mr1399276166b.34.1736620640445; Sat, 11 Jan 2025 10:37:20 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Paolo Bonzini , Guenter Roeck , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Andrey Smirnov , qemu-arm@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Jean-Christophe Dubois , Laurent Vivier , Bin Meng , qemu-block@nongnu.org, Bernhard Beschow Subject: [PATCH v2 01/13] hw/sd/sdhci: Set SDHC_NIS_DMA bit when appropriate Date: Sat, 11 Jan 2025 19:36:59 +0100 Message-ID: <20250111183711.2338-2-shentey@gmail.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250111183711.2338-1-shentey@gmail.com> References: <20250111183711.2338-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=shentey@gmail.com; helo=mail-ed1-x534.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1736620856803116600 In U-Boot, the fsl_esdhc[_imx] driver waits for both "transmit completed" a= nd "DMA" bits in esdhc_send_cmd_common() by means of DATA_COMPLETE constant. Q= EMU currently misses to set the DMA bit which causes the driver to loop forever= . Fix that by setting the DMA bit if enabled when doing DMA block transfers. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Bernhard Beschow --- hw/sd/sdhci.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 299cd4bc1b..a958c11497 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -665,12 +665,13 @@ static void sdhci_sdma_transfer_multi_blocks(SDHCISta= te *s) } } =20 + if (s->norintstsen & SDHC_NISEN_DMA) { + s->norintsts |=3D SDHC_NIS_DMA; + } + if (s->blkcnt =3D=3D 0) { sdhci_end_transfer(s); } else { - if (s->norintstsen & SDHC_NISEN_DMA) { - s->norintsts |=3D SDHC_NIS_DMA; - } sdhci_update_irq(s); } } @@ -691,6 +692,10 @@ static void sdhci_sdma_transfer_single_block(SDHCIStat= e *s) } s->blkcnt--; =20 + if (s->norintstsen & SDHC_NISEN_DMA) { + s->norintsts |=3D SDHC_NIS_DMA; + } + sdhci_end_transfer(s); } =20 --=20 2.48.0