mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: kbuild-all@01.org, linux-arm-kernel@lists.infradead.org,
	sre@kernel.org,
	Alexandre Belloni <alexandre.belloni@free-electrons.com>,
	robh+dt@kernel.org, linux-kernel@vger.kernel.org,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	linux@roeck-us.net, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk,
	Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>,
	Nicolas Ferre <nicolas.ferre@atmel.com>
Subject: Re: [PATCH v3 2/2] power: reset: at91-shdwc: add new shutdown controller driver
Date: Thu, 1 Oct 2015 00:45:18 +0800	[thread overview]
Message-ID: <201510010048.I9oghJUp%fengguang.wu@intel.com> (raw)
In-Reply-To: <1443630121-13912-3-git-send-email-nicolas.ferre@atmel.com>

[-- Attachment #1: Type: text/plain, Size: 3952 bytes --]

Hi Nicolas,

[auto build test results on v4.3-rc3 -- if it's inappropriate base, please ignore]

config: x86_64-allmodconfig (attached as .config)
reproduce:
  git checkout c2df3a7df512b1d640247d7c9b7542217bfb9ab1
  # save the attached .config to linux build tree
  make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   drivers/power/reset/at91-shdwc.c: In function 'at91_poweroff':
>> drivers/power/reset/at91-shdwc.c:32:24: warning: large integer implicitly truncated to unsigned type [-Woverflow]
    #define AT91_SHDW_KEY  (0xa5 << 24)  /* KEY Password */
                           ^
>> drivers/power/reset/at91-shdwc.c:107:9: note: in expansion of macro 'AT91_SHDW_KEY'
     writel(AT91_SHDW_KEY | AT91_SHDW_SHDW,
            ^

vim +32 drivers/power/reset/at91-shdwc.c

    26	#include <linux/printk.h>
    27	
    28	#define SLOW_CLOCK_FREQ	32768
    29	
    30	#define AT91_SHDW_CR	0x00		/* Shut Down Control Register */
    31	#define AT91_SHDW_SHDW		BIT(0)			/* Shut Down command */
  > 32	#define AT91_SHDW_KEY		(0xa5 << 24)		/* KEY Password */
    33	
    34	#define AT91_SHDW_MR	0x04		/* Shut Down Mode Register */
    35	#define AT91_SHDW_WKUPDBC_SHIFT	24
    36	#define AT91_SHDW_WKUPDBC_MASK	GENMASK(31, 16)
    37	#define AT91_SHDW_WKUPDBC(x)	(((x) << AT91_SHDW_WKUPDBC_SHIFT) \
    38							& AT91_SHDW_WKUPDBC_MASK)
    39	
    40	#define AT91_SHDW_SR	0x08		/* Shut Down Status Register */
    41	#define AT91_SHDW_WKUPIS_SHIFT	16
    42	#define AT91_SHDW_WKUPIS_MASK	GENMASK(31, 16)
    43	#define AT91_SHDW_WKUPIS(x)	((1 << (x)) << AT91_SHDW_WKUPIS_SHIFT \
    44							& AT91_SHDW_WKUPIS_MASK)
    45	
    46	#define AT91_SHDW_WUIR	0x0c		/* Shutdown Wake-up Inputs Register */
    47	#define AT91_SHDW_WKUPEN_MASK	GENMASK(15, 0)
    48	#define AT91_SHDW_WKUPEN(x)	((1 << (x)) & AT91_SHDW_WKUPEN_MASK)
    49	#define AT91_SHDW_WKUPT_SHIFT	16
    50	#define AT91_SHDW_WKUPT_MASK	GENMASK(31, 16)
    51	#define AT91_SHDW_WKUPT(x)	((1 << (x)) << AT91_SHDW_WKUPT_SHIFT \
    52							& AT91_SHDW_WKUPT_MASK)
    53	
    54	#define SHDW_WK_PIN(reg, cfg)	((reg) & AT91_SHDW_WKUPIS((cfg)->wkup_pin_input))
    55	#define SHDW_RTCWK(reg, cfg)	(((reg) >> ((cfg)->sr_rtcwk_shift)) & 0x1)
    56	#define SHDW_RTCWKEN(cfg)	(1 << ((cfg)->mr_rtcwk_shift))
    57	
    58	#define DBC_PERIOD_US(x)	DIV_ROUND_UP_ULL((1000000 * (x)), \
    59								SLOW_CLOCK_FREQ)
    60	
    61	struct shdwc_config {
    62		u8 wkup_pin_input;
    63		u8 mr_rtcwk_shift;
    64		u8 sr_rtcwk_shift;
    65	};
    66	
    67	struct shdwc {
    68		struct shdwc_config *cfg;
    69		void __iomem *at91_shdwc_base;
    70	};
    71	
    72	/*
    73	 * Hold configuration here, cannot be more than one instance of the driver
    74	 * since pm_power_off itself is global.
    75	 */
    76	static struct shdwc *at91_shdwc;
    77	static struct clk *sclk;
    78	
    79	static const unsigned long long sdwc_dbc_period[] = {
    80		0, 3, 32, 512, 4096, 32768,
    81	};
    82	
    83	static void __init at91_wakeup_status(struct platform_device *pdev)
    84	{
    85		struct shdwc *shdw = platform_get_drvdata(pdev);
    86		u32 reg;
    87		char *reason = "unknown";
    88	
    89		reg = readl(shdw->at91_shdwc_base + AT91_SHDW_SR);
    90	
    91		dev_dbg(&pdev->dev, "%s: status = %#x\n", __func__, reg);
    92	
    93		/* Simple power-on, just bail out */
    94		if (!reg)
    95			return;
    96	
    97		if (SHDW_WK_PIN(reg, shdw->cfg))
    98			reason = "WKUP pin";
    99		else if (SHDW_RTCWK(reg, shdw->cfg))
   100			reason = "RTC";
   101	
   102		pr_info("AT91: Wake-Up source: %s\n", reason);
   103	}
   104	
   105	static void at91_poweroff(void)
   106	{
 > 107		writel(AT91_SHDW_KEY | AT91_SHDW_SHDW,
   108				at91_shdwc->at91_shdwc_base + AT91_SHDW_CR);
   109	}
   110	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 50064 bytes --]

  reply	other threads:[~2015-09-30 16:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30 16:21 [PATCH v3 0/2] power: reset: support for Atmel alternative Shutdown Controller Nicolas Ferre
2015-09-30 16:22 ` [PATCH v3 1/2] ARM: at91/dt: shdwc binding: add new shutdown controller documentation Nicolas Ferre
2015-10-03 17:02   ` Alexandre Belloni
2016-03-07 14:31     ` Nicolas Ferre
2015-09-30 16:22 ` [PATCH v3 2/2] power: reset: at91-shdwc: add new shutdown controller driver Nicolas Ferre
2015-09-30 16:45   ` kbuild test robot [this message]
2015-10-01 15:12   ` kbuild test robot

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=201510010048.I9oghJUp%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=kbuild-all@01.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mark.rutland@arm.com \
    --cc=maxime.ripard@free-electrons.com \
    --cc=nicolas.ferre@atmel.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=robh+dt@kernel.org \
    --cc=sre@kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®