Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp813751lqt; Tue, 19 Mar 2024 04:59:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUwu8RDO5vts4TNFg0I58frGE6TGyqqN3qzpH2586OAf8Pl2P3dGqpEVXFtg/XjRchNtHzUx9zPtwTnbE2OxXBQZS3OiLADRT8KdddsGg== X-Google-Smtp-Source: AGHT+IH6tm2w9rx3V0tMnt2pN1pfEMKt6AJabFYzyfl3Gf+9OIbVfPaeIleTeKeIJpS0dKiwvV+x X-Received: by 2002:a05:6359:4106:b0:17e:6aab:8f7c with SMTP id kh6-20020a056359410600b0017e6aab8f7cmr2392577rwc.20.1710849593523; Tue, 19 Mar 2024 04:59:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710849593; cv=pass; d=google.com; s=arc-20160816; b=Opm9pKy3seMlp+Jz28ZEjoQcdpx0G3y7/dtl1mhmxTyYvDCPJFgiDfVfS9CJiNQ1FB t9heXZ40T10IuTrLYYwBHldVi4/vdMRBeo1MjYm2f8fZJB2hYEEyVpU5VcpcU9tfCQSO CknG9svFMUESuKMAQBxfGL0t8Um7SegxvnEBEfw3d8oSlci+9fj/X4RwpSY3Dufr7sTl LjoPOmZaNt7cwKvejJs8YNfNQS/9vK812bbDBkT9c8Krx+RzD/Xv7U9WD2pRLaphY50W OzhwYnAkAUhPFWzcfMC+MCgxr8MhebT+w8asgNKCItv+MrxGRIhcjzy7SDp1TxHmMp7Y BN4Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=RI1qGz8CIIXyUXChOvLqXgzJKN1FSHM3UtHTCtJhJhY=; fh=9Kph9NkySA9uWT/3PzQFEg4JYJuZ5w/Bh4wOzi48Zyc=; b=XphxcJmMZ3ut7Gtlelj+gAFkZzwpMaJcvOnj/EiabLlAe6U7lHHYy6Q0DLEKb+J8OQ mDZwVKxwmd1tRX3gDrfXh9ahaT2NUPlELzT44Q/NPTzEGe9ejwtUx3fzz5FDVFxBl8nz foSp2gHiTAeqgN1wRHut+zM+4qrvmwda4qNDbFfpnU7cOYSAiLPy4f6PZGZQT8wRvxpe EaVrnObKHyb/g9+Cp0oMVHfltNvYI/oTB26lo46TPka8KiUkoyBYs0774AMu9GMmOIW9 3C8+TixrQa+NenjufFlFyoqU1P7nT/w+kBKnsZhT/qrmdGnKxSLTsjAlEjE3FeGoFImS O88g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=AxyahYLK; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-107489-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107489-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id b11-20020a63eb4b000000b005dcae4c1ff8si10322910pgk.131.2024.03.19.04.59.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 04:59:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-107489-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=AxyahYLK; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-107489-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107489-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8D49B283D7F for ; Tue, 19 Mar 2024 11:59:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 40A197F7C4; Tue, 19 Mar 2024 11:59:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AxyahYLK" Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A2B017F478; Tue, 19 Mar 2024 11:59:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710849579; cv=none; b=uy+ZUTirlkEs1NdBEjouSBDyhYCiMZ3AvgCgtfc8YG9qLaH68CObL+J4HQhqc62ftpVTYSr7u7SbX/rJLMC/6O2yTU6Hk5YtIeuaGo0aQ5GPZtr1oqr3rnZduPvW3YmxoTj8o77oaxSIaY4x55Lf4VFvkTMTzaCUKoaqwzPEEjI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710849579; c=relaxed/simple; bh=eZ7+YWRuTJS+M+Tbb32Zj+n4QjgQnXl0BfWwdXSaSiI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=eNaBHxTS0KCEjjgDUj7rm4Y12cB/bjcgbl/IVTY2fhe8ltuVG4p8hDtm7cXzW8WKQsDgKLY3MeaLRbqfiaaM6YSD23o4TwMypVSPPHrSiX61RJjIvsEWWE/cakSuisiQWJ+2CFWp2ZaTOJJ4J4xUbeNVF+B0OhTMdOF2HQuVCh0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AxyahYLK; arc=none smtp.client-ip=209.85.167.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-513da1c1f26so6266227e87.3; Tue, 19 Mar 2024 04:59:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710849575; x=1711454375; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RI1qGz8CIIXyUXChOvLqXgzJKN1FSHM3UtHTCtJhJhY=; b=AxyahYLKAxzqycXoKfcdfceihyDss5thPIWavMSTsOCZSLUWgVGkAP86VP5JxZI0LB 6FUr3SEtEYNuYwy0YHF6CJR2F8NVCqzUS+gvWWvDuAaiIQ0DkDDEMnCxCt9JeusV/DxE 2Vdkkws/b5UqtWzm+l8Wmi8OzfSqquGaK/ej1QqsQDd3UQEKFwMG0EdWsE1ZbcNG2RUc hPHIfGEG5WIcu++glYGfTQZa650OZL52QUoakVb/4V20v3ZM/oO3Tm8bIeMYN5J//C97 F+H3IhBYuLYewszKk3jVSu+AlhOKSwpEbVWPrmTPDSDlkdJMzwBe0B8e4yyZ7k056ZLS e+Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710849575; x=1711454375; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RI1qGz8CIIXyUXChOvLqXgzJKN1FSHM3UtHTCtJhJhY=; b=j+QGPsZo+HT8P1IiVZ3AfJQ+eSzo2lFSt+QmrHyk6F7i13wm9qGm+CXV7OAJoCeOAc Pvoolvr3fvM3MOKubhqRZlQH3FLrt+FxTtGM/qKLu2+GV+9aL8p74kzalkoqyJy5K0ug YoWy5GvBcz5X2u5RB4+l2sWJGJmN91JUc/Kd9mjYyV85gjX24a9YI1ELpam0U0/edeKo go1f0V/bJyVmSyg+djB5t/JgCO3EmrOh3eRz19JkJ53xiQ8Y9JebopkoXI3DGDEMxwqN /FqXGUmHl69jVXJ5tyZRrAgEy4dcfubtssd+uRcaS6ZMLn9fGqaqbN8/MKX3HGX1wVZv +Igg== X-Gm-Message-State: AOJu0Yz9u8PHhX0HGRkshRtRlmW7fDCipl9bbevs20SGpJ0ortR6YhIg 75q6XkEnsZQevDJh3v86uzWwaIwZQLWVZ4i7ZymdalsBLiUCCzTqgM9CYABuzu4= X-Received: by 2002:a19:8c55:0:b0:513:a1eb:c084 with SMTP id i21-20020a198c55000000b00513a1ebc084mr8865785lfj.7.1710849575314; Tue, 19 Mar 2024 04:59:35 -0700 (PDT) Received: from skhimich.dev.yadro.com (avpn01.yadro.com. [89.207.88.243]) by smtp.gmail.com with ESMTPSA id d11-20020a056512368b00b00513a53acdd4sm1915198lfs.104.2024.03.19.04.59.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 04:59:34 -0700 (PDT) From: Sergey Khimich To: linux-kernel@vger.kernel.org Cc: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter , Shawn Lin , Jyan Chou , Asutosh Das , Ritesh Harjani Subject: [PATCH v7 1/2] mmc: cqhci: Add cqhci set_tran_desc() callback Date: Tue, 19 Mar 2024 14:59:31 +0300 Message-Id: <20240319115932.4108904-2-serghox@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240319115932.4108904-1-serghox@gmail.com> References: <20240319115932.4108904-1-serghox@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 | 11 ++++++++--- drivers/mmc/host/cqhci.h | 4 ++++ 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..c14d7251d0bb 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, + bool dma64) { __le32 *attr = (__le32 __force *)desc; @@ -495,6 +495,7 @@ static void cqhci_set_tran_desc(u8 *desc, dma_addr_t addr, int len, bool end, dataddr[0] = cpu_to_le32(addr); } } +EXPORT_SYMBOL(cqhci_set_tran_desc); static int cqhci_prep_tran_desc(struct mmc_request *mrq, struct cqhci_host *cq_host, int tag) @@ -522,7 +523,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..fab9d74445ba 100644 --- a/drivers/mmc/host/cqhci.h +++ b/drivers/mmc/host/cqhci.h @@ -293,6 +293,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 +321,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); -- 2.30.2