Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3547362pxj; Mon, 24 May 2021 09:06:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLTJGPBFKFOGdJ0djFLj6OjEyEb3HYMLx91FcpOq8CtDFWmGbQLXQNtWNOsRH8ZHe8xPe+ X-Received: by 2002:a05:6e02:2192:: with SMTP id j18mr17985993ila.223.1621872410827; Mon, 24 May 2021 09:06:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621872410; cv=none; d=google.com; s=arc-20160816; b=NRBPGEGzSiFhZyUL4YLrYlMdwPbBgUT8YKoXHdWVURg1MJmwBrEuqAvEEVtoalBEyB PF/UEGcE8iWdivu3Lpbygx0EPY2fxz70sEyYfkILxwKZNOO1tDwnxOyyWTWSbpy/Vd4N jMppV6vd0n/qTuvB8X6SnX5IapuCCtniTSSs4m3u2r9JOteHKlyR+pV65FrPec3gYn9A 6RvafU+kCUHSTSkwMEBmISLyGsmsJGKdFyhzsddjzSjtgMB7bLxavB5SK2jyyBOBY/Oi PVF9QeAe6/1eEH3HXUrWmUsnAs3MAPcDDraCHWLuoXBwyi7batPXdVgeFn4SD55aJdwu 0BqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OG41dNEBjpMNOFKe6+Fqy1tyOBs/oijLOB1pm8nAk0o=; b=PDwlCOngB913WpngJe7Ra4lcUb3MQxQHliHxDcHzqQGxfJQSTV4mx+TIb0AcG99FQL 178aJ5Z2o9eHLzewysl8i/W9UixNwlmfFUz5+boxIzTLkus3nx7BXIVAa+z9yASnjj5y IZFQ3/Ul4sCxJCiF9x6qMxakdCxX+wbpMn0VR1R5DjmR0AvW8/4uELstJ/SzYj4cGyOl ustIW/ojObaFbFpy3Y0g88YvYM6YX0Ef9UqLxfqfKAbknCIIxXQpRaeWc5dHpddZjGnp +Ev2L91I3Kz4cirfvH+89jMKdl0/UIYwNQ1cSijad/yiS1XwMlmal3ppVwD1il3NgOL2 BHag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="m/f8wWn8"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y7si15069004ill.0.2021.05.24.09.06.28; Mon, 24 May 2021 09:06:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="m/f8wWn8"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236175AbhEXQGc (ORCPT + 99 others); Mon, 24 May 2021 12:06:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:41136 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234086AbhEXP7i (ORCPT ); Mon, 24 May 2021 11:59:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7E1D761977; Mon, 24 May 2021 15:45:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621871128; bh=ixhFpQz0nlCLsTx+AGp7ZLRmJh2P0VlBJgxy83FfUmE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m/f8wWn8P4/UEkgDd19ivg9+KKbBx67TOqsYPbX8i4jYgEMgt0ZzZMdIoX1PdOEX0 Tl8MdCer+7Kxr2CoujD2/YmpNw0Iq/6E3Qbap54Db8RfT2euUqljE0tykvvEo5/Z8g L/dSANEgwKmlTjwdB0P61yS/Arxn72trxjWwku7A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christian Hewitt , Neil Armstrong , Ulf Hansson Subject: [PATCH 5.12 086/127] mmc: meson-gx: also check SD_IO_RW_EXTENDED for scatterlist size alignment Date: Mon, 24 May 2021 17:26:43 +0200 Message-Id: <20210524152337.767670885@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152334.857620285@linuxfoundation.org> References: <20210524152334.857620285@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Neil Armstrong commit 9b81354d7ebc1fd17f666a168dcabf27dae290bd upstream. The brcmfmac driver can generate a scatterlist from a skb with each packets not aligned to the block size. This is not supported by the Amlogic Descriptor dma engine where each descriptor must match a multiple of the block size. The sg list is valid, since the sum of the sg buffers is a multiple of the block size, but we must discard those when in SD_IO_RW_EXTENDED mode since SDIO block mode can be used under the hood even with data->blocks == 1. Those transfers are very rare, thus can be replaced by a bounce buffer without real performance loss. Fixes: 7412dee9f1fd ("mmc: meson-gx: replace WARN_ONCE with dev_warn_once about scatterlist size alignment in block mode") Cc: stable@vger.kernel.org Reported-by: Christian Hewitt Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20210426175559.3110575-2-narmstrong@baylibre.com Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/meson-gx-mmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -236,7 +236,8 @@ static void meson_mmc_get_transfer_mode( if (host->dram_access_quirk) return; - if (data->blocks > 1) { + /* SD_IO_RW_EXTENDED (CMD53) can also use block mode under the hood */ + if (data->blocks > 1 || mrq->cmd->opcode == SD_IO_RW_EXTENDED) { /* * In block mode DMA descriptor format, "length" field indicates * number of blocks and there is no way to pass DMA size that