Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1558996img; Wed, 27 Feb 2019 01:12:30 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibj7rQOEC9xJJmscFAMqjJlpofj6M9weTpsa3yu5fd88PBVKafEkxIAJejDGXDvAt4ysMQM X-Received: by 2002:a63:ca:: with SMTP id 193mr2004592pga.288.1551258750467; Wed, 27 Feb 2019 01:12:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551258750; cv=none; d=google.com; s=arc-20160816; b=StDW+AJoF5oTZWJkfPEkzg6XarGExu/dqF7/qw6490Sij0GTH+9ZtmCNs7Wo/DXKHn JaQrLIO9L65HBzh7sXu0/94eFaKH58mqrpu5qjefQJNAEUMKtQ1bciA/DH5tNM6kE1DI TjBP6wDd0Don2BplzUMqmyCrsfVFoWoESKSux0v0OAyA+neXB9k3WxUR3wn6RmLiKqwV 2t1GlCxgL0SgQibpFLeRkmVPNkpIC1Y5t9E43QQgqxfw3Xj9TDn1tt+oeQsMtH9n4+AJ ePOZqdoLmvGRg/HrwfLC3gabE3qeI9UYsJFpvnFsob5a9Nh1PHbl5FgcUloEIH/BsUoK rcgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=kw8tusPCA1LkwwPgvJXNDPcc4GR2+4CJ0mI3cYf1BkI=; b=EyM5RJ24UQBc5sRx4bSSahUO/sUmkJLaBpOGVHD0DMlzAA2re7Mpg2Yyxm1/QwHBWZ ghmoPycmKYEQ8zNz/Qmi3atcfnyRJIahvXLOAow5vAyQRF3gEp0ntq/w1vHbVGrZ7JuQ BB0unc6461Y8kAtN7uXmwV3WyGXmHF7nJNH7jeh8EJQWpGM2OQ3+Vbd1LMGBkeMvjtmp 6eXQRslXyThSnm89hZhd2k5u7/tgQs2/w+GvzwKeKXDr725hHsftLEsO+6pJGDq1lvQ5 ejmYPZYQaJV80KGte6AlBdL2Fl33Olg8iJCyyfgDXxsSGQ1VB++CbWjPBG4fmJUjAMtj /MSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NW6JurUs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c20si9779047pgl.595.2019.02.27.01.12.14; Wed, 27 Feb 2019 01:12:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NW6JurUs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729558AbfB0JLz (ORCPT + 99 others); Wed, 27 Feb 2019 04:11:55 -0500 Received: from mail-ua1-f67.google.com ([209.85.222.67]:44400 "EHLO mail-ua1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727189AbfB0JLy (ORCPT ); Wed, 27 Feb 2019 04:11:54 -0500 Received: by mail-ua1-f67.google.com with SMTP id r21so7482577uan.11 for ; Wed, 27 Feb 2019 01:11:53 -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=kw8tusPCA1LkwwPgvJXNDPcc4GR2+4CJ0mI3cYf1BkI=; b=NW6JurUsFRBVGoroaa+zeoQy2/PFjytXZNZqRWxNnjdraqjWti0Y7TE7stuzyMby0J pxzTIxUPwrb5z6IHqEVqn15wlB0v+qfNMHApva8CksWdK15+niZ9Hmc6jrCJSWX81e2U ITnth/3ALPjaSfQO8MLrN1RZeN+G1mzuDqdzAiMkMJG/L4jtSrmvti0QE8OTGpq9BHkq hyLq512TRv5CrdVA8Xn9IcjSTdWMSUvi4R3uVI8EMc6sN8d5ZjkIdTJPiViuxgMfqjeH H4sj5D9HDUSIOW7mtmNxDdUbWqKISgUDs67gFjbp1N+0GAehZIewxg30xKnCQEGuDuaC xxbg== 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=kw8tusPCA1LkwwPgvJXNDPcc4GR2+4CJ0mI3cYf1BkI=; b=MWkGSE9Afdjryl5SiYQAC0MS/W9qmmCD6VlDbTnVNNdwXXZCvt2MXLHhFi5erngPWB G5W+dBvSQ6AQp63SHWDFJATFGVSw7tAl8SY185lYnZ2s38Mq78s/N6VjclOzH8i34oL5 bc7KKffWO7fRUGvQ8hZtVJHxdBQdkYt3ALv7fkvNIDPrci+z52LZeCakTvdtaoFAPIAb IbZe7QRiAU6FOCrIIDpB7Vh4Vf23QPyAyKwWKIAIbZ3zrWtBA0GujjIAgBtgkFa0c8AJ Tk75D5TIoh4s0cWtKe/g7sFl/QLq6PPMU9oMr7DwcqrYN9B+Ua5utVy8GRUkZNmuxR6Q 0/YQ== X-Gm-Message-State: AHQUAuZxhTLHAEeWjJr16IwNcci1vuJ57Y/FcmanNVoGHVgQHyfDy5+c V1CJM2clYnTjanHLEXZDTGOqs6tmjJ3oZ0y4/KSw4Q== X-Received: by 2002:a67:8055:: with SMTP id b82mr1203928vsd.200.1551258713237; Wed, 27 Feb 2019 01:11:53 -0800 (PST) MIME-Version: 1.0 References: <1550743851-13588-1-git-send-email-ludovic.Barre@st.com> <20190221102739.cc37au6elqu6gvfe@shell.armlinux.org.uk> <20190221103049.tspc5igoe6wmt3jd@shell.armlinux.org.uk> <20190221140300.y3tunrvsh3gyig5f@shell.armlinux.org.uk> <9c88d76c-2080-71b1-c9c6-c24d0f0aeb91@st.com> In-Reply-To: <9c88d76c-2080-71b1-c9c6-c24d0f0aeb91@st.com> From: Ulf Hansson Date: Wed, 27 Feb 2019 10:11:17 +0100 Message-ID: Subject: Re: [PATCH 0/2] mmc: mmci: add quirk property to add stm32 transfer mode To: Ludovic BARRE Cc: Russell King - ARM Linux admin , DTML , Alexandre Torgue , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List , Rob Herring , Srinivas Kandagatla , Maxime Coquelin , linux-stm32@st-md-mailman.stormreply.com, Linux ARM Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 25 Feb 2019 at 11:49, Ludovic BARRE wrote: > > hi Russell & Ulf > > On 2/21/19 3:03 PM, Russell King - ARM Linux admin wrote: > > On Thu, Feb 21, 2019 at 02:38:36PM +0100, Ludovic BARRE wrote: > >> hi Russell & Ulf > >> > >> On 2/21/19 11:30 AM, Russell King - ARM Linux admin wrote: > >>> On Thu, Feb 21, 2019 at 10:27:39AM +0000, Russell King - ARM Linux admin wrote: > >>>> On Thu, Feb 21, 2019 at 11:10:49AM +0100, Ludovic Barre wrote: > >>>>> From: Ludovic Barre > >>>>> > >>>>> This patch series introduces a bitmap of hardware quirks that require > >>>>> some special action. This should reduce the number of boolean > >>>>> into variant structure. > >>>>> And adds quirk bit to define sdmmc specific transfer modes. > >>>> > >>>> Please find some other way to deal with these differences. As far as > >>>> I'm concerned, introducing a quirk bitmask such as what was done in > >>>> sdhci is a complete disaster and leads to long-term maintanability > >>>> problems. > >>>> > >>>> We already have a way to deal with variants in mmci. > >>> > >>> ... to finish what I was saying ... > >>> > >>> and I think that: > >>> > >>> if (variant->blksz_datactrl16) > >>> datactrl = variant->datactrl_dpsm_enable | (data->blksz << 16); > >>> else if (variant->blksz_datactrl4) > >>> datactrl = variant->datactrl_dpsm_enable | (data->blksz << 4); > >>> else > >>> datactrl = variant->datactrl_dpsm_enable | blksz_bits << 4; > >>> > >>> ought to become a variant function call which returns the appropriate > >>> datactrl value. This would shrink the amount of variant testing in this > >>> path, and also means that going forward we aren't facing an endlessly > >>> increasing number of tests here. > >> > >> For blksz_datactrl case: > >> We could create an inline function for datactrl16 and blksz_datactrl4 > >> which returns the appropriate datactrl value (specific for ux500v2 and > >> qcom). This function could be register in mmci_host_ops structure. > > > > Yes, this is what I'm proposing (except for the "inline" bit which > > seems meaningless if it's called via the mmci_host_ops structure.) > > I'm also proposing that it shouldn't just be the blksz that's > > returned but anything that the variant needs to take account of, > > including the stm transfer mode. > > Ulf, are you alright with this callback approach (just to be sure that > every body is align, before send a patch)? Go ahead, let's see how it looks! > > This mmci_host_ops callback could return datactrl config to > start data (defined by variant). Yes. [...] Kind regards Uffe