From 5e6e5dc47d38da68bf40c60b14f262fcb5510aa5 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Sun, 6 Mar 2011 18:02:31 +0000 Subject: [PATCH] --- yaml --- r: 234018 b: refs/heads/master c: f2f6dad6ca3b06ae35a2e7b63f38158242c01531 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/alpha/kernel/sys_titan.c | 1 - trunk/arch/powerpc/include/asm/lppaca.h | 16 ++++++++++++++++ trunk/arch/powerpc/kernel/paca.c | 14 -------------- trunk/arch/powerpc/platforms/iseries/dt.c | 6 +++--- trunk/arch/powerpc/platforms/iseries/setup.c | 1 + trunk/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c | 2 +- trunk/drivers/i2c/busses/i2c-eg20t.c | 1 - trunk/drivers/i2c/busses/i2c-ocores.c | 2 +- trunk/drivers/i2c/busses/i2c-omap.c | 4 +++- trunk/drivers/mmc/core/core.c | 2 +- trunk/drivers/watchdog/sbc_fitpc2_wdt.c | 7 ++----- trunk/fs/namei.c | 14 +++----------- trunk/fs/nfsd/nfs4callback.c | 2 +- trunk/fs/nfsd/nfs4state.c | 13 ++++++------- trunk/fs/nfsd/nfs4xdr.c | 4 ++-- trunk/fs/proc/inode.c | 8 ++------ trunk/fs/proc/proc_sysctl.c | 7 ++----- trunk/include/linux/netdevice.h | 3 --- trunk/include/linux/sysctl.h | 14 ++++---------- trunk/kernel/sysctl.c | 15 +++++---------- trunk/net/core/dev.c | 12 ++---------- trunk/net/ipv4/ip_gre.c | 2 +- trunk/net/ipv4/ipip.c | 2 +- trunk/net/ipv6/sit.c | 2 +- 25 files changed, 59 insertions(+), 97 deletions(-) diff --git a/[refs] b/[refs] index dc5185d1e91c..3e53ec439a73 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ab02a9540541dd7b2012f32f5e311c3cbd772387 +refs/heads/master: f2f6dad6ca3b06ae35a2e7b63f38158242c01531 diff --git a/trunk/arch/alpha/kernel/sys_titan.c b/trunk/arch/alpha/kernel/sys_titan.c index 8c13a0c77830..f6c108a3d673 100644 --- a/trunk/arch/alpha/kernel/sys_titan.c +++ b/trunk/arch/alpha/kernel/sys_titan.c @@ -149,7 +149,6 @@ static int titan_set_irq_affinity(struct irq_data *d, const struct cpumask *affinity, bool force) { - unsigned int irq = d->irq; spin_lock(&titan_irq_lock); titan_cpu_set_irq_affinity(irq - 16, *affinity); titan_update_irq_hw(titan_cached_irq_mask); diff --git a/trunk/arch/powerpc/include/asm/lppaca.h b/trunk/arch/powerpc/include/asm/lppaca.h index 380d48bacd16..26b8c807f8f1 100644 --- a/trunk/arch/powerpc/include/asm/lppaca.h +++ b/trunk/arch/powerpc/include/asm/lppaca.h @@ -33,9 +33,25 @@ // //---------------------------------------------------------------------------- #include +#include #include #include +/* + * We only have to have statically allocated lppaca structs on + * legacy iSeries, which supports at most 64 cpus. + */ +#ifdef CONFIG_PPC_ISERIES +#if NR_CPUS < 64 +#define NR_LPPACAS NR_CPUS +#else +#define NR_LPPACAS 64 +#endif +#else /* not iSeries */ +#define NR_LPPACAS 1 +#endif + + /* The Hypervisor barfs if the lppaca crosses a page boundary. A 1k * alignment is sufficient to prevent this */ struct lppaca { diff --git a/trunk/arch/powerpc/kernel/paca.c b/trunk/arch/powerpc/kernel/paca.c index ebf9846f3c3b..f4adf89d7614 100644 --- a/trunk/arch/powerpc/kernel/paca.c +++ b/trunk/arch/powerpc/kernel/paca.c @@ -26,20 +26,6 @@ extern unsigned long __toc_start; #ifdef CONFIG_PPC_BOOK3S -/* - * We only have to have statically allocated lppaca structs on - * legacy iSeries, which supports at most 64 cpus. - */ -#ifdef CONFIG_PPC_ISERIES -#if NR_CPUS < 64 -#define NR_LPPACAS NR_CPUS -#else -#define NR_LPPACAS 64 -#endif -#else /* not iSeries */ -#define NR_LPPACAS 1 -#endif - /* * The structure which the hypervisor knows about - this structure * should not cross a page boundary. The vpa_init/register_vpa call diff --git a/trunk/arch/powerpc/platforms/iseries/dt.c b/trunk/arch/powerpc/platforms/iseries/dt.c index fdb7384c0c4f..f0491cc28900 100644 --- a/trunk/arch/powerpc/platforms/iseries/dt.c +++ b/trunk/arch/powerpc/platforms/iseries/dt.c @@ -242,8 +242,8 @@ static void __init dt_cpus(struct iseries_flat_dt *dt) pft_size[0] = 0; /* NUMA CEC cookie, 0 for non NUMA */ pft_size[1] = __ilog2(HvCallHpt_getHptPages() * HW_PAGE_SIZE); - for (i = 0; i < NR_CPUS; i++) { - if (lppaca_of(i).dyn_proc_status >= 2) + for (i = 0; i < NR_LPPACAS; i++) { + if (lppaca[i].dyn_proc_status >= 2) continue; snprintf(p, 32 - (p - buf), "@%d", i); @@ -251,7 +251,7 @@ static void __init dt_cpus(struct iseries_flat_dt *dt) dt_prop_str(dt, "device_type", device_type_cpu); - index = lppaca_of(i).dyn_hv_phys_proc_index; + index = lppaca[i].dyn_hv_phys_proc_index; d = &xIoHriProcessorVpd[index]; dt_prop_u32(dt, "i-cache-size", d->xInstCacheSize * 1024); diff --git a/trunk/arch/powerpc/platforms/iseries/setup.c b/trunk/arch/powerpc/platforms/iseries/setup.c index b0863410517f..2946ae10fbfd 100644 --- a/trunk/arch/powerpc/platforms/iseries/setup.c +++ b/trunk/arch/powerpc/platforms/iseries/setup.c @@ -680,6 +680,7 @@ void * __init iSeries_early_setup(void) * on but calling this function multiple times is fine. */ identify_cpu(0, mfspr(SPRN_PVR)); + initialise_paca(&boot_paca, 0); powerpc_firmware_features |= FW_FEATURE_ISERIES; powerpc_firmware_features |= FW_FEATURE_LPAR; diff --git a/trunk/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c b/trunk/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c index 4a5a42b842ad..4f6f679f2799 100644 --- a/trunk/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c +++ b/trunk/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c @@ -195,7 +195,7 @@ static unsigned int pcc_get_freq(unsigned int cpu) cmd_incomplete: iowrite16(0, &pcch_hdr->status); spin_unlock(&pcc_lock); - return 0; + return -EINVAL; } static int pcc_cpufreq_target(struct cpufreq_policy *policy, diff --git a/trunk/drivers/i2c/busses/i2c-eg20t.c b/trunk/drivers/i2c/busses/i2c-eg20t.c index 50ea1f43bdc1..2e067dd2ee51 100644 --- a/trunk/drivers/i2c/busses/i2c-eg20t.c +++ b/trunk/drivers/i2c/busses/i2c-eg20t.c @@ -29,7 +29,6 @@ #include #include #include -#include #define PCH_EVENT_SET 0 /* I2C Interrupt Event Set Status */ #define PCH_EVENT_NONE 1 /* I2C Interrupt Event Clear Status */ diff --git a/trunk/drivers/i2c/busses/i2c-ocores.c b/trunk/drivers/i2c/busses/i2c-ocores.c index 61653f079671..ef3bcb1ce864 100644 --- a/trunk/drivers/i2c/busses/i2c-ocores.c +++ b/trunk/drivers/i2c/busses/i2c-ocores.c @@ -249,7 +249,7 @@ static struct i2c_adapter ocores_adapter = { static int ocores_i2c_of_probe(struct platform_device* pdev, struct ocores_i2c* i2c) { - const __be32* val; + __be32* val; val = of_get_property(pdev->dev.of_node, "regstep", NULL); if (!val) { diff --git a/trunk/drivers/i2c/busses/i2c-omap.c b/trunk/drivers/i2c/busses/i2c-omap.c index 58a58c7eaa17..829a2a1029f7 100644 --- a/trunk/drivers/i2c/busses/i2c-omap.c +++ b/trunk/drivers/i2c/busses/i2c-omap.c @@ -378,7 +378,9 @@ static int omap_i2c_init(struct omap_i2c_dev *dev) * REVISIT: Some wkup sources might not be needed. */ dev->westate = OMAP_I2C_WE_ALL; - omap_i2c_write_reg(dev, OMAP_I2C_WE_REG, dev->westate); + if (dev->rev < OMAP_I2C_REV_ON_4430) + omap_i2c_write_reg(dev, OMAP_I2C_WE_REG, + dev->westate); } } omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); diff --git a/trunk/drivers/mmc/core/core.c b/trunk/drivers/mmc/core/core.c index 150b5f3cd401..6625c057be05 100644 --- a/trunk/drivers/mmc/core/core.c +++ b/trunk/drivers/mmc/core/core.c @@ -1529,7 +1529,7 @@ void mmc_rescan(struct work_struct *work) * still present */ if (host->bus_ops && host->bus_ops->detect && !host->bus_dead - && !(host->caps & MMC_CAP_NONREMOVABLE)) + && mmc_card_is_removable(host)) host->bus_ops->detect(host); /* diff --git a/trunk/drivers/watchdog/sbc_fitpc2_wdt.c b/trunk/drivers/watchdog/sbc_fitpc2_wdt.c index 79906255eeb6..c7d67e9a7465 100644 --- a/trunk/drivers/watchdog/sbc_fitpc2_wdt.c +++ b/trunk/drivers/watchdog/sbc_fitpc2_wdt.c @@ -201,14 +201,11 @@ static struct miscdevice fitpc2_wdt_miscdev = { static int __init fitpc2_wdt_init(void) { int err; - const char *brd_name; - brd_name = dmi_get_system_info(DMI_BOARD_NAME); - - if (!brd_name || !strstr(brd_name, "SBC-FITPC2")) + if (!strstr(dmi_get_system_info(DMI_BOARD_NAME), "SBC-FITPC2")) return -ENODEV; - pr_info("%s found\n", brd_name); + pr_info("%s found\n", dmi_get_system_info(DMI_BOARD_NAME)); if (!request_region(COMMAND_PORT, 1, WATCHDOG_NAME)) { pr_err("I/O address 0x%04x already in use\n", COMMAND_PORT); diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index a4689eb2df28..0087cf9c2c6b 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -1546,7 +1546,6 @@ static int path_walk(const char *name, struct nameidata *nd) /* nd->path had been dropped */ current->total_link_count = 0; nd->path = save; - nd->inode = save.dentry->d_inode; path_get(&nd->path); nd->flags |= LOOKUP_REVAL; result = link_path_walk(name, nd); @@ -2456,29 +2455,22 @@ struct file *do_filp_open(int dfd, const char *pathname, /* !O_CREAT, simple open */ error = do_path_lookup(dfd, pathname, flags, &nd); if (unlikely(error)) - goto out_filp2; + goto out_filp; error = -ELOOP; if (!(nd.flags & LOOKUP_FOLLOW)) { if (nd.inode->i_op->follow_link) - goto out_path2; + goto out_path; } error = -ENOTDIR; if (nd.flags & LOOKUP_DIRECTORY) { if (!nd.inode->i_op->lookup) - goto out_path2; + goto out_path; } audit_inode(pathname, nd.path.dentry); filp = finish_open(&nd, open_flag, acc_mode); -out2: release_open_intent(&nd); return filp; -out_path2: - path_put(&nd.path); -out_filp2: - filp = ERR_PTR(error); - goto out2; - creat: /* OK, have to create the file. Find the parent. */ error = path_init_rcu(dfd, pathname, diff --git a/trunk/fs/nfsd/nfs4callback.c b/trunk/fs/nfsd/nfs4callback.c index 02eb4edf0ece..cde36cb0f348 100644 --- a/trunk/fs/nfsd/nfs4callback.c +++ b/trunk/fs/nfsd/nfs4callback.c @@ -432,7 +432,7 @@ static int decode_cb_sequence4resok(struct xdr_stream *xdr, * If the server returns different values for sessionID, slotID or * sequence number, the server is looney tunes. */ - p = xdr_inline_decode(xdr, NFS4_MAX_SESSIONID_LEN + 4 + 4 + 4 + 4); + p = xdr_inline_decode(xdr, NFS4_MAX_SESSIONID_LEN + 4 + 4); if (unlikely(p == NULL)) goto out_overflow; memcpy(id.data, p, NFS4_MAX_SESSIONID_LEN); diff --git a/trunk/fs/nfsd/nfs4state.c b/trunk/fs/nfsd/nfs4state.c index 7b566ec14e18..54b60bfceb8d 100644 --- a/trunk/fs/nfsd/nfs4state.c +++ b/trunk/fs/nfsd/nfs4state.c @@ -2445,16 +2445,15 @@ nfs4_check_delegmode(struct nfs4_delegation *dp, int flags) static struct nfs4_delegation * find_delegation_file(struct nfs4_file *fp, stateid_t *stid) { - struct nfs4_delegation *dp; + struct nfs4_delegation *dp = NULL; spin_lock(&recall_lock); - list_for_each_entry(dp, &fp->fi_delegations, dl_perfile) - if (dp->dl_stateid.si_stateownerid == stid->si_stateownerid) { - spin_unlock(&recall_lock); - return dp; - } + list_for_each_entry(dp, &fp->fi_delegations, dl_perfile) { + if (dp->dl_stateid.si_stateownerid == stid->si_stateownerid) + break; + } spin_unlock(&recall_lock); - return NULL; + return dp; } int share_access_to_flags(u32 share_access) diff --git a/trunk/fs/nfsd/nfs4xdr.c b/trunk/fs/nfsd/nfs4xdr.c index 615f0a9f0600..1275b8655070 100644 --- a/trunk/fs/nfsd/nfs4xdr.c +++ b/trunk/fs/nfsd/nfs4xdr.c @@ -1142,7 +1142,7 @@ nfsd4_decode_create_session(struct nfsd4_compoundargs *argp, u32 dummy; char *machine_name; - int i, j; + int i; int nr_secflavs; READ_BUF(16); @@ -1215,7 +1215,7 @@ nfsd4_decode_create_session(struct nfsd4_compoundargs *argp, READ_BUF(4); READ32(dummy); READ_BUF(dummy * 4); - for (j = 0; j < dummy; ++j) + for (i = 0; i < dummy; ++i) READ32(dummy); break; case RPC_AUTH_GSS: diff --git a/trunk/fs/proc/inode.c b/trunk/fs/proc/inode.c index d6a7ca1fdac5..176ce4cda68a 100644 --- a/trunk/fs/proc/inode.c +++ b/trunk/fs/proc/inode.c @@ -27,7 +27,6 @@ static void proc_evict_inode(struct inode *inode) { struct proc_dir_entry *de; - struct ctl_table_header *head; truncate_inode_pages(&inode->i_data, 0); end_writeback(inode); @@ -39,11 +38,8 @@ static void proc_evict_inode(struct inode *inode) de = PROC_I(inode)->pde; if (de) pde_put(de); - head = PROC_I(inode)->sysctl; - if (head) { - rcu_assign_pointer(PROC_I(inode)->sysctl, NULL); - sysctl_head_put(head); - } + if (PROC_I(inode)->sysctl) + sysctl_head_put(PROC_I(inode)->sysctl); } struct vfsmount *proc_mnt; diff --git a/trunk/fs/proc/proc_sysctl.c b/trunk/fs/proc/proc_sysctl.c index 8eb2522111c5..09a1f92a34ef 100644 --- a/trunk/fs/proc/proc_sysctl.c +++ b/trunk/fs/proc/proc_sysctl.c @@ -408,18 +408,15 @@ static int proc_sys_compare(const struct dentry *parent, const struct dentry *dentry, const struct inode *inode, unsigned int len, const char *str, const struct qstr *name) { - struct ctl_table_header *head; /* Although proc doesn't have negative dentries, rcu-walk means * that inode here can be NULL */ - /* AV: can it, indeed? */ if (!inode) - return 1; + return 0; if (name->len != len) return 1; if (memcmp(name->name, str, len)) return 1; - head = rcu_dereference(PROC_I(inode)->sysctl); - return !head || !sysctl_is_seen(head); + return !sysctl_is_seen(PROC_I(inode)->sysctl); } static const struct dentry_operations proc_sys_dentry_operations = { diff --git a/trunk/include/linux/netdevice.h b/trunk/include/linux/netdevice.h index 71caf7a5e6c6..d971346b0340 100644 --- a/trunk/include/linux/netdevice.h +++ b/trunk/include/linux/netdevice.h @@ -2392,9 +2392,6 @@ extern int netdev_notice(const struct net_device *dev, const char *format, ...) extern int netdev_info(const struct net_device *dev, const char *format, ...) __attribute__ ((format (printf, 2, 3))); -#define MODULE_ALIAS_NETDEV(device) \ - MODULE_ALIAS("netdev-" device) - #if defined(DEBUG) #define netdev_dbg(__dev, format, args...) \ netdev_printk(KERN_DEBUG, __dev, format, ##args) diff --git a/trunk/include/linux/sysctl.h b/trunk/include/linux/sysctl.h index 11684d9e6bd2..7bb5cb64f3b8 100644 --- a/trunk/include/linux/sysctl.h +++ b/trunk/include/linux/sysctl.h @@ -930,7 +930,6 @@ enum #ifdef __KERNEL__ #include -#include /* For the /proc/sys support */ struct ctl_table; @@ -1038,15 +1037,10 @@ struct ctl_table_root { struct ctl_table trees. */ struct ctl_table_header { - union { - struct { - struct ctl_table *ctl_table; - struct list_head ctl_entry; - int used; - int count; - }; - struct rcu_head rcu; - }; + struct ctl_table *ctl_table; + struct list_head ctl_entry; + int used; + int count; struct completion *unregistering; struct ctl_table *ctl_table_arg; struct ctl_table_root *root; diff --git a/trunk/kernel/sysctl.c b/trunk/kernel/sysctl.c index 4eed0af5d144..0f1bd83db985 100644 --- a/trunk/kernel/sysctl.c +++ b/trunk/kernel/sysctl.c @@ -194,9 +194,9 @@ static int sysrq_sysctl_handler(ctl_table *table, int write, static struct ctl_table root_table[]; static struct ctl_table_root sysctl_table_root; static struct ctl_table_header root_table_header = { - {{.count = 1, + .count = 1, .ctl_table = root_table, - .ctl_entry = LIST_HEAD_INIT(sysctl_table_root.default_set.list),}}, + .ctl_entry = LIST_HEAD_INIT(sysctl_table_root.default_set.list), .root = &sysctl_table_root, .set = &sysctl_table_root.default_set, }; @@ -1567,16 +1567,11 @@ void sysctl_head_get(struct ctl_table_header *head) spin_unlock(&sysctl_lock); } -static void free_head(struct rcu_head *rcu) -{ - kfree(container_of(rcu, struct ctl_table_header, rcu)); -} - void sysctl_head_put(struct ctl_table_header *head) { spin_lock(&sysctl_lock); if (!--head->count) - call_rcu(&head->rcu, free_head); + kfree(head); spin_unlock(&sysctl_lock); } @@ -1953,10 +1948,10 @@ void unregister_sysctl_table(struct ctl_table_header * header) start_unregistering(header); if (!--header->parent->count) { WARN_ON(1); - call_rcu(&header->parent->rcu, free_head); + kfree(header->parent); } if (!--header->count) - call_rcu(&header->rcu, free_head); + kfree(header); spin_unlock(&sysctl_lock); } diff --git a/trunk/net/core/dev.c b/trunk/net/core/dev.c index 6561021d22d1..8ae6631abcc2 100644 --- a/trunk/net/core/dev.c +++ b/trunk/net/core/dev.c @@ -1114,21 +1114,13 @@ EXPORT_SYMBOL(netdev_bonding_change); void dev_load(struct net *net, const char *name) { struct net_device *dev; - int no_module; rcu_read_lock(); dev = dev_get_by_name_rcu(net, name); rcu_read_unlock(); - no_module = !dev; - if (no_module && capable(CAP_NET_ADMIN)) - no_module = request_module("netdev-%s", name); - if (no_module && capable(CAP_SYS_MODULE)) { - if (!request_module("%s", name)) - pr_err("Loading kernel module for a network device " -"with CAP_SYS_MODULE (deprecated). Use CAP_NET_ADMIN and alias netdev-%s " -"instead\n", name); - } + if (!dev && capable(CAP_NET_ADMIN)) + request_module("%s", name); } EXPORT_SYMBOL(dev_load); diff --git a/trunk/net/ipv4/ip_gre.c b/trunk/net/ipv4/ip_gre.c index d1d0e2c256fc..6613edfac28c 100644 --- a/trunk/net/ipv4/ip_gre.c +++ b/trunk/net/ipv4/ip_gre.c @@ -1765,4 +1765,4 @@ module_exit(ipgre_fini); MODULE_LICENSE("GPL"); MODULE_ALIAS_RTNL_LINK("gre"); MODULE_ALIAS_RTNL_LINK("gretap"); -MODULE_ALIAS_NETDEV("gre0"); +MODULE_ALIAS("gre0"); diff --git a/trunk/net/ipv4/ipip.c b/trunk/net/ipv4/ipip.c index a5f58e7cbb26..988f52fba54a 100644 --- a/trunk/net/ipv4/ipip.c +++ b/trunk/net/ipv4/ipip.c @@ -913,4 +913,4 @@ static void __exit ipip_fini(void) module_init(ipip_init); module_exit(ipip_fini); MODULE_LICENSE("GPL"); -MODULE_ALIAS_NETDEV("tunl0"); +MODULE_ALIAS("tunl0"); diff --git a/trunk/net/ipv6/sit.c b/trunk/net/ipv6/sit.c index d2c16e10f650..8ce38f10a547 100644 --- a/trunk/net/ipv6/sit.c +++ b/trunk/net/ipv6/sit.c @@ -1290,4 +1290,4 @@ static int __init sit_init(void) module_init(sit_init); module_exit(sit_cleanup); MODULE_LICENSE("GPL"); -MODULE_ALIAS_NETDEV("sit0"); +MODULE_ALIAS("sit0");