LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "H. Nikolaus Schaller" <hns@goldelico.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Jerome Pouiller <Jerome.Pouiller@silabs.com>,
	Avri Altman <avri.altman@wdc.com>,
	Shawn Lin <shawn.lin@rock-chips.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bean Huo <beanhuo@micron.com>,
	linux-mmc@vger.kernel.org,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Discussions about the Letux Kernel 
	<letux-kernel@openphoenux.org>,
	kernel@pyra-handheld.com, Tony Lindgren <tony@atomide.com>,
	Linux-OMAP <linux-omap@vger.kernel.org>
Subject: Re: [RFC] mmc: core: transplant ti,wl1251 quirks from to be retired omap_hsmmc
Date: Tue, 26 Oct 2021 20:08:42 +0200	[thread overview]
Message-ID: <80C6A8DD-183B-4FDD-B203-D3108C106043@goldelico.com> (raw)
In-Reply-To: <CAPDyKFraMXqC9OBeUTpm=bxjrFZTCopV3ZJQf1TRsA8UeTWdTA@mail.gmail.com>

Hi Uf,

+ Tony, linux-omap list

> Am 26.10.2021 um 19:12 schrieb Ulf Hansson <ulf.hansson@linaro.org>:
> 
> + Jerome
> 
> On Wed, 6 Oct 2021 at 13:25, H. Nikolaus Schaller <hns@goldelico.com> wrote:
>> 
>> The TiWi 5 WiFi module needs special setup of the sdio
>> interface before it can be probed.
>> 
>> So far, this is done in omap_hsmmc_init_card() in omap_hsmmc.c
>> which makes it useable only if connected to omap devices
>> which use the omap_hsmmc. The OpenPandora is the most promient
>> example.
>> 
>> There are plans to switch to a newer sdhci-omap driver and
>> retire omap_hsmmc. Hence this quirk must be reworked or moved
>> somewhere else. Ideally to some location that is not dependent
>> on the specific SoC mmc host driver.
>> 
>> Analysis has shown that omap_hsmmc_init_card() is called
>> through the host->ops->init_card hook which itself
>> is called in three generic locations:
>> 
>> mmc_init_card()
>> mmc_sd_init_card()
>> mmc_sdio_init_card()
>> 
>> All these functions share a call to mmc_select_card() shortly
>> after running the init hook and therefore I assume that
>> a good place transplanting the special wl1251 handling is
>> mmc_select_card() - unless we want to copy and maintain the
>> code to three different places.
>> 
>> After this quirk has been moved there, we can remove
>> omap_hsmmc_init_card() in omap_hsmmc.c in a separate patch.
>> Indeed the plan is to remove omap_hsmmc.c completely.
>> 
>> A future development path to generalize could be to make
>> the code not depend on compatible = "ti,wl1251" but check
>> for optional device tree properties (non-std-sdio, bus width,
>> vendor, device, blksize, max_dtr, ocr) which can be defined
>> for any child device of the mmd/sd port needing such special
>> setup.
> 
> I wouldn't go that path, simply because it may look like we encourage
> vendors to deviate from the SDIO spec. :-)

Well, that ti,wl1251 chip is so old [1] that probably the SDIO spec did
deviate from what the vendor thought it will look like :)

[1] https://www.ti.com/lit/ml/swmt009a/swmt009a.pdf

> At least for now, matching on the compatible string and applying card
> quirks makes perfect sense to me.

Yes, that is how it already was in the omal_hsmmc driver quirks.

> 
>> 
>> Related-to: commit f6498b922e57 ("mmc: host: omap_hsmmc: add code for special init of wl1251 to get rid of pandora_wl1251_init_card")
>> Related-to: commit 2398c41d6432 ("omap: pdata-quirks: remove openpandora quirks for mmc3 and wl1251")
>> Related-to: commit f9d50fef4b64 ("ARM: OMAP2+: omap3-pandora: add wifi support")
>> Tested-by: H. Nikolaus Schaller <hns@goldelico.com> # on OpenPandora
>> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> 
> As a matter of fact, the similar problem that you are looking to
> address (applying card quirks based on DT compatibility strings), is
> partly being taken care of in another series [1], being discussed
> right now. I think the solution for the ti,wl1251 should be based upon
> that too. Please have a look and see if you can play with that!?

That is interesting.
Yes, maybe it can be the basis. At least for finding the chip and driver.

BR and thanks,
Nikolaus

> 
> Kind regards
> Uffe
> 
> [1]
> [RFC PATCH 0/2] mmc: allow to rely on the DT to apply quirks
> https://lore.kernel.org/lkml/20211014143031.1313783-1-Jerome.Pouiller@silabs.com/


  reply	other threads:[~2021-10-26 18:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-06 11:25 H. Nikolaus Schaller
2021-10-26 17:12 ` Ulf Hansson
2021-10-26 18:08   ` H. Nikolaus Schaller [this message]
2021-10-27 17:00     ` H. Nikolaus Schaller
2021-10-27 21:31       ` Ulf Hansson
2021-10-28  7:08         ` H. Nikolaus Schaller
2021-10-28  8:59           ` Jérôme Pouiller
2021-10-28  9:31             ` Ulf Hansson
2021-10-28  9:40             ` H. Nikolaus Schaller
2021-10-28  9:43               ` H. Nikolaus Schaller
2021-10-28  9:51                 ` Ulf Hansson
2021-10-28  9:55               ` Jérôme Pouiller
2021-10-28 10:07                 ` H. Nikolaus Schaller
2021-11-01  9:12                   ` H. Nikolaus Schaller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=80C6A8DD-183B-4FDD-B203-D3108C106043@goldelico.com \
    --to=hns@goldelico.com \
    --cc=Jerome.Pouiller@silabs.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=kernel@pyra-handheld.com \
    --cc=letux-kernel@openphoenux.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=shawn.lin@rock-chips.com \
    --cc=tony@atomide.com \
    --cc=ulf.hansson@linaro.org \
    --subject='Re: [RFC] mmc: core: transplant ti,wl1251 quirks from to be retired omap_hsmmc' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).