lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180809131426.GB21639@ulmo>
Date:   Thu, 9 Aug 2018 15:14:26 +0200
From:   Thierry Reding <thierry.reding@...il.com>
To:     Aapo Vienamo <avienamo@...dia.com>
Cc:     Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Jonathan Hunter <jonathanh@...dia.com>,
        Ulf Hansson <ulf.hansson@...aro.org>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Mikko Perttunen <mperttunen@...dia.com>,
        Stefan Agner <stefan@...er.ch>, devicetree@...r.kernel.org,
        linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-mmc@...r.kernel.org
Subject: Re: [PATCH 12/40] mmc: tegra: Reconfigure pad voltages during
 voltage switching

On Thu, Aug 09, 2018 at 03:52:39PM +0300, Aapo Vienamo wrote:
> On Thu, 9 Aug 2018 14:43:46 +0200
> Thierry Reding <thierry.reding@...il.com> wrote:
> 
> > On Wed, Aug 01, 2018 at 07:32:02PM +0300, Aapo Vienamo wrote:
> > > Parse the pinctrl state and nvidia,only-1-8-v properties from the device
> > > tree. Validate the pinctrl and regulator configuration before unmasking
> > > UHS modes. Implement pad voltage state reconfiguration in the mmc
> > > start_signal_voltage_switch() callback. Add NVQUIRK_NEEDS_PAD_CONTROL
> > > and add set it for Tegra210 and Tegra186.
> > > 
> > > The pad configuration is done in the mmc callback because the order of
> > > pad reconfiguration and sdhci voltage switch depend on the voltage to
> > > which the transition occurs.
> > > 
> > > Signed-off-by: Aapo Vienamo <avienamo@...dia.com>
> > > ---
> > >  drivers/mmc/host/sdhci-tegra.c | 138 ++++++++++++++++++++++++++++++++++++++---
> > >  1 file changed, 131 insertions(+), 7 deletions(-)
> > > 
> > > diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
> > > index ddf00166..7d98455 100644
> > > --- a/drivers/mmc/host/sdhci-tegra.c
> > > +++ b/drivers/mmc/host/sdhci-tegra.c
> > > @@ -21,6 +21,8 @@
> > >  #include <linux/io.h>
> > >  #include <linux/of.h>
> > >  #include <linux/of_device.h>
> > > +#include <linux/pinctrl/consumer.h>
> > > +#include <linux/regulator/consumer.h>
> > >  #include <linux/reset.h>
> > >  #include <linux/mmc/card.h>
> > >  #include <linux/mmc/host.h>
> > > @@ -55,6 +57,7 @@
> > >  #define NVQUIRK_ENABLE_SDR104		BIT(4)
> > >  #define NVQUIRK_ENABLE_DDR50		BIT(5)
> > >  #define NVQUIRK_HAS_PADCALIB		BIT(6)
> > > +#define NVQUIRK_NEEDS_PAD_CONTROL	BIT(7)
> > >  
> > >  struct sdhci_tegra_soc_data {
> > >  	const struct sdhci_pltfm_data *pdata;
> > > @@ -66,8 +69,12 @@ struct sdhci_tegra {
> > >  	struct gpio_desc *power_gpio;
> > >  	bool ddr_signaling;
> > >  	bool pad_calib_required;
> > > +	bool pad_control_available;
> > >  
> > >  	struct reset_control *rst;
> > > +	struct pinctrl *pinctrl_sdmmc;
> > > +	struct pinctrl_state *pinctrl_state_3v3;
> > > +	struct pinctrl_state *pinctrl_state_1v8;
> > >  };
> > >  
> > >  static u16 tegra_sdhci_readw(struct sdhci_host *host, int reg)
> > > @@ -138,12 +145,46 @@ static unsigned int tegra_sdhci_get_ro(struct sdhci_host *host)
> > >  	return mmc_gpio_get_ro(host->mmc);
> > >  }
> > >  
> > > +static bool tegra_sdhci_is_pad_and_regulator_valid(struct sdhci_host *host)
> > > +{
> > > +	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> > > +	struct sdhci_tegra *tegra_host = sdhci_pltfm_priv(pltfm_host);
> > > +	int has_1v8, has_3v3;  
> > 
> > Can these be boolean?
> 
> In some cases regulator_is_supported_voltage() can return a negative
> error code.

Okay, that's fine then.

Thierry

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ