Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp626093imm; Wed, 11 Jul 2018 08:16:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdziTpZKfGdkXZFRdqw+N4Zbp/9SRA+50cs+PQ+W93HdURERe6z0WdqLhvpldx0fu6e4swZ X-Received: by 2002:a63:3c0c:: with SMTP id j12-v6mr20718788pga.440.1531322189615; Wed, 11 Jul 2018 08:16:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531322189; cv=none; d=google.com; s=arc-20160816; b=xMTfCHKU0MyTKgfRoWfEHfvfA1nnVN0jYGRHvcfLv59N6IegM7k8AB6IdwCUdSG/h8 RRmttqNXy/5vxSrbcXhnt5I7AYbhMJQ2WFGXVeRKGR4C9bt/Q9fUeAJb9++N6zUAI8Xb H/ksvqxmiO+uG6SV6Q4Mg+809q8Cof+RjAloju7ftC+z4P+64RSbUcQDN8alY4MUCviG rwnHaAtaU9cUAsbZEYtJf2YnUhHJyuLqs+Qdk5cLV15vSatqyuUwD+cxmZczGS9QrBXF cMzeUg2eytnGJ/ITNTiBQPya2hdGrwnduiU5sP505tc1IUeJEapx2gqQh6114M/ckhtK Q1ZA== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=sPwiriw5RMFLe9Dd8rKkkDSc9FciTk4lrfjW6jP3R2E=; b=z45YdEykvESMLLgW+ZkuB45bEhAUQiOyxf86Tl0xUPBQ4OiB3Igvm/ktZl8LhltPgG BLa4OJDIO/k6DsDluz8ZI3dIFdaHrJ/9+JvQIOo/tkrV9+yAFC5O7Q6jieaSAL9Vwdd4 6pXHaKjZKz6/pxnSGW5yOEUpq1UzmSilkfv9ak8MMphurXY4fwNp2n6zEOYnHohbo4Ew t3rL8HerqU0Od/myI7La1A758hJRd+oSxPH//YEj5AVZEmWmZWJLuT7U810qtYs3vOGK Em1tC3kFRmA9bLcXUAu2uZKUO1XnHCZZ8pa+kG5g/t5pd3hl2ITkB8ZL7OsY3UFOr0mc 2upw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K9U7UJ2C; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d64-v6si20080220pfc.31.2018.07.11.08.16.13; Wed, 11 Jul 2018 08:16:29 -0700 (PDT) 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=K9U7UJ2C; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387611AbeGKMnJ (ORCPT + 99 others); Wed, 11 Jul 2018 08:43:09 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:46752 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726423AbeGKMnI (ORCPT ); Wed, 11 Jul 2018 08:43:08 -0400 Received: by mail-io0-f196.google.com with SMTP id i18-v6so7706874ioj.13 for ; Wed, 11 Jul 2018 05:39:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=sPwiriw5RMFLe9Dd8rKkkDSc9FciTk4lrfjW6jP3R2E=; b=K9U7UJ2CFHh9AlgdaX9wacaJTuwdpms5k7PzEQzi/L+FkcDKQ+puDcZHLLEZS0Csx+ ofsZh7oIqSByCskrlbPjZ5VqsMDhQiIvSAvuYScj/DloFeKID3uzb/Nq4vk2hLxuueVe FbdpMAwCIhju5rQMgtukzDOOSJZkEwgbdLfZU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=sPwiriw5RMFLe9Dd8rKkkDSc9FciTk4lrfjW6jP3R2E=; b=TPa3KnBZvwSK4ZSlKfXjZo6fDYdEPg5oKUENyH/oc8Ir8x5IqH+CwgFgTH6jhkktWg bXy9jBn/WsliYunIaEGQQxmYRlP3mBT6l1SzuI7/V3fBA9DQOSj3CWhmjXje185yVFsZ xEaLjWytTcFLp3vJErUgzcA5Pp4B8fbC954CIZaZVLLB+4piDZAA8Va1DeMgy3Ly4/5J JM7WsPHKhu7ADB/LysJCy0Cl0sHFvzN5PL7aYvDljsNasCMknrJ3pLBhQoJp2cS3aygV YpUHmoJUDlnQCQn46m+Ld5Cfk8Q9Iv+StOYnM1TX9cPB/b464hxnGHmmoQwSFJuyBUXo qrIw== X-Gm-Message-State: AOUpUlHVcg9qRHTr/8AjK3HqkXVmqSFdfitXFmxlLtutF4vl5l+34Hrq xmDU6gtN0aUPgj/Zjs65CpbK3eIcbhxKM8+ZPnURjQ== X-Received: by 2002:a6b:144c:: with SMTP id 73-v6mr23632050iou.218.1531312740167; Wed, 11 Jul 2018 05:39:00 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:818f:0:0:0:0:0 with HTTP; Wed, 11 Jul 2018 05:38:59 -0700 (PDT) In-Reply-To: <973d98c5-b5c7-d1c4-1b20-b6a77500adc3@st.com> References: <1528809280-31116-1-git-send-email-ludovic.Barre@st.com> <1528809280-31116-6-git-send-email-ludovic.Barre@st.com> <973d98c5-b5c7-d1c4-1b20-b6a77500adc3@st.com> From: Ulf Hansson Date: Wed, 11 Jul 2018 14:38:59 +0200 Message-ID: Subject: Re: [PATCH 05/19] mmc: mmci: allow to overwrite clock/power procedure to specific variant To: Ludovic BARRE Cc: Rob Herring , Maxime Coquelin , Alexandre Torgue , Gerald Baeza , Linux ARM , Linux Kernel Mailing List , devicetree@vger.kernel.org, "linux-mmc@vger.kernel.org" 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 [...] >> 2) The clock register will be written to before the regulator >> operations have been done. Not sure if that works fine!? > > > you are right, it's probably better if the clock is done after power. > do you agree if I change the order? If the new ST variant can cope with the existing order in the current code, then let's stick to that to avoid breaking legacy variants. > >> >> An overall comment, I think we should create a mmci_host_ops structure >> and put the needed callbacks in there (kept to a minimum of course), >> rather than putting them as a part of the variant struct. More >> importantly, also the legacy mmci variants should get a mmci_host_ops >> structure assigned during probe. >> >> The point is, I think it makes the code above (and future wise) more >> flexible. It should also allow us to better share functions between >> the variants. In principle, I expect that we end up with a bunch of >> "library" mmci functions that can be invoked from variant's >> mmci_host_ops (if not assigned directly). > > > After "Linaro connect" we have exchanged some emails (subject: "STM32MP1 > SDMMC driver review") and the start point was > "Goal is not to redesign mmci.c like sdhci.c." > This it's why I'm surprise by "library" and "mmci_host_ops" > and comment of patch 01. Sometimes it's easier to look at patches/code, instead of giving qualified guesses what is the best solution. Try something, realize what is better, then try again... The point is, we need callbacks to cope with the variants as we can't have quirks for everything, and you are demonstrating that in $subject patch. Since this is the case, then I think it's better to make it more flexible, already from the beginning and thus put the callbacks in a new mmci host ops structure instead. > > So, it's not clear for me on where we wish to go. > Could you clarify the way, if it's with a mmci_ops like sdhci_ops? Yep, something along those lines. However, we don't want to introduce unnecessary callbacks and complexity. We should strive towards sharing common functionality through library functions in mmci.c, rather than having callbacks for every single difference. Does it makes sense? [...] Kind regards Uffe