From nobody Mon May 16 09:45:29 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0B2701AE2F24; Mon, 16 May 2022 09:45:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L1vWF6tMfz3r8t; Mon, 16 May 2022 09:45:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652694330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9191A3xd3gtjVfxafQQjUv3UlYxjWk4dJgcrkdqIwmk=; b=QQ9lyQOotM7zu2uGWShQtidrESHMltDyvc9w3EQbnPkXI7tvTzaYyPIkI7Jed03NHvy/Pb 3/oTjl0oH5Mq10C0sCyX9RGidgjIy12TNeJBoZtkjcfQ7o74emhyxsoN3gWC4/cBtWizN7 vnFyujjjCgsNjob1j44pB/Qrjkt5Cko7lbwFt2JfLDGaOy3yC2KyOayNuza69Z17PiR2AW iK7lq0uLR+RSCNvKHQF0vmN5Md9rxVqpkI+heiFJixavRDj4mNFZ9scf6h4vd5aycL0DY1 Uz6slAscDTNO+jiPP5W8T0JKYXcqzVWmx106UjGCQOG4CmXhHkuBH4/ngoyTLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC28F1DA49; Mon, 16 May 2022 09:45:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24G9jTNc040482; Mon, 16 May 2022 09:45:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24G9jTAM040481; Mon, 16 May 2022 09:45:29 GMT (envelope-from git) Date: Mon, 16 May 2022 09:45:29 GMT Message-Id: <202205160945.24G9jTAM040481@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: c8dbee973e50 - stable/13 - dwmmc: Fix MMCCAM block size support List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c8dbee973e50d57f8814cce604267ef1e25929b1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652694330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9191A3xd3gtjVfxafQQjUv3UlYxjWk4dJgcrkdqIwmk=; b=HXZOTQA6DwaTDRRpMRZ3X0MH/F7heLA9SQdOED6hmLNeGhl8qQfL/RiHz5Iy2mDPkcilN3 kA5z08CRAMPFc3U+L7vBAabXcfsBBij5ujbx0SPKV+H3FNlUkAi4FnuBqAzQZq/jTJ01ar vN9hpyz+yjdSoRWaALcEkIvaHTQrxrKw1PlwMp0Z7+Dro5JZitx9L7DyWLBadE8bTzNjbw dudfzcvskfx9UiGTakNyw+2OKOyFSw4qQuxIYiHQeM/x+UEmbpzu3q6ouuUW3ds5siW4s8 3M9hZJnmF/T22WKCc6j3ihu+kx5JXwFV7T/NGF7xzin9KjMbbB/cXwrcbb+itw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652694330; a=rsa-sha256; cv=none; b=hxEz4ctgfPjSJz7o3WNPe+We8VR8iegTr2nr0E/aIWZDLy7VX2jylFZuB+yZLhDgRYMw4E xVxntGME47mJzLiWgEfMwTnttrfOMzwj+wncA4XJ0jj/vYRA8ktpCmn5LYfw1GrwCAee9c 7D/IAklwctz+xiDRLcfqSYLRfWg0D/HqTlS1D2xf5Yn6GgJc/shmDLMBhhoJ/ik3PW2wNh vtxOjqCpv4sZpTzTBFwiWDNG3PFpdYDOqU9PWSMbgvbOMxD4IA9sk5UF9+D16wUG55iFZy 7b5tJ6CnP7mqIW3TZ5T7Nrxr/xwJ5JxraEZtmkCYE+Xm/T6NWvmfwbZuRCzp6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=c8dbee973e50d57f8814cce604267ef1e25929b1 commit c8dbee973e50d57f8814cce604267ef1e25929b1 Author: Emmanuel Vadot AuthorDate: 2021-07-14 15:25:05 +0000 Commit: Emmanuel Vadot CommitDate: 2022-05-16 09:33:41 +0000 dwmmc: Fix MMCCAM block size support When using SDIO the block size if per function and most of the time not equal to MMC_SECTOR_SIZE, fix sdio on dwmmc by setting the correct block size in the mmc registers. MFC after: 1 month Sponsored by: Diablotin Systems (cherry picked from commit 990a1dbf6fe1a9f4dc491d3e4e276034919b94f3) --- sys/dev/mmc/host/dwmmc.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c index f0cd8c1b4378..9910db2e50cb 100644 --- a/sys/dev/mmc/host/dwmmc.c +++ b/sys/dev/mmc/host/dwmmc.c @@ -1162,10 +1162,18 @@ dwmmc_start_cmd(struct dwmmc_softc *sc, struct mmc_command *cmd) cmdr |= SDMMC_CMD_DATA_WRITE; WRITE4(sc, SDMMC_TMOUT, 0xffffffff); - WRITE4(sc, SDMMC_BYTCNT, data->len); - blksz = (data->len < MMC_SECTOR_SIZE) ? \ - data->len : MMC_SECTOR_SIZE; - WRITE4(sc, SDMMC_BLKSIZ, blksz); +#ifdef MMCCAM + if (cmd->data->flags & MMC_DATA_BLOCK_SIZE) { + WRITE4(sc, SDMMC_BLKSIZ, cmd->data->block_size); + WRITE4(sc, SDMMC_BYTCNT, cmd->data->len); + } else +#endif + { + WRITE4(sc, SDMMC_BYTCNT, data->len); + blksz = (data->len < MMC_SECTOR_SIZE) ? \ + data->len : MMC_SECTOR_SIZE; + WRITE4(sc, SDMMC_BLKSIZ, blksz); + } if (sc->use_pio) { pio_prepare(sc, cmd);