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-next>] [day] [month] [year] [list]
Date:	Fri, 9 Dec 2011 11:13:20 +0200
From:	Peter De Schrijver <pdeschrijver@...dia.com>
To:	Colin Cross <ccross@...roid.com>
CC:	Grant Likely <grant.likely@...retlab.ca>,
	Rob Herring <rob.herring@...xeda.com>,
	Randy Dunlap <rdunlap@...otime.net>,
	Russell King <linux@....linux.org.uk>,
	Olof Johansson <olof@...om.net>,
	Stephen Warren <swarren@...dia.com>,
	Gary King <gking@...dia.com>,
	"devicetree-discuss@...ts.ozlabs.org" 
	<devicetree-discuss@...ts.ozlabs.org>,
	"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>
Subject: Re: [PATCH v6 03/10] arm/tegra: prepare clock code for multiple
 tegra variants

On Thu, Dec 08, 2011 at 07:25:53PM +0100, Colin Cross wrote:
> On Thu, Dec 8, 2011 at 4:43 AM, Peter De Schrijver <pdeschrijver@...dia.com<mailto:pdeschrijver@...dia.com>> wrote:
> Rework the tegra20 clock code to support multiple tegra variants :
> 
>  * remove tegra2_periph_reset_assert/tegra2_periph_reset_deassert. This
>   functionality should be in clock.c.
>  * compile tegra_sdmmc_tap_delay only on tegra20 as this feature will not
>   be available in future variants.
>  * don't export clk_measure_input_freq as its functionality is also available
>   using clk_get_rate().
> 
> Signed-off-by: Peter De Schrijver <pdeschrijver@...dia.com<mailto:pdeschrijver@...dia.com>>
> ---
>  arch/arm/mach-tegra/clock.c         |   12 +++++++-----
>  arch/arm/mach-tegra/clock.h         |    8 ++++----
>  arch/arm/mach-tegra/tegra2_clocks.c |   14 +-------------
>  arch/arm/mach-tegra/timer.c         |   12 ++++++++----
>  4 files changed, 20 insertions(+), 26 deletions(-)
> 
> diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
> index f8d41ff..f27bdcc 100644
> --- a/arch/arm/mach-tegra/clock.c
> +++ b/arch/arm/mach-tegra/clock.c
> @@ -387,13 +387,15 @@ EXPORT_SYMBOL(tegra_clk_init_from_table);
> 
>  void tegra_periph_reset_deassert(struct clk *c)
>  {
> -       tegra2_periph_reset_deassert(c);
> +       BUG_ON(!c->ops->reset);
> +       c->ops->reset(c, false);
>  }
>  EXPORT_SYMBOL(tegra_periph_reset_deassert);
> 
>  void tegra_periph_reset_assert(struct clk *c)
>  {
> -       tegra2_periph_reset_assert(c);
> +       BUG_ON(!c->ops->reset);
> +       c->ops->reset(c, true);
>  }
>  EXPORT_SYMBOL(tegra_periph_reset_assert);
> 
> @@ -403,9 +405,9 @@ void __init tegra_init_clock(void)
>  }
> 
>  /*
> - * The SDMMC controllers have extra bits in the clock source register that
> - * adjust the delay between the clock and data to compenstate for delays
> - * on the PCB.
> + * The SDMMC controllers on tegra20 have extra bits in the clock source
> + * register that adjust the delay between the clock and data to compenstate
> + * for delays on the PCB.
>  */
>  void tegra_sdmmc_tap_delay(struct clk *c, int delay)
>  {
> 
> I created this wrapper around tegra2_sdmmc_tap_delay because I guessed the same requirement would be present in tegra3.  If you don't expect this to be required on anything but tegra2, you could drop the wrapper and just have callers use tegra2_sdmmc_tap_delay.
> 

I will ask around if this is needed for tegra30.

> diff --git a/arch/arm/mach-tegra/clock.h b/arch/arm/mach-tegra/clock.h
> index 688316a..135bb5f 100644
> --- a/arch/arm/mach-tegra/clock.h
> +++ b/arch/arm/mach-tegra/clock.h
> @@ -146,15 +146,15 @@ struct tegra_clk_init_table {
>  };
> 
>  void tegra2_init_clocks(void);
> -void tegra2_periph_reset_deassert(struct clk *c);
> -void tegra2_periph_reset_assert(struct clk *c);
>  void clk_init(struct clk *clk);
>  struct clk *tegra_get_clock_by_name(const char *name);
> -unsigned long clk_measure_input_freq(void);
>  int clk_reparent(struct clk *c, struct clk *parent);
>  void tegra_clk_init_from_table(struct tegra_clk_init_table *table);
>  unsigned long clk_get_rate_locked(struct clk *c);
>  int clk_set_rate_locked(struct clk *c, unsigned long rate);
> +#ifdef CONFIG_ARCH_TEGRA_2x_SOC
>  void tegra2_sdmmc_tap_delay(struct clk *c, int delay);
> -
> +#else
> +#define tegra2_sdmmc_tap_delay(c, d) do {} while(0);
> 
> It's more standard to use an empty static inline function here.
> 

clock.h is included in several board files. So making this a static inline
function results in a number of 'static function declared but not used'
warnings.

Cheers,

Peter.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ