aboutsummaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@google.com>2017-11-21 12:53:14 +0100
committerGreg Kroah-Hartman <gregkh@google.com>2017-11-21 12:53:14 +0100
commitfbb7468cbc28bc782735bd0789b6d9ca048fc587 (patch)
tree5488b58ed27e2068d850575a86e2fe7b197c88df /drivers/rtc
parenta82871426a057d6772860c1be00b590381b7d25e (diff)
parent563c24f65f4fb009047cf4702dd16c7c592fd2b2 (diff)
Merge 4.9.64 into android-4.9
Changes in 4.9.64 media: imon: Fix null-ptr-deref in imon_probe media: dib0700: fix invalid dvb_detach argument arm: crypto: reduce priority of bit-sliced AES cipher Bluetooth: btusb: fix QCA Rome suspend/resume extcon: Remove potential problem when calling extcon_register_notifier() extcon: palmas: Check the parent instance to prevent the NULL fm10k: request reset when mbx->state changes ARM: dts: Fix compatible for ti81xx uarts for 8250 ARM: dts: Fix am335x and dm814x scm syscon to probe children ARM: OMAP2+: Fix init for multiple quirks for the same SoC ARM: dts: Fix omap3 off mode pull defines ARM: dts: omap5-uevm: Allow bootloader to configure USB Ethernet MAC ata: ATA_BMDMA should depend on HAS_DMA ata: SATA_HIGHBANK should depend on HAS_DMA ata: SATA_MV should depend on HAS_DMA drm/sti: sti_vtg: Handle return NULL error from devm_ioremap_nocache igb: reset the PHY before reading the PHY ID igb: close/suspend race in netif_device_detach igb: Fix hw_dbg logging in igb_update_flash_i210 scsi: ufs-qcom: Fix module autoload scsi: ufs: add capability to keep auto bkops always enabled tcp: provide timestamps for partial writes staging: rtl8188eu: fix incorrect ERROR tags from logs x86/irq, trace: Add __irq_entry annotation to x86's platform IRQ handlers scsi: lpfc: Add missing memory barrier scsi: lpfc: FCoE VPort enable-disable does not bring up the VPort scsi: lpfc: Correct host name in symbolic_name field scsi: lpfc: Correct issue leading to oops during link reset scsi: lpfc: Clear the VendorVersion in the PLOGI/PLOGI ACC payload rtc: rx8010: change lock mechanism power: supply: axp288_fuel_gauge: Read 15 bit values 2 registers at a time power: supply: axp288_fuel_gauge: Read 12 bit values 2 registers at a time ALSA: vx: Don't try to update capture stream before running ALSA: vx: Fix possible transfer overflow drm/omap: panel-sony-acx565akm.c: Add MODULE_ALIAS backlight: lcd: Fix race condition during register backlight: adp5520: Fix error handling in adp5520_bl_probe() gpu: drm: mgag200: mgag200_main:- Handle error from pci_iomap ALSA: hda/realtek - Add new codec ID ALC299 arm64: dts: NS2: reserve memory for Nitro firmware ixgbe: Configure advertised speeds correctly for KR/KX backplane ixgbe: fix AER error handling ixgbe: handle close/suspend race with netif_device_detach/present ixgbe: Fix reporting of 100Mb capability ixgbe: Reduce I2C retry count on X550 devices ixgbe: add mask for 64 RSS queues ixgbe: do not disable FEC from the driver staging: rtl8712: fixed little endian problem staging: wilc1000: Fix endian sparse warning staging: greybus: add host device function pointer checks MIPS: End asm function prologue macros with .insn MIPS: init: Ensure bootmem does not corrupt reserved memory MIPS: init: Ensure reserved memory regions are not added to bootmem MIPS: traps: Ensure L1 & L2 ECC checking match for CM3 systems MIPS: Netlogic: Exclude netlogic,xlp-pic code from XLR builds Revert "crypto: xts - Add ECB dependency" Revert "uapi: fix linux/rds.h userspace compilation errors" uapi: fix linux/rds.h userspace compilation error uapi: fix linux/rds.h userspace compilation errors Revert "dt-bindings: Add vendor prefix for LEGO" Revert "dt-bindings: Add LEGO MINDSTORMS EV3 compatible specification" crypto: dh - Don't permit 'p' to be 0 crypto: dh - Don't permit 'key' or 'g' size longer than 'p' USB: usbfs: compute urb->actual_length for isochronous USB: Add delay-init quirk for Corsair K70 LUX keyboards usb: gadget: f_fs: Fix use-after-free in ffs_free_inst USB: serial: qcserial: add pid/vid for Sierra Wireless EM7355 fw update USB: serial: garmin_gps: fix I/O after failed probe and remove USB: serial: garmin_gps: fix memory leak on probe errors x86/MCE/AMD: Always give panic severity for UC errors in kernel context brcmfmac: don't preset all channels as disabled staging: greybus: spilib: fix use-after-free after deregistration Linux 4.9.64 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-rx8010.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/drivers/rtc/rtc-rx8010.c b/drivers/rtc/rtc-rx8010.c
index 7163b91bb773..d08da371912c 100644
--- a/drivers/rtc/rtc-rx8010.c
+++ b/drivers/rtc/rtc-rx8010.c
@@ -63,7 +63,6 @@ struct rx8010_data {
struct i2c_client *client;
struct rtc_device *rtc;
u8 ctrlreg;
- spinlock_t flags_lock;
};
static irqreturn_t rx8010_irq_1_handler(int irq, void *dev_id)
@@ -72,12 +71,12 @@ static irqreturn_t rx8010_irq_1_handler(int irq, void *dev_id)
struct rx8010_data *rx8010 = i2c_get_clientdata(client);
int flagreg;
- spin_lock(&rx8010->flags_lock);
+ mutex_lock(&rx8010->rtc->ops_lock);
flagreg = i2c_smbus_read_byte_data(client, RX8010_FLAG);
if (flagreg <= 0) {
- spin_unlock(&rx8010->flags_lock);
+ mutex_unlock(&rx8010->rtc->ops_lock);
return IRQ_NONE;
}
@@ -101,7 +100,7 @@ static irqreturn_t rx8010_irq_1_handler(int irq, void *dev_id)
i2c_smbus_write_byte_data(client, RX8010_FLAG, flagreg);
- spin_unlock(&rx8010->flags_lock);
+ mutex_unlock(&rx8010->rtc->ops_lock);
return IRQ_HANDLED;
}
@@ -143,7 +142,6 @@ static int rx8010_set_time(struct device *dev, struct rtc_time *dt)
u8 date[7];
int ctrl, flagreg;
int ret;
- unsigned long irqflags;
if ((dt->tm_year < 100) || (dt->tm_year > 199))
return -EINVAL;
@@ -181,11 +179,8 @@ static int rx8010_set_time(struct device *dev, struct rtc_time *dt)
if (ret < 0)
return ret;
- spin_lock_irqsave(&rx8010->flags_lock, irqflags);
-
flagreg = i2c_smbus_read_byte_data(rx8010->client, RX8010_FLAG);
if (flagreg < 0) {
- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags);
return flagreg;
}
@@ -193,8 +188,6 @@ static int rx8010_set_time(struct device *dev, struct rtc_time *dt)
ret = i2c_smbus_write_byte_data(rx8010->client, RX8010_FLAG,
flagreg & ~RX8010_FLAG_VLF);
- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags);
-
return 0;
}
@@ -288,12 +281,9 @@ static int rx8010_set_alarm(struct device *dev, struct rtc_wkalrm *t)
u8 alarmvals[3];
int extreg, flagreg;
int err;
- unsigned long irqflags;
- spin_lock_irqsave(&rx8010->flags_lock, irqflags);
flagreg = i2c_smbus_read_byte_data(client, RX8010_FLAG);
if (flagreg < 0) {
- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags);
return flagreg;
}
@@ -302,14 +292,12 @@ static int rx8010_set_alarm(struct device *dev, struct rtc_wkalrm *t)
err = i2c_smbus_write_byte_data(rx8010->client, RX8010_CTRL,
rx8010->ctrlreg);
if (err < 0) {
- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags);
return err;
}
}
flagreg &= ~RX8010_FLAG_AF;
err = i2c_smbus_write_byte_data(rx8010->client, RX8010_FLAG, flagreg);
- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags);
if (err < 0)
return err;
@@ -404,7 +392,6 @@ static int rx8010_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
struct rx8010_data *rx8010 = dev_get_drvdata(dev);
int ret, tmp;
int flagreg;
- unsigned long irqflags;
switch (cmd) {
case RTC_VL_READ:
@@ -419,16 +406,13 @@ static int rx8010_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
return 0;
case RTC_VL_CLR:
- spin_lock_irqsave(&rx8010->flags_lock, irqflags);
flagreg = i2c_smbus_read_byte_data(rx8010->client, RX8010_FLAG);
if (flagreg < 0) {
- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags);
return flagreg;
}
flagreg &= ~RX8010_FLAG_VLF;
ret = i2c_smbus_write_byte_data(client, RX8010_FLAG, flagreg);
- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags);
if (ret < 0)
return ret;
@@ -466,8 +450,6 @@ static int rx8010_probe(struct i2c_client *client,
rx8010->client = client;
i2c_set_clientdata(client, rx8010);
- spin_lock_init(&rx8010->flags_lock);
-
err = rx8010_init_client(client);
if (err)
return err;