From: Greg Kroah-Hartman Date: Tue, 3 Jun 2014 23:18:20 +0000 (-0700) Subject: 3.14-stable patches X-Git-Tag: v3.14.6~56 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1d3afd4272d9ef23b900177ff4cdc931540a7c36;p=thirdparty%2Fkernel%2Fstable-queue.git 3.14-stable patches added patches: autofs-fix-lockref-lookup.patch ceph-clear-directory-s-completeness-when-creating-file.patch e1000e-fix-no-connectivity-when-driver-loaded-with-cable-out.patch fix-races-between-__d_instantiate-and-checks-of-dentry-flags.patch input-add-input_prop_topbuttonpad-device-property.patch input-i8042-add-firmware_id-support.patch input-serio-add-firmware_id-sysfs-attribute.patch input-synaptics-report-input_prop_topbuttonpad-property.patch --- diff --git a/queue-3.14/autofs-fix-lockref-lookup.patch b/queue-3.14/autofs-fix-lockref-lookup.patch new file mode 100644 index 00000000000..3f552852183 --- /dev/null +++ b/queue-3.14/autofs-fix-lockref-lookup.patch @@ -0,0 +1,54 @@ +From 6b6751f7feba68d8f5c72b72cc69a1c5a625529c Mon Sep 17 00:00:00 2001 +From: Ian Kent +Date: Tue, 6 May 2014 12:50:06 -0700 +Subject: autofs: fix lockref lookup + +From: Ian Kent + +commit 6b6751f7feba68d8f5c72b72cc69a1c5a625529c upstream. + +autofs needs to be able to see private data dentry flags for its dentrys +that are being created but not yet hashed and for its dentrys that have +been rmdir()ed but not yet freed. It needs to do this so it can block +processes in these states until a status has been returned to indicate +the given operation is complete. + +It does this by keeping two lists, active and expring, of dentrys in +this state and uses ->d_release() to keep them stable while it checks +the reference count to determine if they should be used. + +But with the recent lockref changes dentrys being freed sometimes don't +transition to a reference count of 0 before being freed so autofs can +occassionally use a dentry that is invalid which can lead to a panic. + +Signed-off-by: Ian Kent +Cc: Al Viro +Cc: Linus Torvalds +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/autofs4/root.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/fs/autofs4/root.c ++++ b/fs/autofs4/root.c +@@ -179,7 +179,7 @@ static struct dentry *autofs4_lookup_act + spin_lock(&active->d_lock); + + /* Already gone? */ +- if (!d_count(active)) ++ if ((int) d_count(active) <= 0) + goto next; + + qstr = &active->d_name; +@@ -230,7 +230,7 @@ static struct dentry *autofs4_lookup_exp + + spin_lock(&expiring->d_lock); + +- /* Bad luck, we've already been dentry_iput */ ++ /* We've already been dentry_iput or unlinked */ + if (!expiring->d_inode) + goto next; + diff --git a/queue-3.14/ceph-clear-directory-s-completeness-when-creating-file.patch b/queue-3.14/ceph-clear-directory-s-completeness-when-creating-file.patch new file mode 100644 index 00000000000..fa9a4c93ce5 --- /dev/null +++ b/queue-3.14/ceph-clear-directory-s-completeness-when-creating-file.patch @@ -0,0 +1,220 @@ +From 0a8a70f96fe1bd3e07c15bb86fd247e76102398a Mon Sep 17 00:00:00 2001 +From: "Yan, Zheng" +Date: Mon, 14 Apr 2014 13:13:02 +0800 +Subject: ceph: clear directory's completeness when creating file + +From: "Yan, Zheng" + +commit 0a8a70f96fe1bd3e07c15bb86fd247e76102398a upstream. + +When creating a file, ceph_set_dentry_offset() puts the new dentry +at the end of directory's d_subdirs, then set the dentry's offset +based on directory's max offset. The offset does not reflect the +real postion of the dentry in directory. Later readdir reply from +MDS may change the dentry's position/offset. This inconsistency +can cause missing/duplicate entries in readdir result if readdir +is partly satisfied by dcache_readdir(). + +The fix is clear directory's completeness after creating/renaming +file. It prevents later readdir from using dcache_readdir(). + +Fixes: http://tracker.ceph.com/issues/8025 +Signed-off-by: Yan, Zheng +Reviewed-by: Sage Weil +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ceph/dir.c | 9 +++---- + fs/ceph/inode.c | 71 ++++++++++++-------------------------------------------- + fs/ceph/super.h | 1 + 3 files changed, 21 insertions(+), 60 deletions(-) + +--- a/fs/ceph/dir.c ++++ b/fs/ceph/dir.c +@@ -446,7 +446,6 @@ more: + if (atomic_read(&ci->i_release_count) == fi->dir_release_count) { + dout(" marking %p complete\n", inode); + __ceph_dir_set_complete(ci, fi->dir_release_count); +- ci->i_max_offset = ctx->pos; + } + spin_unlock(&ci->i_ceph_lock); + +@@ -932,14 +931,16 @@ static int ceph_rename(struct inode *old + * to do it here. + */ + +- /* d_move screws up d_subdirs order */ +- ceph_dir_clear_complete(new_dir); +- + d_move(old_dentry, new_dentry); + + /* ensure target dentry is invalidated, despite + rehashing bug in vfs_rename_dir */ + ceph_invalidate_dentry_lease(new_dentry); ++ ++ /* d_move screws up sibling dentries' offsets */ ++ ceph_dir_clear_complete(old_dir); ++ ceph_dir_clear_complete(new_dir); ++ + } + ceph_mdsc_put_request(req); + return err; +--- a/fs/ceph/inode.c ++++ b/fs/ceph/inode.c +@@ -752,7 +752,6 @@ static int fill_inode(struct inode *inod + !__ceph_dir_is_complete(ci)) { + dout(" marking %p complete (empty)\n", inode); + __ceph_dir_set_complete(ci, atomic_read(&ci->i_release_count)); +- ci->i_max_offset = 2; + } + no_change: + spin_unlock(&ci->i_ceph_lock); +@@ -890,41 +889,6 @@ out_unlock: + } + + /* +- * Set dentry's directory position based on the current dir's max, and +- * order it in d_subdirs, so that dcache_readdir behaves. +- * +- * Always called under directory's i_mutex. +- */ +-static void ceph_set_dentry_offset(struct dentry *dn) +-{ +- struct dentry *dir = dn->d_parent; +- struct inode *inode = dir->d_inode; +- struct ceph_inode_info *ci; +- struct ceph_dentry_info *di; +- +- BUG_ON(!inode); +- +- ci = ceph_inode(inode); +- di = ceph_dentry(dn); +- +- spin_lock(&ci->i_ceph_lock); +- if (!__ceph_dir_is_complete(ci)) { +- spin_unlock(&ci->i_ceph_lock); +- return; +- } +- di->offset = ceph_inode(inode)->i_max_offset++; +- spin_unlock(&ci->i_ceph_lock); +- +- spin_lock(&dir->d_lock); +- spin_lock_nested(&dn->d_lock, DENTRY_D_LOCK_NESTED); +- list_move(&dn->d_u.d_child, &dir->d_subdirs); +- dout("set_dentry_offset %p %lld (%p %p)\n", dn, di->offset, +- dn->d_u.d_child.prev, dn->d_u.d_child.next); +- spin_unlock(&dn->d_lock); +- spin_unlock(&dir->d_lock); +-} +- +-/* + * splice a dentry to an inode. + * caller must hold directory i_mutex for this to be safe. + * +@@ -933,7 +897,7 @@ static void ceph_set_dentry_offset(struc + * the caller) if we fail. + */ + static struct dentry *splice_dentry(struct dentry *dn, struct inode *in, +- bool *prehash, bool set_offset) ++ bool *prehash) + { + struct dentry *realdn; + +@@ -965,8 +929,6 @@ static struct dentry *splice_dentry(stru + } + if ((!prehash || *prehash) && d_unhashed(dn)) + d_rehash(dn); +- if (set_offset) +- ceph_set_dentry_offset(dn); + out: + return dn; + } +@@ -987,7 +949,6 @@ int ceph_fill_trace(struct super_block * + { + struct ceph_mds_reply_info_parsed *rinfo = &req->r_reply_info; + struct inode *in = NULL; +- struct ceph_mds_reply_inode *ininfo; + struct ceph_vino vino; + struct ceph_fs_client *fsc = ceph_sb_to_client(sb); + int err = 0; +@@ -1112,6 +1073,9 @@ int ceph_fill_trace(struct super_block * + + /* rename? */ + if (req->r_old_dentry && req->r_op == CEPH_MDS_OP_RENAME) { ++ struct inode *olddir = req->r_old_dentry_dir; ++ BUG_ON(!olddir); ++ + dout(" src %p '%.*s' dst %p '%.*s'\n", + req->r_old_dentry, + req->r_old_dentry->d_name.len, +@@ -1131,13 +1095,10 @@ int ceph_fill_trace(struct super_block * + rehashing bug in vfs_rename_dir */ + ceph_invalidate_dentry_lease(dn); + +- /* +- * d_move() puts the renamed dentry at the end of +- * d_subdirs. We need to assign it an appropriate +- * directory offset so we can behave when dir is +- * complete. +- */ +- ceph_set_dentry_offset(req->r_old_dentry); ++ /* d_move screws up sibling dentries' offsets */ ++ ceph_dir_clear_complete(dir); ++ ceph_dir_clear_complete(olddir); ++ + dout("dn %p gets new offset %lld\n", req->r_old_dentry, + ceph_dentry(req->r_old_dentry)->offset); + +@@ -1164,8 +1125,9 @@ int ceph_fill_trace(struct super_block * + + /* attach proper inode */ + if (!dn->d_inode) { ++ ceph_dir_clear_complete(dir); + ihold(in); +- dn = splice_dentry(dn, in, &have_lease, true); ++ dn = splice_dentry(dn, in, &have_lease); + if (IS_ERR(dn)) { + err = PTR_ERR(dn); + goto done; +@@ -1186,17 +1148,16 @@ int ceph_fill_trace(struct super_block * + (req->r_op == CEPH_MDS_OP_LOOKUPSNAP || + req->r_op == CEPH_MDS_OP_MKSNAP)) { + struct dentry *dn = req->r_dentry; ++ struct inode *dir = req->r_locked_dir; + + /* fill out a snapdir LOOKUPSNAP dentry */ + BUG_ON(!dn); +- BUG_ON(!req->r_locked_dir); +- BUG_ON(ceph_snap(req->r_locked_dir) != CEPH_SNAPDIR); +- ininfo = rinfo->targeti.in; +- vino.ino = le64_to_cpu(ininfo->ino); +- vino.snap = le64_to_cpu(ininfo->snapid); ++ BUG_ON(!dir); ++ BUG_ON(ceph_snap(dir) != CEPH_SNAPDIR); + dout(" linking snapped dir %p to dn %p\n", in, dn); ++ ceph_dir_clear_complete(dir); + ihold(in); +- dn = splice_dentry(dn, in, NULL, true); ++ dn = splice_dentry(dn, in, NULL); + if (IS_ERR(dn)) { + err = PTR_ERR(dn); + goto done; +@@ -1358,7 +1319,7 @@ retry_lookup: + } + + if (!dn->d_inode) { +- dn = splice_dentry(dn, in, NULL, false); ++ dn = splice_dentry(dn, in, NULL); + if (IS_ERR(dn)) { + err = PTR_ERR(dn); + dn = NULL; +--- a/fs/ceph/super.h ++++ b/fs/ceph/super.h +@@ -266,7 +266,6 @@ struct ceph_inode_info { + struct timespec i_rctime; + u64 i_rbytes, i_rfiles, i_rsubdirs; + u64 i_files, i_subdirs; +- u64 i_max_offset; /* largest readdir offset, set with complete dir */ + + struct rb_root i_fragtree; + struct mutex i_fragtree_mutex; diff --git a/queue-3.14/e1000e-fix-no-connectivity-when-driver-loaded-with-cable-out.patch b/queue-3.14/e1000e-fix-no-connectivity-when-driver-loaded-with-cable-out.patch new file mode 100644 index 00000000000..7144cd32be4 --- /dev/null +++ b/queue-3.14/e1000e-fix-no-connectivity-when-driver-loaded-with-cable-out.patch @@ -0,0 +1,70 @@ +From b20a774495671f037e7160ea2ce8789af6b61533 Mon Sep 17 00:00:00 2001 +From: David Ertman +Date: Tue, 25 Mar 2014 04:27:55 +0000 +Subject: e1000e: Fix no connectivity when driver loaded with cable out + +From: David Ertman + +commit b20a774495671f037e7160ea2ce8789af6b61533 upstream. + +In commit da1e2046e5, the flow for enabling/disabling an Si errata +workaround (e1000_lv_jumbo_workaround_ich8lan) was changed to fix a problem +with iAMT connections dropping on interface down with jumbo frames set. +Part of this change was to move the function call disabling the workaround +to e1000e_down() from the e1000_setup_rctl() function. The mechanic for +disabling of this workaround involves writing several MAC and PHY registers +back to hardware defaults. + +After this commit, when the driver is loaded with the cable out, the PHY +registers are not programmed with the correct default values. This causes +the device to be capable of transmitting packets, but is unable to recieve +them until this workaround is called. + +The flow of e1000e's open code relies upon calling the above workaround to +expicitly program these registers either with jumbo frame appropriate settings +or h/w defaults on 82579 and newer hardware. + +Fix this issue by adding logic to e1000_setup_rctl() that not only calls +e1000_lv_jumbo_workaround_ich8lan() when jumbo frames are set, to enable the +workaround, but also calls this function to explicitly disable the workaround +in the case that jumbo frames are not set. + +Signed-off-by: Dave Ertman +Tested-by: Jeff Pieper +Signed-off-by: Jeff Kirsher +Cc: Thomas Gleixner +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/intel/e1000e/netdev.c | 20 +++++++++++++++----- + 1 file changed, 15 insertions(+), 5 deletions(-) + +--- a/drivers/net/ethernet/intel/e1000e/netdev.c ++++ b/drivers/net/ethernet/intel/e1000e/netdev.c +@@ -2976,11 +2976,21 @@ static void e1000_setup_rctl(struct e100 + u32 rctl, rfctl; + u32 pages = 0; + +- /* Workaround Si errata on PCHx - configure jumbo frame flow */ +- if ((hw->mac.type >= e1000_pch2lan) && +- (adapter->netdev->mtu > ETH_DATA_LEN) && +- e1000_lv_jumbo_workaround_ich8lan(hw, true)) +- e_dbg("failed to enable jumbo frame workaround mode\n"); ++ /* Workaround Si errata on PCHx - configure jumbo frame flow. ++ * If jumbo frames not set, program related MAC/PHY registers ++ * to h/w defaults ++ */ ++ if (hw->mac.type >= e1000_pch2lan) { ++ s32 ret_val; ++ ++ if (adapter->netdev->mtu > ETH_DATA_LEN) ++ ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true); ++ else ++ ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false); ++ ++ if (ret_val) ++ e_dbg("failed to enable|disable jumbo frame workaround mode\n"); ++ } + + /* Program MC offset vector base */ + rctl = er32(RCTL); diff --git a/queue-3.14/fix-races-between-__d_instantiate-and-checks-of-dentry-flags.patch b/queue-3.14/fix-races-between-__d_instantiate-and-checks-of-dentry-flags.patch new file mode 100644 index 00000000000..a8eee87d131 --- /dev/null +++ b/queue-3.14/fix-races-between-__d_instantiate-and-checks-of-dentry-flags.patch @@ -0,0 +1,79 @@ +From 22213318af7ae265bc6cd8aef2febbc2d69a2440 Mon Sep 17 00:00:00 2001 +From: Al Viro +Date: Sat, 19 Apr 2014 12:30:58 -0400 +Subject: fix races between __d_instantiate() and checks of dentry flags + +From: Al Viro + +commit 22213318af7ae265bc6cd8aef2febbc2d69a2440 upstream. + +in non-lazy walk we need to be careful about dentry switching from +negative to positive - both ->d_flags and ->d_inode are updated, +and in some places we might see only one store. The cases where +dentry has been obtained by dcache lookup with ->i_mutex held on +parent are safe - ->d_lock and ->i_mutex provide all the barriers +we need. However, there are several places where we run into +trouble: + * do_last() fetches ->d_inode, then checks ->d_flags and +assumes that inode won't be NULL unless d_is_negative() is true. +Race with e.g. creat() - we might have fetched the old value of +->d_inode (still NULL) and new value of ->d_flags (already not +DCACHE_MISS_TYPE). Lin Ming has observed and reported the resulting +oops. + * a bunch of places checks ->d_inode for being non-NULL, +then checks ->d_flags for "is it a symlink". Race with symlink(2) +in case if our CPU sees ->d_inode update first - we see non-NULL +there, but ->d_flags still contains DCACHE_MISS_TYPE instead of +DCACHE_SYMLINK_TYPE. Result: false negative on "should we follow +link here?", with subsequent unpleasantness. + +Reported-and-tested-by: Lin Ming +Signed-off-by: Al Viro +Signed-off-by: Greg Kroah-Hartman + +--- + fs/dcache.c | 3 +-- + fs/namei.c | 6 +++--- + 2 files changed, 4 insertions(+), 5 deletions(-) + +--- a/fs/dcache.c ++++ b/fs/dcache.c +@@ -1647,8 +1647,7 @@ static void __d_instantiate(struct dentr + unsigned add_flags = d_flags_for_inode(inode); + + spin_lock(&dentry->d_lock); +- dentry->d_flags &= ~DCACHE_ENTRY_TYPE; +- dentry->d_flags |= add_flags; ++ __d_set_type(dentry, add_flags); + if (inode) + hlist_add_head(&dentry->d_alias, &inode->i_dentry); + dentry->d_inode = inode; +--- a/fs/namei.c ++++ b/fs/namei.c +@@ -1537,7 +1537,7 @@ static inline int walk_component(struct + inode = path->dentry->d_inode; + } + err = -ENOENT; +- if (!inode) ++ if (!inode || d_is_negative(path->dentry)) + goto out_path_put; + + if (should_follow_link(path->dentry, follow)) { +@@ -2240,7 +2240,7 @@ mountpoint_last(struct nameidata *nd, st + mutex_unlock(&dir->d_inode->i_mutex); + + done: +- if (!dentry->d_inode) { ++ if (!dentry->d_inode || d_is_negative(dentry)) { + error = -ENOENT; + dput(dentry); + goto out; +@@ -2982,7 +2982,7 @@ retry_lookup: + finish_lookup: + /* we _can_ be in RCU mode here */ + error = -ENOENT; +- if (d_is_negative(path->dentry)) { ++ if (!inode || d_is_negative(path->dentry)) { + path_to_nameidata(path, nd); + goto out; + } diff --git a/queue-3.14/input-add-input_prop_topbuttonpad-device-property.patch b/queue-3.14/input-add-input_prop_topbuttonpad-device-property.patch new file mode 100644 index 00000000000..03d4a228149 --- /dev/null +++ b/queue-3.14/input-add-input_prop_topbuttonpad-device-property.patch @@ -0,0 +1,40 @@ +From f37c013409bb78ebb958821aa10d069e707cabac Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sat, 19 Apr 2014 22:25:45 -0700 +Subject: Input: Add INPUT_PROP_TOPBUTTONPAD device property + +From: Hans de Goede + +commit f37c013409bb78ebb958821aa10d069e707cabac upstream. + +On some newer laptops with a trackpoint the physical buttons for the +trackpoint have been removed to allow for a larger touchpad. On these +laptops the buttonpad has clearly marked areas on the top which are to be +used as trackpad buttons. + +Users of the event device-node need to know about this, so that they can +properly interpret BTN_LEFT events as being a left / right / middle click +depending on where on the button pad the clicking finger is. + +This commits adds a INPUT_PROP_TOPBUTTONPAD device property which drivers +for such buttonpads will use to signal to the user that this buttonpad not +only has the normal bottom button area, but also a top button area. + +Signed-off-by: Hans de Goede +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman + +--- + include/uapi/linux/input.h | 1 + + 1 file changed, 1 insertion(+) + +--- a/include/uapi/linux/input.h ++++ b/include/uapi/linux/input.h +@@ -164,6 +164,7 @@ struct input_keymap_entry { + #define INPUT_PROP_DIRECT 0x01 /* direct input devices */ + #define INPUT_PROP_BUTTONPAD 0x02 /* has button(s) under pad */ + #define INPUT_PROP_SEMI_MT 0x03 /* touch rectangle only */ ++#define INPUT_PROP_TOPBUTTONPAD 0x04 /* softbuttons at top of pad */ + + #define INPUT_PROP_MAX 0x1f + #define INPUT_PROP_CNT (INPUT_PROP_MAX + 1) diff --git a/queue-3.14/input-i8042-add-firmware_id-support.patch b/queue-3.14/input-i8042-add-firmware_id-support.patch new file mode 100644 index 00000000000..d68dbd85440 --- /dev/null +++ b/queue-3.14/input-i8042-add-firmware_id-support.patch @@ -0,0 +1,89 @@ +From a7c5868c3482127cb308c779b8a6460a3353c17f Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sat, 19 Apr 2014 20:47:35 -0700 +Subject: Input: i8042 - add firmware_id support + +From: Hans de Goede + +commit a7c5868c3482127cb308c779b8a6460a3353c17f upstream. + +Fill in the new serio firmware_id sysfs attribute for pnp instantiated +8042 serio ports. + +Signed-off-by: Hans de Goede +Acked-by: Peter Hutterer +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/input/serio/i8042-x86ia64io.h | 15 +++++++++++++++ + drivers/input/serio/i8042.c | 6 ++++++ + 2 files changed, 21 insertions(+) + +--- a/drivers/input/serio/i8042-x86ia64io.h ++++ b/drivers/input/serio/i8042-x86ia64io.h +@@ -702,6 +702,17 @@ static int i8042_pnp_aux_irq; + static char i8042_pnp_kbd_name[32]; + static char i8042_pnp_aux_name[32]; + ++static void i8042_pnp_id_to_string(struct pnp_id *id, char *dst, int dst_size) ++{ ++ strlcpy(dst, "PNP:", dst_size); ++ ++ while (id) { ++ strlcat(dst, " ", dst_size); ++ strlcat(dst, id->id, dst_size); ++ id = id->next; ++ } ++} ++ + static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did) + { + if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1) +@@ -718,6 +729,8 @@ static int i8042_pnp_kbd_probe(struct pn + strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name)); + strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name)); + } ++ i8042_pnp_id_to_string(dev->id, i8042_kbd_firmware_id, ++ sizeof(i8042_kbd_firmware_id)); + + /* Keyboard ports are always supposed to be wakeup-enabled */ + device_set_wakeup_enable(&dev->dev, true); +@@ -742,6 +755,8 @@ static int i8042_pnp_aux_probe(struct pn + strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name)); + strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name)); + } ++ i8042_pnp_id_to_string(dev->id, i8042_aux_firmware_id, ++ sizeof(i8042_aux_firmware_id)); + + i8042_pnp_aux_devices++; + return 0; +--- a/drivers/input/serio/i8042.c ++++ b/drivers/input/serio/i8042.c +@@ -87,6 +87,8 @@ MODULE_PARM_DESC(debug, "Turn i8042 debu + #endif + + static bool i8042_bypass_aux_irq_test; ++static char i8042_kbd_firmware_id[128]; ++static char i8042_aux_firmware_id[128]; + + #include "i8042.h" + +@@ -1218,6 +1220,8 @@ static int __init i8042_create_kbd_port( + serio->dev.parent = &i8042_platform_device->dev; + strlcpy(serio->name, "i8042 KBD port", sizeof(serio->name)); + strlcpy(serio->phys, I8042_KBD_PHYS_DESC, sizeof(serio->phys)); ++ strlcpy(serio->firmware_id, i8042_kbd_firmware_id, ++ sizeof(serio->firmware_id)); + + port->serio = serio; + port->irq = I8042_KBD_IRQ; +@@ -1244,6 +1248,8 @@ static int __init i8042_create_aux_port( + if (idx < 0) { + strlcpy(serio->name, "i8042 AUX port", sizeof(serio->name)); + strlcpy(serio->phys, I8042_AUX_PHYS_DESC, sizeof(serio->phys)); ++ strlcpy(serio->firmware_id, i8042_aux_firmware_id, ++ sizeof(serio->firmware_id)); + serio->close = i8042_port_close; + } else { + snprintf(serio->name, sizeof(serio->name), "i8042 AUX%d port", idx); diff --git a/queue-3.14/input-serio-add-firmware_id-sysfs-attribute.patch b/queue-3.14/input-serio-add-firmware_id-sysfs-attribute.patch new file mode 100644 index 00000000000..43608b6e931 --- /dev/null +++ b/queue-3.14/input-serio-add-firmware_id-sysfs-attribute.patch @@ -0,0 +1,89 @@ +From 0456c66f4e905e1ca839318219c770988b47975c Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sat, 19 Apr 2014 20:39:35 -0700 +Subject: Input: serio - add firmware_id sysfs attribute + +From: Hans de Goede + +commit 0456c66f4e905e1ca839318219c770988b47975c upstream. + +serio devices exposed via platform firmware interfaces such as ACPI may +provide additional identifying information of use to userspace. + +We don't associate the serio devices with the firmware device (we don't +set it as parent), so there's no way for userspace to make use of this +information. + +We cannot change the parent for serio devices instantiated though a +firmware interface as that would break suspend / resume ordering. + +Therefore this patch adds a new firmware_id sysfs attribute so that +userspace can get a string from there with any additional identifying +information the firmware interface may provide. + +Signed-off-by: Hans de Goede +Acked-by: Peter Hutterer +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/input/serio/serio.c | 14 ++++++++++++++ + include/linux/serio.h | 1 + + 2 files changed, 15 insertions(+) + +--- a/drivers/input/serio/serio.c ++++ b/drivers/input/serio/serio.c +@@ -451,6 +451,13 @@ static ssize_t serio_set_bind_mode(struc + return retval; + } + ++static ssize_t firmware_id_show(struct device *dev, struct device_attribute *attr, char *buf) ++{ ++ struct serio *serio = to_serio_port(dev); ++ ++ return sprintf(buf, "%s\n", serio->firmware_id); ++} ++ + static DEVICE_ATTR_RO(type); + static DEVICE_ATTR_RO(proto); + static DEVICE_ATTR_RO(id); +@@ -473,12 +480,14 @@ static DEVICE_ATTR_RO(modalias); + static DEVICE_ATTR_WO(drvctl); + static DEVICE_ATTR(description, S_IRUGO, serio_show_description, NULL); + static DEVICE_ATTR(bind_mode, S_IWUSR | S_IRUGO, serio_show_bind_mode, serio_set_bind_mode); ++static DEVICE_ATTR_RO(firmware_id); + + static struct attribute *serio_device_attrs[] = { + &dev_attr_modalias.attr, + &dev_attr_description.attr, + &dev_attr_drvctl.attr, + &dev_attr_bind_mode.attr, ++ &dev_attr_firmware_id.attr, + NULL + }; + +@@ -921,9 +930,14 @@ static int serio_uevent(struct device *d + SERIO_ADD_UEVENT_VAR("SERIO_PROTO=%02x", serio->id.proto); + SERIO_ADD_UEVENT_VAR("SERIO_ID=%02x", serio->id.id); + SERIO_ADD_UEVENT_VAR("SERIO_EXTRA=%02x", serio->id.extra); ++ + SERIO_ADD_UEVENT_VAR("MODALIAS=serio:ty%02Xpr%02Xid%02Xex%02X", + serio->id.type, serio->id.proto, serio->id.id, serio->id.extra); + ++ if (serio->firmware_id[0]) ++ SERIO_ADD_UEVENT_VAR("SERIO_FIRMWARE_ID=%s", ++ serio->firmware_id); ++ + return 0; + } + #undef SERIO_ADD_UEVENT_VAR +--- a/include/linux/serio.h ++++ b/include/linux/serio.h +@@ -23,6 +23,7 @@ struct serio { + + char name[32]; + char phys[32]; ++ char firmware_id[128]; + + bool manual_bind; + diff --git a/queue-3.14/input-synaptics-report-input_prop_topbuttonpad-property.patch b/queue-3.14/input-synaptics-report-input_prop_topbuttonpad-property.patch new file mode 100644 index 00000000000..3fb7bafb259 --- /dev/null +++ b/queue-3.14/input-synaptics-report-input_prop_topbuttonpad-property.patch @@ -0,0 +1,106 @@ +From 43e19888b1fe2a3e8a5543030c5b286cde38b3f5 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sat, 19 Apr 2014 22:26:41 -0700 +Subject: Input: synaptics - report INPUT_PROP_TOPBUTTONPAD property + +From: Hans de Goede + +commit 43e19888b1fe2a3e8a5543030c5b286cde38b3f5 upstream. + +Check PNP ID of the PS/2 AUX port and report INPUT_PROP_TOPBUTTONPAD +property for for touchpads with top button areas. + +Signed-off-by: Hans de Goede +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/input/mouse/synaptics.c | 55 ++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 53 insertions(+), 2 deletions(-) + +--- a/drivers/input/mouse/synaptics.c ++++ b/drivers/input/mouse/synaptics.c +@@ -117,6 +117,44 @@ void synaptics_reset(struct psmouse *psm + } + + #ifdef CONFIG_MOUSE_PS2_SYNAPTICS ++/* This list has been kindly provided by Synaptics. */ ++static const char * const topbuttonpad_pnp_ids[] = { ++ "LEN0017", ++ "LEN0018", ++ "LEN0019", ++ "LEN0023", ++ "LEN002A", ++ "LEN002B", ++ "LEN002C", ++ "LEN002D", ++ "LEN002E", ++ "LEN0033", /* Helix */ ++ "LEN0034", /* T431s, T540, X1 Carbon 2nd */ ++ "LEN0035", /* X240 */ ++ "LEN0036", /* T440 */ ++ "LEN0037", ++ "LEN0038", ++ "LEN0041", ++ "LEN0042", /* Yoga */ ++ "LEN0045", ++ "LEN0046", ++ "LEN0047", ++ "LEN0048", ++ "LEN0049", ++ "LEN2000", ++ "LEN2001", ++ "LEN2002", ++ "LEN2003", ++ "LEN2004", /* L440 */ ++ "LEN2005", ++ "LEN2006", ++ "LEN2007", ++ "LEN2008", ++ "LEN2009", ++ "LEN200A", ++ "LEN200B", ++ NULL ++}; + + /***************************************************************************** + * Synaptics communications functions +@@ -1255,8 +1293,10 @@ static void set_abs_position_params(stru + input_abs_set_res(dev, y_code, priv->y_res); + } + +-static void set_input_params(struct input_dev *dev, struct synaptics_data *priv) ++static void set_input_params(struct psmouse *psmouse, ++ struct synaptics_data *priv) + { ++ struct input_dev *dev = psmouse->dev; + int i; + + /* Things that apply to both modes */ +@@ -1325,6 +1365,17 @@ static void set_input_params(struct inpu + + if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) { + __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit); ++ /* See if this buttonpad has a top button area */ ++ if (!strncmp(psmouse->ps2dev.serio->firmware_id, "PNP:", 4)) { ++ for (i = 0; topbuttonpad_pnp_ids[i]; i++) { ++ if (strstr(psmouse->ps2dev.serio->firmware_id, ++ topbuttonpad_pnp_ids[i])) { ++ __set_bit(INPUT_PROP_TOPBUTTONPAD, ++ dev->propbit); ++ break; ++ } ++ } ++ } + /* Clickpads report only left button */ + __clear_bit(BTN_RIGHT, dev->keybit); + __clear_bit(BTN_MIDDLE, dev->keybit); +@@ -1643,7 +1694,7 @@ static int __synaptics_init(struct psmou + priv->capabilities, priv->ext_cap, priv->ext_cap_0c, + priv->board_id, priv->firmware_id); + +- set_input_params(psmouse->dev, priv); ++ set_input_params(psmouse, priv); + + /* + * Encode touchpad model so that it can be used to set diff --git a/queue-3.14/series b/queue-3.14/series index b08830d178a..a2abb8f88be 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -128,3 +128,11 @@ crypto-crypto_wq-fix-late-crypto-work-queue-initialization.patch clk-vexpress-null-dereference-on-error-path.patch media-media-device-fix-infoleak-in-ioctl-media_enum_entities.patch i2c-i801-enable-intel-baytrail-smbus.patch +input-serio-add-firmware_id-sysfs-attribute.patch +input-i8042-add-firmware_id-support.patch +input-add-input_prop_topbuttonpad-device-property.patch +input-synaptics-report-input_prop_topbuttonpad-property.patch +e1000e-fix-no-connectivity-when-driver-loaded-with-cable-out.patch +ceph-clear-directory-s-completeness-when-creating-file.patch +autofs-fix-lockref-lookup.patch +fix-races-between-__d_instantiate-and-checks-of-dentry-flags.patch