Skip to content

Commit 23dcfa6

Browse files
committed
Merge branch 'akpm' (Andrew's patch-bomb)
Merge fixes from Andrew Morton. Random drivers and some VM fixes. * emailed patches from Andrew Morton <[email protected]>: (17 commits) mm: compaction: Abort async compaction if locks are contended or taking too long mm: have order > 0 compaction start near a pageblock with free pages rapidio/tsi721: fix unused variable compiler warning rapidio/tsi721: fix inbound doorbell interrupt handling drivers/rtc/rtc-rs5c348.c: fix hour decoding in 12-hour mode mm: correct page->pfmemalloc to fix deactivate_slab regression drivers/rtc/rtc-pcf2123.c: initialize dynamic sysfs attributes mm/compaction.c: fix deferring compaction mistake drivers/misc/sgi-xp/xpc_uv.c: SGI XPC fails to load when cpu 0 is out of IRQ resources string: do not export memweight() to userspace hugetlb: update hugetlbpage.txt checkpatch: add control statement test to SINGLE_STATEMENT_DO_WHILE_MACRO mm: hugetlbfs: correctly populate shared pmd cciss: fix incorrect scsi status reporting Documentation: update mount option in filesystem/vfat.txt mm: change nr_ptes BUG_ON to WARN_ON cs5535-clockevt: typo, it's MFGPT, not MFPGT
2 parents a484147 + c67fe37 commit 23dcfa6

File tree

16 files changed

+258
-110
lines changed

16 files changed

+258
-110
lines changed

Documentation/filesystems/vfat.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,17 @@ errors=panic|continue|remount-ro
137137
without doing anything or remount the partition in
138138
read-only mode (default behavior).
139139

140+
discard -- If set, issues discard/TRIM commands to the block
141+
device when blocks are freed. This is useful for SSD devices
142+
and sparse/thinly-provisoned LUNs.
143+
144+
nfs -- This option maintains an index (cache) of directory
145+
inodes by i_logstart which is used by the nfs-related code to
146+
improve look-ups.
147+
148+
Enable this only if you want to export the FAT filesystem
149+
over NFS
150+
140151
<bool>: 0,1,yes,no,true,false
141152

142153
TODO

Documentation/vm/hugetlbpage.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,17 @@ map_hugetlb.c.
299299
*******************************************************************
300300

301301
/*
302-
* hugepage-shm: see Documentation/vm/hugepage-shm.c
302+
* map_hugetlb: see tools/testing/selftests/vm/map_hugetlb.c
303303
*/
304304

305305
*******************************************************************
306306

307307
/*
308-
* hugepage-mmap: see Documentation/vm/hugepage-mmap.c
308+
* hugepage-shm: see tools/testing/selftests/vm/hugepage-shm.c
309+
*/
310+
311+
*******************************************************************
312+
313+
/*
314+
* hugepage-mmap: see tools/testing/selftests/vm/hugepage-mmap.c
309315
*/

arch/x86/mm/hugetlbpage.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,16 @@ static int vma_shareable(struct vm_area_struct *vma, unsigned long addr)
5656
}
5757

5858
/*
59-
* search for a shareable pmd page for hugetlb.
59+
* Search for a shareable pmd page for hugetlb. In any case calls pmd_alloc()
60+
* and returns the corresponding pte. While this is not necessary for the
61+
* !shared pmd case because we can allocate the pmd later as well, it makes the
62+
* code much cleaner. pmd allocation is essential for the shared case because
63+
* pud has to be populated inside the same i_mmap_mutex section - otherwise
64+
* racing tasks could either miss the sharing (see huge_pte_offset) or select a
65+
* bad pmd for sharing.
6066
*/
61-
static void huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud)
67+
static pte_t *
68+
huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud)
6269
{
6370
struct vm_area_struct *vma = find_vma(mm, addr);
6471
struct address_space *mapping = vma->vm_file->f_mapping;
@@ -68,9 +75,10 @@ static void huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud)
6875
struct vm_area_struct *svma;
6976
unsigned long saddr;
7077
pte_t *spte = NULL;
78+
pte_t *pte;
7179

7280
if (!vma_shareable(vma, addr))
73-
return;
81+
return (pte_t *)pmd_alloc(mm, pud, addr);
7482

7583
mutex_lock(&mapping->i_mmap_mutex);
7684
vma_prio_tree_foreach(svma, &iter, &mapping->i_mmap, idx, idx) {
@@ -97,7 +105,9 @@ static void huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud)
97105
put_page(virt_to_page(spte));
98106
spin_unlock(&mm->page_table_lock);
99107
out:
108+
pte = (pte_t *)pmd_alloc(mm, pud, addr);
100109
mutex_unlock(&mapping->i_mmap_mutex);
110+
return pte;
101111
}
102112

103113
/*
@@ -142,8 +152,9 @@ pte_t *huge_pte_alloc(struct mm_struct *mm,
142152
} else {
143153
BUG_ON(sz != PMD_SIZE);
144154
if (pud_none(*pud))
145-
huge_pmd_share(mm, addr, pud);
146-
pte = (pte_t *) pmd_alloc(mm, pud, addr);
155+
pte = huge_pmd_share(mm, addr, pud);
156+
else
157+
pte = (pte_t *)pmd_alloc(mm, pud, addr);
147158
}
148159
}
149160
BUG_ON(pte && !pte_none(*pte) && !pte_huge(*pte));

drivers/block/cciss_scsi.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -763,16 +763,7 @@ static void complete_scsi_command(CommandList_struct *c, int timeout,
763763
{
764764
case CMD_TARGET_STATUS:
765765
/* Pass it up to the upper layers... */
766-
if( ei->ScsiStatus)
767-
{
768-
#if 0
769-
printk(KERN_WARNING "cciss: cmd %p "
770-
"has SCSI Status = %x\n",
771-
c, ei->ScsiStatus);
772-
#endif
773-
cmd->result |= (ei->ScsiStatus << 1);
774-
}
775-
else { /* scsi status is zero??? How??? */
766+
if (!ei->ScsiStatus) {
776767

777768
/* Ordinarily, this case should never happen, but there is a bug
778769
in some released firmware revisions that allows it to happen

drivers/clocksource/cs5535-clockevt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static struct cs5535_mfgpt_timer *cs5535_event_clock;
5353
#define MFGPT_PERIODIC (MFGPT_HZ / HZ)
5454

5555
/*
56-
* The MFPGT timers on the CS5536 provide us with suitable timers to use
56+
* The MFGPT timers on the CS5536 provide us with suitable timers to use
5757
* as clock event sources - not as good as a HPET or APIC, but certainly
5858
* better than the PIT. This isn't a general purpose MFGPT driver, but
5959
* a simplified one designed specifically to act as a clock event source.
@@ -144,7 +144,7 @@ static int __init cs5535_mfgpt_init(void)
144144

145145
timer = cs5535_mfgpt_alloc_timer(MFGPT_TIMER_ANY, MFGPT_DOMAIN_WORKING);
146146
if (!timer) {
147-
printk(KERN_ERR DRV_NAME ": Could not allocate MFPGT timer\n");
147+
printk(KERN_ERR DRV_NAME ": Could not allocate MFGPT timer\n");
148148
return -ENODEV;
149149
}
150150
cs5535_event_clock = timer;

drivers/misc/sgi-xp/xpc_uv.c

Lines changed: 65 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include <linux/interrupt.h>
1919
#include <linux/delay.h>
2020
#include <linux/device.h>
21+
#include <linux/cpu.h>
22+
#include <linux/module.h>
2123
#include <linux/err.h>
2224
#include <linux/slab.h>
2325
#include <asm/uv/uv_hub.h>
@@ -59,6 +61,8 @@ static struct xpc_heartbeat_uv *xpc_heartbeat_uv;
5961
XPC_NOTIFY_MSG_SIZE_UV)
6062
#define XPC_NOTIFY_IRQ_NAME "xpc_notify"
6163

64+
static int xpc_mq_node = -1;
65+
6266
static struct xpc_gru_mq_uv *xpc_activate_mq_uv;
6367
static struct xpc_gru_mq_uv *xpc_notify_mq_uv;
6468

@@ -109,11 +113,8 @@ xpc_get_gru_mq_irq_uv(struct xpc_gru_mq_uv *mq, int cpu, char *irq_name)
109113
#if defined CONFIG_X86_64
110114
mq->irq = uv_setup_irq(irq_name, cpu, mq->mmr_blade, mq->mmr_offset,
111115
UV_AFFINITY_CPU);
112-
if (mq->irq < 0) {
113-
dev_err(xpc_part, "uv_setup_irq() returned error=%d\n",
114-
-mq->irq);
116+
if (mq->irq < 0)
115117
return mq->irq;
116-
}
117118

118119
mq->mmr_value = uv_read_global_mmr64(mmr_pnode, mq->mmr_offset);
119120

@@ -238,8 +239,9 @@ xpc_create_gru_mq_uv(unsigned int mq_size, int cpu, char *irq_name,
238239
mq->mmr_blade = uv_cpu_to_blade_id(cpu);
239240

240241
nid = cpu_to_node(cpu);
241-
page = alloc_pages_exact_node(nid, GFP_KERNEL | __GFP_ZERO | GFP_THISNODE,
242-
pg_order);
242+
page = alloc_pages_exact_node(nid,
243+
GFP_KERNEL | __GFP_ZERO | GFP_THISNODE,
244+
pg_order);
243245
if (page == NULL) {
244246
dev_err(xpc_part, "xpc_create_gru_mq_uv() failed to alloc %d "
245247
"bytes of memory on nid=%d for GRU mq\n", mq_size, nid);
@@ -1731,9 +1733,50 @@ static struct xpc_arch_operations xpc_arch_ops_uv = {
17311733
.notify_senders_of_disconnect = xpc_notify_senders_of_disconnect_uv,
17321734
};
17331735

1736+
static int
1737+
xpc_init_mq_node(int nid)
1738+
{
1739+
int cpu;
1740+
1741+
get_online_cpus();
1742+
1743+
for_each_cpu(cpu, cpumask_of_node(nid)) {
1744+
xpc_activate_mq_uv =
1745+
xpc_create_gru_mq_uv(XPC_ACTIVATE_MQ_SIZE_UV, nid,
1746+
XPC_ACTIVATE_IRQ_NAME,
1747+
xpc_handle_activate_IRQ_uv);
1748+
if (!IS_ERR(xpc_activate_mq_uv))
1749+
break;
1750+
}
1751+
if (IS_ERR(xpc_activate_mq_uv)) {
1752+
put_online_cpus();
1753+
return PTR_ERR(xpc_activate_mq_uv);
1754+
}
1755+
1756+
for_each_cpu(cpu, cpumask_of_node(nid)) {
1757+
xpc_notify_mq_uv =
1758+
xpc_create_gru_mq_uv(XPC_NOTIFY_MQ_SIZE_UV, nid,
1759+
XPC_NOTIFY_IRQ_NAME,
1760+
xpc_handle_notify_IRQ_uv);
1761+
if (!IS_ERR(xpc_notify_mq_uv))
1762+
break;
1763+
}
1764+
if (IS_ERR(xpc_notify_mq_uv)) {
1765+
xpc_destroy_gru_mq_uv(xpc_activate_mq_uv);
1766+
put_online_cpus();
1767+
return PTR_ERR(xpc_notify_mq_uv);
1768+
}
1769+
1770+
put_online_cpus();
1771+
return 0;
1772+
}
1773+
17341774
int
17351775
xpc_init_uv(void)
17361776
{
1777+
int nid;
1778+
int ret = 0;
1779+
17371780
xpc_arch_ops = xpc_arch_ops_uv;
17381781

17391782
if (sizeof(struct xpc_notify_mq_msghdr_uv) > XPC_MSG_HDR_MAX_SIZE) {
@@ -1742,21 +1785,21 @@ xpc_init_uv(void)
17421785
return -E2BIG;
17431786
}
17441787

1745-
xpc_activate_mq_uv = xpc_create_gru_mq_uv(XPC_ACTIVATE_MQ_SIZE_UV, 0,
1746-
XPC_ACTIVATE_IRQ_NAME,
1747-
xpc_handle_activate_IRQ_uv);
1748-
if (IS_ERR(xpc_activate_mq_uv))
1749-
return PTR_ERR(xpc_activate_mq_uv);
1788+
if (xpc_mq_node < 0)
1789+
for_each_online_node(nid) {
1790+
ret = xpc_init_mq_node(nid);
17501791

1751-
xpc_notify_mq_uv = xpc_create_gru_mq_uv(XPC_NOTIFY_MQ_SIZE_UV, 0,
1752-
XPC_NOTIFY_IRQ_NAME,
1753-
xpc_handle_notify_IRQ_uv);
1754-
if (IS_ERR(xpc_notify_mq_uv)) {
1755-
xpc_destroy_gru_mq_uv(xpc_activate_mq_uv);
1756-
return PTR_ERR(xpc_notify_mq_uv);
1757-
}
1792+
if (!ret)
1793+
break;
1794+
}
1795+
else
1796+
ret = xpc_init_mq_node(xpc_mq_node);
17581797

1759-
return 0;
1798+
if (ret < 0)
1799+
dev_err(xpc_part, "xpc_init_mq_node() returned error=%d\n",
1800+
-ret);
1801+
1802+
return ret;
17601803
}
17611804

17621805
void
@@ -1765,3 +1808,6 @@ xpc_exit_uv(void)
17651808
xpc_destroy_gru_mq_uv(xpc_notify_mq_uv);
17661809
xpc_destroy_gru_mq_uv(xpc_activate_mq_uv);
17671810
}
1811+
1812+
module_param(xpc_mq_node, int, 0);
1813+
MODULE_PARM_DESC(xpc_mq_node, "Node number on which to allocate message queues.");

drivers/rapidio/devices/tsi721.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,9 @@ static void tsi721_db_dpc(struct work_struct *work)
435435
" info %4.4x\n", DBELL_SID(idb.bytes),
436436
DBELL_TID(idb.bytes), DBELL_INF(idb.bytes));
437437
}
438+
439+
wr_ptr = ioread32(priv->regs +
440+
TSI721_IDQ_WP(IDB_QUEUE)) % IDB_QSIZE;
438441
}
439442

440443
iowrite32(rd_ptr & (IDB_QSIZE - 1),
@@ -445,6 +448,10 @@ static void tsi721_db_dpc(struct work_struct *work)
445448
regval |= TSI721_SR_CHINT_IDBQRCV;
446449
iowrite32(regval,
447450
priv->regs + TSI721_SR_CHINTE(IDB_QUEUE));
451+
452+
wr_ptr = ioread32(priv->regs + TSI721_IDQ_WP(IDB_QUEUE)) % IDB_QSIZE;
453+
if (wr_ptr != rd_ptr)
454+
schedule_work(&priv->idb_work);
448455
}
449456

450457
/**
@@ -2212,7 +2219,7 @@ static int __devinit tsi721_probe(struct pci_dev *pdev,
22122219
const struct pci_device_id *id)
22132220
{
22142221
struct tsi721_device *priv;
2215-
int i, cap;
2222+
int cap;
22162223
int err;
22172224
u32 regval;
22182225

@@ -2232,12 +2239,15 @@ static int __devinit tsi721_probe(struct pci_dev *pdev,
22322239
priv->pdev = pdev;
22332240

22342241
#ifdef DEBUG
2242+
{
2243+
int i;
22352244
for (i = 0; i <= PCI_STD_RESOURCE_END; i++) {
22362245
dev_dbg(&pdev->dev, "res[%d] @ 0x%llx (0x%lx, 0x%lx)\n",
22372246
i, (unsigned long long)pci_resource_start(pdev, i),
22382247
(unsigned long)pci_resource_len(pdev, i),
22392248
pci_resource_flags(pdev, i));
22402249
}
2250+
}
22412251
#endif
22422252
/*
22432253
* Verify BAR configuration

drivers/rtc/rtc-pcf2123.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include <linux/rtc.h>
4444
#include <linux/spi/spi.h>
4545
#include <linux/module.h>
46+
#include <linux/sysfs.h>
4647

4748
#define DRV_VERSION "0.6"
4849

@@ -292,6 +293,7 @@ static int __devinit pcf2123_probe(struct spi_device *spi)
292293
pdata->rtc = rtc;
293294

294295
for (i = 0; i < 16; i++) {
296+
sysfs_attr_init(&pdata->regs[i].attr.attr);
295297
sprintf(pdata->regs[i].name, "%1x", i);
296298
pdata->regs[i].attr.attr.mode = S_IRUGO | S_IWUSR;
297299
pdata->regs[i].attr.attr.name = pdata->regs[i].name;

drivers/rtc/rtc-rs5c348.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,12 @@ rs5c348_rtc_read_time(struct device *dev, struct rtc_time *tm)
122122
tm->tm_min = bcd2bin(rxbuf[RS5C348_REG_MINS] & RS5C348_MINS_MASK);
123123
tm->tm_hour = bcd2bin(rxbuf[RS5C348_REG_HOURS] & RS5C348_HOURS_MASK);
124124
if (!pdata->rtc_24h) {
125-
tm->tm_hour %= 12;
126-
if (rxbuf[RS5C348_REG_HOURS] & RS5C348_BIT_PM)
125+
if (rxbuf[RS5C348_REG_HOURS] & RS5C348_BIT_PM) {
126+
tm->tm_hour -= 20;
127+
tm->tm_hour %= 12;
127128
tm->tm_hour += 12;
129+
} else
130+
tm->tm_hour %= 12;
128131
}
129132
tm->tm_wday = bcd2bin(rxbuf[RS5C348_REG_WDAY] & RS5C348_WDAY_MASK);
130133
tm->tm_mday = bcd2bin(rxbuf[RS5C348_REG_DAY] & RS5C348_DAY_MASK);

include/linux/compaction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extern int sysctl_extfrag_handler(struct ctl_table *table, int write,
2222
extern int fragmentation_index(struct zone *zone, unsigned int order);
2323
extern unsigned long try_to_compact_pages(struct zonelist *zonelist,
2424
int order, gfp_t gfp_mask, nodemask_t *mask,
25-
bool sync);
25+
bool sync, bool *contended);
2626
extern int compact_pgdat(pg_data_t *pgdat, int order);
2727
extern unsigned long compaction_suitable(struct zone *zone, int order);
2828

@@ -64,7 +64,7 @@ static inline bool compaction_deferred(struct zone *zone, int order)
6464
#else
6565
static inline unsigned long try_to_compact_pages(struct zonelist *zonelist,
6666
int order, gfp_t gfp_mask, nodemask_t *nodemask,
67-
bool sync)
67+
bool sync, bool *contended)
6868
{
6969
return COMPACT_CONTINUE;
7070
}

include/linux/string.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ static inline bool strstarts(const char *str, const char *prefix)
144144
{
145145
return strncmp(str, prefix, strlen(prefix)) == 0;
146146
}
147-
#endif
148147

149148
extern size_t memweight(const void *ptr, size_t bytes);
150149

150+
#endif /* __KERNEL__ */
151151
#endif /* _LINUX_STRING_H_ */

0 commit comments

Comments
 (0)