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=-3.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 117C4C35656 for ; Fri, 21 Feb 2020 14:34:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D8E9C24650 for ; Fri, 21 Feb 2020 14:34:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="DUMUWH+o" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728781AbgBUOeL (ORCPT ); Fri, 21 Feb 2020 09:34:11 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:42561 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728392AbgBUOeL (ORCPT ); Fri, 21 Feb 2020 09:34:11 -0500 Received: by mail-lj1-f194.google.com with SMTP id d10so2387992ljl.9 for ; Fri, 21 Feb 2020 06:34:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qE1ZprvNAQZEaedKCgeg3ifr2lhMX5FFSbIkCacp4Kw=; b=DUMUWH+o5xdEn4HR/SntOIZf6pWK2WCRJo9GDytRJlf/wRrfthg3iixysSl789z7QV cWt75Jm8nDTe+v9ctDDtSdF0l5ln3hu7YnDUgIww04Q1jOLT3LlEJY5Np7xnnDm12q22 zMtcwL6aW4EdhmjVpuhoKoluw2mZk8ZlFiPs7NXZpmM1yCzC0wVB0BH1b3EG4rqRqa9C pYVGdEP1BZ1xifOB1yzVdKi9iSVyJh2LWc8OsI88wTr7ivb3LyFWFFC5WkJlQ9bnDKOI Tv60UO/1LRXTVVXr8nBzNDWO6d8+PQniSdcEiO/19AcFYSeICRQ7COilyc6YYMi1QnPa y2iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qE1ZprvNAQZEaedKCgeg3ifr2lhMX5FFSbIkCacp4Kw=; b=myVGpq67MwKBGi1FNmrJT3S9msxvXus6sZt2YWWM91ieQGGJF3Gzl3EOhBaADkx0rP wkgXWYnQdZK+QrqRHhnJr9nlk93Esqh+4inazNXh+/xuuKZLPIJET/EKpmd9npBvuFa8 69rcAO2b/fBVGFXJTilZFFDTBUmvSQxkMtmWjVJmbsb5ZXrraj2oWbjvrP8grZwwdWim 0OnTAD6lshSTqVJ0CAF7jGNs7Tou1ObGR2aBPpFzreTUyxJx1zAUu71UuOWu/Y49YC+c PZAMiIsW1o71zsYTzItv4oSV1zsdRICB4Xz+n4vAc2JTGoqCLDP+UxvUV9Kl4IZHtvbq MtHw== X-Gm-Message-State: APjAAAVsBeTuSpIp1I7DjxcQB43ue7UjUDkcqm7avsfI5g4qm1Ef46SV WgfUPc+4793OninhZL81+n4NSDfPxEQ+6KfeMDgy/w== X-Google-Smtp-Source: APXvYqw4oSVVlShPCelo7IGnTIlbPgsMGxvB5xli1PlMp8bLrG3RvR3Haq1OJ5idjUHugDKxC+iAjv/NG+M/2+LLAR0= X-Received: by 2002:a2e:81c3:: with SMTP id s3mr21749572ljg.168.1582295649418; Fri, 21 Feb 2020 06:34:09 -0800 (PST) MIME-Version: 1.0 References: <1581921111-24172-1-git-send-email-chun-hung.wu@mediatek.com> <1581921111-24172-2-git-send-email-chun-hung.wu@mediatek.com> In-Reply-To: <1581921111-24172-2-git-send-email-chun-hung.wu@mediatek.com> From: Linus Walleij Date: Fri, 21 Feb 2020 15:33:58 +0100 Message-ID: Subject: Re: [PATCH 1/4] [1/4] mmc: core: expose MMC_CAP2_CQE* to dt To: Chun-Hung Wu Cc: Chaotian Jing , Ulf Hansson , Rob Herring , Mark Rutland , Matthias Brugger , Pavel Machek , Kate Stewart , Greg Kroah-Hartman , Martin Blumenstingl , Pan Bian , Thomas Gleixner , Allison Randal , Mathieu Malaterre , Stanley Chu , Kuohong Wang , kernel-team@android.com, "linux-kernel@vger.kernel.org" , linux-mmc , "moderated list:ARM/Mediatek SoC support" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , wsd_upstream@mediatek.com, Linux ARM Content-Type: text/plain; charset="UTF-8" Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Mon, Feb 17, 2020 at 7:32 AM Chun-Hung Wu wrote: > Expose MMC_CAP2_CQE and MMC_CAP2_CQE_DCMD > to host->caps2 if > 1. "supports-cqe" is defined in dt and > 2. "disable-cqe-dcmd" is not defined in dt. > > --- > drivers/mmc/core/host.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c > index 105b7a7..efb0dbe 100644 > --- a/drivers/mmc/core/host.c > +++ b/drivers/mmc/core/host.c > @@ -319,6 +319,14 @@ int mmc_of_parse(struct mmc_host *host) > host->caps2 |= MMC_CAP2_NO_SD; > if (device_property_read_bool(dev, "no-mmc")) > host->caps2 |= MMC_CAP2_NO_MMC; > + if (device_property_read_bool(dev, "supports-cqe")) > + host->caps2 |= MMC_CAP2_CQE; I don't understand why this is even a DT property as it should be clear from the hosts compatible whether it supports CQE or not. But it's too late to do anything about that I suppose, and I just assume there is something I don't understand here. > + /* Must be after "supports-cqe" check */ > + if (!device_property_read_bool(dev, "disable-cqe-dcmd")) { > + if (host->caps2 & MMC_CAP2_CQE) > + host->caps2 |= MMC_CAP2_CQE_DCMD; > + } This is the right place to do this I suppose. Disabling CQE selectively is something you might wanna do for debugging. Acked-by: Linus Walleij I see that some drivers are already parsing this DT property on their own, should we follow up with patches so that these: $ git grep 'supports-cqe' drivers/mmc/host/sdhci-brcmstb.c: if (device_property_read_bool(&pdev->dev, "supports-cqe")) { drivers/mmc/host/sdhci-msm.c: if (of_property_read_bool(node, "supports-cqe")) drivers/mmc/host/sdhci-tegra.c: if (device_property_read_bool(host->mmc->parent, "supports-cqe")) Make use of the central parsing instead? Yours, Linus Walleij