From patchwork Fri Oct 21 07:30:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenchao Chen X-Patchwork-Id: 6543 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp545993wrr; Fri, 21 Oct 2022 00:38:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5vzQmttnd9ciMHTUkbt21EJNirxq1VdCA3eLzaq5oGDMigW1cMjakBCOy6eGWpMHr2bdVY X-Received: by 2002:a63:43c2:0:b0:46a:eec8:9430 with SMTP id q185-20020a6343c2000000b0046aeec89430mr15088998pga.6.1666337928782; Fri, 21 Oct 2022 00:38:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666337928; cv=none; d=google.com; s=arc-20160816; b=jLLsJjDLHf/9WwdPIpGMgyopMOeknWUWMi744tlfrHwid3sWeRJUwSV0aVWQvd4uPN ZUJsL6pcT5jgihpkpINXKQKTocSjFtJ0WVm+abqjTzO07tiIsehRa7omGjHcRJ8+Dl00 cf8FfOETICqyDca6VdPN9aPNrDNU8Y3RGlRYTO6Zb2fdE+FmYKNP9h8HKcxGZ7m0t4QS MFIA6jb8dwWtlHY9F2zSvwtNN19j/Rp5FvlQwyI2E97mtesgGC0NQzKB9jKNrWiBsp3W yo7jUUXqUtSY3AmZMwrm6/+iR63dRiOd7uQAt9pdxQ3+Dp8Mwxiu0Hw+vC4tCBOXPuW+ PAIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=cA0JuBcMGJcSgHH3GujJWpGTkEiW9E55Zi7SMvV9234=; b=jACfAorK8OaHyB0b6BUYKdOtDWjuSg+Y/vlA/Fcd0ZTH2r3FJR+kvYOfLUF6+HM68R 4y2PKKY408iu/Qh9B2Pex/gKlMkte0Gqrc0aVXx7oCJyAVokb0lH1fGjw86tvZxOrIKQ KTRbKiwdE/2Jtrx7dOssN7WyOlW3NBG75iRg3Y28/z0EWcN4A4jC+qi18vG+zlBcFYDK VhtazZgP3GPM+KKuY7GFb2QUYBGqXkI9OluFY2O+pHLoeHWYxGiiC1cfWmC7WtLwUJfI TStuJf/mMyM2EMkEyNeCqVoa3xEU50wBwNsUNcZypSK81Lx48N4W3UeT93+WFDwiMAB7 kxxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BrnObNRK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q12-20020a170902b10c00b00180f5fde747si21581084plr.454.2022.10.21.00.38.36; Fri, 21 Oct 2022 00:38:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BrnObNRK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230144AbiJUHa7 (ORCPT + 99 others); Fri, 21 Oct 2022 03:30:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230006AbiJUHau (ORCPT ); Fri, 21 Oct 2022 03:30:50 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1AAA21F951; Fri, 21 Oct 2022 00:30:48 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id h185so1811099pgc.10; Fri, 21 Oct 2022 00:30:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=cA0JuBcMGJcSgHH3GujJWpGTkEiW9E55Zi7SMvV9234=; b=BrnObNRKZwd5rs7Sf1T5Z9/GYg8E7MKhCX0cAkPgwS0B9xXxV9ogNGpbnXH9GAAOv5 qOyIY4ftukfxVxFpqdhzSs5/AsifL4MQHumR9rsmlT72Y/YVP/tFPsZiPqisP9LOufwg jd7rLv907DZwWH59Qbh60LBwiKhg3VahjohIuUsHe1kwy4DnMoeEgNqGYrmkuBnGUjxm vcXVaS1JomPEg4Yfflch7v2j1NYRcDHdE/NTnopEGO/t5GnF6yHRwfLKO5Cg0A/Pfj9R 0loMmhSmFdc8yc51IKpUqroGqP1Uv5Ckn6iL/h9SpbSdoYjAPw4ns1qt6nm2UKBptiV1 T1Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=cA0JuBcMGJcSgHH3GujJWpGTkEiW9E55Zi7SMvV9234=; b=3k/MwSl6UxplqGaA7z+GYPMkRq3HBp4Jj5AIFJky5/mLISIpoNGaW0CaVsuiNc+89q Mck47aao4EqdhbXdzzyy240GzRjdRqdn74cIHdwY6i0sCqxo27fjjoKRH16NCf1GnZIl dEAVjkP/5hNVTQGgcKC9vVdq3Ter6ol4CgTy0VaSP23P7BPV+5DFGNc2msgrDE7sTJY2 Y6Wjd3LXo9P5N6zvglHHSL9nzRzHYfL9x3DIwdfstb+5H2Q2SydpBofh0uEtv/aZK3tB 70Hzt5/ItWlh94GT1QId1u6Xj0j8zRIA21l8E8kRpbymG3vg8Bpm4W+ZrQUWHuXBRjAJ Qxtg== X-Gm-Message-State: ACrzQf1R9IrqquujmDcD8JPngp9HXT3s7mrjjA0mAn6n9BbDhRZP6leh zckd9Res/eaaX1D9DQEXLeE= X-Received: by 2002:a62:1dcc:0:b0:567:6e2c:4810 with SMTP id d195-20020a621dcc000000b005676e2c4810mr14416183pfd.44.1666337448421; Fri, 21 Oct 2022 00:30:48 -0700 (PDT) Received: from xm06403pcu.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id d4-20020a62f804000000b005628a30a500sm14531929pfh.41.2022.10.21.00.30.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 00:30:48 -0700 (PDT) From: Wenchao Chen To: ulf.hansson@linaro.org, adrian.hunter@intel.com, orsonzhai@gmail.com, baolin.wang@linux.alibaba.com, zhang.lyra@gmail.com, axboe@kernel.dk, avri.altman@wdc.com, kch@nvidia.com Cc: CLoehle@hyperstone.com, vincent.whitchurch@axis.com, bigeasy@linutronix.de, s.shtylyov@omp.ru, michael@allwinnertech.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, megoo.tang@gmail.com, lzx.stg@gmail.com Subject: [PATCH V2 1/2] mmc: block: Support Host to control FUA Date: Fri, 21 Oct 2022 15:30:24 +0800 Message-Id: <20221021073025.18831-2-wenchao.chen666@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221021073025.18831-1-wenchao.chen666@gmail.com> References: <20221021073025.18831-1-wenchao.chen666@gmail.com> X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747281948324336918?= X-GMAIL-MSGID: =?utf-8?q?1747281960264695744?= From: Wenchao Chen This patch introduces host->fua_disable for MMC host controller. The host can turn off FUA to improve performance. Signed-off-by: Wenchao Chen --- V1 -> V2 Address Chaitanyak's suggestions Address Avri's suggestions --- drivers/mmc/core/block.c | 3 ++- include/linux/mmc/host.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 54cd009aee50..333e819e077a 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -2490,7 +2490,8 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, ((card->ext_csd.rel_param & EXT_CSD_WR_REL_PARAM_EN) || card->ext_csd.rel_sectors)) { md->flags |= MMC_BLK_REL_WR; - fua_enabled = true; + if (!card->host->fua_disable) + fua_enabled = true; cache_enabled = true; } if (mmc_cache_enabled(card->host)) diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 8fdd3cf971a3..16a5bee3eeae 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -517,6 +517,9 @@ struct mmc_host { struct blk_crypto_profile crypto_profile; #endif + /* Host FUA support */ + bool fua_disable; + /* Host Software Queue support */ bool hsq_enabled; From patchwork Fri Oct 21 07:30:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenchao Chen X-Patchwork-Id: 6546 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp546530wrr; Fri, 21 Oct 2022 00:40:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM49j89e/FIHXpRXJxpf0z5oDHM0OeM2ioJcvKBNlHCjxeGIjKtmtPGM5P0ksYQ+G/Od1ILQ X-Received: by 2002:a17:90a:e7c8:b0:20d:6c60:c38 with SMTP id kb8-20020a17090ae7c800b0020d6c600c38mr20845690pjb.26.1666337999621; Fri, 21 Oct 2022 00:39:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666337999; cv=none; d=google.com; s=arc-20160816; b=smBtYGGu0S+xIaEZqyZM6vHozYL3dEKFqg+jiAcCZP7iosSBByM9ASsslmLqJHLOd0 9gG4u8Vm/fe8xLuJF/ZAahAQEApj0AhPXxnCAOviJ6K2ImIDfOKH5ukYzOJBPJpvn3Cw EM+JI2SGh2gYmzXuGb2FhO+v26L23UuaaRPkTBWec3iZkLvPLeLyn3Dv08ofdywud613 0uxLJ6KiitxAX2TRNq26n+C6FZqWA0VVL5VuQwz0sSf4qgggpoOiNhuLQc/mlkouJ1zA nj8oFWiC7B5WWeQ8gQI4xglwnreznHFDymQLRxSH8UZEO9Nm1I/wgrkbn53V2zzxMoK7 br0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=TejV+PVlIWu1ZS6SsOoMljpzVPK//ltlKzLgsPTI8ds=; b=vo8ZNhjDYUszpFxsIMr/22rAfEdPx8f31qc/d4S1ML0Hy+G7ibWVXxfybTKfDpW29R RpcgrrN+CmaC84LgWfCBbkBqwxh4Pbl03xYuVFV3M7odd/0MaOPjbnhyw1tjmxVUCSkG Spm6TasdZyOkcMSmpC3AgWAiR3I3dQySkYvi3RI00sJwMPSZAJqPk61i7U8vf70BnJD+ OxGxYNB7GcyJsVmNcU0kG18+VqA7Rg5oQEWGH6I4Ikd1lJoaVPl1MSbq5DlmhTv7Uagu A6QoNG9Cd+1OfjjOCTnBuhp4O9TTgPC2uWXe5AQoLOJRCND0Ld0aJocYTJryOGmSG/Z9 jWIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="f2bTAw8/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m4-20020a6545c4000000b0043c00d4d5a3si25919050pgr.93.2022.10.21.00.39.47; Fri, 21 Oct 2022 00:39:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="f2bTAw8/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230143AbiJUHbG (ORCPT + 99 others); Fri, 21 Oct 2022 03:31:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230039AbiJUHa5 (ORCPT ); Fri, 21 Oct 2022 03:30:57 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C506F239207; Fri, 21 Oct 2022 00:30:54 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id fw14so1691991pjb.3; Fri, 21 Oct 2022 00:30:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=TejV+PVlIWu1ZS6SsOoMljpzVPK//ltlKzLgsPTI8ds=; b=f2bTAw8/XqEr3YOFLjWtB9KLAKldY1acFLtSCfPGG5OoGIkd2H6iJDjE6APABzEF63 JGoDEzsExcrI5mWxDO2jg1vv88QvdfZBQ1Mh+Cz1mUffZLv2nnxMXcfbE1QY3lW2YZof /VgAXVBbrO6lAtRRmzjoARjZl5IpuCGiQkoJuOcTdkOgpQzgDf7ngZevFsBwpiJI/6wF +RlxPzcK0aYb81QyprVLHJDl+YxL239FzD80rrJ/Yg53rv6U6m7vM7rC3AkVk8XGo3OZ +6E1yPzjtkRH1F4zF9ve1B1mFQ05SJkzeG5/G6GYTT8hu5/DI5GlEDcMukDtTd2R+bsi jw9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=TejV+PVlIWu1ZS6SsOoMljpzVPK//ltlKzLgsPTI8ds=; b=MwEIQ12ZNiuszvoIcTqz7QLAf7KtOR8qWUrtaIe+oBPW5t/YZ/qvRoArcYhV5wqcy1 +Cn4i/agOsq0q/PJilrGSAfr8+6ew2CBwH/YeiRz3GGV7haDSAg0LUFKDDC33hdXW5PS 9CYVzzXYh4/vOi9lL0QeHOLjHwPSsB6Darm58YqljYS4n0EY7sd3W/5wcCy9SiJwyW+D /TdHYXFDvX4uod1hjzEKuKsFZx+rZB3QFAjHaWLrGawO6rfqI53bRVkcSvu+k9Z1Qaxh CxUysJ/ic/AYG74sq2s1PNNjXTooL7uDYQkVunp4Z/XtoMaJ1ElbSmjXltbtqG/Ocx6n 1mPA== X-Gm-Message-State: ACrzQf1PigBdE9Xr2XfpIocDVj1mPoF7O1g07w6wQ/lfgJ9KnpZTIr89 EBOrLWDcmF+kCryrlNPdGH4= X-Received: by 2002:a17:903:2442:b0:17f:8069:533a with SMTP id l2-20020a170903244200b0017f8069533amr17709846pls.46.1666337454271; Fri, 21 Oct 2022 00:30:54 -0700 (PDT) Received: from xm06403pcu.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id d4-20020a62f804000000b005628a30a500sm14531929pfh.41.2022.10.21.00.30.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 00:30:54 -0700 (PDT) From: Wenchao Chen To: ulf.hansson@linaro.org, adrian.hunter@intel.com, orsonzhai@gmail.com, baolin.wang@linux.alibaba.com, zhang.lyra@gmail.com, axboe@kernel.dk, avri.altman@wdc.com, kch@nvidia.com Cc: CLoehle@hyperstone.com, vincent.whitchurch@axis.com, bigeasy@linutronix.de, s.shtylyov@omp.ru, michael@allwinnertech.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, megoo.tang@gmail.com, lzx.stg@gmail.com Subject: [PATCH V2 2/2] mmc: sdhci-sprd: enable fua_disable for SPRDSDHCI Date: Fri, 21 Oct 2022 15:30:25 +0800 Message-Id: <20221021073025.18831-3-wenchao.chen666@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221021073025.18831-1-wenchao.chen666@gmail.com> References: <20221021073025.18831-1-wenchao.chen666@gmail.com> X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747282034534071284?= X-GMAIL-MSGID: =?utf-8?q?1747282034534071284?= From: Wenchao Chen Enable fua_disable in sdhci_sprd_probe. Signed-off-by: Wenchao Chen --- drivers/mmc/host/sdhci-sprd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c index b92a408f138d..d426624196f4 100644 --- a/drivers/mmc/host/sdhci-sprd.c +++ b/drivers/mmc/host/sdhci-sprd.c @@ -586,6 +586,8 @@ static int sdhci_sprd_probe(struct platform_device *pdev) host->mmc->caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_WAIT_WHILE_BUSY; + host->mmc->fua_disable = true; + ret = mmc_of_parse(host->mmc); if (ret) goto pltfm_free;