From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B1D9C10F03 for ; Mon, 4 Mar 2019 08:42:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4D94F20823 for ; Mon, 4 Mar 2019 08:42:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551688942; bh=TcKecyf0YLCADO4ZwIY8hejKSksXT01V7tceF/PICwM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ELZJ1TCDi5EyZdv9JJQ1RSVDDI93Q6OT5B3KvfB+zleZ1GCJCjkCggP6JZ5v8Y3q5 nlZ7jauxrDHmDiPRMz36CmkFV+1G62BRRGvl9lR6CMT93ju1cv04KHgY8vm5HrFAa8 uKXFM0XzVVl2kN8lXyLvOD00Wv5Ct7Z7lrrHKIZE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726694AbfCDIbF (ORCPT ); Mon, 4 Mar 2019 03:31:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:60406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726485AbfCDIbE (ORCPT ); Mon, 4 Mar 2019 03:31:04 -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 C03E020836; Mon, 4 Mar 2019 08:31:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551688263; bh=TcKecyf0YLCADO4ZwIY8hejKSksXT01V7tceF/PICwM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h44gwcjPiNW7CSBYWNd3ujyjH9gUMJNy0YvDRFPus5tv+YrTTawW8bpx1HKaqUX8a bxhbbfWXC2H3XQGJoE5fr20zhqNz/k8c9DRYl5156e5UQtD3zjtAOYzQBAdi2r3TQW RD+VA/w3wF8AgSE9DLfuwWlOFQT06wANG2ODwQGg= 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.19 69/78] mmc: cqhci: fix space allocated for transfer descriptor Date: Mon, 4 Mar 2019 09:22:52 +0100 Message-Id: <20190304081628.676968683@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190304081625.508788074@linuxfoundation.org> References: <20190304081625.508788074@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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 4.19-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,