aboutsummaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@google.com>2018-02-22 18:10:27 +0100
committerGreg Kroah-Hartman <gregkh@google.com>2018-02-22 18:10:27 +0100
commitda9fb78452e8b97bb9be4189ab1c1a12d71a41b1 (patch)
tree2b46d64799f29f30550201efb7ae5d59ec54bbce /drivers/rtc
parent7595d550012d4a0b4b1fb40547495259a3674dc4 (diff)
parent80c1c8322c331586a86e58d3f95026a1265ab396 (diff)
Merge 4.9.83 into android-4.9
Changes in 4.9.83 scsi: smartpqi: allow static build ("built-in") drm/radeon: Add dpm quirk for Jet PRO (v2) drm/radeon: adjust tested variable rtc-opal: Fix handling of firmware error codes, prevent busy loops mbcache: initialize entry->e_referenced in mb_cache_entry_create() jbd2: fix sphinx kernel-doc build warnings ext4: fix a race in the ext4 shutdown path ext4: save error to disk in __ext4_grp_locked_error() ext4: correct documentation for grpid mount option mm: hide a #warning for COMPILE_TEST mm: Fix memory size alignment in devm_memremap_pages_release() MIPS: Fix typo BIG_ENDIAN to CPU_BIG_ENDIAN PCI: keystone: Fix interrupt-controller-node lookup video: fbdev: atmel_lcdfb: fix display-timings lookup console/dummy: leave .con_font_get set to NULL rtlwifi: rtl8821ae: Fix connection lost problem correctly target/iscsi: avoid NULL dereference in CHAP auth error path Btrfs: fix deadlock in run_delalloc_nocow Btrfs: fix crash due to not cleaning up tree log block's dirty bits Btrfs: fix extent state leak from tree log Btrfs: fix btrfs_evict_inode to handle abnormal inodes correctly Btrfs: fix unexpected -EEXIST when creating new inode 9p/trans_virtio: discard zero-length reply mtd: nand: vf610: set correct ooblayout ALSA: hda - Fix headset mic detection problem for two Dell machines ALSA: usb-audio: Fix UAC2 get_ctl request with a RANGE attribute ALSA: hda/realtek - Enable Thinkpad Dock device for ALC298 platform ALSA: hda/realtek: PCI quirk for Fujitsu U7x7 ALSA: usb-audio: add implicit fb quirk for Behringer UFX1204 ALSA: seq: Fix racy pool initializations mvpp2: fix multicast address filter usb: Move USB_UHCI_BIG_ENDIAN_* out of USB_SUPPORT dm: correctly handle chained bios in dec_pending() powerpc: fix build errors in stable tree IB/qib: Fix comparison error with qperf compare/swap test IB/mlx4: Fix incorrectly releasing steerable UD QPs when have only ETH ports kselftest: fix OOM in memory compaction test RDMA/rxe: Fix a race condition related to the QP error state cpufreq: powernv: Dont assume distinct pstate values for nominal and pmin PM / devfreq: Propagate error from devfreq_add_device() ocfs2: try a blocking lock before return AOP_TRUNCATED_PAGE s390: fix handling of -1 in set{,fs}[gu]id16 syscalls arm64: dts: msm8916: Correct ipc references for smsm ARM: lpc3250: fix uda1380 gpio numbers ARM: dts: STi: Add gpio polarity for "hdmi,hpd-gpio" property ARM: dts: nomadik: add interrupt-parent for clcd arm: spear600: Add missing interrupt-parent of rtc arm: spear13xx: Fix dmas cells arm: spear13xx: Fix spics gpio controller's warning x86/entry/64/compat: Clear registers for compat syscalls, to reduce speculation attack surface compiler-gcc.h: Introduce __optimize function attribute x86/speculation: Update Speculation Control microcode blacklist x86/speculation: Correct Speculation Control microcode blacklist again KVM/x86: Reduce retpoline performance impact in slot_handle_level_range(), by always inlining iterator helper methods X86/nVMX: Properly set spec_ctrl and pred_cmd before merging MSRs x86/speculation: Clean up various Spectre related details selftests/x86/pkeys: Remove unused functions selftests/x86: Do not rely on "int $0x80" in test_mremap_vdso.c selftests/x86: Do not rely on "int $0x80" in single_step_syscall.c x86/speculation: Fix up array_index_nospec_mask() asm constraint nospec: Move array_index_nospec() parameter checking into separate macro x86/speculation: Add <asm/msr-index.h> dependency selftests/x86/mpx: Fix incorrect bounds with old _sigfault x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping x86/spectre: Fix an error message x86/cpu: Change type of x86_cache_size variable to unsigned int x86: fix build warnign with 32-bit PAE vfs: don't do RCU lookup of empty pathnames ARM: dts: exynos: fix RTC interrupt for exynos5410 ARM: pxa/tosa-bt: add MODULE_LICENSE tag arm64: dts: msm8916: Add missing #phy-cells ARM: dts: s5pv210: add interrupt-parent for ohci arm: dts: mt2701: Add reset-cells ARM: dts: Delete bogus reference to the charlcd media: r820t: fix r820t_write_reg for KASAN Linux 4.9.83 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-opal.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-opal.c b/drivers/rtc/rtc-opal.c
index ea20f627dabe..e4324dcf9508 100644
--- a/drivers/rtc/rtc-opal.c
+++ b/drivers/rtc/rtc-opal.c
@@ -58,6 +58,7 @@ static void tm_to_opal(struct rtc_time *tm, u32 *y_m_d, u64 *h_m_s_ms)
static int opal_get_rtc_time(struct device *dev, struct rtc_time *tm)
{
long rc = OPAL_BUSY;
+ int retries = 10;
u32 y_m_d;
u64 h_m_s_ms;
__be32 __y_m_d;
@@ -67,8 +68,11 @@ static int opal_get_rtc_time(struct device *dev, struct rtc_time *tm)
rc = opal_rtc_read(&__y_m_d, &__h_m_s_ms);
if (rc == OPAL_BUSY_EVENT)
opal_poll_events(NULL);
- else
+ else if (retries-- && (rc == OPAL_HARDWARE
+ || rc == OPAL_INTERNAL_ERROR))
msleep(10);
+ else if (rc != OPAL_BUSY && rc != OPAL_BUSY_EVENT)
+ break;
}
if (rc != OPAL_SUCCESS)
@@ -84,6 +88,7 @@ static int opal_get_rtc_time(struct device *dev, struct rtc_time *tm)
static int opal_set_rtc_time(struct device *dev, struct rtc_time *tm)
{
long rc = OPAL_BUSY;
+ int retries = 10;
u32 y_m_d = 0;
u64 h_m_s_ms = 0;
@@ -92,8 +97,11 @@ static int opal_set_rtc_time(struct device *dev, struct rtc_time *tm)
rc = opal_rtc_write(y_m_d, h_m_s_ms);
if (rc == OPAL_BUSY_EVENT)
opal_poll_events(NULL);
- else
+ else if (retries-- && (rc == OPAL_HARDWARE
+ || rc == OPAL_INTERNAL_ERROR))
msleep(10);
+ else if (rc != OPAL_BUSY && rc != OPAL_BUSY_EVENT)
+ break;
}
return rc == OPAL_SUCCESS ? 0 : -EIO;