Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7298963rdb; Wed, 3 Jan 2024 10:53:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IEN8tPb7cpqtnPUE7oHGuS9pfYyVjKhRw++JWkxNPHiYlikWMg41lOoMmn6ARNwYmGjsDnE X-Received: by 2002:a05:6a20:7594:b0:195:c518:4aa8 with SMTP id n20-20020a056a20759400b00195c5184aa8mr5056781pze.16.1704308006737; Wed, 03 Jan 2024 10:53:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704308006; cv=none; d=google.com; s=arc-20160816; b=OiDWuwam/Dbu06Tu3om6uO6dXR1nQwJLMkz3msvwuLtns5JbIN/rmA4Usga7S0hLjG hUlRy6NymJkx1uriRcA7wLNFXxJ/gXniCLkdaWbxxEc6PAkEXJluM3KwVabu4h4oAkRd 2DB7NS771sZvgG8r6kBAWv64fm0Xv4lvgXTs46pTeilU+Rq6qqsm4T66Y6qeg/1abj2i Dv2nU2NZTtyr6BBU4sp2Kdh2vw9GCqh7eJktda5nPORvo9E8SsnL6HZsPz7YjxdX9DMK /X9tuBJvwHwS6mAq8rGb7mbQRNzsnK+t59cu284ZGWzgS0tLC8GhY7oavdhwgBcZ5wBF mh0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=2ppMYkZL0j9uejy2jRkOiz5liLYSGGMzUqbddC00HMg=; fh=zzsAgmN7Er+rBjSLLevSvjBWlDFRAQfT8mNT4FS+YZU=; b=kt2QcORoQfpzkvlmSJ6Iarm1xk20aJSs/eozoplwshd1YC5/eyvNVdEIdQHewD2NTM byW2pkwl+oP46llZYmizZcasr9pUNZ0GYGnC+2nYR99klQRGMT3+pcSUx+yDauaXC4+x VIk9MWgFSabDWFlDy3OSsOHwpik4Zfr0VNfPDMnUg6Tcnd9rbJ1IUd+O2HuuGx6vg4Fe imn7zvaX+f/SPLLWMNBZHVfaAhNomdgiBsb1sV5Zyn71lM0gSauiMqDL9F4R9YGvsbFC W7/ghPnKnQfDiT5Eided0ESM+u04o/Un0mMuwB/iRrE0ACwNerFpKPzxNxeM7qfEH+Mw RB7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=A5AV5lBO; spf=pass (google.com: domain of linux-kernel+bounces-15889-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15889-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id z64-20020a636543000000b005cdbf27fdd1si21976164pgb.684.2024.01.03.10.53.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 10:53:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15889-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=A5AV5lBO; spf=pass (google.com: domain of linux-kernel+bounces-15889-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15889-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7D792B23917 for ; Wed, 3 Jan 2024 18:53:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B15071CAB3; Wed, 3 Jan 2024 18:53:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="A5AV5lBO" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 192171CAA9; Wed, 3 Jan 2024 18:53:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704307985; x=1735843985; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=xb3JCgo4iqLo11WVKyNpxqIH6S3YvPj930p7OczgVDQ=; b=A5AV5lBOPtJz9CJDlOM8YOrjz9tDuH74rPYZC/bVlGYnxkxSkwuX8auP Df2s0r2N30eXOj7q3oTuoq2gbFCdSPk86y37/q8OyNVA9JVeSuvm8NEFl 7idoUXe/oHNSq0Qy6rxdEjPtD2LV4CPWuxZDcJqpepM5IFfbjqrF2dSBY 52MQhTGGO/gSyHVxjm3w3vzg3i3xsTHi/DuWI6RJA9vyXwB6KSbokppy3 D9i7YJCpIKoFz7zon9xBaChf0vAiGOzuJGyPX0co44qdmNre+S4c17EY+ CI1/FCCkswzlfPiCOXmBfI5THugfljFoCRYEo55wfHc1Ybw6YaM6gAZ6s A==; X-IronPort-AV: E=McAfee;i="6600,9927,10942"; a="382009519" X-IronPort-AV: E=Sophos;i="6.04,328,1695711600"; d="scan'208";a="382009519" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2024 10:53:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10942"; a="850508459" X-IronPort-AV: E=Sophos;i="6.04,328,1695711600"; d="scan'208";a="850508459" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.51.162]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2024 10:53:01 -0800 Message-ID: Date: Wed, 3 Jan 2024 20:52:58 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 1/2] mmc: cqhci: Add cqhci set_tran_desc() callback Content-Language: en-US To: Sergey Khimich , linux-mmc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Ulf Hansson , Shawn Lin , Jyan Chou References: <20231231144619.758290-1-serghox@gmail.com> <20231231144619.758290-2-serghox@gmail.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <20231231144619.758290-2-serghox@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 31/12/23 16:46, Sergey Khimich wrote: > From: Sergey Khimich > > There are could be specific limitations for some mmc > controllers for setting cqhci transfer descriptors. > So add callback to allow implement driver specific function. > > Signed-off-by: Sergey Khimich > --- > drivers/mmc/host/cqhci-core.c | 10 +++++++--- > drivers/mmc/host/cqhci.h | 5 +++++ > 2 files changed, 12 insertions(+), 3 deletions(-) > > diff --git a/drivers/mmc/host/cqhci-core.c b/drivers/mmc/host/cqhci-core.c > index 41e94cd14109..d12870b124cc 100644 > --- a/drivers/mmc/host/cqhci-core.c > +++ b/drivers/mmc/host/cqhci-core.c > @@ -474,8 +474,8 @@ static int cqhci_dma_map(struct mmc_host *host, struct mmc_request *mrq) > return sg_count; > } > > -static void cqhci_set_tran_desc(u8 *desc, dma_addr_t addr, int len, bool end, > - bool dma64) > +void cqhci_set_tran_desc(u8 *desc, dma_addr_t addr, int len, bool end, Needs to be exported also i.e. EXPORT_SYMBOL(cqhci_set_tran_desc); > + bool dma64) > { > __le32 *attr = (__le32 __force *)desc; > > @@ -522,7 +522,11 @@ static int cqhci_prep_tran_desc(struct mmc_request *mrq, > > if ((i+1) == sg_count) > end = true; > - cqhci_set_tran_desc(desc, addr, len, end, dma64); > + if (cq_host->ops->set_tran_desc) > + cq_host->ops->set_tran_desc(cq_host, &desc, addr, len, end, dma64); > + else > + cqhci_set_tran_desc(desc, addr, len, end, dma64); > + > desc += cq_host->trans_desc_len; > } > > diff --git a/drivers/mmc/host/cqhci.h b/drivers/mmc/host/cqhci.h > index 1a12e40a02e6..703d5af6c49e 100644 > --- a/drivers/mmc/host/cqhci.h > +++ b/drivers/mmc/host/cqhci.h > @@ -217,6 +217,7 @@ struct cqhci_host_ops; > struct mmc_host; > struct mmc_request; > struct cqhci_slot; > +struct mmc_data; Not used > > struct cqhci_host { > const struct cqhci_host_ops *ops; > @@ -293,6 +294,9 @@ struct cqhci_host_ops { > int (*program_key)(struct cqhci_host *cq_host, > const union cqhci_crypto_cfg_entry *cfg, int slot); > #endif > + void (*set_tran_desc)(struct cqhci_host *cq_host, u8 **desc, > + dma_addr_t addr, int len, bool end, bool dma64); > + > }; > > static inline void cqhci_writel(struct cqhci_host *host, u32 val, int reg) > @@ -318,6 +322,7 @@ irqreturn_t cqhci_irq(struct mmc_host *mmc, u32 intmask, int cmd_error, > int cqhci_init(struct cqhci_host *cq_host, struct mmc_host *mmc, bool dma64); > struct cqhci_host *cqhci_pltfm_init(struct platform_device *pdev); > int cqhci_deactivate(struct mmc_host *mmc); > +void cqhci_set_tran_desc(u8 *desc, dma_addr_t addr, int len, bool end, bool dma64); > static inline int cqhci_suspend(struct mmc_host *mmc) > { > return cqhci_deactivate(mmc);