Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2279304imb; Mon, 4 Mar 2019 00:36:26 -0800 (PST) X-Google-Smtp-Source: APXvYqz1+IZeGghIP4rzSM4gbeFZp0fNX/esGseVgw0yZuK3r2RF2AmCRTaJZ/Sne0QO98sDJWTF X-Received: by 2002:a63:c70c:: with SMTP id n12mr17812654pgg.302.1551688586373; Mon, 04 Mar 2019 00:36:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551688586; cv=none; d=google.com; s=arc-20160816; b=CnIA13ZfPEU1K/Pa98L3H4xeh9y2wMJ9+Ysn6K3uokoGsRGWVMiVItPo7oO1g6ILvk ieloAMlXsaVp07bkM6aWbilW6PyhdmUa7wzTwYO/bc129qc5dVxQl538ONKvfHUH89xY vposYTC7UJ8v/dPpc9zH2oNZjAJP6lTWuDah8IN5lsnbfmSrtSzobAx3R/NjOhanenpq PtXtc16RrvOctY+0mYaI/7Z+TZmllBYweskKxT7XIoAUAIRoL4WwL4Nkl9WG/hMj/eKD b6OVmmVZ6LVq16jBhKygwfR5fpiQu2EnN5p3pNhOC+rmeATsaIgAwUX64qzitBI1WdJo D/YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VAw+OFPfhPMjdlm5Ck+2Q6fRHy84slXvtwtayloWE9I=; b=hPUK2P4FHaREfKgySBQ+GOlJYyw8eQNHClsLIuSV9OplCqMAbGuGrPOV+wm2uQwBR3 ipuJ5VXaCofey1mKUj5iSh7n5JCu8fyfsYbS79ZR88lL6ma7KnVnalQNJ9T2oEtaxs8I w8WwLKj7i+DEiGc9hQzvSPQhg8Cc/1zodohV0UkkCepHZ1h5t3vvNNy9SA1Nc+4kFTqe BOTOE/Ntr/2E83iqqmFd14QkeXkNpPSmmlu00ELdC4wkV6Vc4g3WixcvkJQ6ZJCLpqPN bavVlYMylvdKISZSGOoGfAqKvWfg3q0Q4rWz4Ro1Gq7ioNppHXBI0H81lejjnrLeokdj xd6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fNIBqgox; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si4661530pgo.394.2019.03.04.00.36.11; Mon, 04 Mar 2019 00:36:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fNIBqgox; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728453AbfCDIfb (ORCPT + 99 others); Mon, 4 Mar 2019 03:35:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:43512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728444AbfCDIf1 (ORCPT ); Mon, 4 Mar 2019 03:35:27 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E825520823; Mon, 4 Mar 2019 08:35:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551688526; bh=AltHwL9KrtZgBxdswZki4EFiidAdFtNyXhWJnWMUkQQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fNIBqgoxW0AgKHejXg+vzORgxeMoozEBo8rtf2tJa4BUCOon1SMUAxaIoOQCH+qKO mY6mD1psoX8tgxI5olx08xhCaWkK79TPNtkBu7cMS7Nviq9GYqN5C0uxzBYce6oOcy ViAB9W6rh9WBgDQqo7Em6du3J7B0347SIcQ5q5vU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alamy Liu , Adrian Hunter , Ulf Hansson Subject: [PATCH 4.20 72/88] mmc: cqhci: fix space allocated for transfer descriptor Date: Mon, 4 Mar 2019 09:22:55 +0100 Message-Id: <20190304081633.471803653@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190304081630.610632175@linuxfoundation.org> References: <20190304081630.610632175@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alamy Liu commit 27ec9dc17c48ea2e642ccb90b4ebf7fd47468911 upstream. There is not enough space being allocated when DCMD is disabled. CQE_DCMD is not necessary to be enabled when CQE is enabled. (Software could halt CQE to send command) In the case that CQE_DCMD is not enabled, it still needs to allocate space for data transfer. For instance: CQE_DCMD is enabled: 31 slots space (one slot used by DCMD) CQE_DCMD is disabled: 32 slots space Fixes: a4080225f51d ("mmc: cqhci: support for command queue enabled host") Signed-off-by: Alamy Liu Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/cqhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/mmc/host/cqhci.c +++ b/drivers/mmc/host/cqhci.c @@ -201,7 +201,7 @@ static int cqhci_host_alloc_tdl(struct c cq_host->desc_size = cq_host->slot_sz * cq_host->num_slots; cq_host->data_size = cq_host->trans_desc_len * cq_host->mmc->max_segs * - (cq_host->num_slots - 1); + cq_host->mmc->cqe_qdepth; pr_debug("%s: cqhci: desc_size: %zu data_sz: %zu slot-sz: %d\n", mmc_hostname(cq_host->mmc), cq_host->desc_size, cq_host->data_size,