aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-memory.c11
-rw-r--r--drivers/rapidio/rio-scan.c40
-rw-r--r--drivers/rapidio/rio.c75
-rw-r--r--drivers/rtc/Kconfig3
-rw-r--r--include/linux/memcontrol.h4
-rw-r--r--include/linux/pageblock-flags.h6
-rw-r--r--include/linux/rio.h3
-rw-r--r--lib/kasprintf.c2
-rw-r--r--tools/perf/util/include/linux/rbtree.h1
9 files changed, 80 insertions, 65 deletions
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index dc0a035e63b..ecdb0a6b317 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -77,8 +77,9 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz
77{ 77{
78 unsigned long start, start_pfn; 78 unsigned long start, start_pfn;
79 struct zone *zone; 79 struct zone *zone;
80 int i, ret; 80 int ret;
81 int sections_to_remove; 81 unsigned long section;
82 unsigned long sections_to_remove;
82 83
83 start_pfn = base >> PAGE_SHIFT; 84 start_pfn = base >> PAGE_SHIFT;
84 85
@@ -99,9 +100,9 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz
99 * while writing to it. So we have to defer it to here. 100 * while writing to it. So we have to defer it to here.
100 */ 101 */
101 sections_to_remove = (memblock_size >> PAGE_SHIFT) / PAGES_PER_SECTION; 102 sections_to_remove = (memblock_size >> PAGE_SHIFT) / PAGES_PER_SECTION;
102 for (i = 0; i < sections_to_remove; i++) { 103 for (section = 0; section < sections_to_remove; section++) {
103 unsigned long pfn = start_pfn + i * PAGES_PER_SECTION; 104 unsigned long pfn = start_pfn + section * PAGES_PER_SECTION;
104 ret = __remove_pages(zone, start_pfn, PAGES_PER_SECTION); 105 ret = __remove_pages(zone, pfn, PAGES_PER_SECTION);
105 if (ret) 106 if (ret)
106 return ret; 107 return ret;
107 } 108 }
diff --git a/drivers/rapidio/rio-scan.c b/drivers/rapidio/rio-scan.c
index 48e9041dd1e..07da58bb495 100644
--- a/drivers/rapidio/rio-scan.c
+++ b/drivers/rapidio/rio-scan.c
@@ -55,9 +55,9 @@ static int rio_mport_phys_table[] = {
55}; 55};
56 56
57 57
58/* 58/**
59 * rio_destid_alloc - Allocate next available destID for given network 59 * rio_destid_alloc - Allocate next available destID for given network
60 * net: RIO network 60 * @net: RIO network
61 * 61 *
62 * Returns next available device destination ID for the specified RIO network. 62 * Returns next available device destination ID for the specified RIO network.
63 * Marks allocated ID as one in use. 63 * Marks allocated ID as one in use.
@@ -69,14 +69,9 @@ static u16 rio_destid_alloc(struct rio_net *net)
69 struct rio_id_table *idtab = &net->destid_table; 69 struct rio_id_table *idtab = &net->destid_table;
70 70
71 spin_lock(&idtab->lock); 71 spin_lock(&idtab->lock);
72 destid = find_next_zero_bit(idtab->table, idtab->max, idtab->next); 72 destid = find_first_zero_bit(idtab->table, idtab->max);
73 if (destid >= idtab->max)
74 destid = find_first_zero_bit(idtab->table, idtab->max);
75 73
76 if (destid < idtab->max) { 74 if (destid < idtab->max) {
77 idtab->next = destid + 1;
78 if (idtab->next >= idtab->max)
79 idtab->next = 0;
80 set_bit(destid, idtab->table); 75 set_bit(destid, idtab->table);
81 destid += idtab->start; 76 destid += idtab->start;
82 } else 77 } else
@@ -86,10 +81,10 @@ static u16 rio_destid_alloc(struct rio_net *net)
86 return (u16)destid; 81 return (u16)destid;
87} 82}
88 83
89/* 84/**
90 * rio_destid_reserve - Reserve the specivied destID 85 * rio_destid_reserve - Reserve the specivied destID
91 * net: RIO network 86 * @net: RIO network
92 * destid: destID to reserve 87 * @destid: destID to reserve
93 * 88 *
94 * Tries to reserve the specified destID. 89 * Tries to reserve the specified destID.
95 * Returns 0 if successfull. 90 * Returns 0 if successfull.
@@ -106,10 +101,10 @@ static int rio_destid_reserve(struct rio_net *net, u16 destid)
106 return oldbit; 101 return oldbit;
107} 102}
108 103
109/* 104/**
110 * rio_destid_free - free a previously allocated destID 105 * rio_destid_free - free a previously allocated destID
111 * net: RIO network 106 * @net: RIO network
112 * destid: destID to free 107 * @destid: destID to free
113 * 108 *
114 * Makes the specified destID available for use. 109 * Makes the specified destID available for use.
115 */ 110 */
@@ -123,9 +118,9 @@ static void rio_destid_free(struct rio_net *net, u16 destid)
123 spin_unlock(&idtab->lock); 118 spin_unlock(&idtab->lock);
124} 119}
125 120
126/* 121/**
127 * rio_destid_first - return first destID in use 122 * rio_destid_first - return first destID in use
128 * net: RIO network 123 * @net: RIO network
129 */ 124 */
130static u16 rio_destid_first(struct rio_net *net) 125static u16 rio_destid_first(struct rio_net *net)
131{ 126{
@@ -142,10 +137,10 @@ static u16 rio_destid_first(struct rio_net *net)
142 return (u16)destid; 137 return (u16)destid;
143} 138}
144 139
145/* 140/**
146 * rio_destid_next - return next destID in use 141 * rio_destid_next - return next destID in use
147 * net: RIO network 142 * @net: RIO network
148 * from: destination ID from which search shall continue 143 * @from: destination ID from which search shall continue
149 */ 144 */
150static u16 rio_destid_next(struct rio_net *net, u16 from) 145static u16 rio_destid_next(struct rio_net *net, u16 from)
151{ 146{
@@ -1163,8 +1158,8 @@ static struct rio_net __devinit *rio_alloc_net(struct rio_mport *port,
1163 1158
1164 net = kzalloc(sizeof(struct rio_net), GFP_KERNEL); 1159 net = kzalloc(sizeof(struct rio_net), GFP_KERNEL);
1165 if (net && do_enum) { 1160 if (net && do_enum) {
1166 net->destid_table.table = kzalloc( 1161 net->destid_table.table = kcalloc(
1167 BITS_TO_LONGS(RIO_MAX_ROUTE_ENTRIES(port->sys_size)) * 1162 BITS_TO_LONGS(RIO_MAX_ROUTE_ENTRIES(port->sys_size)),
1168 sizeof(long), 1163 sizeof(long),
1169 GFP_KERNEL); 1164 GFP_KERNEL);
1170 1165
@@ -1174,7 +1169,6 @@ static struct rio_net __devinit *rio_alloc_net(struct rio_mport *port,
1174 net = NULL; 1169 net = NULL;
1175 } else { 1170 } else {
1176 net->destid_table.start = start; 1171 net->destid_table.start = start;
1177 net->destid_table.next = 0;
1178 net->destid_table.max = 1172 net->destid_table.max =
1179 RIO_MAX_ROUTE_ENTRIES(port->sys_size); 1173 RIO_MAX_ROUTE_ENTRIES(port->sys_size);
1180 spin_lock_init(&net->destid_table.lock); 1174 spin_lock_init(&net->destid_table.lock);
@@ -1391,7 +1385,7 @@ int __devinit rio_disc_mport(struct rio_mport *mport)
1391 while (time_before(jiffies, to_end)) { 1385 while (time_before(jiffies, to_end)) {
1392 if (rio_enum_complete(mport)) 1386 if (rio_enum_complete(mport))
1393 goto enum_done; 1387 goto enum_done;
1394 schedule_timeout_uninterruptible(msecs_to_jiffies(10)); 1388 msleep(10);
1395 } 1389 }
1396 1390
1397 pr_debug("RIO: discovery timeout on mport %d %s\n", 1391 pr_debug("RIO: discovery timeout on mport %d %s\n",
diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c
index d4bd69013c5..c17ae22567e 100644
--- a/drivers/rapidio/rio.c
+++ b/drivers/rapidio/rio.c
@@ -1275,49 +1275,68 @@ static void __devinit disc_work_handler(struct work_struct *_work)
1275 pr_debug("RIO: discovery work for mport %d %s\n", 1275 pr_debug("RIO: discovery work for mport %d %s\n",
1276 work->mport->id, work->mport->name); 1276 work->mport->id, work->mport->name);
1277 rio_disc_mport(work->mport); 1277 rio_disc_mport(work->mport);
1278
1279 kfree(work);
1280} 1278}
1281 1279
1282int __devinit rio_init_mports(void) 1280int __devinit rio_init_mports(void)
1283{ 1281{
1284 struct rio_mport *port; 1282 struct rio_mport *port;
1285 struct rio_disc_work *work; 1283 struct rio_disc_work *work;
1286 int no_disc = 0; 1284 int n = 0;
1285
1286 if (!next_portid)
1287 return -ENODEV;
1287 1288
1289 /*
1290 * First, run enumerations and check if we need to perform discovery
1291 * on any of the registered mports.
1292 */
1288 list_for_each_entry(port, &rio_mports, node) { 1293 list_for_each_entry(port, &rio_mports, node) {
1289 if (port->host_deviceid >= 0) 1294 if (port->host_deviceid >= 0)
1290 rio_enum_mport(port); 1295 rio_enum_mport(port);
1291 else if (!no_disc) { 1296 else
1292 if (!rio_wq) { 1297 n++;
1293 rio_wq = alloc_workqueue("riodisc", 0, 0); 1298 }
1294 if (!rio_wq) { 1299
1295 pr_err("RIO: unable allocate rio_wq\n"); 1300 if (!n)
1296 no_disc = 1; 1301 goto no_disc;
1297 continue; 1302
1298 } 1303 /*
1299 } 1304 * If we have mports that require discovery schedule a discovery work
1300 1305 * for each of them. If the code below fails to allocate needed
1301 work = kzalloc(sizeof *work, GFP_KERNEL); 1306 * resources, exit without error to keep results of enumeration
1302 if (!work) { 1307 * process (if any).
1303 pr_err("RIO: no memory for work struct\n"); 1308 * TODO: Implement restart of dicovery process for all or
1304 no_disc = 1; 1309 * individual discovering mports.
1305 continue; 1310 */
1306 } 1311 rio_wq = alloc_workqueue("riodisc", 0, 0);
1307 1312 if (!rio_wq) {
1308 work->mport = port; 1313 pr_err("RIO: unable allocate rio_wq\n");
1309 INIT_WORK(&work->work, disc_work_handler); 1314 goto no_disc;
1310 queue_work(rio_wq, &work->work);
1311 }
1312 } 1315 }
1313 1316
1314 if (rio_wq) { 1317 work = kcalloc(n, sizeof *work, GFP_KERNEL);
1315 pr_debug("RIO: flush discovery workqueue\n"); 1318 if (!work) {
1316 flush_workqueue(rio_wq); 1319 pr_err("RIO: no memory for work struct\n");
1317 pr_debug("RIO: flush discovery workqueue finished\n");
1318 destroy_workqueue(rio_wq); 1320 destroy_workqueue(rio_wq);
1321 goto no_disc;
1319 } 1322 }
1320 1323
1324 n = 0;
1325 list_for_each_entry(port, &rio_mports, node) {
1326 if (port->host_deviceid < 0) {
1327 work[n].mport = port;
1328 INIT_WORK(&work[n].work, disc_work_handler);
1329 queue_work(rio_wq, &work[n].work);
1330 n++;
1331 }
1332 }
1333
1334 flush_workqueue(rio_wq);
1335 pr_debug("RIO: destroy discovery workqueue\n");
1336 destroy_workqueue(rio_wq);
1337 kfree(work);
1338
1339no_disc:
1321 rio_init(); 1340 rio_init();
1322 1341
1323 return 0; 1342 return 0;
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index e069f176a82..19c03ab2bdc 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -59,6 +59,7 @@ comment "RTC interfaces"
59config RTC_INTF_SYSFS 59config RTC_INTF_SYSFS
60 boolean "/sys/class/rtc/rtcN (sysfs)" 60 boolean "/sys/class/rtc/rtcN (sysfs)"
61 depends on SYSFS 61 depends on SYSFS
62 default RTC_CLASS
62 help 63 help
63 Say yes here if you want to use your RTCs using sysfs interfaces, 64 Say yes here if you want to use your RTCs using sysfs interfaces,
64 /sys/class/rtc/rtc0 through /sys/.../rtcN. 65 /sys/class/rtc/rtc0 through /sys/.../rtcN.
@@ -68,6 +69,7 @@ config RTC_INTF_SYSFS
68config RTC_INTF_PROC 69config RTC_INTF_PROC
69 boolean "/proc/driver/rtc (procfs for rtcN)" 70 boolean "/proc/driver/rtc (procfs for rtcN)"
70 depends on PROC_FS 71 depends on PROC_FS
72 default RTC_CLASS
71 help 73 help
72 Say yes here if you want to use your system clock RTC through 74 Say yes here if you want to use your system clock RTC through
73 the proc interface, /proc/driver/rtc. 75 the proc interface, /proc/driver/rtc.
@@ -79,6 +81,7 @@ config RTC_INTF_PROC
79 81
80config RTC_INTF_DEV 82config RTC_INTF_DEV
81 boolean "/dev/rtcN (character devices)" 83 boolean "/dev/rtcN (character devices)"
84 default RTC_CLASS
82 help 85 help
83 Say yes here if you want to use your RTCs using the /dev 86 Say yes here if you want to use your RTCs using the /dev
84 interfaces, which "udev" sets up as /dev/rtc0 through 87 interfaces, which "udev" sets up as /dev/rtc0 through
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index fd0e6d53836..11ddc7ffeba 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -396,7 +396,7 @@ enum {
396}; 396};
397 397
398struct sock; 398struct sock;
399#ifdef CONFIG_MEMCG_KMEM 399#if defined(CONFIG_INET) && defined(CONFIG_MEMCG_KMEM)
400void sock_update_memcg(struct sock *sk); 400void sock_update_memcg(struct sock *sk);
401void sock_release_memcg(struct sock *sk); 401void sock_release_memcg(struct sock *sk);
402#else 402#else
@@ -406,6 +406,6 @@ static inline void sock_update_memcg(struct sock *sk)
406static inline void sock_release_memcg(struct sock *sk) 406static inline void sock_release_memcg(struct sock *sk)
407{ 407{
408} 408}
409#endif /* CONFIG_MEMCG_KMEM */ 409#endif /* CONFIG_INET && CONFIG_MEMCG_KMEM */
410#endif /* _LINUX_MEMCONTROL_H */ 410#endif /* _LINUX_MEMCONTROL_H */
411 411
diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h
index eed27f4f4c3..be655e4a2a7 100644
--- a/include/linux/pageblock-flags.h
+++ b/include/linux/pageblock-flags.h
@@ -71,13 +71,13 @@ void set_pageblock_flags_group(struct page *page, unsigned long flags,
71#ifdef CONFIG_COMPACTION 71#ifdef CONFIG_COMPACTION
72#define get_pageblock_skip(page) \ 72#define get_pageblock_skip(page) \
73 get_pageblock_flags_group(page, PB_migrate_skip, \ 73 get_pageblock_flags_group(page, PB_migrate_skip, \
74 PB_migrate_skip + 1) 74 PB_migrate_skip)
75#define clear_pageblock_skip(page) \ 75#define clear_pageblock_skip(page) \
76 set_pageblock_flags_group(page, 0, PB_migrate_skip, \ 76 set_pageblock_flags_group(page, 0, PB_migrate_skip, \
77 PB_migrate_skip + 1) 77 PB_migrate_skip)
78#define set_pageblock_skip(page) \ 78#define set_pageblock_skip(page) \
79 set_pageblock_flags_group(page, 1, PB_migrate_skip, \ 79 set_pageblock_flags_group(page, 1, PB_migrate_skip, \
80 PB_migrate_skip + 1) 80 PB_migrate_skip)
81#endif /* CONFIG_COMPACTION */ 81#endif /* CONFIG_COMPACTION */
82 82
83#define get_pageblock_flags(page) \ 83#define get_pageblock_flags(page) \
diff --git a/include/linux/rio.h b/include/linux/rio.h
index d2dff22cf68..4187da51100 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -63,7 +63,7 @@
63 * 63 *
64 * 0 RapidIO inbound doorbells 64 * 0 RapidIO inbound doorbells
65 * 1 RapidIO inbound mailboxes 65 * 1 RapidIO inbound mailboxes
66 * 1 RapidIO outbound mailboxes 66 * 2 RapidIO outbound mailboxes
67 */ 67 */
68#define RIO_DOORBELL_RESOURCE 0 68#define RIO_DOORBELL_RESOURCE 0
69#define RIO_INB_MBOX_RESOURCE 1 69#define RIO_INB_MBOX_RESOURCE 1
@@ -266,7 +266,6 @@ struct rio_mport {
266 266
267struct rio_id_table { 267struct rio_id_table {
268 u16 start; /* logical minimal id */ 268 u16 start; /* logical minimal id */
269 u16 next; /* hint for find */
270 u32 max; /* max number of IDs in table */ 269 u32 max; /* max number of IDs in table */
271 spinlock_t lock; 270 spinlock_t lock;
272 unsigned long *table; 271 unsigned long *table;
diff --git a/lib/kasprintf.c b/lib/kasprintf.c
index ae0de80c1c8..32f12150fc4 100644
--- a/lib/kasprintf.c
+++ b/lib/kasprintf.c
@@ -21,7 +21,7 @@ char *kvasprintf(gfp_t gfp, const char *fmt, va_list ap)
21 len = vsnprintf(NULL, 0, fmt, aq); 21 len = vsnprintf(NULL, 0, fmt, aq);
22 va_end(aq); 22 va_end(aq);
23 23
24 p = kmalloc(len+1, gfp); 24 p = kmalloc_track_caller(len+1, gfp);
25 if (!p) 25 if (!p)
26 return NULL; 26 return NULL;
27 27
diff --git a/tools/perf/util/include/linux/rbtree.h b/tools/perf/util/include/linux/rbtree.h
index 9bcdc844b33..2a030c5af3a 100644
--- a/tools/perf/util/include/linux/rbtree.h
+++ b/tools/perf/util/include/linux/rbtree.h
@@ -1,3 +1,2 @@
1#include <stdbool.h> 1#include <stdbool.h>
2#include <stdbool.h>
3#include "../../../../include/linux/rbtree.h" 2#include "../../../../include/linux/rbtree.h"