Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 14629ed3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'akpm' (fixes from Andrew)

Merge misc fixes from Andrew Morton.

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  mqueue: sys_mq_open: do not call mnt_drop_write() if read-only
  mm/hotplug: only free wait_table if it's allocated by vmalloc
  dma-debug: update DMA debug API to better handle multiple mappings of a buffer
  dma-debug: fix locking bug in check_unmap()
  drivers/rtc/rtc-at91rm9200.c: use a variable for storing IMR
  drivers/video/ep93xx-fb.c: include <linux/io.h> for devm_ioremap()
  drivers/rtc/rtc-da9052.c: fix for rtc device registration
  mm: zone_end_pfn is too small
  poweroff: change orderly_poweroff() to use schedule_work()
  mm/hugetlb: fix total hugetlbfs pages count when using memory overcommit accouting
  printk: Provide a wake_up_klogd() off-case
  irq_work.h: fix warning when CONFIG_IRQ_WORK=n
parents b9cb3bf4 38d78e58
Loading
Loading
Loading
Loading
+31 −19
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ static DECLARE_COMPLETION(at91_rtc_updated);
static unsigned int at91_alarm_year = AT91_RTC_EPOCH;
static void __iomem *at91_rtc_regs;
static int irq;
static u32 at91_rtc_imr;

/*
 * Decode time/date into rtc_time structure
@@ -108,9 +109,11 @@ static int at91_rtc_settime(struct device *dev, struct rtc_time *tm)
	cr = at91_rtc_read(AT91_RTC_CR);
	at91_rtc_write(AT91_RTC_CR, cr | AT91_RTC_UPDCAL | AT91_RTC_UPDTIM);

	at91_rtc_imr |= AT91_RTC_ACKUPD;
	at91_rtc_write(AT91_RTC_IER, AT91_RTC_ACKUPD);
	wait_for_completion(&at91_rtc_updated);	/* wait for ACKUPD interrupt */
	at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ACKUPD);
	at91_rtc_imr &= ~AT91_RTC_ACKUPD;

	at91_rtc_write(AT91_RTC_TIMR,
			  bin2bcd(tm->tm_sec) << 0
@@ -142,7 +145,7 @@ static int at91_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm)
	tm->tm_yday = rtc_year_days(tm->tm_mday, tm->tm_mon, tm->tm_year);
	tm->tm_year = at91_alarm_year - 1900;

	alrm->enabled = (at91_rtc_read(AT91_RTC_IMR) & AT91_RTC_ALARM)
	alrm->enabled = (at91_rtc_imr & AT91_RTC_ALARM)
			? 1 : 0;

	dev_dbg(dev, "%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __func__,
@@ -168,6 +171,7 @@ static int at91_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
	tm.tm_sec = alrm->time.tm_sec;

	at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ALARM);
	at91_rtc_imr &= ~AT91_RTC_ALARM;
	at91_rtc_write(AT91_RTC_TIMALR,
		  bin2bcd(tm.tm_sec) << 0
		| bin2bcd(tm.tm_min) << 8
@@ -180,6 +184,7 @@ static int at91_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)

	if (alrm->enabled) {
		at91_rtc_write(AT91_RTC_SCCR, AT91_RTC_ALARM);
		at91_rtc_imr |= AT91_RTC_ALARM;
		at91_rtc_write(AT91_RTC_IER, AT91_RTC_ALARM);
	}

@@ -196,9 +201,12 @@ static int at91_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)

	if (enabled) {
		at91_rtc_write(AT91_RTC_SCCR, AT91_RTC_ALARM);
		at91_rtc_imr |= AT91_RTC_ALARM;
		at91_rtc_write(AT91_RTC_IER, AT91_RTC_ALARM);
	} else
	} else {
		at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ALARM);
		at91_rtc_imr &= ~AT91_RTC_ALARM;
	}

	return 0;
}
@@ -207,12 +215,10 @@ static int at91_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
 */
static int at91_rtc_proc(struct device *dev, struct seq_file *seq)
{
	unsigned long imr = at91_rtc_read(AT91_RTC_IMR);

	seq_printf(seq, "update_IRQ\t: %s\n",
			(imr & AT91_RTC_ACKUPD) ? "yes" : "no");
			(at91_rtc_imr & AT91_RTC_ACKUPD) ? "yes" : "no");
	seq_printf(seq, "periodic_IRQ\t: %s\n",
			(imr & AT91_RTC_SECEV) ? "yes" : "no");
			(at91_rtc_imr & AT91_RTC_SECEV) ? "yes" : "no");

	return 0;
}
@@ -227,7 +233,7 @@ static irqreturn_t at91_rtc_interrupt(int irq, void *dev_id)
	unsigned int rtsr;
	unsigned long events = 0;

	rtsr = at91_rtc_read(AT91_RTC_SR) & at91_rtc_read(AT91_RTC_IMR);
	rtsr = at91_rtc_read(AT91_RTC_SR) & at91_rtc_imr;
	if (rtsr) {		/* this interrupt is shared!  Is it ours? */
		if (rtsr & AT91_RTC_ALARM)
			events |= (RTC_AF | RTC_IRQF);
@@ -291,6 +297,7 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
	at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ACKUPD | AT91_RTC_ALARM |
					AT91_RTC_SECEV | AT91_RTC_TIMEV |
					AT91_RTC_CALEV);
	at91_rtc_imr = 0;

	ret = request_irq(irq, at91_rtc_interrupt,
				IRQF_SHARED,
@@ -329,6 +336,7 @@ static int __exit at91_rtc_remove(struct platform_device *pdev)
	at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ACKUPD | AT91_RTC_ALARM |
					AT91_RTC_SECEV | AT91_RTC_TIMEV |
					AT91_RTC_CALEV);
	at91_rtc_imr = 0;
	free_irq(irq, pdev);

	rtc_device_unregister(rtc);
@@ -341,31 +349,35 @@ static int __exit at91_rtc_remove(struct platform_device *pdev)

/* AT91RM9200 RTC Power management control */

static u32 at91_rtc_imr;
static u32 at91_rtc_bkpimr;


static int at91_rtc_suspend(struct device *dev)
{
	/* this IRQ is shared with DBGU and other hardware which isn't
	 * necessarily doing PM like we are...
	 */
	at91_rtc_imr = at91_rtc_read(AT91_RTC_IMR)
			& (AT91_RTC_ALARM|AT91_RTC_SECEV);
	if (at91_rtc_imr) {
		if (device_may_wakeup(dev))
	at91_rtc_bkpimr = at91_rtc_imr & (AT91_RTC_ALARM|AT91_RTC_SECEV);
	if (at91_rtc_bkpimr) {
		if (device_may_wakeup(dev)) {
			enable_irq_wake(irq);
		else
			at91_rtc_write(AT91_RTC_IDR, at91_rtc_imr);
		} else {
			at91_rtc_write(AT91_RTC_IDR, at91_rtc_bkpimr);
			at91_rtc_imr &= ~at91_rtc_bkpimr;
		}
}
	return 0;
}

static int at91_rtc_resume(struct device *dev)
{
	if (at91_rtc_imr) {
		if (device_may_wakeup(dev))
	if (at91_rtc_bkpimr) {
		if (device_may_wakeup(dev)) {
			disable_irq_wake(irq);
		else
			at91_rtc_write(AT91_RTC_IER, at91_rtc_imr);
		} else {
			at91_rtc_imr |= at91_rtc_bkpimr;
			at91_rtc_write(AT91_RTC_IER, at91_rtc_bkpimr);
		}
	}
	return 0;
}
+0 −1
Original line number Diff line number Diff line
@@ -64,7 +64,6 @@
#define	AT91_RTC_SCCR		0x1c			/* Status Clear Command Register */
#define	AT91_RTC_IER		0x20			/* Interrupt Enable Register */
#define	AT91_RTC_IDR		0x24			/* Interrupt Disable Register */
#define	AT91_RTC_IMR		0x28			/* Interrupt Mask Register */

#define	AT91_RTC_VER		0x2c			/* Valid Entry Register */
#define		AT91_RTC_NVTIM		(1 <<  0)		/* Non valid Time */
+3 −5
Original line number Diff line number Diff line
@@ -239,11 +239,9 @@ static int da9052_rtc_probe(struct platform_device *pdev)

	rtc->da9052 = dev_get_drvdata(pdev->dev.parent);
	platform_set_drvdata(pdev, rtc);
	rtc->irq = platform_get_irq_byname(pdev, "ALM");
	ret = devm_request_threaded_irq(&pdev->dev, rtc->irq, NULL,
				da9052_rtc_irq,
				IRQF_TRIGGER_LOW | IRQF_ONESHOT,
				"ALM", rtc);
	rtc->irq =  DA9052_IRQ_ALARM;
	ret = da9052_request_irq(rtc->da9052, rtc->irq, "ALM",
				da9052_rtc_irq, rtc);
	if (ret != 0) {
		rtc_err(rtc->da9052, "irq registration failed: %d\n", ret);
		return ret;
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include <linux/slab.h>
#include <linux/clk.h>
#include <linux/fb.h>
#include <linux/io.h>

#include <linux/platform_data/video-ep93xx.h>

+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ void irq_work_sync(struct irq_work *work);
#ifdef CONFIG_IRQ_WORK
bool irq_work_needs_cpu(void);
#else
static bool irq_work_needs_cpu(void) { return false; }
static inline bool irq_work_needs_cpu(void) { return false; }
#endif

#endif /* _LINUX_IRQ_WORK_H */
Loading