3.5.5-stable review
Subsystems (128)
Greg Kroah-Hartman
maintainerPATCH 217/262 Bluetooth: btusb: Add vendor specific ID (0a5c:21f4) BCM20702A0
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manoj Iyer <[email protected]>
commit 61c964ba1748e984cb232b431582815899bf10fe upstream.
Patch adds support for BCM20702A0 device id (0a5c:21f4).
usb-devices after patch was applied:
T: Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0a5c ProdID=21f4 Rev=01.12
S: Manufacturer=Broadcom Corp
S: Product=BCM20702A0
S: SerialNumber=E4D53DF154D6
C: #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
I: If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
usb-devices before patch was applied:
T: Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0a5c ProdID=21f4 Rev=01.12
S: Manufacturer=Broadcom Corp
S: Product=BCM20702A0
S: SerialNumber=E4D53DF154D6
C: #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
I: If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
--- drivers/bluetooth/btusb.c | 1 + 1 file changed, 1 insertion(+)
drivers/bluetooth/btusb.c +1 -0
@@ -106,6 +106,7 @@ static struct usb_device_id btusb_table[ { USB_DEVICE(0x0a5c, 0x21e6) }, { USB_DEVICE(0x0a5c, 0x21e8) }, { USB_DEVICE(0x0a5c, 0x21f3) }, + { USB_DEVICE(0x0a5c, 0x21f4) }, { USB_DEVICE(0x413c, 0x8197) },/* Foxconn - Hon Hai */
Greg Kroah-Hartman
maintainerPATCH 215/262 Input: wacom - add support to Cintiq 22HD
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ping Cheng <[email protected]>
commit d838c644fea603eb24811333c6e2cf4f9722bf10 upstream.
--- drivers/input/tablet/wacom_wac.c | 21 +++++++++++++++++++-- drivers/input/tablet/wacom_wac.h | 3 ++- 2 files changed, 21 insertions(+), 3 deletions(-)
drivers/input/tablet/wacom_wac.c +19 -2
@@ -464,7 +464,7 @@ static void wacom_intuos_general(struct t = (data[6 ] <<2 ) | ((data[7 ] >>6 ) &3 );if ((features->type >=INTUOS4S && features->type <=INTUOS4L ) || (features->type >=INTUOS5S && features->type <=INTUOS5L ) || - features->type ==WACOM_21UX2 || features->type ==WACOM_24HD ) { + (features->type >=WACOM_21UX2 && features->type <=WACOM_24HD )) { t = (t <<1 ) | (data[1 ] &1 ); }input_report_abs (input,ABS_PRESSURE , t);
@@ -614,7 +614,7 @@ static int wacom_intuos_irq(struct wacominput_report_abs (input,ABS_MISC ,0 ); } }else { -if (features->type ==WACOM_21UX2 ) { +if (features->type ==WACOM_21UX2 || features->type ==WACOM_22HD ) {input_report_key (input,BTN_0 , (data[5 ] &0x01 ));input_report_key (input,BTN_1 , (data[6 ] &0x01 ));input_report_key (input,BTN_2 , (data[6 ] &0x02 ));
@@ -633,6 +633,12 @@ static int wacom_intuos_irq(struct wacominput_report_key (input,BTN_Z , (data[8 ] &0x20 ));input_report_key (input,BTN_BASE , (data[8 ] &0x40 ));input_report_key (input,BTN_BASE2 , (data[8 ] &0x80 )); + +if (features->type ==WACOM_22HD ) { +input_report_key (input,KEY_PROG1 , data[9 ] &0x01 ); +input_report_key (input,KEY_PROG2 , data[9 ] &0x02 ); +input_report_key (input,KEY_PROG3 , data[9 ] &0x04 ); + } }else {input_report_key (input,BTN_0 , (data[5 ] &0x01 ));input_report_key (input,BTN_1 , (data[5 ] &0x02 ));
@@ -1230,6 +1236,7 @@ void wacom_wac_irq(struct wacom_wac *waccase CINTIQ :case WACOM_BEE :case WACOM_21UX2 : +case WACOM_22HD :case WACOM_24HD : sync =wacom_intuos_irq (wacom_wac);break ;
@@ -1432,6 +1439,12 @@ int wacom_setup_input_capabilities(strucwacom_setup_cintiq (wacom_wac);break ; +case WACOM_22HD : +__set_bit (KEY_PROG1 , input_dev->keybit); +__set_bit (KEY_PROG2 , input_dev->keybit); +__set_bit (KEY_PROG3 , input_dev->keybit); +/* fall through */ +case WACOM_21UX2 :__set_bit (BTN_A , input_dev->keybit);__set_bit (BTN_B , input_dev->keybit);
@@ -1855,6 +1868,9 @@ static const struct wacom_features wacomstatic const struct wacom_features wacom_features_0xCC = {"Wacom Cintiq 21UX2" ,WACOM_PKGLEN_INTUOS ,87200 ,65600 ,2047 ,63 ,WACOM_21UX2 ,WACOM_INTUOS3_RES ,WACOM_INTUOS3_RES }; +static const struct wacom_features wacom_features_0xFA = + {"Wacom Cintiq 22HD" ,WACOM_PKGLEN_INTUOS ,95840 ,54260 ,2047 , +63 ,WACOM_22HD ,WACOM_INTUOS3_RES ,WACOM_INTUOS3_RES };static const struct wacom_features wacom_features_0x90 = {"Wacom ISDv4 90" ,WACOM_PKGLEN_GRAPHIRE ,26202 ,16325 ,255 ,0 ,TABLETPC ,WACOM_INTUOS_RES ,WACOM_INTUOS_RES };
@@ -2064,6 +2080,7 @@ const struct usb_device_id wacom_ids[] = { USB_DEVICE_WACOM(0xEC) }, { USB_DEVICE_WACOM(0x47) }, { USB_DEVICE_WACOM(0xF4) }, + { USB_DEVICE_WACOM(0xFA) }, { USB_DEVICE_LENOVO(0x6004) }, { } };
drivers/input/tablet/wacom_wac.h +2 -1
@@ -74,8 +74,9 @@ enum {INTUOS5S ,INTUOS5 ,INTUOS5L , -WACOM_24HD ,WACOM_21UX2 , +WACOM_22HD , +WACOM_24HD ,CINTIQ ,WACOM_BEE , WACOM_MO,
Greg Kroah-Hartman
maintainerPATCH 212/262 iwlwifi: fix flow handler debug code
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit 94543a8d4fb302817014981489f15cb3b92ec3c2 upstream.
iwl_dbgfs_fh_reg_read() can cause crashes and/orBUG_ON in slub because the ifdefs are wrong, the
code in iwl_dump_fh() should use DEBUGFS, not
DEBUG to protect the buffer writing code.
Also, while at it, clean up the arguments to the
function, some code and make it generally safer.
--- drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h | 2 - drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | 2 - drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 30 +++++++++++----------- 3 files changed, 18 insertions(+), 16 deletions(-)
drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h +1 -1
@@ -355,7 +355,7 @@ int iwl_queue_space(const struct iwl_que/***************************************************** * Error handling ******************************************************/ -int iwl_dump_fh (struct iwl_trans *trans,char **buf,bool display); +int iwl_dump_fh (struct iwl_trans *trans,char **buf);void iwl_dump_csr (struct iwl_trans *trans);/*****************************************************
drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c +1 -1
@@ -559,7 +559,7 @@ static void iwl_irq_handle_error(struct }iwl_dump_csr (trans); -iwl_dump_fh (trans,NULL , false); +iwl_dump_fh (trans,NULL );iwl_op_mode_nic_error (trans->op_mode); }
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +16 -14
@@ -1655,13 +1655,9 @@ static const char *get_fh_string(int cmd#undef IWL_CMD } -int iwl_dump_fh (struct iwl_trans *trans,char **buf,bool display) +int iwl_dump_fh (struct iwl_trans *trans,char **buf) {int i; -#ifdef CONFIG_IWLWIFI_DEBUG -int pos =0 ; -size_t bufsz =0 ; -#endif static const u32 fh_tbl[] = {FH_RSCSR_CHNL0_STTS_WPTR_REG ,FH_RSCSR_CHNL0_RBDCB_BASE_REG ,
@@ -1673,29 +1669,35 @@ int iwl_dump_fh(struct iwl_trans *trans,FH_TSSR_TX_STATUS_REG ,FH_TSSR_TX_ERROR_REG }; -#ifdef CONFIG_IWLWIFI_DEBUG -if (display) { - bufsz =ARRAY_SIZE (fh_tbl) *48 +40 ; + +#ifdef CONFIG_IWLWIFI_DEBUGFS +if (buf) { +int pos =0 ; +size_t bufsz =ARRAY_SIZE (fh_tbl) *48 +40 ; + *buf =kmalloc (bufsz,GFP_KERNEL );if (!*buf)return -ENOMEM ; + pos +=scnprintf (*buf + pos, bufsz - pos,"FH register values:\n" ); -for (i =0 ; i <ARRAY_SIZE (fh_tbl); i++) { + +for (i =0 ; i <ARRAY_SIZE (fh_tbl); i++) pos +=scnprintf (*buf + pos, bufsz - pos," %34s: 0X%08x\n" ,get_fh_string (fh_tbl[i]),iwl_read_direct32 (trans, fh_tbl[i])); - } +return pos; }#endif +IWL_ERR (trans,"FH register values:\n" ); -for (i =0 ; i <ARRAY_SIZE (fh_tbl); i++) { +for (i =0 ; i <ARRAY_SIZE (fh_tbl); i++)IWL_ERR (trans," %34s: 0X%08x\n" ,get_fh_string (fh_tbl[i]),iwl_read_direct32 (trans, fh_tbl[i])); - } +return 0 ; }
@@ -1990,11 +1992,11 @@ static ssize_t iwl_dbgfs_fh_reg_read(str size_t count, loff_t *ppos) { struct iwl_trans *trans = file->private_data; -char *buf; +char *buf =NULL ;int pos =0 ;ssize_t ret = -EFAULT ; - ret = pos =iwl_dump_fh (trans, &buf, true); + ret = pos =iwl_dump_fh (trans, &buf);if (buf) { ret =simple_read_from_buffer (user_buf, count, ppos, buf, pos);
Greg Kroah-Hartman
maintainerPATCH 202/262 drm/radeon: fix dig encoder selection on DCE61
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 41fa54377057ab38bc3e08ebb46168a7daf2e63b upstream.
Was using the DCE41 code which was wrong. Fixes
blank displays on a number of Trinity systems.
--- drivers/gpu/drm/radeon/atombios_encoders.c | 31 ++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-)
drivers/gpu/drm/radeon/atombios_encoders.c +26 -5
@@ -1769,13 +1769,34 @@ static int radeon_atom_pick_dig_encoder(struct radeon_crtc *radeon_crtc =to_radeon_crtc (encoder->crtc);struct radeon_encoder *radeon_encoder =to_radeon_encoder (encoder);struct drm_encoder *test_encoder; -struct radeon_encoder_atom_dig *dig; +struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;uint32_t dig_enc_in_use =0 ; -/* DCE4/5 */ -if (ASIC_IS_DCE4 (rdev)) { - dig = radeon_encoder->enc_priv; -if (ASIC_IS_DCE41 (rdev)) { +if (ASIC_IS_DCE6 (rdev)) { +/* DCE6 */ +switch (radeon_encoder->encoder_id) { +case ENCODER_OBJECT_ID_INTERNAL_UNIPHY : +if (dig->linkb) +return 1 ; +else +return 0 ; +break ; +case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1 : +if (dig->linkb) +return 3 ; +else +return 2 ; +break ; +case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2 : +if (dig->linkb) +return 5 ; +else +return 4 ; +break ; + } + }else if (ASIC_IS_DCE4 (rdev)) { +/* DCE4/5 */ +if (ASIC_IS_DCE41 (rdev) && !ASIC_IS_DCE61 (rdev)) {/* ontario follows DCE4 */ if (rdev->family ==CHIP_PALM ) {if (dig->linkb)
Greg Kroah-Hartman
maintainerPATCH 208/262 drm/i915: Reduce a pin-leak BUG into a WARN
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Wilson <[email protected]>
commit 7e81a42e341a4f15d76624b7c02ffb21b085b56f upstream.
Pin-leaks persist and we get the perennial bug reports of machine lockups to the BUG_ON(pin_count==MAX). If we instead loudly report that the object cannot be pinned at that time it should prevent the driver from locking up, and hopefully restore a semblance of working whilst still leaving us a OOPS to debug.
--- drivers/gpu/drm/i915/i915_gem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem.c +2 -1
@@ -3044,7 +3044,8 @@ i915_gem_object_pin(struct drm_i915_gem_ {int ret; -BUG_ON (obj->pin_count ==DRM_I915_GEM_OBJECT_MAX_PIN_COUNT ); +if (WARN_ON (obj->pin_count ==DRM_I915_GEM_OBJECT_MAX_PIN_COUNT )) +return -EBUSY ;if (obj->gtt_space !=NULL ) { if ((alignment && obj->gtt_offset & (alignment - 1)) ||
Greg Kroah-Hartman
maintainerPATCH 207/262 drm/i915: HDMI - Clear Audio Enable bit for Hot Plug
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wang Xingchao <[email protected]>
commit b98b60167279df3acac9422c3c9820d9ebbcf9fb upstream.
Clear Audio Enable bit to trigger unsolicated event to notify Audio Driver part the HDMI hot plug change. The patch fixed the bug when remove HDMI cable the bit was not cleared correctly.
In intel_hdmi_dpms(), if intel_hdmi->has_audio been true, the "Audio enable bit" will be set to trigger unsolicated event to notify Alsa driver the change.
intel_hdmi->has_audio will be reset to false from intel_hdmi_detect() after remove the hdmi cable, here's debug log:
[ 187.494153] [drm:output_poll_execute], [CONNECTOR:17:HDMI-A-1] status updated from 1 to 2 [ 187.525349] [drm:intel_hdmi_detect], HDMI: has_audio = 0
so when comes back to intel_hdmi_dpms(), the "Audio enable bit" will not be cleared. And this cause the eld infomation and pin presence doesnot update accordingly in alsa driver side.
This patch will also trigger unsolicated event to alsa driver to notify the hot plug event:
[ 187.853159] ALSA sound/pci/hda/patch_hdmi.c:772 HDMI hot plug event: Codec=3 Pin=5 Presence_Detect=0 ELD_Valid=1 [ 187.853268] ALSA sound/pci/hda/patch_hdmi.c:990 HDMI status: Codec=3 Pin=5 Presence_Detect=0 ELD_Valid=0
--- drivers/gpu/drm/i915/intel_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_hdmi.c +1 -1
@@ -400,7 +400,7 @@ static void intel_hdmi_dpms(struct drm_eu32 temp;u32 enable_bits =SDVO_ENABLE ; -if (intel_hdmi->has_audio) +if (intel_hdmi->has_audio || mode !=DRM_MODE_DPMS_ON ) enable_bits |=SDVO_AUDIO_ENABLE ; temp =I915_READ (intel_hdmi->sdvox_reg);
Greg Kroah-Hartman
maintainerPATCH 203/262 drm/radeon: make 64bit fences more robust v3
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian König <[email protected]>
commit f492c171a38d77fc13a8998a0721f2da50835224 upstream.
Only increase the higher 32bits if we really detect a wrap around.
v2: instead of increasing the higher 32bits just use the higher
32bits from the last emitted fence.
v3: also use last emitted fence value as upper limit.
The intention of this patch is to make fences as robust as they where before introducing 64bit fences. This is necessary because on older systems it looks like the fence value gets corrupted on initialization.
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=51344
Should also fix:
https://bugs.freedesktop.org/show_bug.cgi?id=54129
https://bugs.freedesktop.org/show_bug.cgi?id=54662
https://bugzilla.redhat.com/show_bug.cgi?id=846505
https://bugzilla.redhat.com/show_bug.cgi?id=845639
3.5 needs a separate patch due to changes in the fence code. Will send that out separately.
--- drivers/gpu/drm/radeon/radeon_fence.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/radeon/radeon_fence.c +5 -3
@@ -75,7 +75,7 @@ int radeon_fence_emit(struct radeon_devivoid radeon_fence_process (struct radeon_device *rdev,int ring) { -uint64_t seq, last_seq; +uint64_t seq, last_seq, last_emitted;unsigned count_loop =0 ;bool wake = false;
@@ -102,13 +102,15 @@ void radeon_fence_process(struct radeon_*/ last_seq =atomic64_read (&rdev->fence_drv[ring].last_seq); do { + last_emitted = rdev->fence_drv[ring].seq; seq = radeon_fence_read(rdev, ring); seq |= last_seq & 0xffffffff00000000LL; if (seq < last_seq) { - seq += 0x100000000LL; + seq &= 0xffffffff; + seq |= last_emitted & 0xffffffff00000000LL; } - if (seq == last_seq) { + if (seq <= last_seq || seq > last_emitted) { break; } /* If we loop over we don't want to return without
Greg Kroah-Hartman
maintainerPATCH 194/262 drm: Check for invalid cursor flags
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jakob Bornecrantz <[email protected]>
commit 7c4eaca4162d0b5ad4fb39f974d7ffd71b9daa09 upstream.
--- drivers/gpu/drm/drm_crtc.c | 2 +- include/drm/drm_mode.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_crtc.c +1 -1
@@ -1981,7 +1981,7 @@ int drm_mode_cursor_ioctl(struct drm_devif (!drm_core_check_feature (dev,DRIVER_MODESET ))return -EINVAL ; -if (!req->flags) +if (!req->flags || (~DRM_MODE_CURSOR_FLAGS & req->flags))return -EINVAL ;mutex_lock (&dev->mode_config.mutex);
include/drm/drm_mode.h +3 -2
@@ -359,8 +359,9 @@ struct drm_mode_mode_cmd {struct drm_mode_modeinfo mode; }; -#define DRM_MODE_CURSOR_BO (1<<0) -#define DRM_MODE_CURSOR_MOVE (1<<1) +#define DRM_MODE_CURSOR_BO 0x01 +#define DRM_MODE_CURSOR_MOVE 0x02 +#define DRM_MODE_CURSOR_FLAGS 0x03/* * depending on the value in flags different members are used.
Greg Kroah-Hartman
maintainerPATCH 200/262 drm/radeon: dont disable plls that are in use by other crtcs
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 4e58591c8961b3e31709313f75819f2eec06e322 upstream.
Some plls are shared for DP.
--- drivers/gpu/drm/radeon/atombios_crtc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/gpu/drm/radeon/atombios_crtc.c +14 -0
@@ -1668,9 +1668,22 @@ static void atombios_crtc_disable(structstruct drm_device *dev = crtc->dev;struct radeon_device *rdev = dev->dev_private;struct radeon_atom_ss ss; +int i;atombios_crtc_dpms (crtc,DRM_MODE_DPMS_OFF ); +for (i =0 ; i < rdev->num_crtc; i++) { +if (rdev->mode_info.crtcs[i] && + rdev->mode_info.crtcs[i]->enabled && + i != radeon_crtc->crtc_id && + radeon_crtc->pll_id == rdev->mode_info.crtcs[i]->pll_id) { +/* one other crtc is using this pll don't turn +* off the pll +*/ + goto done; + } + } +switch (radeon_crtc->pll_id) {case ATOM_PPLL1 :case ATOM_PPLL2 :
@@ -1687,6 +1700,7 @@ static void atombios_crtc_disable(structdefault :break ; } +done: radeon_crtc->pll_id =-1 ; }
Greg Kroah-Hartman
maintainerPATCH 198/262 drm/i915: fix wrong order of parameters in port checking functions
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Xu, Anhua" <[email protected]>
commit b70ad586162609141f0aa9eb34790f31a8954f89 upstream.
Wrong order of parameters passed-in when calling hdmi/adpa /lvds_pipe_enabled(), 2nd and 3rd parameters are reversed.
This bug was indroduced by
commit 1519b9956eb4b4180fa3f47c73341463cdcfaa37
Author: Keith Packard <[email protected]> Date: Sat Aug 6 10:35:34 2011 -0700
drm/i915: Fix PCH port pipe select in CPT disable paths
The reachable tag for this commit is v3.1-rc1-3-g1519b99
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44876
--- drivers/gpu/drm/i915/intel_display.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_display.c +6 -6
@@ -1238,7 +1238,7 @@ static void assert_pch_hdmi_disabled(str enum pipe pipe, int reg) {u32 val =I915_READ (reg); -WARN (hdmi_pipe_enabled (dev_priv, val, pipe), +WARN (hdmi_pipe_enabled (dev_priv, pipe, val),"PCH HDMI (0x%08x) enabled on transcoder %c, should be disabled\n" , reg,pipe_name (pipe)); }
@@ -1255,13 +1255,13 @@ static void assert_pch_ports_disabled(st reg =PCH_ADPA ; val =I915_READ (reg); -WARN (adpa_pipe_enabled (dev_priv, val, pipe), +WARN (adpa_pipe_enabled (dev_priv, pipe, val),"PCH VGA enabled on transcoder %c, should be disabled\n" ,pipe_name (pipe)); reg =PCH_LVDS ; val =I915_READ (reg); -WARN (lvds_pipe_enabled (dev_priv, val, pipe), +WARN (lvds_pipe_enabled (dev_priv, pipe, val),"PCH LVDS enabled on transcoder %c, should be disabled\n" ,pipe_name (pipe));
@@ -1723,7 +1723,7 @@ static void disable_pch_hdmi(struct drm_ enum pipe pipe, int reg) {u32 val =I915_READ (reg); -if (hdmi_pipe_enabled (dev_priv, val, pipe)) { +if (hdmi_pipe_enabled (dev_priv, pipe, val)) {DRM_DEBUG_KMS ("Disabling pch HDMI %x on pipe %d\n" , reg, pipe);I915_WRITE (reg, val & ~PORT_ENABLE );
@@ -1745,12 +1745,12 @@ static void intel_disable_pch_ports(stru reg =PCH_ADPA ; val =I915_READ (reg); -if (adpa_pipe_enabled (dev_priv, val, pipe)) +if (adpa_pipe_enabled (dev_priv, pipe, val))I915_WRITE (reg, val & ~ADPA_DAC_ENABLE ); reg =PCH_LVDS ; val =I915_READ (reg); -if (lvds_pipe_enabled (dev_priv, val, pipe)) { +if (lvds_pipe_enabled (dev_priv, pipe, val)) {DRM_DEBUG_KMS ("disable lvds on pipe %d val 0x%08x\n" , pipe, val);I915_WRITE (reg, val & ~LVDS_PORT_EN );POSTING_READ (reg);
Greg Kroah-Hartman
maintainerPATCH 195/262 drm/nvc0/copy: check PUNITS to determine which copy engines are disabled
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Skeggs <[email protected]>
commit 14f0458a41e033dee31ba605137419385c03fc78 upstream.
On some Fermi chipsets (NVCE particularly) PCOPY1 doesn't exist. And if what I've seen on Kepler is true of Fermi too, chipsets of the same type can have different PCOPY units available.
This should fix a v3.5 regression reported by a number of people effecting suspend/resume on NVC8/NVCE chipsets.
--- drivers/gpu/drm/nouveau/nouveau_state.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nouveau_state.c +4 -2
@@ -737,9 +737,11 @@ nouveau_card_init(struct drm_device *dev }break ;case NV_C0 : -nvc0_copy_create (dev,1 ); +if (!(nv_rd32 (dev,0x022500 ) &0x00000200 )) +nvc0_copy_create (dev,1 );case NV_D0 : -nvc0_copy_create (dev,0 ); +if (!(nv_rd32 (dev,0x022500 ) &0x00000100 )) +nvc0_copy_create (dev,0 );break ;default :break ;
Greg Kroah-Hartman
maintainerPATCH 193/262 asus-nb-wmi: add some video toggle keys
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: AceLan Kao <[email protected]>
commit 3766054fff4af1b58a1440a284907887f4d2e8be upstream.
There are some new video switch keys that used by newer machines. 0xA0 - SDSP HDMI only0xA1 - SDSP LCD + HDMI0xA2 - SDSP CRT + HDMI0xA3 - SDSP TV + HDMI
But in Linux, there is no suitable userspace application to handle this, so, mapping them all to KEY_SWITCHVIDEOMODE.
--- drivers/platform/x86/asus-nb-wmi.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/platform/x86/asus-nb-wmi.c +4 -0
@@ -94,6 +94,10 @@ static const struct key_entry asus_nb_wm { KE_KEY, 0x8A, { KEY_PROG1 } }, { KE_KEY, 0x95, { KEY_MEDIA } }, { KE_KEY, 0x99, { KEY_PHONE } }, + { KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */ + { KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */ + { KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */ + { KE_KEY, 0xA3, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + HDMI */ { KE_KEY, 0xb5, { KEY_CALC } }, { KE_KEY, 0xc4, { KEY_KBDILLUMUP } }, { KE_KEY, 0xc5, { KEY_KBDILLUMDOWN } },
Greg Kroah-Hartman
maintainerPATCH 191/262 asus-laptop: HRWS/HWRS typo
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Corentin Chary <[email protected]>
commit 8871e99f89b7d7b1ea99de550eea2a56273f42ab upstream.
Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=24222
--- drivers/platform/x86/asus-laptop.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/platform/x86/asus-laptop.c +4 -4
@@ -863,9 +863,9 @@ static ssize_t show_infos(struct device* The significance of others is yet to be found. * If we don't find the method, we assume the device are present. */ - rv =acpi_evaluate_integer (asus->handle,"HRWS" ,NULL , &temp); + rv =acpi_evaluate_integer (asus->handle,"HWRS" ,NULL , &temp);if (!ACPI_FAILURE (rv)) - len +=sprintf (page + len,"HRWS value : %#x\n" , + len +=sprintf (page + len,"HWRS value : %#x\n" , (uint ) temp);/* * Another value for userspace: the ASYM method returns 0x02 for
@@ -1751,9 +1751,9 @@ static int asus_laptop_get_info(struct a* The significance of others is yet to be found. */ status = -acpi_evaluate_integer (asus->handle,"HRWS" ,NULL , &hwrs_result); +acpi_evaluate_integer (asus->handle,"HWRS" ,NULL , &hwrs_result);if (!ACPI_FAILURE (status)) -pr_notice (" HRWS returned %x" , (int )hwrs_result); +pr_notice (" HWRS returned %x" , (int )hwrs_result);if (!acpi_check_handle (asus->handle,METHOD_WL_STATUS ,NULL )) asus->have_rsts = true;
Greg Kroah-Hartman
maintainerPATCH 189/262 drm/i915: fall back to bit-banging if GMBUS fails in CRT EDID reads
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jani Nikula <[email protected]>
commit f1a2f5b7c5f0941d23eef0a095c0b99bf8d051e6 upstream.
GMBUS was enabled over bit-banging as the default in commits:
commit c3dfefa0a6d235bd465309e12f4c56ea16e71111
Author: Daniel Vetter <[email protected]> Date: Tue Feb 14 22:37:25 2012 +0100
drm/i915: reenable gmbus on gen3+ again
and
commit 0fb3f969c8683505fb7323c06bf8a999a5a45a15
Author: Daniel Vetter <[email protected]> Date: Fri Mar 2 19:38:30 2012 +0100
drm/i915: enable gmbus on gen2
Unfortunately, GMBUS seems to fail on some CRT displays. Add a bit-banging fallback to CRT EDID reads.
LKML-Reference: <[email protected]>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=45881
--- drivers/gpu/drm/i915/intel_crt.c | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_crt.c +33 -3
@@ -284,6 +284,36 @@ static bool intel_crt_detect_hotplug(strreturn ret; } +static struct edid *intel_crt_get_edid (struct drm_connector *connector, +struct i2c_adapter *i2c) +{ +struct edid *edid; + + edid =drm_get_edid (connector, i2c); + +if (!edid && !intel_gmbus_is_forced_bit (i2c)) { +DRM_DEBUG_KMS ("CRT GMBUS EDID read failed, retry using GPIO bit-banging\n" ); +intel_gmbus_force_bit (i2c, true); + edid =drm_get_edid (connector, i2c); +intel_gmbus_force_bit (i2c, false); + } + +return edid; +} + +/* local version of intel_ddc_get_modes() to use intel_crt_get_edid() */ +static int intel_crt_ddc_get_modes (struct drm_connector *connector, +struct i2c_adapter *adapter) +{ +struct edid *edid; + + edid =intel_crt_get_edid (connector, adapter); +if (!edid) +return 0 ; + +return intel_connector_update_modes (connector, edid); +} +static bool intel_crt_detect_ddc (struct drm_connector *connector) {struct intel_crt *crt =intel_attached_crt (connector);
@@ -299,7 +329,7 @@ static bool intel_crt_detect_ddc(structstruct i2c_adapter *i2c; i2c =intel_gmbus_get_adapter (dev_priv, dev_priv->crt_ddc_pin); - edid =drm_get_edid (connector, i2c); + edid =intel_crt_get_edid (connector, i2c);/* * This may be a DVI-I connector with a shared DDC * link between analog and digital outputs, so we
@@ -498,13 +528,13 @@ static int intel_crt_get_modes(struct drstruct i2c_adapter *i2c; i2c =intel_gmbus_get_adapter (dev_priv, dev_priv->crt_ddc_pin); - ret =intel_ddc_get_modes (connector, i2c); + ret =intel_crt_ddc_get_modes (connector, i2c);if (ret || !IS_G4X (dev))return ret;/* Try to probe digital port for output in DVI-I -> VGA mode. */ i2c =intel_gmbus_get_adapter (dev_priv,GMBUS_PORT_DPB ); -return intel_ddc_get_modes (connector, i2c); +return intel_crt_ddc_get_modes (connector, i2c); } static int intel_crt_set_property(struct drm_connector *connector,
Greg Kroah-Hartman
maintainerPATCH 187/262 drm/radeon: init lockup timeout on ring init
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian König <[email protected]>
commit 48c0ac9911839daf188e4a0b6b132ac31050a241 upstream.
Reset the lockup timeout on ring (re-)initialisation.
Otherwise we get error messages like this on gpu resets:
[ 1559.949177] radeon 0000:01:00.0: GPU lockup CP stall for more than 1482270msec
--- drivers/gpu/drm/radeon/radeon_ring.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/radeon/radeon_ring.c +1 -0
@@ -394,6 +394,7 @@ int radeon_ring_init(struct radeon_devicif (radeon_debugfs_ring_init (rdev, ring)) {DRM_ERROR ("Failed to register debugfs file for rings !\n" ); } +radeon_ring_lockup_update (ring);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 178/262 PM / Runtime: Check device PM QoS setting before "no callbacks" check
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Rafael J. Wysocki" <[email protected]>
commit 55d7ec4520e86d735d178c15d7df33d507bd43c6 upstream.
If __dev_pm_qos_read_value(dev) returns a negative value, rpm_suspend() should return -EPERM for dev even if its power.no_callbacks flag is set. For this to happen, the device's power.no_callbacks flag has to be checked after the PM QoS check, so move the PM QoS check to rpm_check_suspend_allowed() (this will make it cover idle notifications as well as runtime suspend too).
--- drivers/base/power/runtime.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/base/power/runtime.c +2 -6
@@ -147,6 +147,8 @@ static int rpm_check_suspend_allowed(str || (dev->power.request_pending && dev->power.request == RPM_REQ_RESUME)) retval = -EAGAIN ; + else if (__dev_pm_qos_read_value(dev) < 0) + retval = -EPERM ; else if (dev->power.runtime_status == RPM_SUSPENDED) retval =1 ;
@@ -402,12 +404,6 @@ static int rpm_suspend(struct device *de goto out; } -if (__dev_pm_qos_read_value (dev) <0 ) { -/* Negative PM QoS constraint means "never suspend". */ - retval = -EPERM ; - goto out; - } -__update_runtime_status (dev,RPM_SUSPENDING );if (dev->pm_domain)
Greg Kroah-Hartman
maintainerPATCH 184/262 drm/radeon: split ATRM support out from the ATPX handler (v3)
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit c61e2775873f603148e8e998a938721b7d222d24 upstream.
There are systems that use ATRM, but not ATPX.
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=41265
V2: fix #ifdefs as per Greg's comments
V3: fix it harder
--- drivers/gpu/drm/radeon/radeon.h | 15 ----- drivers/gpu/drm/radeon/radeon_atpx_handler.c | 56 ------------------ drivers/gpu/drm/radeon/radeon_bios.c | 80 +++++++++++++++++++++++++-- 3 files changed, 77 insertions(+), 74 deletions(-)
drivers/gpu/drm/radeon/radeon.h +0 -15
@@ -143,21 +143,6 @@ struct radeon_device;/* * BIOS. */ -#define ATRM_BIOS_PAGE 4096 - -#if defined(CONFIG_VGA_SWITCHEROO ) -bool radeon_atrm_supported (struct pci_dev *pdev); -int radeon_atrm_get_bios_chunk (uint8_t *bios,int offset,int len); -#else -static inline bool radeon_atrm_supported (struct pci_dev *pdev) -{ -return false; -} - -static inline int radeon_atrm_get_bios_chunk (uint8_t *bios,int offset,int len){ -return -EINVAL ; -} -#endif bool radeon_get_bios (struct radeon_device *rdev);
drivers/gpu/drm/radeon/radeon_atpx_handler.c +1 -55
78 lines not on this page · raw message
drivers/gpu/drm/radeon/radeon_bios.c +76 -4
107 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 182/262 drm/radeon/ss: use num_crtc rather than hardcoded 6
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 5317670692f61675394db2eb6713484b67383750 upstream.
When checking if a pll is in use.
--- drivers/gpu/drm/radeon/atombios_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/atombios_crtc.c +1 -1
@@ -452,7 +452,7 @@ static void atombios_crtc_program_ss(strunion atom_enable_ss args;if (!enable) { -for (i =0 ; i <6 ; i++) { +for (i =0 ; i < rdev->num_crtc; i++) { if (rdev->mode_info.crtcs[i] && rdev->mode_info.crtcs[i]->enabled && i != crtc_id &&
Greg Kroah-Hartman
maintainerPATCH 180/262 fbcon: fix race condition between console lock and cursor timer (v1.1)
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Airlie <[email protected]>
commit d8636a2717bb3da2a7ce2154bf08de90bb8c87b0 upstream.
So we've had a fair few reports of fbcon handover breakage between efi/vesafb and i915 surface recently, so I dedicated a couple of days to finding the problem.
Essentially the last thing we saw was the conflicting framebuffer message and that was all.
So after much tracing with direct netconsole writes (printks under console_lock not so useful), I think I found the race.
Thread A (driver load) Thread B (timer thread)
unbind_con_driver -> |
bind_con_driver -> |
vc->vc_sw->con_deinit -> |
fbcon_deinit -> |
console_lock() |
| |
| fbcon_flashcursor timer fires
| console_lock() <- blocked for A
|
|fbcon_del_cursor_timer ->
del_timer_sync
(BOOM)
Of course because all of this is under the console lock, we never see anything, also since we also just unbound the active console guess what we never see anything.
Hopefully this fixes the problem for anyone seeing vesafb->kms driver handoff.
v1.1: add comment suggestion from Alan.
--- drivers/video/console/fbcon.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/video/console/fbcon.c +8 -1
@@ -372,8 +372,15 @@ static void fb_flashcursor(struct work_sstruct vc_data *vc =NULL ;int c;int mode; +int ret; + +/* FIXME: we should sort out the unbind locking instead */ +/* instead we just fail to flash the cursor if we can't get +* the lock instead of blocking fbcon deinit */ + ret =console_trylock (); +if (ret ==0 ) +return ; -console_lock ();if (ops && ops->currcon !=-1 ) vc = vc_cons[ops->currcon].d;
Re: [ 173/262] mutex: Place lock in contended state after fastpath_lock failure
In reply to Greg Kroah-HartmanQuoted 9 lines · Greg Kroah-Hartman
From: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <[email protected]>
commit
0bce9c46bf3b15f485d82d7e81dabed6ebcc24b1upstream.
Now that you've queued this one, could you pick up a76d7bd96d as well please?
Thanks
Nicolas
Greg Kroah-Hartman
maintainerPATCH 170/262 usb: host: xhci: fix compilation error for non-PCI based stacks
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Moiz Sonasath <[email protected]>
commit 296365781903226a3fb8758901eaeec09d2798e4 upstream.
For non PCI-based stacks, this function call usb_disable_xhci_ports(to_pci_dev(hcd->self.controller)); made from xhci_shutdown is not applicable.
Ideally, we wouldn't have any PCI-specific code on a generic driver such as the xHCI stack, but it looks like we should just stub usb_disable_xhci_ports() out for non-PCI devices.
[ [email protected]: slight improvement to commit log ]
This patch should be backported to kernels as old as 3.0, since the commit it fixes (e95829f474f0db3a4d940cae1423783edd966027 "xhci: Switch PPT ports to EHCI on shutdown.") was marked for stable.
--- drivers/usb/host/pci-quirks.h | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/pci-quirks.h +1 -0
@@ -15,6 +15,7 @@ void usb_disable_xhci_ports(struct pci_dstatic inline void usb_amd_quirk_pll_disable (void ) {}static inline void usb_amd_quirk_pll_enable (void ) {}static inline void usb_amd_dev_put (void ) {} +static inline void usb_disable_xhci_ports (struct pci_dev *xhci_pdev) {}#endif /* CONFIG_PCI */ #endif /* __LINUX_USB_PCI_QUIRKS_H */
Greg Kroah-Hartman
maintainerPATCH 175/262 drivers/rtc/rtc-rs5c348.c: fix hour decoding in 12-hour mode
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Atsushi Nemoto <[email protected]>
commit 7dbfb315b2aaef0a115765946bf3026d074c33a7 upstream.
Correct the offset by subtracting 20 from tm_hour before taking the modulo 12.
[ "Why 20?" I hear you ask. Or at least I did.
Here's the reason why: RS5C348_BIT_PM is 32, and is - stupidly - included in the RS5C348_HOURS_MASK define. So it's really subtracting out that bit to get "hour+12". But then because it does things modulo 12, it needs to add the 12 in again afterwards anyway.
This code is confused. It would be much clearer if RS5C348_HOURS_MASK just didn't include the RS5C348_BIT_PM bit at all, then it wouldn't need to do the silly subtract either.
Whatever. It's all just math, the end result is the same. - Linus ]
--- drivers/rtc/rtc-rs5c348.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/rtc/rtc-rs5c348.c +5 -2
@@ -122,9 +122,12 @@ rs5c348_rtc_read_time(struct device *dev tm->tm_min =bcd2bin (rxbuf[RS5C348_REG_MINS ] &RS5C348_MINS_MASK ); tm->tm_hour =bcd2bin (rxbuf[RS5C348_REG_HOURS ] &RS5C348_HOURS_MASK );if (!pdata->rtc_24h) { - tm->tm_hour %=12 ; -if (rxbuf[RS5C348_REG_HOURS ] &RS5C348_BIT_PM ) +if (rxbuf[RS5C348_REG_HOURS ] &RS5C348_BIT_PM ) { + tm->tm_hour -=20 ; + tm->tm_hour %=12 ; tm->tm_hour +=12 ; + }else + tm->tm_hour %=12 ; } tm->tm_wday =bcd2bin (rxbuf[RS5C348_REG_WDAY ] &RS5C348_WDAY_MASK ); tm->tm_mday =bcd2bin (rxbuf[RS5C348_REG_DAY ] &RS5C348_DAY_MASK );
Greg Kroah-Hartman
maintainerPATCH 173/262 mutex: Place lock in contended state after fastpath_lock failure
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <[email protected]>
commit 0bce9c46bf3b15f485d82d7e81dabed6ebcc24b1 upstream.
ARM recently moved to asm-generic/mutex-xchg.h for its mutex implementation after the previous implementation was found to be missing some crucial memory barriers. However, this has revealed some problems running hackbench on SMP platforms due to the way in which the MUTEX_SPIN_ON_OWNER code operates.
The symptoms are that a bunch of hackbench tasks are left waiting on an unlocked mutex and therefore never get woken up to claim it. This boils down to the following sequence of events:
Task A Task B Task C Lock value
0 1 1 lock() 0 2 lock() 0 3 spin(A) 0 4 unlock() 1 5 lock() 0 6 cmpxchg(1,0) 0 7 contended() -1 8 lock() 0 9 spin(C) 0 10 unlock() 1 11 cmpxchg(1,0) 0 12 unlock() 1
At this point, the lock is unlocked, but Task B is in an uninterruptible sleep with nobody to wake it up.
This patch fixes the problem by ensuring we put the lock into the contended state if we fail to acquire it on the fastpath, ensuring that any blocked waiters are woken up when the mutex is released.
--- include/asm-generic/mutex-xchg.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
include/asm-generic/mutex-xchg.h +9 -2
@@ -26,7 +26,13 @@ static inline void __mutex_fastpath_lock(atomic_t *count, void (*fail_fn)(atomic_t *)) {if (unlikely (atomic_xchg (count,0 ) !=1 )) -fail_fn (count); +/* +* We failed to acquire the lock, so mark it contended +* to ensure that any waiting tasks are woken up by the +* unlock slow path. +*/ +if (likely (atomic_xchg (count,-1 ) !=1 )) +fail_fn (count); }/**
@@ -43,7 +49,8 @@ static inline int __mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *)) {if (unlikely (atomic_xchg (count,0 ) !=1 )) -return fail_fn (count); +if (likely (atomic_xchg (count,-1 ) !=1 )) +return fail_fn (count);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 172/262 tty: serial: imx: dont reinit clock in imx_setup_ufcr()
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dirk Behme <[email protected]>
commit 7be0670f7b9198382938a03ff3db7f47ef6b4780 upstream.
Remove the clock configuration from imx_setup_ufcr(). This isn't needed here and will cause garbage output if done.
To be be sure that we only touch the bits we want (TXTL and RXTL) we have to mask out all other bits of the UFCR register. Add one non-existing bit macro for this, too (bit 6, DCEDTE on i.MX6).
--- drivers/tty/serial/imx.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-)
drivers/tty/serial/imx.c +4 -14
@@ -132,6 +132,7 @@#define UCR4_OREN (1<<1)/* Receiver overrun interrupt enable */ #define UCR4_DREN (1<<0)/* Recv data ready interrupt enable */ #define UFCR_RXTL_SHF 0/* Receiver trigger level shift */ +#define UFCR_DCEDTE (1<<6)/* DCE/DTE mode select */ #define UFCR_RFDIV (7<<7)/* Reference freq divider mask */ #define UFCR_RFDIV_REG (x) (((x) < 7 ? 6 - (x) : 6) << 7)#define UFCR_TXTL_SHF 10/* Transmitter trigger level shift */
@@ -668,22 +669,11 @@ static void imx_break_ctl(struct uart_postatic int imx_setup_ufcr (struct imx_port *sport,unsigned int mode) {unsigned int val; -unsigned int ufcr_rfdiv; - -/* set receiver / transmitter trigger level. -* RFDIV is set such way to satisfy requested uartclk value -*/ - val =TXTL <<10 |RXTL ; - ufcr_rfdiv = (clk_get_rate (sport->clk_per) + sport->port.uartclk /2 ) - / sport->port.uartclk; - -if (!ufcr_rfdiv) - ufcr_rfdiv =1 ; - - val |=UFCR_RFDIV_REG (ufcr_rfdiv); +/* set receiver / transmitter trigger level */ + val =readl (sport->port.membase +UFCR ) & (UFCR_RFDIV |UFCR_DCEDTE ); + val |=TXTL <<UFCR_TXTL_SHF |RXTL ;writel (val, sport->port.membase +UFCR ); -return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 162/262 USB: add device quirk for Joss Optical touchboard
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit 92fc7a8b0f20bdb243c706daf42658e8e0cd2ef0 upstream.
This patch (as1604) adds a CONFIG_INTF_STRINGS quirk for the Joss infrared touchboard device. The device doesn't like to be asked for its interface strings.
--- drivers/usb/core/quirks.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/core/quirks.c +4 -0
@@ -96,6 +96,10 @@ static const struct usb_device_id usb_qu { USB_DEVICE(0x04b4, 0x0526), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS }, + /* Microchip Joss Optical infrared touchboard device */ + { USB_DEVICE(0x04d8, 0x000c), .driver_info = + USB_QUIRK_CONFIG_INTF_STRINGS }, + /* Samsung Android phone modem - ID conflict with SPH-I500 */ { USB_DEVICE(0x04e8, 0x6601), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS },
Greg Kroah-Hartman
maintainerPATCH 168/262 xhci: Make handover code more robust
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Garrett <[email protected]>
commit e955a1cd086de4d165ae0f4c7be7289d84b63bdc upstream.
My test platform (Intel DX79SI) boots reliably under BIOS, but frequently crashes when booting via UEFI. I finally tracked this down to the xhci handoff code. It seems that reads from the device occasionally just return 0xff, resulting in xhci_find_next_cap_offset generating a value that's larger than the resource region. We then oops when attempting to read the value. Sanity checking that value lets us avoid the crash.
I've no idea what's causing the underlying problem, and xhci still doesn't actually *work* even with this, but the machine at least boots which will probably make further debugging easier.
This should be backported to kernels as old as 2.6.31, that contain the commit 66d4eadd8d067269ea8fead1a50fe87c2979a80d "USB: xhci: BIOS handoff and HW initialization."
--- drivers/usb/host/pci-quirks.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/usb/host/pci-quirks.c +10 -2
@@ -841,12 +841,12 @@ static void __devinit quirk_usb_handoff_void __iomem *op_reg_base;u32 val;int timeout; +int len =pci_resource_len (pdev,0 );if (!mmio_resource_enabled (pdev,0 ))return ; - base =ioremap_nocache (pci_resource_start (pdev,0 ), -pci_resource_len (pdev,0 )); + base =ioremap_nocache (pci_resource_start (pdev,0 ), len);if (base ==NULL )return ;
@@ -856,9 +856,17 @@ static void __devinit quirk_usb_handoff_*/ ext_cap_offset =xhci_find_next_cap_offset (base,XHCI_HCC_PARAMS_OFFSET ); do { + if ((ext_cap_offset + sizeof(val)) > len) { + /* We're reading garbage from the controller */ + dev_warn(&pdev->dev, + "xHCI controller failing to respond"); + return; + } + if (!ext_cap_offset) /* We've reached the end of the extended capabilities */ goto hc_init; + val = readl(base + ext_cap_offset); if (XHCI_EXT_CAPS_ID(val) == XHCI_EXT_CAPS_LEGACY) break;
Greg Kroah-Hartman
maintainerPATCH 166/262 usb: host: xhci-plat: use ioremap_nocache
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ruchika Kharwar <[email protected]>
commit 319acdfc064169023cd9ada5085b434fbcdacec2 upstream.
Use the ioremap_nocache variant of the ioremap API in order to make sure our memory will be marked uncachable.
This patch should be backported to kernels as old as 3.4, that contain the commit 3429e91a661e1f383aecc86c6bbcf65afb15c892 "usb: host: xhci:
add platform driver support".
--- drivers/usb/host/xhci-plat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-plat.c +1 -1
@@ -118,7 +118,7 @@ static int xhci_plat_probe(struct platfo goto put_hcd; } - hcd->regs =ioremap (hcd->rsrc_start, hcd->rsrc_len); + hcd->regs =ioremap_nocache (hcd->rsrc_start, hcd->rsrc_len);if (!hcd->regs) {dev_dbg (&pdev->dev,"error mapping memory\n" ); ret = -EFAULT ;
Greg Kroah-Hartman
maintainerPATCH 164/262 usb: host: xhci: Fix Compliance Mode on SN65LVPE502CP Hardware
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Alexis R. Cortes" <[email protected]>
commit 71c731a296f1b08a3724bd1b514b64f1bda87a23 upstream.
This patch is intended to work around a known issue on the SN65LVPE502CP USB3.0 re-driver that can delay the negotiation between a device and the host past the usual handshake timeout.
If that happens on the first insertion, the host controller port will enter in Compliance Mode and NO port status event will be generated (as per xHCI Spec) making impossible to detect this event by software. The port will remain in compliance mode until a warm reset is applied to it.
As a result of this, the port will seem "dead" to the user and no device connections or disconnections will be detected.
For solving this, the patch creates a timer which polls every 2 seconds the link state of each host controller's port (this by reading the PORTSC register) and recovers the port by issuing a Warm reset every time Compliance mode is detected.
If a xHC USB3.0 port has previously entered to U0, the compliance mode issue will NOT occur only until system resumes from sleep/hibernate, therefore, the compliance mode timer is stopped when all xHC USB 3.0 ports have entered U0. The timer is initialized again after each system resume.
Since the issue is being caused by a piece of hardware, the timer will be enabled ONLY on those systems that have the SN65LVPE502CP installed (this patch uses DMI strings for detecting those systems) therefore making this patch to act as a quirk (XHCI_COMP_MODE_QUIRK has been added to the xhci stack).
This patch applies for these systems:
Vendor: Hewlett-Packard. System Models: Z420, Z620 and Z820.
This patch should be backported to kernels as old as 3.2, as that was the first kernel to support warm reset. The kernels will need to contain both commit 10d674a82e553cb8a1f41027bb3c3e309b3f6804 "USB: When hot reset for USB3 fails, try warm reset" and commit 8bea2bd37df08aaa599aa361a9f8b836ba98e554 "usb: Add support for root hub port status CAS". The first patch add warm reset support, and the second patch modifies the USB core to issue a warm reset when the port is in compliance mode.
--- drivers/usb/host/xhci-hub.c | 42 +++++++++++++++ drivers/usb/host/xhci.c | 121 ++++++++++++++++++++++++++++++++++++++++++++ drivers/usb/host/xhci.h | 6 ++ 3 files changed, 169 insertions(+)
drivers/usb/host/xhci-hub.c +42 -0
@@ -493,11 +493,48 @@ static void xhci_hub_report_link_state(u* when this bit is set. */ pls |=USB_PORT_STAT_CONNECTION ; + }else { +/* +* If CAS bit isn't set but the Port is already at +* Compliance Mode, fake a connection so the USB core +* notices the Compliance state and resets the port. +* This resolves an issue generated by the SN65LVPE502CP +* in which sometimes the port enters compliance mode +* caused by a delay on the host-device negotiation. +*/ +if (pls ==USB_SS_PORT_LS_COMP_MOD ) + pls |=USB_PORT_STAT_CONNECTION ; } +/* update status field */ *status |= pls; } +/* +* Function for Compliance Mode Quirk. +* +* This Function verifies if all xhc USB3 ports have entered U0, if so, +* the compliance mode timer is deleted. A port won't enter +* compliance mode if it has previously entered U0. +*/ +void xhci_del_comp_mod_timer (struct xhci_hcd *xhci,u32 status,u16 wIndex) +{ +u32 all_ports_seen_u0 = ((1 << xhci->num_usb3_ports)-1 ); +bool port_in_u0 = ((status &PORT_PLS_MASK ) ==XDEV_U0 ); + +if (!(xhci->quirks &XHCI_COMP_MODE_QUIRK )) +return ; + +if ((xhci->port_status_u0 != all_ports_seen_u0) && port_in_u0) { + xhci->port_status_u0 |=1 << wIndex; +if (xhci->port_status_u0 == all_ports_seen_u0) { +del_timer_sync (&xhci->comp_mode_recovery_timer); +xhci_dbg (xhci,"All USB3 ports have entered U0 already!\n" ); +xhci_dbg (xhci,"Compliance Mode Recovery Timer Deleted.\n" ); + } + } +} +int xhci_hub_control (struct usb_hcd *hcd,u16 typeReq,u16 wValue,u16 wIndex,char *buf,u16 wLength) {
@@ -645,6 +682,11 @@ int xhci_hub_control(struct usb_hcd *hcd/* Update Port Link State for super speed ports*/ if (hcd->speed ==HCD_USB3 ) {xhci_hub_report_link_state (&status, temp); +/* +* Verify if all USB3 Ports Have entered U0 already. +* Delete Compliance Mode Timer if so. +*/ +xhci_del_comp_mod_timer (xhci, temp, wIndex); }if (bus_state->port_c_suspend & (1 << wIndex)) status |=1 <<USB_PORT_FEAT_C_SUSPEND ;
drivers/usb/host/xhci.c +121 -0
157 lines not on this page · raw message
drivers/usb/host/xhci.h +6 -0
@@ -1495,6 +1495,7 @@ struct xhci_hcd {#define XHCI_LPM_SUPPORT (1 << 11)#define XHCI_INTEL_HOST (1 << 12)#define XHCI_SPURIOUS_REBOOT (1 << 13) +#define XHCI_COMP_MODE_QUIRK (1 << 14)unsigned int num_active_eps;unsigned int limit_active_eps;/* There are two roothubs to keep track of bus suspend info for */
@@ -1511,6 +1512,11 @@ struct xhci_hcd { unsigned sw_lpm_support:1;/* support xHCI 1.0 spec USB2 hardware LPM */ unsigned hw_lpm_support:1; +/* Compliance Mode Recovery Data */ +struct timer_list comp_mode_recovery_timer; +u32 port_status_u0; +/* Compliance Mode Timer Triggered every 2 seconds */ +#define COMP_MODE_RCVRY_MSECS 2000 };/* convert between an HCD pointer and the corresponding EHCI_HCD */
Greg Kroah-Hartman
maintainerPATCH 155/262 USB: ftdi-sio: add support for more Physik Instrumente devices
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Éric Piel <[email protected]>
commit dafc4f7be1a556ca3868d343c00127728b397068 upstream.
Commit b69cc672052540 added support for the E-861. After acquiring a C-867, I realised that every Physik Instrumente's device has a different PID. They are listed in the Windows device driver's .inf file. So here are all PIDs for the current (and probably future) USB devices from Physik Instrumente.
Compiled, but only actually tested on the E-861 and C-867.
--- drivers/usb/serial/ftdi_sio.c | 17 +++++++++++++++++ drivers/usb/serial/ftdi_sio_ids.h | 21 ++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-)
drivers/usb/serial/ftdi_sio.c +17 -0
@@ -813,7 +813,24 @@ static struct usb_device_id id_table_com .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, { USB_DEVICE(LARSENBRUSGAARD_VID, LB_ALTITRACK_PID) }, { USB_DEVICE(GN_OTOMETRICS_VID, AURICAL_USB_PID) }, + { USB_DEVICE(FTDI_VID, PI_C865_PID) }, + { USB_DEVICE(FTDI_VID, PI_C857_PID) }, + { USB_DEVICE(PI_VID, PI_C866_PID) }, + { USB_DEVICE(PI_VID, PI_C663_PID) }, + { USB_DEVICE(PI_VID, PI_C725_PID) }, + { USB_DEVICE(PI_VID, PI_E517_PID) }, + { USB_DEVICE(PI_VID, PI_C863_PID) }, { USB_DEVICE(PI_VID, PI_E861_PID) }, + { USB_DEVICE(PI_VID, PI_C867_PID) }, + { USB_DEVICE(PI_VID, PI_E609_PID) }, + { USB_DEVICE(PI_VID, PI_E709_PID) }, + { USB_DEVICE(PI_VID, PI_100F_PID) }, + { USB_DEVICE(PI_VID, PI_1011_PID) }, + { USB_DEVICE(PI_VID, PI_1012_PID) }, + { USB_DEVICE(PI_VID, PI_1013_PID) }, + { USB_DEVICE(PI_VID, PI_1014_PID) }, + { USB_DEVICE(PI_VID, PI_1015_PID) }, + { USB_DEVICE(PI_VID, PI_1016_PID) }, { USB_DEVICE(KONDO_VID, KONDO_USB_SERIAL_PID) }, { USB_DEVICE(BAYER_VID, BAYER_CONTOUR_CABLE_PID) }, { USB_DEVICE(FTDI_VID, MARVELL_OPENRD_PID),
drivers/usb/serial/ftdi_sio_ids.h +20 -1
@@ -797,8 +797,27 @@* Physik Instrumente * http://www.physikinstrumente.com/en/products/ */ +/* These two devices use the VID of FTDI */ +#define PI_C865_PID 0xe0a0/* PI C-865 Piezomotor Controller */ +#define PI_C857_PID 0xe0a1/* PI Encoder Trigger Box */ +#define PI_VID 0x1a72/* Vendor ID */ -#define PI_E861_PID 0x1008/* E-861 piezo controller USB connection */ +#define PI_C866_PID 0x1000/* PI C-866 Piezomotor Controller */ +#define PI_C663_PID 0x1001/* PI C-663 Mercury-Step */ +#define PI_C725_PID 0x1002/* PI C-725 Piezomotor Controller */ +#define PI_E517_PID 0x1005/* PI E-517 Digital Piezo Controller Operation Module */ +#define PI_C863_PID 0x1007/* PI C-863 */ +#define PI_E861_PID 0x1008/* PI E-861 Piezomotor Controller */ +#define PI_C867_PID 0x1009/* PI C-867 Piezomotor Controller */ +#define PI_E609_PID 0x100D/* PI E-609 Digital Piezo Controller */ +#define PI_E709_PID 0x100E/* PI E-709 Digital Piezo Controller */ +#define PI_100F_PID 0x100F/* PI Digital Piezo Controller */ +#define PI_1011_PID 0x1011/* PI Digital Piezo Controller */ +#define PI_1012_PID 0x1012/* PI Motion Controller */ +#define PI_1013_PID 0x1013/* PI Motion Controller */ +#define PI_1014_PID 0x1014/* PI Device */ +#define PI_1015_PID 0x1015/* PI Device */ +#define PI_1016_PID 0x1016/* PI Digital Servo Module */ /* * Kondo Kagaku Co.Ltd.
Greg Kroah-Hartman
maintainerPATCH 160/262 USB: cdc-wdm: fix wdm_find_device* return value
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjørn Mork <[email protected]>
commit 6a44886899ef8cc396e230e492e6a56a883889f3 upstream.
A logic error made the wdm_find_device* functions return a bogus pointer into static data instead of the intended NULL no matching device was found.
--- drivers/usb/class/cdc-wdm.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/usb/class/cdc-wdm.c +8 -4
@@ -134,12 +134,14 @@ static struct usb_driver wdm_driver;/* return intfdata if we own the interface, else look up intf in the list */ static struct wdm_device *wdm_find_device (struct usb_interface *intf) { -struct wdm_device *desc =NULL ; +struct wdm_device *desc;spin_lock (&wdm_device_list_lock);list_for_each_entry (desc, &wdm_device_list, device_list)if (desc->intf == intf) -break ; + goto found; + desc =NULL ; +found:spin_unlock (&wdm_device_list_lock);return desc;
@@ -147,12 +149,14 @@ static struct wdm_device *wdm_find_devicstatic struct wdm_device *wdm_find_device_by_minor (int minor) { -struct wdm_device *desc =NULL ; +struct wdm_device *desc;spin_lock (&wdm_device_list_lock);list_for_each_entry (desc, &wdm_device_list, device_list)if (desc->intf->minor == minor) -break ; + goto found; + desc =NULL ; +found:spin_unlock (&wdm_device_list_lock);return desc;
Greg Kroah-Hartman
maintainerPATCH 158/262 usb: dwc3: ep0: correct cache sync issue in case of ep0_bounced
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pratyush Anand <[email protected]>
commit 0416e494ce7dc84e2719bc9fb7daecb330476074 upstream.
In case of ep0 out, if length is not aligned to maxpacket size then we use dwc->ep_bounce_addr for dma transfer and not request->dma. Since, we have alreday done memcpy from dwc->ep0_bounce to request->buf, so we do not need to issue cache sync function. In fact, cache sync function will bring wrong data in request->buf from request->dma in this scenario.
So, cache sync function must not be executed in case of ep0 bounced.
--- drivers/usb/dwc3/ep0.c | 1 - drivers/usb/dwc3/gadget.c | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-)
drivers/usb/dwc3/ep0.c +0 -1
@@ -702,7 +702,6 @@ static void dwc3_ep0_complete_data(struc transferred =min_t (u32, ur->length, transfer_size - length);memcpy (ur->buf, dwc->ep0_bounce, transferred); - dwc->ep0_bounced = false; }else { transferred = ur->length - length; }
drivers/usb/dwc3/gadget.c +5 -2
@@ -238,8 +238,11 @@ void dwc3_gadget_giveback(struct dwc3_epif (req->request.status == -EINPROGRESS ) req->request.status = status; -usb_gadget_unmap_request (&dwc->gadget, &req->request, - req->direction); +if (dwc->ep0_bounced && dep->number ==0 ) + dwc->ep0_bounced = false; +else +usb_gadget_unmap_request (&dwc->gadget, &req->request, + req->direction); dev_dbg(dwc->dev, "request %p from %s completed %d/%d ===> %d\n", req, dep->name, req->request.actual,
Greg Kroah-Hartman
maintainerPATCH 156/262 usb: chipidea: udc: fix setup of endpoint maxpacket size
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Grzeschik <[email protected]>
commit 7f67c38bdcb6d8bce02e10521fbf1618b586319f upstream.
This patch changes the setup of the endpoint maxpacket size. All non control endpoints are initialized with an undefined ((unsigned short)~0) maxpacket size. The maxpacket size of Endpoint 0 will be kept at CTRL_PAYLOAD_MAX.
Some gadget drivers check for the maxpacket size before they enable the endpoint, which leads to a wrong state in these drivers.
--- drivers/usb/chipidea/udc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/usb/chipidea/udc.c +7 -1
@@ -1468,7 +1468,12 @@ static int init_eps(struct ci13xxx *udc) mEp->ep.name = mEp->name; mEp->ep.ops = &usb_ep_ops; - mEp->ep.maxpacket =CTRL_PAYLOAD_MAX ; +/* +* for ep0: maxP defined in desc, for other +* eps, maxP is set by epautoconfig() called +* by gadget layer +*/ + mEp->ep.maxpacket = (unsigned short )~0 ;INIT_LIST_HEAD (&mEp->qh.queue); mEp->qh.ptr = dma_pool_alloc(udc->qh_pool, GFP_KERNEL,
@@ -1488,6 +1493,7 @@ static int init_eps(struct ci13xxx *udc)else udc->ep0in = mEp; + mEp->ep.maxpacket =CTRL_PAYLOAD_MAX ;continue ; }
Greg Kroah-Hartman
maintainerPATCH 154/262 USB: ftdi_sio: do not claim CDC ACM function
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjørn Mork <[email protected]>
commit f08dea734844aa42ec57c229b0b73b3d7d21f810 upstream.
The Microchip vid:pid 04d8:000a is used for their CDC ACM demo firmware application. This is a device with a single function conforming to the CDC ACM specification and with the intention of demonstrating CDC ACM class firmware and driver interaction. The demo is used on a number of development boards, and may also be used unmodified by vendors using Microchip hardware.
Some vendors have re-used this vid:pid for other types of firmware, emulating FTDI chips. Attempting to continue to support such devices without breaking class based applications that by matching on interface class/subclass/proto being ff/ff/00. I have no information about the actual device or interface descriptors, but this will at least make the proper CDC ACM devices work again. Anyone having details of the offending device's descriptors should update this entry with the details.
--- drivers/usb/serial/ftdi_sio.c | 4 +++- drivers/usb/serial/ftdi_sio_ids.h | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-)
drivers/usb/serial/ftdi_sio.c +3 -1
@@ -805,7 +805,9 @@ static struct usb_device_id id_table_com .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, { USB_DEVICE(ADI_VID, ADI_GNICEPLUS_PID), .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, - { USB_DEVICE(MICROCHIP_VID, MICROCHIP_USB_BOARD_PID) }, + {USB_DEVICE_AND_INTERFACE_INFO (MICROCHIP_VID ,MICROCHIP_USB_BOARD_PID , +USB_CLASS_VENDOR_SPEC , + USB_SUBCLASS_VENDOR_SPEC, 0x00) }, { USB_DEVICE(JETI_VID, JETI_SPC1201_PID) }, { USB_DEVICE(MARVELL_VID, MARVELL_SHEEVAPLUG_PID), .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
drivers/usb/serial/ftdi_sio_ids.h +4 -1
@@ -542,7 +542,10 @@/* * Microchip Technology, Inc. * -* MICROCHIP_VID (0x04D8) and MICROCHIP_USB_BOARD_PID (0x000A) are also used by: +* MICROCHIP_VID (0x04D8) and MICROCHIP_USB_BOARD_PID (0x000A) are +* used by single function CDC ACM class based firmware demo +* applications. The VID/PID has also been used in firmware +* emulating FTDI serial chips by: * Hornby Elite - Digital Command Control Console * http://www.hornby.com/hornby-dcc/controllers/ */
Greg Kroah-Hartman
maintainerPATCH 152/262 EHCI: Update qTD next pointer in QH overlay region during unlink
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pavankumar Kondeti <[email protected]>
commit 3d037774b42ed677f699b1dce7d548d55f4e4c2b upstream.
There is a possibility of QH overlay region having reference to a stale qTD pointer during unlink.
Consider an endpoint having two pending qTD before unlink process begins. The endpoint's QH queue looks like this.
qTD1 --> qTD2 --> Dummy
To unlink qTD2, QH is removed from asynchronous list and Asynchronous Advance Doorbell is programmed. The qTD1's next qTD pointer is set to qTD2'2 next qTD pointer and qTD2 is retired upon controller's doorbell interrupt. If QH's current qTD pointer points to qTD1, transfer overlay region still have reference to qTD2. But qtD2 is just unlinked and freed. This may cause EHCI system error. Fix this by updating qTD next pointer in QH overlay region with the qTD next pointer of the current qTD.
--- drivers/usb/host/ehci-q.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/usb/host/ehci-q.c +10 -2
@@ -128,9 +128,17 @@ qh_refresh (struct ehci_hcd *ehci, strucelse { qtd =list_entry (qh->qtd_list.next, struct ehci_qtd, qtd_list); -/* first qtd may already be partially processed */ -if (cpu_to_hc32 (ehci, qtd->qtd_dma) == qh->hw->hw_current) +/* +* first qtd may already be partially processed. +* If we come here during unlink, the QH overlay region +* might have reference to the just unlinked qtd. The +* qtd is updated in qh_completions(). Update the QH +* overlay here. +*/ +if (cpu_to_hc32 (ehci, qtd->qtd_dma) == qh->hw->hw_current) { + qh->hw->hw_qtd_next = qtd->hw_next; qtd =NULL ; + } }if (qtd)
Greg Kroah-Hartman
maintainerPATCH 150/262 NFS: Fix a problem with the legacy binary mount code
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit 872ece86ea5c367aa92f44689c2d01a1c767aeb3 upstream.
Apparently, am-utils is still using the legacy binary mountdata interface, and is having trouble parsing /proc/mounts due to the 'port=' field being incorrectly set.
The following patch should fix up the regression.
--- fs/nfs/super.c | 2 ++ 1 file changed, 2 insertions(+)
fs/nfs/super.c +2 -0
@@ -1918,6 +1918,7 @@ static int nfs23_validate_mount_data(voimemcpy (sap, &data->addr,sizeof (data->addr)); args->nfs_server.addrlen =sizeof (data->addr); + args->nfs_server.port =ntohs (data->addr.sin_port);if (!nfs_verify_server_address (sap)) goto out_no_address;
@@ -2651,6 +2652,7 @@ static int nfs4_validate_mount_data(voidreturn -EFAULT ;if (!nfs_verify_server_address (sap)) goto out_no_address; + args->nfs_server.port =ntohs (((struct sockaddr_in *)sap)->sin_port);if (data->auth_flavourlen) {if (data->auth_flavourlen >1 )
Greg Kroah-Hartman
maintainerPATCH 149/262 NFS: Fix the initialisation of the readdir cookieverf array
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit c3f52af3e03013db5237e339c817beaae5ec9e3a upstream.
When the NFS_COOKIEVERF helper macro was converted into a static inline function in commit 99fadcd764 (nfs: convert NFS_*(inode) helpers to static inline), we broke the initialisation of the readdir cookies, since that depended on doing a memset with an argument of 'sizeof(NFS_COOKIEVERF(inode))' which therefore changed from sizeof(be32 cookieverf[2]) to sizeof(be32 *).
At this point, NFS_COOKIEVERF seems to be more of an obfuscation than a helper, so the best thing would be to just get rid of it.
Also see: https://bugzilla.kernel.org/show_bug.cgi?id=46881
--- fs/nfs/inode.c | 2 +- fs/nfs/nfs3proc.c | 2 +- fs/nfs/nfs4proc.c | 4 ++-- include/linux/nfs_fs.h | 5 ----- 4 files changed, 4 insertions(+), 9 deletions(-)
fs/nfs/inode.c +1 -1
@@ -152,7 +152,7 @@ static void nfs_zap_caches_locked(struct nfsi->attrtimeo =NFS_MINATTRTIMEO (inode); nfsi->attrtimeo_timestamp = jiffies; -memset (NFS_COOKIEVERF (inode),0 ,sizeof (NFS_COOKIEVERF (inode))); +memset (NFS_I (inode)->cookieverf,0 ,sizeof (NFS_I (inode)->cookieverf));if (S_ISREG (mode) ||S_ISDIR (mode) ||S_ISLNK (mode)) nfsi->cache_validity |=NFS_INO_INVALID_ATTR |NFS_INO_INVALID_DATA |NFS_INO_INVALID_ACCESS |NFS_INO_INVALID_ACL |NFS_INO_REVAL_PAGECACHE ;else
fs/nfs/nfs3proc.c +1 -1
@@ -643,7 +643,7 @@ nfs3_proc_readdir(struct dentry *dentry, u64 cookie, struct page **pages, unsigned int count, int plus) { struct inode *dir = dentry->d_inode; -__be32 *verf =NFS_COOKIEVERF (dir); +__be32 *verf =NFS_I (dir)->cookieverf; struct nfs3_readdirargs arg = { .fh = NFS_FH(dir), .cookie = cookie,
fs/nfs/nfs4proc.c +2 -2
@@ -3189,11 +3189,11 @@ static int _nfs4_proc_readdir(struct den dentry->d_parent->d_name.name, dentry->d_name.name, (unsigned long long)cookie); -nfs4_setup_readdir (cookie,NFS_COOKIEVERF (dir), dentry, &args); +nfs4_setup_readdir (cookie,NFS_I (dir)->cookieverf, dentry, &args); res.pgbase = args.pgbase; status =nfs4_call_sync (NFS_SERVER (dir)->client,NFS_SERVER (dir), &msg, &args.seq_args, &res.seq_res,0 );if (status >=0 ) { -memcpy (NFS_COOKIEVERF (dir), res.verifier.data,NFS4_VERIFIER_SIZE ); +memcpy (NFS_I (dir)->cookieverf, res.verifier.data,NFS4_VERIFIER_SIZE ); status += args.pgbase; }
include/linux/nfs_fs.h +0 -5
@@ -265,11 +265,6 @@ static inline const struct nfs_rpc_ops *return NFS_SERVER (inode)->nfs_client->rpc_ops; } -static inline __be32 *NFS_COOKIEVERF (const struct inode *inode) -{ -return NFS_I (inode)->cookieverf; -} -static inline unsigned NFS_MINATTRTIMEO (const struct inode *inode) {struct nfs_server *nfss =NFS_SERVER (inode);
Greg Kroah-Hartman
maintainerPATCH 139/262 can: ti_hecc: fix oops during rmmod
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Kleine-Budde <[email protected]>
commit ab04c8bd423edb03e2148350a091836c196107fc upstream.
This patch fixes an oops which occurs when unloading the driver, while the network interface is still up. The problem is that first the io mapping is teared own, then the CAN device is unregistered, resulting in accessing the hardware's iomem:
[ 172.744232] Unable to handle kernel paging request at virtual address c88b0040 [ 172.752441] pgd = c7be4000 [ 172.755645] [c88b0040] *pgd=87821811, *pte=00000000, *ppte=00000000 [ 172.762207] Internal error: Oops: 807 [#1] PREEMPT ARM [ 172.767517] Modules linked in: ti_hecc(-) can_dev [ 172.772430] CPU: 0 Not tainted (3.5.0alpha-00037-g3554cc0 #126) [ 172.778961] PC is at ti_hecc_close+0xb0/0x100 [ti_hecc] [ 172.784423] LR is at __dev_close_many+0x90/0xc0 [ 172.789123] pc : [<bf00c768>] lr : [<c033be58>] psr: 60000013 [ 172.789123] sp : c5c1de68 ip : 00040081 fp : 00000000 [ 172.801025] r10: 00000001 r9 : c5c1c000 r8 : 00100100 [ 172.806457] r7 : c5d0a48c r6 : c5d0a400 r5 : 00000000 r4 : c5d0a000 [ 172.813232] r3 : c88b0000 r2 : 00000001 r1 : c5d0a000 r0 : c5d0a000 [ 172.820037] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user [ 172.827423] Control: 10c5387d Table: 87be4019 DAC: 00000015 [ 172.833404] Process rmmod (pid: 600, stack limit = 0xc5c1c2f0) [ 172.839447] Stack: (0xc5c1de68 to 0xc5c1e000) [ 172.843994] de60: bf00c6b8 c5c1dec8 c5d0a000 c5d0a000 00200200 c033be58 [ 172.852478] de80: c5c1de44 c5c1dec8 c5c1dec8 c033bf2c c5c1de90 c5c1de90 c5d0a084 c5c1de44 [ 172.860992] dea0: c5c1dec8 c033c098 c061d3dc c5d0a000 00000000 c05edf28 c05edb34 c000d724 [ 172.869476] dec0: 00000000 c033c2f8 c5d0a084 c5d0a084 00000000 c033c370 00000000 c5d0a000 [ 172.877990] dee0: c05edb00 c033c3b8 c5d0a000 bf00d3ac c05edb00 bf00d7c8 bf00d7c8 c02842dc [ 172.886474] df00: c02842c8 c0282f90 c5c1c000 c05edb00 bf00d7c8 c0283668 bf00d7c8 00000000 [ 172.894989] df20: c0611f98 befe2f80 c000d724 c0282d10 bf00d804 00000000 00000013 c0068a8c [ 172.903472] df40: c5c538e8 685f6974 00636365 c61571a8 c5cb9980 c61571a8 c6158a20 c00c9bc4 [ 172.911987] df60: 00000000 00000000 c5cb9980 00000000 c5cb9980 00000000 c7823680 00000006 [ 172.920471] df80: bf00d804 00000880 c5c1df8c 00000000 000d4267 befe2f80 00000001 b6d90068 [ 172.928985] dfa0: 00000081 c000d5a0 befe2f80 00000001 befe2f80 00000880 b6d90008 00000008 [ 172.937469] dfc0: befe2f80 00000001 b6d90068 00000081 00000001 00000000 befe2eac 00000000 [ 172.945983] dfe0: 00000000 befe2b18 00023ba4 b6e6addc 60000010 befe2f80 a8e00190 86d2d344 [ 172.954498] [<bf00c768>] (ti_hecc_close+0xb0/0x100 [ti_hecc]) from [<c033be58>] (__dev__registered_many+0xc0/0x2a0) [ 172.984161] [<c033c098>] (rollback_registered_many+0xc0/0x2a0) from [<c033c2f8>] (rollback_registered+0x20/0x30) [ 172.994750] [<c033c2f8>] (rollback_registered+0x20/0x30) from [<c033c370>] (unregister_netdevice_queue+0x68/0x98) [ 173.005401] [<c033c370>] (unregister_netdevice_queue+0x68/0x98) from [<c033c3b8>] (unregister_netdev+0x18/0x20) [ 173.015899] [<c033c3b8>] (unregister_netdev+0x18/0x20) from [<bf00d3ac>] (ti_hecc_remove+0x60/0x80 [ti_hecc]) [ 173.026245] [<bf00d3ac>] (ti_hecc_remove+0x60/0x80 [ti_hecc]) from [<c02842dc>] (platform_drv_remove+0x14/0x18) [ 173.036712] [<c02842dc>] (platform_drv_remove+0x14/0x18) from [<c0282f90>] (__device_release_driver+0x7c/0xbc)
--- drivers/net/can/ti_hecc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/ti_hecc.c +1 -1
@@ -984,12 +984,12 @@ static int __devexit ti_hecc_remove(strustruct net_device *ndev =platform_get_drvdata (pdev);struct ti_hecc_priv *priv =netdev_priv (ndev); +unregister_candev (ndev);clk_disable (priv->clk);clk_put (priv->clk); res =platform_get_resource (pdev,IORESOURCE_MEM ,0 );iounmap (priv->base);release_mem_region (res->start,resource_size (res)); -unregister_candev (ndev);free_candev (ndev);platform_set_drvdata (pdev,NULL );
Greg Kroah-Hartman
maintainerPATCH 145/262 dmaengine: at_hdmac: check that each sg data length is non-null
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolas Ferre <[email protected]>
commit c456797681db814f4f5b36909e8e94047bf53d9c upstream.
Avoid the construction of a malformed DMA request sent to the DMA controller.
Log message is for debug only because this condition is unlikely to append and may only trigger at driver development time.
--- drivers/dma/at_hdmac.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/dma/at_hdmac.c +11 -0
@@ -690,6 +690,11 @@ atc_prep_slave_sg(struct dma_chan *chan, mem =sg_dma_address (sg); len =sg_dma_len (sg); +if (unlikely (!len)) { +dev_dbg (chan2dev (chan), +"prep_slave_sg: sg(%d) data length is zero\n" , i); + goto err; + } mem_width =2 ;if (unlikely (mem &3 || len &3 )) mem_width =0 ;
@@ -725,6 +730,11 @@ atc_prep_slave_sg(struct dma_chan *chan, mem =sg_dma_address (sg); len =sg_dma_len (sg); +if (unlikely (!len)) { +dev_dbg (chan2dev (chan), +"prep_slave_sg: sg(%d) data length is zero\n" , i); + goto err; + } mem_width =2 ;if (unlikely (mem &3 || len &3 )) mem_width =0 ;
@@ -758,6 +768,7 @@ atc_prep_slave_sg(struct dma_chan *chan, err_desc_get:dev_err (chan2dev (chan),"not enough descriptors available\n" ); +err:atc_desc_put (atchan, first);return NULL ; }
Greg Kroah-Hartman
maintainerPATCH 143/262 DMA: PL330: Check the pointer returned by kzalloc
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sachin Kamat <[email protected]>
commit 61c6e7531d3b66b33187b8cdd700fd8ab93ffd62 upstream.
kzalloc could return NULL. Hence add a check to avoid NULL pointer dereference.
--- drivers/dma/pl330.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/dma/pl330.c +5 -0
@@ -2930,6 +2930,11 @@ pl330_probe(struct amba_device *adev, co num_chan =max_t (int, pi->pcfg.num_peri, pi->pcfg.num_chan); pdmac->peripherals =kzalloc (num_chan *sizeof (*pch),GFP_KERNEL ); +if (!pdmac->peripherals) { + ret = -ENOMEM ; +dev_err (&adev->dev,"unable to allocate pdmac->peripherals\n" ); + goto probe_err5; + }for (i =0 ; i < num_chan; i++) { pch = &pdmac->peripherals[i];
Greg Kroah-Hartman
maintainerPATCH 142/262 DMA: PL330: Fix potential NULL pointer dereference in pl330_submit_req()
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sachin Kamat <[email protected]>
commit 2e2c682becb20416c140aa0d6d3137b51a5c76da upstream.
'r->cfg' is being checked for NULL. However, it is dereferenced in the previous statements. Thus moving those statements within the check.
--- drivers/dma/pl330.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/dma/pl330.c +9 -7
@@ -1567,17 +1567,19 @@ static int pl330_submit_req(void *ch_id, goto xfer_exit; } -/* Prefer Secure Channel */ -if (!_manager_ns (thrd)) - r->cfg->nonsecure =0 ; -else - r->cfg->nonsecure =1 ;/* Use last settings, if not provided */ -if (r->cfg) +if (r->cfg) { +/* Prefer Secure Channel */ +if (!_manager_ns (thrd)) + r->cfg->nonsecure =0 ; +else + r->cfg->nonsecure =1 ; + ccr =_prepare_ccr (r->cfg); -else + }else { ccr =readl (regs +CC (thrd->id)); + }/* If this req doesn't have valid xfer settings */ if (!_is_valid (ccr)) {
Greg Kroah-Hartman
maintainerPATCH 131/262 ARM: imx: armadillo5x0: Fix illegal register access
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fabio Estevam <[email protected]>
commit 35495173e1df621dff0e9a244accbe32cd28a98f upstream.
Since commit eb92044eb (ARM i.MX3: Make ccm base address a variable ) it is necessary to pass the CCM register base as a variable.
Fix the CCM register access in mach-armadillo5x0 by passing mx3_ccm_base and avoid illegal accesses.
Also applies to v3.5
--- arch/arm/mach-imx/mach-armadillo5x0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-imx/mach-armadillo5x0.c +2 -1
@@ -526,7 +526,8 @@ static void __init armadillo5x0_init(voiimx31_add_mxc_nand (&armadillo5x0_nand_board_info);/* set NAND page size to 2k if not configured via boot mode pins */ -__raw_writel (__raw_readl (MXC_CCM_RCSR ) | (1 <<30 ),MXC_CCM_RCSR ); +__raw_writel (__raw_readl (mx3_ccm_base +MXC_CCM_RCSR ) | + (1 <<30 ), mx3_ccm_base +MXC_CCM_RCSR );/* RTC */ /* Get RTC IRQ and register the chip */
Greg Kroah-Hartman
maintainerPATCH 137/262 rtlwifi: rtl8192ce: Log message that B_CUT device may not work
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Larry Finger <[email protected]>
commit 022e1d0680c7b4366017393417b8758be5abcee8 upstream.
There are a number of problems that occur for the latest version of the Realtek RTL8188CE device with the in-kernel driver. These include selection of the wrong firmware, and system lockup. A full fix is known, but is too invasive for inclusion in stable. This patch fixes the problem with loading the wrong firmware, and logs a message that the device may not work for kernels 3.6 and older.
--- drivers/net/wireless/rtlwifi/rtl8192ce/def.h | 1 + drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | 12 ++++++++++-- drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 6 ++++-- 3 files changed, 15 insertions(+), 4 deletions(-)
drivers/net/wireless/rtlwifi/rtl8192ce/def.h +1 -0
@@ -117,6 +117,7 @@#define CHIP_VER_B BIT(4)#define CHIP_92C_BITMASK BIT(0) +#define CHIP_UNKNOWN BIT(7)#define CHIP_92C_1T2R 0x03#define CHIP_92C 0x01#define CHIP_88C 0x00
drivers/net/wireless/rtlwifi/rtl8192ce/hw.c +10 -2
@@ -995,8 +995,16 @@ static enum version_8192c _rtl92ce_read_ version = (value32 &TYPE_ID ) ?VERSION_A_CHIP_92C :VERSION_A_CHIP_88C ; }else { - version = (value32 &TYPE_ID ) ?VERSION_B_CHIP_92C : -VERSION_B_CHIP_88C ; + version = (enum version_8192c ) (CHIP_VER_B | + ((value32 &TYPE_ID ) ?CHIP_92C_BITMASK :0 ) | + ((value32 &VENDOR_ID ) ?CHIP_VENDOR_UMC :0 )); +if ((!IS_CHIP_VENDOR_UMC (version)) && (value32 & +CHIP_VER_RTL_MASK )) { + version = (enum version_8192c )(version | + ((((value32 &CHIP_VER_RTL_MASK ) ==BIT (12 )) + ?CHIP_VENDOR_UMC_B_CUT :CHIP_UNKNOWN ) | +CHIP_VENDOR_UMC )); + } }switch (version) {
drivers/net/wireless/rtlwifi/rtl8192ce/sw.c +4 -2
@@ -162,10 +162,12 @@ int rtl92c_init_sw_vars(struct ieee80211/* request fw */ if (IS_VENDOR_UMC_A_CUT (rtlhal->version) && - !IS_92C_SERIAL (rtlhal->version)) + !IS_92C_SERIAL (rtlhal->version)) { rtlpriv->cfg->fw_name ="rtlwifi/rtl8192cfwU.bin" ; -else if (IS_81xxC_VENDOR_UMC_B_CUT (rtlhal->version)) + }else if (IS_81xxC_VENDOR_UMC_B_CUT (rtlhal->version)) { rtlpriv->cfg->fw_name ="rtlwifi/rtl8192cfwU_B.bin" ; +pr_info ("****** This B_CUT device may not work with kernels 3.6 and earlier\n" ); + } rtlpriv->max_fw_size =0x4000 ;pr_info ("Using firmware %s\n" , rtlpriv->cfg->fw_name);
Greg Kroah-Hartman
maintainerPATCH 136/262 perf/x86/ibs: Check syscall attribute flags
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Robert Richter <[email protected]>
commit bad9ac2d7f878a31cf1ae8c1ee3768077d222bcb upstream.
Current implementation simply ignores attribute flags. Thus, there is no notification to userland of unsupported features. Check syscall's attribute flags to let userland know if a feature is supported by the kernel. This is also needed to distinguish between future kernels what might support a feature.
--- arch/x86/kernel/cpu/perf_event_amd_ibs.c | 12 ++++++++++++ include/linux/perf_event.h | 2 ++ 2 files changed, 14 insertions(+)
arch/x86/kernel/cpu/perf_event_amd_ibs.c +12 -0
@@ -207,6 +207,15 @@ static int perf_ibs_precise_event(structreturn -EOPNOTSUPP ; } +static const struct perf_event_attr ibs_notsupp = { + .exclude_user =1 , + .exclude_kernel =1 , + .exclude_hv =1 , + .exclude_idle =1 , + .exclude_host =1 , + .exclude_guest =1 , +}; +static int perf_ibs_init (struct perf_event *event) {struct hw_perf_event *hwc = &event->hw;
@@ -227,6 +236,9 @@ static int perf_ibs_init(struct perf_eveif (event->pmu != &perf_ibs->pmu)return -ENOENT ; +if (perf_flags (&event->attr) &perf_flags (&ibs_notsupp)) +return -EINVAL ; +if (config & ~perf_ibs->config_mask)return -EINVAL ;
include/linux/perf_event.h +2 -0
@@ -274,6 +274,8 @@ struct perf_event_attr {__u64 branch_sample_type;/* enum branch_sample_type */ }; +#define perf_flags (attr) (*(&(attr)->read_format + 1)) +/* * Ioctls that can be done on a perf event fd: */
Greg Kroah-Hartman
maintainerPATCH 135/262 MIPS: mm: Add compound tail page _mapcount when mapped
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jovi Zhang <[email protected]>
commit af89fa3986b9d034a286544ab1ed95096496a2f9 upstream.
See commit b6999b191 which did the same modification for x86's mm/gup,
Quote from commit b6999b191:
"If compound pages are used and the page is a
tail page, gup_huge_pmd() increases _mapcount to record tail page are mapped while gup_huge_pud does not do that."
[[email protected]: fixed rejects caused by the original patch getting linewrapped.]
Patchwork: https://patchwork.linux-mips.org/patch/4291/
--- arch/mips/mm/gup.c | 2 ++ 1 file changed, 2 insertions(+)
arch/mips/mm/gup.c +2 -0
@@ -152,6 +152,8 @@ static int gup_huge_pud(pud_t pud, unsig do { VM_BUG_ON(compound_head(page) != head); pages[*nr] = page; + if (PageTail(page)) + get_huge_page_tail(page); (*nr)++; page++; refs++;
Greg Kroah-Hartman
maintainerPATCH 132/262 ARM: 7532/1: decompressor: reset SCTLR.TRE for VMSA ARMv7 cores
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Leach <[email protected]>
commit e1e5b7e4251c7538ca08c2c5545b0c2fbd8a6635 upstream.
This patch zeroes the SCTLR.TRE bit prior to setting the mapping as cacheable for ARMv7 cores in the decompressor, ensuring that the memory region attributes are obtained from the C and B bits, not from the page tables.
--- arch/arm/boot/compressed/head.S | 1 + 1 file changed, 1 insertion(+)
arch/arm/boot/compressed/head.S +1 -0
@@ -653,6 +653,7 @@ __armv7_mmu_cache_on: mcrne p15, 0, r0, c8, c7, 0 @ flush I,D TLBs #endif mrc p15, 0, r0, c1, c0, 0 @ read control reg + bic r0, r0, #1 << 28 @ clear SCTLR.TRE orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement orr r0, r0, #0x003c @ write buffer #ifdef CONFIG_MMU
Greg Kroah-Hartman
maintainerPATCH 130/262 hpwdt: Fix kdump issue in hpwdt
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Toshi Kani <[email protected]>
commit 308b135e4fcc00c80c07e0e04e7afa8edf78583c upstream.
kdump can be interrupted by watchdog timer when the timer is left activated on the crash kernel. Changed the hpwdt driver to disable watchdog timer at boot-time. This assures that watchdog timer is disabled until /dev/watchdog is opened, and prevents watchdog timer to be left running on the crash kernel.
--- drivers/watchdog/hpwdt.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/watchdog/hpwdt.c +3 -0
@@ -814,6 +814,9 @@ static int __devinit hpwdt_init_one(stru hpwdt_timer_reg = pci_mem_addr +0x70 ; hpwdt_timer_con = pci_mem_addr +0x72 ; +/* Make sure that timer is disabled until /dev/watchdog is opened */ +hpwdt_stop (); +/* Make sure that we have a valid soft_margin */ if (hpwdt_change_timer (soft_margin))hpwdt_change_timer (DEFAULT_MARGIN );
Greg Kroah-Hartman
maintainerPATCH 129/262 c/r: prctl: fix build error for no-MMU case
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Salter <[email protected]>
commit be8cfc4af15cf611dfeb66a1fb5df43d5f1e280a upstream.
Commit 1ad75b9e1628 ("c/r: prctl: add minimal address test to PR_SET_MM") added some address checking to prctl_set_mm() used by checkpoint-restore. This causes a build error for no-MMU systems:
kernel/sys.c: In function 'prctl_set_mm':
kernel/sys.c:1868:34: error: 'mmap_min_addr' undeclared (first use in this function)
The test for mmap_min_addr doesn't make a lot of sense for no-MMU code as noted in commit 6e1415467614 ("NOMMU: Optimise away the {dac_,}mmap_min_addr tests").
This patch defines mmap_min_addr as 0UL in the no-MMU case so that the compiler will optimize away tests for "addr < mmap_min_addr".
--- include/linux/security.h | 1 + 1 file changed, 1 insertion(+)
include/linux/security.h +1 -0
@@ -118,6 +118,7 @@ void reset_security_ops(void);extern unsigned long mmap_min_addr;extern unsigned long dac_mmap_min_addr;#else +#define mmap_min_addr 0UL#define dac_mmap_min_addr 0UL#endif
Greg Kroah-Hartman
maintainerPATCH 126/262 Bluetooth: mgmt: Fix enabling SSP while powered off
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrzej Kaczmarek <[email protected]>
commit 3d1cbdd6aefff711bcf389fdabc4af9bc22e8201 upstream.
When new BT USB adapter is plugged in it's configured while still being powered off (HCI_AUTO_OFF flag is set), thus Set SSP will only set dev_flags but won't write changes to controller. As a result remote devices won't use Secure Simple Pairing with our device due to SSP Host Support flag disabled in extended features and may also reject SSP attempt from our side (with possible fallback to legacy pairing).
This patch ensures HCI Write Simple Pairing Mode is sent when Set Powered is called to power on controller and clear HCI_AUTO_OFF flag.
--- net/bluetooth/mgmt.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/bluetooth/mgmt.c +6 -0
@@ -2879,6 +2879,12 @@ int mgmt_powered(struct hci_dev *hdev, uif (scan)hci_send_cmd (hdev,HCI_OP_WRITE_SCAN_ENABLE ,1 , &scan); +if (test_bit (HCI_SSP_ENABLED , &hdev->dev_flags)) { +u8 ssp =1 ; + +hci_send_cmd (hdev,HCI_OP_WRITE_SSP_MODE ,1 , &ssp); + } +update_class (hdev);update_name (hdev, hdev->dev_name);update_eir (hdev);
Greg Kroah-Hartman
maintainerPATCH 124/262 SCSI: hpsa: fix handling of protocol error
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Stephen M. Cameron" <[email protected]>
commit 256d0eaac87da1e993190846064f339f4c7a63f5 upstream.
If a command status of CMD_PROTOCOL_ERR is received, this information should be conveyed to the SCSI mid layer, not dropped on the floor. CMD_PROTOCOL_ERR may be received from the Smart Array for any commands destined for an external RAID controller such as a P2000, or commands destined for tape drives or CD/DVD-ROM drives, if for instance a cable is disconnected. This mostly affects multipath configurations, as disconnecting a cable on a non-multipath configuration is not going to do anything good regardless of whether CMD_PROTOCOL_ERR is handled correctly or not. Not handling CMD_PROTOCOL_ERR correctly in a multipath configaration involving external RAID controllers may cause data corruption, so this is quite a serious bug. This bug should not normally cause a problem for direct attached disk storage.
--- drivers/scsi/hpsa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/hpsa.c +2 -1
@@ -1315,8 +1315,9 @@ static void complete_scsi_command(struct }break ;case CMD_PROTOCOL_ERR : + cmd->result =DID_ERROR <<16 ;dev_warn (&h->pdev->dev,"cp %p has " -"protocol error \n" , cp); +"protocol error\n" , cp);break ;case CMD_HARDWARE_ERR : cmd->result =DID_ERROR <<16 ;
Greg Kroah-Hartman
maintainerPATCH 122/262 SCSI: mpt2sas: Fix for issue - Unable to boot from the drive connected to HBA
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: "[email protected]" <[email protected]>
commit 10cce6d8b5af0b32bc4254ae4a28423a74c0921c upstream.
This patch checks whether HBA is SAS2008 B0 controller.
if it is a SAS2008 B0 controller then it use IO-APIC interrupt instead of MSIX, as SAS2008 B0 controller doesn't support MSIX interrupts.
--- drivers/scsi/mpt2sas/mpt2sas_base.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/scsi/mpt2sas/mpt2sas_base.c +7 -0
@@ -1209,6 +1209,13 @@ _base_check_enable_msix(struct MPT2SAS_Au16 message_control; +/* Check whether controller SAS2008 B0 controller, +if it is SAS2008 B0 controller use IO-APIC instead of MSIX */ +if (ioc->pdev->device ==MPI2_MFGPAGE_DEVID_SAS2008 && + ioc->pdev->revision ==0x01 ) { +return -EINVAL ; + } + base =pci_find_capability (ioc->pdev,PCI_CAP_ID_MSIX );if (!base) { dfailprintk(ioc, printk(MPT2SAS_INFO_FMT "msix not "
Greg Kroah-Hartman
maintainerPATCH 121/262 SCSI: lpfc: fix problems with -Werror
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Bottomley <[email protected]>
commit 4bdd03e61b7a5c4c6bc2b25d46fcd491788fdfb3 upstream.
Commit d38bd3aef ("Add -Werror compilation flag") is causing build breakage with random gcc incarnations. These look like gcc problems, but we shouldn't break the build because of a bad gcc. Fix this by adding a make flag
WARNINGS_BECOME_ERRORS=1
which is the same as aic7xxx uses so ordinarily the build doesn't use -Werror
--- drivers/scsi/lpfc/Makefile | 2 ++ 1 file changed, 2 insertions(+)
drivers/scsi/lpfc/Makefile +2 -0
@@ -22,7 +22,9 @@ ccflags-$(GCOV) := -fprofile-arcs -ftest-coverage ccflags-$(GCOV) += -O0 +ifdef WARNINGS_BECOME_ERRORS ccflags-y += -Werror +endif obj-$(CONFIG_SCSI_LPFC) := lpfc.o
Greg Kroah-Hartman
maintainerPATCH 119/262 brcmfmac: fix big endian bug in i-scan.
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hante Meuleman <[email protected]>
commit ed205b361956c96e0d8c09a8c9135a6a79cd9541 upstream.
ssid len is 32 bit and needs endian conversion for big endian systems.
--- drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +4 -2
@@ -500,8 +500,10 @@ static void wl_iscan_prep(struct brcmf_s params_le->active_time =cpu_to_le32 (-1 ); params_le->passive_time =cpu_to_le32 (-1 ); params_le->home_time =cpu_to_le32 (-1 ); -if (ssid && ssid->SSID_len) -memcpy (¶ms_le->ssid_le, ssid,sizeof (struct brcmf_ssid )); +if (ssid && ssid->SSID_len) { + params_le->ssid_le.SSID_len =cpu_to_le32 (ssid->SSID_len); +memcpy (¶ms_le->ssid_le.SSID, ssid->SSID, ssid->SSID_len); + } } static s32
Greg Kroah-Hartman
maintainerPATCH 117/262 ibmveth: Fix alignment of rx queue bug
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Santiago Leon <[email protected]>
commit d90c92fee89ccd75ef2646f3bde0b4c0450666c3 upstream.
This patch fixes a bug found by Nish Aravamudan
(https://lkml.org/lkml/2012/5/15/220) where the driver is not following the spec (it is not aligning the rx buffer on a 16-byte boundary) and the hypervisor aborts the registration, making the device unusable.
The fix follows BenH's recommendation (https://lkml.org/lkml/2012/7/20/461)
to replace the kmalloc+map for a single call to dma_alloc_coherent() because that function always aligns to a 16-byte boundary.
The stable trees will run into this bug whenever the rx buffer kmalloc call returns something not aligned on a 16-byte boundary.
--- drivers/net/ethernet/ibm/ibmveth.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-)
drivers/net/ethernet/ibm/ibmveth.c +9 -17
@@ -472,14 +472,9 @@ static void ibmveth_cleanup(struct ibmve }if (adapter->rx_queue.queue_addr !=NULL ) { -if (!dma_mapping_error (dev, adapter->rx_queue.queue_dma)) { -dma_unmap_single (dev, - adapter->rx_queue.queue_dma, - adapter->rx_queue.queue_len, -DMA_BIDIRECTIONAL ); - adapter->rx_queue.queue_dma =DMA_ERROR_CODE ; - } -kfree (adapter->rx_queue.queue_addr); +dma_free_coherent (dev, adapter->rx_queue.queue_len, + adapter->rx_queue.queue_addr, + adapter->rx_queue.queue_dma); adapter->rx_queue.queue_addr =NULL ; }
@@ -556,10 +551,13 @@ static int ibmveth_open(struct net_devic goto err_out; } + dev = &adapter->vdev->dev; + adapter->rx_queue.queue_len =sizeof (struct ibmveth_rx_q_entry ) * rxq_entries; - adapter->rx_queue.queue_addr =kmalloc (adapter->rx_queue.queue_len, -GFP_KERNEL ); + adapter->rx_queue.queue_addr = +dma_alloc_coherent (dev, adapter->rx_queue.queue_len, + &adapter->rx_queue.queue_dma,GFP_KERNEL );if (!adapter->rx_queue.queue_addr) {netdev_err (netdev,"unable to allocate rx queue pages\n" );
@@ -567,19 +565,13 @@ static int ibmveth_open(struct net_devic goto err_out; } - dev = &adapter->vdev->dev; - adapter->buffer_list_dma =dma_map_single (dev, adapter->buffer_list_addr,4096 ,DMA_BIDIRECTIONAL ); adapter->filter_list_dma =dma_map_single (dev, adapter->filter_list_addr,4096 ,DMA_BIDIRECTIONAL ); - adapter->rx_queue.queue_dma =dma_map_single (dev, - adapter->rx_queue.queue_addr, - adapter->rx_queue.queue_len,DMA_BIDIRECTIONAL );if ((dma_mapping_error (dev, adapter->buffer_list_dma)) || - (dma_mapping_error (dev, adapter->filter_list_dma)) || - (dma_mapping_error (dev, adapter->rx_queue.queue_dma))) { + (dma_mapping_error (dev, adapter->filter_list_dma))) {netdev_err (netdev,"unable to map filter or buffer list " "pages\n" ); rc = -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 107/262 xen/boot: Disable BIOS SMP MP table search.
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Rzeszutek Wilk <[email protected]>
commit bd49940a35ec7d488ae63bd625639893b3385b97 upstream.
As the initial domain we are able to search/map certain regions of memory to harvest configuration data. For all low-level we use ACPI tables - for interrupts we use exclusively ACPI _PRT (so DSDT) and MADT for INT_SRC_OVR.
The SMP MP table is not used at all. As a matter of fact we do not even support machines that only have SMP MP but no ACPI tables.
Lets follow how Moorestown does it and just disable searching for BIOS SMP tables.
This also fixes an issue on HP Proliant BL680c G5 and DL380 G6:
9f->100 for 1:1 PTE
Freeing 9f-100 pfn range: 97 pages freed
1-1 mapping on 9f->100
.. snip..
e820: BIOS-provided physical RAM map:
Xen: [mem 0x0000000000000000-0x000000000009efff] usable
Xen: [mem 0x000000000009f400-0x00000000000fffff] reserved
Xen: [mem 0x0000000000100000-0x00000000cfd1dfff] usable
.. snip..
Scan for SMP in [mem 0x00000000-0x000003ff]
Scan for SMP in [mem 0x0009fc00-0x0009ffff]
Scan for SMP in [mem 0x000f0000-0x000fffff]
found SMP MP-table at [mem 0x000f4fa0-0x000f4faf] mapped at [ffff8800000f4fa0]
(XEN) mm.c:908:d0 Error getting mfn 100 (pfn 5555555555555555) from L1 entry 0000000000100461 for l1e_owner=0, pg_owner=0 (XEN) mm.c:4995:d0 ptwr_emulate: could not get_page_from_l1e()
BUG: unable to handle kernel NULL pointer dereference at (null) IP: [<ffffffff81ac07e2>] xen_set_pte_init+0x66/0x71 . snip.. Pid: 0, comm: swapper Not tainted 3.6.0-rc6upstream-00188-gb6fb969-dirty #2 HP ProLiant BL680c G5 .. snip.. Call Trace: [<ffffffff81ad31c6>] __early_ioremap+0x18a/0x248 [<ffffffff81624731>] ? printk+0x48/0x4a [<ffffffff81ad32ac>] early_ioremap+0x13/0x15 [<ffffffff81acc140>] get_mpc_size+0x2f/0x67 [<ffffffff81acc284>] smp_scan_config+0x10c/0x136 [<ffffffff81acc2e4>] default_find_smp_config+0x36/0x5a [<ffffffff81ac3085>] setup_arch+0x5b3/0xb5b [<ffffffff81624731>] ? printk+0x48/0x4a [<ffffffff81abca7f>] start_kernel+0x90/0x390 [<ffffffff81abc356>] x86_64_start_reservations+0x131/0x136 [<ffffffff81abfa83>] xen_start_kernel+0x65f/0x661
(XEN) Domain 0 crashed: 'noreboot' set - not rebooting.
which is that ioremap would end up mapping 0xff using _PAGE_IOMAP (which is what early_ioremap sticks as a flag) - which meant we would get MFN 0xFF (pte ff461, which is OK), and then it would also map 0x100 (b/c ioremap tries to get page aligned request, and it was trying to map 0xf4fa0 + PAGE_SIZE - so it mapped the next page) as _PAGE_IOMAP. Since 0x100 is actually a RAM page, and the _PAGE_IOMAP bypasses the P2M lookup we would happily set the PTE to 1000461. Xen would deny the request since we do not have access to the Machine Frame Number (MFN) of 0x100. The P2M[0x100] is for example 0x80140.
Fixes-Oracle-Bugzilla: https://bugzilla.oracle.com/bugzilla/show_bug.cgi?id=13665
--- arch/x86/xen/enlighten.c | 4 ++++ 1 file changed, 4 insertions(+)
arch/x86/xen/enlighten.c +4 -0
@@ -1422,6 +1422,10 @@ asmlinkage void __init xen_start_kernel(pci_request_acs ();xen_acpi_sleep_register (); + +/* Avoid searching for BIOS MP tables */ + x86_init.mpparse.find_smp_config = x86_init_noop; + x86_init.mpparse.get_smp_config = x86_init_uint_noop; }#ifdef CONFIG_PCI /* PCI BIOS service won't work from a PV guest. */
Greg Kroah-Hartman
maintainerPATCH 114/262 cifs: fix return value in cifsConvertToUTF16
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <[email protected]>
commit c73f693989d7a7d99ec66a7065295a0c93d0b127 upstream.
This function returns the wrong value, which causes the callers to get the length of the resulting pathname wrong when it contains non-ASCII characters.
This seems to fix https://bugzilla.samba.org/show_bug.cgi?id=6767
--- fs/cifs/cifs_unicode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/cifs_unicode.c +1 -1
@@ -328,6 +328,6 @@ cifsConvertToUTF16(__le16 *target, const } ctoUTF16_out: -return i; +return j; }
Greg Kroah-Hartman
maintainerPATCH 112/262 dj: memory scribble in logi_dj
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Cox <[email protected]>
commit 8a55ade76551e3927b4e41ee9e7751875d18bc25 upstream.
Allocate a structure not a pointer to it !
--- drivers/hid/hid-logitech-dj.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hid/hid-logitech-dj.c +2 -2
@@ -439,7 +439,7 @@ static int logi_dj_recv_query_paired_devstruct dj_report *dj_report;int retval; - dj_report =kzalloc (sizeof (dj_report),GFP_KERNEL ); + dj_report =kzalloc (sizeof (struct dj_report ),GFP_KERNEL );if (!dj_report)return -ENOMEM ; dj_report->report_id =REPORT_ID_DJ_SHORT ;
@@ -456,7 +456,7 @@ static int logi_dj_recv_switch_to_dj_modstruct dj_report *dj_report;int retval; - dj_report =kzalloc (sizeof (dj_report),GFP_KERNEL ); + dj_report =kzalloc (sizeof (struct dj_report ),GFP_KERNEL );if (!dj_report)return -ENOMEM ; dj_report->report_id =REPORT_ID_DJ_SHORT ;
Greg Kroah-Hartman
maintainerPATCH 111/262 hwmon: (ad7314) Add name sysfs attribute
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <[email protected]>
commit 3ceefe4319636d89d4bdf40dca9471970f942e4f upstream.
The 'name' sysfs attribute is mandatory for hwmon devices, but was missing in this driver.
--- drivers/hwmon/ad7314.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/hwmon/ad7314.c +8 -0
@@ -87,10 +87,18 @@ static ssize_t ad7314_show_temperature(s } } +static ssize_t ad7314_show_name (struct device *dev, +struct device_attribute *devattr,char *buf) +{ +return sprintf (buf,"%s\n" ,to_spi_device (dev)->modalias); +} + +static DEVICE_ATTR(name, S_IRUGO, ad7314_show_name, NULL); static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, ad7314_show_temperature, NULL, 0);static struct attribute *ad7314_attributes[] = { + &dev_attr_name.attr, &sensor_dev_attr_temp1_input.dev_attr.attr,NULL , };
Greg Kroah-Hartman
maintainerPATCH 108/262 xen/boot: Disable NUMA for PV guests.
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Rzeszutek Wilk <[email protected]>
commit 8d54db795dfb1049d45dc34f0dddbc5347ec5642 upstream.
The hypervisor is in charge of allocating the proper "NUMA" memory and dealing with the CPU scheduler to keep them bound to the proper NUMA node. The PV guests (and PVHVM) have no inkling of where they run and do not need to know that right now. In the future we will need to inject NUMA configuration data (if a guest spans two or more NUMA nodes) so that the kernel can make the right choices. But those patches are not yet present.
In the meantime, disable the NUMA capability in the PV guest, which also fixes a bootup issue. Andre says:
"we see Dom0 crashes due to the kernel detecting the NUMA topology not by ACPI, but directly from the northbridge (CONFIG_AMD_NUMA).
This will detect the actual NUMA config of the physical machine, but will crash about the mismatch with Dom0's virtual memory. Variation of the theme: Dom0 sees what it's not supposed to see.
This happens with the said config option enabled and on a machine where this scanning is still enabled (K8 and Fam10h, not Bulldozer class)
We have this dump then:
NUMA: Warning: node ids are out of bound, from=-1 to=-1 distance=10 Scanning NUMA topology in Northbridge 24
Number of physical nodes 4
Node 0 MemBase 0000000000000000 Limit 0000000040000000 Node 1 MemBase 0000000040000000 Limit 0000000138000000 Node 2 MemBase 0000000138000000 Limit 00000001f8000000 Node 3 MemBase 00000001f8000000 Limit 0000000238000000 Initmem setup node 0 0000000000000000-0000000040000000
NODE_DATA [000000003ffd9000 - 000000003fffffff]
Initmem setup node 1 0000000040000000-0000000138000000
NODE_DATA [0000000137fd9000 - 0000000137ffffff]
Initmem setup node 2 0000000138000000-00000001f8000000
NODE_DATA [00000001f095e000 - 00000001f0984fff]
Initmem setup node 3 00000001f8000000-0000000238000000 Cannot find 159744 bytes in node 3
BUG: unable to handle kernel NULL pointer dereference at (null) IP: [<ffffffff81d220e6>] __alloc_bootmem_node+0x43/0x96 Pid: 0, comm: swapper Not tainted 3.3.6 #1 AMD Dinar/Dinar RIP: e030:[<ffffffff81d220e6>] [<ffffffff81d220e6>] __alloc_bootmem_node+0x43/0x96 .. snip.. [<ffffffff81d23024>] sparse_early_usemaps_alloc_node+0x64/0x178 [<ffffffff81d23348>] sparse_init+0xe4/0x25a [<ffffffff81d16840>] paging_init+0x13/0x22 [<ffffffff81d07fbb>] setup_arch+0x9c6/0xa9b [<ffffffff81683954>] ? printk+0x3c/0x3e [<ffffffff81d01a38>] start_kernel+0xe5/0x468 [<ffffffff81d012cf>] x86_64_start_reservations+0xba/0xc1 [<ffffffff81007153>] ? xen_setup_runstate_info+0x2c/0x36 [<ffffffff81d050ee>] xen_start_kernel+0x565/0x56c
"
so we just disable NUMA scanning by setting numa_off=1.
--- arch/x86/xen/setup.c | 4 ++++ 1 file changed, 4 insertions(+)
arch/x86/xen/setup.c +4 -0
@@ -17,6 +17,7 @@#include <asm/e820.h> #include <asm/setup.h> #include <asm/acpi.h> +#include <asm/numa.h> #include <asm/xen/hypervisor.h> #include <asm/xen/hypercall.h>
@@ -549,4 +550,7 @@ void __init xen_arch_setup(void)disable_cpufreq ();WARN_ON (set_pm_idle_to_default ());fiddle_vdso (); +#ifdef CONFIG_NUMA + numa_off =1 ; +#endif }
Greg Kroah-Hartman
maintainerPATCH 97/262 drivers/rtc/rtc-twl.c: ensure all interrupts are disabled during probe
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kevin Hilman <[email protected]>
commit 8dcebaa9a0ae8a0487f4342f3d56d2cb1c980860 upstream.
On some platforms, bootloaders are known to do some interesting RTC programming. Without going into the obscurities as to why this may be the case, suffice it to say the the driver should not make any assumptions about the state of the RTC when the driver loads. In particular, the driver probe should be sure that all interrupts are disabled until otherwise programmed.
This was discovered when finding bursty I2C traffic every second on Overo platforms. This I2C overhead was keeping the SoC from hitting deep power states. The cause was found to be the RTC firing every second on the I2C-connected TWL PMIC.
Special thanks to Felipe Balbi for suggesting to look for a rogue driver as the source of the I2C traffic rather than the I2C driver itself.
Special thanks to Steve Sakoman for helping track down the source of the continuous RTC interrups on the Overo boards.
--- drivers/rtc/rtc-twl.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/rtc/rtc-twl.c +5 -0
@@ -495,6 +495,11 @@ static int __devinit twl_rtc_probe(strucif (ret <0 ) goto out1; +/* ensure interrupts are disabled, bootloaders can be strange */ + ret =twl_rtc_write_u8 (0 ,REG_RTC_INTERRUPTS_REG ); +if (ret <0 ) +dev_warn (&pdev->dev,"unable to disable interrupt\n" ); +/* init cached IRQ enable bits */ ret =twl_rtc_read_u8 (&rtc_irq_bits,REG_RTC_INTERRUPTS_REG );if (ret <0 )
Greg Kroah-Hartman
maintainerPATCH 105/262 memory hotplug: fix section info double registration bug
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: qiuxishi <[email protected]>
commit f14851af0ebb32745c6c5a2e400aa0549f9d20df upstream.
There may be a bug when registering section info. For example, on my Itanium platform, the pfn range of node0 includes the other nodes, so other nodes' section info will be double registered, and memmap's page count will equal to 3.
node0: start_pfn=0x100, spanned_pfn=0x20fb00, present_pfn=0x7f8a3, => 0x000100-0x20fc00
node1: start_pfn=0x80000, spanned_pfn=0x80000, present_pfn=0x80000, => 0x080000-0x100000 node2: start_pfn=0x100000, spanned_pfn=0x80000, present_pfn=0x80000, => 0x100000-0x180000 node3: start_pfn=0x180000, spanned_pfn=0x80000, present_pfn=0x80000, => 0x180000-0x200000
free_all_bootmem_node()
register_page_bootmem_info_node()
register_page_bootmem_info_section()
When hot remove memory, we can't free the memmap's page because page_count() is 2 after put_page_bootmem().
sparse_remove_one_section()
free_section_usemap()
free_map_bootmem()
put_page_bootmem()
--- mm/memory_hotplug.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
mm/memory_hotplug.c +10 -6
@@ -126,9 +126,6 @@ static void register_page_bootmem_info_sstruct mem_section *ms;struct page *page, *memmap; -if (!pfn_valid (start_pfn)) -return ; - section_nr =pfn_to_section_nr (start_pfn); ms =__nr_to_section (section_nr);
@@ -187,9 +184,16 @@ void register_page_bootmem_info_node(str end_pfn = pfn + pgdat->node_spanned_pages;/* register_section info */ -for (; pfn < end_pfn; pfn +=PAGES_PER_SECTION ) - register_page_bootmem_info_section(pfn); - +for (; pfn < end_pfn; pfn +=PAGES_PER_SECTION ) { +/* +* Some platforms can assign the same pfn to multiple nodes - on +* node0 as well as nodeN. To avoid registering a pfn against +* multiple nodes we check that this pfn does not already +* reside in some other node. +*/ +if (pfn_valid (pfn) && (pfn_to_nid (pfn) == node)) +register_page_bootmem_info_section (pfn); + } }#endif /* !CONFIG_SPARSEMEM_VMEMMAP */
Greg Kroah-Hartman
maintainerPATCH 103/262 can: mcp251x: avoid repeated frame bug
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benoît Locher <[email protected]>
commit cab32f39dcc5b35db96497dc0a026b5dea76e4e7 upstream.
The MCP2515 has a silicon bug causing repeated frame transmission, see section 5 of MCP2515 Rev. B Silicon Errata Revision G (March 2007).
Basically, setting TXBnCTRL.TXREQ in either SPI mode (00 or 11) will eventually cause the bug. The workaround proposed by Microchip is to use mode 00 and send a RTS command on the SPI bus to initiate the transmission.
--- drivers/net/can/mcp251x.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/net/can/mcp251x.c +10 -1
@@ -83,6 +83,11 @@#define INSTRUCTION_LOAD_TXB (n) (0x40 + 2 * (n))#define INSTRUCTION_READ_RXB (n) (((n) == 0) ? 0x90 : 0x94)#define INSTRUCTION_RESET 0xC0 +#define RTS_TXB0 0x01 +#define RTS_TXB1 0x02 +#define RTS_TXB2 0x04 +#define INSTRUCTION_RTS (n) (0x80 | ((n) & 0x07)) +/* MPC251x registers */ #define CANSTAT 0x0e
@@ -397,6 +402,7 @@ static void mcp251x_hw_tx_frame(struct sstatic void mcp251x_hw_tx (struct spi_device *spi,struct can_frame *frame,int tx_buf_idx) { +struct mcp251x_priv *priv =dev_get_drvdata (&spi->dev);u32 sid, eid, exide, rtr;u8 buf[SPI_TRANSFER_BUF_LEN ];
@@ -418,7 +424,10 @@ static void mcp251x_hw_tx(struct spi_dev buf[TXBDLC_OFF ] = (rtr <<DLC_RTR_SHIFT ) | frame->can_dlc;memcpy (buf +TXBDAT_OFF , frame->data, frame->can_dlc);mcp251x_hw_tx_frame (spi, buf, frame->can_dlc, tx_buf_idx); -mcp251x_write_reg (spi,TXBCTRL (tx_buf_idx),TXBCTRL_TXREQ ); + +/* use INSTRUCTION_RTS, to avoid "repeated frame problem" */ + priv->spi_tx_buf[0 ] =INSTRUCTION_RTS (1 << tx_buf_idx); +mcp251x_spi_trans (priv->spi,1 ); } static void mcp251x_hw_rx_frame(struct spi_device *spi, u8 *buf,
Re: [ 089/262] SUNRPC: Fix a UDP transport regression
In reply to Greg Kroah-HartmanQuoted 151 lines · Greg Kroah-Hartman
From: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit
f39c1bfb5a03e2d255451bff05be0d7255298fa4upstream.Commit
43cedbf0e8dfb9c5610eb7985d5f21263e313802(SUNRPC: Ensure that we grab theXPRT_LOCKbefore callingxprt_alloc_slot) is causing hangs in the case of NFS over UDP mounts.Since neither the UDP or the RDMA transport mechanism use dynamic slot allocation, we can skip grabbing the socket lock for those transports. Add a new
rpc_xprt_opto allow switching between the TCP and UDP/RDMA case.Note that the NFSv4.1 back channel assigns the slot directly through
rpc_run_bc_task, so we can ignore that case.Reported-by Dick Streefland <[email protected]>Signed-off-by Trond Myklebust <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- include/linux/sunrpc/xprt.h | 3 +++ net/sunrpc/xprt.c | 34 ++++++++++++++++++++-------------- net/sunrpc/xprtrdma/transport.c | 1 + net/sunrpc/xprtsock.c | 3 +++ 4 files changed, 27 insertions(+), 14 deletions(-)include/linux/sunrpc/xprt.h +3
-0@@ -114,6 +114,7 @@ struct rpc_xprt_ops {void (*set_buffer_size)(struct rpc_xprt *xprt,size_t sndsize,size_t rcvsize);int (*reserve_xprt)(struct rpc_xprt *xprt,struct rpc_task *task);void (*release_xprt)(struct rpc_xprt *xprt,struct rpc_task *task); +void (*alloc_slot)(struct rpc_xprt *xprt,struct rpc_task *task);void (*rpcbind)(struct rpc_task *task);void (*set_port)(struct rpc_xprt *xprt,unsigned short port);void (*connect)(struct rpc_task *task);@@ -279,6 +280,8 @@ void xprt_connect(struct rpc_task *tasvoid xprt_reserve (struct rpc_task *task);int xprt_reserve_xprt (struct rpc_xprt *xprt,struct rpc_task *task);int xprt_reserve_xprt_cong (struct rpc_xprt *xprt,struct rpc_task *task); +void xprt_alloc_slot (struct rpc_xprt *xprt,struct rpc_task *task); +void xprt_lock_and_alloc_slot (struct rpc_xprt *xprt,struct rpc_task *task);int xprt_prepare_transmit (struct rpc_task *task);void xprt_transmit (struct rpc_task *task);void xprt_end_transmit (struct rpc_task *task);net/sunrpc/xprt.c +20
-14@@ -969,11 +969,11 @@ static bool xprt_dynamic_free_slot(strucreturn false; } -static void xprt_alloc_slot (struct rpc_task *task) +void xprt_alloc_slot (struct rpc_xprt *xprt,struct rpc_task *task) { -struct rpc_xprt *xprt = task->tk_xprt;struct rpc_rqst *req; +spin_lock (&xprt->reserve_lock);if (!list_empty (&xprt->free)) { req = list_entry(xprt->free.next, struct rpc_rqst, rq_list);list_del (&req->rq_list);@@ -994,12 +994,29 @@ static void xprt_alloc_slot(struct rpc_tdefault : task->tk_status = -EAGAIN ; } +spin_unlock (&xprt->reserve_lock);return ; out_init_req: task->tk_status =0 ; task->tk_rqstp = req;xprt_request_init (task, xprt); +spin_unlock (&xprt->reserve_lock); +} +EXPORT_SYMBOL_GPL (xprt_alloc_slot); + +void xprt_lock_and_alloc_slot (struct rpc_xprt *xprt,struct rpc_task *task) +{ +/* Note: grabbing the xprt_lock_write() ensures that we throttle +* new slot allocation if the transport is congested (i.e. when +* reconnecting a stream transport or when out of socket write +* buffer space). +*/ +if (xprt_lock_write (xprt, task)) { +xprt_alloc_slot (xprt, task); +xprt_release_write (xprt, task); + } } +EXPORT_SYMBOL_GPL (xprt_lock_and_alloc_slot);static void xprt_free_slot (struct rpc_xprt *xprt,struct rpc_rqst *req) {@@ -1083,20 +1100,9 @@ void xprt_reserve(struct rpc_task *task)if (task->tk_rqstp !=NULL )return ; -/* Note: grabbing the xprt_lock_write() here is not strictly needed, -* but ensures that we throttle new slot allocation if the transport -* is congested (e.g. if reconnecting or if we're out of socket -* write buffer space). -*/ task->tk_timeout =0 ; task->tk_status = -EAGAIN ; -if (!xprt_lock_write (xprt, task)) -return ; - -spin_lock (&xprt->reserve_lock); -xprt_alloc_slot (task); -spin_unlock (&xprt->reserve_lock); -xprt_release_write (xprt, task); + xprt->ops->alloc_slot (xprt, task); }static inline __be32 xprt_alloc_xid (struct rpc_xprt *xprt)net/sunrpc/xprtrdma/transport.c +1
-0@@ -713,6 +713,7 @@ static void xprt_rdma_print_stats(structstatic struct rpc_xprt_ops xprt_rdma_procs = { .reserve_xprt = xprt_rdma_reserve_xprt, .release_xprt = xprt_release_xprt_cong,/* sunrpc/xprt.c */ + .alloc_slot = xprt_alloc_slot, .release_request = xprt_release_rqst_cong,/* ditto */ .set_retrans_timeout = xprt_set_retrans_timeout_def,/* ditto */ .rpcbind = rpcb_getport_async,/* sunrpc/rpcb_clnt.c */ net/sunrpc/xprtsock.c +2
-0@@ -2433,6 +2433,7 @@ static void bc_destroy(struct rpc_xprt *static struct rpc_xprt_ops xs_local_ops = { .reserve_xprt = xprt_reserve_xprt, .release_xprt = xs_tcp_release_xprt, + .alloc_slot = xprt_alloc_slot, .rpcbind = xs_local_rpcbind, .set_port = xs_local_set_port, .connect = xs_connect,@@ -2449,6 +2450,7 @@ static struct rpc_xprt_ops xs_udp_ops = .set_buffer_size = xs_udp_set_buffer_size, .reserve_xprt = xprt_reserve_xprt_cong, .release_xprt = xprt_release_xprt_cong, + .alloc_slot = xprt_alloc_slot, .rpcbind = rpcb_getport_async, .set_port = xs_set_port, .connect = xs_connect,
net/sunrpc/xprtsock.c static struct rpc_xprt_ops xs_udp_ops = · line 2474
Quoted 7 lines
net/sunrpc/xprtsock.c +1
-0@@ -2466,6 +2468,7 @@ static struct rpc_xprt_ops xs_udp_ops =static struct rpc_xprt_ops xs_tcp_ops = { .reserve_xprt = xprt_reserve_xprt, .release_xprt = xs_tcp_release_xprt, + .alloc_slot = xprt_lock_and_alloc_slot, .rpcbind = rpcb_getport_async, .set_port = xs_set_port, .connect = xs_connect,
Hi Greg,
Can we please hold on this one for now. It appears that it requires an extra initialiser in the 'bc_tcp_ops' declaration in net/sunrpc/xprtsock.c (to set '.alloc_slot = xprt_alloc_slot').
I have a separate patch for that, but it has not yet made it upstream.
Cheers
Trond
Signature · 7 lines
Trond Myklebust Linux NFS client maintainer NetApp [email protected] www.netapp.com ���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m����������?�I�
Greg Kroah-Hartman
maintainerPATCH 101/262 gma500: Fix regression on Oaktrail devices
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Cox <[email protected]>
commit 26df641eac05abe1a3276eea441359b4d1120816 upstream.
The register map patches didn't set one value for the GMA600 which means the Fujitsu Q550 dies on boot with the GMA500 driver enabled.
Add the map entry so we don't read from the device MMIO + 0 by mistake.
--- drivers/gpu/drm/gma500/oaktrail_device.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/gma500/oaktrail_device.c +2 -0
@@ -476,6 +476,7 @@ static const struct psb_offset oaktrail_ .pos = DSPAPOS, .surf = DSPASURF, .addr = MRST_DSPABASE, + .base = MRST_DSPABASE, .status = PIPEASTAT, .linoff = DSPALINOFF, .tileoff = DSPATILEOFF,
@@ -499,6 +500,7 @@ static const struct psb_offset oaktrail_ .pos = DSPBPOS, .surf = DSPBSURF, .addr = DSPBBASE, + .base = DSPBBASE, .status = PIPEBSTAT, .linoff = DSPBLINOFF, .tileoff = DSPBTILEOFF,
Greg Kroah-Hartman
maintainerPATCH 99/262 hwmon: (ina2xx) Fix word size register read and write operations
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <[email protected]>
commit 080b98e9ab30734bda2f1b8b33cd55a4c4ef406a upstream.
The driver uses be16_to_cpu and cpu_to_be16 to convert data in SMBus word operations from chip to host byte order. However, the data passed from and to the SMBus word API functions is in host byte order, not in chip byte order. Conversion should therefore use swab16 instead of be16 to change the byte order.
Replace driver internal word conversion functions with SMBus API functions to solve the problem.
--- drivers/hwmon/ina2xx.c | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-)
drivers/hwmon/ina2xx.c +9 -21
@@ -69,22 +69,6 @@ struct ina2xx_data {u16 regs[INA2XX_MAX_REGISTERS ]; }; -int ina2xx_read_word (struct i2c_client *client,int reg) -{ -int val =i2c_smbus_read_word_data (client, reg); -if (unlikely (val <0 )) { -dev_dbg (&client->dev, -"Failed to read register: %d\n" , reg); -return val; - } -return be16_to_cpu (val); -} - -void ina2xx_write_word (struct i2c_client *client,int reg,int data) -{ -i2c_smbus_write_word_data (client, reg,cpu_to_be16 (data)); -} -static struct ina2xx_data *ina2xx_update_device (struct device *dev) {struct i2c_client *client =to_i2c_client (dev);
@@ -102,7 +86,7 @@ static struct ina2xx_data *ina2xx_update/* Read all registers */ for (i =0 ; i < data->registers; i++) { -int rv =ina2xx_read_word (client, i); +int rv =i2c_smbus_read_word_swapped (client, i);if (rv <0 ) { ret =ERR_PTR (rv); goto abort;
@@ -279,22 +263,26 @@ static int ina2xx_probe(struct i2c_clienswitch (data->kind) {case ina219:/* device configuration */ -ina2xx_write_word (client,INA2XX_CONFIG ,INA219_CONFIG_DEFAULT ); +i2c_smbus_write_word_swapped (client,INA2XX_CONFIG , +INA219_CONFIG_DEFAULT );/* set current LSB to 1mA, shunt is in uOhms */ /* (equation 13 in datasheet) */ -ina2xx_write_word (client,INA2XX_CALIBRATION ,40960000 / shunt); +i2c_smbus_write_word_swapped (client,INA2XX_CALIBRATION , +40960000 / shunt);dev_info (&client->dev,"power monitor INA219 (Rshunt = %li uOhm)\n" , shunt); data->registers =INA219_REGISTERS ;break ;case ina226:/* device configuration */ -ina2xx_write_word (client,INA2XX_CONFIG ,INA226_CONFIG_DEFAULT ); +i2c_smbus_write_word_swapped (client,INA2XX_CONFIG , +INA226_CONFIG_DEFAULT );/* set current LSB to 1mA, shunt is in uOhms */ /* (equation 1 in datasheet)*/ -ina2xx_write_word (client,INA2XX_CALIBRATION ,5120000 / shunt); +i2c_smbus_write_word_swapped (client,INA2XX_CALIBRATION , +5120000 / shunt);dev_info (&client->dev,"power monitor INA226 (Rshunt = %li uOhm)\n" , shunt); data->registers =INA226_REGISTERS ;
Greg Kroah-Hartman
maintainerPATCH 89/262 SUNRPC: Fix a UDP transport regression
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit f39c1bfb5a03e2d255451bff05be0d7255298fa4 upstream.
Commit 43cedbf0e8dfb9c5610eb7985d5f21263e313802 (SUNRPC: Ensure that we grab the XPRT_LOCK before calling xprt_alloc_slot) is causing hangs in the case of NFS over UDP mounts.
Since neither the UDP or the RDMA transport mechanism use dynamic slot allocation, we can skip grabbing the socket lock for those transports. Add a new rpc_xprt_op to allow switching between the TCP and UDP/RDMA case.
Note that the NFSv4.1 back channel assigns the slot directly through rpc_run_bc_task, so we can ignore that case.
--- include/linux/sunrpc/xprt.h | 3 +++ net/sunrpc/xprt.c | 34 ++++++++++++++++++++-------------- net/sunrpc/xprtrdma/transport.c | 1 + net/sunrpc/xprtsock.c | 3 +++ 4 files changed, 27 insertions(+), 14 deletions(-)
include/linux/sunrpc/xprt.h +3 -0
@@ -114,6 +114,7 @@ struct rpc_xprt_ops {void (*set_buffer_size)(struct rpc_xprt *xprt,size_t sndsize,size_t rcvsize);int (*reserve_xprt)(struct rpc_xprt *xprt,struct rpc_task *task);void (*release_xprt)(struct rpc_xprt *xprt,struct rpc_task *task); +void (*alloc_slot)(struct rpc_xprt *xprt,struct rpc_task *task);void (*rpcbind)(struct rpc_task *task);void (*set_port)(struct rpc_xprt *xprt,unsigned short port);void (*connect)(struct rpc_task *task);
@@ -279,6 +280,8 @@ void xprt_connect(struct rpc_task *tasvoid xprt_reserve (struct rpc_task *task);int xprt_reserve_xprt (struct rpc_xprt *xprt,struct rpc_task *task);int xprt_reserve_xprt_cong (struct rpc_xprt *xprt,struct rpc_task *task); +void xprt_alloc_slot (struct rpc_xprt *xprt,struct rpc_task *task); +void xprt_lock_and_alloc_slot (struct rpc_xprt *xprt,struct rpc_task *task);int xprt_prepare_transmit (struct rpc_task *task);void xprt_transmit (struct rpc_task *task);void xprt_end_transmit (struct rpc_task *task);
net/sunrpc/xprt.c +20 -14
@@ -969,11 +969,11 @@ static bool xprt_dynamic_free_slot(strucreturn false; } -static void xprt_alloc_slot (struct rpc_task *task) +void xprt_alloc_slot (struct rpc_xprt *xprt,struct rpc_task *task) { -struct rpc_xprt *xprt = task->tk_xprt;struct rpc_rqst *req; +spin_lock (&xprt->reserve_lock);if (!list_empty (&xprt->free)) { req = list_entry(xprt->free.next, struct rpc_rqst, rq_list);list_del (&req->rq_list);
@@ -994,12 +994,29 @@ static void xprt_alloc_slot(struct rpc_tdefault : task->tk_status = -EAGAIN ; } +spin_unlock (&xprt->reserve_lock);return ; out_init_req: task->tk_status =0 ; task->tk_rqstp = req;xprt_request_init (task, xprt); +spin_unlock (&xprt->reserve_lock); +} +EXPORT_SYMBOL_GPL (xprt_alloc_slot); + +void xprt_lock_and_alloc_slot (struct rpc_xprt *xprt,struct rpc_task *task) +{ +/* Note: grabbing the xprt_lock_write() ensures that we throttle +* new slot allocation if the transport is congested (i.e. when +* reconnecting a stream transport or when out of socket write +* buffer space). +*/ +if (xprt_lock_write (xprt, task)) { +xprt_alloc_slot (xprt, task); +xprt_release_write (xprt, task); + } } +EXPORT_SYMBOL_GPL (xprt_lock_and_alloc_slot);static void xprt_free_slot (struct rpc_xprt *xprt,struct rpc_rqst *req) {
@@ -1083,20 +1100,9 @@ void xprt_reserve(struct rpc_task *task)if (task->tk_rqstp !=NULL )return ; -/* Note: grabbing the xprt_lock_write() here is not strictly needed, -* but ensures that we throttle new slot allocation if the transport -* is congested (e.g. if reconnecting or if we're out of socket -* write buffer space). -*/ task->tk_timeout =0 ; task->tk_status = -EAGAIN ; -if (!xprt_lock_write (xprt, task)) -return ; - -spin_lock (&xprt->reserve_lock); -xprt_alloc_slot (task); -spin_unlock (&xprt->reserve_lock); -xprt_release_write (xprt, task); + xprt->ops->alloc_slot (xprt, task); }static inline __be32 xprt_alloc_xid (struct rpc_xprt *xprt)
net/sunrpc/xprtrdma/transport.c +1 -0
@@ -713,6 +713,7 @@ static void xprt_rdma_print_stats(structstatic struct rpc_xprt_ops xprt_rdma_procs = { .reserve_xprt = xprt_rdma_reserve_xprt, .release_xprt = xprt_release_xprt_cong,/* sunrpc/xprt.c */ + .alloc_slot = xprt_alloc_slot, .release_request = xprt_release_rqst_cong,/* ditto */ .set_retrans_timeout = xprt_set_retrans_timeout_def,/* ditto */ .rpcbind = rpcb_getport_async,/* sunrpc/rpcb_clnt.c */
net/sunrpc/xprtsock.c +3 -0
@@ -2433,6 +2433,7 @@ static void bc_destroy(struct rpc_xprt *static struct rpc_xprt_ops xs_local_ops = { .reserve_xprt = xprt_reserve_xprt, .release_xprt = xs_tcp_release_xprt, + .alloc_slot = xprt_alloc_slot, .rpcbind = xs_local_rpcbind, .set_port = xs_local_set_port, .connect = xs_connect,
@@ -2449,6 +2450,7 @@ static struct rpc_xprt_ops xs_udp_ops = .set_buffer_size = xs_udp_set_buffer_size, .reserve_xprt = xprt_reserve_xprt_cong, .release_xprt = xprt_release_xprt_cong, + .alloc_slot = xprt_alloc_slot, .rpcbind = rpcb_getport_async, .set_port = xs_set_port, .connect = xs_connect,
@@ -2466,6 +2468,7 @@ static struct rpc_xprt_ops xs_udp_ops =static struct rpc_xprt_ops xs_tcp_ops = { .reserve_xprt = xprt_reserve_xprt, .release_xprt = xs_tcp_release_xprt, + .alloc_slot = xprt_lock_and_alloc_slot, .rpcbind = rpcb_getport_async, .set_port = xs_set_port, .connect = xs_connect,
Greg Kroah-Hartman
maintainerPATCH 96/262 mm/page_alloc: fix the page address of higher pages buddy calculation
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Haifeng <[email protected]>
commit 0ba8f2d59304dfe69b59c034de723ad80f7ab9ac upstream.
The heuristic method for buddy has been introduced since commit 43506fad21ca ("mm/page_alloc.c: simplify calculation of combined index of adjacent buddy lists"). But the page address of higher page's buddy was wrongly calculated, which will lead page_is_buddy to fail for ever. IOW, the heuristic method would be disabled with the wrong page address of higher page's buddy.
Calculating the page address of higher page's buddy should be based higher_page with the offset between index of higher page and index of higher page's buddy.
--- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_alloc.c +1 -1
@@ -580,7 +580,7 @@ static inline void __free_one_page(struc combined_idx = buddy_idx & page_idx; higher_page = page + (combined_idx - page_idx); buddy_idx =__find_buddy_index (combined_idx, order +1 ); - higher_buddy = page + (buddy_idx - combined_idx); + higher_buddy = higher_page + (buddy_idx - combined_idx);if (page_is_buddy (higher_page, higher_buddy, order +1 )) {list_add_tail (&page->lru, &zone->free_area[order].free_list[migratetype]);
Greg Kroah-Hartman
maintainerPATCH 93/262 md/raid5: fix calculate of degraded when a replacement becomes active.
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
commit e5c86471f933608db5d43679f84cb4346c32033e upstream.
When a replacement device becomes active, we mark the device that it replaces as 'faulty' so that it can subsequently get removed. However 'calc_degraded' only pays attention to the primary device, not the replacement, so the array appears to become degraded, which is wrong.
So teach 'calc_degraded' to consider any replacement if a primary device is faulty.
This is suitable for -stable as an incorrect 'degraded' value can confuse md and could lead to data corruption.
This is only relevant for 3.3 and later.
--- drivers/md/raid5.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/md/raid5.c +4 -0
@@ -380,6 +380,8 @@ static int calc_degraded(struct r5conf * degraded =0 ;for (i =0 ; i < conf->previous_raid_disks; i++) {struct md_rdev *rdev =rcu_dereference (conf->disks[i].rdev); +if (rdev &&test_bit (Faulty, &rdev->flags)) + rdev =rcu_dereference (conf->disks[i].replacement);if (!rdev ||test_bit (Faulty, &rdev->flags)) degraded++;else if (test_bit (In_sync, &rdev->flags))
@@ -404,6 +406,8 @@ static int calc_degraded(struct r5conf * degraded2 =0 ;for (i =0 ; i < conf->raid_disks; i++) {struct md_rdev *rdev =rcu_dereference (conf->disks[i].rdev); +if (rdev &&test_bit (Faulty, &rdev->flags)) + rdev =rcu_dereference (conf->disks[i].replacement);if (!rdev ||test_bit (Faulty, &rdev->flags)) degraded2++;else if (test_bit (In_sync, &rdev->flags))
Greg Kroah-Hartman
maintainerPATCH 92/262 md: make sure metadata is updated when spares are activated or removed.
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
commit 6dafab6b1383e912cd252fa809570b484eb6e0dc upstream.
It isn't always necessary to update the metadata when spares are removed as the presence-or-not of a spare isn't really important to the integrity of an array.
Also activating a spare doesn't always require updating the metadata as the update on 'recovery-completed' is usually sufficient.
However the introduction of 'replacement' devices have made these transitions sometimes more important. For example the 'Replacement' flag isn't cleared until the original device is removed, so we need to ensure a metadata update after that 'spare' is removed.
So set MD_CHANGE_DEVS whenever a spare is activated or removed, to complement the current situation where it is set when a spare is added or a device is failed (or a number of other less common situations).
This is suitable for -stable as out-of-data metadata could lead to data corruption.
This is only relevant for 3.3 and later 9when 'replacement' as introduced.
--- drivers/md/md.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/md/md.c +5 -1
@@ -7672,6 +7672,8 @@ static int remove_and_add_spares(struct } } } +if (removed) +set_bit (MD_CHANGE_DEVS , &mddev->flags);return spares; }
@@ -7685,9 +7687,11 @@ static void reap_sync_thread(struct mdde !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) {/* success...*/ /* activate any spares */ -if (mddev->pers->spare_active (mddev)) +if (mddev->pers->spare_active (mddev)) {sysfs_notify (&mddev->kobj,NULL ,"degraded" ); +set_bit (MD_CHANGE_DEVS , &mddev->flags); + } }if (test_bit (MD_RECOVERY_RESHAPE , &mddev->recovery) && mddev->pers->finish_reshape)
Greg Kroah-Hartman
maintainerPATCH 91/262 md/raid10: fix problem with on-stack allocation of r10bio structure.
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
commit e0ee778528bbaad28a5c69d2e219269a3a096607 upstream.
A 'struct r10bio' has an array of per-copy information at the end. This array is declared with size [0] and r10bio_pool_alloc allocates enough extra space to store the per-copy information depending on the number of copies needed.
So declaring a 'struct r10bio on the stack isn't going to work. It won't allocate enough space, and memory corruption will ensue.
So in the two places where this is done, declare a sufficiently large structure and use that instead.
The two call-sites of this bug were introduced in 3.4 and 3.5 so this is suitable for both those kernels. The patch will have to be modified for 3.4 as it only has one bug.
--- drivers/md/raid10.c | 30 +++++++++++++++++++----------- drivers/md/raid10.h | 2 +- 2 files changed, 20 insertions(+), 12 deletions(-)
drivers/md/raid10.c +19 -11
@@ -645,7 +645,11 @@ static int raid10_mergeable_bvec(struct max = biovec->bv_len;if (mddev->merge_check_needed) { -struct r10bio r10_bio; +struct { +struct r10bio r10_bio; +struct r10dev devs[conf->copies]; + } on_stack; +struct r10bio *r10_bio = &on_stack.r10_bio;int s;if (conf->reshape_progress != MaxSector) {/* Cannot give any guidance during reshape */
@@ -653,18 +657,18 @@ static int raid10_mergeable_bvec(structreturn biovec->bv_len;return 0 ; } - r10_bio.sector = sector; -raid10_find_phys (conf, &r10_bio); + r10_bio->sector = sector; +raid10_find_phys (conf, r10_bio);rcu_read_lock ();for (s =0 ; s < conf->copies; s++) { -int disk = r10_bio.devs[s].devnum; +int disk = r10_bio->devs[s].devnum;struct md_rdev *rdev =rcu_dereference ( conf->mirrors[disk].rdev);if (rdev && !test_bit (Faulty, &rdev->flags)) {struct request_queue *q =bdev_get_queue (rdev->bdev);if (q->merge_bvec_fn) { - bvm->bi_sector = r10_bio.devs[s].addr + bvm->bi_sector = r10_bio->devs[s].addr + rdev->data_offset; bvm->bi_bdev = rdev->bdev; max = min(max, q->merge_bvec_fn(
@@ -676,7 +680,7 @@ static int raid10_mergeable_bvec(structstruct request_queue *q =bdev_get_queue (rdev->bdev);if (q->merge_bvec_fn) { - bvm->bi_sector = r10_bio.devs[s].addr + bvm->bi_sector = r10_bio->devs[s].addr + rdev->data_offset; bvm->bi_bdev = rdev->bdev; max = min(max, q->merge_bvec_fn(
@@ -4389,14 +4393,18 @@ static int handle_reshape_read_error(str {/* Use sync reads to get the blocks from somewhere else */ int sectors = r10_bio->sectors; -struct r10bio r10b;struct r10conf *conf = mddev->private; +struct { +struct r10bio r10_bio; +struct r10dev devs[conf->copies]; + } on_stack; +struct r10bio *r10b = &on_stack.r10_bio;int slot =0 ;int idx =0 ;struct bio_vec *bvec = r10_bio->master_bio->bi_io_vec; - r10b.sector = r10_bio->sector; -__raid10_find_phys (&conf->prev, &r10b); + r10b->sector = r10_bio->sector; +__raid10_find_phys (&conf->prev, r10b);while (sectors) {int s = sectors;
@@ -4407,7 +4415,7 @@ static int handle_reshape_read_error(str s =PAGE_SIZE >>9 ;while (!success) { -int d = r10b.devs[slot].devnum; +int d = r10b->devs[slot].devnum;struct md_rdev *rdev = conf->mirrors[d].rdev;sector_t addr; if (rdev == NULL ||
@@ -4415,7 +4423,7 @@ static int handle_reshape_read_error(str !test_bit(In_sync, &rdev->flags)) goto failed; - addr = r10b.devs[slot].addr + idx *PAGE_SIZE ; + addr = r10b->devs[slot].addr + idx *PAGE_SIZE ; success = sync_page_io(rdev, addr, s << 9,
drivers/md/raid10.h +1 -1
@@ -110,7 +110,7 @@ struct r10bio {* We choose the number when they are allocated. * We sometimes need an extra bio to write to the replacement. */ -struct { +struct r10dev {struct bio *bio;union {struct bio *repl_bio;/* used for resync and
Greg Kroah-Hartman
maintainerPATCH 85/262 kobject: fix oops with "input0: bad kobj_uevent_env content in show_uevent()"
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjørn Mork <[email protected]>
commit 60e233a56609fd963c59e99bd75c663d63fa91b6 upstream.
Quoted 18 lines · Fengguang Wu
After the __devinit* removal series, I can still get kernel panic in
show_uevent(). So there are more sources of bug..Debug patch:
(quoted diff) +4
-1@@ -343,8 +343,11 @@ static ssize_t show_uevent(struct device goto out; /* copy keys to file */ - for (i = 0; i < env->envp_idx; i++) + dev_err(dev, "uevent %d env[%d]: %s/.../%s\n", env->buflen, env->envp_idx, top_kobj->name, dev->kobj.name); + for (i = 0; i < env->envp_idx; i++) { + printk(KERN_ERR "uevent %d env[%d]: %s\n", (int)count, i, env->envp[i]); count += sprintf(&buf[count], "%s\n", env->envp[i]); + }Oops message, the env[] is again not properly initilized:
Quoted 2 lines
[ 44.068623] input input0: uevent 61 env[805306368]: input0/.../input0 [ 44.069552] uevent 0 env[0]: (null)
This is a completely different CONFIG_HOTPLUG problem, only demonstrating another reason why CONFIG_HOTPLUG should go away. I had a hard time trying to disable it anyway ;-)
The problem this time is lots of code assuming that a call to add_uevent_var() will guarantee that env->buflen > 0. This is not true if CONFIG_HOTPLUG is unset. So things like this end up overwriting env->envp_idx because the array index is -1:
if (add_uevent_var(env, "MODALIAS="))
return -ENOMEM;
len = input_print_modalias(&env->buf[env->buflen - 1],
sizeof(env->buf) - env->buflen,
dev, 0);Don't know what the best action is, given that there seem to be a *lot* of this around the kernel. This patch "fixes" the problem for me, but I don't know if it can be considered an appropriate fix.
[ It is the correct fix for now, for 3.7 forcing CONFIG_HOTPLUG to always be on is the longterm fix, but it's too late for 3.6 and older kernels to resolve this that way - gregkh ]
--- include/linux/kobject.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/kobject.h +1 -1
@@ -224,7 +224,7 @@ static inline int kobject_uevent_env(str static inline __printf(2, 3) int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...) -{return 0 ; } +{ return -ENOMEM; } static inline int kobject_action_type(const char *buf, size_t count, enum kobject_action *type)
Greg Kroah-Hartman
maintainerPATCH 83/262 usb: gadget: at91udc: Dont check for ep->ep.desc
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
commit f3bb8e63a8ee0398dffe412e774d8801db7e1bf1 upstream.
Earlier we used to check for ep->ep.desc to figure out if this ep has already been enabled and if so, abort.
Ido Shayevitz removed the usb_endpoint_descriptor from private udc structure 5a6506f00 ("usb: gadget: Update at91_udc to useusb_endpoint_descriptor inside the struct usb_ep") but did not fix up
the ep_enable condition because _now_ the member is always true and we can't check if this ep is enabled twice.
--- drivers/usb/gadget/at91_udc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/usb/gadget/at91_udc.c +1 -3
@@ -475,8 +475,7 @@ static int at91_ep_enable(struct usb_epunsigned long flags;if (!_ep || !ep - || !desc || ep->ep.desc - || _ep->name == ep0name + || !desc || _ep->name == ep0name || desc->bDescriptorType !=USB_DT_ENDPOINT || (maxpacket =usb_endpoint_maxp (desc)) ==0 || maxpacket > ep->maxpacket) {
@@ -530,7 +529,6 @@ ok: tmp |=AT91_UDP_EPEDS ;__raw_writel (tmp, ep->creg); - ep->ep.desc = desc; ep->ep.maxpacket = maxpacket;/*
Greg Kroah-Hartman
maintainerPATCH 81/262 usb: gadget: dummy_hcd: add support for USB_DT_BOS on rh
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
commit 3b9c1c5ba7a95caae8440ea47308496b14f7301a upstream.
Without a reply for USB_DT_BOS the USB3 mode does not work since 448b6eb1 ("USB: Make sure to fetch the BOS desc for roothubs.).
--- drivers/usb/gadget/dummy_hcd.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)
drivers/usb/gadget/dummy_hcd.c +33 -0
@@ -1916,6 +1916,27 @@ done:return retval; } +/* usb 3.0 root hub device descriptor */ +struct { +struct usb_bos_descriptor bos; +struct usb_ss_cap_descriptor ss_cap; +} __packed usb3_bos_desc = { + + .bos = { + .bLength =USB_DT_BOS_SIZE , + .bDescriptorType =USB_DT_BOS , + .wTotalLength =cpu_to_le16 (sizeof (usb3_bos_desc)), + .bNumDeviceCaps =1 , + }, + .ss_cap = { + .bLength =USB_DT_USB_SS_CAP_SIZE , + .bDescriptorType =USB_DT_DEVICE_CAPABILITY , + .bDevCapabilityType =USB_SS_CAP_TYPE , + .wSpeedSupported =cpu_to_le16 (USB_5GBPS_OPERATION ), + .bFunctionalitySupport =ilog2 (USB_5GBPS_OPERATION ), + }, +}; +static inline void ss_hub_descriptor (struct usb_hub_descriptor *desc) {
@@ -2006,6 +2027,18 @@ static int dummy_hub_control(else hub_descriptor ((struct usb_hub_descriptor *) buf);break ; + +case DeviceRequest |USB_REQ_GET_DESCRIPTOR : +if (hcd->speed !=HCD_USB3 ) + goto error; + +if ((wValue >>8 ) !=USB_DT_BOS ) + goto error; + +memcpy (buf, &usb3_bos_desc,sizeof (usb3_bos_desc)); + retval =sizeof (usb3_bos_desc); +break ; +case GetHubStatus: *(__le32 *) buf =cpu_to_le32 (0 );break ;
Greg Kroah-Hartman
maintainerPATCH 79/262 usb: chipidea: udc: add pullup fuction, needed by the uvc gadget
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Grzeschik <[email protected]>
commit c0a48e6c75f2ac190d812bea5fc339696e434c2e upstream.
Add function to physicaly enable or disable of pullup connection on the USB-D+ line. The uvc gaget will fail, if this function is not implemented.
--- drivers/usb/chipidea/udc.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-)
drivers/usb/chipidea/udc.c +17 -3
@@ -77,8 +77,7 @@ static inline int ep_to_bit(struct ci13x }/** -* hw_device_state: enables/disables interrupts & starts/stops device (execute -* without interruption) +* hw_device_state: enables/disables interrupts (execute without interruption) * @dma: 0 => disable, !0 => enable and set dma engine * * This function returns an error code
@@ -92,7 +91,6 @@ static int hw_device_state(struct ci13xx USBi_UI|USBi_UEI|USBi_PCI|USBi_URI|USBi_SLI);hw_write (udc,OP_USBCMD ,USBCMD_RS ,USBCMD_RS ); }else { -hw_write (udc,OP_USBCMD ,USBCMD_RS ,0 );hw_write (udc,OP_USBINTR , ~0 ,0 ); }return 0 ;
@@ -1419,6 +1417,21 @@ static int ci13xxx_vbus_draw(struct usb_return -ENOTSUPP ; } +/* Change Data+ pullup status +* this func is used by usb_gadget_connect/disconnet +*/ +static int ci13xxx_pullup (struct usb_gadget *_gadget,int is_on) +{ + struct ci13xxx *ci = container_of(_gadget, struct ci13xxx, gadget); + +if (is_on) +hw_write (ci,OP_USBCMD ,USBCMD_RS ,USBCMD_RS ); +else +hw_write (ci,OP_USBCMD ,USBCMD_RS ,0 ); + +return 0 ; +} +static int ci13xxx_start (struct usb_gadget *gadget,struct usb_gadget_driver *driver); static int ci13xxx_stop(struct usb_gadget *gadget,
@@ -1431,6 +1444,7 @@ static int ci13xxx_stop(struct usb_gadgestatic const struct usb_gadget_ops usb_gadget_ops = { .vbus_session = ci13xxx_vbus_session, .wakeup = ci13xxx_wakeup, + .pullup = ci13xxx_pullup, .vbus_draw = ci13xxx_vbus_draw, .udc_start = ci13xxx_start, .udc_stop = ci13xxx_stop,
Greg Kroah-Hartman
maintainerPATCH 88/262 digsig: add hash size comparision on signature verification
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Kasatkin <[email protected]>
commit bc01637a80f5b670bd70a0279d3f93fa8de1c96d upstream.
When pkcs_1_v1_5_decode_emsa() returns without error and hash sizes do not match, hash comparision is not done and digsig_verify_rsa() returns no error. This is a bug and this patch fixes it.
The bug was introduced in v3.3 by commit b35e286a640f ("lib/digsig:pkcs_1_v1_5_decode_emsa cleanup").
--- lib/digsig.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
lib/digsig.c +4 -2
@@ -163,9 +163,11 @@ static int digsig_verify_rsa(struct keymemcpy (out1 + head, p, l); err =pkcs_1_v1_5_decode_emsa (out1, len, mblen, out2, &len); +if (err) + goto err; -if (!err && len == hlen) - err =memcmp (out2, h, hlen); +if (len != hlen ||memcmp (out2, h, hlen)) + err = -EINVAL ; err:mpi_free (in);
Greg Kroah-Hartman
maintainerPATCH 66/262 USB: option: replace ZTE K5006-Z entry with vendor class rule
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <[email protected]>
commit ba9edaa468869a8cea242a411066b0f490751798 upstream.
Fix the ZTE K5006-Z entry so that it actually matches anything
commit f1b5c997 USB: option: add ZTE K5006-Z
added a device specific entry assuming that the device would use class/subclass/proto == ff/ff/ff like other ZTE devices. It turns out that ZTE has started using vendor specific subclass and protocol codes:
T: Bus=01 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#= 4 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=19d2 ProdID=1018 Rev= 0.00 S: Manufacturer=ZTE,Incorporated S: Product=ZTE LTE Technologies MSM S: SerialNumber=MF821Vxxxxxxx C:* #Ifs= 5 Cfg#= 1 Atr=c0 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=86 Prot=10 Driver=(none) E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=02 Prot=05 Driver=(none) E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=02 Prot=01 Driver=(none) E: Ad=83(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=06 Prot=00 Driver=qmi_wwan E: Ad=85(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms I:* If#= 4 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
We do not have any information on how ZTE intend to use these codes, but let us assume for now that the 3 sets matching serial functions in the K5006-Z always will identify a serial function in a ZTE device.
--- drivers/usb/serial/option.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/usb/serial/option.c +4 -2
@@ -886,8 +886,6 @@ static const struct usb_device_id option { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff), .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1018, 0xff, 0xff, 0xff), - .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1057, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1058, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1059, 0xff, 0xff, 0xff) },
@@ -1092,6 +1090,10 @@ static const struct usb_device_id option .driver_info = (kernel_ulong_t)&zte_ad3812_z_blacklist }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2716, 0xff, 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_mc2716_z_blacklist }, + { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x01) }, + { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x05) }, + { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x86, 0x10) }, + { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5) }, /* Yes, ALINK_VENDOR_ID */
Greg Kroah-Hartman
maintainerPATCH 74/262 mmc: mxs-mmc: fix deadlock caused by recursion loop
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lauri Hintsala <[email protected]>
commit fc108d24d3a6da63576a460e122fa1df0cbdea20 upstream.
Release the lock before mmc_signal_sdio_irq is called by mxs_mmc_enable_sdio_irq.
Backtrace:
[ 65.470000] =============================================
[ 65.470000] [ INFO: possible recursive locking detected ]
[ 65.470000] 3.5.0-rc5 #2 Not tainted
[ 65.470000] ---------------------------------------------
[ 65.470000] ksdioirqd/mmc0/73 is trying to acquire lock:
[ 65.470000] (&(&host->lock)->rlock#2){-.-...}, at: [<bf054120>] mxs_mmc_enable_sdio_irq+0x18/0xdc [mxs_mmc]
[ 65.470000]
[ 65.470000] but task is already holding lock:
[ 65.470000] (&(&host->lock)->rlock#2){-.-...}, at: [<bf054120>] mxs_mmc_enable_sdio_irq+0x18/0xdc [mxs_mmc]
[ 65.470000]
[ 65.470000] other info that might help us debug this:
[ 65.470000] Possible unsafe locking scenario:
[ 65.470000]
[ 65.470000] CPU0
[ 65.470000] ----
[ 65.470000] lock(&(&host->lock)->rlock#2);
[ 65.470000] lock(&(&host->lock)->rlock#2);
[ 65.470000]
[ 65.470000] *** DEADLOCK ***
[ 65.470000]
[ 65.470000] May be due to missing lock nesting notation
[ 65.470000]
[ 65.470000] 1 lock held by ksdioirqd/mmc0/73:
[ 65.470000] #0: (&(&host->lock)->rlock#2){-.-...}, at: [<bf054120>] mxs_mmc_enable_sdio_irq+0x18/0xdc [mxs_mmc]
[ 65.470000]
[ 65.470000] stack backtrace:
[ 65.470000] [<c0014990>] (unwind_backtrace+0x0/0xf4) from [<c005ccb8>] (__lock_acquire+0x14f8/0x1b98)
[ 65.470000] [<c005ccb8>] (__lock_acquire+0x14f8/0x1b98) from [<c005d3f8>] (lock_acquire+0xa0/0x108)
[ 65.470000] [<c005d3f8>] (lock_acquire+0xa0/0x108) from [<c02f671c>] (_raw_spin_lock_irqsave+0x48/0x5c)
[ 65.470000] [<c02f671c>] (_raw_spin_lock_irqsave+0x48/0x5c) from [<bf054120>] (mxs_mmc_enable_sdio_irq+0x18/0xdc [mxs_mmc])
[ 65.470000] [<bf054120>] (mxs_mmc_enable_sdio_irq+0x18/0xdc [mxs_mmc]) from [<bf0541d0>] (mxs_mmc_enable_sdio_irq+0xc8/0xdc [mxs_mmc])
[ 65.470000] [<bf0541d0>] (mxs_mmc_enable_sdio_irq+0xc8/0xdc [mxs_mmc]) from [<c0219b38>] (sdio_irq_thread+0x1bc/0x274)
[ 65.470000] [<c0219b38>] (sdio_irq_thread+0x1bc/0x274) from [<c003c324>] (kthread+0x8c/0x98)
[ 65.470000] [<c003c324>] (kthread+0x8c/0x98) from [<c00101ac>] (kernel_thread_exit+0x0/0x8)
[ 65.470000] BUG: spinlock lockup suspected on CPU#0, ksdioirqd/mmc0/73
[ 65.470000] lock: 0xc3358724, .magic: dead4ead, .owner: ksdioirqd/mmc0/73, .owner_cpu: 0
[ 65.470000] [<c0014990>] (unwind_backtrace+0x0/0xf4) from [<c01b46b0>] (do_raw_spin_lock+0x100/0x144)
[ 65.470000] [<c01b46b0>] (do_raw_spin_lock+0x100/0x144) from [<c02f6724>] (_raw_spin_lock_irqsave+0x50/0x5c)
[ 65.470000] [<c02f6724>] (_raw_spin_lock_irqsave+0x50/0x5c) from [<bf054120>] (mxs_mmc_enable_sdio_irq+0x18/0xdc [mxs_mmc])
[ 65.470000] [<bf054120>] (mxs_mmc_enable_sdio_irq+0x18/0xdc [mxs_mmc]) from [<bf0541d0>] (mxs_mmc_enable_sdio_irq+0xc8/0xdc [mxs_mmc])
[ 65.470000] [<bf0541d0>] (mxs_mmc_enable_sdio_irq+0xc8/0xdc [mxs_mmc]) from [<c0219b38>] (sdio_irq_thread+0x1bc/0x274)
[ 65.470000] [<c0219b38>] (sdio_irq_thread+0x1bc/0x274) from [<c003c324>] (kthread+0x8c/0x98)
[ 65.470000] [<c003c324>] (kthread+0x8c/0x98) from [<c00101ac>] (kernel_thread_exit+0x0/0x8)--- drivers/mmc/host/mxs-mmc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/mmc/host/mxs-mmc.c +5 -5
@@ -637,11 +637,6 @@ static void mxs_mmc_enable_sdio_irq(stru host->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_SET);writel (BM_SSP_CTRL1_SDIO_IRQ_EN , host->base +HW_SSP_CTRL1 (host) +STMP_OFFSET_REG_SET ); - -if (readl (host->base +HW_SSP_STATUS (host)) & -BM_SSP_STATUS_SDIO_IRQ ) -mmc_signal_sdio_irq (host->mmc); - }else {writel (BM_SSP_CTRL0_SDIO_IRQ_CHECK , host->base +HW_SSP_CTRL0 +STMP_OFFSET_REG_CLR );
@@ -650,6 +645,11 @@ static void mxs_mmc_enable_sdio_irq(stru }spin_unlock_irqrestore (&host->lock, flags); + +if (enable &&readl (host->base +HW_SSP_STATUS (host)) & +BM_SSP_STATUS_SDIO_IRQ ) +mmc_signal_sdio_irq (host->mmc); + }static const struct mmc_host_ops mxs_mmc_ops = {
Greg Kroah-Hartman
maintainerPATCH 73/262 mmc: mxs-mmc: fix deadlock in SDIO IRQ case
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lauri Hintsala <[email protected]>
commit 1af36b2a993dddfa3d6860ec4879c9e8abc9b976 upstream.
Release the lock before mmc_signal_sdio_irq is called by mxs_mmc_irq_handler.
Backtrace:
[ 79.660000] =============================================
[ 79.660000] [ INFO: possible recursive locking detected ]
[ 79.660000] 3.4.0-00009-g3e96082-dirty #11 Not tainted
[ 79.660000] ---------------------------------------------
[ 79.660000] swapper/0 is trying to acquire lock:
[ 79.660000] (&(&host->lock)->rlock#2){-.....}, at: [<c026ea3c>] mxs_mmc_enable_sdio_irq+0x18/0xd4
[ 79.660000]
[ 79.660000] but task is already holding lock:
[ 79.660000] (&(&host->lock)->rlock#2){-.....}, at: [<c026f744>] mxs_mmc_irq_handler+0x1c/0xe8
[ 79.660000]
[ 79.660000] other info that might help us debug this:
[ 79.660000] Possible unsafe locking scenario:
[ 79.660000]
[ 79.660000] CPU0
[ 79.660000] ----
[ 79.660000] lock(&(&host->lock)->rlock#2);
[ 79.660000] lock(&(&host->lock)->rlock#2);
[ 79.660000]
[ 79.660000] *** DEADLOCK ***
[ 79.660000]
[ 79.660000] May be due to missing lock nesting notation
[ 79.660000]
[ 79.660000] 1 lock held by swapper/0:
[ 79.660000] #0: (&(&host->lock)->rlock#2){-.....}, at: [<c026f744>] mxs_mmc_irq_handler+0x1c/0xe8
[ 79.660000]
[ 79.660000] stack backtrace:
[ 79.660000] [<c0014bd0>] (unwind_backtrace+0x0/0xf4) from [<c005f9c0>] (__lock_acquire+0x1948/0x1d48)
[ 79.660000] [<c005f9c0>] (__lock_acquire+0x1948/0x1d48) from [<c005fea0>] (lock_acquire+0xe0/0xf8)
[ 79.660000] [<c005fea0>] (lock_acquire+0xe0/0xf8) from [<c03a8460>] (_raw_spin_lock_irqsave+0x44/0x58)
[ 79.660000] [<c03a8460>] (_raw_spin_lock_irqsave+0x44/0x58) from [<c026ea3c>] (mxs_mmc_enable_sdio_irq+0x18/0xd4)
[ 79.660000] [<c026ea3c>] (mxs_mmc_enable_sdio_irq+0x18/0xd4) from [<c026f7fc>] (mxs_mmc_irq_handler+0xd4/0xe8)
[ 79.660000] [<c026f7fc>] (mxs_mmc_irq_handler+0xd4/0xe8) from [<c006bdd8>] (handle_irq_event_percpu+0x70/0x254)
[ 79.660000] [<c006bdd8>] (handle_irq_event_percpu+0x70/0x254) from [<c006bff8>] (handle_irq_event+0x3c/0x5c)
[ 79.660000] [<c006bff8>] (handle_irq_event+0x3c/0x5c) from [<c006e6d0>] (handle_level_irq+0x90/0x110)
[ 79.660000] [<c006e6d0>] (handle_level_irq+0x90/0x110) from [<c006b930>] (generic_handle_irq+0x38/0x50)
[ 79.660000] [<c006b930>] (generic_handle_irq+0x38/0x50) from [<c00102fc>] (handle_IRQ+0x30/0x84)
[ 79.660000] [<c00102fc>] (handle_IRQ+0x30/0x84) from [<c000f058>] (__irq_svc+0x38/0x60)
[ 79.660000] [<c000f058>] (__irq_svc+0x38/0x60) from [<c0010520>] (default_idle+0x2c/0x40)
[ 79.660000] [<c0010520>] (default_idle+0x2c/0x40) from [<c0010a90>] (cpu_idle+0x64/0xcc)
[ 79.660000] [<c0010a90>] (cpu_idle+0x64/0xcc) from [<c04ff858>] (start_kernel+0x244/0x2c8)
[ 79.660000] BUG: spinlock lockup on CPU#0, swapper/0
[ 79.660000] lock: c398cb2c, .magic: dead4ead, .owner: swapper/0, .owner_cpu: 0
[ 79.660000] [<c0014bd0>] (unwind_backtrace+0x0/0xf4) from [<c01ddb1c>] (do_raw_spin_lock+0xf0/0x144)
[ 79.660000] [<c01ddb1c>] (do_raw_spin_lock+0xf0/0x144) from [<c03a8468>] (_raw_spin_lock_irqsave+0x4c/0x58)
[ 79.660000] [<c03a8468>] (_raw_spin_lock_irqsave+0x4c/0x58) from [<c026ea3c>] (mxs_mmc_enable_sdio_irq+0x18/0xd4)
[ 79.660000] [<c026ea3c>] (mxs_mmc_enable_sdio_irq+0x18/0xd4) from [<c026f7fc>] (mxs_mmc_irq_handler+0xd4/0xe8)
[ 79.660000] [<c026f7fc>] (mxs_mmc_irq_handler+0xd4/0xe8) from [<c006bdd8>] (handle_irq_event_percpu+0x70/0x254)
[ 79.660000] [<c006bdd8>] (handle_irq_event_percpu+0x70/0x254) from [<c006bff8>] (handle_irq_event+0x3c/0x5c)
[ 79.660000] [<c006bff8>] (handle_irq_event+0x3c/0x5c) from [<c006e6d0>] (handle_level_irq+0x90/0x110)
[ 79.660000] [<c006e6d0>] (handle_level_irq+0x90/0x110) from [<c006b930>] (generic_handle_irq+0x38/0x50)
[ 79.660000] [<c006b930>] (generic_handle_irq+0x38/0x50) from [<c00102fc>] (handle_IRQ+0x30/0x84)
[ 79.660000] [<c00102fc>] (handle_IRQ+0x30/0x84) from [<c000f058>] (__irq_svc+0x38/0x60)
[ 79.660000] [<c000f058>] (__irq_svc+0x38/0x60) from [<c0010520>] (default_idle+0x2c/0x40)
[ 79.660000] [<c0010520>] (default_idle+0x2c/0x40) from [<c0010a90>] (cpu_idle+0x64/0xcc)
[ 79.660000] [<c0010a90>] (cpu_idle+0x64/0xcc) from [<c04ff858>] (start_kernel+0x244/0x2c8)--- drivers/mmc/host/mxs-mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/mxs-mmc.c +2 -2
@@ -278,11 +278,11 @@ static irqreturn_t mxs_mmc_irq_handler(iwritel (stat &MXS_MMC_IRQ_BITS , host->base +HW_SSP_CTRL1 (host) +STMP_OFFSET_REG_CLR ); +spin_unlock (&host->lock); +if ((stat &BM_SSP_CTRL1_SDIO_IRQ ) && (stat &BM_SSP_CTRL1_SDIO_IRQ_EN ))mmc_signal_sdio_irq (host->mmc); -spin_unlock (&host->lock); -if (stat &BM_SSP_CTRL1_RESP_TIMEOUT_IRQ ) cmd->error = -ETIMEDOUT ;else if (stat &BM_SSP_CTRL1_RESP_ERR_IRQ )
Greg Kroah-Hartman
maintainerPATCH 72/262 ACPI / PM: Use KERN_DEBUG when no power resources are found
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaron Lu <[email protected]>
commit f25b70613c048ceb1df052576fda03321ebf41cf upstream.
commit a606dac368eed5696fb38e16b1394f1d049c09e9 adds support to link devices which have _PRx, if a device does not have _PRx, a warning message will be printed.
This commit is for ZPODD on Intel ZPODD capable platforms, on other platforms, it has no problem if there is no power resource for this device, so a warning here is not appropriate, change it to debug.
--- drivers/acpi/power.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/power.c +1 -1
@@ -468,7 +468,7 @@ int acpi_power_resource_register_device(return ret; no_power_resource: - printk(KERN_WARNING PREFIX "Invalid Power Resource to register!"); + printk(KERN_DEBUG PREFIX "Invalid Power Resource to register!");return -ENODEV ; }
Greg Kroah-Hartman
maintainerPATCH 69/262 perf_event: Switch to internal refcount, fix race with close()
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <[email protected]>
commit a6fa941d94b411bbd2b6421ffbde6db3c93e65ab upstream.
Don't mess with file refcounts (or keep a reference to file, for that matter) in perf_event. Use explicit refcount of its own instead. Deal with the race between the final reference to event going away and new children getting created for it by use of atomic_long_inc_not_zero() in inherit_event(); just have the latter free what it had allocated and return NULL, that works out just fine (children of siblings of something doomed are created as singletons, same as if the child of leader had been created and immediately killed).
--- include/linux/perf_event.h | 2 - kernel/events/core.c | 62 +++++++++++++++++++++++---------------------- 2 files changed, 34 insertions(+), 30 deletions(-)
include/linux/perf_event.h +1 -1
@@ -925,7 +925,7 @@ struct perf_event {struct hw_perf_event hw;struct perf_event_context *ctx; -struct file *filp; +atomic_long_t refcount;/* * These accumulate total time (in nanoseconds) that children
kernel/events/core.c +33 -29
160 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 67/262 fs/proc: fix potential unregister_sysctl_table hang
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Francesco Ruggeri <[email protected]>
commit 6bf6104573482570f7103d3e5ddf9574db43a363 upstream.
The unregister_sysctl_table() function hangs if all references to its ctl_table_header structure are not dropped.
This can happen sometimes because of a leak in proc_sys_lookup():proc_sys_lookup() gets a reference to the table via lookup_entry(), but it does not release it when a subsequent call to sysctl_follow_link() fails.
This patch fixes this leak by making sure the reference is always dropped on return.
See also commit 076c3eed2c31 ("sysctl: Rewrite proc_sys_lookup introducing find_entry and lookup_entry") which reorganized this code in 3.4.
Tested in Linux 3.4.4.
--- fs/proc/proc_sysctl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
fs/proc/proc_sysctl.c +2 -3
@@ -462,9 +462,6 @@ static struct dentry *proc_sys_lookup(st err =ERR_PTR (-ENOMEM ); inode =proc_sys_make_inode (dir->i_sb, h ? h : head, p); -if (h) -sysctl_head_finish (h); -if (!inode) goto out;
@@ -473,6 +470,8 @@ static struct dentry *proc_sys_lookup(std_add (dentry, inode); out: +if (h) +sysctl_head_finish (h);sysctl_head_finish (head);return err; }
Greg Kroah-Hartman
maintainerPATCH 58/262 ALSA: hda - Workaround for silent output on VAIO Z with ALC889
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit e427c2375646789ecd0ccaef1a1e41458559ab2d upstream.
On recent kernels, Realtek codec parser tries to optimize the routing aggressively and take the headphone output as primary at first. This caused a regression on VAIO Z with ALC889, the silent output from the speaker.
The problem seems that the speaker pin must be connected to the first DAC (0x02) on this machine by some reason although the codec itself advertises the flexible routing with any DACs.
This patch adds a fix-up for choosing the speaker pin as the primary so that the right DAC is assigned on this device.
---
--- Documentation/sound/alsa/HD-Audio-Models.txt | 1 + sound/pci/hda/patch_realtek.c | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-)
Documentation/sound/alsa/HD-Audio-Models.txt +1 -0
@@ -47,6 +47,7 @@ ALC882/883/885/888/889 acer-aspire-4930g Acer Aspire 4930G/5930G/6530G/6930G/7730G acer-aspire-8930g Acer Aspire 8330G/6935G acer-aspire Acer Aspire others + no-primary-hp VAIO Z workaround (for fixed speaker DAC) ALC861/660 ==========
sound/pci/hda/patch_realtek.c +21 -1
@@ -201,6 +201,7 @@ struct alc_spec { unsigned int vol_in_capsrc:1; /* use capsrc volume (ADC has no vol) */unsigned int parse_flags;/* passed to snd_hda_parse_pin_defcfg() */ unsigned int shared_mic_hp:1; /* HP/Mic-in sharing */ + unsigned int no_primary_hp:1; /* Don't prefer HP pins to speaker pins *//* auto-mute control */ int automute_mode;
@@ -4182,7 +4183,8 @@ static int alc_parse_auto_config(structreturn 0 ;/* can't find valid BIOS pin config */ } -if (cfg->line_out_type ==AUTO_PIN_SPEAKER_OUT && +if (!spec->no_primary_hp && + cfg->line_out_type ==AUTO_PIN_SPEAKER_OUT && cfg->line_outs <= cfg->hp_outs) {/* use HP as primary out */ cfg->speaker_outs = cfg->line_outs;
@@ -4909,6 +4911,7 @@ enum {ALC889_FIXUP_DAC_ROUTE ,ALC889_FIXUP_MBP_VREF ,ALC889_FIXUP_IMAC91_VREF , + ALC882_FIXUP_NO_PRIMARY_HP, }; static void alc889_fixup_coef(struct hda_codec *codec,
@@ -5030,6 +5033,17 @@ static void alc889_fixup_imac91_vref(str spec->keep_vref_in_automute =1 ; } +/* Don't take HP output as primary +* strangely, the speaker output doesn't work on VAIO Z through DAC 0x05 +*/ +static void alc882_fixup_no_primary_hp (struct hda_codec *codec, +const struct alc_fixup *fix,int action) +{ +struct alc_spec *spec = codec->spec; +if (action ==ALC_FIXUP_ACT_PRE_PROBE ) + spec->no_primary_hp =1 ; +} +static const struct alc_fixup alc882_fixups[] = { [ALC882_FIXUP_ABIT_AW9D_MAX ] = { .type =ALC_FIXUP_PINS ,
@@ -5212,6 +5226,10 @@ static const struct alc_fixup alc882_fix .chained = true, .chain_id = ALC882_FIXUP_GPIO1, }, + [ALC882_FIXUP_NO_PRIMARY_HP] = { + .type = ALC_FIXUP_FUNC, + .v.func = alc882_fixup_no_primary_hp, + }, }; static const struct snd_pci_quirk alc882_fixup_tbl[] = {
@@ -5246,6 +5264,7 @@ static const struct snd_pci_quirk alc882SND_PCI_QUIRK (0x1043 ,0x1971 ,"Asus W2JC" ,ALC882_FIXUP_ASUS_W2JC ),SND_PCI_QUIRK (0x1043 ,0x835f ,"Asus Eee 1601" ,ALC888_FIXUP_EEE1601 ),SND_PCI_QUIRK (0x104d ,0x9047 ,"Sony Vaio TT" ,ALC889_FIXUP_VAIO_TT ), +SND_PCI_QUIRK (0x104d ,0x905a ,"Sony Vaio Z" ,ALC882_FIXUP_NO_PRIMARY_HP ),/* All Apple entries are in codec SSIDs */ SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
@@ -5286,6 +5305,7 @@ static const struct alc_model_fixup alc8 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"}, {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"}, {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"}, + {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"}, {} };
Greg Kroah-Hartman
maintainerPATCH 64/262 staging: comedi: das08: Correct AO output for das08jr-16-ao
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Abbott <[email protected]>
commit 61ed59ed09e6ad2b8395178ea5ad5f653bba08e3 upstream.
Don't zero out bits 15..12 of the data value in das08jr_ao_winsn() as that knobbles the upper three-quarters of the output range for the 'das08jr-16-ao' board.
--- drivers/staging/comedi/drivers/das08.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/drivers/das08.c +1 -1
@@ -678,7 +678,7 @@ static int das08jr_ao_winsn(struct comedint chan; lsb = data[0 ] &0xff ; - msb = (data[0 ] >>8 ) &0xf ; + msb = (data[0 ] >>8 ) &0xff ; chan =CR_CHAN (insn->chanspec);
Greg Kroah-Hartman
maintainerPATCH 62/262 staging: r8712u: fix bug in r8712_recv_indicatepkt()
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
commit abf02cfc179bb4bd30d05f582d61b3b8f429b813 upstream.
64bit arches have a buggy r8712u driver, let's fix it.
skb->tail must be set properly or network stack behavior is undefined.
Addresses https://bugzilla.redhat.com/show_bug.cgi?id=847525
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=45071
--- drivers/staging/rtl8712/recv_linux.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/staging/rtl8712/recv_linux.c +1 -6
@@ -117,13 +117,8 @@ void r8712_recv_indicatepkt(struct _adapif (skb ==NULL ) goto _recv_indicatepkt_drop; skb->data = precv_frame->u.hdr.rx_data; -#ifdef NET_SKBUFF_DATA_USES_OFFSET - skb->tail = (sk_buff_data_t)(precv_frame->u.hdr.rx_tail - - precv_frame->u.hdr.rx_head); -#else - skb->tail = (sk_buff_data_t )precv_frame->u.hdr.rx_tail; -#endif skb->len = precv_frame->u.hdr.len; +skb_set_tail_pointer (skb, skb->len);if ((pattrib->tcpchk_valid ==1 ) && (pattrib->tcp_chkrpt ==1 )) skb->ip_summed =CHECKSUM_UNNECESSARY ;else
Greg Kroah-Hartman
maintainerPATCH 60/262 staging: zcache: fix cleancache race condition with shrinker
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Seth Jennings <[email protected]>
commit 6d7d9798ad5c97ee4e911dd070dc12dc5ae55bd0 upstream.
This patch fixes a race condition that results in memory corruption when using cleancache.
The race exists between the zcache shrinker handler, shrink_zcache_memory() and cleancache_get_page().
In most cases, the shrinker will both evict a zbpg from its buddy list and flush it from tmem before a cleancache_get_page() occurs on that page. A subsequent cleancache_get_page() will fail in the tmem layer.
In the rare case that two occur together and the cleancache_get_page() path gets through the tmem layer before the shrinker path can flush tmem, zbud_decompress() does a check to see if the zbpg is a "zombie", i.e. not on a buddy list, which means the shrinker is in the process of reclaiming it. If the zbpg is a zombie, zbud_decompress() returns -EINVAL.
However, this return code is being ignored by the caller, zcache_pampd_get_data_and_free(), which results in the caller of cleancache_get_page() thinking that the page has been properly retrieved when it has not.
This patch modifies zcache_pampd_get_data_and_free() to convey the failure up the stack so that the caller of cleancache_get_page() knows the page retrieval failed.
This needs to be applied to stable trees as well. zcache-main.c was named zcache.c before v3.1, so I'm not sure how you want to handle trees earlier than that.
--- drivers/staging/zcache/zcache-main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/staging/zcache/zcache-main.c +3 -4
@@ -1259,13 +1259,12 @@ static int zcache_pampd_get_data_and_fre void *pampd, struct tmem_pool *pool, struct tmem_oid *oid, uint32_t index) { - int ret = 0; - BUG_ON(!is_ephemeral(pool)); -zbud_decompress ((struct page *)(data), pampd); +if (zbud_decompress ((struct page *)(data), pampd) <0 ) +return -EINVAL ;zbud_free_and_delist ((struct zbud_hdr *)pampd);atomic_dec (&zcache_curr_eph_pampd_count); -return ret; +return 0 ; }/*
Greg Kroah-Hartman
maintainerPATCH 57/262 ALSA: ice1724: Use linear scale for AK4396 volume control.
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matteo Frigo <[email protected]>
commit 3737e2be505d872bf2b3c1cd4151b2d2b413d7b5 upstream.
The AK4396 DAC has a linear-scale attentuator, but sound/pci/ice1712/prodigy_hifi.c used a log scale instead, which is not quite right. This patch restores the correct scale, borrowing from the ak4396 code in sound/pci/oxygen/oxygen.c.
--- sound/pci/ice1712/prodigy_hifi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/pci/ice1712/prodigy_hifi.c +2 -1
@@ -297,6 +297,7 @@ static int ak4396_dac_vol_put(struct snd } static const DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1); +static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0);static struct snd_kcontrol_new prodigy_hd2_controls[]__devinitdata = { {
@@ -307,7 +308,7 @@ static struct snd_kcontrol_new prodigy_h .info = ak4396_dac_vol_info, .get = ak4396_dac_vol_get, .put = ak4396_dac_vol_put, - .tlv = { .p = db_scale_wm_dac }, + .tlv = { .p = ak4396_db_scale }, }, };
Greg Kroah-Hartman
maintainerPATCH 56/262 ALSA: hda - Fix Oops at codec reset/reconfig
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 07dc59f0988cb54fd87bd373b3b27eb2401dd811 upstream.
snd_hda_codec_reset() calls restore_pincfgs() where the codec is powered up again, which eventually tries to resume and initialize via the callbacks of the codec. However, it's the place just after codec free callback, thus no codec callbacks should be called after that. On a codec like CS4206, it results in Oops due to the access in init callback.
This patch fixes the issue by clearing the codec callbacks properly after freeing codec.
--- sound/pci/hda/hda_codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_codec.c +1 -1
@@ -2325,6 +2325,7 @@ int snd_hda_codec_reset(struct hda_codec }if (codec->patch_ops.free) codec->patch_ops.free (codec); +memset (&codec->patch_ops,0 ,sizeof (codec->patch_ops));snd_hda_jack_tbl_clear (codec); codec->proc_widget_hook =NULL ; codec->spec =NULL ;
@@ -2340,7 +2341,6 @@ int snd_hda_codec_reset(struct hda_codec codec->num_pcms =0 ; codec->pcm_info =NULL ; codec->preset =NULL ; -memset (&codec->patch_ops,0 ,sizeof (codec->patch_ops)); codec->slave_dig_outs =NULL ; codec->spdif_status_reset =0 ;module_put (codec->owner);
Greg Kroah-Hartman
maintainerPATCH 54/262 ALSA: hda - Fix missing Master volume for STAC9200/925x
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit ab548d2dba63ba947287965e525cc02a15d9853d upstream.
With the commit [2faa3bf: ALSA: hda - Rewrite the mute-LED hook with vmaster hook in patch_sigmatel.c], the former Master volume control was converted to PCM. This was supposed to be covered by the vmaster control. But due to the lack of "PCM" slave definition, this didn't happen properly. The patch fixes the missing entry.
--- sound/pci/hda/patch_sigmatel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/patch_sigmatel.c +1 -1
@@ -1075,7 +1075,7 @@ static struct snd_kcontrol_new stac_smuxstatic const char *const slave_pfxs[] = {"Front" ,"Surround" ,"Center" ,"LFE" ,"Side" , -"Headphone" ,"Speaker" ,"IEC958" , +"Headphone" ,"Speaker" ,"IEC958" ,"PCM" ,NULL };
Greg Kroah-Hartman
maintainerPATCH 52/262 ARM: clk-imx35: Fix SSI clock registration
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fabio Estevam <[email protected]>
commit 48540058612786d365602f3324ed97f9071092de upstream.
SSI block has two types of clock:
ipg: bus clock, the clock needed for accessing registers.
per: peripheral clock, the clock needed for generating the bit rate.
Currently SSI driver only supports slave mode and only need to handle the ipg clock, because the peripheral clock comes from the master codec.
Only register the ipg clock and do not register the peripheral clock for ssi.
--- arch/arm/mach-imx/clk-imx35.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
arch/arm/mach-imx/clk-imx35.c +2 -4
@@ -230,10 +230,8 @@ int __init mx35_clocks_init()clk_register_clkdev (clk[ipu_gate],NULL ,"mx3_sdc_fb" );clk_register_clkdev (clk[owire_gate],NULL ,"mxc_w1" );clk_register_clkdev (clk[sdma_gate],NULL ,"imx35-sdma" ); -clk_register_clkdev (clk[ipg],"ipg" ,"imx-ssi.0" ); -clk_register_clkdev (clk[ssi1_div_post],"per" ,"imx-ssi.0" ); -clk_register_clkdev (clk[ipg],"ipg" ,"imx-ssi.1" ); -clk_register_clkdev (clk[ssi2_div_post],"per" ,"imx-ssi.1" ); +clk_register_clkdev (clk[ssi1_gate],NULL ,"imx-ssi.0" ); +clk_register_clkdev (clk[ssi2_gate],NULL ,"imx-ssi.1" );/* i.mx35 has the i.mx21 type uart */ clk_register_clkdev (clk[uart1_gate],"per" ,"imx21-uart.0" );clk_register_clkdev (clk[ipg],"ipg" ,"imx21-uart.0" );
Greg Kroah-Hartman
maintainerPATCH 50/262 ARM: OMAP: timer: obey the !CONFIG_OMAP_32K_TIMER
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Igor Grinberg <[email protected]>
commit 45caae74d238ef6583e9402cb8c550cc0b0f7dbd upstream.
Currently, omap2_sync32k_clocksource_init() function initializes the 32K timer as the system clock source regardless of the CONFIG_OMAP_32K_TIMER setting.
Fix this by providing a default implementation for !CONFIG_OMAP_32K_TIMER case.
--- arch/arm/mach-omap2/timer.c | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm/mach-omap2/timer.c +7 -0
@@ -263,6 +263,7 @@ static u32 notrace dmtimer_read_sched_clreturn 0 ; } +#ifdef CONFIG_OMAP_32K_TIMER /* Setup free-running counter for clocksource */ static int __init omap2_sync32k_clocksource_init (void ) {
@@ -302,6 +303,12 @@ static int __init omap2_sync32k_clocksou return ret; } +#else +static inline int omap2_sync32k_clocksource_init (void ) +{ +return -ENODEV ; +} +#endif static void __init omap2_gptimer_clocksource_init (int gptimer_id,const char *fck_source)
Greg Kroah-Hartman
maintainerPATCH 48/262 ARM: 7527/1: uaccess: explicitly check __user pointer when !CPU_USE_DOMAINS
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Russell King <[email protected]>
commit 8404663f81d212918ff85f493649a7991209fa04 upstream.
The {get,put}_user macros don't perform range checking on the provided __user address when !CPU_HAS_DOMAINS.
This patch reworks the out-of-line assembly accessors to check the user address against a specified limit, returning -EFAULT if is is out of range.
[will: changed get_user register allocation to match put_user] [rmk: fixed building on older ARM architectures]
--- arch/arm/include/asm/assembler.h | 8 +++++++ arch/arm/include/asm/uaccess.h | 40 ++++++++++++++++++++++++++------------- arch/arm/lib/getuser.S | 23 ++++++++++++++-------- arch/arm/lib/putuser.S | 6 +++++ 4 files changed, 56 insertions(+), 21 deletions(-)
arch/arm/include/asm/assembler.h +8 -0
@@ -320,4 +320,12 @@ .size \name , . - \name .endm + .macro check_uaccess, addr:req, size:req, limit:req, tmp:req, bad:req +#ifndef CONFIG_CPU_USE_DOMAINS + adds \tmp, \addr, #\size - 1 + sbcccs \tmp, \tmp, \limit + bcs \bad +#endif + .endm + #endif /* __ASM_ASSEMBLER_H__ */
arch/arm/include/asm/uaccess.h +27 -13
@@ -101,28 +101,39 @@ extern int __get_user_1(void *);extern int __get_user_2 (void *);extern int __get_user_4 (void *); -#define __get_user_x(__r2,__p,__e,__s,__i...) \ +#define __GUP_CLOBBER_1 "lr", "cc" +#ifdef CONFIG_CPU_USE_DOMAINS +#define __GUP_CLOBBER_2 "ip", "lr", "cc" +#else +#define __GUP_CLOBBER_2 "lr", "cc" +#endif +#define __GUP_CLOBBER_4 "lr", "cc" + +#define __get_user_x (__r2,__p,__e,__l,__s) \ __asm__ __volatile__ ( \ __asmeq("%0", "r0") __asmeq("%1", "r2") \ + __asmeq("%3", "r1") \ "bl __get_user_" #__s \ : "=&r" (__e), "=r" (__r2) \ - : "0" (__p) \ - : __i, "cc") + : "0" (__p), "r" (__l) \ + : __GUP_CLOBBER_##__s)#define get_user (x,p) \ ({ \ + unsigned long __limit = current_thread_info()->addr_limit - 1; \ register const typeof(*(p)) __user *__p asm("r0") = (p);\ register unsigned long __r2 asm("r2"); \ + register unsigned long __l asm("r1") = __limit; \ register int __e asm("r0"); \ switch (sizeof(*(__p))) { \ case 1: \ - __get_user_x(__r2, __p, __e, 1, "lr"); \ - break; \ + __get_user_x(__r2, __p, __e, __l, 1); \ + break; \ case 2: \ - __get_user_x(__r2, __p, __e, 2, "r3", "lr"); \ + __get_user_x(__r2, __p, __e, __l, 2); \ break; \ case 4: \ - __get_user_x(__r2, __p, __e, 4, "lr"); \ + __get_user_x(__r2, __p, __e, __l, 4); \ break; \ default: __e = __get_user_bad(); break; \ } \
@@ -135,31 +146,34 @@ extern int __put_user_2(void *, unsignedextern int __put_user_4 (void *,unsigned int );extern int __put_user_8 (void *,unsigned long long ); -#define __put_user_x (__r2,__p,__e,__s) \ +#define __put_user_x (__r2,__p,__e,__l,__s) \ __asm__ __volatile__ ( \ __asmeq("%0", "r0") __asmeq("%2", "r2") \ + __asmeq("%3", "r1") \ "bl __put_user_" #__s \ : "=&r" (__e) \ - : "0" (__p), "r" (__r2) \ + : "0" (__p), "r" (__r2), "r" (__l) \ : "ip", "lr", "cc")#define put_user (x,p) \ ({ \ + unsigned long __limit = current_thread_info()->addr_limit - 1; \ register const typeof(*(p)) __r2 asm("r2") = (x); \ register const typeof(*(p)) __user *__p asm("r0") = (p);\ + register unsigned long __l asm("r1") = __limit; \ register int __e asm("r0"); \ switch (sizeof(*(__p))) { \ case 1: \ - __put_user_x(__r2, __p, __e, 1); \ + __put_user_x(__r2, __p, __e, __l, 1); \ break; \ case 2: \ - __put_user_x(__r2, __p, __e, 2); \ + __put_user_x(__r2, __p, __e, __l, 2); \ break; \ case 4: \ - __put_user_x(__r2, __p, __e, 4); \ + __put_user_x(__r2, __p, __e, __l, 4); \ break; \ case 8: \ - __put_user_x(__r2, __p, __e, 8); \ + __put_user_x(__r2, __p, __e, __l, 8); \ break; \ default: __e = __put_user_bad(); break; \ } \
arch/arm/lib/getuser.S +15 -8
@@ -16,8 +16,9 @@ * __get_user_X * * Inputs: r0 contains the address + * r1 contains the address limit, which must be preserved * Outputs: r0 is the error code - * r2, r3 contains the zero-extended value + * r2 contains the zero-extended value * lr corrupted * * No other registers must be altered. (see <asm/uaccess.h>
@@ -27,33 +28,39 @@ * Note also that it is intended that __get_user_bad is not global. */ #include <linux/linkage.h> +#include <asm/assembler.h> #include <asm/errno.h> #include <asm/domain.h> ENTRY(__get_user_1) + check_uaccess r0, 1, r1, r2, __get_user_bad 1: TUSER(ldrb) r2, [r0] mov r0, #0 mov pc, lr ENDPROC(__get_user_1) ENTRY(__get_user_2) -#ifdef CONFIG_THUMB2_KERNEL -2: TUSER(ldrb) r2, [r0] -3: TUSER(ldrb) r3, [r0, #1] + check_uaccess r0, 2, r1, r2, __get_user_bad +#ifdef CONFIG_CPU_USE_DOMAINS +rb .req ip +2: ldrbt r2, [r0], #1 +3: ldrbt rb, [r0], #0 #else -2: TUSER(ldrb) r2, [r0], #1 -3: TUSER(ldrb) r3, [r0] +rb .req r0 +2: ldrb r2, [r0] +3: ldrb rb, [r0, #1] #endif #ifndef __ARMEB__ - orr r2, r2, r3, lsl #8 + orr r2, r2, rb, lsl #8 #else - orr r2, r3, r2, lsl #8 + orr r2, rb, r2, lsl #8 #endif mov r0, #0 mov pc, lr ENDPROC(__get_user_2) ENTRY(__get_user_4) + check_uaccess r0, 4, r1, r2, __get_user_bad 4: TUSER(ldr) r2, [r0] mov r0, #0 mov pc, lr
arch/arm/lib/putuser.S +6 -0
@@ -16,6 +16,7 @@ * __put_user_X * * Inputs: r0 contains the address + * r1 contains the address limit, which must be preserved * r2, r3 contains the value * Outputs: r0 is the error code * lr corrupted
@@ -27,16 +28,19 @@ * Note also that it is intended that __put_user_bad is not global. */ #include <linux/linkage.h> +#include <asm/assembler.h> #include <asm/errno.h> #include <asm/domain.h> ENTRY(__put_user_1) + check_uaccess r0, 1, r1, ip, __put_user_bad 1: TUSER(strb) r2, [r0] mov r0, #0 mov pc, lr ENDPROC(__put_user_1) ENTRY(__put_user_2) + check_uaccess r0, 2, r1, ip, __put_user_bad mov ip, r2, lsr #8 #ifdef CONFIG_THUMB2_KERNEL #ifndef __ARMEB__
@@ -60,12 +64,14 @@ ENTRY(__put_user_2) ENDPROC(__put_user_2) ENTRY(__put_user_4) + check_uaccess r0, 4, r1, ip, __put_user_bad 4: TUSER(str) r2, [r0] mov r0, #0 mov pc, lr ENDPROC(__put_user_4) ENTRY(__put_user_8) + check_uaccess r0, 8, r1, ip, __put_user_bad #ifdef CONFIG_THUMB2_KERNEL 5: TUSER(str) r2, [r0] 6: TUSER(str) r3, [r0, #4]
Greg Kroah-Hartman
maintainerPATCH 46/262 ARM: 7513/1: Make sure dtc is built before running it
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Brown <[email protected]>
commit 70b0476a2394de4f4e32e0b67288d80ff71ca963 upstream.
'make dtbs' in a clean tree will try running the dtc before actually building it. Make these rules depend upon the scripts to build it.
--- arch/arm/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/Makefile +2 -2
@@ -279,10 +279,10 @@ zImage Image xipImage bootpImage uImage: zinstall uinstall install: vmlinux $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ -%.dtb: +%.dtb: scripts $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ -dtbs: +dtbs: scripts $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ # We use MRPROPER_FILES and CLEAN_FILES now
Greg Kroah-Hartman
maintainerPATCH 44/262 ARM: 7496/1: hw_breakpoint: dont rely on dfsr to show watchpoint access type
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <[email protected]>
commit bf8801145c01ab600f8df66e8c879ac642fa5846 upstream.
Quoted 1 line
From ARM debug architecture v7.1 onwards, a watchpoint exception causes
the DFAR to be updated with the faulting data address. However, DFSR.WnR takes an UNKNOWN value and therefore cannot be used in general to determine the access type that triggered the watchpoint.
This patch forbids watchpoints without an overflow handler from specifying a specific access type (load/store). Those with overflow handlers must be able to handle false positives potentially triggered by a watchpoint of a different access type on the same address. For SIGTRAP-based handlers (i.e. ptrace), this should have no impact.
--- arch/arm/kernel/hw_breakpoint.c | 55 +++++++++++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 15 deletions(-)
arch/arm/kernel/hw_breakpoint.c +40 -15
@@ -159,6 +159,12 @@ static int debug_arch_supported(void) arch >=ARM_DEBUG_ARCH_V7_1 ; } +/* Can we determine the watchpoint access type from the fsr? */ +static int debug_exception_updates_fsr (void ) +{ +return 0 ; +} +/* Determine number of WRP registers available. */ static int get_num_wrp_resources (void ) {
@@ -619,18 +625,35 @@ int arch_validate_hwbkpt_settings(struct info->address &= ~alignment_mask; info->ctrl.len <<= offset; -/* -* Currently we rely on an overflow handler to take -* care of single-stepping the breakpoint when it fires. -* In the case of userspace breakpoints on a core with V7 debug, -* we can use the mismatch feature as a poor-man's hardware -* single-step, but this only works for per-task breakpoints. -*/ -if (!bp->overflow_handler && (arch_check_bp_in_kernelspace (bp) || - !core_has_mismatch_brps () || !bp->hw.bp_target)) { -pr_warning ("overflow handler required but none found\n" ); - ret = -EINVAL ; +if (!bp->overflow_handler) { +/* +* Mismatch breakpoints are required for single-stepping +* breakpoints. +*/ +if (!core_has_mismatch_brps ()) +return -EINVAL ; + +/* We don't allow mismatch breakpoints in kernel space. */ +if (arch_check_bp_in_kernelspace (bp)) +return -EPERM ; + +/* +* Per-cpu breakpoints are not supported by our stepping +* mechanism. +*/ +if (!bp->hw.bp_target) +return -EINVAL ; + +/* +* We only support specific access types if the fsr +* reports them. +*/ +if (!debug_exception_updates_fsr () && + (info->ctrl.type ==ARM_BREAKPOINT_LOAD || + info->ctrl.type ==ARM_BREAKPOINT_STORE )) +return -EINVAL ; } + out:return ret; }
@@ -706,10 +729,12 @@ static void watchpoint_handler(unsigned goto unlock;/* Check that the access type matches. */ - access = (fsr &ARM_FSR_ACCESS_MASK ) ?HW_BREAKPOINT_W : -HW_BREAKPOINT_R ; -if (!(access &hw_breakpoint_type (wp))) - goto unlock; +if (debug_exception_updates_fsr ()) { + access = (fsr &ARM_FSR_ACCESS_MASK ) ? +HW_BREAKPOINT_W :HW_BREAKPOINT_R ; +if (!(access &hw_breakpoint_type (wp))) + goto unlock; + }/* We have a winner. */ info->trigger = addr;
Greg Kroah-Hartman
maintainerPATCH 43/262 target: simplify code around transport_get_sense_data
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paolo Bonzini <[email protected]>
commit 27a2709912ac19c755d34c79fe11994b0bf8082b upstream.
The error conditions in transport_get_sense_data are superfluous and complicate the code unnecessarily:
* SCF_TRANSPORT_TASK_SENSE is checked in the caller;
* it's simply part of the invariants of dev->transport->get_sense_buffer that it must be there if transport_complete ever returns 1, and that it must not return NULL. Besides, the entire callback will disappear with the next patch.
* similarly in the caller we can expect that sense data is only sent for non-zero cmd->scsi_status.
--- drivers/target/target_core_transport.c | 49 ++++++++------------------------- 1 file changed, 13 insertions(+), 36 deletions(-)
drivers/target/target_core_transport.c +13 -36
@@ -2261,7 +2261,7 @@ out:/* * Used to obtain Sense Data from underlying Linux/SCSI struct scsi_cmnd */ -static int transport_get_sense_data (struct se_cmd *cmd) +static void transport_get_sense_data (struct se_cmd *cmd) {unsigned char *buffer = cmd->sense_buffer, *sense_buffer =NULL ;struct se_device *dev = cmd->se_dev;
@@ -2271,30 +2271,15 @@ static int transport_get_sense_data(struWARN_ON (!cmd->se_lun);if (!dev) -return 0 ; +return ;spin_lock_irqsave (&cmd->t_state_lock, flags);if (cmd->se_cmd_flags &SCF_SENT_CHECK_CONDITION ) {spin_unlock_irqrestore (&cmd->t_state_lock, flags); -return 0 ; - } - -if (!(cmd->se_cmd_flags &SCF_TRANSPORT_TASK_SENSE )) - goto out; - -if (!dev->transport->get_sense_buffer) { -pr_err ("dev->transport->get_sense_buffer is NULL\n" ); - goto out; +return ; } sense_buffer = dev->transport->get_sense_buffer (cmd); -if (!sense_buffer) { -pr_err ("ITT 0x%08x cmd %p: Unable to locate" -" sense buffer for task with sense\n" , - cmd->se_tfo->get_task_tag (cmd), cmd); - goto out; - } -spin_unlock_irqrestore (&cmd->t_state_lock, flags); offset = cmd->se_tfo->set_fabric_sense_len (cmd,TRANSPORT_SENSE_BUFFER );
@@ -2306,11 +2291,6 @@ static int transport_get_sense_data(strupr_debug ("HBA_[%u]_PLUG[%s]: Set SAM STATUS: 0x%02x and sense\n" , dev->se_hba->hba_id, dev->transport->name, cmd->scsi_status); -return 0 ; - -out: -spin_unlock_irqrestore (&cmd->t_state_lock, flags); -return -1 ; }static inline long long transport_dev_end_lba (struct se_device *dev)
@@ -3171,7 +3151,7 @@ static void transport_handle_queue_full(static void target_complete_ok_work (struct work_struct *work) { struct se_cmd *cmd = container_of(work, struct se_cmd, work); -int reason =0 , ret; +int ret;/* * Check if we need to move delayed/dormant tasks from cmds on the
@@ -3192,19 +3172,16 @@ static void target_complete_ok_work(stru* the struct se_cmd in question. */ if (cmd->se_cmd_flags &SCF_TRANSPORT_TASK_SENSE ) { -if (transport_get_sense_data (cmd) <0 ) - reason =TCM_NON_EXISTENT_LUN ; +WARN_ON (!cmd->scsi_status); +transport_get_sense_data (cmd); + ret =transport_send_check_condition_and_sense ( + cmd,0 ,1 ); +if (ret == -EAGAIN || ret == -ENOMEM ) + goto queue_full; -if (cmd->scsi_status) { - ret =transport_send_check_condition_and_sense ( - cmd, reason,1 ); -if (ret == -EAGAIN || ret == -ENOMEM ) - goto queue_full; - -transport_lun_remove_cmd (cmd); -transport_cmd_check_stop_to_fabric (cmd); -return ; - } +transport_lun_remove_cmd (cmd); +transport_cmd_check_stop_to_fabric (cmd); +return ; }/* * Check for a callback, used by amongst other things
Greg Kroah-Hartman
maintainerPATCH 40/262 netconsole: remove a redundant netconsole_target_put()
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amerigo Wang <[email protected]>
commit 72d3eb13b5c0abe7d63efac41f39c5b644c7bbaa upstream.
This netconsole_target_put() is obviously redundant, and it causes a kernel segfault when removing a bridge device which has netconsole running on it.
This is caused by:
commit 8d8fc29d02a33e4bd5f4fa47823c1fd386346093 Author: Amerigo Wang <[email protected]> Date: Thu May 19 21:39:10 2011 +0000 netpoll: disable netpoll when enslave a device
--- drivers/net/netconsole.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/netconsole.c +0 -1
@@ -648,7 +648,6 @@ static int netconsole_netdev_event(struc flags);dev_put (nt->np.dev); nt->np.dev =NULL ; -netconsole_target_put (nt); } nt->enabled =0 ; stopped = true;
Greg Kroah-Hartman
maintainerPATCH 38/262 vfs: make O_PATH file descriptors usable for fstat()
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
commit 55815f70147dcfa3ead5738fd56d3574e2e3c1c2 upstream.
We already use them for openat() and friends, but fstat() also wants to be able to use O_PATH file descriptors. This should make it more directly comparable to the O_SEARCH of Solaris.
Note that you could already do the same thing with "fstatat()" and an empty path, but just doing "fstat()" directly is simpler and faster, so there is no reason not to just allow it directly.
See also commit 332a2e1244bd, which did the same thing for fchdir, for the same reasons.
--- fs/stat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/stat.c +1 -1
@@ -58,7 +58,7 @@ EXPORT_SYMBOL(vfs_getattr);int vfs_fstat (unsigned int fd,struct kstat *stat) {int fput_needed; -struct file *f =fget_light (fd, &fput_needed); +struct file *f =fget_raw_light (fd, &fput_needed);int error = -EBADF ;if (f) {
Greg Kroah-Hartman
maintainerPATCH 36/262 cpufreq/powernow-k8: workqueue user shouldnt migrate the kworker to another CPU
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <[email protected]>
commit 6889125b8b4e09c5e53e6ecab3433bed1ce198c9 upstream.
powernowk8_target() runs off a per-cpu work item and if the cpufreq_policy->cpu is different from the current one, it migrates the kworker to the target CPU by manipulating current->cpus_allowed. The function migrates the kworker back to the original CPU but this is still broken. Workqueue concurrency management requires the kworkers to stay on the same CPU and powernowk8_target() ends up triggerring BUG_ON(rq != this_rq()) in try_to_wake_up_local() if it contends on fidvid_mutex and sleeps.
It is unclear why this bug is being reported now. Duncan says it appeared to be a regression of 3.6-rc1 and couldn't reproduce it on 3.5. Bisection seemed to point to 63d95a91 "workqueue: use @pool instead of @gcwq or @cpu where applicable" which is an non-functional change. Given that the reproduce case sometimes took upto days to trigger, it's easy to be misled while bisecting. Maybe something made contention on fidvid_mutex more likely? I don't know.
This patch fixes the bug by using work_on_cpu() instead if @pol->cpu isn't the same as the current one. The code assumes that cpufreq_policy->cpu is kept online by the caller, which Rafael tells me is the case.
stable: ed48ece27c ("workqueue: reimplement work_on_cpu() using
system_wq") should be applied before this; otherwise, the behavior could be horrible.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=47301
--- drivers/cpufreq/powernow-k8.c | 63 ++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 29 deletions(-)
drivers/cpufreq/powernow-k8.c +34 -29
@@ -35,7 +35,6 @@#include <linux/slab.h> #include <linux/string.h> #include <linux/cpumask.h> -#include <linux/sched.h> /* for current / set_cpus_allowed() */ #include <linux/io.h> #include <linux/delay.h>
@@ -1139,16 +1138,23 @@ static int transition_frequency_pstate(sreturn res; } -/* Driver entry point to switch to the target frequency */ -static int powernowk8_target (struct cpufreq_policy *pol, -unsigned targfreq,unsigned relation) +struct powernowk8_target_arg { +struct cpufreq_policy *pol; +unsigned targfreq; +unsigned relation; +}; + +static long powernowk8_target_fn (void *arg) { -cpumask_var_t oldmask; +struct powernowk8_target_arg *pta = arg; +struct cpufreq_policy *pol = pta->pol; +unsigned targfreq = pta->targfreq; +unsigned relation = pta->relation;struct powernow_k8_data *data =per_cpu (powernow_data, pol->cpu);u32 checkfid;u32 checkvid;unsigned int newstate; -int ret = -EIO ; +int ret;if (!data)return -EINVAL ;
@@ -1156,29 +1162,16 @@ static int powernowk8_target(struct cpuf checkfid = data->currfid; checkvid = data->currvid; -/* only run on specific CPU from here on. */ -/* This is poor form: use a workqueue or smp_call_function_single */ -if (!alloc_cpumask_var (&oldmask,GFP_KERNEL )) -return -ENOMEM ; - -cpumask_copy (oldmask,tsk_cpus_allowed (current)); -set_cpus_allowed_ptr (current,cpumask_of (pol->cpu)); - -if (smp_processor_id () != pol->cpu) { - printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu); - goto err_out; - } -if (pending_bit_stuck ()) { printk(KERN_ERR PFX "failing targ, change pending bit set\n"); - goto err_out; +return -EIO ; }pr_debug ("targ: cpu %d, %d kHz, min %d, max %d, relation %d\n" , pol->cpu, targfreq, pol->min, pol->max, relation);if (query_current_values_with_pending_wait (data)) - goto err_out; +return -EIO ;if (cpu_family !=CPU_HW_PSTATE ) { pr_debug("targ: curr fid 0x%x, vid 0x%x\n",
@@ -1196,7 +1189,7 @@ static int powernowk8_target(struct cpufif (cpufreq_frequency_table_target (pol, data->powernow_table, targfreq, relation, &newstate)) - goto err_out; +return -EIO ;mutex_lock (&fidvid_mutex);
@@ -1209,9 +1202,8 @@ static int powernowk8_target(struct cpuf ret =transition_frequency_fidvid (data, newstate);if (ret) { printk(KERN_ERR PFX "transition frequency failed\n"); - ret =1 ;mutex_unlock (&fidvid_mutex); - goto err_out; +return 1 ; }mutex_unlock (&fidvid_mutex);
@@ -1220,12 +1212,25 @@ static int powernowk8_target(struct cpuf data->powernow_table[newstate].index); else pol->cur = find_khz_freq_from_fid(data->currfid); - ret =0 ; -err_out: -set_cpus_allowed_ptr (current, oldmask); -free_cpumask_var (oldmask); -return ret; +return 0 ; +} + +/* Driver entry point to switch to the target frequency */ +static int powernowk8_target (struct cpufreq_policy *pol, +unsigned targfreq,unsigned relation) +{ +struct powernowk8_target_arg pta = { .pol = pol, .targfreq = targfreq, + .relation = relation }; + +/* +* Must run on @pol->cpu. cpufreq core is responsible for ensuring +* that we're bound to the current CPU and pol->cpu stays online. +*/ +if (smp_processor_id () == pol->cpu) +return powernowk8_target_fn (&pta); +else +return work_on_cpu (pol->cpu, powernowk8_target_fn, &pta); }/* Driver entry point to verify the policy and range of frequencies */
Greg Kroah-Hartman
maintainerPATCH 33/262 cs89x0 : packet reception not working
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jaccon Bastiaansen <[email protected]>
[ Upstream commit b72c200975a4ed579dbf3353019e19528745a29a ]
The RxCFG register of the CS89x0 could be configured incorrectly (because of misplaced parentheses), resulting in the disabling of packet reception.
--- drivers/net/ethernet/cirrus/cs89x0.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/cirrus/cs89x0.c +5 -5
@@ -1243,6 +1243,7 @@ static void set_multicast_list(struct ne {struct net_local *lp =netdev_priv (dev);unsigned long flags; +u16 cfg;spin_lock_irqsave (&lp->lock, flags);if (dev->flags &IFF_PROMISC )
@@ -1260,11 +1261,10 @@ static void set_multicast_list(struct ne/* in promiscuous mode, we accept errored packets, * so we have to enable interrupts on them also */ -writereg (dev, PP_RxCFG, - (lp->curr_rx_cfg | - (lp->rx_mode ==RX_ALL_ACCEPT ) - ? (RX_CRC_ERROR_ENBL |RX_RUNT_ENBL |RX_EXTRA_DATA_ENBL ) - :0 )); + cfg = lp->curr_rx_cfg; +if (lp->rx_mode ==RX_ALL_ACCEPT ) + cfg |=RX_CRC_ERROR_ENBL |RX_RUNT_ENBL |RX_EXTRA_DATA_ENBL ; +writereg (dev, PP_RxCFG, cfg);spin_unlock_irqrestore (&lp->lock, flags); }
Greg Kroah-Hartman
maintainerPATCH 32/262 bnx2x: fix 57840_MF pci id
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuval Mintz <[email protected]>
[ Upstream commit 5c879d2094946081af934739850c7260e8b25d3c ]
Commit c3def943c7117d42caaed3478731ea7c3c87190e have added support for new pci ids of the 57840 board, while failing to change the obsolete value in 'pci_ids.h'.
This patch does so, allowing the probe of such devices.
--- include/linux/pci_ids.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/pci_ids.h +1 -1
@@ -2148,7 +2148,7 @@#define PCI_DEVICE_ID_TIGON3_5704S 0x16a8#define PCI_DEVICE_ID_NX2_57800_VF 0x16a9#define PCI_DEVICE_ID_NX2_5706S 0x16aa -#define PCI_DEVICE_ID_NX2_57840_MF 0x16ab +#define PCI_DEVICE_ID_NX2_57840_MF 0x16a4#define PCI_DEVICE_ID_NX2_5708S 0x16ac#define PCI_DEVICE_ID_NX2_57840_VF 0x16ad#define PCI_DEVICE_ID_NX2_57810_MF 0x16ae
Greg Kroah-Hartman
maintainerPATCH 30/262 l2tp: avoid to use synchronize_rcu in tunnel free function
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: "[email protected]" <[email protected]>
[ Upstream commit 99469c32f79a32d8481f87be0d3c66dad286f4ec ]
Avoid to use synchronize_rcu in l2tp_tunnel_free because context may be atomic.
--- net/l2tp/l2tp_core.c | 3 +-- net/l2tp/l2tp_core.h | 1 + 2 files changed, 2 insertions(+), 2 deletions(-)
net/l2tp/l2tp_core.c +1 -2
@@ -1346,11 +1346,10 @@ static void l2tp_tunnel_free(struct l2tp/* Remove from tunnel list */ spin_lock_bh (&pn->l2tp_tunnel_list_lock);list_del_rcu (&tunnel->list); +kfree_rcu (tunnel, rcu);spin_unlock_bh (&pn->l2tp_tunnel_list_lock); -synchronize_rcu ();atomic_dec (&l2tp_tunnel_count); -kfree (tunnel); }/* Create a socket for the tunnel, if one isn't set up by
net/l2tp/l2tp_core.h +1 -0
@@ -163,6 +163,7 @@ struct l2tp_tunnel_cfg {struct l2tp_tunnel {int magic;/* Should be L2TP_TUNNEL_MAGIC */ +struct rcu_head rcu;rwlock_t hlist_lock;/* protect session_hlist */ struct hlist_head session_hlist[L2TP_HASH_SIZE ];/* hashed list of sessions,
Greg Kroah-Hartman
maintainerPATCH 29/262 gianfar: fix default tx vlan offload feature flag
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Claudiu Manoil <[email protected]>
[ Upstream commit e2c53be223aca36cf93eb6a0f6bafa079e78f52b ]
Commit -
"b852b72 gianfar: fix bug caused by 87c288c6e9aa31720b72e2bc2d665e24e1653c3e"
disables by default (on mac init) the hw vlan tag insertion. The "features" flags were not updated to reflect this, and "ethtool -K" shows tx-vlan-offload to be "on" by default.
--- drivers/net/ethernet/freescale/gianfar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/gianfar.c +1 -1
@@ -1037,7 +1037,7 @@ static int gfar_probe(struct platform_deif (priv->device_flags &FSL_GIANFAR_DEV_HAS_VLAN ) { dev->hw_features |=NETIF_F_HW_VLAN_TX |NETIF_F_HW_VLAN_RX ; - dev->features |=NETIF_F_HW_VLAN_TX |NETIF_F_HW_VLAN_RX ; + dev->features |=NETIF_F_HW_VLAN_RX ; }if (priv->device_flags &FSL_GIANFAR_DEV_HAS_EXTENDED_HASH ) {
Greg Kroah-Hartman
maintainerPATCH 25/262 af_netlink: force credentials passing [CVE-2012-3520]
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit e0e3cea46d31d23dc40df0a49a7a2c04fe8edfea ]
Pablo Neira Ayuso discovered that avahi and
potentially NetworkManager accept spoofed Netlink messages because of a kernel bug. The kernel passes all-zero SCM_CREDENTIALS ancillary data to the receiver if the sender did not provide such data, instead of not including any such data at all or including the correct data from the peer (as it is the case with AF_UNIX).
This bug was introduced in commit 16e572626961
(af_unix: dont send SCM_CREDENTIALS by default)
This patch forces passing credentials for netlink, as before the regression.
Another fix would be to not add SCM_CREDENTIALS in netlink messages if not provided by the sender, but it might break some programs.
With help from Florian Weimer & Petr Matousek
This issue is designated as CVE-2012-3520
--- include/net/scm.h | 4 +++- net/netlink/af_netlink.c | 2 +- net/unix/af_unix.c | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-)
include/net/scm.h +3 -1
@@ -71,9 +71,11 @@ static __inline__ void scm_destroy(struc }static __inline__int scm_send (struct socket *sock,struct msghdr *msg, -struct scm_cookie *scm) +struct scm_cookie *scm,bool forcecreds) {memset (scm,0 ,sizeof (*scm)); +if (forcecreds) +scm_set_cred (scm,task_tgid (current),current_cred ());unix_get_peersec_dgram (sock, scm);if (msg->msg_controllen <=0 )return 0 ;
net/netlink/af_netlink.c +1 -1
@@ -1344,7 +1344,7 @@ static int netlink_sendmsg(struct kiocbif (NULL == siocb->scm) siocb->scm = &scm; - err =scm_send (sock, msg, siocb->scm); + err =scm_send (sock, msg, siocb->scm, true);if (err <0 )return err;
net/unix/af_unix.c +2 -2
@@ -1448,7 +1448,7 @@ static int unix_dgram_sendmsg(struct kioif (NULL == siocb->scm) siocb->scm = &tmp_scm;wait_for_unix_gc (); - err =scm_send (sock, msg, siocb->scm); + err =scm_send (sock, msg, siocb->scm, false);if (err <0 )return err;
@@ -1617,7 +1617,7 @@ static int unix_stream_sendmsg(struct kiif (NULL == siocb->scm) siocb->scm = &tmp_scm;wait_for_unix_gc (); - err =scm_send (sock, msg, siocb->scm); + err =scm_send (sock, msg, siocb->scm, false);if (err <0 )return err;
Greg Kroah-Hartman
maintainerPATCH 27/262 tcp: fix cwnd reduction for non-sack recovery
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuchung Cheng <[email protected]>
[ Upstream commit 7c4a56fec379ac0d7754e0d4da6a7361f1a4fe64 ]
The cwnd reduction in fast recovery is based on the number of packets newly delivered per ACK. For non-sack connections every DUPACK signifies a packet has been delivered, but the sender mistakenly skips counting them for cwnd reduction.
The fix is to compute newly_acked_sacked after DUPACKs are accounted in sacked_out for non-sack connections.
--- net/ipv4/tcp_input.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
net/ipv4/tcp_input.c +7 -8
@@ -3107,13 +3107,14 @@ static void tcp_enter_recovery(struct so* tcp_xmit_retransmit_queue(). */ static void tcp_fastretrans_alert (struct sock *sk,int pkts_acked, -int newly_acked_sacked,bool is_dupack, +int prior_sacked,bool is_dupack,int flag) {struct inet_connection_sock *icsk =inet_csk (sk);struct tcp_sock *tp =tcp_sk (sk);int do_lost = is_dupack || ((flag &FLAG_DATA_SACKED ) && (tcp_fackets_out (tp) > tp->reordering)); +int newly_acked_sacked =0 ;int fast_rexmit =0 ;if (WARN_ON (!tp->packets_out && tp->sacked_out))
@@ -3173,6 +3174,7 @@ static void tcp_fastretrans_alert(structtcp_add_reno_sack (sk); }else do_lost =tcp_try_undo_partial (sk, pkts_acked); + newly_acked_sacked = pkts_acked + tp->sacked_out - prior_sacked;break ;case TCP_CA_Loss:if (flag &FLAG_DATA_ACKED )
@@ -3194,6 +3196,7 @@ static void tcp_fastretrans_alert(structif (is_dupack)tcp_add_reno_sack (sk); } + newly_acked_sacked = pkts_acked + tp->sacked_out - prior_sacked;if (icsk->icsk_ca_state <= TCP_CA_Disorder)tcp_try_undo_dsack (sk);
@@ -3771,7 +3774,6 @@ static int tcp_ack(struct sock *sk, consint prior_packets;int prior_sacked = tp->sacked_out;int pkts_acked =0 ; -int newly_acked_sacked =0 ;bool frto_cwnd = false;/* If the ack is older than previous acks
@@ -3847,8 +3849,6 @@ static int tcp_ack(struct sock *sk, cons flag |=tcp_clean_rtx_queue (sk, prior_fackets, prior_snd_una); pkts_acked = prior_packets - tp->packets_out; - newly_acked_sacked = (prior_packets - prior_sacked) - - (tp->packets_out - tp->sacked_out);if (tp->frto_counter) frto_cwnd =tcp_process_frto (sk, flag);
@@ -3862,7 +3862,7 @@ static int tcp_ack(struct sock *sk, cons tcp_may_raise_cwnd(sk, flag))tcp_cong_avoid (sk, ack, prior_in_flight); is_dupack = !(flag & (FLAG_SND_UNA_ADVANCED |FLAG_NOT_DUP )); -tcp_fastretrans_alert (sk, pkts_acked, newly_acked_sacked, +tcp_fastretrans_alert (sk, pkts_acked, prior_sacked, is_dupack, flag); }else {if ((flag &FLAG_DATA_ACKED ) && !frto_cwnd)
@@ -3877,7 +3877,7 @@ static int tcp_ack(struct sock *sk, cons no_queue:/* If data was DSACKed, see if we can undo a cwnd reduction. */ if (flag &FLAG_DSACKING_ACK ) -tcp_fastretrans_alert (sk, pkts_acked, newly_acked_sacked, +tcp_fastretrans_alert (sk, pkts_acked, prior_sacked, is_dupack, flag);/* If this ack opens up a zero window, clear backoff. It was * being used to time the probes, and is probably far higher than
@@ -3897,8 +3897,7 @@ old_ack:*/ if (TCP_SKB_CB (skb)->sacked) { flag |=tcp_sacktag_write_queue (sk, skb, prior_snd_una); - newly_acked_sacked = tp->sacked_out - prior_sacked; -tcp_fastretrans_alert (sk, pkts_acked, newly_acked_sacked, +tcp_fastretrans_alert (sk, pkts_acked, prior_sacked, is_dupack, flag); }
Greg Kroah-Hartman
maintainerPATCH 17/262 Bluetooth: RFCOMM - Fix info leak via getsockname()
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit 9344a972961d1a6d2c04d9008b13617bcb6ec2ef ]
The RFCOMM code fails to initialize the trailing padding byte of struct sockaddr_rc added for alignment. It that for leaks one byte kernel stack via the getsockname() syscall. Add an explicit memset(0) before filling the structure to avoid the info leak.
--- net/bluetooth/rfcomm/sock.c | 1 + 1 file changed, 1 insertion(+)
net/bluetooth/rfcomm/sock.c +1 -0
@@ -547,6 +547,7 @@ static int rfcomm_sock_getname(struct soBT_DBG ("sock %p, sk %p" , sock, sk); +memset (sa,0 ,sizeof (*sa)); sa->rc_family =AF_BLUETOOTH ; sa->rc_channel =rfcomm_pi (sk)->channel;if (peer)
Greg Kroah-Hartman
maintainerPATCH 23/262 net: fix info leak in compat dev_ifconf()
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit 43da5f2e0d0c69ded3d51907d9552310a6b545e8 ]
The implementation of dev_ifconf() for the compat ioctl interface uses an intermediate ifc structure allocated in userland for the duration of the syscall. Though, it fails to initialize the padding bytes inserted for alignment and that for leaks four bytes of kernel stack. Add an explicit memset(0) before filling the structure to avoid the info leak.
--- net/socket.c | 1 + 1 file changed, 1 insertion(+)
net/socket.c +1 -0
@@ -2658,6 +2658,7 @@ static int dev_ifconf(struct net *net, sif (copy_from_user (&ifc32, uifc32,sizeof (struct compat_ifconf )))return -EFAULT ; +memset (&ifc,0 ,sizeof (ifc));if (ifc32.ifcbuf ==0 ) { ifc32.ifc_len =0 ; ifc.ifc_len =0 ;
Greg Kroah-Hartman
maintainerPATCH 22/262 ipvs: fix info leak in getsockopt(IP_VS_SO_GET_TIMEOUT)
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit 2d8a041b7bfe1097af21441cb77d6af95f4f4680 ]
If at least one of CONFIG_IP_VS_PROTO_TCP or CONFIG_IP_VS_PROTO_UDP is not set, __ip_vs_get_timeouts() does not fully initialize the structure that gets copied to userland and that for leaks up to 12 bytes of kernel stack. Add an explicit memset(0) before passing the structure to __ip_vs_get_timeouts() to avoid the info leak.
--- net/netfilter/ipvs/ip_vs_ctl.c | 1 + 1 file changed, 1 insertion(+)
net/netfilter/ipvs/ip_vs_ctl.c +1 -0
@@ -2759,6 +2759,7 @@ do_ip_vs_get_ctl(struct sock *sk, int cm {struct ip_vs_timeout_user t; +memset (&t,0 ,sizeof (t));__ip_vs_get_timeouts (net, &t);if (copy_to_user (user, &t,sizeof (t)) !=0 ) ret = -EFAULT ;
Greg Kroah-Hartman
maintainerPATCH 18/262 Bluetooth: L2CAP - Fix info leak via getsockname()
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit 792039c73cf176c8e39a6e8beef2c94ff46522ed ]
The L2CAP code fails to initialize the l2_bdaddr_type member of struct sockaddr_l2 and the padding byte added for alignment. It that for leaks two bytes kernel stack via the getsockname() syscall. Add an explicit memset(0) before filling the structure to avoid the info leak.
--- net/bluetooth/l2cap_sock.c | 1 + 1 file changed, 1 insertion(+)
net/bluetooth/l2cap_sock.c +1 -0
@@ -246,6 +246,7 @@ static int l2cap_sock_getname(struct socBT_DBG ("sock %p, sk %p" , sock, sk); +memset (la,0 ,sizeof (struct sockaddr_l2 )); addr->sa_family =AF_BLUETOOTH ; *len =sizeof (struct sockaddr_l2 );
Greg Kroah-Hartman
maintainerPATCH 16/262 Bluetooth: RFCOMM - Fix info leak in ioctl(RFCOMMGETDEVLIST)
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit f9432c5ec8b1e9a09b9b0e5569e3c73db8de432a ]
The RFCOMM code fails to initialize the two padding bytes of struct rfcomm_dev_list_req inserted for alignment before copying it to userland. Additionally there are two padding bytes in each instance of struct rfcomm_dev_info. The ioctl() that for disclosures two bytes plus dev_num times two bytes uninitialized kernel heap memory.
Allocate the memory using kzalloc() to fix this issue.
--- net/bluetooth/rfcomm/tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/rfcomm/tty.c +1 -1
@@ -461,7 +461,7 @@ static int rfcomm_get_dev_list(void __us size =sizeof (*dl) + dev_num *sizeof (*di); - dl =kmalloc (size,GFP_KERNEL ); + dl =kzalloc (size,GFP_KERNEL );if (!dl)return -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 15/262 Bluetooth: RFCOMM - Fix info leak in getsockopt(BT_SECURITY)
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit 9ad2de43f1aee7e7274a4e0d41465489299e344b ]
The RFCOMM code fails to initialize the key_size member of struct bt_security before copying it to userland -- that for leaking one byte kernel stack. Initialize key_size with 0 to avoid the info leak.
--- net/bluetooth/rfcomm/sock.c | 1 + 1 file changed, 1 insertion(+)
net/bluetooth/rfcomm/sock.c +1 -0
@@ -841,6 +841,7 @@ static int rfcomm_sock_getsockopt(struct } sec.level =rfcomm_pi (sk)->sec_level; + sec.key_size =0 ; len = min_t(unsigned int, len, sizeof(sec));if (copy_to_user (optval, (char *) &sec, len))
Greg Kroah-Hartman
maintainerPATCH 10/262 ipv6: addrconf: Avoid calling netdevice notifiers with RCU read-side lock
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
[ Upstream commit 4acd4945cd1e1f92b20d14e349c6c6a52acbd42d ]
Cong Wang reports that lockdep detected suspicious RCU usage while enabling IPV6 forwarding:
[ 1123.310275] ===============================
[ 1123.442202] [ INFO: suspicious RCU usage. ]
[ 1123.558207] 3.6.0-rc1+ #109 Not tainted
[ 1123.665204] -------------------------------
[ 1123.768254] include/linux/rcupdate.h:430 Illegal context switch in RCU read-side critical section!
[ 1123.992320]
[ 1123.992320] other info that might help us debug this:
[ 1123.992320]
[ 1124.307382]
[ 1124.307382] rcu_scheduler_active = 1, debug_locks = 0
[ 1124.522220] 2 locks held by sysctl/5710:
[ 1124.648364] #0: (rtnl_mutex){+.+.+.}, at: [<ffffffff81768498>] rtnl_trylock+0x15/0x17
[ 1124.882211] #1: (rcu_read_lock){.+.+.+}, at: [<ffffffff81871df8>] rcu_lock_acquire+0x0/0x29
[ 1125.085209]
[ 1125.085209] stack backtrace:
[ 1125.332213] Pid: 5710, comm: sysctl Not tainted 3.6.0-rc1+ #109
[ 1125.441291] Call Trace:
[ 1125.545281] [<ffffffff8109d915>] lockdep_rcu_suspicious+0x109/0x112
[ 1125.667212] [<ffffffff8107c240>] rcu_preempt_sleep_check+0x45/0x47
[ 1125.781838] [<ffffffff8107c260>] __might_sleep+0x1e/0x19b
[...]
[ 1127.445223] [<ffffffff81757ac5>] call_netdevice_notifiers+0x4a/0x4f
[...]
[ 1127.772188] [<ffffffff8175e125>] dev_disable_lro+0x32/0x6b
[ 1127.885174] [<ffffffff81872d26>] dev_forward_change+0x30/0xcb
[ 1128.013214] [<ffffffff818738c4>] addrconf_forward_change+0x85/0xc5[...]
addrconf_forward_change() uses RCU iteration over the netdev list, which is unnecessary since it already holds the RTNL lock. We also cannot reasonably require netdevice notifier functions not to sleep.
--- net/ipv6/addrconf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
net/ipv6/addrconf.c +1 -3
@@ -493,8 +493,7 @@ static void addrconf_forward_change(strustruct net_device *dev;struct inet6_dev *idev; -rcu_read_lock (); -for_each_netdev_rcu (net, dev) { +for_each_netdev (net, dev) { idev =__in6_dev_get (dev);if (idev) {int changed = (!idev->cnf.forwarding) ^ (!newf);
@@ -503,7 +502,6 @@ static void addrconf_forward_change(strudev_forward_change (idev); } } -rcu_read_unlock (); }static int addrconf_fixup_forwarding (struct ctl_table *table,int *p,int newf)
Greg Kroah-Hartman
maintainerPATCH 7/262 pptp: lookup route with the proper net namespace
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gao feng <[email protected]>
[ Upstream commit 08252b32311c3fa84219ad794d640af7399b5485 ]
pptp always use init_net as the net namespace to lookup route, this will cause route lookup failed in container.
because we already set the correct net namespace to struct sock in pptp_create,so fix this by using sock_net(sk) to replace &init_net.
--- drivers/net/ppp/pptp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ppp/pptp.c +2 -2
@@ -189,7 +189,7 @@ static int pptp_xmit(struct ppp_channelif (sk_pppox (po)->sk_state &PPPOX_DEAD ) goto tx_error; - rt = ip_route_output_ports(&init_net, &fl4, NULL, + rt = ip_route_output_ports(sock_net(sk), &fl4, NULL, opt->dst_addr.sin_addr.s_addr, opt->src_addr.sin_addr.s_addr, 0, 0, IPPROTO_GRE,
@@ -468,7 +468,7 @@ static int pptp_connect(struct socket *s po->chan.private = sk; po->chan.ops = &pptp_chan_ops; - rt = ip_route_output_ports(&init_net, &fl4, sk, + rt = ip_route_output_ports(sock_net(sk), &fl4, sk, opt->dst_addr.sin_addr.s_addr, opt->src_addr.sin_addr.s_addr, 0, 0,
Greg Kroah-Hartman
maintainerPATCH 5/262 net_sched: gact: Fix potential panic in tcf_gact().
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hiroaki SHIMODA <[email protected]>
[ Upstream commit 696ecdc10622d86541f2e35cc16e15b6b3b1b67e ]
gact_rand array is accessed by gact->tcfg_ptype whose value is assumed to less than MAX_RAND, but any range checks are not performed.
So add a check in tcf_gact_init(). And in tcf_gact(), we can reduce a branch.
--- net/sched/act_gact.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
net/sched/act_gact.c +11 -3
@@ -67,6 +67,9 @@ static int tcf_gact_init(struct nlattr *struct tcf_common *pc;int ret =0 ;int err; +#ifdef CONFIG_GACT_PROB +struct tc_gact_p *p_parm =NULL ; +#endif if (nla ==NULL )return -EINVAL ;
@@ -82,6 +85,12 @@ static int tcf_gact_init(struct nlattr *#ifndef CONFIG_GACT_PROB if (tb[TCA_GACT_PROB ] !=NULL )return -EOPNOTSUPP ; +#else +if (tb[TCA_GACT_PROB ]) { + p_parm =nla_data (tb[TCA_GACT_PROB ]); +if (p_parm->ptype >=MAX_RAND ) +return -EINVAL ; + }#endif pc =tcf_hash_check (parm->index, a, bind, &gact_hash_info);
@@ -103,8 +112,7 @@ static int tcf_gact_init(struct nlattr *spin_lock_bh (&gact->tcf_lock); gact->tcf_action = parm->action;#ifdef CONFIG_GACT_PROB -if (tb[TCA_GACT_PROB ] !=NULL ) { -struct tc_gact_p *p_parm =nla_data (tb[TCA_GACT_PROB ]); +if (p_parm) { gact->tcfg_paction = p_parm->paction; gact->tcfg_pval = p_parm->pval; gact->tcfg_ptype = p_parm->ptype;
@@ -133,7 +141,7 @@ static int tcf_gact(struct sk_buff *skb,spin_lock (&gact->tcf_lock);#ifdef CONFIG_GACT_PROB -if (gact->tcfg_ptype && gact_rand[gact->tcfg_ptype] !=NULL ) +if (gact->tcfg_ptype) action = gact_rand[gact->tcfg_ptype](gact);else action = gact->tcf_action;
Greg Kroah-Hartman
maintainerPATCH 4/262 tcp: Apply device TSO segment limit earlier
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
[ Upstream commit 1485348d2424e1131ea42efc033cbd9366462b01 ]
Cache the device gso_max_segs in sock::sk_gso_max_segs and use it to limit the size of TSO skbs. This avoids the need to fall back to software GSO for local TCP senders.
--- include/net/sock.h | 2 ++ net/core/sock.c | 1 + net/ipv4/tcp.c | 4 +++- net/ipv4/tcp_cong.c | 3 ++- net/ipv4/tcp_output.c | 21 ++++++++++++--------- 5 files changed, 20 insertions(+), 11 deletions(-)
include/net/sock.h +2 -0
@@ -217,6 +217,7 @@ struct cg_proto;* @sk_route_nocaps: forbidden route capabilities (e.g NETIF_F_GSO_MASK) * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4) * @sk_gso_max_size: Maximum GSO segment size to build +* @sk_gso_max_segs: Maximum number of GSO segments * @sk_lingertime: %SO_LINGER l_linger setting * @sk_backlog: always used with the per-socket spinlock held * @sk_callback_lock: used with the callbacks in the end of this struct
@@ -336,6 +337,7 @@ struct sock {netdev_features_t sk_route_nocaps;int sk_gso_type;unsigned int sk_gso_max_size; +u16 sk_gso_max_segs;int sk_rcvlowat;unsigned long sk_lingertime;struct sk_buff_head sk_error_queue;
net/core/sock.c +1 -0
@@ -1403,6 +1403,7 @@ void sk_setup_caps(struct sock *sk, stru }else { sk->sk_route_caps |=NETIF_F_SG |NETIF_F_HW_CSUM ; sk->sk_gso_max_size = dst->dev->gso_max_size; + sk->sk_gso_max_segs = dst->dev->gso_max_segs; } } }
net/ipv4/tcp.c +3 -1
@@ -805,7 +805,9 @@ static unsigned int tcp_xmit_size_goal(s old_size_goal + mss_now > xmit_size_goal)) { xmit_size_goal = old_size_goal; }else { - tp->xmit_size_goal_segs = xmit_size_goal / mss_now; + tp->xmit_size_goal_segs = +min_t (u16, xmit_size_goal / mss_now, + sk->sk_gso_max_segs); xmit_size_goal = tp->xmit_size_goal_segs * mss_now; } }
net/ipv4/tcp_cong.c +2 -1
@@ -291,7 +291,8 @@ bool tcp_is_cwnd_limited(const struct so left = tp->snd_cwnd - in_flight;if (sk_can_gso (sk) && left * sysctl_tcp_tso_win_divisor < tp->snd_cwnd && - left * tp->mss_cache < sk->sk_gso_max_size) + left * tp->mss_cache < sk->sk_gso_max_size && + left < sk->sk_gso_max_segs)return true;return left <=tcp_max_tso_deferred_mss (tp); }
net/ipv4/tcp_output.c +12 -9
@@ -1334,21 +1334,21 @@ static void tcp_cwnd_validate(struct soc* when we would be allowed to send the split-due-to-Nagle skb fully. */ static unsigned int tcp_mss_split_point (const struct sock *sk,const struct sk_buff *skb, -unsigned int mss_now,unsigned int cwnd) +unsigned int mss_now,unsigned int max_segs) {const struct tcp_sock *tp =tcp_sk (sk); -u32 needed, window, cwnd_len; +u32 needed, window, max_len; window =tcp_wnd_end (tp) -TCP_SKB_CB (skb)->seq; - cwnd_len = mss_now * cwnd; + max_len = mss_now * max_segs; -if (likely (cwnd_len <= window && skb !=tcp_write_queue_tail (sk))) -return cwnd_len; +if (likely (max_len <= window && skb !=tcp_write_queue_tail (sk))) +return max_len; needed =min (skb->len, window); -if (cwnd_len <= needed) -return cwnd_len; +if (max_len <= needed) +return max_len;return needed - needed % mss_now; }
@@ -1577,7 +1577,8 @@ static bool tcp_tso_should_defer(struct limit =min (send_win, cong_win);/* If a full-sized TSO skb can be sent, do it. */ -if (limit >= sk->sk_gso_max_size) + if (limit >= min_t(unsigned int, sk->sk_gso_max_size, + sk->sk_gso_max_segs * tp->mss_cache)) goto send_now;/* Middle in queue won't get any more data, full sendable already? */
@@ -1803,7 +1804,9 @@ static bool tcp_write_xmit(struct sock * limit = mss_now;if (tso_segs >1 && !tcp_urg_mode (tp)) limit =tcp_mss_split_point (sk, skb, mss_now, - cwnd_quota); + min_t(unsigned int, + cwnd_quota, + sk->sk_gso_max_segs));if (skb->len > limit &&unlikely (tso_fragment (sk, skb, limit, mss_now, gfp)))
Greg Kroah-Hartman
maintainerPATCH 2/262 net: Allow driver to limit number of GSO segments per skb
In reply to Greg Kroah-HartmanFrom: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
[ Upstream commit 30b678d844af3305cda5953467005cebb5d7b687 ]
A peer (or local user) may cause TCP to use a nominal MSS of as little as 88 (actual MSS of 76 with timestamps). Given that we have a sufficiently prodigious local sender and the peer ACKs quickly enough, it is nevertheless possible to grow the window for such a connection to the point that we will try to send just under 64K at once. This results in a single skb that expands to 861 segments.
In some drivers with TSO support, such an skb will require hundreds of DMA descriptors; a substantial fraction of a TX ring or even more than a full ring. The TX queue selected for the skb may stall and trigger the TX watchdog repeatedly (since the problem skb will be retried after the TX reset). This particularly affects sfc, for which the issue is designated as CVE-2012-3412.
Therefore:
1. Add the field net_device::gso_max_segs holding the device-specific limit.
2. In netif_skb_features(), if the number of segments is too high then mask out GSO features to force fall back to software GSO.
--- include/linux/netdevice.h | 2 ++ net/core/dev.c | 4 ++++ 2 files changed, 6 insertions(+)
include/linux/netdevice.h +2 -0
@@ -1301,6 +1301,8 @@ struct net_device {/* for setting kernel sock attribute on TCP connection setup */ #define GSO_MAX_SIZE 65536unsigned int gso_max_size; +#define GSO_MAX_SEGS 65535 +u16 gso_max_segs;#ifdef CONFIG_DCB /* Data Center Bridging netlink ops */
net/core/dev.c +4 -0
@@ -2119,6 +2119,9 @@ netdev_features_t netif_skb_features(str__be16 protocol = skb->protocol;netdev_features_t features = skb->dev->features; +if (skb_shinfo (skb)->gso_segs > skb->dev->gso_max_segs) + features &= ~NETIF_F_GSO_MASK ; +if (protocol ==htons (ETH_P_8021Q )) {struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data; protocol = veh->h_vlan_encapsulated_proto;
@@ -5911,6 +5914,7 @@ struct net_device *alloc_netdev_mqs(intdev_net_set (dev, &init_net); dev->gso_max_size =GSO_MAX_SIZE ; + dev->gso_max_segs =GSO_MAX_SEGS ;INIT_LIST_HEAD (&dev->napi_list);INIT_LIST_HEAD (&dev->unreg_list);
Greg Kroah-Hartman
maintainerRe: [ 173/262] mutex: Place lock in contended state after fastpath_lock failure
In reply to Nicolas PitreQuoted 6 lines · Nicolas Pitre
Quoted 4 lines · Greg Kroah-Hartman
From: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
Quoted 8 lines
Quoted 5 lines
------------------
From: Will Deacon <[email protected]>
commit
0bce9c46bf3b15f485d82d7e81dabed6ebcc24b1upstream.Now that you've queued this one, could you pick up
a76d7bd96das well please?
Sure, for just 3.5.y or any other stable trees?
thanks,
greg k-h
Greg Kroah-Hartman
maintainerRe: [ 089/262] SUNRPC: Fix a UDP transport regression
In reply to Myklebust, TrondQuoted 11 lines · Trond
Quoted 9 lines · Greg Kroah-Hartman
From: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit
f39c1bfb5a03e2d255451bff05be0d7255298fa4upstream.
Quoted 7 lines
Hi Greg,
Can we please hold on this one for now. It appears that it requires an extra initialiser in the '
bc_tcp_ops' declaration innet/sunrpc/xprtsock.c(to set '.alloc_slot =xprt_alloc_slot').I have a separate patch for that, but it has not yet made it upstream.
Now dropped, thanks for letting me know.
greg k-h
Re: [ 173/262] mutex: Place lock in contended state after fastpath_lock failure
In reply to Greg Kroah-HartmanQuoted 9 lines · Greg Kroah-Hartman
Quoted 8 lines · Nicolas Pitre
Quoted 6 lines · Greg Kroah-Hartman
From: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
From: Will Deacon <[email protected]>
commit
0bce9c46bf3b15f485d82d7e81dabed6ebcc24b1upstream.Now that you've queued this one, could you pick up
a76d7bd96das well please?Sure, for just 3.5.y or any other stable trees?
Any other stable tree where commit 0bce9c46bf has also been merged.
Nicolas
Greg Kroah-Hartman
maintainerRe: [ 173/262] mutex: Place lock in contended state after fastpath_lock failure
Quoted 13 lines · Nicolas Pitre
Quoted 11 lines · Greg Kroah-Hartman
Quoted 10 lines · Nicolas Pitre
Quoted 8 lines · Greg Kroah-Hartman
From: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <[email protected]>
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
commit
0bce9c46bf3b15f485d82d7e81dabed6ebcc24b1upstream.Now that you've queued this one, could you pick up
a76d7bd96das well please?Sure, for just 3.5.y or any other stable trees?
Any other stable tree where commit
0bce9c46bfhas also been merged.
Ok, now applied to 3.0.y and 3.4.y and 3.5.y
greg k-h
Re: [ 074/262] mmc: mxs-mmc: fix deadlock caused by recursion loop
In reply to Greg Kroah-HartmanQuoted 4 lines · On Fri, 28 Sep 2012 11:50:03 -0700 Greg Kroah-Hartman…
From: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
Quoted 8 lines
------------------
From: Lauri Hintsala <[email protected]>
commit
fc108d24d3a6da63576a460e122fa1df0cbdea20upstream.Release the lock before
mmc_signal_sdio_irqis called bymxs_mmc_enable_sdio_irq.
Looks ok on this side of the big pond.
Attila Kinali
Signature · 2 lines
There is no secret ingredient
-- Po, Kung Fu PandaRe: [ 045/262] ARM: 7501/1: decompressor: reset ttbcr for VMSA ARMv7 cores
In reply to Greg Kroah-HartmanQuoted 21 lines · Greg Kroah-Hartman
From: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <[email protected]>
commit
dbece45894d3ab1baac15a96dc4e1e8e23f64a93upstream.When enabling the MMU for ARMv7 CPUs, the decompressor does not touch the ttbcr register, assuming that it will be zeroed (N == 0, EAE == 0). Given that only EAE is defined as 0 for non-secure copies of the register (and a bootloader such as kexec may leave it set to 1 anyway), we should ensure that we reset the register ourselves before turning on the MMU.
This patch zeroes TTBCR.EAE and TTBCR.N prior to enabling the MMU for ARMv7 cores in the decompressor, configuring us exclusively for 32-bit translation tables via TTBR0.
Quoted 5 lines
Acked-by Nicolas Pitre <[email protected]>Signed-off-by Matthew Leach <[email protected]>Signed-off-by Will Deacon <[email protected]>Signed-off-by Russell King <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
[...]
Is this also needed for earlier kernel versions? If so, can you provide a backported version?
Ben.
Signature · 3 lines
Ben Hutchings
Usenet is essentially a HUGE group of people passing notes in class.
- Rachel Kadel, `A Quick Guide to Newsgroup Etiquette'Re: [ 080/262] usb: gadget: dummy_hcd: fixup error probe path
In reply to Greg Kroah-HartmanQuoted 10 lines · Greg Kroah-Hartman
From: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
commit
1b68a4ca2d038addb7314211d122fb6d7002b38bupstream.
Quoted 8 lines
If USB2 host controller probes fine but USB3 does not then we don't remove the USB controller properly and lock up the system while the HUB code will try to enumerate the USB2 controller and access memory which is no longer available in case the
dummy_hcdwas compiled as a module.This is a problem since
448b6eb1("USB: Make sure to fetch the BOS desc for roothubs.) if used in USB3 mode because dummy does not provide this descriptor and explodes later.
[...]
i.e. for 3.5 (as noted in the cc: stable line). But I don't see why this isn't needed for earlier kernel versions. The same broken error handling is present.
Ben.
Signature · 3 lines
Ben Hutchings
Usenet is essentially a HUGE group of people passing notes in class.
- Rachel Kadel, `A Quick Guide to Newsgroup Etiquette'Re: [ 080/262] usb: gadget: dummy_hcd: fixup error probe path
Quoted 8 lines · Ben Hutchings
Quoted 3 lines
This is a problem since
448b6eb1("USB: Make sure to fetch the BOS desc for roothubs.) if used in USB3 mode because dummy does not provide this descriptor and explodes later.[...]
i.e. for 3.5 (as noted in the cc: stable line). But I don't see why this isn't needed for earlier kernel versions. The same broken error handling is present.
Hmmm. The error handling is broken since day 1 that is cdfcbd2c4a ("usb:
gadget: dummy_hcd: use the shared_hcd infrastructure") / v3.1-rc1. Prior v3.5 it is unlikely that something fails here, I never noticed it. However you are right: wrong is wrong and thefore it should be picked up to v3.1.
Quoted 1 line
Ben.
Sebastian
Re: [ 174/262] x86, avx: dont use avx instructions with "noxsave" boot param
In reply to Greg Kroah-HartmanQuoted 10 lines · Greg Kroah-Hartman
From: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Suresh Siddha <[email protected]>
commit
c6fd893da927c6cefb2ece22402765379921a834upstream.
Quoted 8 lines
Clear AVX, AVX2 features along with clearing XSAVE feature bits, as part of the parsing "noxsave" parameter.
Fixes the kernel boot panic with "noxsave" boot parameter.
We could have checked
cpu_has_osxsavealong withcpu_has_avxetc, but Peter mentioned clearing the feature bits will be better for uses likestatic_cpu_has()etc.
This was marked as needed for 3.5 only - presumably because the kernel wasn't using AVX before this - but don't we also need to clear these bits even in earlier versions so userland knows not to use it?
Ben.
Quoted 20 lines
Signed-off-by Suresh Siddha <[email protected]>Signed-off-by H. Peter Anvin <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- arch/x86/kernel/cpu/common.c | 2 ++ 1 file changed, 2 insertions(+)arch/x86/kernel/cpu/common.c +2
-0@@ -144,6 +144,8 @@ static int __init x86_xsave_setup(char * {setup_clear_cpu_cap (X86_FEATURE_XSAVE );setup_clear_cpu_cap (X86_FEATURE_XSAVEOPT ); +setup_clear_cpu_cap (X86_FEATURE_AVX ); +setup_clear_cpu_cap (X86_FEATURE_AVX2 );return 1 ; }__setup ("noxsave" , x86_xsave_setup);
Signature · 2 lines
Ben Hutchings You can't have everything. Where would you put it?
H. Peter Anvin
reviewerRe: [ 174/262] x86, avx: dont use avx instructions with "noxsave" boot param
Userland should use a different query mechanism. On the other hand, it will not hurt either. On pre-xsave kernels AVX is a non-option.
Quoted 49 lines · Ben Hutchings
Quoted 3 lines · Greg Kroah-Hartman
From: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me
know.
Quoted 5 lines
------------------
From: Suresh Siddha <[email protected]>
Quoted 8 lines
commit
c6fd893da927c6cefb2ece22402765379921a834upstream.Clear AVX, AVX2 features along with clearing XSAVE feature bits, as part of the parsing "noxsave" parameter.
Fixes the kernel boot panic with "noxsave" boot parameter.
We could have checked
cpu_has_osxsavealong withcpu_has_avxetc, butPeter
Quoted 2 lines
mentioned clearing the feature bits will be better for uses like
static_cpu_has()etc.This was marked as needed for 3.5 only - presumably because the kernel wasn't using AVX before this - but don't we also need to clear these bits even in earlier versions so userland knows not to use it?
Ben.
Quoted 2 lines
Signed-off-by Suresh Siddha <[email protected]>Link:
http://lkml.kernel.org/r/[email protected]
Quoted 18 lines
Signed-off-by H. Peter Anvin <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- arch/x86/kernel/cpu/common.c | 2 ++ 1 file changed, 2 insertions(+)arch/x86/kernel/cpu/common.c +2
-0@@ -144,6 +144,8 @@ static int __init x86_xsave_setup(char * {setup_clear_cpu_cap (X86_FEATURE_XSAVE );setup_clear_cpu_cap (X86_FEATURE_XSAVEOPT ); +setup_clear_cpu_cap (X86_FEATURE_AVX ); +setup_clear_cpu_cap (X86_FEATURE_AVX2 );return 1 ; }__setup ("noxsave" , x86_xsave_setup);
Signature · 1 line
Sent from my mobile phone. Please excuse brevity and lack of formatting.
Re: [ 174/262] x86, avx: dont use avx instructions with "noxsave" boot param
Quoted 2 lines · H. Peter Anvin
Userland should use a different query mechanism. On the other hand, it will not hurt either. On pre-xsave kernels AVX is a non-option.
[...]
OK, having looked at what the SDM says I agree that there shouldn't be a problem for userland.
Ben.
Signature · 2 lines
Ben Hutchings Who are all these weirdos? - David Bowie, about L-Space IRC channel #afp
Re: [ 243/262] NFS: Fix Oopses in nfs_lookup_revalidate and nfs4_lookup_revalidate
In reply to Greg Kroah-HartmanQuoted 3 lines · Greg Kroah-Hartman
From: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
Hi Greg,
Can we please apply this patch to the older stable kernels too? I see that Ben has already applied it to the 3.2 kernel, but it really wants to go into 3.4 and 3.0 as well...
Thanks!
Trond
Quoted 85 lines
------------------
From: Trond Myklebust <[email protected]>
[Fixed upstream as part of
0b728e1911c, but that's a much larger patch, this is only the nfs portion backported as needed.]Fix the following Oops in 3.5.1:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000038 IP: [<ffffffffa03789cd>] nfs_lookup_revalidate+0x2d/0x480 [nfs] PGD 337c63067 PUD 0 Oops: 0000 [#1] SMP CPU 5 Modules linked in: nfs fscache nfsd lockd nfs_acl auth_rpcgss sunrpc af_packet binfmt_misc cpufreq_conservative cpufreq_userspace cpufreq_powersave dm_mod acpi_cpufreq mperf coretemp gpio_ich kvm_intel joydev kvm ioatdma hid_generic igb lpc_ich i7core_edac edac_core ptp serio_raw dca pcspkr i2c_i801 mfd_core sg pps_core usbhid crc32c_intel microcode button autofs4 uhci_hcd ttm drm_kms_helper drm i2c_algo_bit sysimgblt sysfillrect syscopyarea ehci_hcd usbcore usb_common scsi_dh_rdac scsi_dh_emc scsi_dh_hp_sw scsi_dh_alua scsi_dh edd fan ata_piix thermal processor thermal_sysPid: 30431, comm: java Not tainted 3.5.1-2-default #1 Supermicro X8DTT/X8DTT
RIP: 0010:[<ffffffffa03789cd>] [<ffffffffa03789cd>] nfs_lookup_revalidate+0x2d/0x480 [nfs] RSP: 0018:ffff8801b418bd38 EFLAGS: 00010292 RAX: 00000000fffffff6 RBX: ffff88032016d800 RCX: 0000000000000020 RDX: ffffffff00000000 RSI: 0000000000000000 RDI: ffff8801824a7b00 RBP: ffff8801b418bdf8 R08: 7fffff0034323030 R09: fffffffff04c03ed R10: ffff8801824a7b00 R11: 0000000000000002 R12: ffff8801824a7b00 R13: ffff8801824a7b00 R14: 0000000000000000 R15: ffff8803201725d0 FS: 00002b53a46cb700(0000) GS:ffff88033fc20000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000038 CR3: 000000020a426000 CR4: 00000000000007e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process java (pid: 30431, threadinfo ffff8801b418a000, task ffff8801b5d20600) Stack: ffff8801b418be44 ffff88032016d800 ffff8801b418bdf8 0000000000000000 ffff8801824a7b00 ffff8801b418bdd7 ffff8803201725d0 ffffffff8116a9c0 ffff8801b5c38dc0 0000000000000007 ffff88032016d800 0000000000000000 Call Trace: [<ffffffff8116a9c0>] lookup_dcache+0x80/0xe0 [<ffffffff8116aa43>] __lookup_hash+0x23/0x90 [<ffffffff8116b4a5>] lookup_one_len+0xc5/0x100 [<ffffffffa03869a3>] nfs_sillyrename+0xe3/0x210 [nfs] [<ffffffff8116cadf>] vfs_unlink.part.25+0x7f/0xe0 [<ffffffff8116f22c>] do_unlinkat+0x1ac/0x1d0 [<ffffffff815717b9>] system_call_fastpath+0x16/0x1b [<00002b5348b5f527>] 0x2b5348b5f526 Code: ec 38 b8 f6 ff ff ff 4c 89 64 24 18 4c 89 74 24 28 49 89 fc 48 89 5c 24 08 48 89 6c 24 10 49 89 f6 4c 89 6c 24 20 4c 89 7c 24 30 <f6> 46 38 40 0f 85 d1 00 00 00 e8 c4 c4 df e0 48 8b 58 30 49 89 RIP [<ffffffffa03789cd>] nfs_lookup_revalidate+0x2d/0x480 [nfs] RSP <ffff8801b418bd38> CR2: 0000000000000038 ---[ end trace 845113ed191985dd ]---This Oops affects 3.5 kernels and older, and is due to
lookup_one_len()calling down to the dentry revalidation code with a NULL pointer to struct nameidata.It is fixed upstream by commit
0b728e1911c(stop passing nameidata * to ->d_revalidate())Reported-by Richard Ems <[email protected]>Signed-off-by Trond Myklebust <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- fs/nfs/dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/nfs/dir.c +2
-2@@ -1123,7 +1123,7 @@ static int nfs_lookup_revalidate(structstruct nfs_fattr *fattr =NULL ;int error; -if (nd->flags &LOOKUP_RCU ) +if (nd && (nd->flags &LOOKUP_RCU ))return -ECHILD ; parent =dget_parent (dentry);@@ -1526,7 +1526,7 @@ static int nfs4_lookup_revalidate(structstruct inode *dir;int openflags, ret =0 ; -if (nd->flags &LOOKUP_RCU ) +if (nd && (nd->flags &LOOKUP_RCU ))return -ECHILD ; inode = dentry->d_inode;
Signature · 7 lines
Trond Myklebust Linux NFS client maintainer NetApp [email protected] www.netapp.com ���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m����������?�I�
Greg Kroah-Hartman
maintainerRe: [ 243/262] NFS: Fix Oopses in nfs_lookup_revalidate and nfs4_lookup_revalidate
Quoted 11 lines · Trond
Quoted 3 lines · Greg Kroah-Hartman
From: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
Hi Greg,
Can we please apply this patch to the older stable kernels too? I see that Ben has already applied it to the 3.2 kernel, but it really wants to go into 3.4 and 3.0 as well...
Ok, I'll queue this up for the next round of releases.
thanks,
greg k-h
Greg Kroah-Hartman
maintainerRe: [ 243/262] NFS: Fix Oopses in nfs_lookup_revalidate and nfs4_lookup_revalidate
Quoted 7 lines · Greg Kroah-Hartman
Quoted 6 lines · Trond
Quoted 3 lines · Greg Kroah-Hartman
From: Greg KH <[email protected]>
3.5-stable review patch. If anyone has any objections, please let me know.
Quoted 7 lines
Quoted 5 lines
Hi Greg,
Can we please apply this patch to the older stable kernels too? I see that Ben has already applied it to the 3.2 kernel, but it really wants to go into 3.4 and 3.0 as well...
Ok, I'll queue this up for the next round of releases.
Now applied, thanks.
greg k-h