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: <alpine.DEB.2.02.1505271520570.19205@linuxheads99>
Date:	Wed, 27 May 2015 15:25:24 -0500
From:	atull <atull@...nsource.altera.com>
To:	Dinh Nguyen <dinguyen@...nsource.altera.com>
CC:	Rob Herring <robh+dt@...nel.org>, Pavel Machek <pavel@...x.de>,
	"Arnd Bergmann" <arnd@...db.de>,
	Steffen Trumtrar <s.trumtrar@...gutronix.de>,
	Pawel Moll <pawel.moll@....com>,
	Mark Rutland <mark.rutland@....com>,
	"Ian Campbell" <ijc+devicetree@...lion.org.uk>,
	Kumar Gala <galak@...eaurora.org>,
	<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	Russell King <linux@....linux.org.uk>,
	<linux-arm-kernel@...ts.infradead.org>,
	"Delicious Quinoq" <delicious.quinoa@...il.com>
Subject: Re: [PATCH v4 1/2] ARM: socfpga: support suspend to ram

On Tue, 26 May 2015, Dinh Nguyen wrote:

> Hi Alan,
> 
> On 5/22/15 1:02 PM, Alan Tull wrote:
> > Add code that requests that the sdr controller go into
> > self-refresh mode.  This code is run from ocram.
> > 
> > This patch assumes that u-boot has already configured sdr:
> >   sdr.ctrlcfg.lowpwreq.selfrfshmask = 3
> >   sdr.ctrlcfg.lowpwrtiming.clkdisablecycles = 8
> >   sdr.ctrlcfg.dramtiming4.selfrfshexit = 512
> > 
> > Suspend-to-RAM and EDAC support are mutually exclusive on SOCFPGA
> > platforms.  CONFIG_SOCFPGA_SUSPEND enables suspend-to-RAM and
> > prevents selecting CONFIG_EDAC_ALTERA_MC.
> > 
> > How to suspend to ram:
> >  $ echo enabled > \
> > /sys/devices/soc/ffc02000.serial0/tty/ttyS0/power/wakeup
> > 
> >  $ echo -n mem > /sys/power/state
> > 
> > Signed-off-by: Alan Tull <atull@...nsource.altera.com>
> > Cc: Pavel Machek <pavel@...x.de>
> > Cc: Arnd Bergmann <arnd@...db.de>
> > Cc: Dinh Nguyen <dinguyen@...nsource.altera.com>
> > Cc: Steffen Trumtrar <s.trumtrar@...gutronix.de>
> > ---
> > v2: use Generic on-chip SRAM driver to allocate ocram
> >     rm fncpy_align since generic allocator handles alignment
> >     check __arm_ioremap_exec return code
> >     check for NULL pointers
> >     add a comment regarding sdram controller configuration
> > v3: fix renamed #define
> >     propagate socfpga_setup_ocram_self_refresh error code
> > v4: Kconfig: don't need to select GENERIC_ALLOCATER
> >     add CONFIG_SOCFPGA_SUSPEND
> >     make s2r and EDAC support mutually exclusive
> >     socfpga.c: add sdr_ctl_base_addr
> >     return error if ocram not available in device tree
> >     update copyright years
> > ---
> 
> <snip>
> 
> > +
> > +static int socfpga_pm_suspend(unsigned long arg)
> > +{
> > +	u32 ret;
> > +
> > +	if (!sdr_ctl_base_addr || !socfpga_scu_base_addr)
> > +		return -EFAULT;
> > +
> > +	ret = socfpga_sdram_self_refresh_in_ocram(
> > +		(u32)sdr_ctl_base_addr, (u32)socfpga_scu_base_addr);
> > +
> 
> I had a patch that removed socfpga_scu_base_addr from being a global and
> just a local variable in:
> 
> f6e14376fb20 ARM: socfpga: use of_iomap to map the SCU
> 
> This patch will be in v4.2 and is currently in arm-soc/next or
> at my fork: kernel/git/dinguyen/linux.git socfpga_for_next_arria10
> 
> So you will either need to make socfpga_scu_base_addr global again, or
> you can use the asm instruction to get the SCU base addr.
> 
> Sorry about that..
> 
> Dinh
> 

I can't make socfpga_scu_base_addr a global from platsmp.c since that file
may or may not be compiled in.

That leaves me with the option of adding the code that was removed from
socfpga.c back where it was or taking that same code moving it to pm.c

What's your preference?

Alan
--
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