Skip to content

Commit ecca5c3

Browse files
committed
Merge branch 'akpm' (Andrew's patch-bomb)
Merge fixes from Andrew Morton. * emailed from Andrew Morton <akpm@linux-foundation.org>: (14 patches) panic: fix stack dump print on direct call to panic() drivers/rtc/rtc-pl031.c: enable clock on all ST variants Revert "mm: vmscan: fix misused nr_reclaimed in shrink_mem_cgroup_zone()" hugetlb: fix race condition in hugetlb_fault() drivers/rtc/rtc-twl.c: use static register while reading time drivers/rtc/rtc-s3c.c: add placeholder for driver private data drivers/rtc/rtc-s3c.c: fix compilation error MAINTAINERS: add PCDP console maintainer memcg: do not open code accesses to res_counter members drivers/rtc/rtc-efi.c: fix section mismatch warning drivers/rtc/rtc-r9701.c: reset registers if invalid values are detected drivers/char/random.c: fix boot id uniqueness race memcg: fix broken boolen expression memcg: fix up documentation on global LRU
2 parents 174808a + 026ee1f commit ecca5c3

12 files changed

Lines changed: 105 additions & 33 deletions

File tree

‎Documentation/cgroups/memory.txt‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ Current Status: linux-2.6.34-mmotm(development version of 2010/April)
3434

3535
Features:
3636
- accounting anonymous pages, file caches, swap caches usage and limiting them.
37-
- private LRU and reclaim routine. (system's global LRU and private LRU
38-
work independently from each other)
37+
- pages are linked to per-memcg LRU exclusively, and there is no global LRU.
3938
- optionally, memory+swap usage can be accounted and limited.
4039
- hierarchical accounting
4140
- soft limit
@@ -154,7 +153,7 @@ updated. page_cgroup has its own LRU on cgroup.
154153
2.2.1 Accounting details
155154

156155
All mapped anon pages (RSS) and cache pages (Page Cache) are accounted.
157-
Some pages which are never reclaimable and will not be on the global LRU
156+
Some pages which are never reclaimable and will not be on the LRU
158157
are not accounted. We just account pages under usual VM management.
159158

160159
RSS pages are accounted at page_fault unless they've already been accounted

‎MAINTAINERS‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5117,6 +5117,11 @@ F: drivers/i2c/busses/i2c-pca-*
51175117
F: include/linux/i2c-algo-pca.h
51185118
F: include/linux/i2c-pca-platform.h
51195119

5120+
PCDP - PRIMARY CONSOLE AND DEBUG PORT
5121+
M: Khalid Aziz <khalid.aziz@hp.com>
5122+
S: Maintained
5123+
F: drivers/firmware/pcdp.*
5124+
51205125
PCI ERROR RECOVERY
51215126
M: Linas Vepstas <linasvepstas@gmail.com>
51225127
L: linux-pci@vger.kernel.org

‎drivers/char/random.c‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,10 +1260,15 @@ static int proc_do_uuid(ctl_table *table, int write,
12601260
uuid = table->data;
12611261
if (!uuid) {
12621262
uuid = tmp_uuid;
1263-
uuid[8] = 0;
1264-
}
1265-
if (uuid[8] == 0)
12661263
generate_random_uuid(uuid);
1264+
} else {
1265+
static DEFINE_SPINLOCK(bootid_spinlock);
1266+
1267+
spin_lock(&bootid_spinlock);
1268+
if (!uuid[8])
1269+
generate_random_uuid(uuid);
1270+
spin_unlock(&bootid_spinlock);
1271+
}
12671272

12681273
sprintf(buf, "%pU", uuid);
12691274

‎drivers/rtc/rtc-efi.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ static struct platform_driver efi_rtc_driver = {
213213
.name = "rtc-efi",
214214
.owner = THIS_MODULE,
215215
},
216-
.probe = efi_rtc_probe,
217216
.remove = __exit_p(efi_rtc_remove),
218217
};
219218

‎drivers/rtc/rtc-pl031.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
339339
dev_dbg(&adev->dev, "revision = 0x%01x\n", ldata->hw_revision);
340340

341341
/* Enable the clockwatch on ST Variants */
342-
if ((ldata->hw_designer == AMBA_VENDOR_ST) &&
343-
(ldata->hw_revision > 1))
342+
if (ldata->hw_designer == AMBA_VENDOR_ST)
344343
writel(readl(ldata->base + RTC_CR) | RTC_CR_CWEN,
345344
ldata->base + RTC_CR);
346345

‎drivers/rtc/rtc-r9701.c‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ static const struct rtc_class_ops r9701_rtc_ops = {
122122
static int __devinit r9701_probe(struct spi_device *spi)
123123
{
124124
struct rtc_device *rtc;
125+
struct rtc_time dt;
125126
unsigned char tmp;
126127
int res;
127128

@@ -132,6 +133,27 @@ static int __devinit r9701_probe(struct spi_device *spi)
132133
return -ENODEV;
133134
}
134135

136+
/*
137+
* The device seems to be present. Now check if the registers
138+
* contain invalid values. If so, try to write a default date:
139+
* 2000/1/1 00:00:00
140+
*/
141+
r9701_get_datetime(&spi->dev, &dt);
142+
if (rtc_valid_tm(&dt)) {
143+
dev_info(&spi->dev, "trying to repair invalid date/time\n");
144+
dt.tm_sec = 0;
145+
dt.tm_min = 0;
146+
dt.tm_hour = 0;
147+
dt.tm_mday = 1;
148+
dt.tm_mon = 0;
149+
dt.tm_year = 100;
150+
151+
if (r9701_set_datetime(&spi->dev, &dt)) {
152+
dev_err(&spi->dev, "cannot repair RTC register\n");
153+
return -ENODEV;
154+
}
155+
}
156+
135157
rtc = rtc_device_register("r9701",
136158
&spi->dev, &r9701_rtc_ops, THIS_MODULE);
137159
if (IS_ERR(rtc))

‎drivers/rtc/rtc-s3c.c‎

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ enum s3c_cpu_type {
4040
TYPE_S3C64XX,
4141
};
4242

43+
struct s3c_rtc_drv_data {
44+
int cpu_type;
45+
};
46+
4347
/* I have yet to find an S3C implementation with more than one
4448
* of these rtc blocks in */
4549

@@ -446,10 +450,12 @@ static const struct of_device_id s3c_rtc_dt_match[];
446450
static inline int s3c_rtc_get_driver_data(struct platform_device *pdev)
447451
{
448452
#ifdef CONFIG_OF
453+
struct s3c_rtc_drv_data *data;
449454
if (pdev->dev.of_node) {
450455
const struct of_device_id *match;
451456
match = of_match_node(s3c_rtc_dt_match, pdev->dev.of_node);
452-
return match->data;
457+
data = (struct s3c_rtc_drv_data *) match->data;
458+
return data->cpu_type;
453459
}
454460
#endif
455461
return platform_get_device_id(pdev)->driver_data;
@@ -664,20 +670,27 @@ static int s3c_rtc_resume(struct platform_device *pdev)
664670
#define s3c_rtc_resume NULL
665671
#endif
666672

673+
static struct s3c_rtc_drv_data s3c_rtc_drv_data_array[] = {
674+
[TYPE_S3C2410] = { TYPE_S3C2410 },
675+
[TYPE_S3C2416] = { TYPE_S3C2416 },
676+
[TYPE_S3C2443] = { TYPE_S3C2443 },
677+
[TYPE_S3C64XX] = { TYPE_S3C64XX },
678+
};
679+
667680
#ifdef CONFIG_OF
668681
static const struct of_device_id s3c_rtc_dt_match[] = {
669682
{
670-
.compatible = "samsung,s3c2410-rtc"
671-
.data = TYPE_S3C2410,
683+
.compatible = "samsung,s3c2410-rtc",
684+
.data = &s3c_rtc_drv_data_array[TYPE_S3C2410],
672685
}, {
673-
.compatible = "samsung,s3c2416-rtc"
674-
.data = TYPE_S3C2416,
686+
.compatible = "samsung,s3c2416-rtc",
687+
.data = &s3c_rtc_drv_data_array[TYPE_S3C2416],
675688
}, {
676-
.compatible = "samsung,s3c2443-rtc"
677-
.data = TYPE_S3C2443,
689+
.compatible = "samsung,s3c2443-rtc",
690+
.data = &s3c_rtc_drv_data_array[TYPE_S3C2443],
678691
}, {
679-
.compatible = "samsung,s3c6410-rtc"
680-
.data = TYPE_S3C64XX,
692+
.compatible = "samsung,s3c6410-rtc",
693+
.data = &s3c_rtc_drv_data_array[TYPE_S3C64XX],
681694
},
682695
{},
683696
};

‎drivers/rtc/rtc-twl.c‎

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ static const u8 twl6030_rtc_reg_map[] = {
112112
#define BIT_RTC_CTRL_REG_TEST_MODE_M 0x10
113113
#define BIT_RTC_CTRL_REG_SET_32_COUNTER_M 0x20
114114
#define BIT_RTC_CTRL_REG_GET_TIME_M 0x40
115+
#define BIT_RTC_CTRL_REG_RTC_V_OPT 0x80
115116

116117
/* RTC_STATUS_REG bitfields */
117118
#define BIT_RTC_STATUS_REG_RUN_M 0x02
@@ -235,25 +236,57 @@ static int twl_rtc_read_time(struct device *dev, struct rtc_time *tm)
235236
unsigned char rtc_data[ALL_TIME_REGS + 1];
236237
int ret;
237238
u8 save_control;
239+
u8 rtc_control;
238240

239241
ret = twl_rtc_read_u8(&save_control, REG_RTC_CTRL_REG);
240-
if (ret < 0)
242+
if (ret < 0) {
243+
dev_err(dev, "%s: reading CTRL_REG, error %d\n", __func__, ret);
241244
return ret;
245+
}
246+
/* for twl6030/32 make sure BIT_RTC_CTRL_REG_GET_TIME_M is clear */
247+
if (twl_class_is_6030()) {
248+
if (save_control & BIT_RTC_CTRL_REG_GET_TIME_M) {
249+
save_control &= ~BIT_RTC_CTRL_REG_GET_TIME_M;
250+
ret = twl_rtc_write_u8(save_control, REG_RTC_CTRL_REG);
251+
if (ret < 0) {
252+
dev_err(dev, "%s clr GET_TIME, error %d\n",
253+
__func__, ret);
254+
return ret;
255+
}
256+
}
257+
}
242258

243-
save_control |= BIT_RTC_CTRL_REG_GET_TIME_M;
259+
/* Copy RTC counting registers to static registers or latches */
260+
rtc_control = save_control | BIT_RTC_CTRL_REG_GET_TIME_M;
244261

245-
ret = twl_rtc_write_u8(save_control, REG_RTC_CTRL_REG);
246-
if (ret < 0)
262+
/* for twl6030/32 enable read access to static shadowed registers */
263+
if (twl_class_is_6030())
264+
rtc_control |= BIT_RTC_CTRL_REG_RTC_V_OPT;
265+
266+
ret = twl_rtc_write_u8(rtc_control, REG_RTC_CTRL_REG);
267+
if (ret < 0) {
268+
dev_err(dev, "%s: writing CTRL_REG, error %d\n", __func__, ret);
247269
return ret;
270+
}
248271

249272
ret = twl_i2c_read(TWL_MODULE_RTC, rtc_data,
250273
(rtc_reg_map[REG_SECONDS_REG]), ALL_TIME_REGS);
251274

252275
if (ret < 0) {
253-
dev_err(dev, "rtc_read_time error %d\n", ret);
276+
dev_err(dev, "%s: reading data, error %d\n", __func__, ret);
254277
return ret;
255278
}
256279

280+
/* for twl6030 restore original state of rtc control register */
281+
if (twl_class_is_6030()) {
282+
ret = twl_rtc_write_u8(save_control, REG_RTC_CTRL_REG);
283+
if (ret < 0) {
284+
dev_err(dev, "%s: restore CTRL_REG, error %d\n",
285+
__func__, ret);
286+
return ret;
287+
}
288+
}
289+
257290
tm->tm_sec = bcd2bin(rtc_data[0]);
258291
tm->tm_min = bcd2bin(rtc_data[1]);
259292
tm->tm_hour = bcd2bin(rtc_data[2]);

‎kernel/panic.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void panic(const char *fmt, ...)
9797
/*
9898
* Avoid nested stack-dumping if a panic occurs during oops processing
9999
*/
100-
if (!oops_in_progress)
100+
if (!test_taint(TAINT_DIE) && oops_in_progress <= 1)
101101
dump_stack();
102102
#endif
103103

‎mm/hugetlb.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2791,6 +2791,7 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
27912791
* so no worry about deadlock.
27922792
*/
27932793
page = pte_page(entry);
2794+
get_page(page);
27942795
if (page != pagecache_page)
27952796
lock_page(page);
27962797

@@ -2822,6 +2823,7 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
28222823
}
28232824
if (page != pagecache_page)
28242825
unlock_page(page);
2826+
put_page(page);
28252827

28262828
out_mutex:
28272829
mutex_unlock(&hugetlb_instantiation_mutex);

0 commit comments

Comments
 (0)