3.2.7-stable review
Subsystems (25)
Greg KH
maintainercover 3.2.7-stable review
This is the start of the stable review cycle for the 3.2.7 release. There are 28 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Feb 19 00:55:33 UTC 2012. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.2.7-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
-------------
Makefile | 4 +- arch/x86/pci/xen.c | 2 +- crypto/sha512_generic.c | 70 ++++++------ drivers/gpu/drm/i915/intel_dp.c | 20 +--- drivers/gpu/drm/i915/intel_lvds.c | 8 ++ drivers/hwmon/f75375s.c | 4 +- drivers/mmc/host/atmel-mci.c | 3 + drivers/mmc/host/dw_mmc.c | 144 ++++++++++++----------- drivers/net/ethernet/intel/igb/igb_main.c | 3 +- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 3 +- drivers/net/ethernet/toshiba/Kconfig | 2 +- drivers/net/wireless/ath/ath9k/hw.c | 7 +- drivers/net/wireless/ath/ath9k/init.c | 9 +- drivers/net/wireless/ath/ath9k/recv.c | 8 ++ fs/cifs/connect.c | 7 +- fs/cifs/dir.c | 2 +- fs/fs-writeback.c | 16 ++-- include/linux/mmc/dw_mmc.h | 6 +- include/linux/proportions.h | 4 + include/trace/events/writeback.h | 7 +- kernel/relay.c | 10 ++- mm/backing-dev.c | 25 +++- net/mac80211/rx.c | 2 +- sound/pci/hda/patch_realtek.c | 23 ++++ sound/pci/hda/patch_via.c | 3 + sound/pci/intel8x0.c | 6 + tools/perf/bench/mem-memcpy-x86-64-asm.S | 6 + tools/perf/util/evsel.c | 1 + 28 files changed, 245 insertions(+), 160 deletions(-)
Greg KH
maintainerPATCH 1/28 ixgbe: fix vf lookup
3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Rose <[email protected]>
commit a4b08329c74985e5cc3a44b6d2b2c59444ed8079 upstream.
Recent addition of code to find already allocated VFs failed to take account that systems with 2 or more multi-port SR-IOV capable controllers might have already enabled VFs. Make sure that the VFs the function is finding are actually subordinate to the particular instance of the adapter that is looking for them and not subordinate to some device that has previously enabled SR-IOV.
This bug exists in 3.2 stable as well as 3.3 release candidates.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +2 -1
@@ -67,7 +67,8 @@ static int ixgbe_find_enabled_vfs(struct vf_devfn = pdev->devfn +0x80 ; pvfdev =pci_get_device (IXGBE_INTEL_VENDOR_ID , device_id,NULL );while (pvfdev) { -if (pvfdev->devfn == vf_devfn) +if (pvfdev->devfn == vf_devfn && + (pvfdev->bus->number >= pdev->bus->number)) vfs_found++; vf_devfn +=2 ; pvfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID,
Greg KH
maintainerPATCH 2/28 igb: fix vf lookup
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Rose <[email protected]>
commit 0629292117572a60465f38cdedde2f8164c3df0b upstream.
Recent addition of code to find already allocated VFs failed to take account that systems with 2 or more multi-port SR-IOV capable controllers might have already enabled VFs. Make sure that the VFs the function is finding are actually subordinate to the particular instance of the adapter that is looking for them and not subordinate to some device that has previously enabled SR-IOV.
This is applicable to 3.2+ kernels.
--- drivers/net/ethernet/intel/igb/igb_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/igb/igb_main.c +2 -1
@@ -4965,7 +4965,8 @@ static int igb_find_enabled_vfs(struct i vf_devfn = pdev->devfn +0x80 ; pvfdev =pci_get_device (hw->vendor_id, device_id,NULL );while (pvfdev) { -if (pvfdev->devfn == vf_devfn) +if (pvfdev->devfn == vf_devfn && + (pvfdev->bus->number >= pdev->bus->number)) vfs_found++; vf_devfn += vf_stride; pvfdev = pci_get_device(hw->vendor_id,
Greg KH
maintainerPATCH 3/28 perf evsel: Fix an issue where perf report fails to show the proper percentage
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Naveen N. Rao" <[email protected]>
commit a4a03fc7ef89020baca4f19174e6a43767c6d78a upstream.
This patch fixes an issue where perf report shows nan% for certain perf.data files. The below is from a report for a do_fork probe:
-nan% sshd [kernel.kallsyms] [k] do_fork -nan% packagekitd [kernel.kallsyms] [k] do_fork -nan% dbus-daemon [kernel.kallsyms] [k] do_fork -nan% bash [kernel.kallsyms] [k] do_fork
A git bisect shows commit f3bda2c as the cause. However, looking back through the git history, I saw commit 640c03c which seems to have removed the required initialization for perf_sample->period. The problem only started showing after commit f3bda2c. The below patch re-introduces the initialization and it fixes the problem for me.
With the below patch, for the same perf.data:
73.08% bash [kernel.kallsyms] [k] do_fork 8.97% 11-dhclient [kernel.kallsyms] [k] do_fork 6.41% sshd [kernel.kallsyms] [k] do_fork 3.85% 20-chrony [kernel.kallsyms] [k] do_fork 2.56% sendmail [kernel.kallsyms] [k] do_fork
This patch applies over current linux-tip commit 9949284.
Problem introduced in:
$ git describe 640c03c v2.6.37-rc3-83-g640c03c
--- tools/perf/util/evsel.c | 1 + 1 file changed, 1 insertion(+)
tools/perf/util/evsel.c +1 -0
@@ -390,6 +390,7 @@ int perf_event__parse_sample(const union data->cpu = data->pid = data->tid =-1 ; data->stream_id = data->id = data->time =-1ULL ; + data->period =1 ;if (event->header.type !=PERF_RECORD_SAMPLE ) {if (!sample_id_all)
Greg KH
maintainerPATCH 4/28 perf tools: Fix perf stack to non executable on x86_64
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Olsa <[email protected]>
commit 7a0153ee15575a4d07b5da8c96b79e0b0fd41a12 upstream.
By adding following objects:
bench/mem-memcpy-x86-64-asm.o
the x86_64 perf binary ended up with executable stack.
The reason was that above object are assembler sourced and is missing the GNU-stack note section. In such case the linker assumes that the final binary should not be restricted at all and mark the stack as RWX.
Adding section ".note.GNU-stack" definition to mentioned object, with all flags disabled, thus omiting this object from linker stack flags decision.
Problem introduced in:
$ git describe ea7872b v2.6.37-rc2-19-gea7872b
Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=783570
--- tools/perf/bench/mem-memcpy-x86-64-asm.S | 6 ++++++ 1 file changed, 6 insertions(+)
tools/perf/bench/mem-memcpy-x86-64-asm.S +6 -0
@@ -1,2 +1,8 @@ #include "../../../arch/x86/lib/memcpy_64.S" +/* + * We need to provide note.GNU-stack section, saying that we want + * NOT executable stack. Otherwise the final linking will assume that + * the ELF stack should not be restricted at all and set it RWX. + */ +.section .note.GNU-stack,"",@progbits
Greg KH
maintainerPATCH 5/28 drm/i915: Force explicit bpp selection for intel_dp_link_required
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Keith Packard <[email protected]>
commit c898261c0dad617f0f1080bedc02d507a2fcfb92 upstream.
It is never correct to use intel_crtc->bpp in intel_dp_link_required, so instead pass an explicit bpp in to this function. This patch only supports 18bpp and 24bpp modes, which means that 10bpc modes will be computed incorrectly. Fixing that will require more extensive changes, and so must be addressed separately from this bugfix.
intel_dp_link_required is called from intel_dp_mode_valid and intel_dp_mode_fixup.
* intel_dp_mode_valid is called to list supported modes; in this case, the current crtc values cannot be relevant as the modes in question may never be selected. Thus, using intel_crtc->bpp is never right.
* intel_dp_mode_fixup is called during mode setting, but it is run well before ironlake_crtc_mode_set is called to set intel_crtc->bpp, so using intel_crtc-bpp in this path can only ever get a stale value.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42263
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44881
--- drivers/gpu/drm/i915/intel_dp.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +5 -15
@@ -208,17 +208,8 @@ intel_dp_link_clock(uint8_t link_bw)*/ static int -intel_dp_link_required (struct intel_dp *intel_dp,int pixel_clock,int check_bpp) +intel_dp_link_required (int pixel_clock,int bpp) { -struct drm_crtc *crtc = intel_dp->base.base.crtc; -struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -int bpp =24 ; - -if (check_bpp) - bpp = check_bpp; -else if (intel_crtc) - bpp = intel_crtc->bpp; -return (pixel_clock * bpp +9 ) /10 ; }
@@ -245,12 +236,11 @@ intel_dp_mode_valid(struct drm_connectorreturn MODE_PANEL ; } - mode_rate =intel_dp_link_required (intel_dp, mode->clock,0 ); + mode_rate =intel_dp_link_required (mode->clock,24 ); max_rate =intel_dp_max_data_rate (max_link_clock, max_lanes);if (mode_rate > max_rate) { - mode_rate =intel_dp_link_required (intel_dp, - mode->clock,18 ); + mode_rate =intel_dp_link_required (mode->clock,18 );if (mode_rate > max_rate)return MODE_CLOCK_HIGH ;else
@@ -683,7 +673,7 @@ intel_dp_mode_fixup(struct drm_encoder *int lane_count, clock;int max_lane_count =intel_dp_max_lane_count (intel_dp);int max_clock =intel_dp_max_link_bw (intel_dp) ==DP_LINK_BW_2_7 ?1 :0 ; -int bpp = mode->private_flags &INTEL_MODE_DP_FORCE_6BPC ?18 :0 ; +int bpp = mode->private_flags &INTEL_MODE_DP_FORCE_6BPC ?18 :24 ;static int bws[2 ] = {DP_LINK_BW_1_62 ,DP_LINK_BW_2_7 };if (is_edp (intel_dp) && intel_dp->panel_fixed_mode) {
@@ -701,7 +691,7 @@ intel_dp_mode_fixup(struct drm_encoder *for (clock =0 ; clock <= max_clock; clock++) {int link_avail =intel_dp_max_data_rate (intel_dp_link_clock (bws[clock]), lane_count); -if (intel_dp_link_required (intel_dp, mode->clock, bpp) +if (intel_dp_link_required (mode->clock, bpp) <= link_avail) { intel_dp->link_bw = bws[clock]; intel_dp->lane_count = lane_count;
Greg KH
maintainerPATCH 6/28 drm/i915: no lvds quirk for AOpen MP45
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Vetter <[email protected]>
commit e57b6886f555ab57f40a01713304e2053efe51ec upstream.
According to a bug report, it doesn't have one.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44263
--- drivers/gpu/drm/i915/intel_lvds.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/i915/intel_lvds.c +8 -0
@@ -694,6 +694,14 @@ static const struct dmi_system_id intel_ }, { .callback = intel_no_lvds_dmi_callback, + .ident = "AOpen i45GMx-I", + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"AOpen" ), + DMI_MATCH(DMI_BOARD_NAME, "i45GMx-I"), + }, + }, + { + .callback = intel_no_lvds_dmi_callback, .ident = "Aopen i945GTt-VFA", .matches = { DMI_MATCH(DMI_PRODUCT_VERSION, "AO00001JW"),
Greg KH
maintainerPATCH 7/28 ath9k: Fix kernel panic during driver initilization
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mohammed Shafi Shajakhan <[email protected]>
commit 07445f688218a48bde72316aed9de4fdcc173131 upstream.
all works need to be initialized before ieee80211_register_hw to prevent mac80211 call backs such as drv_start, drv_config getting started. otherwise we would queue/cancel works before initializing them and it leads to kernel panic. this issue can be recreated with the following script in Chrome laptops with AR928X cards, with background scan running (or) Network manager is running
while true
do
sudo modprobe -v ath9k
sleep 3
sudo modprobe -r ath9k
sleep 3
done
EIP: [<81040a47>] __cancel_work_timer+0xb8/0xe1 SS:ESP 0068:f6be9d70 ---[ end trace 4f86d6139a9900ef ]--- Registered led device: ath9k-phy0 ieee80211 phy0: Atheros AR9280 Rev:2 mem=0xf88a0000, irq=16 Kernel panic - not syncing: Fatal exception Pid: 456, comm: wpa_supplicant Tainted: G D 3.0.13 #1 Call Trace: [<81379e21>] panic+0x53/0x14a [<81004a30>] oops_end+0x73/0x81 [<81004b53>] die+0x4c/0x55 [<81002710>] do_trap+0x7c/0x83 [<81002855>] ? do_bounds+0x58/0x58 [<810028cc>] do_invalid_op+0x77/0x81 [<81040a47>] ? __cancel_work_timer+0xb8/0xe1 [<810489ec>] ? sched_clock_cpu+0x81/0x11f [<8103f809>] ? wait_on_work+0xe2/0xf7 [<8137f807>] error_code+0x67/0x6c [<810300d8>] ? wait_consider_task+0x4ba/0x84c [<81040a47>] ? __cancel_work_timer+0xb8/0xe1 [<810380c9>] ? try_to_del_timer_sync+0x5f/0x67 [<81040a91>] cancel_work_sync+0xf/0x11 [<f88d7b7c>] ath_set_channel+0x62/0x25c [ath9k] [<f88d67d1>] ? ath9k_tx_last_beacon+0x26a/0x85c [ath9k] [<f88d8899>] ath_radio_disable+0x3f1/0x68e [ath9k] [<f90d0edb>] ieee80211_hw_config+0x111/0x116 [mac80211] [<f90dd95c>] __ieee80211_recalc_idle+0x919/0xa37 [mac80211] [<f90dda76>] __ieee80211_recalc_idle+0xa33/0xa37 [mac80211] [<812dbed8>] __dev_open+0x82/0xab
--- drivers/net/wireless/ath/ath9k/init.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath9k/init.c +5 -4
@@ -775,6 +775,11 @@ int ath9k_init_device(u16 devid, struct ARRAY_SIZE(ath9k_tpt_blink));#endif +INIT_WORK (&sc->hw_reset_work, ath_reset_work); +INIT_WORK (&sc->hw_check_work, ath_hw_check); +INIT_WORK (&sc->paprd_work, ath_paprd_calibrate); +INIT_DELAYED_WORK (&sc->hw_pll_work, ath_hw_pll_work); +/* Register with mac80211 */ error =ieee80211_register_hw (hw);if (error)
@@ -793,10 +798,6 @@ int ath9k_init_device(u16 devid, struct goto error_world; } -INIT_WORK (&sc->hw_reset_work, ath_reset_work); -INIT_WORK (&sc->hw_check_work, ath_hw_check); -INIT_WORK (&sc->paprd_work, ath_paprd_calibrate); -INIT_DELAYED_WORK (&sc->hw_pll_work, ath_hw_pll_work); sc->last_rssi =ATH_RSSI_DUMMY_MARKER ;ath_init_leds (sc);
Greg KH
maintainerPATCH 8/28 ath9k: fix a WEP crypto related regression
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
commit f88373fa47f3ce6590fdfaa742d0ddacc2ae017f upstream.
commit b4a82a0 "ath9k_hw: fix interpretation of the rx KeyMiss flag" fixed the interpretation of the KeyMiss flag for keycache based lookups, however WEP encryption uses a static index, so KeyMiss is always asserted for it, even though frames are decrypted properly.
Fix this by clearing the ATH9K_RXERR_KEYMISS flag if no keycache based lookup was performed.
--- drivers/net/wireless/ath/ath9k/recv.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/net/wireless/ath/ath9k/recv.c +8 -0
@@ -824,6 +824,14 @@ static bool ath9k_rx_accept(struct ath_c (ATH9K_RXERR_DECRYPT |ATH9K_RXERR_CRC |ATH9K_RXERR_MIC | ATH9K_RXERR_KEYMISS)); +/* +* Key miss events are only relevant for pairwise keys where the +* descriptor does contain a valid key index. This has been observed +* mostly with CCMP encryption. +*/ +if (rx_stats->rs_keyix ==ATH9K_RXKEYIX_INVALID ) + rx_stats->rs_status &= ~ATH9K_RXERR_KEYMISS ; +if (!rx_stats->rs_datalen)return false;/*
Greg KH
maintainerPATCH 9/28 ath9k_hw: fix a RTS/CTS timeout regression
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
commit 55a2bb4a6d5e8c7b324d003e130fd9aaf33be4e6 upstream.
commit adb5066 "ath9k_hw: do not apply the 2.4 ghz ack timeout workaround to cts" reduced the hardware CTS timeout to the normal values specified by the standard, but it turns out while it doesn't need the same extra time that it needs for the ACK timeout, it does need more than the value specified in the standard, but only for 2.4 GHz.
This patch brings the CTS timeout value in sync with the initialization values, while still allowing adjustment for bigger distances.
--- drivers/net/wireless/ath/ath9k/hw.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/hw.c +5 -2
@@ -1034,13 +1034,16 @@ void ath9k_hw_init_global_settings(struc/* * Workaround for early ACK timeouts, add an offset to match the -* initval's 64us ack timeout value. +* initval's 64us ack timeout value. Use 48us for the CTS timeout. * This was initially only meant to work around an issue with delayed * BA frames in some implementations, but it has been found to fix ACK * timeout issues in other cases as well. */ -if (conf->channel && conf->channel->band ==IEEE80211_BAND_2GHZ ) +if (conf->channel && conf->channel->band ==IEEE80211_BAND_2GHZ ) { acktimeout +=64 - sifstime - ah->slottime; + ctstimeout +=48 - sifstime - ah->slottime; + } +ath9k_hw_set_sifs_time (ah, sifstime);ath9k_hw_setslottime (ah, slottime);
Greg KH
maintainerPATCH 10/28 hwmon: (f75375s) Fix bit shifting in f75375_write16
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikolaus Schulz <[email protected]>
commit eb2f255b2d360df3f500042a2258dcf2fcbe89a2 upstream.
In order to extract the high byte of the 16-bit word, shift the word to the right, not to the left.
--- drivers/hwmon/f75375s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/f75375s.c +1 -1
@@ -159,7 +159,7 @@ static inline void f75375_write8(structstatic inline void f75375_write16 (struct i2c_client *client,u8 reg,u16 value) { -int err =i2c_smbus_write_byte_data (client, reg, (value <<8 )); +int err =i2c_smbus_write_byte_data (client, reg, (value >>8 ));if (err)return ;i2c_smbus_write_byte_data (client, reg +1 , (value &0xFF ));
Greg KH
maintainerPATCH 11/28 net: enable TC35815 for MIPS again
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Atsushi Nemoto <[email protected]>
commit a1728800bed3b93b231d99e97c756f622b9991c2 upstream.
8<----------------------------------------------------------------------
From: Ralf Roesch <[email protected]>
Date: Wed, 16 Nov 2011 09:33:50 +0100
Subject: [11/28] net: enable TC35815 for MIPS again
TX493[8,9] MIPS SoCs support 2 Ethernet channels of type TC35815 which are connected to the internal PCI controller.
And JMR3927 MIPS board has a TC35815 chip on board.
These dependencies were lost on movement to drivers/net/ethernet/toshiba.
--- drivers/net/ethernet/toshiba/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/toshiba/Kconfig +1 -1
@@ -5,7 +5,7 @@ config NET_VENDOR_TOSHIBA bool "Toshiba devices" default y - depends on PCI && (PPC_IBM_CELL_BLADE || PPC_CELLEB) || PPC_PS3 + depends on PCI && (PPC_IBM_CELL_BLADE || PPC_CELLEB || MIPS) || PPC_PS3 ---help--- If you have a network (Ethernet) card belonging to this class, say Y and read the Ethernet-HOWTO, available from
Greg KH
maintainerPATCH 12/28 lib: proportion: lower PROP_MAX_SHIFT to 32 on 64-bit kernel
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wu Fengguang <[email protected]>
commit 3310225dfc71a35a2cc9340c15c0e08b14b3c754 upstream.
PROP_MAX_SHIFT should be set to <=32 on 64-bit box. This fixes two bugs in the below lines of bdi_dirty_limit():
bdi_dirty *= numerator; do_div(bdi_dirty, denominator);
1) divide error: do_div() only uses the lower 32 bit of the denominator, which may trimmed to be 0 when PROP_MAX_SHIFT > 32.
2) overflow: (bdi_dirty * numerator) could easily overflow if numerator used up to 48 bits, leaving only 16 bits to bdi_dirty
--- include/linux/proportions.h | 4 ++++ 1 file changed, 4 insertions(+)
include/linux/proportions.h +4 -0
@@ -81,7 +81,11 @@ void prop_inc_percpu(struct prop_descrip* Limit the time part in order to ensure there are some bits left for the * cycle counter and fraction multiply. */ +#if BITS_PER_LONG ==32 #define PROP_MAX_SHIFT (3*BITS_PER_LONG/4) +#else +#define PROP_MAX_SHIFT (BITS_PER_LONG/2) +#endif #define PROP_FRAC_SHIFT (BITS_PER_LONG - PROP_MAX_SHIFT - 1)#define PROP_FRAC_BASE (1UL << PROP_FRAC_SHIFT)
Greg KH
maintainerPATCH 13/28 relay: prevent integer overflow in relay_open()
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit f6302f1bcd75a042df69866d98b8d775a668f8f1 upstream.
"subbuf_size" and "n_subbufs" come from the user and they need to be capped to prevent an integer overflow.
--- kernel/relay.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
kernel/relay.c +8 -2
@@ -164,10 +164,14 @@ depopulate:*/ static struct rchan_buf *relay_create_buf (struct rchan *chan) { -struct rchan_buf *buf =kzalloc (sizeof (struct rchan_buf ),GFP_KERNEL ); -if (!buf) +struct rchan_buf *buf; + +if (chan->n_subbufs >UINT_MAX /sizeof (size_t *))return NULL ; + buf =kzalloc (sizeof (struct rchan_buf ),GFP_KERNEL ); +if (!buf) +return NULL ; buf->padding =kmalloc (chan->n_subbufs *sizeof (size_t *),GFP_KERNEL );if (!buf->padding) goto free_buf;
@@ -574,6 +578,8 @@ struct rchan *relay_open(const char *basif (!(subbuf_size && n_subbufs))return NULL ; +if (subbuf_size >UINT_MAX / n_subbufs) +return NULL ; chan =kzalloc (sizeof (struct rchan ),GFP_KERNEL );if (!chan)
Greg KH
maintainerPATCH 14/28 mac80211: timeout a single frame in the rx reorder buffer
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eliad Peller <[email protected]>
commit 07ae2dfcf4f7143ce191c6436da1c33f179af0d6 upstream.
The current code checks for stored_mpdu_num > 1, causing the reorder_timer to be triggered indefinitely, but the frame is never timed-out (until the next packet is received)
--- net/mac80211/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/rx.c +1 -1
@@ -616,7 +616,7 @@ static void ieee80211_sta_reorder_releas index =seq_sub (tid_agg_rx->head_seq_num, tid_agg_rx->ssn) % tid_agg_rx->buf_size;if (!tid_agg_rx->reorder_buf[index] && - tid_agg_rx->stored_mpdu_num >1 ) { + tid_agg_rx->stored_mpdu_num) {/* * No buffers ready to be released, but check whether any * frames in the reorder buffer have timed out.
Greg KH
maintainerPATCH 15/28 writeback: fix NULL bdi->dev in trace writeback_single_inode
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wu Fengguang <[email protected]>
commit 15eb77a07c714ac80201abd0a9568888bcee6276 upstream.
bdi_prune_sb() resets sb->s_bdi to default_backing_dev_info when the tearing down the original bdi. Fix trace_writeback_single_inode to use sb->s_bdi=default_backing_dev_info rather than bdi->dev=NULL for a teared down bdi.
--- fs/fs-writeback.c | 16 ++++++++-------- include/trace/events/writeback.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-)
fs/fs-writeback.c +8 -8
@@ -48,14 +48,6 @@ struct wb_writeback_work { };/* -* Include the creation of the trace points after defining the -* wb_writeback_work structure so that the definition remains local to this -* file. -*/ -#define CREATE_TRACE_POINTS -#include <trace/events/writeback.h> - -/* * We don't actually have pdflush, but this one is exported though /proc... */ int nr_pdflush_threads;
@@ -87,6 +79,14 @@ static inline struct inode *wb_inode(str return list_entry(head, struct inode, i_wb_list); } +/* +* Include the creation of the trace points after defining the +* wb_writeback_work structure and inline functions so that the definition +* remains local to this file. +*/ +#define CREATE_TRACE_POINTS +#include <trace/events/writeback.h> +/* Wakeup flusher thread or forker thread to fork it. Requires bdi->wb_lock. */ static void bdi_wakeup_flusher (struct backing_dev_info *bdi) {
include/trace/events/writeback.h +1 -1
@@ -418,7 +418,7 @@ DECLARE_EVENT_CLASS(writeback_single_inoTP_fast_assign (strncpy (__entry->name, - dev_name(inode->i_mapping->backing_dev_info->dev), 32); + dev_name(inode_to_bdi(inode)->dev), 32); __entry->ino = inode->i_ino; __entry->state = inode->i_state; __entry->dirtied_when = inode->dirtied_when;
Greg KH
maintainerPATCH 16/28 writeback: fix dereferencing NULL bdi->dev on trace_writeback_queue
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wu Fengguang <[email protected]>
commit 977b7e3a52a7421ad33a393a38ece59f3d41c2fa upstream.
When a SD card is hot removed without umount, del_gendisk() will call bdi_unregister() without destroying/freeing it. This leaves the bdi in the bdi->dev = NULL, bdi->wb.task = NULL, bdi->bdi_list removed state.
When sync(2) gets the bdi before bdi_unregister() and calls bdi_queue_work() after the unregister, trace_writeback_queue will be dereferencing the NULL bdi->dev. Fix it with a simple test for NULL.
LKML-reference: http://lkml.org/lkml/2012/1/18/346
--- include/trace/events/writeback.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
include/trace/events/writeback.h +4 -1
@@ -47,7 +47,10 @@ DECLARE_EVENT_CLASS(writeback_work_class__field (int, reason) ),TP_fast_assign ( - strncpy(__entry->name, dev_name(bdi->dev), 32); + struct device *dev = bdi->dev; +if (!dev) + dev = default_backing_dev_info.dev; +strncpy (__entry->name,dev_name (dev),32 ); __entry->nr_pages = work->nr_pages; __entry->sb_dev = work->sb ? work->sb->s_dev :0 ; __entry->sync_mode = work->sync_mode;
Greg KH
maintainerPATCH 17/28 hwmon: (f75375s) Fix automatic pwm mode setting for F75373 & F75375
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikolaus Schulz <[email protected]>
commit 09e87e5c4f9af656af2a8a3afc03487c5d9287c3 upstream.
In order to enable temperature mode aka automatic mode for the F75373 and F75375 chips, the two FANx_MODE bits in the fan configuration register need be set to 01, not 10.
--- drivers/hwmon/f75375s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/f75375s.c +1 -1
@@ -311,7 +311,7 @@ static int set_pwm_enable_direct(struct fanmode |= (3 <<FAN_CTRL_MODE (nr));break ;case 2 :/* AUTOMATIC*/ - fanmode |= (2 <<FAN_CTRL_MODE (nr)); + fanmode |= (1 <<FAN_CTRL_MODE (nr));break ;case 3 :/* fan speed */ break ;
Greg KH
maintainerPATCH 18/28 cifs: request oplock when doing open on lookup
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <[email protected]>
commit 8b0192a5f478da1c1ae906bf3ffff53f26204f56 upstream.
Currently, it's always set to 0 (no oplock requested).
--- fs/cifs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/dir.c +1 -1
@@ -492,7 +492,7 @@ cifs_lookup(struct inode *parent_dir_ino {int xid;int rc =0 ;/* to get around spurious gcc warning, set to zero here */ -__u32 oplock =0 ; +__u32 oplock = enable_oplocks ?REQ_OPLOCK :0 ;__u16 fileHandle =0 ;bool posix_open = false;struct cifs_sb_info *cifs_sb;
Greg KH
maintainerPATCH 19/28 cifs: dont return error from standard_receive3 after marking response malformed
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <[email protected]>
commit ff4fa4a25a33f92b5653bb43add0c63bea98d464 upstream.
standard_receive3 will check the validity of the response from the server (via checkSMB). It'll pass the result of that check to handle_mid which will dequeue it and mark it with a status of MID_RESPONSE_MALFORMED if checkSMB returned an error. At that point, standard_receive3 will also return an error, which will make the demultiplex thread skip doing the callback for the mid.
This is wrong -- if we were able to identify the request and the response is marked malformed, then we want the demultiplex thread to do the callback. Fix this by making standard_receive3 return 0 in this situation.
--- fs/cifs/connect.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
fs/cifs/connect.c +4 -3
@@ -756,10 +756,11 @@ standard_receive3(struct TCP_Server_Infocifs_dump_mem ("Bad SMB: " , buf, min_t(unsigned int, server->total_read, 48)); -if (mid) -handle_mid (mid, server, smb_buffer, length); +if (!mid) +return length; -return length; +handle_mid (mid, server, smb_buffer, length); +return 0 ; } static int
Greg KH
maintainerPATCH 20/28 crypto: sha512 - Use binary and instead of modulus
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <[email protected]>
commit 58d7d18b5268febb8b1391c6dffc8e2aaa751fcd upstream.
The previous patch used the modulus operator over a power of 2 unnecessarily which may produce suboptimal binary code. This patch changes changes them to binary ands instead.
--- crypto/sha512_generic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
crypto/sha512_generic.c +2 -2
@@ -78,7 +78,7 @@ static inline void LOAD_OP(int I, u64 *Wstatic inline void BLEND_OP (int I ,u64 *W ) { -W [I %16 ] +=s1 (W [(I -2 ) %16 ]) +W [(I -7 ) %16 ] +s0 (W [(I -15 ) %16 ]); +W [I &15 ] +=s1 (W [(I -2 ) &15 ]) +W [(I -7 ) &15 ] +s0 (W [(I -15 ) &15 ]); } static void
@@ -105,7 +105,7 @@ sha512_transform(u64 *state, const u8 *i#define SHA512_16_79 (i, a, b, c, d, e, f, g, h) \ BLEND_OP(i, W); \ - t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[(i)%16]; \ + t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[(i)&15]; \ t2 = e0(a) + Maj(a, b, c); \ d += t1; \ h = t1 + t2
Greg KH
maintainerPATCH 21/28 crypto: sha512 - Avoid stack bloat on i386
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <[email protected]>
commit 3a92d687c8015860a19213e3c102cad6b722f83c upstream.
Unfortunately in reducing W from 80 to 16 we ended up unrolling the loop twice. As gcc has issues dealing with 64-bit ops on i386 this means that we end up using even more stack space (>1K).
This patch solves the W reduction by moving LOAD_OP/BLEND_OP into the loop itself, thus avoiding the need to duplicate it.
While the stack space still isn't great (>0.5K) it is at least in the same ball park as the amount of stack used for our C sha1 implementation.
Note that this patch basically reverts to the original code so the diff looks bigger than it really is.
--- crypto/sha512_generic.c | 68 ++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 36 deletions(-)
crypto/sha512_generic.c +32 -36
@@ -89,46 +89,42 @@ sha512_transform(u64 *state, const u8 *iint i;u64 W [16 ]; -/* load the input */ -for (i =0 ; i <16 ; i++) -LOAD_OP (i,W , input); -/* load the state into our registers */ a=state[0 ]; b=state[1 ]; c=state[2 ]; d=state[3 ]; e=state[4 ]; f=state[5 ]; g=state[6 ]; h=state[7 ]; -#define SHA512_0_15 (i, a, b, c, d, e, f, g, h) \ - t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[i]; \ - t2 = e0(a) + Maj(a, b, c); \ - d += t1; \ - h = t1 + t2 - -#define SHA512_16_79 (i, a, b, c, d, e, f, g, h) \ - BLEND_OP(i, W); \ - t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[(i)&15]; \ - t2 = e0(a) + Maj(a, b, c); \ - d += t1; \ - h = t1 + t2 - -for (i =0 ; i <16 ; i +=8 ) { -SHA512_0_15 (i, a, b, c, d, e, f, g, h); -SHA512_0_15 (i +1 , h, a, b, c, d, e, f, g); -SHA512_0_15 (i +2 , g, h, a, b, c, d, e, f); -SHA512_0_15 (i +3 , f, g, h, a, b, c, d, e); -SHA512_0_15 (i +4 , e, f, g, h, a, b, c, d); -SHA512_0_15 (i +5 , d, e, f, g, h, a, b, c); -SHA512_0_15 (i +6 , c, d, e, f, g, h, a, b); -SHA512_0_15 (i +7 , b, c, d, e, f, g, h, a); - } -for (i =16 ; i <80 ; i +=8 ) { -SHA512_16_79 (i, a, b, c, d, e, f, g, h); -SHA512_16_79 (i +1 , h, a, b, c, d, e, f, g); -SHA512_16_79 (i +2 , g, h, a, b, c, d, e, f); -SHA512_16_79 (i +3 , f, g, h, a, b, c, d, e); -SHA512_16_79 (i +4 , e, f, g, h, a, b, c, d); -SHA512_16_79 (i +5 , d, e, f, g, h, a, b, c); -SHA512_16_79 (i +6 , c, d, e, f, g, h, a, b); -SHA512_16_79 (i +7 , b, c, d, e, f, g, h, a); +/* now iterate */ +for (i=0 ; i<80 ; i+=8 ) { +if (!(i &8 )) { +int j; + +if (i <16 ) { +/* load the input */ +for (j =0 ; j <16 ; j++) +LOAD_OP (i + j,W , input); + }else { +for (j =0 ; j <16 ; j++) { +BLEND_OP (i + j,W ); + } + } + } + + t1 = h +e1 (e) +Ch (e,f,g) + sha512_K[i ] +W [(i &15 )]; + t2 =e0 (a) +Maj (a,b,c); d+=t1; h=t1+t2; + t1 = g +e1 (d) +Ch (d,e,f) + sha512_K[i+1 ] +W [(i &15 ) +1 ]; + t2 =e0 (h) +Maj (h,a,b); c+=t1; g=t1+t2; + t1 = f +e1 (c) +Ch (c,d,e) + sha512_K[i+2 ] +W [(i &15 ) +2 ]; + t2 =e0 (g) +Maj (g,h,a); b+=t1; f=t1+t2; + t1 = e +e1 (b) +Ch (b,c,d) + sha512_K[i+3 ] +W [(i &15 ) +3 ]; + t2 =e0 (f) +Maj (f,g,h); a+=t1; e=t1+t2; + t1 = d +e1 (a) +Ch (a,b,c) + sha512_K[i+4 ] +W [(i &15 ) +4 ]; + t2 =e0 (e) +Maj (e,f,g); h+=t1; d=t1+t2; + t1 = c +e1 (h) +Ch (h,a,b) + sha512_K[i+5 ] +W [(i &15 ) +5 ]; + t2 =e0 (d) +Maj (d,e,f); g+=t1; c=t1+t2; + t1 = b +e1 (g) +Ch (g,h,a) + sha512_K[i+6 ] +W [(i &15 ) +6 ]; + t2 =e0 (c) +Maj (c,d,e); f+=t1; b=t1+t2; + t1 = a +e1 (f) +Ch (f,g,h) + sha512_K[i+7 ] +W [(i &15 ) +7 ]; + t2 =e0 (b) +Maj (b,c,d); e+=t1; a=t1+t2; } state[0 ] += a; state[1 ] += b; state[2 ] += c; state[3 ] += d;
David Miller
maintainerRe: [21/28] crypto: sha512 - Avoid stack bloat on i386
From: Greg KH <[email protected]>
Date: Thu, 16 Feb 2012 16:55:55 -0800
Quoted 1 line
3.2-stable review patch. If anyone has any objections, please let me know.
This causes a stack usage regression on sparc that Herbert is in the middle of merging a fix for into Linus's tree.
Greg KH
maintainerRe: [21/28] crypto: sha512 - Avoid stack bloat on i386
Quoted 7 lines · David Miller
From: Greg KH <[email protected]>
Date: Thu, 16 Feb 2012 16:55:55 -0800Quoted 1 line
3.2-stable review patch. If anyone has any objections, please let me know.
This causes a stack usage regression on sparc that Herbert is in the middle of merging a fix for into Linus's tree.
Ick. Any idea when that will hit Linus's tree? If it's before next Monday, we are good, and I can queue it up here, if not, then I'll drop this and have to add it back later.
thanks,
greg k-h
Re: [21/28] crypto: sha512 - Avoid stack bloat on i386
Quoted 4 lines · Greg KH
Quoted 3 lines · David Miller
From: Greg KH <[email protected]>
Date: Thu, 16 Feb 2012 16:55:55 -0800
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
3.2-stable review patch. If anyone has any objections, please let me know.
This causes a stack usage regression on sparc that Herbert is in the middle of merging a fix for into Linus's tree.
Ick. Any idea when that will hit Linus's tree? If it's before next Monday, we are good, and I can queue it up here, if not, then I'll drop this and have to add it back later.
I've pushed it though it hasn't been pulled yet:
The commit ID is f2ea0f5f04c97b48c88edccba52b0682fbe45087.
Thanks,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Greg KH
maintainerRe: [21/28] crypto: sha512 - Avoid stack bloat on i386
Quoted 10 lines · Herbert Xu
Quoted 9 lines · Greg KH
Quoted 7 lines · David Miller
From: Greg KH <[email protected]>
Date: Thu, 16 Feb 2012 16:55:55 -0800Quoted 1 line
3.2-stable review patch. If anyone has any objections, please let me know.
This causes a stack usage regression on sparc that Herbert is in the middle of merging a fix for into Linus's tree.
Quoted 7 lines
Quoted 3 lines
Ick. Any idea when that will hit Linus's tree? If it's before next Monday, we are good, and I can queue it up here, if not, then I'll drop this and have to add it back later.
I've pushed it though it hasn't been pulled yet:
The commit ID is
f2ea0f5f04c97b48c88edccba52b0682fbe45087.
Thanks, I'll watch out for it.
greg k-h
David Miller
maintainerRe: [21/28] crypto: sha512 - Avoid stack bloat on i386
From: Greg KH <[email protected]>
Date: Thu, 16 Feb 2012 18:37:42 -0800
Quoted 15 lines · Herbert Xu
Quoted 14 lines · Greg KH
Quoted 12 lines · David Miller
Quoted 7 lines
From: Greg KH <[email protected]>
Date: Thu, 16 Feb 2012 16:55:55 -0800Quoted 1 line
3.2-stable review patch. If anyone has any objections, please let me know.
This causes a stack usage regression on sparc that Herbert is in the middle of merging a fix for into Linus's tree.
Ick. Any idea when that will hit Linus's tree? If it's before next Monday, we are good, and I can queue it up here, if not, then I'll drop this and have to add it back later.
Quoted 5 lines
Quoted 3 lines
I've pushed it though it hasn't been pulled yet:
The commit ID is
f2ea0f5f04c97b48c88edccba52b0682fbe45087.Thanks, I'll watch out for it.
Greg, keep in mind that this stuff is in your 3.0-stable series too.
Greg KH
maintainerRe: [21/28] crypto: sha512 - Avoid stack bloat on i386
Quoted 18 lines · David Miller
From: Greg KH <[email protected]>
Date: Thu, 16 Feb 2012 18:37:42 -0800Quoted 15 lines · Herbert Xu
Quoted 14 lines · Greg KH
Quoted 12 lines · David Miller
Quoted 7 lines
From: Greg KH <[email protected]>
Date: Thu, 16 Feb 2012 16:55:55 -0800Quoted 1 line
3.2-stable review patch. If anyone has any objections, please let me know.
This causes a stack usage regression on sparc that Herbert is in the middle of merging a fix for into Linus's tree.
Ick. Any idea when that will hit Linus's tree? If it's before next Monday, we are good, and I can queue it up here, if not, then I'll drop this and have to add it back later.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
I've pushed it though it hasn't been pulled yet:
The commit ID is
f2ea0f5f04c97b48c88edccba52b0682fbe45087.Thanks, I'll watch out for it.
Greg, keep in mind that this stuff is in your 3.0-stable series too.
I just checked, and I also have this in the 2.6.32-stable tree, which I haven't sent out for review, but will next week.
Thanks for pointing it out.
greg k-h
Greg KH
maintainerRe: [21/28] crypto: sha512 - Avoid stack bloat on i386
Quoted 23 lines · Greg KH
Quoted 22 lines · David Miller
From: Greg KH <[email protected]>
Date: Thu, 16 Feb 2012 18:37:42 -0800Quoted 19 lines · Herbert Xu
Quoted 17 lines · Greg KH
Quoted 12 lines · David Miller
Quoted 7 lines
From: Greg KH <[email protected]>
Date: Thu, 16 Feb 2012 16:55:55 -0800Quoted 1 line
3.2-stable review patch. If anyone has any objections, please let me know.
This causes a stack usage regression on sparc that Herbert is in the middle of merging a fix for into Linus's tree.
Ick. Any idea when that will hit Linus's tree? If it's before next Monday, we are good, and I can queue it up here, if not, then I'll drop this and have to add it back later.
I've pushed it though it hasn't been pulled yet:
The commit ID is
f2ea0f5f04c97b48c88edccba52b0682fbe45087.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Thanks, I'll watch out for it.
Greg, keep in mind that this stuff is in your 3.0-stable series too.
I just checked, and I also have this in the 2.6.32-stable tree, which I haven't sent out for review, but will next week.
Thanks for pointing it out.
Ok, that's now in Linus's tree, so I've queued it up for the 3.0 and 3.2 releases in a few hours.
greg k-h
Greg KH
maintainerPATCH 22/28 backing-dev: fix wakeup timer races with bdi_unregister()
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rabin Vincent <[email protected]>
commit 2673b4cf5d59c3ee5e0c12f6d734d38770324dc4 upstream.
While 7a401a972df8e18 ("backing-dev: ensure wakeup_timer is deleted") addressed the problem of the bdi being freed with a queued wakeup timer, there are other races that could happen if the wakeup timer expires after/during bdi_unregister(), before bdi_destroy() is called.
wakeup_timer_fn() could attempt to wakeup a task which has already has been freed, or could access a NULL bdi->dev via the wake_forker_thread tracepoint.
--- mm/backing-dev.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-)
mm/backing-dev.c +19 -6
@@ -318,7 +318,7 @@ static void wakeup_timer_fn(unsigned lonif (bdi->wb.task) {trace_writeback_wake_thread (bdi);wake_up_process (bdi->wb.task); - }else { + }else if (bdi->dev) {/* * When bdi tasks are inactive for long time, they are killed. * In this case we have to wake-up the forker thread which
@@ -584,6 +584,8 @@ EXPORT_SYMBOL(bdi_register_dev);*/ static void bdi_wb_shutdown (struct backing_dev_info *bdi) { +struct task_struct *task; +if (!bdi_cap_writeback_dirty (bdi))return ;
@@ -604,9 +606,14 @@ static void bdi_wb_shutdown(struct backi* unfreeze of the thread before calling kthread_stop(), otherwise * it would never exet if it is currently stuck in the refrigerator. */ -if (bdi->wb.task) { -thaw_process (bdi->wb.task); -kthread_stop (bdi->wb.task); +spin_lock_bh (&bdi->wb_lock); + task = bdi->wb.task; + bdi->wb.task =NULL ; +spin_unlock_bh (&bdi->wb_lock); + +if (task) { +thaw_process (task); +kthread_stop (task); } }
@@ -627,7 +634,9 @@ static void bdi_prune_sb(struct backing_void bdi_unregister (struct backing_dev_info *bdi) { -if (bdi->dev) { +struct device *dev = bdi->dev; + +if (dev) {bdi_set_min_ratio (bdi,0 );trace_writeback_bdi_unregister (bdi);bdi_prune_sb (bdi);
@@ -636,8 +645,12 @@ void bdi_unregister(struct backing_dev_iif (!bdi_cap_flush_forker (bdi))bdi_wb_shutdown (bdi);bdi_debug_unregister (bdi); -device_unregister (bdi->dev); + +spin_lock_bh (&bdi->wb_lock); bdi->dev =NULL ; +spin_unlock_bh (&bdi->wb_lock); + +device_unregister (dev); } }EXPORT_SYMBOL (bdi_unregister);
Greg KH
maintainerPATCH 23/28 ALSA: intel8x0: Fix default inaudible sound on Gateway M520
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel T Chen <[email protected]>
commit 27c3afe6e1cf129faac90405121203962da08ff4 upstream.
The reporter states that audio is inaudible by default without muting 'External Amplifier'. Add a quirk to handle his SSID so that changing the control is not necessary.
--- sound/pci/intel8x0.c | 6 ++++++ 1 file changed, 6 insertions(+)
sound/pci/intel8x0.c +6 -0
@@ -2102,6 +2102,12 @@ static struct ac97_quirk ac97_quirks[] _ }, { .subvendor = 0x161f, + .subdevice = 0x202f, + .name = "Gateway M520", + .type =AC97_TUNE_INV_EAPD + }, + { + .subvendor = 0x161f, .subdevice = 0x203a, .name ="Gateway 4525GZ" ,/* AD1981B */ .type = AC97_TUNE_INV_EAPD
Greg KH
maintainerPATCH 24/28 ALSA: hda - Fix initialization of secondary capture source on VT1705
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit fc1156c0b0f7ad45ec03d919866349eeca2bf18c upstream.
VT1705 codec has two ADCs where the secondary ADC has no MUX but only a fixed connection to the mic pin. This confused the driver and it tries always overriding the input-source selection by assumption of the existing MUX for the secondary ADC, resulted in resetting the input-source at each time PM (including power-saving) occurs.
The fix is simply to check the existence of MUX for secondary ADCs in the initialization code.
--- sound/pci/hda/patch_via.c | 3 +++ 1 file changed, 3 insertions(+)
sound/pci/hda/patch_via.c +3 -0
@@ -665,6 +665,9 @@ static void via_auto_init_analog_input(s/* init input-src */ for (i =0 ; i < spec->num_adc_nids; i++) {int adc_idx = spec->inputs[spec->cur_mux[i]].adc_idx; +/* secondary ADCs must have the unique MUX */ +if (i >0 && !spec->mux_nids[i]) +break ;if (spec->mux_nids[adc_idx]) {int mux_idx = spec->inputs[spec->cur_mux[i]].mux_idx; snd_hda_codec_write(codec, spec->mux_nids[adc_idx], 0,
Greg KH
maintainerPATCH 25/28 ALSA: hda - Fix silent speaker output on Acer Aspire 6935
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 02a237b24d57e2e2d5402c92549e9e792aa24359 upstream.
Since 3.2 kernel, the driver starts trying to assign the multi-io DACs before the speaker, thus it assigns DAC2/3 for multi-io and DAC4 for the speaker for a standard laptop setup like a HP, a speaker, a mic-in and a line-in. However, on Acer Aspire 6935, it seems that the speaker pin 0x14 must be connected with either DAC1 or 2; otherwise it results in silence by some reason, although the codec itself allows the routing to DAC3/4.
As a workaround, the connection list of each pin is reduced to be mapped to either only DAC1/2 or DAC3/4, so that the compatible assignment as in kernel 3.1 is achieved.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42740
--- sound/pci/hda/patch_realtek.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
sound/pci/hda/patch_realtek.c +23 -0
@@ -4213,8 +4213,26 @@ enum {PINFIX_PB_M5210 ,PINFIX_ACER_ASPIRE_7736 ,PINFIX_ASUS_W90V , + ALC889_FIXUP_DAC_ROUTE, }; +/* Fix the connection of some pins for ALC889: +* At least, Acer Aspire 5935 shows the connections to DAC3/4 don't +* work correctly (bko#42740) +*/ +static void alc889_fixup_dac_route (struct hda_codec *codec, +const struct alc_fixup *fix,int action) +{ +if (action ==ALC_FIXUP_ACT_PRE_PROBE ) { +hda_nid_t conn1[2 ] = {0x0c ,0x0d }; +hda_nid_t conn2[2 ] = {0x0e ,0x0f }; +snd_hda_override_conn_list (codec,0x14 ,2 , conn1); +snd_hda_override_conn_list (codec,0x15 ,2 , conn1); +snd_hda_override_conn_list (codec,0x18 ,2 , conn2); +snd_hda_override_conn_list (codec,0x1a ,2 , conn2); + } +} +static const struct alc_fixup alc882_fixups[] = { [PINFIX_ABIT_AW9D_MAX ] = { .type =ALC_FIXUP_PINS ,
@@ -4251,10 +4269,15 @@ static const struct alc_fixup alc882_fix { } } }, + [ALC889_FIXUP_DAC_ROUTE] = { + .type = ALC_FIXUP_FUNC, + .v.func = alc889_fixup_dac_route, + }, };static const struct snd_pci_quirk alc882_fixup_tbl[] = {SND_PCI_QUIRK (0x1025 ,0x0155 ,"Packard-Bell M5120" ,PINFIX_PB_M5210 ), +SND_PCI_QUIRK (0x1025 ,0x0259 ,"Acer Aspire 5935" ,ALC889_FIXUP_DAC_ROUTE ),SND_PCI_QUIRK (0x1043 ,0x1873 ,"ASUS W90V" ,PINFIX_ASUS_W90V ),SND_PCI_QUIRK (0x17aa ,0x3a0d ,"Lenovo Y530" ,PINFIX_LENOVO_Y530 ),SND_PCI_QUIRK (0x147b ,0x107a ,"Abit AW9D-MAX" ,PINFIX_ABIT_AW9D_MAX ),
Greg KH
maintainerPATCH 26/28 mmc: atmel-mci: save and restore sdioirq when soft reset is performed
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ludovic Desroches <[email protected]>
commit 18ee684b8ab666329e0a0a72d8b70f16fb0e2243 upstream.
Sometimes a software reset is needed. Then some registers are saved and restored but the interrupt mask register is missing. It causes issues with sdio devices whose interrupts are masked after reset.
--- drivers/mmc/host/atmel-mci.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/mmc/host/atmel-mci.c +3 -0
@@ -965,11 +965,14 @@ static void atmci_start_request(struct a host->data_status =0 ;if (host->need_reset) { + iflags =atmci_readl (host,ATMCI_IMR ); + iflags &= (ATMCI_SDIOIRQA |ATMCI_SDIOIRQB );atmci_writel (host,ATMCI_CR ,ATMCI_CR_SWRST );atmci_writel (host,ATMCI_CR ,ATMCI_CR_MCIEN );atmci_writel (host,ATMCI_MR , host->mode_reg);if (host->caps.has_cfg_reg)atmci_writel (host,ATMCI_CFG , host->cfg_reg); +atmci_writel (host,ATMCI_IER , iflags); host->need_reset = false; }atmci_writel (host,ATMCI_SDCR , slot->sdc_reg);
Greg KH
maintainerPATCH 27/28 mmc: dw_mmc: Fix PIO mode with support of highmem
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Seungwon Jeon <[email protected]>
commit f9c2a0dc42a6938ff2a80e55ca2bbd1d5581c72e upstream.
Current PIO mode makes a kernel crash with CONFIG_HIGHMEM. Highmem pages have a NULL from sg_virt(sg).
This patch fixes the following problem.
Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = c0004000 [00000000] *pgd=00000000 Internal error: Oops: 817 [#1] PREEMPT SMP Modules linked in: CPU: 0 Not tainted (3.0.15-01423-gdbf465f #589) PC is at dw_mci_pull_data32+0x4c/0x9c LR is at dw_mci_read_data_pio+0x54/0x1f0 pc : [<c0358824>] lr : [<c035988c>] psr: 20000193
sp : c0619d48 ip : c0619d70 fp : c0619d6c
r10: 00000000 r9 : 00000002 r8 : 00001000
r7 : 00000200 r6 : 00000000 r5 : e1dd3100 r4 : 00000000 r3 : 65622023 r2 : 0000007f r1 : eeb96000 r0 : e1dd3100
Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment xkernel
Control: 10c5387d Table: 61e2004a DAC: 00000015 Process swapper (pid: 0, stack limit = 0xc06182f0)
Stack: (0xc0619d48 to 0xc061a000)
9d40: e1dd3100 e1a4f000 00000000 e1dd3100 e1a4f000 00000200
9d60: c0619da4 c0619d70 c035988c c03587e4 c0619d9c e18158f4 e1dd3100 e1dd3100 9d80: 00000020 00000000 00000000 00000020 c06e8a84 00000000 c0619e04 c0619da8 9da0: c0359b24 c0359844 e18158f4 e1dd3164 e1dd3168 e1dd3150 3d02fc79 e1dd3154 9dc0: e1dd3178 00000000 00000020 00000000 e1dd3150 00000000 c10dd7e8 e1a84900 9de0: c061e7cc 00000000 00000000 0000008d c06e8a84 c061e780 c0619e4c c0619e08 9e00: c00c4738 c0359a34 3d02fc79 00000000 c0619e4c c05a1698 c05a1670 c05a165c 9e20: c04de8b0 c061e780 c061e7cc e1a84900 ffffed68 0000008d c0618000 00000000 9e40: c0619e6c c0619e50 c00c48b4 c00c46c8 c061e780 c00423ac c061e7cc ffffed68 9e60: c0619e8c c0619e70 c00c7358 c00c487c 0000008d ffffee38 c0618000 ffffed68 9e80: c0619ea4 c0619e90 c00c4258 c00c72b0 c00423ac ffffee38 c0619ecc c0619ea8 9ea0: c004241c c00c4234 ffffffff f8810000 0000006d 00000002 00000001 7fffffff 9ec0: c0619f44 c0619ed0 c0048bc0 c00423c4 220ae7a9 00000000 386f0d30 0005d3a4 9ee0: c00423ac c10dd0b8 c06f2cd8 c0618000 c0594778 c003a674 7fffffff c0619f44 9f00: 386f0d30 c0619f18 c00a6f94 c005be3c 80000013 ffffffff 386f0d30 0005d3a4 9f20: 386f0d30 0005d2d1 c10dd0a8 c10dd0b8 c06f2cd8 c0618000 c0619f74 c0619f48 9f40: c0345858 c005be00 c00a2440 c0618000 c0618000 c00410d8 c06c1944 c00410fc 9f60: c0594778 c003a674 c0619f9c c0619f78 c004a7e8 c03457b4 c0618000 c06c18f8 9f80: 00000000 c0039c70 c06c18d4 c003a674 c0619fb4 c0619fa0 c04ceafc c004a714 9fa0: c06287b4 c06c18f8 c0619ff4 c0619fb8 c0008b68 c04cea68 c0008578 00000000 9fc0: 00000000 c003a674 00000000 10c5387d c0628658 c003aa78 c062f1c4 4000406a 9fe0: 413fc090 00000000 00000000 c0619ff8 40008044 c0008858 00000000 00000000
Backtrace: [<c03587d8>] (dw_mci_pull_data32+0x0/0x9c) from [<c035988c>] (dw_mci_read_data_pio+0x54/0x1f0) r6:00000200 r5:e1a4f000 r4:e1dd3100 [<c0359838>] (dw_mci_read_data_pio+0x0/0x1f0) from [<c0359b24>] (dw_mci_interrupt+0xfc/0x4a4) [<c0359a28>] (dw_mci_interrupt+0x0/0x4a4) from [<c00c4738>] (handle_irq_event_percpu+0x7c/0x1b4) [<c00c46bc>] (handle_irq_event_percpu+0x0/0x1b4) from [<c00c48b4>] (handle_irq_event+0x44/0x64) [<c00c4870>] (handle_irq_event+0x0/0x64) from [<c00c7358>] (handle_fasteoi_irq+0xb4/0x124) r7:ffffed68 r6:c061e7cc r5:c00423ac r4:c061e780 [<c00c72a4>] (handle_fasteoi_irq+0x0/0x124) from [<c00c4258>] (generic_handle_irq+0x30/0x38) r7:ffffed68 r6:c0618000 r5:ffffee38 r4:0000008d [<c00c4228>] (generic_handle_irq+0x0/0x38) from [<c004241c>] (asm_do_IRQ+0x64/0xe0) r5:ffffee38 r4:c00423ac [<c00423b8>] (asm_do_IRQ+0x0/0xe0) from [<c0048bc0>] (__irq_svc+0x80/0x14c) Exception stack(0xc0619ed0 to 0xc0619f18)
--- drivers/mmc/host/dw_mmc.c | 144 +++++++++++++++++++++++---------------------- include/linux/mmc/dw_mmc.h | 6 + 2 files changed, 79 insertions(+), 71 deletions(-)
drivers/mmc/host/dw_mmc.c +75 -69
@@ -22,7 +22,6 @@#include <linux/ioport.h> #include <linux/module.h> #include <linux/platform_device.h> -#include <linux/scatterlist.h> #include <linux/seq_file.h> #include <linux/slab.h> #include <linux/stat.h>
@@ -502,8 +501,14 @@ static void dw_mci_submit_data(struct dw host->dir_status =DW_MCI_SEND_STATUS ;if (dw_mci_submit_data_dma (host, data)) { +int flags =SG_MITER_ATOMIC ; +if (host->data->flags &MMC_DATA_READ ) + flags |=SG_MITER_TO_SG ; +else + flags |=SG_MITER_FROM_SG ; + +sg_miter_start (&host->sg_miter, data->sg, data->sg_len, flags); host->sg = data->sg; - host->pio_offset =0 ; host->part_buf_start =0 ; host->part_buf_count =0 ;
@@ -953,6 +958,7 @@ static void dw_mci_tasklet_func(unsigned* generates a block interrupt, hence setting * the scatter-gather pointer to NULL. */ +sg_miter_stop (&host->sg_miter); host->sg =NULL ; ctrl =mci_readl (host,CTRL ); ctrl |=SDMMC_CTRL_FIFO_RESET ;
@@ -1286,54 +1292,44 @@ static void dw_mci_pull_data(struct dw_mstatic void dw_mci_read_data_pio (struct dw_mci *host) { -struct scatterlist *sg = host->sg; -void *buf =sg_virt (sg); -unsigned int offset = host->pio_offset; +struct sg_mapping_iter *sg_miter = &host->sg_miter; +void *buf; +unsigned int offset;struct mmc_data *data = host->data;int shift = host->data_shift;u32 status;unsigned int nbytes =0 , len; +unsigned int remain, fcnt; do { - len = host->part_buf_count + - (SDMMC_GET_FCNT(mci_readl(host, STATUS)) << shift); - if (offset + len <= sg->length) { - dw_mci_pull_data(host, (void *)(buf + offset), len); + if (!sg_miter_next(sg_miter)) + goto done; + host->sg = sg_miter->__sg; + buf = sg_miter->addr; + remain = sg_miter->length; + offset = 0; + + do { + fcnt = (SDMMC_GET_FCNT(mci_readl(host, STATUS)) + << shift) + host->part_buf_count; + len = min(remain, fcnt); + if (!len) + break; + dw_mci_pull_data(host, (void *)(buf + offset), len); offset += len; nbytes += len; - - if (offset == sg->length) { - flush_dcache_page(sg_page(sg)); - host->sg = sg = sg_next(sg); - if (!sg) - goto done; - - offset = 0; - buf = sg_virt(sg); - } - } else { - unsigned int remaining = sg->length - offset; - dw_mci_pull_data(host, (void *)(buf + offset), - remaining); - nbytes += remaining; - - flush_dcache_page(sg_page(sg)); - host->sg = sg = sg_next(sg); - if (!sg) - goto done; - - offset = len - remaining; - buf = sg_virt(sg); - dw_mci_pull_data(host, buf, offset); - nbytes += offset; - } + remain -= len; + } while (remain); + sg_miter->consumed = offset; status = mci_readl(host, MINTSTS); mci_writel(host, RINTSTS, SDMMC_INT_RXDR); if (status & DW_MCI_DATA_ERROR_FLAGS) { host->data_status = status; data->bytes_xfered += nbytes; + sg_miter_stop(sg_miter); + host->sg = NULL; smp_wmb(); set_bit(EVENT_DATA_ERROR, &host->pending_events);
@@ -1342,65 +1338,66 @@ static void dw_mci_read_data_pio(structreturn ; } }while (status &SDMMC_INT_RXDR );/*if the RXDR is ready read again*/ - host->pio_offset = offset; data->bytes_xfered += nbytes; + +if (!remain) { +if (!sg_miter_next (sg_miter)) + goto done; + sg_miter->consumed =0 ; + } +sg_miter_stop (sg_miter);return ; done: data->bytes_xfered += nbytes; +sg_miter_stop (sg_miter); + host->sg =NULL ;smp_wmb ();set_bit (EVENT_XFER_COMPLETE , &host->pending_events); }static void dw_mci_write_data_pio (struct dw_mci *host) { -struct scatterlist *sg = host->sg; -void *buf =sg_virt (sg); -unsigned int offset = host->pio_offset; +struct sg_mapping_iter *sg_miter = &host->sg_miter; +void *buf; +unsigned int offset;struct mmc_data *data = host->data;int shift = host->data_shift;u32 status;unsigned int nbytes =0 , len; +unsigned int fifo_depth = host->fifo_depth; +unsigned int remain, fcnt; do { - len = ((host->fifo_depth - - SDMMC_GET_FCNT(mci_readl(host, STATUS))) << shift) - - host->part_buf_count; - if (offset + len <= sg->length) { - host->push_data(host, (void *)(buf + offset), len); + if (!sg_miter_next(sg_miter)) + goto done; + host->sg = sg_miter->__sg; + buf = sg_miter->addr; + remain = sg_miter->length; + offset = 0; + + do { + fcnt = ((fifo_depth - + SDMMC_GET_FCNT(mci_readl(host, STATUS))) + << shift) - host->part_buf_count; + len = min(remain, fcnt); + if (!len) + break; + host->push_data(host, (void *)(buf + offset), len); offset += len; nbytes += len; - if (offset == sg->length) { - host->sg = sg = sg_next(sg); - if (!sg) - goto done; - - offset = 0; - buf = sg_virt(sg); - } - } else { - unsigned int remaining = sg->length - offset; - - host->push_data(host, (void *)(buf + offset), - remaining); - nbytes += remaining; - - host->sg = sg = sg_next(sg); - if (!sg) - goto done; - - offset = len - remaining; - buf = sg_virt(sg); - host->push_data(host, (void *)buf, offset); - nbytes += offset; - } + remain -= len; + } while (remain); + sg_miter->consumed = offset; status = mci_readl(host, MINTSTS); mci_writel(host, RINTSTS, SDMMC_INT_TXDR); if (status & DW_MCI_DATA_ERROR_FLAGS) { host->data_status = status; data->bytes_xfered += nbytes; + sg_miter_stop(sg_miter); + host->sg = NULL; smp_wmb();
@@ -1410,12 +1407,20 @@ static void dw_mci_write_data_pio(structreturn ; } }while (status &SDMMC_INT_TXDR );/* if TXDR write again */ - host->pio_offset = offset; data->bytes_xfered += nbytes; + +if (!remain) { +if (!sg_miter_next (sg_miter)) + goto done; + sg_miter->consumed =0 ; + } +sg_miter_stop (sg_miter);return ; done: data->bytes_xfered += nbytes; +sg_miter_stop (sg_miter); + host->sg =NULL ;smp_wmb ();set_bit (EVENT_XFER_COMPLETE , &host->pending_events); }
@@ -1618,6 +1623,7 @@ static void dw_mci_work_routine_card(str* block interrupt, hence setting the * scatter-gather pointer to NULL. */ +sg_miter_stop (&host->sg_miter); host->sg =NULL ; ctrl =mci_readl (host,CTRL );
include/linux/mmc/dw_mmc.h +4 -2
@@ -14,6 +14,8 @@#ifndef LINUX_MMC_DW_MMC_H #define LINUX_MMC_DW_MMC_H +#include <linux/scatterlist.h> +#define MAX_MCI_SLOTS 2 enum dw_mci_state {
@@ -40,7 +42,7 @@ struct mmc_data;* @lock: Spinlock protecting the queue and associated data. * @regs: Pointer to MMIO registers. * @sg: Scatterlist entry currently being processed by PIO code, if any. -* @pio_offset: Offset into the current scatterlist entry. +* @sg_miter: PIO mapping scatterlist iterator. * @cur_slot: The slot which is currently using the controller. * @mrq: The request currently being processed on @cur_slot, * or NULL if the controller is idle.
@@ -115,7 +117,7 @@ struct dw_mci {void __iomem *regs;struct scatterlist *sg; -unsigned int pio_offset; +struct sg_mapping_iter sg_miter;struct dw_mci_slot *cur_slot;struct mmc_request *mrq;
Greg KH
maintainerPATCH 28/28 xen pvhvm: do not remap pirqs onto evtchns if !xen_have_vector_callback
In reply to Greg KH3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefano Stabellini <[email protected]>
commit 207d543f472c1ac9552df79838dc807cbcaa9740 upstream.
--- arch/x86/pci/xen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/pci/xen.c +1 -1
@@ -374,7 +374,7 @@ int __init pci_xen_init(void)int __init pci_xen_hvm_init (void ) { -if (!xen_feature (XENFEAT_hvm_pirqs)) +if (!xen_have_vector_callback || !xen_feature (XENFEAT_hvm_pirqs))return 0 ;#ifdef CONFIG_ACPI