2.6.39.4-stable review
Subsystems (47)
cover 2.6.39.4-stable review
This is the start of the stable review cycle for the 2.6.39.4 release.
Note, barring anything extremely unusual, this will be the LAST 2.6.39.y kernel release. Everyone should be moving to the 3.0 kernel soon.
There are 70 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 us know. If anyone is a maintainer of the proper subsystem, and wants to add a Signed-off-by: line to the patch, please respond with it.
Responses should be made by Wed, August 3, 2011, 20:00:00 UTC 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/v2.6/stable-review/patch-2.6.39.4-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
Makefile | 2 +- arch/arm/kernel/perf_event.c | 6 +- arch/arm/mach-davinci/board-dm365-evm.c | 4 +- arch/arm/mach-mmp/pxa168.c | 2 +- arch/arm/mach-mmp/pxa910.c | 2 +- arch/arm/mach-pxa/mfp-pxa2xx.c | 4 +- arch/x86/kernel/reboot.c | 8 ++ drivers/ata/libata-eh.c | 12 ++- drivers/firewire/ohci.c | 6 + drivers/gpu/drm/radeon/evergreen.c | 162 +++++++++++++++--------- drivers/gpu/drm/radeon/evergreend.h | 4 +- drivers/gpu/drm/radeon/ni.c | 1 + drivers/gpu/drm/radeon/r600.c | 1 + drivers/gpu/drm/radeon/r600d.h | 2 +- drivers/gpu/drm/radeon/radeon_display.c | 13 ++- drivers/gpu/drm/radeon/rv770.c | 1 + drivers/hwmon/asus_atk0110.c | 1 + drivers/hwmon/it87.c | 2 +- drivers/hwmon/lm95241.c | 22 +++- drivers/hwmon/max1111.c | 11 ++ drivers/hwmon/pmbus.c | 19 ++- drivers/hwmon/pmbus_core.c | 31 ++--- drivers/media/dvb/frontends/dib0070.c | 40 ++----- drivers/media/dvb/frontends/dib0090.c | 71 +++-------- drivers/media/dvb/frontends/dib7000m.c | 49 +++----- drivers/media/dvb/frontends/dib7000p.c | 74 +++-------- drivers/media/dvb/frontends/dib8000.c | 126 +++++-------------- drivers/media/dvb/frontends/dib9000.c | 172 +++++++++----------------- drivers/media/dvb/frontends/dibx000_common.c | 109 +++++++---------- drivers/media/dvb/frontends/dibx000_common.h | 5 - drivers/media/radio/si4713-i2c.c | 4 +- drivers/media/video/bt8xx/bttv-driver.c | 2 +- drivers/media/video/cx23885/cx23885-core.c | 9 +- drivers/media/video/pvrusb2/pvrusb2-hdw.c | 4 + drivers/media/video/tuner-core.c | 59 +++++---- drivers/media/video/v4l2-ioctl.c | 6 + drivers/mmc/host/sdhci-esdhc-imx.c | 2 +- drivers/net/wireless/ath/ath5k/pci.c | 7 +- drivers/net/wireless/ath/ath5k/sysfs.c | 9 +- drivers/net/wireless/ath/ath9k/xmit.c | 3 +- drivers/net/wireless/ath/carl9170/usb.c | 2 + drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 1 + drivers/pci/quirks.c | 23 ++++ drivers/platform/x86/dell-laptop.c | 24 +---- drivers/usb/serial/pl2303.c | 1 + drivers/usb/serial/pl2303.h | 4 + fs/cifs/connect.c | 64 +++++++--- fs/ext4/super.c | 3 + fs/gfs2/file.c | 10 ++- fs/namei.c | 7 +- fs/nfs/nfs4xdr.c | 2 +- fs/partitions/efi.c | 9 ++ fs/xfs/xfs_alloc.c | 6 + include/drm/drm_pciids.h | 2 + include/linux/netdevice.h | 5 +- mm/compaction.c | 42 ++++++- mm/nommu.c | 9 +- mm/vmscan.c | 80 ++++++++---- net/bridge/br_private.h | 1 + net/bridge/br_stp.c | 4 +- net/mac80211/wpa.c | 16 ++- net/sunrpc/rpcb_clnt.c | 2 +- net/sunrpc/sched.c | 27 ++--- sound/soc/blackfin/bf5xx-i2s-pcm.c | 13 ++- sound/soc/codecs/ak4642.c | 2 +- sound/soc/codecs/wm8994.c | 11 +- 66 files changed, 720 insertions(+), 717 deletions(-)
PATCH 1/70 USB: serial: add IDs for WinChipHead USB->RS232 adapter
2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Wolfgang Denk <[email protected]>
commit 026dfaf18973404a01f488d6aa556a8c466e06a4 upstream.
Add ID 4348:5523 for WinChipHead USB->RS 232 adapter with Prolifec PL2303 chipset
--- drivers/usb/serial/pl2303.c | 1 + drivers/usb/serial/pl2303.h | 4 ++++ 2 files changed, 5 insertions(+)
drivers/usb/serial/pl2303.c +1 -0
@@ -91,6 +91,7 @@ static const struct usb_device_id id_tab { USB_DEVICE(SONY_VENDOR_ID, SONY_QN3USB_PRODUCT_ID) }, { USB_DEVICE(SANWA_VENDOR_ID, SANWA_PRODUCT_ID) }, { USB_DEVICE(ADLINK_VENDOR_ID, ADLINK_ND6530_PRODUCT_ID) }, + { USB_DEVICE(WINCHIPHEAD_VENDOR_ID, WINCHIPHEAD_USBSER_PRODUCT_ID) }, { } /* Terminating entry */ };
drivers/usb/serial/pl2303.h +4 -0
@@ -144,3 +144,7 @@/* ADLINK ND-6530 RS232,RS485 and RS422 adapter */ #define ADLINK_VENDOR_ID 0x0b63#define ADLINK_ND6530_PRODUCT_ID 0x6530 + +/* WinChipHead USB->RS 232 adapter */ +#define WINCHIPHEAD_VENDOR_ID 0x4348 +#define WINCHIPHEAD_USBSER_PRODUCT_ID 0x5523
PATCH 2/70 drm/radeon/kms: free ib pool on module unloading
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jerome Glisse <[email protected]>
commit ccd6895d401efad0c0e41d0e93fba4ef3085e268 upstream.
ib pool weren't free for various newer asic on module unload. This doesn't cause much arm but still could be candidate for stable.
--- drivers/gpu/drm/radeon/evergreen.c | 1 + drivers/gpu/drm/radeon/ni.c | 1 + drivers/gpu/drm/radeon/r600.c | 1 + drivers/gpu/drm/radeon/rv770.c | 1 + 4 files changed, 4 insertions(+)
drivers/gpu/drm/radeon/evergreen.c +1 -0
@@ -3150,6 +3150,7 @@ void evergreen_fini(struct radeon_devicer700_cp_fini (rdev);r600_irq_fini (rdev);radeon_wb_fini (rdev); +radeon_ib_pool_fini (rdev);radeon_irq_kms_fini (rdev);evergreen_pcie_gart_fini (rdev);radeon_gem_fini (rdev);
drivers/gpu/drm/radeon/ni.c +1 -0
@@ -1584,6 +1584,7 @@ void cayman_fini(struct radeon_device *rcayman_cp_fini (rdev);r600_irq_fini (rdev);radeon_wb_fini (rdev); +radeon_ib_pool_fini (rdev);radeon_irq_kms_fini (rdev);cayman_pcie_gart_fini (rdev);radeon_gem_fini (rdev);
drivers/gpu/drm/radeon/r600.c +1 -0
@@ -2613,6 +2613,7 @@ void r600_fini(struct radeon_device *rder600_cp_fini (rdev);r600_irq_fini (rdev);radeon_wb_fini (rdev); +radeon_ib_pool_fini (rdev);radeon_irq_kms_fini (rdev);r600_pcie_gart_fini (rdev);radeon_agp_fini (rdev);
drivers/gpu/drm/radeon/rv770.c +1 -0
@@ -1365,6 +1365,7 @@ void rv770_fini(struct radeon_device *rdr700_cp_fini (rdev);r600_irq_fini (rdev);radeon_wb_fini (rdev); +radeon_ib_pool_fini (rdev);radeon_irq_kms_fini (rdev);rv770_pcie_gart_fini (rdev);rv770_vram_scratch_fini (rdev);
PATCH 3/70 drm/radeon/kms: fix typo in evergreen disp int status register
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit 37cba6c6f4687e694ac6e3adcf2c2b2974aa3aae upstream.
--- drivers/gpu/drm/radeon/evergreend.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/evergreend.h +1 -1
@@ -541,7 +541,7 @@# define LB_D5_VBLANK_INTERRUPT (1 << 3)# define DC_HPD5_INTERRUPT (1 << 17)# define DC_HPD5_RX_INTERRUPT (1 << 18) -#define DISP_INTERRUPT_STATUS_CONTINUE5 0x6050 +#define DISP_INTERRUPT_STATUS_CONTINUE5 0x6150# define LB_D6_VLINE_INTERRUPT (1 << 2)# define LB_D6_VBLANK_INTERRUPT (1 << 3)# define DC_HPD6_INTERRUPT (1 << 17)
PATCH 4/70 drm/radeon/kms: fix typo in IH_CNTL swap bitfield
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit fcb857abc4c0d512e99a08ba0415be9a6d65b4c0 upstream.
Only affects BE systems.
--- drivers/gpu/drm/radeon/evergreend.h | 2 +- drivers/gpu/drm/radeon/r600d.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/evergreend.h +1 -1
@@ -460,7 +460,7 @@#define IH_RB_WPTR_ADDR_LO 0x3e14#define IH_CNTL 0x3e18# define ENABLE_INTR (1 << 0) -# define IH_MC_SWAP (x) ((x) << 2) +# define IH_MC_SWAP (x) ((x) << 1)# define IH_MC_SWAP_NONE 0# define IH_MC_SWAP_16BIT 1# define IH_MC_SWAP_32BIT 2
drivers/gpu/drm/radeon/r600d.h +1 -1
@@ -536,7 +536,7 @@#define IH_RB_WPTR_ADDR_LO 0x3e14#define IH_CNTL 0x3e18# define ENABLE_INTR (1 << 0) -# define IH_MC_SWAP (x) ((x) << 2) +# define IH_MC_SWAP (x) ((x) << 1)# define IH_MC_SWAP_NONE 0# define IH_MC_SWAP_16BIT 1# define IH_MC_SWAP_32BIT 2
PATCH 5/70 mm: vmscan: correct check for kswapd sleeping in sleeping_prematurely
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mel Gorman <[email protected]>
commit 08951e545918c1594434d000d88a7793e2452a9b upstream.
During allocator-intensive workloads, kswapd will be woken frequently causing free memory to oscillate between the high and min watermark. This is expected behaviour. Unfortunately, if the highest zone is small, a problem occurs.
This seems to happen most with recent sandybridge laptops but it's probably a co-incidence as some of these laptops just happen to have a small Normal zone. The reproduction case is almost always during copying large files that kswapd pegs at 100% CPU until the file is deleted or cache is dropped.
The problem is mostly down to sleeping_prematurely() keeping kswapd awake when the highest zone is small and unreclaimable and compounded by the fact we shrink slabs even when not shrinking zones causing a lot of time to be spent in shrinkers and a lot of memory to be reclaimed.
Patch 1 corrects sleeping_prematurely to check the zones matching
the classzone_idx instead of all zones.
Patch 2 avoids shrinking slab when we are not shrinking a zone.
Patch 3 notes that sleeping_prematurely is checking lower zones against
a high classzone which is not what allocators or balance_pgdat() is doing leading to an artifical belief that kswapd should be still awake.
Patch 4 notes that when balance_pgdat() gives up on a high zone that the
decision is not communicated to sleeping_prematurely()
This problem affects 2.6.38.8 for certain and is expected to affect 2.6.39 and 3.0-rc4 as well. If accepted, they need to go to -stable to be picked up by distros and this series is against 3.0-rc4. I've cc'd people that reported similar problems recently to see if they still suffer from the problem and if this fixes it.
This patch: correct the check for kswapd sleeping in sleeping_prematurely()
During allocator-intensive workloads, kswapd will be woken frequently causing free memory to oscillate between the high and min watermark. This is expected behaviour.
A problem occurs if the highest zone is small. balance_pgdat() only considers unreclaimable zones when priority is DEF_PRIORITY but sleeping_prematurely considers all zones. It's possible for this sequence to occur
1. kswapd wakes up and enters balance_pgdat()
2. At DEF_PRIORITY, marks highest zone unreclaimable
3. At DEF_PRIORITY-1, ignores highest zone setting end_zone
4. At DEF_PRIORITY-1, calls shrink_slab freeing memory from highest zone, clearing all_unreclaimable. Highest zone is still unbalanced
5. kswapd returns and calls sleeping_prematurely
6. sleeping_prematurely looks at *all* zones, not just the ones being considered by balance_pgdat. The highest small zone has all_unreclaimable cleared but the zone is not balanced. all_zones_ok is false so kswapd stays awake
This patch corrects the behaviour of sleeping_prematurely to check the zones balance_pgdat() checked.
--- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/vmscan.c +1 -1
@@ -2261,7 +2261,7 @@ static bool sleeping_prematurely(pg_datareturn true;/* Check the watermark levels */ -for (i =0 ; i < pgdat->nr_zones; i++) { +for (i =0 ; i <= classzone_idx; i++) {struct zone *zone = pgdat->node_zones + i;if (!populated_zone (zone))
PATCH 6/70 mm/nommu.c: fix remap_pfn_range()
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Bob Liu <[email protected]>
commit 8f3b1327aa454bc8283e96bca7669c3c88b83f79 upstream.
remap_pfn_range() means map physical address pfn<<PAGE_SHIFT to user addr.
For nommu arch it's implemented by vma->vm_start = pfn << PAGE_SHIFT which is wrong acroding the original meaning of this function. And some driver developer using remap_pfn_range() with correct parameter will get unexpected result because vm_start is changed. It should be implementd like addr = pfn << PAGE_SHIFT but which is meanless on nommu arch, this patch just make it simply return.
Parameter name and setting of vma->vm_flags also be fixed.
--- mm/nommu.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
mm/nommu.c +6 -3
@@ -1819,10 +1819,13 @@ struct page *follow_page(struct vm_area_return NULL ; } -int remap_pfn_range (struct vm_area_struct *vma,unsigned long from, -unsigned long to,unsigned long size,pgprot_t prot) +int remap_pfn_range (struct vm_area_struct *vma,unsigned long addr, +unsigned long pfn,unsigned long size,pgprot_t prot) { - vma->vm_start = vma->vm_pgoff <<PAGE_SHIFT ; +if (addr != (pfn <<PAGE_SHIFT )) +return -EINVAL ; + + vma->vm_flags |=VM_IO |VM_RESERVED |VM_PFNMAP ;return 0 ; }EXPORT_SYMBOL (remap_pfn_range);
PATCH 7/70 mm: vmscan: evaluate the watermarks against the correct classzone
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mel Gorman <[email protected]>
commit da175d06b437093f93109ba9e5efbe44dfdf9409 upstream.
When deciding if kswapd is sleeping prematurely, the classzone is taken into account but this is different to what balance_pgdat() and the allocator are doing. Specifically, the DMA zone will be checked based on the classzone used when waking kswapd which could be for a GFP_KERNEL or GFP_HIGHMEM request. The lowmem reserve limit kicks in, the watermark is not met and kswapd thinks it's sleeping prematurely keeping kswapd awake in error.
--- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/vmscan.c +1 -1
@@ -2279,7 +2279,7 @@ static bool sleeping_prematurely(pg_data }if (!zone_watermark_ok_safe (zone, order,high_wmark_pages (zone), - classzone_idx,0 )) + i,0 )) all_zones_ok = false;else balanced += zone->present_pages;
PATCH 8/70 hwmon: (lm95241) Fix chip detection code
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Guenter Roeck <[email protected]>
commit 27739e694a3c34b5e371575d74e500d60111c689 upstream.
The LM95241 driver accepts every chip ID equal to or larger than 0xA4 as its own, and other chips such as LM95245 use chip IDs in the accepted ID range. This results in false chip detection.
Fix problem by accepting only the known LM95241 chip ID.
--- drivers/hwmon/lm95241.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/lm95241.c +1 -1
@@ -339,7 +339,7 @@ static int lm95241_detect(struct i2c_cliif ((i2c_smbus_read_byte_data (new_client,LM95241_REG_R_MAN_ID ) ==MANUFACTURER_ID ) && (i2c_smbus_read_byte_data (new_client,LM95241_REG_R_CHIP_ID ) - >=DEFAULT_REVISION )) { + ==DEFAULT_REVISION )) { name =DEVNAME ; }else { dev_dbg(&adapter->dev, "LM95241 detection failed at 0x%02x\n",
PATCH 9/70 hwmon: (lm95241) Fix negative temperature results
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Guenter Roeck <[email protected]>
commit 0c2a40e2fe4f4af0410f57e84b95b817ec15aa70 upstream.
Negative temperatures were returned in degrees C instead of milli-Degrees C. Also, negative temperatures were reported for remote temperature sensors even if the chip was configured for positive-only results.
Fix by detecting temperature modes, and by treating negative temperatures similar to positive temperatures, with appropriate sign extension.
--- drivers/hwmon/lm95241.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
drivers/hwmon/lm95241.c +14 -6
@@ -98,11 +98,16 @@ struct lm95241_data { };/* Conversions */ -static int TempFromReg (u8 val_h,u8 val_l) +static int temp_from_reg_signed (u8 val_h,u8 val_l) { -if (val_h &0x80 ) -return val_h -0x100 ; -return val_h *1000 + val_l *1000 /256 ; +s16 val_hl = (val_h <<8 ) | val_l; +return val_hl *1000 /256 ; +} + +static int temp_from_reg_unsigned (u8 val_h,u8 val_l) +{ +u16 val_hl = (val_h <<8 ) | val_l; +return val_hl *1000 /256 ; }static struct lm95241_data *lm95241_update_device (struct device *dev)
@@ -135,10 +140,13 @@ static ssize_t show_input(struct device char *buf) {struct lm95241_data *data =lm95241_update_device (dev); +int index =to_sensor_dev_attr (attr)->index;return snprintf (buf,PAGE_SIZE -1 ,"%d\n" , -TempFromReg (data->temp[to_sensor_dev_attr (attr)->index], - data->temp[to_sensor_dev_attr (attr)->index +1 ])); + index ==0 || (data->config & (1 << (index /2 ))) ? +temp_from_reg_signed (data->temp[index], data->temp[index +1 ]) : +temp_from_reg_unsigned (data->temp[index], + data->temp[index +1 ])); } static ssize_t show_type(struct device *dev, struct device_attribute *attr,
PATCH 10/70 hwmon: (pmbus) Auto-detect temp2 and temp3 registers/attributes
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Guenter Roeck <[email protected]>
commit 0e502ec889d33bfcb348e420d7e105bc61c45eb4 upstream.
Additional temperature attribute support is easy to detect, so do it.
--- drivers/hwmon/pmbus.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/hwmon/pmbus.c +4 -0
@@ -63,6 +63,10 @@ static void pmbus_find_sensor_groups(str PMBUS_STATUS_TEMPERATURE)) info->func[0] |= PMBUS_HAVE_STATUS_TEMP; } +if (pmbus_check_word_register (client,0 ,PMBUS_READ_TEMPERATURE_2 )) + info->func[0 ] |=PMBUS_HAVE_TEMP2 ; +if (pmbus_check_word_register (client,0 ,PMBUS_READ_TEMPERATURE_3 )) + info->func[0 ] |=PMBUS_HAVE_TEMP3 ;/* Sensors detected on all pages */ for (page =0 ; page < info->pages; page++) {
PATCH 11/70 hwmon: (pmbus) Drop check for PMBus revision register in probe function
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Guenter Roeck <[email protected]>
commit 7f2c0662e5cfd05f12ca49109e8f787bf2d87b66 upstream.
Some PMBus devices do not support the PMBus revision register, so don't check if it exists.
--- drivers/hwmon/pmbus_core.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/hwmon/pmbus_core.c +3 -8
@@ -1518,14 +1518,9 @@ int pmbus_do_probe(struct i2c_client *cli2c_set_clientdata (client, data);mutex_init (&data->update_lock); -/* -* Bail out if status register or PMBus revision register -* does not exist. -*/ -if (i2c_smbus_read_byte_data (client,PMBUS_STATUS_BYTE ) <0 - ||i2c_smbus_read_byte_data (client,PMBUS_REVISION ) <0 ) { -dev_err (&client->dev, -"Status or revision register not found\n" ); +/* Bail out if PMBus status register does not exist. */ +if (i2c_smbus_read_byte_data (client,PMBUS_STATUS_BYTE ) <0 ) { +dev_err (&client->dev,"PMBus status register not found\n" ); ret = -ENODEV ; goto out_data; }
PATCH 12/70 hwmon: (pmbus) Improve fan detection
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Guenter Roeck <[email protected]>
commit 81ae68142a0483b3791cba99eab268859858f508 upstream.
Some PMBus devices return no error when reading fan speed registers, but don't really support fans. Strengthen fan detection by also checking if fan configuration registers exist.
--- drivers/hwmon/pmbus.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/hwmon/pmbus.c +4 -2
@@ -47,12 +47,14 @@ static void pmbus_find_sensor_groups(strif (info->func[0 ] &&pmbus_check_byte_register (client,0 ,PMBUS_STATUS_INPUT )) info->func[0 ] |=PMBUS_HAVE_STATUS_INPUT ; -if (pmbus_check_word_register (client,0 ,PMBUS_READ_FAN_SPEED_1 )) { +if (pmbus_check_byte_register (client,0 ,PMBUS_FAN_CONFIG_12 ) && +pmbus_check_word_register (client,0 ,PMBUS_READ_FAN_SPEED_1 )) { info->func[0 ] |=PMBUS_HAVE_FAN12 ;if (pmbus_check_byte_register (client,0 ,PMBUS_STATUS_FAN_12 )) info->func[0 ] |=PMBUS_HAVE_STATUS_FAN12 ; } -if (pmbus_check_word_register (client,0 ,PMBUS_READ_FAN_SPEED_3 )) { +if (pmbus_check_byte_register (client,0 ,PMBUS_FAN_CONFIG_34 ) && +pmbus_check_word_register (client,0 ,PMBUS_READ_FAN_SPEED_3 )) { info->func[0 ] |=PMBUS_HAVE_FAN34 ;if (pmbus_check_byte_register (client,0 ,PMBUS_STATUS_FAN_34 )) info->func[0 ] |=PMBUS_HAVE_STATUS_FAN34 ;
PATCH 13/70 hwmon: (pmbus) Use long variables for register to data conversions
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Guenter Roeck <[email protected]>
commit f450c1504d3ff6aace3927c805bdea0ac0669efd upstream.
Using integer variable types for register to data conversions can cause overflows especially for power calculations, which are in microwatt. Use long variables instead.
--- drivers/hwmon/pmbus_core.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/hwmon/pmbus_core.c +10 -10
@@ -355,8 +355,8 @@ static struct pmbus_data *pmbus_update_d* Convert linear sensor values to milli- or micro-units * depending on sensor type. */ -static int pmbus_reg2data_linear (struct pmbus_data *data, -struct pmbus_sensor *sensor) +static long pmbus_reg2data_linear (struct pmbus_data *data, +struct pmbus_sensor *sensor) {s16 exponent;s32 mantissa;
@@ -390,15 +390,15 @@ static int pmbus_reg2data_linear(structelse val >>= -exponent; -return (int )val; +return val; }/* * Convert direct sensor values to milli- or micro-units * depending on sensor type. */ -static int pmbus_reg2data_direct (struct pmbus_data *data, -struct pmbus_sensor *sensor) +static long pmbus_reg2data_direct (struct pmbus_data *data, +struct pmbus_sensor *sensor) {long val = (s16 ) sensor->data;long m, b,R ;
@@ -433,12 +433,12 @@ static int pmbus_reg2data_direct(structR ++; } -return (int )((val - b) / m); +return (val - b) / m; } -static int pmbus_reg2data (struct pmbus_data *data,struct pmbus_sensor *sensor) +static long pmbus_reg2data (struct pmbus_data *data,struct pmbus_sensor *sensor) { -int val; +long val;if (data->info->direct[sensor->class]) val =pmbus_reg2data_direct (data, sensor);
@@ -612,7 +612,7 @@ static int pmbus_get_boolean(struct pmbuif (!s1 && !s2) *val = !!regval;else { -int v1, v2; +long v1, v2;struct pmbus_sensor *sensor1, *sensor2; sensor1 = &data->sensors[s1];
@@ -654,7 +654,7 @@ static ssize_t pmbus_show_sensor(structif (sensor->data <0 )return sensor->data; -return snprintf (buf,PAGE_SIZE ,"%d\n" ,pmbus_reg2data (data, sensor)); +return snprintf (buf,PAGE_SIZE ,"%ld\n" ,pmbus_reg2data (data, sensor)); } static ssize_t pmbus_set_sensor(struct device *dev,
PATCH 14/70 ASoC: Fix Blackfin I2S _pointer() implementation return in bounds values
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mark Brown <[email protected]>
commit e999dc50404d401150a5429b6459473a691fd1a0 upstream.
The Blackfin DMA controller can report one frame beyond the end of the buffer in the wraparound case but ALSA requires that the pointer always be in the buffer. Do the wraparound to handle this. A similar bug is likely to apply to the other Blackfin PCM drivers but the code is less obvious to inspection and I don't have a user to test.
--- sound/soc/blackfin/bf5xx-i2s-pcm.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
sound/soc/blackfin/bf5xx-i2s-pcm.c +11 -2
@@ -138,11 +138,20 @@ static snd_pcm_uframes_t bf5xx_pcm_pointpr_debug ("%s enter\n" , __func__);if (substream->stream ==SNDRV_PCM_STREAM_PLAYBACK ) { diff =sport_curr_offset_tx (sport); - frames =bytes_to_frames (substream->runtime, diff); }else { diff =sport_curr_offset_rx (sport); - frames =bytes_to_frames (substream->runtime, diff); } + +/* +* TX at least can report one frame beyond the end of the +* buffer if we hit the wraparound case - clamp to within the +* buffer as the ALSA APIs require. +*/ +if (diff ==snd_pcm_lib_buffer_bytes (substream)) + diff =0 ; + + frames =bytes_to_frames (substream->runtime, diff); +return frames; }
PATCH 15/70 ASoC: Ensure we delay long enough for WM8994 FLL to lock when starting
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mark Brown <[email protected]>
commit 8e9ddf811ba021506d2316fcfe619faa0ab3f567 upstream.
This delay is very conservative.
--- sound/soc/codecs/wm8994.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/codecs/wm8994.c +2 -0
@@ -1969,6 +1969,8 @@ static int _wm8994_set_fll(struct snd_sosnd_soc_update_bits (codec,WM8994_FLL1_CONTROL_1 + reg_offset,WM8994_FLL1_ENA |WM8994_FLL1_FRAC , reg); + +msleep (5 ); } wm8994->fll[id].in = freq_in;
PATCH 16/70 ASoC: ak4642: fixup snd_soc_update_bits mask for PW_MGMT2
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Kuninori Morimoto <[email protected]>
commit bd7fdbcaa2d06d446577fd3c9b81847b04469e01 upstream.
mask didn't cover update-data
--- sound/soc/codecs/ak4642.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/ak4642.c +1 -1
@@ -357,7 +357,7 @@ static int ak4642_dai_set_fmt(struct snddefault :return -EINVAL ; } -snd_soc_update_bits (codec,PW_MGMT2 ,MS , data); +snd_soc_update_bits (codec,PW_MGMT2 ,MS |MCKO |PMPLL , data);snd_soc_update_bits (codec,MD_CTL1 ,BCKO_MASK , bcko);/* format type */
PATCH 17/70 ARM: 6989/1: perf: do not start the PMU when no events are present
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Will Deacon <[email protected]>
commit f4f38430c94c38187db73a2cf3892cc8b12a2713 upstream.
armpmu_enable can be called in situations where no events are present (for example, from the event rotation tick after a profiled task has exited). In this case, we currently start the PMU anyway which may leave it active inevitably without any events being monitored.
This patch adds a simple check to the enabling code so that we avoid starting the PMU when no events are present.
--- arch/arm/kernel/perf_event.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm/kernel/perf_event.c +4 -2
@@ -588,7 +588,7 @@ static int armpmu_event_init(struct perfstatic void armpmu_enable (struct pmu *pmu) {/* Enable all of the perf events on hardware. */ -int idx; +int idx, enabled =0 ;struct cpu_hw_events *cpuc = &__get_cpu_var (cpu_hw_events);if (!armpmu)
@@ -601,9 +601,11 @@ static void armpmu_enable(struct pmu *pmcontinue ; armpmu->enable (&event->hw, idx); + enabled =1 ; } - armpmu->start (); +if (enabled) + armpmu->start (); }static void armpmu_disable (struct pmu *pmu)
PATCH 18/70 ARM: pxa168: correct nand pmu setting
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Lei Wen <[email protected]>
commit 6662498e132dfa758925a160fd5ef80a083651c3 upstream.
The original pair of <0x01db, 208000000> is invalid. Correct it to the valid value.
The 6th bit of the NFC APMU register indicates NFC works whether at 156Mhz or 78Mhz. So 0x19b indicates NFC works at 156Mhz, and 0x1db indicates it works at 78Mhz.
--- arch/arm/mach-mmp/pxa168.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-mmp/pxa168.c +1 -1
@@ -79,7 +79,7 @@ static APBC_CLK(ssp4, PXA168_SSP4, 4, 0) static APBC_CLK(ssp5, PXA168_SSP5, 4, 0); static APBC_CLK(keypad, PXA168_KPC, 0, 32000); -static APMU_CLK(nand, NAND, 0x01db, 208000000); +static APMU_CLK(nand, NAND, 0x19b, 156000000); static APMU_CLK(lcd, LCD, 0x7f, 312000000);/* device and clock bindings */
PATCH 19/70 ARM: pxa910: correct nand pmu setting
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Lei Wen <[email protected]>
commit d204b2c5b16df935fa9a546c528e168859fddcc0 upstream.
The original pair of <0x01db, 208000000> is invalid. Correct to the valid value.
--- arch/arm/mach-mmp/pxa910.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-mmp/pxa910.c +1 -1
@@ -110,7 +110,7 @@ static APBC_CLK(pwm2, PXA910_PWM2, 1, 13 static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000); static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000); -static APMU_CLK(nand, NAND, 0x01db, 208000000); +static APMU_CLK(nand, NAND, 0x19b, 156000000); static APMU_CLK(u2o, USB, 0x1b, 480000000);/* device and clock bindings */
PATCH 20/70 ARM: pxa: fix PGSR register address calculation
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Paul Parsons <[email protected]>
commit beb0c9b056b1c23d2029b46a425362e9ccbeba01 upstream.
The file mfp-pxa2xx.c defines a macro, PGSR(), which translates a gpio bank number to a PGSR register address. The function pxa2xx_mfp_suspend() erroneously passed in a gpio number instead of a gpio bank number.
--- arch/arm/mach-pxa/mfp-pxa2xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-pxa/mfp-pxa2xx.c +2 -2
@@ -347,9 +347,9 @@ static int pxa2xx_mfp_suspend(struct sysif ((gpio_desc[i].config &MFP_LPM_KEEP_OUTPUT ) && (GPDR (i) &GPIO_bit (i))) {if (GPLR (i) &GPIO_bit (i)) -PGSR (i) |=GPIO_bit (i); +PGSR (gpio_to_bank (i)) |=GPIO_bit (i);else -PGSR (i) &= ~GPIO_bit (i); +PGSR (gpio_to_bank (i)) &= ~GPIO_bit (i); } }
PATCH 21/70 firewire: ohci: do not bind to Pinnacle cards, avert panic
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Stefan Richter <[email protected]>
commit 7f7e37115a8b6724f26d0637a04e1d35e3c59717 upstream.
When firewire-ohci is bound to a Pinnacle MovieBoard, eventually a "Register access failure" is logged and an interrupt storm or a kernel panic happens. https://bugzilla.kernel.org/show_bug.cgi?id=36622
Until this is sorted out (if that is going to succeed at all), let's just prevent firewire-ohci from touching these devices.
--- drivers/firewire/ohci.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/firewire/ohci.c +6 -0
@@ -264,6 +264,7 @@ static char ohci_driver_name[] = KBUILD_#define PCI_DEVICE_ID_AGERE_FW643 0x5901#define PCI_DEVICE_ID_JMICRON_JMB38X_FW 0x2380#define PCI_DEVICE_ID_TI_TSB12LV22 0x8009 +#define PCI_VENDOR_ID_PINNACLE_SYSTEMS 0x11bd#define QUIRK_CYCLE_TIMER 1#define QUIRK_RESET_PACKET 2
@@ -3170,6 +3171,11 @@ static int __devinit pci_probe(struct pcint i, err;size_t size; +if (dev->vendor ==PCI_VENDOR_ID_PINNACLE_SYSTEMS ) { +dev_err (&dev->dev,"Pinnacle MovieBoard is not yet supported\n" ); +return -ENOSYS ; + } + ohci =kzalloc (sizeof (*ohci),GFP_KERNEL );if (ohci ==NULL ) { err = -ENOMEM ;
PATCH 22/70 Revert: "dell-laptop: Toggle the unsupported hardware killswitch"
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Keng-Yu Lin <[email protected]>
commit be65dde82a4a402e9607c2f306f343bf0912623c upstream.
This reverts commit a3d77411e8b2ad661958c1fbee65beb476ec6d70,
as it causes a mess in the wireless rfkill status on some models. It is probably a bad idea to toggle the rfkill for all dell models without the respect to the claim that it is hardware-controlled.
--- drivers/platform/x86/dell-laptop.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-)
drivers/platform/x86/dell-laptop.c +2 -22
@@ -290,12 +290,9 @@ static int dell_rfkill_set(void *data, bdell_send_request (buffer,17 ,11 );/* If the hardware switch controls this radio, and the hardware -switch is disabled, don't allow changing the software state. -If the hardware switch is reported as not supported, always -fire the SMI to toggle the killswitch. */ +switch is disabled, don't allow changing the software state */ if ((hwswitch_state &BIT (hwswitch_bit)) && - !(buffer->output[1 ] &BIT (16 )) && - (buffer->output[1 ] &BIT (0 ))) { + !(buffer->output[1 ] &BIT (16 ))) { ret = -EINVAL ; goto out; }
@@ -401,23 +398,6 @@ static const struct file_operations dellstatic void dell_update_rfkill (struct work_struct *ignored) { -int status; - -get_buffer (); -dell_send_request (buffer,17 ,11 ); - status = buffer->output[1 ]; -release_buffer (); - -/* if hardware rfkill is not supported, set it explicitly */ -if (!(status &BIT (0 ))) { -if (wifi_rfkill) -dell_rfkill_set ((void *)1 , !((status &BIT (17 )) >>17 )); -if (bluetooth_rfkill) -dell_rfkill_set ((void *)2 , !((status &BIT (18 )) >>18 )); -if (wwan_rfkill) -dell_rfkill_set ((void *)3 , !((status &BIT (19 )) >>19 )); - } -if (wifi_rfkill)dell_rfkill_query (wifi_rfkill, (void *)1 );if (bluetooth_rfkill)
PATCH 23/70 v4l2-ioctl.c: prefill tuner type for g_frequency and g/s_tuner
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Hans Verkuil <[email protected]>
commit 227690df75382e46a4f6ea1bbc5df855a674b47f upstream.
The subdevs are supposed to receive a valid tuner type for the g_frequency and g/s_tuner subdev ops. Some drivers do this, others don't. So prefill this in v4l2-ioctl.c based on whether the device node from which this is called is a radio node or not.
The spec does not require applications to fill in the type, and if they leave it at 0 then the 'check_mode' call in tuner-core.c will return an error and the ioctl does nothing.
--- drivers/media/video/v4l2-ioctl.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/media/video/v4l2-ioctl.c +6 -0
@@ -1822,6 +1822,8 @@ static long __video_do_ioctl(struct fileif (!ops->vidioc_g_tuner)break ; + p->type = (vfd->vfl_type ==VFL_TYPE_RADIO ) ? +V4L2_TUNER_RADIO :V4L2_TUNER_ANALOG_TV ; ret = ops->vidioc_g_tuner (file, fh, p);if (!ret) dbgarg(cmd, "index=%d, name=%s, type=%d, "
@@ -1840,6 +1842,8 @@ static long __video_do_ioctl(struct fileif (!ops->vidioc_s_tuner)break ; + p->type = (vfd->vfl_type ==VFL_TYPE_RADIO ) ? +V4L2_TUNER_RADIO :V4L2_TUNER_ANALOG_TV ;dbgarg (cmd,"index=%d, name=%s, type=%d, " "capability=0x%x, rangelow=%d, " "rangehigh=%d, signal=%d, afc=%d, "
@@ -1858,6 +1862,8 @@ static long __video_do_ioctl(struct fileif (!ops->vidioc_g_frequency)break ; + p->type = (vfd->vfl_type ==VFL_TYPE_RADIO ) ? +V4L2_TUNER_RADIO :V4L2_TUNER_ANALOG_TV ; ret = ops->vidioc_g_frequency (file, fh, p);if (!ret) dbgarg(cmd, "tuner=%d, type=%d, frequency=%d\n",
PATCH 24/70 tuner-core: fix s_std and s_tuner
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Hans Verkuil <[email protected]>
commit 4e4a31fb95d88518180517bae3098a23ebde9f9c upstream.
Both s_std and s_tuner are broken because set_mode_freq is called before the new std (for s_std) and audmode (for s_tuner) are set.
This patch splits set_mode_freq in a set_mode and a set_freq and in s_std/s_tuner first calls set_mode, and if that returns 0 (i.e. the mode is supported) then they set t->std/t->audmode and call set_freq.
This fixes a bug where changing std or audmode would actually change it to the previous value.
Discovered while testing analog TV standards for cx18 with a tda18271 tuner.
--- drivers/media/video/tuner-core.c | 59 ++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 28 deletions(-)
drivers/media/video/tuner-core.c +31 -28
@@ -724,19 +724,15 @@ static inline int check_mode(struct tune }/** -* set_mode_freq - Switch tuner to other mode. -* @client: struct i2c_client pointer +* set_mode - Switch tuner to other mode. * @t: a pointer to the module's internal struct_tuner * @mode: enum v4l2_type (radio or TV) -* @freq: frequency to set (0 means to use the previous one) * * If tuner doesn't support the needed mode (radio or TV), prints a * debug message and returns -EINVAL, changing its state to standby. -* Otherwise, changes the state and sets frequency to the last value, if -* the tuner can sleep or if it supports both Radio and TV. +* Otherwise, changes the mode and returns 0. */ -static int set_mode_freq (struct i2c_client *client,struct tuner *t, -enum v4l2_tuner_type mode,unsigned int freq) +static int set_mode (struct tuner *t,enum v4l2_tuner_type mode) {struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
@@ -752,17 +748,27 @@ static int set_mode_freq(struct i2c_clie t->mode = mode;tuner_dbg ("Changing to mode %d\n" , mode); } +return 0 ; +} + +/** +* set_freq - Set the tuner to the desired frequency. +* @t: a pointer to the module's internal struct_tuner +* @freq: frequency to set (0 means to use the current frequency) +*/ +static void set_freq (struct tuner *t,unsigned int freq) +{ +struct i2c_client *client =v4l2_get_subdevdata (&t->sd); +if (t->mode ==V4L2_TUNER_RADIO ) { -if (freq) - t->radio_freq = freq; -set_radio_freq (client, t->radio_freq); +if (!freq) + freq = t->radio_freq; +set_radio_freq (client, freq); }else { -if (freq) - t->tv_freq = freq; -set_tv_freq (client, t->tv_freq); +if (!freq) + freq = t->tv_freq; +set_tv_freq (client, freq); } - -return 0 ; }/*
@@ -1058,10 +1064,9 @@ static void tuner_status(struct dvb_fronstatic int tuner_s_radio (struct v4l2_subdev *sd) {struct tuner *t =to_tuner (sd); -struct i2c_client *client =v4l2_get_subdevdata (sd); -if (set_mode_freq (client, t,V4L2_TUNER_RADIO ,0 ) == -EINVAL ) -return 0 ; +if (set_mode (t,V4L2_TUNER_RADIO ) ==0 ) +set_freq (t,0 );return 0 ; }
@@ -1093,25 +1098,22 @@ static int tuner_s_power(struct v4l2_substatic int tuner_s_std (struct v4l2_subdev *sd,v4l2_std_id std) {struct tuner *t =to_tuner (sd); -struct i2c_client *client =v4l2_get_subdevdata (sd); -if (set_mode_freq (client, t,V4L2_TUNER_ANALOG_TV ,0 ) == -EINVAL ) +if (set_mode (t,V4L2_TUNER_ANALOG_TV ))return 0 ; t->std = std;tuner_fixup_std (t); - +set_freq (t,0 );return 0 ; }static int tuner_s_frequency (struct v4l2_subdev *sd,struct v4l2_frequency *f) {struct tuner *t =to_tuner (sd); -struct i2c_client *client =v4l2_get_subdevdata (sd); - -if (set_mode_freq (client, t, f->type, f->frequency) == -EINVAL ) -return 0 ; +if (set_mode (t, f->type) ==0 ) +set_freq (t, f->frequency);return 0 ; }
@@ -1180,13 +1182,13 @@ static int tuner_g_tuner(struct v4l2_substatic int tuner_s_tuner (struct v4l2_subdev *sd,struct v4l2_tuner *vt) {struct tuner *t =to_tuner (sd); -struct i2c_client *client =v4l2_get_subdevdata (sd); -if (set_mode_freq (client, t, vt->type,0 ) == -EINVAL ) +if (set_mode (t, vt->type))return 0 ;if (t->mode ==V4L2_TUNER_RADIO ) t->audmode = vt->audmode; +set_freq (t,0 );return 0 ; }
@@ -1221,7 +1223,8 @@ static int tuner_resume(struct i2c_clientuner_dbg ("resume\n" );if (!t->standby) -set_mode_freq (c, t, t->type,0 ); +if (set_mode (t, t->type) ==0 ) +set_freq (t,0 );return 0 ; }
PATCH 25/70 tuner-core: fix tuner_resume: use t->mode instead of t->type
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Hans Verkuil <[email protected]>
commit 9bf0ef060ebae452c07cf5b0616247780740bb50 upstream.
set_mode is called with t->type, which is the tuner type. Instead, use t->mode which is the actual tuner mode (i.e. radio vs tv).
--- drivers/media/video/tuner-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/video/tuner-core.c +1 -1
@@ -1223,7 +1223,7 @@ static int tuner_resume(struct i2c_clientuner_dbg ("resume\n" );if (!t->standby) -if (set_mode (t, t->type) ==0 ) +if (set_mode (t, t->mode) ==0 )set_freq (t,0 );return 0 ;
PATCH 26/70 hwmon: (pmbus) Improve auto-detection of temperature status register
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Guenter Roeck <[email protected]>
commit 22e6b2312d221376dcd98a8afb0f314b62d33a91 upstream.
It is possible that a PMBus device supports the READ_TEMPERATURE2 and/or READ_TEMPERATURE3 registers but does not support READ_TEMPERATURE1. Improve temperature status register detection to address this condition.
drivers/hwmon/pmbus.c +6 -5
@@ -59,16 +59,17 @@ static void pmbus_find_sensor_groups(struct i2c_client *client,if (pmbus_check_byte_register (client,0 ,PMBUS_STATUS_FAN_34 )) info->func[0 ] |=PMBUS_HAVE_STATUS_FAN34 ; } -if (pmbus_check_word_register (client,0 ,PMBUS_READ_TEMPERATURE_1 )) { +if (pmbus_check_word_register (client,0 ,PMBUS_READ_TEMPERATURE_1 )) info->func[0 ] |=PMBUS_HAVE_TEMP ; -if (pmbus_check_byte_register (client,0 , -PMBUS_STATUS_TEMPERATURE )) - info->func[0 ] |=PMBUS_HAVE_STATUS_TEMP ; - }if (pmbus_check_word_register (client,0 ,PMBUS_READ_TEMPERATURE_2 )) info->func[0 ] |=PMBUS_HAVE_TEMP2 ;if (pmbus_check_word_register (client,0 ,PMBUS_READ_TEMPERATURE_3 )) info->func[0 ] |=PMBUS_HAVE_TEMP3 ; +if (info->func[0 ] & (PMBUS_HAVE_TEMP |PMBUS_HAVE_TEMP2 + |PMBUS_HAVE_TEMP3 ) + &&pmbus_check_byte_register (client,0 , +PMBUS_STATUS_TEMPERATURE )) + info->func[0 ] |=PMBUS_HAVE_STATUS_TEMP ;/* Sensors detected on all pages */ for (page =0 ; page < info->pages; page++) {
PATCH 27/70 pvrusb2: fix g/s_tuner support
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Hans Verkuil <[email protected]>
commit 50e9efd60b213ce43ad6979bfc18e25eec2d8413 upstream.
The tuner-core subdev requires that the type field of v4l2_tuner is filled in correctly. This is done in v4l2-ioctl.c, but pvrusb2 doesn't use that yet, so we have to do it manually based on whether the current input is radio or not.
Tested with my pvrusb2.
--- drivers/media/video/pvrusb2/pvrusb2-hdw.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/media/video/pvrusb2/pvrusb2-hdw.c +4 -0
@@ -3046,6 +3046,8 @@ static void pvr2_subdev_update(struct pvif (hdw->input_dirty || hdw->audiomode_dirty || hdw->force_dirty) {struct v4l2_tuner vt;memset (&vt,0 ,sizeof (vt)); + vt.type = (hdw->input_val ==PVR2_CVAL_INPUT_RADIO ) ? +V4L2_TUNER_RADIO :V4L2_TUNER_ANALOG_TV ; vt.audmode = hdw->audiomode_val;v4l2_device_call_all (&hdw->v4l2_dev,0 , tuner, s_tuner, &vt); }
@@ -5171,6 +5173,8 @@ void pvr2_hdw_status_poll(struct pvr2_hd {struct v4l2_tuner *vtp = &hdw->tuner_signal_info;memset (vtp,0 ,sizeof (*vtp)); + vtp->type = (hdw->input_val ==PVR2_CVAL_INPUT_RADIO ) ? +V4L2_TUNER_RADIO :V4L2_TUNER_ANALOG_TV ; hdw->tuner_signal_stale =0 ;/* Note: There apparently is no replacement for VIDIOC_CROPCAP using v4l2-subdev - therefore we can't support that AT ALL right
PATCH 28/70 bttv: fix s_tuner for radio
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Hans Verkuil <[email protected]>
commit a024c1a6b274e11596d124619e43c25560f64c01 upstream.
Fix typo: g_tuner should have been s_tuner.
Tested with a bttv card.
--- drivers/media/video/bt8xx/bttv-driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/video/bt8xx/bttv-driver.c +1 -1
@@ -3474,7 +3474,7 @@ static int radio_s_tuner(struct file *fiif (0 != t->index)return -EINVAL ; -bttv_call_all (btv, tuner, g_tuner, t); +bttv_call_all (btv, tuner, s_tuner, t);return 0 ; }
PATCH 29/70 fs/partitions/efi.c: corrupted GUID partition tables can cause kernel oops
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Timo Warns <[email protected]>
commit 3eb8e74ec72736b9b9d728bad30484ec89c91dde upstream.
The kernel automatically evaluates partition tables of storage devices. The code for evaluating GUID partitions (in fs/partitions/efi.c) contains a bug that causes a kernel oops on certain corrupted GUID partition tables.
This bug has security impacts, because it allows, for example, to prepare a storage device that crashes a kernel subsystem upon connecting the device (e.g., a "USB Stick of (Partial) Death").
crc = efi_crc32((const unsigned char *) (*gpt), le32_to_cpu((*gpt)->header_size));
computes a CRC32 checksum over gpt covering (*gpt)->header_size bytes. There is no validation of (*gpt)->header_size before the efi_crc32 call.
A corrupted partition table may have large values for (*gpt)->header_size.
In this case, the CRC32 computation access memory beyond the memory
allocated for gpt, which may cause a kernel heap overflow.
Validate value of GUID partition table header size.
--- fs/partitions/efi.c | 9 +++++++++ 1 file changed, 9 insertions(+)
fs/partitions/efi.c +9 -0
@@ -310,6 +310,15 @@ static int is_gpt_valid(struct parsed_pa goto fail; } +/* Check the GUID Partition Table header size */ +if (le32_to_cpu ((*gpt)->header_size) > +bdev_logical_block_size (state->bdev)) { +pr_debug ("GUID Partition Table Header size is wrong: %u > %u\n" , +le32_to_cpu ((*gpt)->header_size), +bdev_logical_block_size (state->bdev)); + goto fail; + } +/* Check the GUID Partition Table CRC */ origcrc =le32_to_cpu ((*gpt)->header_crc32); (*gpt)->header_crc32 =0 ;
PATCH 30/70 drm/radeon/kms: fix backend map typo on juniper
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit 9a4a0b9c9fa6ad9902f49801d7b770462b69c4d3 upstream.
Don't enable backends that don't exist.
--- drivers/gpu/drm/radeon/evergreen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/evergreen.c +1 -1
@@ -1900,7 +1900,7 @@ static void evergreen_gpu_init(struct ra gb_backend_map =0x66442200 ;break ;case CHIP_JUNIPER : - gb_backend_map =0x00006420 ; + gb_backend_map =0x00002200 ;break ;default : gb_backend_map =
PATCH 31/70 NFSv4.1: update nfs4_fattr_bitmap_maxsz
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andy Adamson <[email protected]>
commit e5012d1f3861d18c7f3814e757c1c3ab3741dbcd upstream.
Attribute IDs assigned in RFC 5661 now require three bitmaps. Fixes hitting a BUG_ON in xdr_shrink_bufhead when getting ACLs.
--- fs/nfs/nfs4xdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/nfs4xdr.c +1 -1
@@ -91,7 +91,7 @@ static int nfs4_stat_to_errno(int);#define encode_getfh_maxsz (op_encode_hdr_maxsz)#define decode_getfh_maxsz (op_decode_hdr_maxsz + 1 + \ ((3+NFS4_FHSIZE) >> 2)) -#define nfs4_fattr_bitmap_maxsz 3 +#define nfs4_fattr_bitmap_maxsz 4#define encode_getattr_maxsz (op_encode_hdr_maxsz + nfs4_fattr_bitmap_maxsz)#define nfs4_name_maxsz (1 + ((3 + NFS4_MAXNAMLEN) >> 2))#define nfs4_path_maxsz (1 + ((3 + NFS4_MAXPATHLEN) >> 2))
PATCH 32/70 mac80211: fix TKIP replay vulnerability
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Johannes Berg <[email protected]>
commit 34459512ffa7236c849466e3bd604801389734e1 upstream.
Unlike CCMP, the presence or absence of the QoS field doesn't change the encryption, only the TID is used. When no QoS field is present, zero is used as the TID value. This means that it is possible for an attacker to take a QoS packet with TID 0 and replay it as a non-QoS packet.
Unfortunately, mac80211 uses different IVs for checking the validity of the packet's TKIP IV when it checks TID 0 and when it checks non-QoS packets. This means it is vulnerable to this replay attack.
To fix this, use the same replay counter for TID 0 and non-QoS packets by overriding the rx->queue value to 0 if it is 16 (non-QoS).
This is a minimal fix for now. I caused this issue in
commit 1411f9b531f0a910cd1c85a337737c1e6ffbae6a
Author: Johannes Berg <[email protected]> Date: Thu Jul 10 10:11:02 2008 +0200
mac80211: fix RX sequence number check
while fixing a sequence number issue (there, a separate counter needs to be used).
--- net/mac80211/wpa.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
net/mac80211/wpa.c +13 -3
@@ -86,6 +86,11 @@ ieee80211_rx_h_michael_mic_verify(structstruct sk_buff *skb = rx->skb;struct ieee80211_rx_status *status =IEEE80211_SKB_RXCB (skb);struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; +int queue = rx->queue; + +/* otherwise, TKIP is vulnerable to TID 0 vs. non-QoS replays */ +if (rx->queue ==NUM_RX_DATA_QUEUES -1 ) + queue =0 ;/* No way to verify the MIC if the hardware stripped it */ if (status->flag &RX_FLAG_MMIC_STRIPPED )
@@ -119,8 +124,8 @@ ieee80211_rx_h_michael_mic_verify(structskb_trim (skb, skb->len -MICHAEL_MIC_LEN );/* update IV in key information to be able to detect replays */ - rx->key->u.tkip.rx[rx->queue].iv32 = rx->tkip_iv32; - rx->key->u.tkip.rx[rx->queue].iv16 = rx->tkip_iv16; + rx->key->u.tkip.rx[queue].iv32 = rx->tkip_iv32; + rx->key->u.tkip.rx[queue].iv16 = rx->tkip_iv16;return RX_CONTINUE ; }
@@ -201,6 +206,11 @@ ieee80211_crypto_tkip_decrypt(struct ieestruct ieee80211_key *key = rx->key;struct sk_buff *skb = rx->skb;struct ieee80211_rx_status *status =IEEE80211_SKB_RXCB (skb); +int queue = rx->queue; + +/* otherwise, TKIP is vulnerable to TID 0 vs. non-QoS replays */ +if (rx->queue ==NUM_RX_DATA_QUEUES -1 ) + queue =0 ; hdrlen =ieee80211_hdrlen (hdr->frame_control);
@@ -221,7 +231,7 @@ ieee80211_crypto_tkip_decrypt(struct iee res =ieee80211_tkip_decrypt_data (rx->local->wep_rx_tfm, key, skb->data + hdrlen, skb->len - hdrlen, rx->sta->sta.addr, - hdr->addr1, hwaccel, rx->queue, + hdr->addr1, hwaccel, queue, &rx->tkip_iv32, &rx->tkip_iv16);if (res !=TKIP_DECRYPT_OK )
PATCH 33/70 carl9170: add NEC WL300NU-AG usbid
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Christian Lamparter <[email protected]>
commit 06a86ddbf557cb8a0f7ded54e872e9d456002d52 upstream.
--- drivers/net/wireless/ath/carl9170/usb.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/ath/carl9170/usb.c +2 -0
@@ -112,6 +112,8 @@ static struct usb_device_id carl9170_usb { USB_DEVICE(0x04bb, 0x093f) },/* NEC WL300NU-G */ { USB_DEVICE(0x0409, 0x0249) }, +/* NEC WL300NU-AG */ + { USB_DEVICE(0x0409, 0x02b4) },/* AVM FRITZ!WLAN USB Stick N */ { USB_DEVICE(0x057c, 0x8401) },/* AVM FRITZ!WLAN USB Stick N 2.4 */
PATCH 34/70 rtlwifi: rtl8192cu: Add new USB ID for Netgear WNA1000M
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Yoann DI-RUZZA <[email protected]>
commit 35cbcbc6f39da30c39bc0a1e679ec44506c4eb3d upstream.
--- drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +1 -0
@@ -278,6 +278,7 @@ static struct usb_device_id rtl8192c_usb {RTL_USB_DEVICE(0x06f8, 0xe033, rtl92cu_hal_cfg)}, /*Hercules - Edimax*/ {RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/ {RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/ + {RTL_USB_DEVICE(0x0846, 0x9041, rtl92cu_hal_cfg)}, /*NetGear WNA1000M*/ {RTL_USB_DEVICE(0x0Df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/ {RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*//* HP - Lite-On ,8188CUS Slim Combo */
PATCH 35/70 SUNRPC: Fix a race between work-queue and rpc_killall_tasks
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Trond Myklebust <[email protected]>
commit b55c59892e1f3b6c7d4b9ccffb4263e1486fb990 upstream.
Since rpc_killall_tasks may modify the rpc_task's tk_action field without any locking, we need to be careful when dereferencing it.
--- net/sunrpc/sched.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-)
net/sunrpc/sched.c +11 -16
@@ -616,30 +616,25 @@ static void __rpc_execute(struct rpc_tasBUG_ON (RPC_IS_QUEUED (task));for (;;) { +void (*do_action)(struct rpc_task *);/* -* Execute any pending callback. +* Execute any pending callback first. */ -if (task->tk_callback) { -void (*save_callback)(struct rpc_task *); - -/* -* We set tk_callback to NULL before calling it, -* in case it sets the tk_callback field itself: -*/ - save_callback = task->tk_callback; - task->tk_callback =NULL ; -save_callback (task); - }else { + do_action = task->tk_callback; + task->tk_callback =NULL ; +if (do_action ==NULL ) {/* * Perform the next FSM step. -* tk_action may be NULL when the task has been killed -* by someone else. +* tk_action may be NULL if the task has been killed. +* In particular, note that rpc_killall_tasks may +* do this at any time, so beware when dereferencing. */ -if (task->tk_action ==NULL ) + do_action = task->tk_action; +if (do_action ==NULL )break ; - task->tk_action (task); } +do_action (task);/* * Lockless check for whether task is sleeping or not.
PATCH 36/70 SUNRPC: Fix use of static variable in rpcb_getport_async
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ben Greear <[email protected]>
commit ec0dd267bf7d08cb30e321e45a75fd40edd7e528 upstream.
Because struct rpcbind_args *map was declared static, if two threads entered this method at the same time, the values assigned to map could be sent two two differen tasks. This could cause all sorts of problems, include use-after-free and double-free of memory.
Fix this by removing the static declaration so that the map pointer is on the stack.
--- net/sunrpc/rpcb_clnt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sunrpc/rpcb_clnt.c +1 -1
@@ -528,7 +528,7 @@ void rpcb_getport_async(struct rpc_tasku32 bind_version;struct rpc_xprt *xprt;struct rpc_clnt *rpcb_clnt; -static struct rpcbind_args *map; +struct rpcbind_args *map;struct rpc_task *child;struct sockaddr_storage addr;struct sockaddr *sap = (struct sockaddr *)&addr;
PATCH 37/70 drm/radeon/kms: add new NI pci ids
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit e3c1620434ac77b618ce74c024ace3559602ac99 upstream.
--- include/drm/drm_pciids.h | 2 ++ 1 file changed, 2 insertions(+)
include/drm/drm_pciids.h +2 -0
@@ -182,6 +182,7 @@ {0x1002, 0x6750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6758, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6759, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x675F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6760, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6761, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6762, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
@@ -192,6 +193,7 @@ {0x1002, 0x6767, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6768, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6770, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x6778, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6779, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6880, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ {0x1002, 0x6888, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \
PATCH 38/70 ath9k: Fix tx throughput drops for AR9003 chips with AES encryption
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Rajkumar Manoharan <[email protected]>
commit 4f6760b01bda625e9555e16d8e9ba8126a9c9498 upstream.
While sending aggregated frames in AES, the AR5416 chips required additional padding b/w subframes. This workaround is not needed for edma (AR9003 family) chips. With this patch ~4Mbps thoughput improvement was observed in clear environment.
--- drivers/net/wireless/ath/ath9k/xmit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/xmit.c +2 -1
@@ -662,7 +662,8 @@ static int ath_compute_num_delims(struct* TODO - this could be improved to be dependent on the rate. * The hardware can keep up at lower rates, but not higher rates */ -if (fi->keyix !=ATH9K_TXKEYIX_INVALID ) +if ((fi->keyix !=ATH9K_TXKEYIX_INVALID ) && + !(sc->sc_ah->caps.hw_caps &ATH9K_HW_CAP_EDMA )) ndelim +=ATH_AGGR_ENCRYPTDELIM ;/*
PATCH 39/70 ath5k: fix incorrect use of drvdata in sysfs code
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Pavel Roskin <[email protected]>
commit 95acbd432b4c6498c5b4b2f92e0e05e3c032d4f8 upstream.
--- drivers/net/wireless/ath/ath5k/sysfs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath5k/sysfs.c +6 -3
@@ -10,7 +10,8 @@ static ssize_t ath5k_attr_show_##name(ststruct device_attribute *attr, \ char *buf) \ { \ - struct ath5k_softc *sc = dev_get_drvdata(dev); \ + struct ieee80211_hw *hw = dev_get_drvdata(dev); \ +struct ath5k_softc *sc = hw->priv; \return snprintf (buf,PAGE_SIZE ,"%d\n" , get); \ } \ \
@@ -18,7 +19,8 @@ static ssize_t ath5k_attr_store_##name(sstruct device_attribute *attr, \ const char *buf, size_t count) \ { \ - struct ath5k_softc *sc = dev_get_drvdata(dev); \ + struct ieee80211_hw *hw = dev_get_drvdata(dev); \ +struct ath5k_softc *sc = hw->priv; \int val; \ \ val = (int )simple_strtoul (buf,NULL ,10 ); \
@@ -33,7 +35,8 @@ static ssize_t ath5k_attr_show_##name(ststruct device_attribute *attr, \ char *buf) \ { \ - struct ath5k_softc *sc = dev_get_drvdata(dev); \ + struct ieee80211_hw *hw = dev_get_drvdata(dev); \ +struct ath5k_softc *sc = hw->priv; \return snprintf (buf,PAGE_SIZE ,"%d\n" , get); \ } \ static DEVICE_ATTR(name, S_IRUGO, ath5k_attr_show_##name, NULL)
PATCH 40/70 ath5k: fix incorrect use of drvdata in PCI suspend/resume code
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Pavel Roskin <[email protected]>
commit 37000b305bff81bb1ee2f7f37b1319b670a08f76 upstream.
--- drivers/net/wireless/ath/ath5k/pci.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath5k/pci.c +5 -2
@@ -265,7 +265,9 @@ ath5k_pci_remove(struct pci_dev *pdev)#ifdef CONFIG_PM_SLEEP static int ath5k_pci_suspend (struct device *dev) { -struct ath5k_softc *sc =pci_get_drvdata (to_pci_dev (dev)); +struct pci_dev *pdev =to_pci_dev (dev); +struct ieee80211_hw *hw =pci_get_drvdata (pdev); +struct ath5k_softc *sc = hw->priv;ath5k_led_off (sc);return 0 ;
@@ -274,7 +276,8 @@ static int ath5k_pci_suspend(struct devistatic int ath5k_pci_resume (struct device *dev) {struct pci_dev *pdev =to_pci_dev (dev); -struct ath5k_softc *sc =pci_get_drvdata (pdev); +struct ieee80211_hw *hw =pci_get_drvdata (pdev); +struct ath5k_softc *sc = hw->priv;/* * Suspend/Resume resets the PCI configuration space, so we have to
PATCH 41/70 drm/radeon/kms: clean up multiple crtc handling for
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
evergreen+ (v2)
From: Alex Deucher <[email protected]>
commit b7eff394670366a42935bfbaef67a6f7185627d7 upstream.
evergreen+ asics have 2-6 crtcs. Don't access crtc registers for crtc regs that don't exist as they have very high latency and may cause problems on some asics. The previous code missed a few cases and was not fine grained enough (missed the 4 crtc case for example).
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=38800
v2: fix typo noticed by Chris Bandy <[email protected]>
--- drivers/gpu/drm/radeon/evergreen.c | 159 ++++++++++++++++++++++--------------- 1 file changed, 98 insertions(+), 61 deletions(-)
drivers/gpu/drm/radeon/evergreen.c +98 -61
@@ -960,17 +960,19 @@ void evergreen_mc_stop(struct radeon_dev { save->vga_control[0 ] =RREG32 (D1VGA_CONTROL ); save->vga_control[1 ] =RREG32 (D2VGA_CONTROL ); - save->vga_control[2 ] =RREG32 (EVERGREEN_D3VGA_CONTROL ); - save->vga_control[3 ] =RREG32 (EVERGREEN_D4VGA_CONTROL ); - save->vga_control[4 ] =RREG32 (EVERGREEN_D5VGA_CONTROL ); - save->vga_control[5 ] =RREG32 (EVERGREEN_D6VGA_CONTROL ); save->vga_render_control =RREG32 (VGA_RENDER_CONTROL ); save->vga_hdp_control =RREG32 (VGA_HDP_CONTROL ); save->crtc_control[0 ] =RREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC0_REGISTER_OFFSET ); save->crtc_control[1 ] =RREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC1_REGISTER_OFFSET ); -if (!(rdev->flags &RADEON_IS_IGP )) { +if (rdev->num_crtc >=4 ) { + save->vga_control[2 ] =RREG32 (EVERGREEN_D3VGA_CONTROL ); + save->vga_control[3 ] =RREG32 (EVERGREEN_D4VGA_CONTROL ); save->crtc_control[2 ] =RREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC2_REGISTER_OFFSET ); save->crtc_control[3 ] =RREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC3_REGISTER_OFFSET ); + } +if (rdev->num_crtc >=6 ) { + save->vga_control[4 ] =RREG32 (EVERGREEN_D5VGA_CONTROL ); + save->vga_control[5 ] =RREG32 (EVERGREEN_D6VGA_CONTROL ); save->crtc_control[4 ] =RREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC4_REGISTER_OFFSET ); save->crtc_control[5 ] =RREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC5_REGISTER_OFFSET ); }
@@ -979,35 +981,45 @@ void evergreen_mc_stop(struct radeon_devWREG32 (VGA_RENDER_CONTROL ,0 );WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC0_REGISTER_OFFSET ,1 );WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC1_REGISTER_OFFSET ,1 ); -if (!(rdev->flags &RADEON_IS_IGP )) { +if (rdev->num_crtc >=4 ) {WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC2_REGISTER_OFFSET ,1 );WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC3_REGISTER_OFFSET ,1 ); + } +if (rdev->num_crtc >=6 ) {WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC4_REGISTER_OFFSET ,1 );WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC5_REGISTER_OFFSET ,1 ); }WREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC0_REGISTER_OFFSET ,0 );WREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC1_REGISTER_OFFSET ,0 ); -if (!(rdev->flags &RADEON_IS_IGP )) { +if (rdev->num_crtc >=4 ) {WREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC2_REGISTER_OFFSET ,0 );WREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC3_REGISTER_OFFSET ,0 ); + } +if (rdev->num_crtc >=6 ) {WREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC4_REGISTER_OFFSET ,0 );WREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC5_REGISTER_OFFSET ,0 ); }WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC0_REGISTER_OFFSET ,0 );WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC1_REGISTER_OFFSET ,0 ); -if (!(rdev->flags &RADEON_IS_IGP )) { +if (rdev->num_crtc >=4 ) {WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC2_REGISTER_OFFSET ,0 );WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC3_REGISTER_OFFSET ,0 ); + } +if (rdev->num_crtc >=6 ) {WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC4_REGISTER_OFFSET ,0 );WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC5_REGISTER_OFFSET ,0 ); }WREG32 (D1VGA_CONTROL ,0 );WREG32 (D2VGA_CONTROL ,0 ); -WREG32 (EVERGREEN_D3VGA_CONTROL ,0 ); -WREG32 (EVERGREEN_D4VGA_CONTROL ,0 ); -WREG32 (EVERGREEN_D5VGA_CONTROL ,0 ); -WREG32 (EVERGREEN_D6VGA_CONTROL ,0 ); +if (rdev->num_crtc >=4 ) { +WREG32 (EVERGREEN_D3VGA_CONTROL ,0 ); +WREG32 (EVERGREEN_D4VGA_CONTROL ,0 ); + } +if (rdev->num_crtc >=6 ) { +WREG32 (EVERGREEN_D5VGA_CONTROL ,0 ); +WREG32 (EVERGREEN_D6VGA_CONTROL ,0 ); + } }void evergreen_mc_resume (struct radeon_device *rdev,struct evergreen_mc_save *save)
@@ -1030,7 +1042,7 @@ void evergreen_mc_resume(struct radeon_dWREG32 (EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS +EVERGREEN_CRTC1_REGISTER_OFFSET , (u32 )rdev->mc.vram_start); -if (!(rdev->flags &RADEON_IS_IGP )) { +if (rdev->num_crtc >=4 ) {WREG32 (EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS_HIGH +EVERGREEN_CRTC2_REGISTER_OFFSET ,upper_32_bits (rdev->mc.vram_start)); WREG32(EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS_HIGH + EVERGREEN_CRTC2_REGISTER_OFFSET,
@@ -1048,7 +1060,8 @@ void evergreen_mc_resume(struct radeon_d (u32)rdev->mc.vram_start);WREG32 (EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS +EVERGREEN_CRTC3_REGISTER_OFFSET , (u32 )rdev->mc.vram_start); - + } +if (rdev->num_crtc >=6 ) {WREG32 (EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS_HIGH +EVERGREEN_CRTC4_REGISTER_OFFSET ,upper_32_bits (rdev->mc.vram_start)); WREG32(EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS_HIGH + EVERGREEN_CRTC4_REGISTER_OFFSET,
@@ -1076,31 +1089,41 @@ void evergreen_mc_resume(struct radeon_d/* Restore video state */ WREG32 (D1VGA_CONTROL , save->vga_control[0 ]);WREG32 (D2VGA_CONTROL , save->vga_control[1 ]); -WREG32 (EVERGREEN_D3VGA_CONTROL , save->vga_control[2 ]); -WREG32 (EVERGREEN_D4VGA_CONTROL , save->vga_control[3 ]); -WREG32 (EVERGREEN_D5VGA_CONTROL , save->vga_control[4 ]); -WREG32 (EVERGREEN_D6VGA_CONTROL , save->vga_control[5 ]); +if (rdev->num_crtc >=4 ) { +WREG32 (EVERGREEN_D3VGA_CONTROL , save->vga_control[2 ]); +WREG32 (EVERGREEN_D4VGA_CONTROL , save->vga_control[3 ]); + } +if (rdev->num_crtc >=6 ) { +WREG32 (EVERGREEN_D5VGA_CONTROL , save->vga_control[4 ]); +WREG32 (EVERGREEN_D6VGA_CONTROL , save->vga_control[5 ]); + }WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC0_REGISTER_OFFSET ,1 );WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC1_REGISTER_OFFSET ,1 ); -if (!(rdev->flags &RADEON_IS_IGP )) { +if (rdev->num_crtc >=4 ) {WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC2_REGISTER_OFFSET ,1 );WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC3_REGISTER_OFFSET ,1 ); + } +if (rdev->num_crtc >=6 ) {WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC4_REGISTER_OFFSET ,1 );WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC5_REGISTER_OFFSET ,1 ); }WREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC0_REGISTER_OFFSET , save->crtc_control[0 ]);WREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC1_REGISTER_OFFSET , save->crtc_control[1 ]); -if (!(rdev->flags &RADEON_IS_IGP )) { +if (rdev->num_crtc >=4 ) {WREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC2_REGISTER_OFFSET , save->crtc_control[2 ]);WREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC3_REGISTER_OFFSET , save->crtc_control[3 ]); + } +if (rdev->num_crtc >=6 ) {WREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC4_REGISTER_OFFSET , save->crtc_control[4 ]);WREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC5_REGISTER_OFFSET , save->crtc_control[5 ]); }WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC0_REGISTER_OFFSET ,0 );WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC1_REGISTER_OFFSET ,0 ); -if (!(rdev->flags &RADEON_IS_IGP )) { +if (rdev->num_crtc >=4 ) {WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC2_REGISTER_OFFSET ,0 );WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC3_REGISTER_OFFSET ,0 ); + } +if (rdev->num_crtc >=6 ) {WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC4_REGISTER_OFFSET ,0 );WREG32 (EVERGREEN_CRTC_UPDATE_LOCK +EVERGREEN_CRTC5_REGISTER_OFFSET ,0 ); }
@@ -2327,18 +2350,22 @@ void evergreen_disable_interrupt_state(sWREG32 (GRBM_INT_CNTL ,0 );WREG32 (INT_MASK +EVERGREEN_CRTC0_REGISTER_OFFSET ,0 );WREG32 (INT_MASK +EVERGREEN_CRTC1_REGISTER_OFFSET ,0 ); -if (!(rdev->flags &RADEON_IS_IGP )) { +if (rdev->num_crtc >=4 ) {WREG32 (INT_MASK +EVERGREEN_CRTC2_REGISTER_OFFSET ,0 );WREG32 (INT_MASK +EVERGREEN_CRTC3_REGISTER_OFFSET ,0 ); + } +if (rdev->num_crtc >=6 ) {WREG32 (INT_MASK +EVERGREEN_CRTC4_REGISTER_OFFSET ,0 );WREG32 (INT_MASK +EVERGREEN_CRTC5_REGISTER_OFFSET ,0 ); }WREG32 (GRPH_INT_CONTROL +EVERGREEN_CRTC0_REGISTER_OFFSET ,0 );WREG32 (GRPH_INT_CONTROL +EVERGREEN_CRTC1_REGISTER_OFFSET ,0 ); -if (!(rdev->flags &RADEON_IS_IGP )) { +if (rdev->num_crtc >=4 ) {WREG32 (GRPH_INT_CONTROL +EVERGREEN_CRTC2_REGISTER_OFFSET ,0 );WREG32 (GRPH_INT_CONTROL +EVERGREEN_CRTC3_REGISTER_OFFSET ,0 ); + } +if (rdev->num_crtc >=6 ) {WREG32 (GRPH_INT_CONTROL +EVERGREEN_CRTC4_REGISTER_OFFSET ,0 );WREG32 (GRPH_INT_CONTROL +EVERGREEN_CRTC5_REGISTER_OFFSET ,0 ); }
@@ -2457,19 +2484,25 @@ int evergreen_irq_set(struct radeon_deviWREG32 (INT_MASK +EVERGREEN_CRTC0_REGISTER_OFFSET , crtc1);WREG32 (INT_MASK +EVERGREEN_CRTC1_REGISTER_OFFSET , crtc2); -if (!(rdev->flags &RADEON_IS_IGP )) { +if (rdev->num_crtc >=4 ) {WREG32 (INT_MASK +EVERGREEN_CRTC2_REGISTER_OFFSET , crtc3);WREG32 (INT_MASK +EVERGREEN_CRTC3_REGISTER_OFFSET , crtc4); + } +if (rdev->num_crtc >=6 ) {WREG32 (INT_MASK +EVERGREEN_CRTC4_REGISTER_OFFSET , crtc5);WREG32 (INT_MASK +EVERGREEN_CRTC5_REGISTER_OFFSET , crtc6); }WREG32 (GRPH_INT_CONTROL +EVERGREEN_CRTC0_REGISTER_OFFSET , grph1);WREG32 (GRPH_INT_CONTROL +EVERGREEN_CRTC1_REGISTER_OFFSET , grph2); -WREG32 (GRPH_INT_CONTROL +EVERGREEN_CRTC2_REGISTER_OFFSET , grph3); -WREG32 (GRPH_INT_CONTROL +EVERGREEN_CRTC3_REGISTER_OFFSET , grph4); -WREG32 (GRPH_INT_CONTROL +EVERGREEN_CRTC4_REGISTER_OFFSET , grph5); -WREG32 (GRPH_INT_CONTROL +EVERGREEN_CRTC5_REGISTER_OFFSET , grph6); +if (rdev->num_crtc >=4 ) { +WREG32 (GRPH_INT_CONTROL +EVERGREEN_CRTC2_REGISTER_OFFSET , grph3); +WREG32 (GRPH_INT_CONTROL +EVERGREEN_CRTC3_REGISTER_OFFSET , grph4); + } +if (rdev->num_crtc >=6 ) { +WREG32 (GRPH_INT_CONTROL +EVERGREEN_CRTC4_REGISTER_OFFSET , grph5); +WREG32 (GRPH_INT_CONTROL +EVERGREEN_CRTC5_REGISTER_OFFSET , grph6); + }WREG32 (DC_HPD1_INT_CONTROL , hpd1);WREG32 (DC_HPD2_INT_CONTROL , hpd2);
@@ -2493,53 +2526,57 @@ static inline void evergreen_irq_ack(str rdev->irq.stat_regs.evergreen.disp_int_cont5 =RREG32 (DISP_INTERRUPT_STATUS_CONTINUE5 ); rdev->irq.stat_regs.evergreen.d1grph_int =RREG32 (GRPH_INT_STATUS +EVERGREEN_CRTC0_REGISTER_OFFSET ); rdev->irq.stat_regs.evergreen.d2grph_int =RREG32 (GRPH_INT_STATUS +EVERGREEN_CRTC1_REGISTER_OFFSET ); - rdev->irq.stat_regs.evergreen.d3grph_int =RREG32 (GRPH_INT_STATUS +EVERGREEN_CRTC2_REGISTER_OFFSET ); - rdev->irq.stat_regs.evergreen.d4grph_int =RREG32 (GRPH_INT_STATUS +EVERGREEN_CRTC3_REGISTER_OFFSET ); - rdev->irq.stat_regs.evergreen.d5grph_int =RREG32 (GRPH_INT_STATUS +EVERGREEN_CRTC4_REGISTER_OFFSET ); - rdev->irq.stat_regs.evergreen.d6grph_int =RREG32 (GRPH_INT_STATUS +EVERGREEN_CRTC5_REGISTER_OFFSET ); +if (rdev->num_crtc >=4 ) { + rdev->irq.stat_regs.evergreen.d3grph_int =RREG32 (GRPH_INT_STATUS +EVERGREEN_CRTC2_REGISTER_OFFSET ); + rdev->irq.stat_regs.evergreen.d4grph_int =RREG32 (GRPH_INT_STATUS +EVERGREEN_CRTC3_REGISTER_OFFSET ); + } +if (rdev->num_crtc >=6 ) { + rdev->irq.stat_regs.evergreen.d5grph_int =RREG32 (GRPH_INT_STATUS +EVERGREEN_CRTC4_REGISTER_OFFSET ); + rdev->irq.stat_regs.evergreen.d6grph_int =RREG32 (GRPH_INT_STATUS +EVERGREEN_CRTC5_REGISTER_OFFSET ); + }if (rdev->irq.stat_regs.evergreen.d1grph_int &GRPH_PFLIP_INT_OCCURRED )WREG32 (GRPH_INT_STATUS +EVERGREEN_CRTC0_REGISTER_OFFSET ,GRPH_PFLIP_INT_CLEAR );if (rdev->irq.stat_regs.evergreen.d2grph_int &GRPH_PFLIP_INT_OCCURRED )WREG32 (GRPH_INT_STATUS +EVERGREEN_CRTC1_REGISTER_OFFSET ,GRPH_PFLIP_INT_CLEAR ); -if (rdev->irq.stat_regs.evergreen.d3grph_int &GRPH_PFLIP_INT_OCCURRED ) -WREG32 (GRPH_INT_STATUS +EVERGREEN_CRTC2_REGISTER_OFFSET ,GRPH_PFLIP_INT_CLEAR ); -if (rdev->irq.stat_regs.evergreen.d4grph_int &GRPH_PFLIP_INT_OCCURRED ) -WREG32 (GRPH_INT_STATUS +EVERGREEN_CRTC3_REGISTER_OFFSET ,GRPH_PFLIP_INT_CLEAR ); -if (rdev->irq.stat_regs.evergreen.d5grph_int &GRPH_PFLIP_INT_OCCURRED ) -WREG32 (GRPH_INT_STATUS +EVERGREEN_CRTC4_REGISTER_OFFSET ,GRPH_PFLIP_INT_CLEAR ); -if (rdev->irq.stat_regs.evergreen.d6grph_int &GRPH_PFLIP_INT_OCCURRED ) -WREG32 (GRPH_INT_STATUS +EVERGREEN_CRTC5_REGISTER_OFFSET ,GRPH_PFLIP_INT_CLEAR ); -if (rdev->irq.stat_regs.evergreen.disp_int &LB_D1_VBLANK_INTERRUPT )WREG32 (VBLANK_STATUS +EVERGREEN_CRTC0_REGISTER_OFFSET ,VBLANK_ACK );if (rdev->irq.stat_regs.evergreen.disp_int &LB_D1_VLINE_INTERRUPT )WREG32 (VLINE_STATUS +EVERGREEN_CRTC0_REGISTER_OFFSET ,VLINE_ACK ); -if (rdev->irq.stat_regs.evergreen.disp_int_cont &LB_D2_VBLANK_INTERRUPT )WREG32 (VBLANK_STATUS +EVERGREEN_CRTC1_REGISTER_OFFSET ,VBLANK_ACK );if (rdev->irq.stat_regs.evergreen.disp_int_cont &LB_D2_VLINE_INTERRUPT )WREG32 (VLINE_STATUS +EVERGREEN_CRTC1_REGISTER_OFFSET ,VLINE_ACK ); -if (rdev->irq.stat_regs.evergreen.disp_int_cont2 &LB_D3_VBLANK_INTERRUPT ) -WREG32 (VBLANK_STATUS +EVERGREEN_CRTC2_REGISTER_OFFSET ,VBLANK_ACK ); -if (rdev->irq.stat_regs.evergreen.disp_int_cont2 &LB_D3_VLINE_INTERRUPT ) -WREG32 (VLINE_STATUS +EVERGREEN_CRTC2_REGISTER_OFFSET ,VLINE_ACK ); - -if (rdev->irq.stat_regs.evergreen.disp_int_cont3 &LB_D4_VBLANK_INTERRUPT ) -WREG32 (VBLANK_STATUS +EVERGREEN_CRTC3_REGISTER_OFFSET ,VBLANK_ACK ); -if (rdev->irq.stat_regs.evergreen.disp_int_cont3 &LB_D4_VLINE_INTERRUPT ) -WREG32 (VLINE_STATUS +EVERGREEN_CRTC3_REGISTER_OFFSET ,VLINE_ACK ); - -if (rdev->irq.stat_regs.evergreen.disp_int_cont4 &LB_D5_VBLANK_INTERRUPT ) -WREG32 (VBLANK_STATUS +EVERGREEN_CRTC4_REGISTER_OFFSET ,VBLANK_ACK ); -if (rdev->irq.stat_regs.evergreen.disp_int_cont4 &LB_D5_VLINE_INTERRUPT ) -WREG32 (VLINE_STATUS +EVERGREEN_CRTC4_REGISTER_OFFSET ,VLINE_ACK ); - -if (rdev->irq.stat_regs.evergreen.disp_int_cont5 &LB_D6_VBLANK_INTERRUPT ) -WREG32 (VBLANK_STATUS +EVERGREEN_CRTC5_REGISTER_OFFSET ,VBLANK_ACK ); -if (rdev->irq.stat_regs.evergreen.disp_int_cont5 &LB_D6_VLINE_INTERRUPT ) -WREG32 (VLINE_STATUS +EVERGREEN_CRTC5_REGISTER_OFFSET ,VLINE_ACK ); +if (rdev->num_crtc >=4 ) { +if (rdev->irq.stat_regs.evergreen.d3grph_int &GRPH_PFLIP_INT_OCCURRED ) +WREG32 (GRPH_INT_STATUS +EVERGREEN_CRTC2_REGISTER_OFFSET ,GRPH_PFLIP_INT_CLEAR ); +if (rdev->irq.stat_regs.evergreen.d4grph_int &GRPH_PFLIP_INT_OCCURRED ) +WREG32 (GRPH_INT_STATUS +EVERGREEN_CRTC3_REGISTER_OFFSET ,GRPH_PFLIP_INT_CLEAR ); +if (rdev->irq.stat_regs.evergreen.disp_int_cont2 &LB_D3_VBLANK_INTERRUPT ) +WREG32 (VBLANK_STATUS +EVERGREEN_CRTC2_REGISTER_OFFSET ,VBLANK_ACK ); +if (rdev->irq.stat_regs.evergreen.disp_int_cont2 &LB_D3_VLINE_INTERRUPT ) +WREG32 (VLINE_STATUS +EVERGREEN_CRTC2_REGISTER_OFFSET ,VLINE_ACK ); +if (rdev->irq.stat_regs.evergreen.disp_int_cont3 &LB_D4_VBLANK_INTERRUPT ) +WREG32 (VBLANK_STATUS +EVERGREEN_CRTC3_REGISTER_OFFSET ,VBLANK_ACK ); +if (rdev->irq.stat_regs.evergreen.disp_int_cont3 &LB_D4_VLINE_INTERRUPT ) +WREG32 (VLINE_STATUS +EVERGREEN_CRTC3_REGISTER_OFFSET ,VLINE_ACK ); + } + +if (rdev->num_crtc >=6 ) { +if (rdev->irq.stat_regs.evergreen.d5grph_int &GRPH_PFLIP_INT_OCCURRED ) +WREG32 (GRPH_INT_STATUS +EVERGREEN_CRTC4_REGISTER_OFFSET ,GRPH_PFLIP_INT_CLEAR ); +if (rdev->irq.stat_regs.evergreen.d6grph_int &GRPH_PFLIP_INT_OCCURRED ) +WREG32 (GRPH_INT_STATUS +EVERGREEN_CRTC5_REGISTER_OFFSET ,GRPH_PFLIP_INT_CLEAR ); +if (rdev->irq.stat_regs.evergreen.disp_int_cont4 &LB_D5_VBLANK_INTERRUPT ) +WREG32 (VBLANK_STATUS +EVERGREEN_CRTC4_REGISTER_OFFSET ,VBLANK_ACK ); +if (rdev->irq.stat_regs.evergreen.disp_int_cont4 &LB_D5_VLINE_INTERRUPT ) +WREG32 (VLINE_STATUS +EVERGREEN_CRTC4_REGISTER_OFFSET ,VLINE_ACK ); +if (rdev->irq.stat_regs.evergreen.disp_int_cont5 &LB_D6_VBLANK_INTERRUPT ) +WREG32 (VBLANK_STATUS +EVERGREEN_CRTC5_REGISTER_OFFSET ,VBLANK_ACK ); +if (rdev->irq.stat_regs.evergreen.disp_int_cont5 &LB_D6_VLINE_INTERRUPT ) +WREG32 (VLINE_STATUS +EVERGREEN_CRTC5_REGISTER_OFFSET ,VLINE_ACK ); + }if (rdev->irq.stat_regs.evergreen.disp_int &DC_HPD1_INTERRUPT ) { tmp =RREG32 (DC_HPD1_INT_CONTROL );
PATCH 3/3 mm: compaction: abort compaction if too many pages are isolated and caller is asynchronous V2
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mel Gorman <[email protected]>
commit: f9e35b3b41f47c4e17d8132edbcab305a6aaa4b0 upstream
Asynchronous compaction is used when promoting to huge pages. This is all very nice but if there are a number of processes in compacting memory, a large number of pages can be isolated. An "asynchronous" process can stall for long periods of time as a result with a user reporting that firefox can stall for 10s of seconds. This patch aborts asynchronous compaction if too many pages are isolated as it's better to fail a hugepage promotion than stall a process.
--- mm/compaction.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-)
mm/compaction.c +24 -5
@@ -251,11 +251,18 @@ static bool too_many_isolated(struct zonreturn isolated > (inactive + active) /2 ; } +/* possible outcome of isolate_migratepages */ +typedef enum { +ISOLATE_ABORT ,/* Abort compaction now */ +ISOLATE_NONE ,/* No pages isolated, continue scanning */ +ISOLATE_SUCCESS ,/* Pages isolated, migrate */ +}isolate_migrate_t ; +/* * Isolate all pages that can be migrated from the block pointed to by * the migrate scanner within compact_control. */ -static unsigned long isolate_migratepages (struct zone *zone, +static isolate_migrate_t isolate_migratepages (struct zone *zone,struct compact_control *cc) {unsigned long low_pfn, end_pfn;
@@ -272,7 +279,7 @@ static unsigned long isolate_migratepage/* Do not cross the free scanner or scan within a memory hole */ if (end_pfn > cc->free_pfn || !pfn_valid (low_pfn)) { cc->migrate_pfn = end_pfn; -return 0 ; +return ISOLATE_NONE ; }/*
@@ -281,10 +288,14 @@ static unsigned long isolate_migratepage* delay for some time until fewer pages are isolated */ while (unlikely (too_many_isolated (zone))) { +/* async migration should just abort */ +if (!cc->sync) +return ISOLATE_ABORT ; +congestion_wait (BLK_RW_ASYNC ,HZ /10 );if (fatal_signal_pending (current)) -return 0 ; +return ISOLATE_ABORT ; }/* Time to isolate some pages for migration */
@@ -369,7 +380,7 @@ static unsigned long isolate_migratepagetrace_mm_compaction_isolate_migratepages (nr_scanned, nr_isolated); -return cc->nr_migratepages; +return ISOLATE_SUCCESS ; }/*
@@ -533,8 +544,15 @@ static int compact_zone(struct zone *zonunsigned long nr_migrate, nr_remaining;int err; -if (!isolate_migratepages (zone, cc)) +switch (isolate_migratepages (zone, cc)) { +case ISOLATE_ABORT : + ret =COMPACT_PARTIAL ; + goto out; +case ISOLATE_NONE :continue ; +case ISOLATE_SUCCESS : + ; + } nr_migrate = cc->nr_migratepages; err = migrate_pages(&cc->migratepages, compaction_alloc,
@@ -558,6 +576,7 @@ static int compact_zone(struct zone *zon } +out:/* Release free pages and check accounting */ cc->nr_freepages -=release_freepages (&cc->freepages);VM_BUG_ON (cc->nr_freepages !=0 );
PATCH 42/70 drm/radeon: fix oops in ttm reserve when pageflipping (v2)
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dave Airlie <[email protected]>
commit 498c555f56a02ec1059bc150cde84411ba0ac010 upstream.
We need to take a reference to this object, pinning doesn't take a reference so if userspace deletes the object it can disappear even if pinned.
v2: fix error paths to unreference properly also.
should fix:
https://bugzilla.kernel.org/show_bug.cgi?id=32402
and
https://bugzilla.redhat.com/show_bug.cgi?id=680651
--- drivers/gpu/drm/radeon/radeon_display.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/gpu/drm/radeon/radeon_display.c +8 -5
@@ -264,6 +264,8 @@ static void radeon_unpin_work_func(strucradeon_bo_unreserve (work->old_rbo); }else DRM_ERROR ("failed to reserve buffer after flip\n" ); + +drm_gem_object_unreference_unlocked (&work->old_rbo->gem_base);kfree (work); }
@@ -371,6 +373,8 @@ static int radeon_crtc_page_flip(struct new_radeon_fb =to_radeon_framebuffer (fb);/* schedule unpin of the old buffer */ obj = old_radeon_fb->obj; +/* take a reference to the old object */ +drm_gem_object_reference (obj); rbo =gem_to_radeon_bo (obj); work->old_rbo = rbo;INIT_WORK (&work->work, radeon_unpin_work_func);
@@ -378,12 +382,9 @@ static int radeon_crtc_page_flip(struct/* We borrow the event spin lock for protecting unpin_work */ spin_lock_irqsave (&dev->event_lock, flags);if (radeon_crtc->unpin_work) { -spin_unlock_irqrestore (&dev->event_lock, flags); -kfree (work); -radeon_fence_unref (&fence); -DRM_DEBUG_DRIVER ("flip queue: crtc already busy\n" ); -return -EBUSY ; + r = -EBUSY ; + goto unlock_free; } radeon_crtc->unpin_work = work; radeon_crtc->deferred_flip_completion =0 ;
@@ -497,6 +498,8 @@ pflip_cleanup1: pflip_cleanup:spin_lock_irqsave (&dev->event_lock, flags); radeon_crtc->unpin_work =NULL ; +unlock_free: +drm_gem_object_unreference_unlocked (old_radeon_fb->obj);spin_unlock_irqrestore (&dev->event_lock, flags);radeon_fence_unref (&fence);kfree (work);
PATCH 43/70 GFS2: make sure fallocate bytes is a multiple of blksize
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Benjamin Marzinski <[email protected]>
commit 6905d9e4dda6112f007e9090bca80507da158e63 upstream.
The GFS2 fallocate code chooses a target size to for allocating chunks of space. Whenever it can't find any resource groups with enough space free, it halves its target. Since this target is in bytes, eventually it will no longer be a multiple of blksize. As long as there is more space available in the resource group than the target, this isn't a problem, since gfs2 will use the actual space available, which is always a multiple of blksize. However, when gfs couldn't fallocate a bigger chunk than the target, it was using the non-blksize aligned number. This caused a BUG in later code that required blksize aligned offsets. GFS2 now ensures that bytes is always a multiple of blksize
--- fs/gfs2/file.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
fs/gfs2/file.c +8 -2
@@ -826,6 +826,7 @@ static long gfs2_fallocate(struct file *loff_t bytes, max_bytes;struct gfs2_alloc *al;int error; +loff_t bsize_mask = ~((loff_t )sdp->sd_sb.sb_bsize -1 );loff_t next = (offset + len -1 ) >> sdp->sd_sb.sb_bsize_shift; next = (next +1 ) << sdp->sd_sb.sb_bsize_shift;
@@ -833,13 +834,15 @@ static long gfs2_fallocate(struct file *if (mode & ~FALLOC_FL_KEEP_SIZE )return -EOPNOTSUPP ; - offset = (offset >> sdp->sd_sb.sb_bsize_shift) << - sdp->sd_sb.sb_bsize_shift; + offset &= bsize_mask; len = next - offset; bytes = sdp->sd_max_rg_data * sdp->sd_sb.sb_bsize /2 ;if (!bytes) bytes =UINT_MAX ; + bytes &= bsize_mask; +if (bytes ==0 ) + bytes = sdp->sd_sb.sb_bsize;gfs2_holder_init (ip->i_gl,LM_ST_EXCLUSIVE ,0 , &ip->i_gh); error =gfs2_glock_nq (&ip->i_gh);
@@ -870,6 +873,9 @@ retry:if (error) {if (error == -ENOSPC && bytes > sdp->sd_sb.sb_bsize) { bytes >>=1 ; + bytes &= bsize_mask; +if (bytes ==0 ) + bytes = sdp->sd_sb.sb_bsize; goto retry; } goto out_qunlock;
PATCH 44/70 Revert "V4L/DVB: cx23885: Enable Message Signaled Interrupts(MSI)"
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jarod Wilson <[email protected]>
commit d7515b8866b60c9526d2d7af37ebcd16c3c5ed97 upstream.
This reverts commit e38030f3ff02684eb9e25e983a03ad318a10a2ea.
MSI flat-out doesn't work right on cx2388x devices yet. There are now multiple reports of cards that hard-lock systems when MSI is enabled, including my own HVR-1250 when trying to use its built-in IR receiver. Disable MSI and it works just fine. Similar for another user's HVR-1270. Issues have also been reported with the HVR-1850 when MSI is enabled, and the 1850 behavior sounds similar to an as-yet-undiagnosed issue I've seen with an 1800.
--- drivers/media/video/cx23885/cx23885-core.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/media/video/cx23885/cx23885-core.c +2 -7
@@ -2060,12 +2060,8 @@ static int __devinit cx23885_initdev(str goto fail_irq; } -if (!pci_enable_msi (pci_dev)) - err =request_irq (pci_dev->irq, cx23885_irq, -IRQF_DISABLED , dev->name, dev); -else - err =request_irq (pci_dev->irq, cx23885_irq, -IRQF_SHARED |IRQF_DISABLED , dev->name, dev); + err =request_irq (pci_dev->irq, cx23885_irq, +IRQF_SHARED |IRQF_DISABLED , dev->name, dev);if (err <0 ) {printk (KERN_ERR "%s: can't get IRQ %d\n" , dev->name, pci_dev->irq);
@@ -2114,7 +2110,6 @@ static void __devexit cx23885_finidev(st/* unregister stuff */ free_irq (pci_dev->irq, dev); -pci_disable_msi (pci_dev);cx23885_dev_unregister (dev);v4l2_device_unregister (v4l2_dev);
PATCH 45/70 si4713-i2c: avoid potential buffer overflow on si4713
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mauro Carvalho Chehab <[email protected]>
commit dc6b845044ccb7e9e6f3b7e71bd179b3cf0223b6 upstream.
While compiling it with Fedora 15, I noticed this issue:
inlined from ‘si4713_write_econtrol_string’ at drivers/media/radio/si4713-i2c.c:1065:24:
arch/x86/include/asm/uaccess_32.h:211:26: error: call to ‘copy_from_user_overflow’ declared with attribute error: copy_from_user() buffer size is not provably correct
--- drivers/media/radio/si4713-i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/radio/si4713-i2c.c +2 -2
@@ -1033,7 +1033,7 @@ static int si4713_write_econtrol_string(char ps_name[MAX_RDS_PS_NAME +1 ]; len = control->size -1 ; -if (len >MAX_RDS_PS_NAME ) { +if (len <0 || len >MAX_RDS_PS_NAME ) { rval = -ERANGE ; goto exit; }
@@ -1057,7 +1057,7 @@ static int si4713_write_econtrol_string(char radio_text[MAX_RDS_RADIO_TEXT +1 ]; len = control->size -1 ; -if (len >MAX_RDS_RADIO_TEXT ) { +if (len <0 || len >MAX_RDS_RADIO_TEXT ) { rval = -ERANGE ; goto exit; }
PATCH 46/70 ASoC: Correct WM8994 MICBIAS supply widget hookup
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mark Brown <[email protected]>
commit b793eb60a01d5b5e4aaeb2fbc2b036dec0d9f84d upstream.
The WM8994 and WM8958 series of devices have two MICBIAS supplies rather than one, the current widget actually manages the microphone detection control register bit (which is managed separately by the relevant API).
Fix this, hooking the relevant supplies up to the MICBIAS1 and MICBIAS2 widgets.
--- sound/soc/codecs/wm8994.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
sound/soc/codecs/wm8994.c +4 -3
@@ -1446,7 +1446,6 @@ SND_SOC_DAPM_INPUT("DMIC1DAT"),SND_SOC_DAPM_INPUT ("DMIC2DAT" ),SND_SOC_DAPM_INPUT ("Clock" ), -SND_SOC_DAPM_MICBIAS ("MICBIAS" ,WM8994_MICBIAS ,2 ,0 ),SND_SOC_DAPM_SUPPLY_S ("MICBIAS Supply" ,1 ,SND_SOC_NOPM ,0 ,0 , micbias_ev, SND_SOC_DAPM_PRE_PMU),
@@ -1765,8 +1764,10 @@ static const struct snd_soc_dapm_route w { "AIF2DACDAT", NULL, "AIF1DACDAT" }, { "AIF1ADCDAT", NULL, "AIF2ADCDAT" }, { "AIF2ADCDAT", NULL, "AIF1ADCDAT" }, - { "MICBIAS", NULL, "CLK_SYS" }, - { "MICBIAS", NULL, "MICBIAS Supply" }, + { "MICBIAS1", NULL, "CLK_SYS" }, + { "MICBIAS1", NULL, "MICBIAS Supply" }, + { "MICBIAS2", NULL, "CLK_SYS" }, + { "MICBIAS2", NULL, "MICBIAS Supply" }, }; static const struct snd_soc_dapm_route wm8994_intercon[] = {
PATCH 47/70 ASoC: Fix shift in WM8958 accessory detection default
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
implementation
From: Mark Brown <[email protected]>
commit b35e160a111aa9ae3fad6294e038be20d0da721b upstream.
--- sound/soc/codecs/wm8994.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wm8994.c +1 -1
@@ -3021,7 +3021,7 @@ static void wm8958_default_micdet(u16 st report =SND_JACK_MICROPHONE ;/* Everything else is buttons; just assign slots */ -if (status &0x1c0 ) +if (status &0x1c ) report |=SND_JACK_BTN_0 ; done:
PATCH 48/70 hwmon: (it87) Fix label group removal
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jean Delvare <[email protected]>
commit fa8b69758e65b406c8010936b541cd00deef804d upstream.
A copy-and-paste error caused it87_attributes_vid to be referenced where it87_attributes_label should be. Thankfully the group is only used for attribute removal, not attribute creation, so the effects of this bug are limited, but let's fix it still.
--- drivers/hwmon/it87.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/it87.c +1 -1
@@ -1535,7 +1535,7 @@ static struct attribute *it87_attributes };static const struct attribute_group it87_group_label = { - .attrs = it87_attributes_vid, + .attrs = it87_attributes_label, };/* SuperIO detection - will change isa_address if a chip is found */
PATCH 49/70 hwmon: (asus_atk0110) Fix memory leak
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luca Tettamanti <[email protected]>
commit 0b8e77f12cb6bfe2e5a67f2cdc8c7af23abc4ccf upstream.
The object returned by atk_gitm is dynamically allocated and must be freed.
--- drivers/hwmon/asus_atk0110.c | 1 + 1 file changed, 1 insertion(+)
drivers/hwmon/asus_atk0110.c +1 -0
@@ -673,6 +673,7 @@ static int atk_debugfs_gitm_get(void *p,else err = -EIO ; +ACPI_FREE (ret);return err; }
PATCH 50/70 hwmon: (max1111) Fix race condition causing NULL pointer exception
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Pavel Herrmann <[email protected]>
commit d3f684f2820a7f42acef68bea6622d9032127fb2 upstream.
spi_sync call uses its spi_message parameter to keep completion information, using a drvdata structure is not thread-safe. Use a mutex to prevent multiple access to shared driver data.
--- drivers/hwmon/max1111.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/hwmon/max1111.c +11 -0
@@ -40,6 +40,8 @@ struct max1111_data {struct spi_transfer xfer[2 ];uint8_t *tx_buf;uint8_t *rx_buf; +struct mutex drvdata_lock; +/* protect msg, xfer and buffers from multiple access */ };static int max1111_read (struct device *dev,int channel)
@@ -48,6 +50,9 @@ static int max1111_read(struct device *duint8_t v1, v2;int err; +/* writing to drvdata struct is not thread safe, wait on mutex */ +mutex_lock (&data->drvdata_lock); + data->tx_buf[0 ] = (channel <<MAX1111_CTRL_SEL_SH ) |MAX1111_CTRL_PD0 |MAX1111_CTRL_PD1 |MAX1111_CTRL_SGL |MAX1111_CTRL_UNI |MAX1111_CTRL_STR ;
@@ -55,12 +60,15 @@ static int max1111_read(struct device *d err =spi_sync (data->spi, &data->msg);if (err <0 ) {dev_err (dev,"spi_sync failed with %d\n" , err); +mutex_unlock (&data->drvdata_lock);return err; } v1 = data->rx_buf[0 ]; v2 = data->rx_buf[1 ]; +mutex_unlock (&data->drvdata_lock); +if ((v1 &0xc0 ) || (v2 &0x3f ))return -EINVAL ;
@@ -176,6 +184,8 @@ static int __devinit max1111_probe(strucif (err) goto err_free_data; +mutex_init (&data->drvdata_lock); + data->spi = spi;spi_set_drvdata (spi, data);
@@ -213,6 +223,7 @@ static int __devexit max1111_remove(struhwmon_device_unregister (data->hwmon_dev);sysfs_remove_group (&spi->dev.kobj, &max1111_attr_group); +mutex_destroy (&data->drvdata_lock);kfree (data->rx_buf);kfree (data->tx_buf);kfree (data);
PATCH 51/70 mmc: Added quirks for Ricoh 1180:e823 lower base clock
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
frequency
From: Manoj Iyer <[email protected]>
commit 15bed0f2fa8e1d7db201692532c210a7823d2d21 upstream.
Ricoh 1180:e823 does not recognize certain types of SD/MMC cards, as reported at http://launchpad.net/bugs/773524. Lowering the SD base clock frequency from 200Mhz to 50Mhz fixes this issue. This solution was suggest by Koji Matsumuro, Ricoh Company, Ltd.
This change has no negative performance effect on standard SD cards, though it's quite possible that there will be one on UHS-1 cards.
--- drivers/pci/quirks.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
drivers/pci/quirks.c +23 -0
@@ -2755,6 +2755,29 @@ static void ricoh_mmc_fixup_r5c832(strucdev_notice (&dev->dev,"proprietary Ricoh MMC controller disabled (via firewire function)\n" );dev_notice (&dev->dev,"MMC cards are now supported by standard SDHCI controller\n" ); + +/* +* RICOH 0xe823 SD/MMC card reader fails to recognize +* certain types of SD/MMC cards. Lowering the SD base +* clock frequency from 200Mhz to 50Mhz fixes this issue. +* +* 0x150 - SD2.0 mode enable for changing base clock +* frequency to 50Mhz +* 0xe1 - Base clock frequency +* 0x32 - 50Mhz new clock frequency +* 0xf9 - Key register for 0x150 +* 0xfc - key register for 0xe1 +*/ +if (dev->device ==PCI_DEVICE_ID_RICOH_R5CE823 ) { +pci_write_config_byte (dev,0xf9 ,0xfc ); +pci_write_config_byte (dev,0x150 ,0x10 ); +pci_write_config_byte (dev,0xf9 ,0x00 ); +pci_write_config_byte (dev,0xfc ,0x01 ); +pci_write_config_byte (dev,0xe1 ,0x32 ); +pci_write_config_byte (dev,0xfc ,0x00 ); + +dev_notice (&dev->dev,"MMC controller base frequency changed to 50Mhz.\n" ); + } }DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_RICOH ,PCI_DEVICE_ID_RICOH_R5C832 , ricoh_mmc_fixup_r5c832);DECLARE_PCI_FIXUP_RESUME_EARLY (PCI_VENDOR_ID_RICOH ,PCI_DEVICE_ID_RICOH_R5C832 , ricoh_mmc_fixup_r5c832);
PATCH 52/70 mmc: sdhci-esdhc-imx: SDHCI_CARD_PRESENT does not get
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
cleared
From: Shawn Guo <[email protected]>
commit 803862a6f7de4939e0a557214e5e4b37e36f87ff upstream.
The function esdhc_readl_le intends to clear bit SDHCI_CARD_PRESENT, when the card detect gpio tells there is no card. But it does not clear the bit actually. The patch gives a fix on that.
--- drivers/mmc/host/sdhci-esdhc-imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/sdhci-esdhc-imx.c +1 -1
@@ -74,7 +74,7 @@ static u32 esdhc_readl_le(struct sdhci_hif (boarddata &&gpio_is_valid (boarddata->cd_gpio) &&gpio_get_value (boarddata->cd_gpio))/* no card, if a valid gpio says so... */ - val &=SDHCI_CARD_PRESENT ; + val &= ~SDHCI_CARD_PRESENT ;else /* ... in all other cases assume card is present */ val |=SDHCI_CARD_PRESENT ;
PATCH 53/70 x86: Make Dell Latitude E5420 use reboot=pci
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel J Blueman <[email protected]>
commit b7798d28ec15d20fd34b70fa57eb13f0cf6d1ecd upstream.
Rebooting on the Dell E5420 often hangs with the keyboard or ACPI methods, but is reliable via the PCI method.
[ hpa: this was deferred because we believed for a long time that the
recent reshuffling of the boot priorities in commit 660e34cebf0a11d54f2d5dd8838607452355f321 fixed this platform. Unfortunately that turned out to be incorrect. ]
--- arch/x86/kernel/reboot.c | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/x86/kernel/reboot.c +8 -0
@@ -411,6 +411,14 @@ static struct dmi_system_id __initdata p DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1"), }, }, + { /* Handle problems with rebooting on the Latitude E5420. */ + .callback = set_pci_reboot, + .ident = "Dell Latitude E5420", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E5420"), + }, + }, { } };
PATCH 54/70 davinci: DM365 EVM: fix video input mux bits
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jon Povey <[email protected]>
commit 9daedd833a38edd90cf7baa1b1fcf61c3a0721e3 upstream.
Video input mux settings for tvp7002 and imager inputs were swapped. Comment was correct.
Tested on EVM with tvp7002 input.
--- arch/arm/mach-davinci/board-dm365-evm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-davinci/board-dm365-evm.c +2 -2
@@ -520,7 +520,7 @@ fail:*/ if (have_imager ()) { label ="HD imager" ; - mux |=1 ; + mux |=2 ;/* externally mux MMC1/ENET/AIC33 to imager */ mux |=BIT (6 ) |BIT (5 ) |BIT (3 );
@@ -540,7 +540,7 @@ fail: resets &= ~BIT (1 );if (have_tvp7002 ()) { - mux |=2 ; + mux |=1 ; resets &= ~BIT (2 ); label ="tvp7002 HD" ; }else {
PATCH 55/70 vmscan: fix a livelock in kswapd
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Shaohua Li <[email protected]>
commit 4746efded84d7c5a9c8d64d4c6e814ff0cf9fb42 upstream.
I'm running a workload which triggers a lot of swap in a machine with 4 nodes. After I kill the workload, I found a kswapd livelock. Sometimes kswapd3 or kswapd2 are keeping running and I can't access filesystem, but most memory is free.
This looks like a regression since commit 08951e545918c159 ("mm: vmscan:
correct check for kswapd sleeping in sleeping_prematurely").
Node 2 and 3 have only ZONE_NORMAL, but balance_pgdat() will return 0 for classzone_idx. The reason is end_zone in balance_pgdat() is 0 by default, if all zones have watermark ok, end_zone will keep 0.
Later sleeping_prematurely() always returns true. Because this is an order 3 wakeup, and if classzone_idx is 0, both balanced_pages and present_pages in pgdat_balanced() are 0. We add a special case here. If a zone has no page, we think it's balanced. This fixes the livelock.
--- mm/vmscan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
mm/vmscan.c +2 -1
@@ -2245,7 +2245,8 @@ static bool pgdat_balanced(pg_data_t *pgfor (i =0 ; i <= classzone_idx; i++) present_pages += pgdat->node_zones[i].present_pages; -return balanced_pages > (present_pages >>2 ); +/* A special case here: if zone has no page, we think it's balanced */ +return balanced_pages >= (present_pages >>2 ); }/* is kswapd sleeping prematurely? */
PATCH 56/70 libata: fix unexpectedly frozen port after ata_eh_reset()
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tejun Heo <[email protected]>
commit 8c56cacc724c7650b893d43068fa66044aa29a61 upstream.
To work around controllers which can't properly plug events while reset, ata_eh_reset() clears error states and ATA_PFLAG_EH_PENDING after reset but before RESET is marked done. As reset is the final recovery action and full verification of devices including onlineness and classfication match is done afterwards, this shouldn't lead to lost devices or missed hotplug events.
Unfortunately, it forgot to thaw the port when clearing EH_PENDING, so if the condition happens after resetting an empty port, the port could be left frozen and EH will end without thawing it, making the port unresponsive to further hotplug events.
Thaw if the port is frozen after clearing EH_PENDING. This problem is reported by Bruce Stenning in the following thread.
http://thread.gmane.org/gmane.linux.kernel/1123265
stable: I think we should weather this patch a bit longer in -rcX
before sending it to -stable. Please wait at least a month after this patch makes upstream. Thanks.
-v2: Fixed spelling in the comment per Dave Howorth.
--- drivers/ata/libata-eh.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/ata/libata-eh.c +8 -4
@@ -2802,10 +2802,11 @@ int ata_eh_reset(struct ata_link *link, }/* -* Some controllers can't be frozen very well and may set -* spuruious error conditions during reset. Clear accumulated -* error information. As reset is the final recovery action, -* nothing is lost by doing this. +* Some controllers can't be frozen very well and may set spurious +* error conditions during reset. Clear accumulated error +* information and re-thaw the port if frozen. As reset is the +* final recovery action and we cross check link onlineness against +* device classification later, no hotplug event is lost by this. */ spin_lock_irqsave (link->ap->lock, flags);memset (&link->eh_info,0 ,sizeof (link->eh_info));
@@ -2814,6 +2815,9 @@ int ata_eh_reset(struct ata_link *link, ap->pflags &= ~ATA_PFLAG_EH_PENDING ;spin_unlock_irqrestore (link->ap->lock, flags); +if (ap->pflags &ATA_PFLAG_FROZEN ) +ata_eh_thaw_port (ap); +/* * Make sure onlineness and classification result correspond. * Hotplug could have happened during reset and some
PATCH 57/70 ext4: fix oops in ext4_quota_off()
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Amir Goldstein <[email protected]>
commit 0b26859027ce0005ef89520af20351360e51ad76 upstream.
If quota is not enabled when ext4_quota_off() is called, we must not dereference quota file inode since it is NULL. Check properly for this.
This fixes a bug in commit 21f976975cbe (ext4: remove unnecessary [cm]time update of quota file), which was merged for 2.6.39-rc3.
--- fs/ext4/super.c | 3 +++ 1 file changed, 3 insertions(+)
fs/ext4/super.c +3 -0
@@ -4635,6 +4635,9 @@ static int ext4_quota_off(struct super_bif (test_opt (sb,DELALLOC ))sync_filesystem (sb); +if (!inode) + goto out; +/* Update modification times of quota files when userspace can * start looking at them */ handle =ext4_journal_start (inode,1 );
PATCH 58/70 mm: compaction: ensure that the compaction free scanner does not move to the next zone
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mel Gorman <[email protected]>
commit: 7454f4ba40b419eb999a3c61a99da662bf1a2bb8 upstream
Compaction works with two scanners, a migration and a free scanner. When the scanners crossover, migration within the zone is complete. The location of the scanner is recorded on each cycle to avoid excesive scanning.
When a zone is small and mostly reserved, it's very easy for the migration scanner to be close to the end of the zone. Then the following situation can occurs
o migration scanner isolates some pages near the end of the zone
o free scanner starts at the end of the zone but finds that the migration scanner is already there
o free scanner gets reinitialised for the next cycle as cc->migrate_pfn + pageblock_nr_pages
moving the free scanner into the next zone
o migration scanner moves into the next zone
When this happens, NR_ISOLATED accounting goes haywire because some of the accounting happens against the wrong zone. One zones counter remains positive while the other goes negative even though the overall global count is accurate. This was reported on X86-32 with !SMP because !SMP allows the negative counters to be visible. The fact that it is the bug should theoritically be possible there.
--- mm/compaction.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
mm/compaction.c +12 -1
@@ -144,9 +144,20 @@ static void isolate_freepages(struct zonint nr_freepages = cc->nr_freepages;struct list_head *freelist = &cc->freepages; +/* +* Initialise the free scanner. The starting point is where we last +* scanned from (or the end of the zone if starting). The low point +* is the end of the pageblock the migration scanner is using. +*/ pfn = cc->free_pfn; low_pfn = cc->migrate_pfn + pageblock_nr_pages; - high_pfn = low_pfn; + +/* +* Take care that if the migration scanner is at the end of the zone +* that the free scanner does not accidentally move to the next zone +* in the next isolation cycle. +*/ + high_pfn =min (low_pfn, pfn);/* * Isolate free pages until enough are available to migrate the
PATCH 59/70 mm: vmscan: do not use page_count without a page pin
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andrea Arcangeli <[email protected]>
commit: d179e84ba5da1d0024087d1759a2938817a00f3f upstream
It is unsafe to run page_count during the physical pfn scan because compound_head could trip on a dangling pointer when reading page->first_page if the compound page is being freed by another CPU.
--- mm/vmscan.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
mm/vmscan.c +14 -2
@@ -1114,8 +1114,20 @@ static unsigned long isolate_lru_pages(u nr_lumpy_dirty++; scan++; }else { -/* the page is freed already. */ -if (!page_count (cursor_page)) +/* +* Check if the page is freed already. +* +* We can't use page_count() as that +* requires compound_head and we don't +* have a pin on the page here. If a +* page is tail, we may or may not +* have isolated the head, so assume +* it's not free, it'd be tricky to +* track the head status without a +* page pin. +*/ +if (!PageTail (cursor_page) && + !atomic_read (&cursor_page->_count))continue ;break ; }
PATCH 61/70 xfs [stable only]: restart busy extent search after node removal
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Sandeen <[email protected]>
A user on #xfs reported that a log replay was oopsing in __rb_rotate_left() with a null pointer deref, and provided an xfs_metadump image for reproduction and testing.
I traced this down to the fact that in xfs_alloc_busy_insert(), we erased a node with rb_erase() when the new node overlapped, but left the erased node specified as the parent node for the new insertion.
So when we try to insert a new node with an erased node as its parent, obviously things go very wrong.
Upstream,97d3ac75e5e0ebf7ca38ae74cebd201c09b97ab2 xfs: exact busy extent tracking actually fixed this, but as part of a much larger change. Here's the relevant code from that commit:
* We also need to restart the busy extent search from the
* tree root, because erasing the node can rearrange the
* tree topology.
*/
rb_erase(&busyp->rb_node, &pag->pagb_tree);
busyp->length = 0;
return false;We can do essentially the same thing to older codebases by restarting the tree search after the erase.
This should apply to .35.y through .39.y, and was tested on .39 with the oopsing replay reproducer.
---
--- fs/xfs/xfs_alloc.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/xfs/xfs_alloc.c +6 -0
@@ -2610,6 +2610,12 @@ restart: new->bno + new->length) -min (busyp->bno, new->bno); new->bno =min (busyp->bno, new->bno); +/* +* Start the search over from the tree root, because +* erasing the node can rearrange the tree topology. +*/ +spin_unlock (&pag->pagb_lock); + goto restart; }else busyp =NULL ;
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 62/70 cifs: clean up wsize negotiation and allow for larger wsize
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Layton <[email protected]>
commit f7910cbd9fa319ee4501074f1f3b5ce23c4b1518 upstream.
Now that we can handle larger wsizes in writepages, fix up the negotiation of the wsize to allow for that. find_get_pages only seems to give out a max of 256 pages at a time, so that gives us a reasonable default of 1M for the wsize.
If the server however does not support large writes via POSIX extensions, then we cap the wsize to (128k - PAGE_CACHE_SIZE). That gives us a size that goes up to the max frame size specified in RFC1001.
Finally, if CAP_LARGE_WRITE_AND_X isn't set, then further cap it to the largest size allowed by the protocol (USHRT_MAX).
--- fs/cifs/connect.c | 69 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 20 deletions(-)
fs/cifs/connect.c +49 -20
@@ -2571,23 +2571,6 @@ static void setup_cifs_sb(struct smb_volelse /* default */ cifs_sb->rsize = CIFSMaxBufSize; -if (pvolume_info->wsize >PAGEVEC_SIZE *PAGE_CACHE_SIZE ) { -cERROR (1 ,"wsize %d too large, using 4096 instead" , - pvolume_info->wsize); - cifs_sb->wsize =4096 ; - }else if (pvolume_info->wsize) - cifs_sb->wsize = pvolume_info->wsize; -else - cifs_sb->wsize = min_t(const int, -PAGEVEC_SIZE *PAGE_CACHE_SIZE , -127 *1024 ); -/* old default of CIFSMaxBufSize was too small now -that SMB Write2 can send multiple pages in kvec. -RFC1001 does not describe what happens when frame -bigger than 128K is sent so use that as max in -conjunction with 52K kvec constraint on arch with 4K -page size */ -if (cifs_sb->rsize <2048 ) { cifs_sb->rsize =2048 ;/* Windows ME may prefer this */
@@ -2665,6 +2648,53 @@ static void setup_cifs_sb(struct smb_vol "mount option supported"); } +/* +* When the server supports very large writes via POSIX extensions, we can +* allow up to 2^24 - PAGE_CACHE_SIZE. +* +* Note that this might make for "interesting" allocation problems during +* writeback however (as we have to allocate an array of pointers for the +* pages). A 16M write means ~32kb page array with PAGE_CACHE_SIZE == 4096. +*/ +#define CIFS_MAX_WSIZE ((1<<24) - PAGE_CACHE_SIZE) + +/* +* When the server doesn't allow large posix writes, default to a wsize of +* 128k - PAGE_CACHE_SIZE -- one page less than the largest frame size +* described in RFC1001. This allows space for the header without going over +* that by default. +*/ +#define CIFS_MAX_RFC1001_WSIZE (128 * 1024 - PAGE_CACHE_SIZE) + +/* +* The default wsize is 1M. find_get_pages seems to return a maximum of 256 +* pages in a single call. With PAGE_CACHE_SIZE == 4k, this means we can fill +* a single wsize request with a single call. +*/ +#define CIFS_DEFAULT_WSIZE (1024 * 1024) + +static unsigned int +cifs_negotiate_wsize (struct cifsTconInfo *tcon,struct smb_vol *pvolume_info) +{ +__u64 unix_cap =le64_to_cpu (tcon->fsUnixInfo.Capability); +struct TCP_Server_Info *server = tcon->ses->server; +unsigned int wsize = pvolume_info->wsize ? pvolume_info->wsize : +CIFS_DEFAULT_WSIZE ; + +/* can server support 24-bit write sizes? (via UNIX extensions) */ +if (!tcon->unix_ext || !(unix_cap &CIFS_UNIX_LARGE_WRITE_CAP )) + wsize = min_t(unsigned int, wsize, CIFS_MAX_RFC1001_WSIZE); + +/* no CAP_LARGE_WRITE_X? Limit it to 16 bits */ +if (!(server->capabilities &CAP_LARGE_WRITE_X )) + wsize = min_t(unsigned int, wsize, USHRT_MAX); + +/* hard limit of CIFS_MAX_WSIZE */ + wsize = min_t(unsigned int, wsize, CIFS_MAX_WSIZE); + +return wsize; +} +static int is_path_accessible (int xid,struct cifsTconInfo *tcon,struct cifs_sb_info *cifs_sb,const char *full_path)
@@ -2866,13 +2896,12 @@ try_mount_again: cifs_sb->rsize =1024 *127 ;cFYI (DBG2 ,"no very large read support, rsize now 127K" ); } -if (!(tcon->ses->capabilities &CAP_LARGE_WRITE_X )) - cifs_sb->wsize =min (cifs_sb->wsize, - (tcon->ses->server->maxBuf -MAX_CIFS_HDR_SIZE ));if (!(tcon->ses->capabilities &CAP_LARGE_READ_X )) cifs_sb->rsize =min (cifs_sb->rsize, (tcon->ses->server->maxBuf -MAX_CIFS_HDR_SIZE )); + cifs_sb->wsize =cifs_negotiate_wsize (tcon, volume_info); + remote_path_check:/* check if a whole path (including prepath) is not remote */ if (!rc && tcon) {
PATCH 63/70 mm: vmscan: do not apply pressure to slab if we are not applying pressure to zone
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mel Gorman <[email protected]>
commit d7868dae893c83c50c7824bc2bc75f93d114669f upstream
During allocator-intensive workloads, kswapd will be woken frequently causing free memory to oscillate between the high and min watermark. This is expected behaviour.
When kswapd applies pressure to zones during node balancing, it checks if the zone is above a high+balance_gap threshold. If it is, it does not apply pressure but it unconditionally shrinks slab on a global basis which is excessive. In the event kswapd is being kept awake due to a high small unreclaimable zone, it skips zone shrinking but still calls shrink_slab().
Once pressure has been applied, the check for zone being unreclaimable is being made before the check is made if all_unreclaimable should be set. This miss of unreclaimable can cause has_under_min_watermark_zone to be set due to an unreclaimable zone preventing kswapd backing off on congestion_wait().
--- mm/vmscan.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-)
mm/vmscan.c +14 -11
@@ -2449,19 +2449,19 @@ loop_again: KSWAPD_ZONE_BALANCE_GAP_RATIO);if (!zone_watermark_ok_safe (zone, order,high_wmark_pages (zone) + balance_gap, - end_zone,0 )) + end_zone,0 )) {shrink_zone (priority, zone, &sc); - reclaim_state->reclaimed_slab =0 ; - nr_slab =shrink_slab (sc.nr_scanned,GFP_KERNEL , - lru_pages); - sc.nr_reclaimed += reclaim_state->reclaimed_slab; - total_scanned += sc.nr_scanned; -if (zone->all_unreclaimable) -continue ; -if (nr_slab ==0 && - !zone_reclaimable (zone)) - zone->all_unreclaimable =1 ; + reclaim_state->reclaimed_slab =0 ; + nr_slab =shrink_slab (sc.nr_scanned,GFP_KERNEL , + lru_pages); + sc.nr_reclaimed += reclaim_state->reclaimed_slab; + total_scanned += sc.nr_scanned; + +if (nr_slab ==0 && !zone_reclaimable (zone)) + zone->all_unreclaimable =1 ; + } +/* * If we've done a decent amount of scanning and * the reclaim ratio is low, start doing writepage
@@ -2471,6 +2471,9 @@ loop_again: total_scanned > sc.nr_reclaimed + sc.nr_reclaimed / 2) sc.may_writepage = 1; +if (zone->all_unreclaimable) +continue ; +if (!zone_watermark_ok_safe (zone, order,high_wmark_pages (zone), end_zone,0 )) { all_zones_ok =0 ;
PATCH 64/70 mm: vmscan: only read new_classzone_idx from pgdat when reclaiming successfully
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mel Gorman <[email protected]>
commit 215ddd6664ced067afca7eebd2d1eb83f064ff5a upstream
During allocator-intensive workloads, kswapd will be woken frequently causing free memory to oscillate between the high and min watermark. This is expected behaviour. Unfortunately, if the highest zone is small, a problem occurs.
When balance_pgdat() returns, it may be at a lower classzone_idx than it started because the highest zone was unreclaimable. Before checking if it should go to sleep though, it checks pgdat->classzone_idx which when there is no other activity will be MAX_NR_ZONES-1. It interprets this as it has been woken up while reclaiming, skips scheduling and reclaims again. As there is no useful reclaim work to do, it enters into a loop of shrinking slab consuming loads of CPU until the highest zone becomes reclaimable for a long period of time.
There are two problems here. 1) If the returned classzone or order is lower, it'll continue reclaiming without scheduling. 2) if the highest zone was marked unreclaimable but balance_pgdat() returns immediately at DEF_PRIORITY, the new lower classzone is not communicated back to kswapd() for sleeping.
This patch does two things that are related. If the end_zone is unreclaimable, this information is communicated back. Second, if the classzone or order was reduced due to failing to reclaim, new information is not read from pgdat and instead an attempt is made to go to sleep. Due to this, it is also necessary that pgdat->classzone_idx be initialised each time to pgdat->nr_zones - 1 to avoid re-reads being interpreted as wakeups.
--- mm/vmscan.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-)
mm/vmscan.c +21 -13
@@ -2394,7 +2394,6 @@ loop_again:if (!zone_watermark_ok_safe (zone, order,high_wmark_pages (zone),0 ,0 )) { end_zone = i; - *classzone_idx = i;break ; } }
@@ -2471,8 +2470,11 @@ loop_again: total_scanned > sc.nr_reclaimed + sc.nr_reclaimed / 2) sc.may_writepage = 1; -if (zone->all_unreclaimable) +if (zone->all_unreclaimable) { +if (end_zone && end_zone == i) + end_zone--;continue ; + }if (!zone_watermark_ok_safe (zone, order,high_wmark_pages (zone), end_zone,0 )) {
@@ -2652,8 +2654,8 @@ static void kswapd_try_to_sleep(pg_data_*/ static int kswapd (void *p) { -unsigned long order; -int classzone_idx; +unsigned long order, new_order; +int classzone_idx, new_classzone_idx;pg_data_t *pgdat = (pg_data_t *)p;struct task_struct *tsk = current;
@@ -2683,17 +2685,23 @@ static int kswapd(void *p) tsk->flags |=PF_MEMALLOC |PF_SWAPWRITE |PF_KSWAPD ;set_freezable (); - order =0 ; - classzone_idx =MAX_NR_ZONES -1 ; + order = new_order =0 ; + classzone_idx = new_classzone_idx = pgdat->nr_zones -1 ;for ( ; ; ) { -unsigned long new_order; -int new_classzone_idx;int ret; - new_order = pgdat->kswapd_max_order; - new_classzone_idx = pgdat->classzone_idx; - pgdat->kswapd_max_order =0 ; - pgdat->classzone_idx =MAX_NR_ZONES -1 ; +/* +* If the last balance_pgdat was unsuccessful it's unlikely a +* new request of a similar or harder type will succeed soon +* so consider going to sleep on the basis we reclaimed at +*/ +if (classzone_idx >= new_classzone_idx && order == new_order) { + new_order = pgdat->kswapd_max_order; + new_classzone_idx = pgdat->classzone_idx; + pgdat->kswapd_max_order =0 ; + pgdat->classzone_idx = pgdat->nr_zones -1 ; + } +if (order < new_order || classzone_idx > new_classzone_idx) {/* * Don't sleep if someone wants a larger 'order'
@@ -2706,7 +2714,7 @@ static int kswapd(void *p) order = pgdat->kswapd_max_order; classzone_idx = pgdat->classzone_idx; pgdat->kswapd_max_order =0 ; - pgdat->classzone_idx =MAX_NR_ZONES -1 ; + pgdat->classzone_idx = pgdat->nr_zones -1 ; } ret =try_to_freeze ();
PATCH 65/70 Revert "DiBxxxx: get rid of DMA buffer on stack"
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
This reverts commit 673de951a6cbaa7a9c4518e03e78b88809828497 which was commit 5a0deeed5741117ee8625d6305d0034e219f102c upstream.
Based on comments from users, this broke things.
--- drivers/media/dvb/frontends/dib0070.c | 40 +----- drivers/media/dvb/frontends/dib0090.c | 71 ++--------- drivers/media/dvb/frontends/dib7000m.c | 47 ++----- drivers/media/dvb/frontends/dib7000p.c | 72 +++-------- drivers/media/dvb/frontends/dib8000.c | 126 +++++-------------- drivers/media/dvb/frontends/dib9000.c | 172 +++++++++------------------ drivers/media/dvb/frontends/dibx000_common.c | 113 +++++++---------- drivers/media/dvb/frontends/dibx000_common.h | 5 8 files changed, 202 insertions(+), 444 deletions(-)
drivers/media/dvb/frontends/dib0070.c +10 -30
@@ -73,47 +73,27 @@ struct dib0070_state {u8 wbd_gain_current;u16 wbd_offset_3_3[2 ]; - -/* for the I2C transfer */ -struct i2c_msg msg[2 ]; -u8 i2c_write_buffer[3 ]; -u8 i2c_read_buffer[2 ]; };static uint16_t dib0070_read_reg (struct dib0070_state *state,u8 reg) { - state->i2c_write_buffer[0 ] = reg; - -memset (state->msg,0 ,2 *sizeof (struct i2c_msg )); - state->msg[0 ].addr = state->cfg->i2c_address; - state->msg[0 ].flags =0 ; - state->msg[0 ].buf = state->i2c_write_buffer; - state->msg[0 ].len =1 ; - state->msg[1 ].addr = state->cfg->i2c_address; - state->msg[1 ].flags =I2C_M_RD ; - state->msg[1 ].buf = state->i2c_read_buffer; - state->msg[1 ].len =2 ; - -if (i2c_transfer (state->i2c, state->msg,2 ) !=2 ) { +u8 b[2 ]; +struct i2c_msg msg[2 ] = { + { .addr = state->cfg->i2c_address, .flags =0 , .buf = ®, .len =1 }, + { .addr = state->cfg->i2c_address, .flags =I2C_M_RD , .buf = b, .len =2 }, + }; +if (i2c_transfer (state->i2c, msg,2 ) !=2 ) {printk (KERN_WARNING "DiB0070 I2C read failed\n" );return 0 ; } -return (state->i2c_read_buffer[0 ] <<8 ) | state->i2c_read_buffer[1 ]; +return (b[0 ] <<8 ) | b[1 ]; }static int dib0070_write_reg (struct dib0070_state *state,u8 reg,u16 val) { - state->i2c_write_buffer[0 ] = reg; - state->i2c_write_buffer[1 ] = val >>8 ; - state->i2c_write_buffer[2 ] = val &0xff ; - -memset (state->msg,0 ,sizeof (struct i2c_msg )); - state->msg[0 ].addr = state->cfg->i2c_address; - state->msg[0 ].flags =0 ; - state->msg[0 ].buf = state->i2c_write_buffer; - state->msg[0 ].len =3 ; - -if (i2c_transfer (state->i2c, state->msg,1 ) !=1 ) { +u8 b[3 ] = { reg, val >>8 , val &0xff }; +struct i2c_msg msg = { .addr = state->cfg->i2c_address, .flags =0 , .buf = b, .len =3 }; +if (i2c_transfer (state->i2c, &msg,1 ) !=1 ) {printk (KERN_WARNING "DiB0070 I2C write failed\n" );return -EREMOTEIO ; }
drivers/media/dvb/frontends/dib0090.c +17 -54
107 lines not on this page · raw message
drivers/media/dvb/frontends/dib7000m.c +16 -31
66 lines not on this page · raw message
drivers/media/dvb/frontends/dib7000p.c +20 -52
105 lines not on this page · raw message
drivers/media/dvb/frontends/dib8000.c +32 -94
207 lines not on this page · raw message
drivers/media/dvb/frontends/dib9000.c +61 -111
393 lines not on this page · raw message
drivers/media/dvb/frontends/dibx000_common.c +46 -67
149 lines not on this page · raw message
drivers/media/dvb/frontends/dibx000_common.h +0 -5
@@ -28,11 +28,6 @@ struct dibx000_i2c_master {u8 i2c_addr;u16 base_reg; - -/* for the I2C transfer */ -struct i2c_msg msg[34 ]; -u8 i2c_write_buffer[8 ]; -u8 i2c_read_buffer[2 ]; }; extern int dibx000_init_i2c_master(struct dibx000_i2c_master *mst,
PATCH 66/70 vfs: fix race in rcu lookup of pruned dentry
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Linus Torvalds <[email protected]>
Backport of commit 59430262401bec02d415179c43dbe5b8819c09ce done by Hugh Dickins <[email protected]>
Don't update *inode in __follow_mount_rcu() until we'd verified that there is mountpoint there. Kudos to Hugh Dickins for catching that one in the first place and eventually figuring out the solution (and catching a braino in the earlier version of patch).
--- fs/namei.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
fs/namei.c +6 -1
@@ -1013,7 +1013,6 @@ static bool __follow_mount_rcu(struct na* Don't forget we might have a non-mountpoint managed dentry * that wants to block transit. */ - *inode = path->dentry->d_inode;if (!reverse_transit &&unlikely (managed_dentry_might_block (path->dentry)))return false;
@@ -1027,6 +1026,12 @@ static bool __follow_mount_rcu(struct na path->mnt = mounted; path->dentry = mounted->mnt_root; nd->seq =read_seqcount_begin (&path->dentry->d_seq); +/* +* Update the inode too. We don't need to re-check the +* dentry sequence number here after this d_inode read, +* because a mount-point is always pinned. +*/ + *inode = path->dentry->d_inode; }if (unlikely (path->dentry->d_flags &DCACHE_NEED_AUTOMOUNT ))
PATCH 67/70 cifs: fix wsize negotiation to respect max buffer size and
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
active signing (try #4)
From: Jeff Layton <[email protected]>
commit 1190f6a067bf27b2ee7e06ec0776a17fe0f6c4d8 upstream.
Hopefully last version. Base signing check on CAP_UNIX instead of tcon->unix_ext, also clean up the comments a bit more.
According to Hongwei Sun's blog posting here:
CAP_LARGE_WRITEX is ignored when signing is active. Also, the maximum size for a write without CAP_LARGE_WRITEX should be the maxBuf that the server sent in the NEGOTIATE request.
Fix the wsize negotiation to take this into account. While we're at it, alter the other wsize definitions to use sizeof(WRITE_REQ) to allow for slightly larger amounts of data to potentially be written per request.
--- fs/cifs/connect.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-)
fs/cifs/connect.c +20 -13
@@ -2650,21 +2650,21 @@ static void setup_cifs_sb(struct smb_vol/* * When the server supports very large writes via POSIX extensions, we can -* allow up to 2^24 - PAGE_CACHE_SIZE. +* allow up to 2^24-1, minus the size of a WRITE_AND_X header, not including +* the RFC1001 length. * * Note that this might make for "interesting" allocation problems during -* writeback however (as we have to allocate an array of pointers for the -* pages). A 16M write means ~32kb page array with PAGE_CACHE_SIZE == 4096. +* writeback however as we have to allocate an array of pointers for the +* pages. A 16M write means ~32kb page array with PAGE_CACHE_SIZE == 4096. */ -#define CIFS_MAX_WSIZE ((1<<24) - PAGE_CACHE_SIZE) +#define CIFS_MAX_WSIZE ((1<<24) - 1 - sizeof(WRITE_REQ) + 4)/* -* When the server doesn't allow large posix writes, default to a wsize of -* 128k - PAGE_CACHE_SIZE -- one page less than the largest frame size -* described in RFC1001. This allows space for the header without going over -* that by default. +* When the server doesn't allow large posix writes, only allow a wsize of +* 128k minus the size of the WRITE_AND_X header. That allows for a write up +* to the maximum size described by RFC1002. */ -#define CIFS_MAX_RFC1001_WSIZE (128 * 1024 - PAGE_CACHE_SIZE) +#define CIFS_MAX_RFC1002_WSIZE (128 * 1024 - sizeof(WRITE_REQ) + 4)/* * The default wsize is 1M. find_get_pages seems to return a maximum of 256
@@ -2683,11 +2683,18 @@ cifs_negotiate_wsize(struct cifsTconInfo/* can server support 24-bit write sizes? (via UNIX extensions) */ if (!tcon->unix_ext || !(unix_cap &CIFS_UNIX_LARGE_WRITE_CAP )) - wsize = min_t(unsigned int, wsize, CIFS_MAX_RFC1001_WSIZE); + wsize = min_t(unsigned int, wsize, CIFS_MAX_RFC1002_WSIZE); -/* no CAP_LARGE_WRITE_X? Limit it to 16 bits */ -if (!(server->capabilities &CAP_LARGE_WRITE_X )) - wsize = min_t(unsigned int, wsize, USHRT_MAX); +/* +* no CAP_LARGE_WRITE_X or is signing enabled without CAP_UNIX set? +* Limit it to max buffer offered by the server, minus the size of the +* WRITEX header, not including the 4 byte RFC1001 length. +*/ +if (!(server->capabilities &CAP_LARGE_WRITE_X ) || + (!(server->capabilities &CAP_UNIX ) && + (server->secMode & (SECMODE_SIGN_ENABLED |SECMODE_SIGN_REQUIRED )))) + wsize = min_t(unsigned int, wsize, + server->maxBuf -sizeof (WRITE_REQ ) +4 );/* hard limit of CIFS_MAX_WSIZE */ wsize = min_t(unsigned int, wsize, CIFS_MAX_WSIZE);
PATCH 68/70 cifs: lower default and max wsize to what 2.6.39 can handle
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Layton <[email protected]>
This patch is intended for 2.6.39-stable kernels only and is needed to fix a regression introduced in 2.6.39. Prior to 2.6.39, when signing was enabled on a socket the client only sent single-page writes. This changed with commit ca83ce3, which made signed and unsigned connections use the same codepaths for write calls.
This caused a regression when working with windows servers. Windows machines will reject writes larger than the MaxBufferSize when signing is active, but do not clear the CAP_LARGE_WRITE_X flag in the protocol negotiation. The upshot is that when signing is active, windows servers often reject large writes from the client in 2.6.39.
Because 3.0 adds support for larger wsize values, simply cherry picking the upstream patches that fix the wsize negotiation isn't sufficient to fix this issue. We also need to alter the maximum and default values to something suitable for 2.6.39.
This patch also accounts for the change in field name from sec_mode to secMode that went into 3.0.
--- fs/cifs/connect.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-)
fs/cifs/connect.c +4 -16
@@ -2648,16 +2648,8 @@ static void setup_cifs_sb(struct smb_vol "mount option supported"); } -/* -* When the server supports very large writes via POSIX extensions, we can -* allow up to 2^24-1, minus the size of a WRITE_AND_X header, not including -* the RFC1001 length. -* -* Note that this might make for "interesting" allocation problems during -* writeback however as we have to allocate an array of pointers for the -* pages. A 16M write means ~32kb page array with PAGE_CACHE_SIZE == 4096. -*/ -#define CIFS_MAX_WSIZE ((1<<24) - 1 - sizeof(WRITE_REQ) + 4) +/* Prior to 3.0, cifs couldn't handle writes larger than this */ +#define CIFS_MAX_WSIZE (PAGEVEC_SIZE * PAGE_CACHE_SIZE)/* * When the server doesn't allow large posix writes, only allow a wsize of
@@ -2666,12 +2658,8 @@ static void setup_cifs_sb(struct smb_vol*/ #define CIFS_MAX_RFC1002_WSIZE (128 * 1024 - sizeof(WRITE_REQ) + 4) -/* -* The default wsize is 1M. find_get_pages seems to return a maximum of 256 -* pages in a single call. With PAGE_CACHE_SIZE == 4k, this means we can fill -* a single wsize request with a single call. -*/ -#define CIFS_DEFAULT_WSIZE (1024 * 1024) +/* Make the default the same as the max */ +#define CIFS_DEFAULT_WSIZE CIFS_MAX_WSIZEstatic unsigned int cifs_negotiate_wsize (struct cifsTconInfo *tcon,struct smb_vol *pvolume_info)
PATCH 69/70 bridge: send proper message_age in config BPDU
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: stephen hemminger <[email protected]>
commit 0c03150e7ea8f7fcd03cfef29385e0010b22ee92 upstream.
A bridge topology with three systems:
+------+ +------+
| A(2) |--| B(1) |
+------+ +------+
\ /
+------+
| C(3) |
+------+What is supposed to happen:
* bridge with the lowest ID is elected root (for example: B)
* C detects that A->C is higher cost path and puts in blocking state
What happens. Bridge with lowest id (B) is elected correctly as root and things start out fine initially. But then config BPDU doesn't get transmitted from A -> C. Because of that the link from A-C is transistioned to the forwarding state.
The root cause of this is that the configuration messages is generated with bogus message age, and dropped before sending.
In the standardmessage_age is supposed to be:
the time since the generation of the Configuration BPDU by the Root that instigated the generation of this Configuration BPDU.
Reimplement this by recording the timestamp (age + jiffies) when recording config information. The old code incorrectly used the time elapsed on the ageing timer which was incorrect.
See also:
https://bugzilla.vyatta.com/show_bug.cgi?id=7164
--- net/bridge/br_private.h | 1 + net/bridge/br_stp.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-)
net/bridge/br_private.h +1 -0
@@ -123,6 +123,7 @@ struct net_bridge_portbridge_id designated_bridge;u32 path_cost;u32 designated_cost; +unsigned long designated_age;struct timer_list forward_delay_timer;struct timer_list hold_timer;
net/bridge/br_stp.c +2 -2
@@ -164,8 +164,7 @@ void br_transmit_config(struct net_bridgelse {struct net_bridge_port *root =br_get_port (br, br->root_port); - bpdu.message_age = br->max_age - - (root->message_age_timer.expires - jiffies) + bpdu.message_age = (jiffies - root->designated_age) +MESSAGE_AGE_INCR ; } bpdu.max_age = br->max_age;
@@ -189,6 +188,7 @@ static inline void br_record_config_info p->designated_cost = bpdu->root_path_cost; p->designated_bridge = bpdu->bridge_id; p->designated_port = bpdu->port_id; + p->designated_age = jiffies + bpdu->message_age;mod_timer (&p->message_age_timer, jiffies + (p->br->max_age - bpdu->message_age));
PATCH 70/70 gro: Only reset frag0 when skb can be pulled
In reply to Greg KH2.6.39-stable review patch. If anyone has any objections, please let us know.
------------------
From: Herbert Xu <[email protected]>
commit 17dd759c67f21e34f2156abcf415e1f60605a188 upstream.
Currently skb_gro_header_slow unconditionally resets frag0 and frag0_len. However, when we can't pull on the skb this leaves the GRO fields in an inconsistent state.
This patch fixes this by only resetting those fields after the pskb_may_pull test.
--- include/linux/netdevice.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
include/linux/netdevice.h +4 -1
@@ -1680,9 +1680,12 @@ static inline int skb_gro_header_hard(ststatic inline void *skb_gro_header_slow (struct sk_buff *skb,unsigned int hlen,unsigned int offset) { +if (!pskb_may_pull (skb, hlen)) +return NULL ; +NAPI_GRO_CB (skb)->frag0 =NULL ;NAPI_GRO_CB (skb)->frag0_len =0 ; -return pskb_may_pull (skb, hlen) ? skb->data + offset :NULL ; +return skb->data + offset; }static inline void *skb_gro_mac_header (struct sk_buff *skb)