summaryrefslogtreecommitdiff
path: root/die.h
blob: 919f3aea122f3ad937ce01e78875d350d88e16f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef DIE_H
#define DIE_H

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdbool.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <syslog.h>

#include "built_in.h"

static inline void panic(const char *format, ...)  __check_format_printf(1, 2);
static inline void syslog_panic(const char *format,
				...) __check_format_printf(1, 2);
static inline void syslog_maybe(bool cond, int priority,
				const char *format, ...) __check_format_printf(3, 4);

static inline void __noreturn __die_hard(void)
{
	exit(EXIT_FAILURE);
}

static inline void __noreturn __die_harder(void)
{
	_exit(EXIT_FAILURE);
}

static inline void __noreturn die(void)
{
	__die_hard();
}

static inline void __noreturn _die(void)
{
	__die_harder();
}

static inline void __noreturn panic(const char *format, ...)
{
	va_list vl;

	va_start(vl, format);
	vfprintf(stderr, format, vl);
	va_end(vl);

	die();
}

static inline void __noreturn syslog_panic(const char *format, ...)
{
	va_list vl;

	va_start(vl, format);
	vsyslog(LOG_ERR, format, vl);
	va_end(vl);

	die();
}

static inline void syslog_maybe(bool cond, int priority,
				const char *format, ...)
{
	if (cond) {
		va_list vl;

		va_start(vl, format);
		vsyslog(priority, format, vl);
		va_end(vl);
	}
}

#endif /* DIE_H */
didn't update the cached value after shuttting the port down. That's assuming the port got enabled at least once prior to hibernating. If that didn't happen then the cached value would still have been totally out of sync with reality (eg. first boot w/o eDP on, then hibernate, and then resume with eDP on). So, let's fix this properly and refresh the cached register value from the hardware register during resume. DDI platforms shouldn't use the cached value during port disable at least, so shouldn't have this particular issue. They might still have issues if we skip the initial modeset and then try to retrain the link or something. But untangling this DP vs. DDI mess is a bigger topic, so let's jut punt on DDI for now. Cc: Jani Nikula <jani.nikula@intel.com> Cc: stable@vger.kernel.org Fixes: 6fec76628333 ("drm/i915: Use intel_dp->DP in eDP PLL setup") Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1463162036-27931-1-git-send-email-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak <imre.deak@intel.com> (cherry picked from commit 64989ca4b27acb026b6496ec21e43bee66f86a5b) Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'Documentation/x86')