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=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham 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 5C65AC43381 for ; Wed, 27 Feb 2019 13:35:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 288182133D for ; Wed, 27 Feb 2019 13:35:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730295AbfB0Nfq (ORCPT ); Wed, 27 Feb 2019 08:35:46 -0500 Received: from mga12.intel.com ([192.55.52.136]:4242 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730073AbfB0Nfq (ORCPT ); Wed, 27 Feb 2019 08:35:46 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Feb 2019 05:35:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,419,1544515200"; d="scan'208";a="127644991" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.56]) ([10.237.72.56]) by fmsmga008.fm.intel.com with ESMTP; 27 Feb 2019 05:35:43 -0800 Subject: Re: [PATCH v2 1/2] mmc: cqhci: fix space allocated for transfer descriptor To: Alamy Liu , Asutosh Das , Ritesh Harjani , Ulf Hansson Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20190225192214.3881-1-alamy.liu@gmail.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <0a656a92-9652-d0f7-05ad-18f849efae4e@intel.com> Date: Wed, 27 Feb 2019 15:34:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <20190225192214.3881-1-alamy.liu@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On 25/02/19 9:22 PM, Alamy Liu wrote: > 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 > --- > drivers/mmc/host/cqhci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/cqhci.c b/drivers/mmc/host/cqhci.c > index 4cc7863c13..974997b6cb 100644 > --- a/drivers/mmc/host/cqhci.c > +++ b/drivers/mmc/host/cqhci.c > @@ -202,7 +202,7 @@ static int cqhci_host_alloc_tdl(struct cqhci_host *cq_host) > 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, >