Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'akpm' (patches from Andrew)

Merge misc fixes from Andrew Morton:
"16 patches

This includes a new rtc driver for the Abracon AB x80x and isn't very
appropriate for -rc2. It was still being fiddled with a bit during
the merge window and I fell asleep during -rc1"

[ So I took the new driver, it seems small and won't regress anything.
I'm a softy. - Linus ]

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
rtc: armada38x: fix concurrency access in armada38x_rtc_set_time
ocfs2: dlm: fix race between purge and get lock resource
nilfs2: fix sanity check of btree level in nilfs_btree_root_broken()
util_macros.h: have array pointer point to array of constants
configfs: init configfs module earlier at boot time
mm/hwpoison-inject: check PageLRU of hpage
mm/hwpoison-inject: fix refcounting in no-injection case
mm: soft-offline: fix num_poisoned_pages counting on concurrent events
rtc: add rtc-abx80x, a driver for the Abracon AB x80x i2c rtc
Documentation: bindings: add abracon,abx80x
kasan: show gcc version requirements in Kconfig and Documentation
mm/memory-failure: call shake_page() when error hits thp tail page
lib: delete lib/find_last_bit.c
MAINTAINERS: add co-maintainer for LED subsystem
zram: add Designated Reviewer for zram in MAINTAINERS
revert "zram: move compact_store() to sysfs functions area"

+429 -75
+30
Documentation/devicetree/bindings/rtc/abracon,abx80x.txt
··· 1 + Abracon ABX80X I2C ultra low power RTC/Alarm chip 2 + 3 + The Abracon ABX80X family consist of the ab0801, ab0803, ab0804, ab0805, ab1801, 4 + ab1803, ab1804 and ab1805. The ab0805 is the superset of ab080x and the ab1805 5 + is the superset of ab180x. 6 + 7 + Required properties: 8 + 9 + - "compatible": should one of: 10 + "abracon,abx80x" 11 + "abracon,ab0801" 12 + "abracon,ab0803" 13 + "abracon,ab0804" 14 + "abracon,ab0805" 15 + "abracon,ab1801" 16 + "abracon,ab1803" 17 + "abracon,ab1804" 18 + "abracon,ab1805" 19 + Using "abracon,abx80x" will enable chip autodetection. 20 + - "reg": I2C bus address of the device 21 + 22 + Optional properties: 23 + 24 + The abx804 and abx805 have a trickle charger that is able to charge the 25 + connected battery or supercap. Both the following properties have to be defined 26 + and valid to enable charging: 27 + 28 + - "abracon,tc-diode": should be "standard" (0.6V) or "schottky" (0.3V) 29 + - "abracon,tc-resistor": should be <0>, <3>, <6> or <11>. 0 disables the output 30 + resistor, the other values are in ohm.
+5 -3
Documentation/kasan.txt
··· 9 9 bugs. 10 10 11 11 KASan uses compile-time instrumentation for checking every memory access, 12 - therefore you will need a certain version of GCC > 4.9.2 12 + therefore you will need a gcc version of 4.9.2 or later. KASan could detect out 13 + of bounds accesses to stack or global variables, but only if gcc 5.0 or later was 14 + used to built the kernel. 13 15 14 16 Currently KASan is supported only for x86_64 architecture and requires that the 15 17 kernel be built with the SLUB allocator. ··· 25 23 26 24 and choose between CONFIG_KASAN_OUTLINE and CONFIG_KASAN_INLINE. Outline/inline 27 25 is compiler instrumentation types. The former produces smaller binary the 28 - latter is 1.1 - 2 times faster. Inline instrumentation requires GCC 5.0 or 29 - latter. 26 + latter is 1.1 - 2 times faster. Inline instrumentation requires a gcc version 27 + of 5.0 or later. 30 28 31 29 Currently KASAN works only with the SLUB memory allocator. 32 30 For better bug detection and nicer report, enable CONFIG_STACKTRACE and put
+2
MAINTAINERS
··· 5805 5805 LED SUBSYSTEM 5806 5806 M: Bryan Wu <cooloney@gmail.com> 5807 5807 M: Richard Purdie <rpurdie@rpsys.net> 5808 + M: Jacek Anaszewski <j.anaszewski@samsung.com> 5808 5809 L: linux-leds@vger.kernel.org 5809 5810 T: git git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds.git 5810 5811 S: Maintained ··· 11038 11037 ZRAM COMPRESSED RAM BLOCK DEVICE DRVIER 11039 11038 M: Minchan Kim <minchan@kernel.org> 11040 11039 M: Nitin Gupta <ngupta@vflare.org> 11040 + R: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> 11041 11041 L: linux-kernel@vger.kernel.org 11042 11042 S: Maintained 11043 11043 F: drivers/block/zram/
+23
drivers/block/zram/zram_drv.c
··· 74 74 return (struct zram *)dev_to_disk(dev)->private_data; 75 75 } 76 76 77 + static ssize_t compact_store(struct device *dev, 78 + struct device_attribute *attr, const char *buf, size_t len) 79 + { 80 + unsigned long nr_migrated; 81 + struct zram *zram = dev_to_zram(dev); 82 + struct zram_meta *meta; 83 + 84 + down_read(&zram->init_lock); 85 + if (!init_done(zram)) { 86 + up_read(&zram->init_lock); 87 + return -EINVAL; 88 + } 89 + 90 + meta = zram->meta; 91 + nr_migrated = zs_compact(meta->mem_pool); 92 + atomic64_add(nr_migrated, &zram->stats.num_migrated); 93 + up_read(&zram->init_lock); 94 + 95 + return len; 96 + } 97 + 77 98 static ssize_t disksize_show(struct device *dev, 78 99 struct device_attribute *attr, char *buf) 79 100 { ··· 1059 1038 .owner = THIS_MODULE 1060 1039 }; 1061 1040 1041 + static DEVICE_ATTR_WO(compact); 1062 1042 static DEVICE_ATTR_RW(disksize); 1063 1043 static DEVICE_ATTR_RO(initstate); 1064 1044 static DEVICE_ATTR_WO(reset); ··· 1136 1114 &dev_attr_num_writes.attr, 1137 1115 &dev_attr_failed_reads.attr, 1138 1116 &dev_attr_failed_writes.attr, 1117 + &dev_attr_compact.attr, 1139 1118 &dev_attr_invalid_io.attr, 1140 1119 &dev_attr_notify_free.attr, 1141 1120 &dev_attr_zero_pages.attr,
+10
drivers/rtc/Kconfig
··· 164 164 This driver can also be built as a module. If so, the module 165 165 will be called rtc-ab-b5ze-s3. 166 166 167 + config RTC_DRV_ABX80X 168 + tristate "Abracon ABx80x" 169 + help 170 + If you say yes here you get support for Abracon AB080X and AB180X 171 + families of ultra-low-power battery- and capacitor-backed real-time 172 + clock chips. 173 + 174 + This driver can also be built as a module. If so, the module 175 + will be called rtc-abx80x. 176 + 167 177 config RTC_DRV_AS3722 168 178 tristate "ams AS3722 RTC driver" 169 179 depends on MFD_AS3722
+1
drivers/rtc/Makefile
··· 25 25 obj-$(CONFIG_RTC_DRV_AB3100) += rtc-ab3100.o 26 26 obj-$(CONFIG_RTC_DRV_AB8500) += rtc-ab8500.o 27 27 obj-$(CONFIG_RTC_DRV_ABB5ZES3) += rtc-ab-b5ze-s3.o 28 + obj-$(CONFIG_RTC_DRV_ABX80X) += rtc-abx80x.o 28 29 obj-$(CONFIG_RTC_DRV_ARMADA38X) += rtc-armada38x.o 29 30 obj-$(CONFIG_RTC_DRV_AS3722) += rtc-as3722.o 30 31 obj-$(CONFIG_RTC_DRV_AT32AP700X)+= rtc-at32ap700x.o
+307
drivers/rtc/rtc-abx80x.c
··· 1 + /* 2 + * A driver for the I2C members of the Abracon AB x8xx RTC family, 3 + * and compatible: AB 1805 and AB 0805 4 + * 5 + * Copyright 2014-2015 Macq S.A. 6 + * 7 + * Author: Philippe De Muyter <phdm@macqel.be> 8 + * Author: Alexandre Belloni <alexandre.belloni@free-electrons.com> 9 + * 10 + * This program is free software; you can redistribute it and/or modify 11 + * it under the terms of the GNU General Public License version 2 as 12 + * published by the Free Software Foundation. 13 + * 14 + */ 15 + 16 + #include <linux/bcd.h> 17 + #include <linux/i2c.h> 18 + #include <linux/module.h> 19 + #include <linux/rtc.h> 20 + 21 + #define ABX8XX_REG_HTH 0x00 22 + #define ABX8XX_REG_SC 0x01 23 + #define ABX8XX_REG_MN 0x02 24 + #define ABX8XX_REG_HR 0x03 25 + #define ABX8XX_REG_DA 0x04 26 + #define ABX8XX_REG_MO 0x05 27 + #define ABX8XX_REG_YR 0x06 28 + #define ABX8XX_REG_WD 0x07 29 + 30 + #define ABX8XX_REG_CTRL1 0x10 31 + #define ABX8XX_CTRL_WRITE BIT(1) 32 + #define ABX8XX_CTRL_12_24 BIT(6) 33 + 34 + #define ABX8XX_REG_CFG_KEY 0x1f 35 + #define ABX8XX_CFG_KEY_MISC 0x9d 36 + 37 + #define ABX8XX_REG_ID0 0x28 38 + 39 + #define ABX8XX_REG_TRICKLE 0x20 40 + #define ABX8XX_TRICKLE_CHARGE_ENABLE 0xa0 41 + #define ABX8XX_TRICKLE_STANDARD_DIODE 0x8 42 + #define ABX8XX_TRICKLE_SCHOTTKY_DIODE 0x4 43 + 44 + static u8 trickle_resistors[] = {0, 3, 6, 11}; 45 + 46 + enum abx80x_chip {AB0801, AB0803, AB0804, AB0805, 47 + AB1801, AB1803, AB1804, AB1805, ABX80X}; 48 + 49 + struct abx80x_cap { 50 + u16 pn; 51 + bool has_tc; 52 + }; 53 + 54 + static struct abx80x_cap abx80x_caps[] = { 55 + [AB0801] = {.pn = 0x0801}, 56 + [AB0803] = {.pn = 0x0803}, 57 + [AB0804] = {.pn = 0x0804, .has_tc = true}, 58 + [AB0805] = {.pn = 0x0805, .has_tc = true}, 59 + [AB1801] = {.pn = 0x1801}, 60 + [AB1803] = {.pn = 0x1803}, 61 + [AB1804] = {.pn = 0x1804, .has_tc = true}, 62 + [AB1805] = {.pn = 0x1805, .has_tc = true}, 63 + [ABX80X] = {.pn = 0} 64 + }; 65 + 66 + static struct i2c_driver abx80x_driver; 67 + 68 + static int abx80x_enable_trickle_charger(struct i2c_client *client, 69 + u8 trickle_cfg) 70 + { 71 + int err; 72 + 73 + /* 74 + * Write the configuration key register to enable access to the Trickle 75 + * register 76 + */ 77 + err = i2c_smbus_write_byte_data(client, ABX8XX_REG_CFG_KEY, 78 + ABX8XX_CFG_KEY_MISC); 79 + if (err < 0) { 80 + dev_err(&client->dev, "Unable to write configuration key\n"); 81 + return -EIO; 82 + } 83 + 84 + err = i2c_smbus_write_byte_data(client, ABX8XX_REG_TRICKLE, 85 + ABX8XX_TRICKLE_CHARGE_ENABLE | 86 + trickle_cfg); 87 + if (err < 0) { 88 + dev_err(&client->dev, "Unable to write trickle register\n"); 89 + return -EIO; 90 + } 91 + 92 + return 0; 93 + } 94 + 95 + static int abx80x_rtc_read_time(struct device *dev, struct rtc_time *tm) 96 + { 97 + struct i2c_client *client = to_i2c_client(dev); 98 + unsigned char buf[8]; 99 + int err; 100 + 101 + err = i2c_smbus_read_i2c_block_data(client, ABX8XX_REG_HTH, 102 + sizeof(buf), buf); 103 + if (err < 0) { 104 + dev_err(&client->dev, "Unable to read date\n"); 105 + return -EIO; 106 + } 107 + 108 + tm->tm_sec = bcd2bin(buf[ABX8XX_REG_SC] & 0x7F); 109 + tm->tm_min = bcd2bin(buf[ABX8XX_REG_MN] & 0x7F); 110 + tm->tm_hour = bcd2bin(buf[ABX8XX_REG_HR] & 0x3F); 111 + tm->tm_wday = buf[ABX8XX_REG_WD] & 0x7; 112 + tm->tm_mday = bcd2bin(buf[ABX8XX_REG_DA] & 0x3F); 113 + tm->tm_mon = bcd2bin(buf[ABX8XX_REG_MO] & 0x1F) - 1; 114 + tm->tm_year = bcd2bin(buf[ABX8XX_REG_YR]) + 100; 115 + 116 + err = rtc_valid_tm(tm); 117 + if (err < 0) 118 + dev_err(&client->dev, "retrieved date/time is not valid.\n"); 119 + 120 + return err; 121 + } 122 + 123 + static int abx80x_rtc_set_time(struct device *dev, struct rtc_time *tm) 124 + { 125 + struct i2c_client *client = to_i2c_client(dev); 126 + unsigned char buf[8]; 127 + int err; 128 + 129 + if (tm->tm_year < 100) 130 + return -EINVAL; 131 + 132 + buf[ABX8XX_REG_HTH] = 0; 133 + buf[ABX8XX_REG_SC] = bin2bcd(tm->tm_sec); 134 + buf[ABX8XX_REG_MN] = bin2bcd(tm->tm_min); 135 + buf[ABX8XX_REG_HR] = bin2bcd(tm->tm_hour); 136 + buf[ABX8XX_REG_DA] = bin2bcd(tm->tm_mday); 137 + buf[ABX8XX_REG_MO] = bin2bcd(tm->tm_mon + 1); 138 + buf[ABX8XX_REG_YR] = bin2bcd(tm->tm_year - 100); 139 + buf[ABX8XX_REG_WD] = tm->tm_wday; 140 + 141 + err = i2c_smbus_write_i2c_block_data(client, ABX8XX_REG_HTH, 142 + sizeof(buf), buf); 143 + if (err < 0) { 144 + dev_err(&client->dev, "Unable to write to date registers\n"); 145 + return -EIO; 146 + } 147 + 148 + return 0; 149 + } 150 + 151 + static const struct rtc_class_ops abx80x_rtc_ops = { 152 + .read_time = abx80x_rtc_read_time, 153 + .set_time = abx80x_rtc_set_time, 154 + }; 155 + 156 + static int abx80x_dt_trickle_cfg(struct device_node *np) 157 + { 158 + const char *diode; 159 + int trickle_cfg = 0; 160 + int i, ret; 161 + u32 tmp; 162 + 163 + ret = of_property_read_string(np, "abracon,tc-diode", &diode); 164 + if (ret) 165 + return ret; 166 + 167 + if (!strcmp(diode, "standard")) 168 + trickle_cfg |= ABX8XX_TRICKLE_STANDARD_DIODE; 169 + else if (!strcmp(diode, "schottky")) 170 + trickle_cfg |= ABX8XX_TRICKLE_SCHOTTKY_DIODE; 171 + else 172 + return -EINVAL; 173 + 174 + ret = of_property_read_u32(np, "abracon,tc-resistor", &tmp); 175 + if (ret) 176 + return ret; 177 + 178 + for (i = 0; i < sizeof(trickle_resistors); i++) 179 + if (trickle_resistors[i] == tmp) 180 + break; 181 + 182 + if (i == sizeof(trickle_resistors)) 183 + return -EINVAL; 184 + 185 + return (trickle_cfg | i); 186 + } 187 + 188 + static int abx80x_probe(struct i2c_client *client, 189 + const struct i2c_device_id *id) 190 + { 191 + struct device_node *np = client->dev.of_node; 192 + struct rtc_device *rtc; 193 + int i, data, err, trickle_cfg = -EINVAL; 194 + char buf[7]; 195 + unsigned int part = id->driver_data; 196 + unsigned int partnumber; 197 + unsigned int majrev, minrev; 198 + unsigned int lot; 199 + unsigned int wafer; 200 + unsigned int uid; 201 + 202 + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) 203 + return -ENODEV; 204 + 205 + err = i2c_smbus_read_i2c_block_data(client, ABX8XX_REG_ID0, 206 + sizeof(buf), buf); 207 + if (err < 0) { 208 + dev_err(&client->dev, "Unable to read partnumber\n"); 209 + return -EIO; 210 + } 211 + 212 + partnumber = (buf[0] << 8) | buf[1]; 213 + majrev = buf[2] >> 3; 214 + minrev = buf[2] & 0x7; 215 + lot = ((buf[4] & 0x80) << 2) | ((buf[6] & 0x80) << 1) | buf[3]; 216 + uid = ((buf[4] & 0x7f) << 8) | buf[5]; 217 + wafer = (buf[6] & 0x7c) >> 2; 218 + dev_info(&client->dev, "model %04x, revision %u.%u, lot %x, wafer %x, uid %x\n", 219 + partnumber, majrev, minrev, lot, wafer, uid); 220 + 221 + data = i2c_smbus_read_byte_data(client, ABX8XX_REG_CTRL1); 222 + if (data < 0) { 223 + dev_err(&client->dev, "Unable to read control register\n"); 224 + return -EIO; 225 + } 226 + 227 + err = i2c_smbus_write_byte_data(client, ABX8XX_REG_CTRL1, 228 + ((data & ~ABX8XX_CTRL_12_24) | 229 + ABX8XX_CTRL_WRITE)); 230 + if (err < 0) { 231 + dev_err(&client->dev, "Unable to write control register\n"); 232 + return -EIO; 233 + } 234 + 235 + /* part autodetection */ 236 + if (part == ABX80X) { 237 + for (i = 0; abx80x_caps[i].pn; i++) 238 + if (partnumber == abx80x_caps[i].pn) 239 + break; 240 + if (abx80x_caps[i].pn == 0) { 241 + dev_err(&client->dev, "Unknown part: %04x\n", 242 + partnumber); 243 + return -EINVAL; 244 + } 245 + part = i; 246 + } 247 + 248 + if (partnumber != abx80x_caps[part].pn) { 249 + dev_err(&client->dev, "partnumber mismatch %04x != %04x\n", 250 + partnumber, abx80x_caps[part].pn); 251 + return -EINVAL; 252 + } 253 + 254 + if (np && abx80x_caps[part].has_tc) 255 + trickle_cfg = abx80x_dt_trickle_cfg(np); 256 + 257 + if (trickle_cfg > 0) { 258 + dev_info(&client->dev, "Enabling trickle charger: %02x\n", 259 + trickle_cfg); 260 + abx80x_enable_trickle_charger(client, trickle_cfg); 261 + } 262 + 263 + rtc = devm_rtc_device_register(&client->dev, abx80x_driver.driver.name, 264 + &abx80x_rtc_ops, THIS_MODULE); 265 + 266 + if (IS_ERR(rtc)) 267 + return PTR_ERR(rtc); 268 + 269 + i2c_set_clientdata(client, rtc); 270 + 271 + return 0; 272 + } 273 + 274 + static int abx80x_remove(struct i2c_client *client) 275 + { 276 + return 0; 277 + } 278 + 279 + static const struct i2c_device_id abx80x_id[] = { 280 + { "abx80x", ABX80X }, 281 + { "ab0801", AB0801 }, 282 + { "ab0803", AB0803 }, 283 + { "ab0804", AB0804 }, 284 + { "ab0805", AB0805 }, 285 + { "ab1801", AB1801 }, 286 + { "ab1803", AB1803 }, 287 + { "ab1804", AB1804 }, 288 + { "ab1805", AB1805 }, 289 + { } 290 + }; 291 + MODULE_DEVICE_TABLE(i2c, abx80x_id); 292 + 293 + static struct i2c_driver abx80x_driver = { 294 + .driver = { 295 + .name = "rtc-abx80x", 296 + }, 297 + .probe = abx80x_probe, 298 + .remove = abx80x_remove, 299 + .id_table = abx80x_id, 300 + }; 301 + 302 + module_i2c_driver(abx80x_driver); 303 + 304 + MODULE_AUTHOR("Philippe De Muyter <phdm@macqel.be>"); 305 + MODULE_AUTHOR("Alexandre Belloni <alexandre.belloni@free-electrons.com>"); 306 + MODULE_DESCRIPTION("Abracon ABX80X RTC driver"); 307 + MODULE_LICENSE("GPL v2");
+12 -12
drivers/rtc/rtc-armada38x.c
··· 40 40 void __iomem *regs; 41 41 void __iomem *regs_soc; 42 42 spinlock_t lock; 43 + /* 44 + * While setting the time, the RTC TIME register should not be 45 + * accessed. Setting the RTC time involves sleeping during 46 + * 100ms, so a mutex instead of a spinlock is used to protect 47 + * it 48 + */ 49 + struct mutex mutex_time; 43 50 int irq; 44 51 }; 45 52 ··· 66 59 struct armada38x_rtc *rtc = dev_get_drvdata(dev); 67 60 unsigned long time, time_check, flags; 68 61 69 - spin_lock_irqsave(&rtc->lock, flags); 70 - 62 + mutex_lock(&rtc->mutex_time); 71 63 time = readl(rtc->regs + RTC_TIME); 72 64 /* 73 65 * WA for failing time set attempts. As stated in HW ERRATA if ··· 77 71 if ((time_check - time) > 1) 78 72 time_check = readl(rtc->regs + RTC_TIME); 79 73 80 - spin_unlock_irqrestore(&rtc->lock, flags); 74 + mutex_unlock(&rtc->mutex_time); 81 75 82 76 rtc_time_to_tm(time_check, tm); 83 77 ··· 100 94 * then wait for 100ms before writing to the time register to be 101 95 * sure that the data will be taken into account. 102 96 */ 103 - spin_lock_irqsave(&rtc->lock, flags); 104 - 97 + mutex_lock(&rtc->mutex_time); 105 98 rtc_delayed_write(0, rtc, RTC_STATUS); 106 - 107 - spin_unlock_irqrestore(&rtc->lock, flags); 108 - 109 99 msleep(100); 110 - 111 - spin_lock_irqsave(&rtc->lock, flags); 112 - 113 100 rtc_delayed_write(time, rtc, RTC_TIME); 101 + mutex_unlock(&rtc->mutex_time); 114 102 115 - spin_unlock_irqrestore(&rtc->lock, flags); 116 103 out: 117 104 return ret; 118 105 } ··· 229 230 return -ENOMEM; 230 231 231 232 spin_lock_init(&rtc->lock); 233 + mutex_init(&rtc->mutex_time); 232 234 233 235 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rtc"); 234 236 rtc->regs = devm_ioremap_resource(&pdev->dev, res);
+1 -1
fs/configfs/mount.c
··· 173 173 MODULE_VERSION("0.0.2"); 174 174 MODULE_DESCRIPTION("Simple RAM filesystem for user driven kernel subsystem configuration."); 175 175 176 - module_init(configfs_init); 176 + core_initcall(configfs_init); 177 177 module_exit(configfs_exit);
+1 -1
fs/nilfs2/btree.c
··· 388 388 nchildren = nilfs_btree_node_get_nchildren(node); 389 389 390 390 if (unlikely(level < NILFS_BTREE_LEVEL_NODE_MIN || 391 - level > NILFS_BTREE_LEVEL_MAX || 391 + level >= NILFS_BTREE_LEVEL_MAX || 392 392 nchildren < 0 || 393 393 nchildren > NILFS_BTREE_ROOT_NCHILDREN_MAX)) { 394 394 pr_crit("NILFS: bad btree root (inode number=%lu): level = %d, flags = 0x%x, nchildren = %d\n",
+13
fs/ocfs2/dlm/dlmmaster.c
··· 757 757 if (tmpres) { 758 758 spin_unlock(&dlm->spinlock); 759 759 spin_lock(&tmpres->spinlock); 760 + 761 + /* 762 + * Right after dlm spinlock was released, dlm_thread could have 763 + * purged the lockres. Check if lockres got unhashed. If so 764 + * start over. 765 + */ 766 + if (hlist_unhashed(&tmpres->hash_node)) { 767 + spin_unlock(&tmpres->spinlock); 768 + dlm_lockres_put(tmpres); 769 + tmpres = NULL; 770 + goto lookup; 771 + } 772 + 760 773 /* Wait on the thread that is mastering the resource */ 761 774 if (tmpres->owner == DLM_LOCK_RES_OWNER_UNKNOWN) { 762 775 __dlm_wait_on_lockres(tmpres);
+1 -1
include/linux/nilfs2_fs.h
··· 460 460 /* level */ 461 461 #define NILFS_BTREE_LEVEL_DATA 0 462 462 #define NILFS_BTREE_LEVEL_NODE_MIN (NILFS_BTREE_LEVEL_DATA + 1) 463 - #define NILFS_BTREE_LEVEL_MAX 14 463 + #define NILFS_BTREE_LEVEL_MAX 14 /* Max level (exclusive) */ 464 464 465 465 /** 466 466 * struct nilfs_palloc_group_desc - block group descriptor
+1 -1
include/linux/util_macros.h
··· 5 5 ({ \ 6 6 typeof(as) __fc_i, __fc_as = (as) - 1; \ 7 7 typeof(x) __fc_x = (x); \ 8 - typeof(*a) *__fc_a = (a); \ 8 + typeof(*a) const *__fc_a = (a); \ 9 9 for (__fc_i = 0; __fc_i < __fc_as; __fc_i++) { \ 10 10 if (__fc_x op DIV_ROUND_CLOSEST(__fc_a[__fc_i] + \ 11 11 __fc_a[__fc_i + 1], 2)) \
+6 -2
lib/Kconfig.kasan
··· 10 10 help 11 11 Enables kernel address sanitizer - runtime memory debugger, 12 12 designed to find out-of-bounds accesses and use-after-free bugs. 13 - This is strictly debugging feature. It consumes about 1/8 14 - of available memory and brings about ~x3 performance slowdown. 13 + This is strictly a debugging feature and it requires a gcc version 14 + of 4.9.2 or later. Detection of out of bounds accesses to stack or 15 + global variables requires gcc 5.0 or later. 16 + This feature consumes about 1/8 of available memory and brings about 17 + ~x3 performance slowdown. 15 18 For better error detection enable CONFIG_STACKTRACE, 16 19 and add slub_debug=U to boot cmdline. 17 20 ··· 43 40 memory accesses. This is faster than outline (in some workloads 44 41 it gives about x2 boost over outline instrumentation), but 45 42 make kernel's .text size much bigger. 43 + This requires a gcc version of 5.0 or later. 46 44 47 45 endchoice 48 46
-41
lib/find_last_bit.c
··· 1 - /* find_last_bit.c: fallback find next bit implementation 2 - * 3 - * Copyright (C) 2008 IBM Corporation 4 - * Written by Rusty Russell <rusty@rustcorp.com.au> 5 - * (Inspired by David Howell's find_next_bit implementation) 6 - * 7 - * Rewritten by Yury Norov <yury.norov@gmail.com> to decrease 8 - * size and improve performance, 2015. 9 - * 10 - * This program is free software; you can redistribute it and/or 11 - * modify it under the terms of the GNU General Public License 12 - * as published by the Free Software Foundation; either version 13 - * 2 of the License, or (at your option) any later version. 14 - */ 15 - 16 - #include <linux/bitops.h> 17 - #include <linux/bitmap.h> 18 - #include <linux/export.h> 19 - #include <linux/kernel.h> 20 - 21 - #ifndef find_last_bit 22 - 23 - unsigned long find_last_bit(const unsigned long *addr, unsigned long size) 24 - { 25 - if (size) { 26 - unsigned long val = BITMAP_LAST_WORD_MASK(size); 27 - unsigned long idx = (size-1) / BITS_PER_LONG; 28 - 29 - do { 30 - val &= addr[idx]; 31 - if (val) 32 - return idx * BITS_PER_LONG + __fls(val); 33 - 34 - val = ~0ul; 35 - } while (idx--); 36 - } 37 - return size; 38 - } 39 - EXPORT_SYMBOL(find_last_bit); 40 - 41 - #endif
+8 -5
mm/hwpoison-inject.c
··· 34 34 if (!hwpoison_filter_enable) 35 35 goto inject; 36 36 37 - if (!PageLRU(p) && !PageHuge(p)) 38 - shake_page(p, 0); 37 + if (!PageLRU(hpage) && !PageHuge(p)) 38 + shake_page(hpage, 0); 39 39 /* 40 40 * This implies unable to support non-LRU pages. 41 41 */ 42 - if (!PageLRU(p) && !PageHuge(p)) 43 - return 0; 42 + if (!PageLRU(hpage) && !PageHuge(p)) 43 + goto put_out; 44 44 45 45 /* 46 46 * do a racy check with elevated page count, to make sure PG_hwpoison ··· 52 52 err = hwpoison_filter(hpage); 53 53 unlock_page(hpage); 54 54 if (err) 55 - return 0; 55 + goto put_out; 56 56 57 57 inject: 58 58 pr_info("Injecting memory failure at pfn %#lx\n", pfn); 59 59 return memory_failure(pfn, 18, MF_COUNT_INCREASED); 60 + put_out: 61 + put_page(hpage); 62 + return 0; 60 63 } 61 64 62 65 static int hwpoison_unpoison(void *data, u64 val)
+8 -8
mm/memory-failure.c
··· 1187 1187 * The check (unnecessarily) ignores LRU pages being isolated and 1188 1188 * walked by the page reclaim code, however that's not a big loss. 1189 1189 */ 1190 - if (!PageHuge(p) && !PageTransTail(p)) { 1191 - if (!PageLRU(p)) 1192 - shake_page(p, 0); 1193 - if (!PageLRU(p)) { 1190 + if (!PageHuge(p)) { 1191 + if (!PageLRU(hpage)) 1192 + shake_page(hpage, 0); 1193 + if (!PageLRU(hpage)) { 1194 1194 /* 1195 1195 * shake_page could have turned it free. 1196 1196 */ ··· 1777 1777 } else if (ret == 0) { /* for free pages */ 1778 1778 if (PageHuge(page)) { 1779 1779 set_page_hwpoison_huge_page(hpage); 1780 - dequeue_hwpoisoned_huge_page(hpage); 1781 - atomic_long_add(1 << compound_order(hpage), 1780 + if (!dequeue_hwpoisoned_huge_page(hpage)) 1781 + atomic_long_add(1 << compound_order(hpage), 1782 1782 &num_poisoned_pages); 1783 1783 } else { 1784 - SetPageHWPoison(page); 1785 - atomic_long_inc(&num_poisoned_pages); 1784 + if (!TestSetPageHWPoison(page)) 1785 + atomic_long_inc(&num_poisoned_pages); 1786 1786 } 1787 1787 } 1788 1788 unset_migratetype_isolate(page, MIGRATE_MOVABLE);