3.0.7-stable review
Subsystems (36)
cover 3.0.7-stable review
This is the start of the stable review cycle for the 3.0.7 release. There are 38 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 Thursday, October 13, 17:00:00 UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch in the message following this one and the diffstat can be found below.
thanks,
greg k-h
Makefile | 4 +- arch/arm/mach-ux500/Kconfig | 1 + arch/mips/jz4740/gpio.c | 52 ++++----- arch/sparc/mm/init_64.c | 5 + arch/x86/pci/acpi.c | 25 +++++ drivers/ata/ahci.c | 12 ++ drivers/gpu/drm/radeon/atombios_dp.c | 28 ++++-- drivers/gpu/drm/radeon/evergreen.c | 44 -------- drivers/gpu/drm/radeon/ni.c | 32 ------ drivers/gpu/drm/radeon/radeon_connectors.c | 8 +- drivers/gpu/drm/radeon/radeon_cursor.c | 12 ++- drivers/gpu/drm/radeon/radeon_encoders.c | 9 +- drivers/gpu/drm/radeon/rv770.c | 51 --------- drivers/ide/ide-disk.c | 7 +- drivers/md/dm-table.c | 13 ++- drivers/md/md.c | 22 ++++- drivers/md/md.h | 2 +- drivers/md/multipath.c | 3 +- drivers/md/raid1.c | 3 +- drivers/md/raid10.c | 5 +- drivers/md/raid5.c | 6 +- drivers/misc/lis3lv02d/lis3lv02d.c | 14 ++- drivers/mmc/host/mxs-mmc.c | 30 +++--- drivers/net/e1000e/ich8lan.c | 19 +++- drivers/net/wireless/rt2x00/rt2x00queue.c | 21 +++- drivers/net/wireless/rt2x00/rt2x00queue.h | 2 + drivers/pci/hotplug/pcihp_slot.c | 47 +-------- drivers/pci/pci.c | 71 ++++++++++++ drivers/pci/probe.c | 159 ++++++++++++++++++++++++++++ drivers/scsi/libsas/sas_expander.c | 10 +- drivers/scsi/qla2xxx/qla_os.c | 9 +- fs/exec.c | 2 + include/linux/ftrace.h | 7 +- include/linux/pci.h | 16 +++- include/linux/ptp_classify.h | 13 ++- include/linux/sched.h | 1 - include/net/ipv6.h | 2 +- kernel/posix-cpu-timers.c | 5 +- kernel/sched.c | 26 +----- kernel/sched_rt.c | 4 +- kernel/trace/ftrace.c | 42 ++++++-- kernel/trace/trace_functions.c | 3 +- net/ipv6/ip6_output.c | 10 +- net/ipv6/udp.c | 4 +- sound/soc/codecs/wm8753.c | 4 +- sound/soc/pxa/zylonite.c | 8 +- 46 files changed, 525 insertions(+), 348 deletions(-)
Here is the 3.0.7-rc1 patch.
greg k-h
Makefile +2 -2
@@ -1,7 +1,7 @@ VERSION = 3 PATCHLEVEL = 0 -SUBLEVEL = 6 -EXTRAVERSION = +SUBLEVEL = 7 +EXTRAVERSION = -rc1 NAME = Sneaky Weasel # *DOCUMENTATION*
arch/arm/mach-ux500/Kconfig +1 -0
@@ -6,6 +6,7 @@ config UX500_SOC_COMMON select ARM_GIC select HAS_MTU select ARM_ERRATA_753970 + select ARM_ERRATA_754322 menu "Ux500 SoC"
arch/mips/jz4740/gpio.c +22 -30
107 lines not on this page · raw message
arch/sparc/mm/init_64.c +5 -0
@@ -511,6 +511,11 @@ static void __init read_obp_translations(void)for (i =0 ; i < prom_trans_ents; i++) prom_trans[i].data &= ~0x0003fe0000000000UL ; } + +/* Force execute bit on. */ +for (i =0 ; i < prom_trans_ents; i++) + prom_trans[i].data |= (tlb_type == hypervisor ? + _PAGE_EXEC_4V : _PAGE_EXEC_4U); } static void __init hypervisor_tlb_lock(unsigned long vaddr,
arch/x86/pci/acpi.c +25 -0
@@ -43,6 +43,17 @@ static const struct dmi_system_id pci_use_crs_table[] __initconst = { DMI_MATCH(DMI_PRODUCT_NAME, "ALiveSATA2-GLAN"), }, }, +/* https://bugzilla.kernel.org/show_bug.cgi?id=30552 */ +/* 2006 AMD HT/VIA system with two host bridges */ + { + .callback = set_use_crs, + .ident = "ASUS M2V-MX SE", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), + DMI_MATCH(DMI_BOARD_NAME, "M2V-MX SE"), + DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."), + }, + }, {} };
@@ -361,6 +372,20 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_pci_root *root) } } +/* After the PCI-E bus has been walked and all devices discovered, +* configure any settings of the fabric that might be necessary. +*/ +if (bus) { +struct pci_bus *child; +list_for_each_entry (child, &bus->children, node) { +struct pci_dev *self = child->self; +if (!self) +continue ; + +pcie_bus_configure_settings (child, self->pcie_mpss); + } + } +if (!bus)kfree (sd);
drivers/ata/ahci.c +12 -0
@@ -812,6 +812,18 @@ static bool ahci_sb600_enable_64bit(struct pci_dev *pdev) DMI_MATCH(DMI_BOARD_NAME, "MS-7376"), }, }, +/* +* All BIOS versions for the Asus M3A support 64bit DMA. +* (all release versions from 0301 to 1206 were tested) +*/ + { + .ident = "ASUS M3A", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, + "ASUSTeK Computer INC."), + DMI_MATCH(DMI_BOARD_NAME, "M3A"), + }, + }, { } }; const struct dmi_system_id *match;
drivers/gpu/drm/radeon/atombios_dp.c +19 -9
@@ -115,6 +115,7 @@ static int radeon_dp_aux_native_write(struct radeon_connector *radeon_connector,u8 msg[20 ];int msg_bytes = send_bytes +4 ;u8 ack; +unsigned retry;if (send_bytes >16 )return -1 ;
@@ -125,20 +126,22 @@ static int radeon_dp_aux_native_write(struct radeon_connector *radeon_connector, msg[3 ] = (msg_bytes <<4 ) | (send_bytes -1 );memcpy (&msg[4 ], send, send_bytes); -while (1 ) { +for (retry =0 ; retry <4 ; retry++) { ret =radeon_process_aux_ch (dig_connector->dp_i2c_bus, msg, msg_bytes,NULL ,0 , delay, &ack); -if (ret <0 ) +if (ret == -EBUSY ) +continue ; +else if (ret <0 )return ret;if ((ack &AUX_NATIVE_REPLY_MASK ) ==AUX_NATIVE_REPLY_ACK ) -break ; +return send_bytes;else if ((ack &AUX_NATIVE_REPLY_MASK ) ==AUX_NATIVE_REPLY_DEFER )udelay (400 );else return -EIO ; } -return send_bytes; +return -EIO ; } static int radeon_dp_aux_native_read(struct radeon_connector *radeon_connector,
@@ -149,26 +152,31 @@ static int radeon_dp_aux_native_read(struct radeon_connector *radeon_connector,int msg_bytes =4 ;u8 ack;int ret; +unsigned retry; msg[0 ] = address; msg[1 ] = address >>8 ; msg[2 ] =AUX_NATIVE_READ <<4 ; msg[3 ] = (msg_bytes <<4 ) | (recv_bytes -1 ); -while (1 ) { +for (retry =0 ; retry <4 ; retry++) { ret =radeon_process_aux_ch (dig_connector->dp_i2c_bus, msg, msg_bytes, recv, recv_bytes, delay, &ack); -if (ret ==0 ) -return -EPROTO ; -if (ret <0 ) +if (ret == -EBUSY ) +continue ; +else if (ret <0 )return ret;if ((ack &AUX_NATIVE_REPLY_MASK ) ==AUX_NATIVE_REPLY_ACK )return ret;else if ((ack &AUX_NATIVE_REPLY_MASK ) ==AUX_NATIVE_REPLY_DEFER )udelay (400 ); +else if (ret ==0 ) +return -EPROTO ;else return -EIO ; } + +return -EIO ; } static void radeon_write_dpcd_reg(struct radeon_connector *radeon_connector,
@@ -232,7 +240,9 @@ int radeon_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,for (retry =0 ; retry <4 ; retry++) { ret =radeon_process_aux_ch (auxch, msg, msg_bytes, reply, reply_bytes,0 , &ack); -if (ret <0 ) { +if (ret == -EBUSY ) +continue ; +else if (ret <0 ) {DRM_DEBUG_KMS ("aux_ch failed %d\n" , ret);return ret; }
drivers/gpu/drm/radeon/evergreen.c +0 -44
56 lines not on this page · raw message
drivers/gpu/drm/radeon/ni.c +0 -32
@@ -569,36 +569,6 @@ static u32 cayman_get_tile_pipe_to_backend_map(struct radeon_device *rdev,return backend_map; } -static void cayman_program_channel_remap (struct radeon_device *rdev) -{ -u32 tcp_chan_steer_lo, tcp_chan_steer_hi, mc_shared_chremap, tmp; - - tmp =RREG32 (MC_SHARED_CHMAP ); -switch ((tmp &NOOFCHAN_MASK ) >>NOOFCHAN_SHIFT ) { -case 0 : -case 1 : -case 2 : -case 3 : -default : -/* default mapping */ - mc_shared_chremap =0x00fac688 ; -break ; - } - -switch (rdev->family) { -case CHIP_CAYMAN : -default : -//tcp_chan_steer_lo = 0x54763210 - tcp_chan_steer_lo =0x76543210 ; - tcp_chan_steer_hi =0x0000ba98 ; -break ; - } - -WREG32 (TCP_CHAN_STEER_LO , tcp_chan_steer_lo); -WREG32 (TCP_CHAN_STEER_HI , tcp_chan_steer_hi); -WREG32 (MC_SHARED_CHREMAP , mc_shared_chremap); -} - static u32 cayman_get_disable_mask_per_asic(struct radeon_device *rdev, u32 disable_mask_per_se, u32 max_disable_mask_per_se,
@@ -841,8 +811,6 @@ static void cayman_gpu_init(struct radeon_device *rdev)WREG32 (DMIF_ADDR_CONFIG , gb_addr_config);WREG32 (HDP_ADDR_CONFIG , gb_addr_config); -cayman_program_channel_remap (rdev); -/* primary versions */ WREG32 (CC_RB_BACKEND_DISABLE , cc_rb_backend_disable);WREG32 (CC_SYS_RB_BACKEND_DISABLE , cc_rb_backend_disable);
drivers/gpu/drm/radeon/radeon_connectors.c +4 -4
@@ -68,11 +68,11 @@ void radeon_connector_hotplug(struct drm_connector *connector)if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) {int saved_dpms = connector->dpms; -if (radeon_hpd_sense (rdev, radeon_connector->hpd.hpd) && -radeon_dp_needs_link_train (radeon_connector)) -drm_helper_connector_dpms (connector,DRM_MODE_DPMS_ON ); -else +/* Only turn off the display it it's physically disconnected */ +if (!radeon_hpd_sense (rdev, radeon_connector->hpd.hpd))drm_helper_connector_dpms (connector,DRM_MODE_DPMS_OFF ); +else if (radeon_dp_needs_link_train (radeon_connector)) +drm_helper_connector_dpms (connector,DRM_MODE_DPMS_ON ); connector->dpms = saved_dpms; } }
drivers/gpu/drm/radeon/radeon_cursor.c +7 -5
@@ -208,6 +208,13 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,int xorigin =0 , yorigin =0 ;int w = radeon_crtc->cursor_width; +if (ASIC_IS_AVIVO (rdev)) { +/* avivo cursor are offset into the total surface */ + x += crtc->x; + y += crtc->y; + } +DRM_DEBUG ("x %d y %d c->x %d c->y %d\n" , x, y, crtc->x, crtc->y); +if (x <0 ) xorigin = -x +1 ;if (y <0 )
@@ -221,11 +228,6 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,int i =0 ;struct drm_crtc *crtc_p; -/* avivo cursor are offset into the total surface */ - x += crtc->x; - y += crtc->y; -DRM_DEBUG ("x %d y %d c->x %d c->y %d\n" , x, y, crtc->x, crtc->y); -/* avivo cursor image can't end on 128 pixel boundary or * go past the end of the frame if both crtcs are enabled */
drivers/gpu/drm/radeon/radeon_encoders.c +6 -3
@@ -1755,9 +1755,12 @@ static int radeon_atom_pick_dig_encoder(struct drm_encoder *encoder)/* DCE4/5 */ if (ASIC_IS_DCE4 (rdev)) { dig = radeon_encoder->enc_priv; -if (ASIC_IS_DCE41 (rdev)) -return radeon_crtc->crtc_id; -else { +if (ASIC_IS_DCE41 (rdev)) { +if (dig->linkb) +return 1 ; +else +return 0 ; + }else {switch (radeon_encoder->encoder_id) {case ENCODER_OBJECT_ID_INTERNAL_UNIPHY :if (dig->linkb)
drivers/gpu/drm/radeon/rv770.c +0 -51
63 lines not on this page · raw message
drivers/ide/ide-disk.c +6 -1
@@ -435,7 +435,12 @@ static int idedisk_prep_fn(struct request_queue *q, struct request *rq)if (!(rq->cmd_flags &REQ_FLUSH ))return BLKPREP_OK ; - cmd =kzalloc (sizeof (*cmd),GFP_ATOMIC ); +if (rq->special) { + cmd = rq->special; +memset (cmd,0 ,sizeof (*cmd)); + }else { + cmd =kzalloc (sizeof (*cmd),GFP_ATOMIC ); + }/* FIXME: map struct ide_taskfile on rq->cmd[] */ BUG_ON (cmd ==NULL );
drivers/md/dm-table.c +7 -6
@@ -1184,14 +1184,15 @@ static void dm_table_set_integrity(struct dm_table *t)return ; template_disk =dm_table_get_integrity_disk (t, true); -if (!template_disk && -blk_integrity_is_initialized (dm_disk (t->md))) { +if (template_disk) +blk_integrity_register (dm_disk (t->md), +blk_get_integrity (template_disk)); +else if (blk_integrity_is_initialized (dm_disk (t->md)))DMWARN ("%s: device no longer has a valid integrity profile" ,dm_device_name (t->md)); -return ; - } -blk_integrity_register (dm_disk (t->md), -blk_get_integrity (template_disk)); +else +DMWARN ("%s: unable to establish an integrity profile" , +dm_device_name (t->md)); } void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
drivers/md/md.c +19 -3
@@ -61,6 +61,11 @@static void autostart_arrays (int part);#endif +/* pers_list is a list of registered personalities protected +* by pers_lock. +* pers_lock does extra service to protect accesses to +* mddev->thread when the mutex cannot be held. +*/ static LIST_HEAD (pers_list);static DEFINE_SPINLOCK (pers_lock);
@@ -690,7 +695,12 @@ static void mddev_unlock(mddev_t * mddev) }else mutex_unlock (&mddev->reconfig_mutex); +/* was we've dropped the mutex we need a spinlock to +* make sur the thread doesn't disappear +*/ +spin_lock (&pers_lock);md_wakeup_thread (mddev->thread); +spin_unlock (&pers_lock); }static mdk_rdev_t *find_rdev_nr (mddev_t *mddev,int nr)
@@ -6186,11 +6196,18 @@ mdk_thread_t *md_register_thread(void (*run) (mddev_t *), mddev_t *mddev,return thread; } -void md_unregister_thread (mdk_thread_t *thread) +void md_unregister_thread (mdk_thread_t **threadp) { +mdk_thread_t *thread = *threadp;if (!thread)return ;dprintk ("interrupting MD-thread pid %d\n" ,task_pid_nr (thread->tsk)); +/* Locking ensures that mddev_unlock does not wake_up a +* non-existent thread +*/ +spin_lock (&pers_lock); + *threadp =NULL ; +spin_unlock (&pers_lock);kthread_stop (thread->tsk);kfree (thread);
@@ -7125,8 +7142,7 @@ static void reap_sync_thread(mddev_t *mddev)mdk_rdev_t *rdev;/* resync has finished, collect result */ -md_unregister_thread (mddev->sync_thread); - mddev->sync_thread =NULL ; +md_unregister_thread (&mddev->sync_thread);if (!test_bit (MD_RECOVERY_INTR , &mddev->recovery) && !test_bit (MD_RECOVERY_REQUESTED , &mddev->recovery)) {/* success...*/
drivers/md/md.h +1 -1
@@ -475,7 +475,7 @@ extern int register_md_personality(struct mdk_personality *p);extern int unregister_md_personality (struct mdk_personality *p);extern mdk_thread_t *md_register_thread (void (*run) (mddev_t *mddev),mddev_t *mddev,const char *name); -extern void md_unregister_thread (mdk_thread_t *thread); +extern void md_unregister_thread (mdk_thread_t **threadp);extern void md_wakeup_thread (mdk_thread_t *thread);extern void md_check_recovery (mddev_t *mddev);extern void md_write_start (mddev_t *mddev,struct bio *bi);
drivers/md/multipath.c +1 -2
@@ -514,8 +514,7 @@ static int multipath_stop (mddev_t *mddev) {multipath_conf_t *conf = mddev->private; -md_unregister_thread (mddev->thread); - mddev->thread =NULL ; +md_unregister_thread (&mddev->thread);blk_sync_queue (mddev->queue);/* the unplug fn references 'conf'*/ mempool_destroy (conf->pool);kfree (conf->multipaths);
drivers/md/raid1.c +1 -2
@@ -2045,8 +2045,7 @@ static int stop(mddev_t *mddev)raise_barrier (conf);lower_barrier (conf); -md_unregister_thread (mddev->thread); - mddev->thread =NULL ; +md_unregister_thread (&mddev->thread);if (conf->r1bio_pool)mempool_destroy (conf->r1bio_pool);kfree (conf->mirrors);
drivers/md/raid10.c +2 -3
@@ -2331,7 +2331,7 @@ static int run(mddev_t *mddev)return 0 ; out_free_conf: -md_unregister_thread (mddev->thread); +md_unregister_thread (&mddev->thread);if (conf->r10bio_pool)mempool_destroy (conf->r10bio_pool);safe_put_page (conf->tmppage);
@@ -2349,8 +2349,7 @@ static int stop(mddev_t *mddev)raise_barrier (conf,0 );lower_barrier (conf); -md_unregister_thread (mddev->thread); - mddev->thread =NULL ; +md_unregister_thread (&mddev->thread);blk_sync_queue (mddev->queue);/* the unplug fn references 'conf'*/ if (conf->r10bio_pool)mempool_destroy (conf->r10bio_pool);
drivers/md/raid5.c +2 -4
@@ -5162,8 +5162,7 @@ static int run(mddev_t *mddev)return 0 ; abort: -md_unregister_thread (mddev->thread); - mddev->thread =NULL ; +md_unregister_thread (&mddev->thread);if (conf) {print_raid5_conf (conf);free_conf (conf);
@@ -5177,8 +5176,7 @@ static int stop(mddev_t *mddev) {raid5_conf_t *conf = mddev->private; -md_unregister_thread (mddev->thread); - mddev->thread =NULL ; +md_unregister_thread (&mddev->thread);if (mddev->queue) mddev->queue->backing_dev_info.congested_fn =NULL ;free_conf (conf);
drivers/misc/lis3lv02d/lis3lv02d.c +8 -6
@@ -375,12 +375,14 @@ void lis3lv02d_poweron(struct lis3lv02d *lis3)* both have been read. So the value read will always be correct. * Set BOOT bit to refresh factory tuning values. */ - lis3->read (lis3,CTRL_REG2 , ®); -if (lis3->whoami ==WAI_12B ) - reg |=CTRL2_BDU |CTRL2_BOOT ; -else - reg |=CTRL2_BOOT_8B ; - lis3->write (lis3,CTRL_REG2 , reg); +if (lis3->pdata) { + lis3->read (lis3,CTRL_REG2 , ®); +if (lis3->whoami ==WAI_12B ) + reg |=CTRL2_BDU |CTRL2_BOOT ; +else + reg |=CTRL2_BOOT_8B ; + lis3->write (lis3,CTRL_REG2 , reg); + }/* LIS3 power on delay is quite long */ msleep (lis3->pwron_delay /lis3lv02d_get_odr ());
drivers/mmc/host/mxs-mmc.c +14 -16
@@ -564,40 +564,38 @@ static void mxs_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)static void mxs_mmc_set_clk_rate (struct mxs_mmc_host *host,unsigned int rate) { -unsigned int ssp_rate, bit_rate; -u32 div1, div2; +unsigned int ssp_clk, ssp_sck; +u32 clock_divide, clock_rate;u32 val; - ssp_rate =clk_get_rate (host->clk); + ssp_clk =clk_get_rate (host->clk); -for (div1 =2 ; div1 <254 ; div1 +=2 ) { - div2 = ssp_rate / rate / div1; -if (div2 <0x100 ) +for (clock_divide =2 ; clock_divide <=254 ; clock_divide +=2 ) { + clock_rate =DIV_ROUND_UP (ssp_clk, rate * clock_divide); + clock_rate = (clock_rate >0 ) ? clock_rate -1 :0 ; +if (clock_rate <=255 )break ; } -if (div1 >=254 ) { +if (clock_divide >254 ) {dev_err (mmc_dev (host->mmc),"%s: cannot set clock to %d\n" , __func__, rate);return ; } -if (div2 ==0 ) - bit_rate = ssp_rate / div1; -else - bit_rate = ssp_rate / div1 / div2; + ssp_sck = ssp_clk / clock_divide / (1 + clock_rate); val =readl (host->base +HW_SSP_TIMING ); val &= ~(BM_SSP_TIMING_CLOCK_DIVIDE |BM_SSP_TIMING_CLOCK_RATE ); - val |=BF_SSP (div1,TIMING_CLOCK_DIVIDE ); - val |=BF_SSP (div2 -1 ,TIMING_CLOCK_RATE ); + val |=BF_SSP (clock_divide,TIMING_CLOCK_DIVIDE ); + val |=BF_SSP (clock_rate,TIMING_CLOCK_RATE );writel (val, host->base +HW_SSP_TIMING ); - host->clk_rate = bit_rate; + host->clk_rate = ssp_sck;dev_dbg (mmc_dev (host->mmc), -"%s: div1 %d, div2 %d, ssp %d, bit %d, rate %d\n" , - __func__, div1, div2, ssp_rate, bit_rate, rate); +"%s: clock_divide %d, clock_rate %d, ssp_clk %d, rate_actual %d, rate_requested %d\n" , + __func__, clock_divide, clock_rate, ssp_clk, ssp_sck, rate); }static void mxs_mmc_set_ios (struct mmc_host *mmc,struct mmc_ios *ios)
drivers/net/e1000e/ich8lan.c +14 -5
@@ -137,8 +137,9 @@#define HV_PM_CTRL PHY_REG(770, 17)/* PHY Low Power Idle Control */ -#define I82579_LPI_CTRL PHY_REG(772, 20) -#define I82579_LPI_CTRL_ENABLE_MASK 0x6000 +#define I82579_LPI_CTRL PHY_REG(772, 20) +#define I82579_LPI_CTRL_ENABLE_MASK 0x6000 +#define I82579_LPI_CTRL_FORCE_PLL_LOCK_COUNT 0x80/* EMI Registers */ #define I82579_EMI_ADDR 0x10
@@ -1611,6 +1612,7 @@ static s32 e1000_k1_workaround_lv(struct e1000_hw *hw)s32 ret_val =0 ;u16 status_reg =0 ;u32 mac_reg; +u16 phy_reg;if (hw->mac.type != e1000_pch2lan) goto out;
@@ -1625,12 +1627,19 @@ static s32 e1000_k1_workaround_lv(struct e1000_hw *hw) mac_reg =er32 (FEXTNVM4 ); mac_reg &= ~E1000_FEXTNVM4_BEACON_DURATION_MASK ; -if (status_reg &HV_M_STATUS_SPEED_1000 ) + ret_val =e1e_rphy (hw,I82579_LPI_CTRL , &phy_reg); +if (ret_val) + goto out; + +if (status_reg &HV_M_STATUS_SPEED_1000 ) { mac_reg |=E1000_FEXTNVM4_BEACON_DURATION_8USEC ; -else + phy_reg &= ~I82579_LPI_CTRL_FORCE_PLL_LOCK_COUNT ; + }else { mac_reg |=E1000_FEXTNVM4_BEACON_DURATION_16USEC ; - + phy_reg |=I82579_LPI_CTRL_FORCE_PLL_LOCK_COUNT ; + }ew32 (FEXTNVM4 , mac_reg); + ret_val =e1e_wphy (hw,I82579_LPI_CTRL , phy_reg); } out:
drivers/net/wireless/rt2x00/rt2x00queue.c +16 -5
@@ -556,15 +556,21 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb, bool local) {struct ieee80211_tx_info *tx_info; -struct queue_entry *entry =rt2x00queue_get_entry (queue,Q_INDEX ); +struct queue_entry *entry;struct txentry_desc txdesc;struct skb_frame_desc *skbdesc;u8 rate_idx, rate_flags; +int ret =0 ; + +spin_lock (&queue->tx_lock); + + entry =rt2x00queue_get_entry (queue,Q_INDEX );if (unlikely (rt2x00queue_full (queue))) {ERROR (queue->rt2x00dev,"Dropping frame due to full tx queue %d.\n" , queue->qid); -return -ENOBUFS ; + ret = -ENOBUFS ; + goto out; } if (unlikely(test_and_set_bit(ENTRY_OWNER_DEVICE_DATA,
@@ -573,7 +579,8 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,"Arrived at non-free entry in the non-full queue %d.\n" "Please file bug report to %s.\n" , queue->qid, DRV_PROJECT); -return -EINVAL ; + ret = -EINVAL ; + goto out; }/*
@@ -635,7 +642,8 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,if (unlikely (rt2x00queue_write_tx_data (entry, &txdesc))) {clear_bit (ENTRY_OWNER_DEVICE_DATA , &entry->flags); entry->skb =NULL ; -return -EIO ; + ret = -EIO ; + goto out; }set_bit (ENTRY_DATA_PENDING , &entry->flags);
@@ -644,7 +652,9 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,rt2x00queue_write_tx_descriptor (entry, &txdesc);rt2x00queue_kick_tx_queue (queue, &txdesc); -return 0 ; +out: +spin_unlock (&queue->tx_lock); +return ret; } int rt2x00queue_clear_beacon(struct rt2x00_dev *rt2x00dev,
@@ -1185,6 +1195,7 @@ static void rt2x00queue_init(struct rt2x00_dev *rt2x00dev, struct data_queue *queue, enum data_queue_qid qid) {mutex_init (&queue->status_lock); +spin_lock_init (&queue->tx_lock);spin_lock_init (&queue->index_lock); queue->rt2x00dev = rt2x00dev;
drivers/net/wireless/rt2x00/rt2x00queue.h +2 -0
@@ -432,6 +432,7 @@ enum data_queue_flags {* @flags: Entry flags, see &enum queue_entry_flags. * @status_lock: The mutex for protecting the start/stop/flush * handling on this queue. +* @tx_lock: Spinlock to serialize tx operations on this queue. * @index_lock: Spinlock to protect index handling. Whenever @index, @index_done or * @index_crypt needs to be changed this lock should be grabbed to prevent * index corruption due to concurrency.
@@ -458,6 +459,7 @@ struct data_queue {unsigned long flags;struct mutex status_lock; +spinlock_t tx_lock;spinlock_t index_lock;unsigned int count;
drivers/pci/hotplug/pcihp_slot.c +3 -44
59 lines not on this page · raw message
drivers/pci/pci.c +71 -0
89 lines not on this page · raw message
drivers/pci/probe.c +159 -0
171 lines not on this page · raw message
drivers/scsi/libsas/sas_expander.c +6 -4
@@ -1769,10 +1769,12 @@ static void sas_unregister_devs_sas_addr(struct domain_device *parent,sas_disable_routing (parent, phy->attached_sas_addr); }memset (phy->attached_sas_addr,0 ,SAS_ADDR_SIZE ); -sas_port_delete_phy (phy->port, phy->phy); -if (phy->port->num_phys ==0 ) -sas_port_delete (phy->port); - phy->port =NULL ; +if (phy->port) { +sas_port_delete_phy (phy->port, phy->phy); +if (phy->port->num_phys ==0 ) +sas_port_delete (phy->port); + phy->port =NULL ; + } } static int sas_discover_bfs_by_root_level(struct domain_device *root,
drivers/scsi/qla2xxx/qla_os.c +5 -4
@@ -1240,10 +1240,9 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res)qla2x00_sp_compl (ha, sp); }else { ctx = sp->ctx; -if (ctx->type ==SRB_LOGIN_CMD || - ctx->type ==SRB_LOGOUT_CMD ) { - ctx->u.iocb_cmd->free (sp); - }else { +if (ctx->type ==SRB_ELS_CMD_RPT || + ctx->type ==SRB_ELS_CMD_HST || + ctx->type ==SRB_CT_CMD ) {struct fc_bsg_job *bsg_job = ctx->u.bsg_job; if (bsg_job->request->msgcode
@@ -1255,6 +1254,8 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res)kfree (sp->ctx);mempool_free (sp, ha->srb_mempool); + }else { + ctx->u.iocb_cmd->free (sp); } } }
fs/exec.c +2 -0
@@ -1411,6 +1411,8 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)printable (bprm->buf[2 ]) && printable(bprm->buf[3])) break; /* -ENOEXEC */ +if (try) +break ;/* -ENOEXEC */ request_module ("binfmt-%04x" , *(unsigned short *)(&bprm->buf[2 ]));#endif }
include/linux/ftrace.h +4 -3
@@ -19,6 +19,8 @@#include <asm/ftrace.h> +struct ftrace_hash ; +#ifdef CONFIG_FUNCTION_TRACER extern int ftrace_enabled;
@@ -29,8 +31,6 @@ ftrace_enable_sysctl(struct ctl_table *table, int write,typedef void (*ftrace_func_t )(unsigned long ip,unsigned long parent_ip); -struct ftrace_hash ; -enum {FTRACE_OPS_FL_ENABLED =1 <<0 ,FTRACE_OPS_FL_GLOBAL =1 <<1 ,
@@ -123,7 +123,8 @@ stack_trace_sysctl(struct ctl_table *table, int write,struct ftrace_func_command {struct list_head list;char *name; -int (*func)(char *func,char *cmd, +int (*func)(struct ftrace_hash *hash, +char *func,char *cmd,char *params,int enable); };
include/linux/pci.h +15 -1
@@ -251,7 +251,8 @@ struct pci_dev {u8 revision;/* PCI revision, low byte of class word */ u8 hdr_type;/* PCI header type (`multi' flag masked out) */ u8 pcie_cap;/* PCI-E capability offset */ -u8 pcie_type;/* PCI-E device/port type */ + u8 pcie_type:4; /* PCI-E device/port type */ + u8 pcie_mpss:3; /* PCI-E Max Payload Size Supported */u8 rom_base_reg;/* which config register controls the ROM */ u8 pin;/* which interrupt pin this device uses */
@@ -617,6 +618,17 @@ struct pci_driver {/* these external functions are only available when PCI support is enabled */ #ifdef CONFIG_PCI +extern void pcie_bus_configure_settings (struct pci_bus *bus,u8 smpss); + +enum pcie_bus_config_types { +PCIE_BUS_TUNE_OFF , +PCIE_BUS_SAFE , +PCIE_BUS_PERFORMANCE , +PCIE_BUS_PEER2PEER , +}; + +extern enum pcie_bus_config_types pcie_bus_config; +extern struct bus_type pci_bus_type;/* Do NOT directly access these two variables, unless you are arch specific pci
@@ -796,6 +808,8 @@ int pcix_get_mmrbc(struct pci_dev *dev);int pcix_set_mmrbc (struct pci_dev *dev,int mmrbc);int pcie_get_readrq (struct pci_dev *dev);int pcie_set_readrq (struct pci_dev *dev,int rq); +int pcie_get_mps (struct pci_dev *dev); +int pcie_set_mps (struct pci_dev *dev,int mps);int __pci_reset_function (struct pci_dev *dev);int pci_reset_function (struct pci_dev *dev);void pci_update_resource (struct pci_dev *dev,int resno);
include/linux/ptp_classify.h +10 -3
@@ -51,6 +51,7 @@#define PTP_CLASS_V2_VLAN (PTP_CLASS_V2 | PTP_CLASS_VLAN)#define PTP_EV_PORT 319 +#define PTP_GEN_BIT 0x08/* indicates general message, if set in message type */ #define OFF_ETYPE 12#define OFF_IHL 14
@@ -116,14 +117,20 @@ static inline int ptp_filter_init(struct sock_filter *f, int len) {OP_OR, 0, 0, PTP_CLASS_IPV6 }, /* */ \ {OP_RETA, 0, 0, 0 }, /* */ \ /*L3x*/ {OP_RETK, 0, 0, PTP_CLASS_NONE }, /* */ \ -/*L40*/ {OP_JEQ, 0, 6, ETH_P_8021Q }, /* f goto L50 */ \ +/*L40*/ {OP_JEQ, 0, 9, ETH_P_8021Q }, /* f goto L50 */ \ {OP_LDH, 0, 0, OFF_ETYPE + 4 }, /* */ \ - {OP_JEQ, 0, 9, ETH_P_1588 }, /* f goto L60 */ \ + {OP_JEQ, 0, 15, ETH_P_1588 }, /* f goto L60 */ \ + {OP_LDB, 0, 0, ETH_HLEN + VLAN_HLEN }, /* */ \ + {OP_AND, 0, 0, PTP_GEN_BIT }, /* */ \ + {OP_JEQ, 0, 12, 0 }, /* f goto L6x */ \ {OP_LDH, 0, 0, ETH_HLEN + VLAN_HLEN }, /* */ \ {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \ {OP_OR, 0, 0, PTP_CLASS_VLAN }, /* */ \ {OP_RETA, 0, 0, 0 }, /* */ \ -/*L50*/ {OP_JEQ, 0, 4, ETH_P_1588 }, /* f goto L61 */ \ +/*L50*/ {OP_JEQ, 0, 7, ETH_P_1588 }, /* f goto L61 */ \ + {OP_LDB, 0, 0, ETH_HLEN }, /* */ \ + {OP_AND, 0, 0, PTP_GEN_BIT }, /* */ \ + {OP_JEQ, 0, 4, 0 }, /* f goto L6x */ \ {OP_LDH, 0, 0, ETH_HLEN }, /* */ \ {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \ {OP_OR, 0, 0, PTP_CLASS_L2 }, /* */ \
include/linux/sched.h +0 -1
@@ -1937,7 +1937,6 @@ static inline void disable_sched_clock_irqtime(void) {}extern unsigned long long task_sched_runtime (struct task_struct *task); -extern unsigned long long thread_group_sched_runtime (struct task_struct *task);/* sched_exec is called by processes performing an exec */ #ifdef CONFIG_SMP
include/net/ipv6.h +1 -1
@@ -463,7 +463,7 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_addreturn __ipv6_addr_diff (a1, a2,sizeof (struct in6_addr )); } -extern void ipv6_select_ident (struct frag_hdr *fhdr,struct rt6_info *rt); +extern void ipv6_select_ident (struct frag_hdr *fhdr,struct in6_addr *addr);/* * Prototypes exported by ipv6
kernel/posix-cpu-timers.c +3 -2
@@ -250,7 +250,7 @@ void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times) do { times->utime = cputime_add(times->utime, t->utime); times->stime = cputime_add(times->stime, t->stime); - times->sum_exec_runtime += t->se.sum_exec_runtime; + times->sum_exec_runtime += task_sched_runtime(t); } while_each_thread(tsk, t); out: rcu_read_unlock();
@@ -312,7 +312,8 @@ static int cpu_clock_sample_group(const clockid_t which_clock, cpu->cpu = cputime.utime;break ;case CPUCLOCK_SCHED : - cpu->sched =thread_group_sched_runtime (p); +thread_group_cputime (p, &cputime); + cpu->sched = cputime.sum_exec_runtime;break ; }return 0 ;
kernel/sched.c +1 -25
@@ -3713,30 +3713,6 @@ unsigned long long task_sched_runtime(struct task_struct *p) }/* -* Return sum_exec_runtime for the thread group. -* In case the task is currently running, return the sum plus current's -* pending runtime that have not been accounted yet. -* -* Note that the thread group might have other running tasks as well, -* so the return value not includes other pending runtime that other -* running tasks might have. -*/ -unsigned long long thread_group_sched_runtime (struct task_struct *p) -{ -struct task_cputime totals; -unsigned long flags; -struct rq *rq; -u64 ns; - - rq =task_rq_lock (p, &flags); -thread_group_cputime (p, &totals); - ns = totals.sum_exec_runtime +do_task_delta_exec (p, rq); -task_rq_unlock (rq, p, &flags); - -return ns; -} - -/* * Account user cpu time to a process. * @p: the process that the cpu time gets accounted to * @cputime: the cpu time spent in user space since the last update
@@ -4335,7 +4311,7 @@ static inline void sched_submit_work(struct task_struct *tsk)blk_schedule_flush_plug (tsk); } -asmlinkage void schedule(void) +asmlinkage void __sched schedule(void) {struct task_struct *tsk = current;
kernel/sched_rt.c +2 -2
@@ -1038,7 +1038,7 @@ select_task_rq_rt(struct task_struct *p, int sd_flag, int flags)*/ if (curr &&unlikely (rt_task (curr)) && (curr->rt.nr_cpus_allowed <2 || - curr->prio < p->prio) && + curr->prio <= p->prio) && (p->rt.nr_cpus_allowed >1 )) {int target =find_lowest_rq (p);
@@ -1569,7 +1569,7 @@ static void task_woken_rt(struct rq *rq, struct task_struct *p) p->rt.nr_cpus_allowed > 1 && rt_task(rq->curr) && (rq->curr->rt.nr_cpus_allowed < 2 || - rq->curr->prio < p->prio)) + rq->curr->prio <= p->prio))push_rt_tasks (rq); }
kernel/trace/ftrace.c +31 -11
83 lines not on this page · raw message
kernel/trace/trace_functions.c +2 -1
@@ -324,7 +324,8 @@ ftrace_trace_onoff_unreg(char *glob, char *cmd, char *param) }static int -ftrace_trace_onoff_callback (char *glob,char *cmd,char *param,int enable) +ftrace_trace_onoff_callback (struct ftrace_hash *hash, +char *glob,char *cmd,char *param,int enable) {struct ftrace_probe_ops *ops;void *count = (void *)-1 ;
net/ipv6/ip6_output.c +5 -5
@@ -620,9 +620,9 @@ static u32 __ipv6_select_ident(const struct in6_addr *addr)return hash + newid; } -void ipv6_select_ident (struct frag_hdr *fhdr,struct rt6_info *rt) +void ipv6_select_ident (struct frag_hdr *fhdr,struct in6_addr *addr) { - fhdr->identification =htonl (__ipv6_select_ident (&rt->rt6i_dst.addr)); + fhdr->identification =htonl (__ipv6_select_ident (addr)); }int ip6_fragment (struct sk_buff *skb,int (*output)(struct sk_buff *))
@@ -709,7 +709,7 @@ int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))skb_reset_network_header (skb);memcpy (skb_network_header (skb), tmp_hdr, hlen); -ipv6_select_ident (fh, rt); +ipv6_select_ident (fh, &rt->rt6i_dst.addr); fh->nexthdr = nexthdr; fh->reserved =0 ; fh->frag_off =htons (IP6_MF );
@@ -855,7 +855,7 @@ slow_path: fh->nexthdr = nexthdr; fh->reserved =0 ;if (!frag_id) { -ipv6_select_ident (fh, rt); +ipv6_select_ident (fh, &rt->rt6i_dst.addr); frag_id = fh->identification; }else fh->identification = frag_id;
@@ -1146,7 +1146,7 @@ static inline int ip6_ufo_append_data(struct sock *sk,skb_shinfo (skb)->gso_size = (mtu - fragheaderlen -sizeof (struct frag_hdr )) & ~7 ;skb_shinfo (skb)->gso_type =SKB_GSO_UDP ; -ipv6_select_ident (&fhdr, rt); +ipv6_select_ident (&fhdr, &rt->rt6i_dst.addr);skb_shinfo (skb)->ip6_frag_id = fhdr.identification;__skb_queue_tail (&sk->sk_write_queue, skb);
net/ipv6/udp.c +3 -1
@@ -1309,6 +1309,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, u32 features)u8 frag_hdr_sz =sizeof (struct frag_hdr );int offset;__wsum csum; +struct rt6_info *rt = (struct rt6_info *)skb_dst (skb); mss =skb_shinfo (skb)->gso_size;if (unlikely (skb->len <= mss))
@@ -1359,7 +1360,8 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, u32 features) fptr = (struct frag_hdr *)(skb_network_header (skb) + unfrag_ip6hlen); fptr->nexthdr = nexthdr; fptr->reserved =0 ; -ipv6_select_ident (fptr, (struct rt6_info *)skb_dst (skb)); +ipv6_select_ident (fptr, + rt ? &rt->rt6i_dst.addr : &ipv6_hdr (skb)->daddr);/* Fragment the skb. ipv6 header and the remaining fields of the * fragment header are updated in ipv6_gso_segment()
sound/soc/codecs/wm8753.c +2 -2
@@ -1454,8 +1454,8 @@ static int wm8753_probe(struct snd_soc_codec *codec)/* set the update bits */ snd_soc_update_bits (codec,WM8753_LDAC ,0x0100 ,0x0100 );snd_soc_update_bits (codec,WM8753_RDAC ,0x0100 ,0x0100 ); -snd_soc_update_bits (codec,WM8753_LDAC ,0x0100 ,0x0100 ); -snd_soc_update_bits (codec,WM8753_RDAC ,0x0100 ,0x0100 ); +snd_soc_update_bits (codec,WM8753_LADC ,0x0100 ,0x0100 ); +snd_soc_update_bits (codec,WM8753_RADC ,0x0100 ,0x0100 );snd_soc_update_bits (codec,WM8753_LOUT1V ,0x0100 ,0x0100 );snd_soc_update_bits (codec,WM8753_ROUT1V ,0x0100 ,0x0100 );snd_soc_update_bits (codec,WM8753_LOUT2V ,0x0100 ,0x0100 );
sound/soc/pxa/zylonite.c +4 -4
@@ -196,20 +196,20 @@ static int zylonite_probe(struct snd_soc_card *card)if (clk_pout) { pout =clk_get (NULL ,"CLK_POUT" );if (IS_ERR (pout)) { -dev_err (&pdev->dev,"Unable to obtain CLK_POUT: %ld\n" , +dev_err (card->dev,"Unable to obtain CLK_POUT: %ld\n" ,PTR_ERR (pout));return PTR_ERR (pout); } ret =clk_enable (pout);if (ret !=0 ) { -dev_err (&pdev->dev,"Unable to enable CLK_POUT: %d\n" , +dev_err (card->dev,"Unable to enable CLK_POUT: %d\n" , ret);clk_put (pout);return ret; } -dev_dbg (&pdev->dev,"MCLK enabled at %luHz\n" , +dev_dbg (card->dev,"MCLK enabled at %luHz\n" ,clk_get_rate (pout)); }
@@ -241,7 +241,7 @@ static int zylonite_resume_pre(struct snd_soc_card *card)if (clk_pout) { ret =clk_enable (pout);if (ret !=0 ) -dev_err (&pdev->dev,"Unable to enable CLK_POUT: %d\n" , +dev_err (card->dev,"Unable to enable CLK_POUT: %d\n" , ret); }
Hi,
is there a reason why the v3.0.7 tag is missing from the stable repository?
[/build/linux-stable]$ make kernelrelease
3.0.7+
[/build/linux-stable]$ make kernelversion
3.0.7
[/build/linux-stable]$ git describe
v3.0.6-33-g62bf792
regards,
Conny
##
##################################################################
# Email : [email protected] GnuPG-Key : 0xA6AB055D #
# Fingerprint: 17C4 5DB2 7C4C C1C7 1452 8148 F139 7C09 A6AB 055D #
##################################################################
# Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach #
# General Managers: Alberto Bozzo #
# Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen #
# HRB Nr. 43632 #
##################################################################
Quoted 6 lines · Conny Seidel
Hi,
is there a reason why the v3.0.7 tag is missing from the stable repository?
Quoted 6 lines
[/build/linux-stable]$ make kernelrelease
3.0.7+
[/build/linux-stable]$ make kernelversion
3.0.7
[/build/linux-stable]$ git describe
v3.0.6-33-g62bf792
Yes, it's not "officially" released yet, I'm still doing testing...
greg k-h
PATCH 1/38 PCI: Set PCI-E Max Payload Size on fabric
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jon Mason <[email protected]>
commit b03e7495a862b028294f59fc87286d6d78ee7fa1 upstream.
On a given PCI-E fabric, each device, bridge, and root port can have a different PCI-E maximum payload size. There is a sizable performance boost for having the largest possible maximum payload size on each PCI-E device. However, if improperly configured, fatal bus errors can occur. Thus, it is important to ensure that PCI-E payloads sends by a device are never larger than the MPS setting of all devices on the way to the destination.
This can be achieved two ways:
- A conservative approach is to use the smallest common denominator of the entire tree below a root complex for every device on that fabric.
This means for example that having a 128 bytes MPS USB controller on one leg of a switch will dramatically reduce performances of a video card or 10GE adapter on another leg of that same switch.
It also means that any hierarchy supporting hotplug slots (including expresscard or thunderbolt I suppose, dbl check that) will have to be entirely clamped to 128 bytes since we cannot predict what will be plugged into those slots, and we cannot change the MPS on a "live" system.
- A more optimal way is possible, if it falls within a couple of constraints:
* The top-level host bridge will never generate packets larger than the smallest TLP (or if it can be controlled independently from its MPS at least)
* The device will never generate packets larger than MPS (which can be configured via MRRS)
* No support of direct PCI-E <-> PCI-E transfers between devices without some additional code to specifically deal with that case
Then we can use an approach that basically ignores downstream requests and focuses exclusively on upstream requests. In that case, all we need to care about is that a device MPS is no larger than its parent MPS, which allows us to keep all switches/bridges to the max MPS supported by their parent and eventually the PHB.
In this case, your USB controller would no longer "starve" your 10GE Ethernet and your hotplug slots won't affect your global MPS. Additionally, the hotplugged devices themselves can be configured to a larger MPS up to the value configured in the hotplug bridge.
To choose between the two available options, two PCI kernel boot args have been added to the PCI calls. "pcie_bus_safe" will provide the former behavior, while "pcie_bus_perf" will perform the latter behavior. By default, the latter behavior is used.
NOTE: due to the location of the enablement, each arch will need to add calls to this function. This patch only enables x86.
This patch includes a number of changes recommended by Benjamin Herrenschmidt.
--- arch/x86/pci/acpi.c | 9 ++ drivers/pci/hotplug/pcihp_slot.c | 45 ------------ drivers/pci/pci.c | 67 ++++++++++++++++++ drivers/pci/probe.c | 145 +++++++++++++++++++++++++++++++++++++++ include/linux/pci.h | 15 +++- 5 files changed, 236 insertions(+), 45 deletions(-)
arch/x86/pci/acpi.c +9 -0
@@ -361,6 +361,15 @@ struct pci_bus * __devinit pci_acpi_scan } } +/* After the PCI-E bus has been walked and all devices discovered, +* configure any settings of the fabric that might be necessary. +*/ +if (bus) { +struct pci_bus *child; +list_for_each_entry (child, &bus->children, node) +pcie_bus_configure_settings (child, child->self->pcie_mpss); + } +if (!bus)kfree (sd);
drivers/pci/hotplug/pcihp_slot.c +1 -44
57 lines not on this page · raw message
drivers/pci/pci.c +67 -0
85 lines not on this page · raw message
drivers/pci/probe.c +145 -0
157 lines not on this page · raw message
include/linux/pci.h +14 -1
@@ -251,7 +251,8 @@ struct pci_dev {u8 revision;/* PCI revision, low byte of class word */ u8 hdr_type;/* PCI header type (`multi' flag masked out) */ u8 pcie_cap;/* PCI-E capability offset */ -u8 pcie_type;/* PCI-E device/port type */ + u8 pcie_type:4; /* PCI-E device/port type */ + u8 pcie_mpss:3; /* PCI-E Max Payload Size Supported */u8 rom_base_reg;/* which config register controls the ROM */ u8 pin;/* which interrupt pin this device uses */
@@ -617,6 +618,16 @@ struct pci_driver {/* these external functions are only available when PCI support is enabled */ #ifdef CONFIG_PCI +extern void pcie_bus_configure_settings (struct pci_bus *bus,u8 smpss); + +enum pcie_bus_config_types { +PCIE_BUS_PERFORMANCE , +PCIE_BUS_SAFE , +PCIE_BUS_PEER2PEER , +}; + +extern enum pcie_bus_config_types pcie_bus_config; +extern struct bus_type pci_bus_type;/* Do NOT directly access these two variables, unless you are arch specific pci
@@ -796,6 +807,8 @@ int pcix_get_mmrbc(struct pci_dev *dev);int pcix_set_mmrbc (struct pci_dev *dev,int mmrbc);int pcie_get_readrq (struct pci_dev *dev);int pcie_set_readrq (struct pci_dev *dev,int rq); +int pcie_get_mps (struct pci_dev *dev); +int pcie_set_mps (struct pci_dev *dev,int mps);int __pci_reset_function (struct pci_dev *dev);int pci_reset_function (struct pci_dev *dev);void pci_update_resource (struct pci_dev *dev,int resno);
Re: [01/38] PCI: Set PCI-E Max Payload Size on fabric
Hello Greg,
drivers/pci/pci.c unsigned long pci_cardbus_mem_size = DEF · line 81
Quoted 8 lines · Greg KH
drivers/pci/pci.c +2
-0@@ -77,6 +77,8 @@ unsigned long pci_cardbus_mem_size = DEFunsigned long pci_hotplug_io_size =DEFAULT_HOTPLUG_IO_SIZE ;unsigned long pci_hotplug_mem_size =DEFAULT_HOTPLUG_MEM_SIZE ; +enum pcie_bus_config_types pcie_bus_config =PCIE_BUS_PERFORMANCE ; +
This version of the patch incorrectly defaults to the new performance mode. Since we haven't even had that code in the 3.1 release yet, I don't think it is suitable for a stable release. This patch should be revised to a version with default set to safe/don't-touch mode if it is to be included.
-ben
Bjorn Helgaas
maintainerRe: [01/38] PCI: Set PCI-E Max Payload Size on fabric
Quoted 9 lines · Benjamin LaHaise
Hello Greg,
Quoted 6 lines · Greg KH
drivers/pci/pci.c +0
-0@@ -77,6 +77,8 @@ unsigned long pci_cardbus_mem_size = DEF unsigned long pci_hotplug_io_size = DEFAULT_HOTPLUG_IO_SIZE; unsigned long pci_hotplug_mem_size = DEFAULT_HOTPLUG_MEM_SIZE;
Quoted 8 lines
drivers/pci/pci.c unsigned long pci_cardbus_mem_size = DEF · line 81
Quoted 2 lines
drivers/pci/pci.c +2
-0+enum pcie_bus_config_types pcie_bus_config =PCIE_BUS_PERFORMANCE ; +This version of the patch incorrectly defaults to the new performance mode. Since we haven't even had that code in the 3.1 release yet, I don't think it is suitable for a stable release. This patch should be revised to a version with default set to safe/don't-touch mode if it is to be included.
It's not obvious that this fits the criteria for -stable (Documentation/stable_kernel_rules.txt).
For example, I can't tell what real problem this fixes.
Re: [01/38] PCI: Set PCI-E Max Payload Size on fabric
Quoted 10 lines · Bjorn Helgaas
Quoted 9 lines · Benjamin LaHaise
Hello Greg,
Quoted 6 lines · Greg KH
drivers/pci/pci.c +0
-0@@ -77,6 +77,8 @@ unsigned long pci_cardbus_mem_size = DEF unsigned long pci_hotplug_io_size = DEFAULT_HOTPLUG_IO_SIZE; unsigned long pci_hotplug_mem_size = DEFAULT_HOTPLUG_MEM_SIZE;
Quoted 8 lines
Quoted 8 lines
drivers/pci/pci.c unsigned long pci_cardbus_mem_size = DEF · line 81
Quoted 2 lines
drivers/pci/pci.c +2
-0+enum pcie_bus_config_types pcie_bus_config =PCIE_BUS_PERFORMANCE ; +This version of the patch incorrectly defaults to the new performance mode. Since we haven't even had that code in the 3.1 release yet, I don't think it is suitable for a stable release. This patch should be revised to a version with default set to safe/don't-touch mode if it is to be included.
Wait, I thought a patch farther in the series made it off by default, yes, see patch 6 in this series for that one.
Quoted 4 lines
It's not obvious that this fits the criteria for -stable (
Documentation/stable_kernel_rules.txt).For example, I can't tell what real problem this fixes.
Yeah, it's not obvious, but I have had a lot of reports that 3.0 does not work on some systems without this set of patches. Now figuring out of those same systems ever worked at all is getting to be quite difficult as I don't have access to the hardware, and the people that do aren't responding to test requests. But from what I gather, 2.6.32 did work on these boxes, so it is a regression somehow, but I am not positive of this.
Because of that, I've included these patches. They default to off now, but allow machines that were oopsing on bootup, to now work properly, which is resolving regressions, so that would seem to meet stable critera, right?
Now I'm very open to pushback, and if people really don't want these in (i.e. the PCI maintainer(s) say no), then I'll drop them and work with the distros to get them into their trees so that their customers's systems will work properly.
thanks,
greg k-h
Bjorn Helgaas
maintainerRe: [01/38] PCI: Set PCI-E Max Payload Size on fabric
Quoted 7 lines · Greg KH
Quoted 4 lines · Bjorn Helgaas
It's not obvious that this fits the criteria for -stable (
Documentation/stable_kernel_rules.txt).For example, I can't tell what real problem this fixes.
Quoted 7 lines
Yeah, it's not obvious, but I have had a lot of reports that 3.0 does not work on some systems without this set of patches. Now figuring out of those same systems ever worked at all is getting to be quite difficult as I don't have access to the hardware, and the people that do aren't responding to test requests. But from what I gather, 2.6.32 did work on these boxes, so it is a regression somehow, but I am not positive of this.
I'd like to know more about this regression.
Quoted 4 lines
Now I'm very open to pushback, and if people really don't want these in (i.e. the PCI maintainer(s) say no), then I'll drop them and work with the distros to get them into their trees so that their customers's systems will work properly.
If distros want these patches, does that mean they have bug reports? URLs to them would be helpful.
I just haven't seen any concrete information that says -stable will be better off if it includes these patches. We've tripped over enough problems upstream that I'm concerned they might make things worse rather than better.
Bjorn
Re: [01/38] PCI: Set PCI-E Max Payload Size on fabric
Quoted 16 lines · Bjorn Helgaas
Quoted 7 lines · Greg KH
Quoted 4 lines · Bjorn Helgaas
It's not obvious that this fits the criteria for -stable (
Documentation/stable_kernel_rules.txt).For example, I can't tell what real problem this fixes.
Quoted 7 lines
Yeah, it's not obvious, but I have had a lot of reports that 3.0 does not work on some systems without this set of patches. Now figuring out of those same systems ever worked at all is getting to be quite difficult as I don't have access to the hardware, and the people that do aren't responding to test requests. But from what I gather, 2.6.32 did work on these boxes, so it is a regression somehow, but I am not positive of this.
Quoted 1 line
I'd like to know more about this regression.
It shows up as an oops that prevents the machine from booting.
Quoted 7 lines
Quoted 4 lines
Now I'm very open to pushback, and if people really don't want these in (i.e. the PCI maintainer(s) say no), then I'll drop them and work with the distros to get them into their trees so that their customers's systems will work properly.
If distros want these patches, does that mean they have bug reports? URLs to them would be helpful.
All of the ones I have are "private" at the moment due to the hardware and product being tested by the users, sorry.
I really wish that some of the people who had this problem would post publically, and I guess we could just say, because they aren't being public about it, it shouldn't go into a stable tree. And I don't have a problem with that.
Quoted 4 lines
I just haven't seen any concrete information that says -stable will be better off if it includes these patches. We've tripped over enough problems upstream that I'm concerned they might make things worse rather than better.
Even though it is disabled by default?
thanks,
greg k-h
Re: [01/38] PCI: Set PCI-E Max Payload Size on fabric
Quoted 1 line · Greg KH
Quoted 1 line · Greg KH
...
Quoted 3 lines
Quoted 1 line
I'd like to know more about this regression.
It shows up as an oops that prevents the machine from booting.
If it's a regression, the patch should be limited to fixing the bug. As it stands, this patch series introduces new functionality, and because it goes through a known broken state with the first patch, it may cause failures for people if they land in the middle during a bisect. This doesn't seem like the right approach for -stable.
-ben
Re: [01/38] PCI: Set PCI-E Max Payload Size on fabric
Quoted 5 lines · Benjamin LaHaise
Quoted 1 line · Greg KH
Quoted 1 line · Greg KH
...
Quoted 2 lines
Quoted 1 line
I'd like to know more about this regression.
Quoted 7 lines
Quoted 1 line
It shows up as an oops that prevents the machine from booting.
If it's a regression, the patch should be limited to fixing the bug. As it stands, this patch series introduces new functionality, and because it goes through a known broken state with the first patch, it may cause failures for people if they land in the middle during a bisect. This doesn't seem like the right approach for -stable.
Bisection here follows the same problems that happened in Linus's tree, so that's not a big deal, it happens a lot in stable patches.
greg k-h
Bjorn Helgaas
maintainerRe: [01/38] PCI: Set PCI-E Max Payload Size on fabric
In reply to Greg KHQuoted 29 lines · Greg KH
Quoted 16 lines · Bjorn Helgaas
Quoted 7 lines · Greg KH
Quoted 4 lines · Bjorn Helgaas
It's not obvious that this fits the criteria for -stable (
Documentation/stable_kernel_rules.txt).For example, I can't tell what real problem this fixes.
Quoted 7 lines
Yeah, it's not obvious, but I have had a lot of reports that 3.0 does not work on some systems without this set of patches. Now figuring out of those same systems ever worked at all is getting to be quite difficult as I don't have access to the hardware, and the people that do aren't responding to test requests. But from what I gather, 2.6.32 did work on these boxes, so it is a regression somehow, but I am not positive of this.
Quoted 1 line
I'd like to know more about this regression.
It shows up as an oops that prevents the machine from booting.
Quoted 7 lines
Quoted 4 lines
Now I'm very open to pushback, and if people really don't want these in (i.e. the PCI maintainer(s) say no), then I'll drop them and work with the distros to get them into their trees so that their customers's systems will work properly.
If distros want these patches, does that mean they have bug reports? URLs to them would be helpful.
Quoted 7 lines
All of the ones I have are "private" at the moment due to the hardware and product being tested by the users, sorry.
I really wish that some of the people who had this problem would post publically, and I guess we could just say, because they aren't being public about it, it shouldn't go into a stable tree. And I don't have a problem with that.
I think accepting patches without our having a chance to see the problem sets a bad precedent. It's quite common to see patches that "solve" the problem, but do it in the wrong way.
If the hardware is secret, maybe they could open a new, sanitized bug report? It should be easy to remove the valuable details from the dmesg log and oops.
Bjorn
Re: [01/38] PCI: Set PCI-E Max Payload Size on fabric
Quoted 38 lines · Bjorn Helgaas
Quoted 29 lines · Greg KH
Quoted 16 lines · Bjorn Helgaas
Quoted 7 lines · Greg KH
Quoted 4 lines · Bjorn Helgaas
It's not obvious that this fits the criteria for -stable (
Documentation/stable_kernel_rules.txt).For example, I can't tell what real problem this fixes.
Quoted 7 lines
Yeah, it's not obvious, but I have had a lot of reports that 3.0 does not work on some systems without this set of patches. Now figuring out of those same systems ever worked at all is getting to be quite difficult as I don't have access to the hardware, and the people that do aren't responding to test requests. But from what I gather, 2.6.32 did work on these boxes, so it is a regression somehow, but I am not positive of this.
Quoted 1 line
I'd like to know more about this regression.
It shows up as an oops that prevents the machine from booting.
Quoted 7 lines
Quoted 4 lines
Now I'm very open to pushback, and if people really don't want these in (i.e. the PCI maintainer(s) say no), then I'll drop them and work with the distros to get them into their trees so that their customers's systems will work properly.
If distros want these patches, does that mean they have bug reports? URLs to them would be helpful.
Quoted 7 lines
All of the ones I have are "private" at the moment due to the hardware and product being tested by the users, sorry.
I really wish that some of the people who had this problem would post publically, and I guess we could just say, because they aren't being public about it, it shouldn't go into a stable tree. And I don't have a problem with that.
Quoted 7 lines
I think accepting patches without our having a chance to see the problem sets a bad precedent. It's quite common to see patches that "solve" the problem, but do it in the wrong way.
If the hardware is secret, maybe they could open a new, sanitized bug report? It should be easy to remove the valuable details from the dmesg log and oops.
I'll go ask again for them to do this, and I'll drop these patches from the release.
thanks,
greg k-h
PATCH 2/38 PCI: export pcie_bus_configure_settings symbol
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jon Mason <[email protected]>
commit debc3b778508f59696ff188f0feca271dcbfa7d9 upstream.
pcie_bus_configure_settings needs to be exported if the PCI hotplug driver is being compiled as a module.
--- drivers/pci/probe.c | 1 + 1 file changed, 1 insertion(+)
drivers/pci/probe.c +1 -0
@@ -1471,6 +1471,7 @@ void pcie_bus_configure_settings(structpcie_bus_configure_set (bus->self, &smpss);pci_walk_bus (bus, pcie_bus_configure_set, &smpss); } +EXPORT_SYMBOL_GPL (pcie_bus_configure_settings);unsigned int __devinit pci_scan_child_bus (struct pci_bus *bus) {
PATCH 3/38 PCI: Remove MRRS modification from MPS setting code
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jon Mason <[email protected]>
commit ed2888e906b56769b4ffabb9c577190438aa68b8 upstream.
Modifying the Maximum Read Request Size to 0 (value of 128Bytes) has massive negative ramifications on some devices. Without knowing which devices have this issue, do not modify from the default value when walking the PCI-E bus in pcie_bus_safe mode. Also, make pcie_bus_safe the default procedure.
References: https://bugzilla.kernel.org/show_bug.cgi?id=42162
--- drivers/pci/pci.c | 2 +- drivers/pci/probe.c | 45 ++++++++++++++++++++++++--------------------- 2 files changed, 25 insertions(+), 22 deletions(-)
drivers/pci/pci.c +1 -1
@@ -77,7 +77,7 @@ unsigned long pci_cardbus_mem_size = DEFunsigned long pci_hotplug_io_size =DEFAULT_HOTPLUG_IO_SIZE ;unsigned long pci_hotplug_mem_size =DEFAULT_HOTPLUG_MEM_SIZE ; -enum pcie_bus_config_types pcie_bus_config =PCIE_BUS_PERFORMANCE ; +enum pcie_bus_config_types pcie_bus_config =PCIE_BUS_SAFE ;/* * The default CLS is used if arch didn't set CLS explicitly and not
drivers/pci/probe.c +24 -21
71 lines not on this page · raw message
PATCH 4/38 pci: Dont crash when reading mpss from root complex
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Benjamin Herrenschmidt <[email protected]>
commit 1a4b1a41b8a3d5256019854e851beed063b34344 upstream.
In pcie_find_smpss(), we have the following statement:
if (dev->is_hotplug_bridge && (!list_is_singular(&dev->bus->devices) ||
dev->bus->self->pcie_type != PCI_EXP_TYPE_ROOT_PORT))
The problem is that at least on my machine, this gets called for the root complex (virtual P2P bridge), and dev->bus->self is NULL since the parent bus for this is not itself anchor to a PCI device.
This adds the necessary NULL check.
--- drivers/pci/probe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pci/probe.c +2 -1
@@ -1352,7 +1352,8 @@ static int pcie_find_smpss(struct pci_de* will occur as normal. */ if (dev->is_hotplug_bridge && (!list_is_singular (&dev->bus->devices) || - dev->bus->self->pcie_type !=PCI_EXP_TYPE_ROOT_PORT )) + (dev->bus->self && + dev->bus->self->pcie_type !=PCI_EXP_TYPE_ROOT_PORT ))) *smpss =0 ;if (*smpss > dev->pcie_mpss)
PATCH 5/38 Fix pointer dereference before call to pcie_bus_configure_settings
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Shyam Iyer <[email protected]>
commit 5307f6d5fb12fd01f9f321bc4a8fd77e74858647 upstream.
Commit b03e7495a862 ("PCI: Set PCI-E Max Payload Size on fabric") introduced a potential NULL pointer dereference in calls to pcie_bus_configure_settings due to attempts to access pci_bus self variables when the self pointer is NULL.
To correct this, verify that the self pointer in pci_bus is non-NULL before dereferencing it.
--- arch/x86/pci/acpi.c | 9 +++++++-- drivers/pci/hotplug/pcihp_slot.c | 4 +++- drivers/pci/probe.c | 3 --- 3 files changed, 10 insertions(+), 6 deletions(-)
arch/x86/pci/acpi.c +7 -2
@@ -366,8 +366,13 @@ struct pci_bus * __devinit pci_acpi_scan*/ if (bus) {struct pci_bus *child; -list_for_each_entry (child, &bus->children, node) -pcie_bus_configure_settings (child, child->self->pcie_mpss); +list_for_each_entry (child, &bus->children, node) { +struct pci_dev *self = child->self; +if (!self) +continue ; + +pcie_bus_configure_settings (child, self->pcie_mpss); + } }if (!bus)
drivers/pci/hotplug/pcihp_slot.c +3 -1
@@ -169,7 +169,9 @@ void pci_configure_slot(struct pci_dev * (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI)))return ; -pcie_bus_configure_settings (dev->bus, dev->bus->self->pcie_mpss); +if (dev->bus && dev->bus->self) +pcie_bus_configure_settings (dev->bus, + dev->bus->self->pcie_mpss);memset (&hpp,0 ,sizeof (hpp)); ret =pci_get_hp_params (dev, &hpp);
drivers/pci/probe.c +0 -3
@@ -1461,9 +1461,6 @@ void pcie_bus_configure_settings(struct {u8 smpss = mpss; -if (!bus->self) -return ; -if (!pci_is_pcie (bus->self))return ;
PATCH 6/38 PCI: Disable MPS configuration by default
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jon Mason <[email protected]>
commit 5f39e6705faade2e89d119958a8c51b9b6e2c53c upstream.
Add the ability to disable PCI-E MPS turning and using the BIOS configured MPS defaults. Due to the number of issues recently discovered on some x86 chipsets, make this the default behavior.
Also, add the option for peer to peer DMA MPS configuration. Peer to peer DMA is outside the scope of this patch, but MPS configuration could prevent it from working by having the MPS on one root port different than the MPS on another. To work around this, simply make the system wide MPS the smallest possible value (128B).
--- drivers/pci/pci.c | 6 +++++- drivers/pci/probe.c | 14 +++++++++++++- include/linux/pci.h | 3 ++- 3 files changed, 20 insertions(+), 3 deletions(-)
drivers/pci/pci.c +5 -1
@@ -77,7 +77,7 @@ unsigned long pci_cardbus_mem_size = DEFunsigned long pci_hotplug_io_size =DEFAULT_HOTPLUG_IO_SIZE ;unsigned long pci_hotplug_mem_size =DEFAULT_HOTPLUG_MEM_SIZE ; -enum pcie_bus_config_types pcie_bus_config =PCIE_BUS_SAFE ; +enum pcie_bus_config_types pcie_bus_config =PCIE_BUS_TUNE_OFF ;/* * The default CLS is used if arch didn't set CLS explicitly and not
@@ -3568,10 +3568,14 @@ static int __init pci_setup(char *str) pci_hotplug_io_size =memparse (str +9 , &str); }else if (!strncmp (str,"hpmemsize=" ,10 )) { pci_hotplug_mem_size =memparse (str +10 , &str); + }else if (!strncmp (str,"pcie_bus_tune_off" ,17 )) { + pcie_bus_config =PCIE_BUS_TUNE_OFF ; }else if (!strncmp (str,"pcie_bus_safe" ,13 )) { pcie_bus_config =PCIE_BUS_SAFE ; }else if (!strncmp (str,"pcie_bus_perf" ,13 )) { pcie_bus_config =PCIE_BUS_PERFORMANCE ; + }else if (!strncmp (str,"pcie_bus_peer2peer" ,18 )) { + pcie_bus_config =PCIE_BUS_PEER2PEER ; }else {printk (KERN_ERR "PCI: Unknown option `%s'\n" , str);
drivers/pci/probe.c +13 -1
@@ -1459,12 +1459,24 @@ static int pcie_bus_configure_set(struct*/ void pcie_bus_configure_settings (struct pci_bus *bus,u8 mpss) { -u8 smpss = mpss; +u8 smpss;if (!pci_is_pcie (bus->self))return ; +if (pcie_bus_config ==PCIE_BUS_TUNE_OFF ) +return ; + +/* FIXME - Peer to peer DMA is possible, though the endpoint would need +* to be aware to the MPS of the destination. To work around this, +* simply force the MPS of the entire system to the smallest possible. +*/ +if (pcie_bus_config ==PCIE_BUS_PEER2PEER ) + smpss =0 ; +if (pcie_bus_config ==PCIE_BUS_SAFE ) { + smpss = mpss; +pcie_find_smpss (bus->self, &smpss);pci_walk_bus (bus, pcie_find_smpss, &smpss); }
include/linux/pci.h +2 -1
@@ -621,8 +621,9 @@ struct pci_driver {extern void pcie_bus_configure_settings (struct pci_bus *bus,u8 smpss);enum pcie_bus_config_types { -PCIE_BUS_PERFORMANCE , +PCIE_BUS_TUNE_OFF ,PCIE_BUS_SAFE , +PCIE_BUS_PERFORMANCE ,PCIE_BUS_PEER2PEER , };
PATCH 7/38 sparc64: Force the execute bit in OpenFirmwares translation entries.
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: "David S. Miller" <[email protected]>
In the OF 'translations' property, the template TTEs in the mappings never specify the executable bit. This is the case even though some of these mappings are for OF's code segment.
Therefore, we need to force the execute bit on in every mapping.
This problem can only really trigger on Niagara/sun4v machines and the history behind this is a little complicated.
Previous to sun4v, the sun4u TTE entries lacked a hardware execute permission bit. So OF didn't have to ever worry about setting anything to handle executable pages. Any valid TTE loaded into the I-TLB would be respected by the chip.
But sun4v Niagara chips have a real hardware enforced executable bit in their TTEs. So it has to be set or else the I-TLB throws an instruction access exception with type code 6 (protection violation).
We've been extremely fortunate to not get bitten by this in the past.
The best I can tell is that the OF's mappings for it's executable code were mapped using permanent locked mappings on sun4v in the past. Therefore, the fact that we didn't have the exec bit set in the OF translations we would use did not matter in practice.
Thanks to Greg Onufer for helping me track this down.
--- arch/sparc/mm/init_64.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/sparc/mm/init_64.c +5 -0
@@ -511,6 +511,11 @@ static void __init read_obp_translationsfor (i =0 ; i < prom_trans_ents; i++) prom_trans[i].data &= ~0x0003fe0000000000UL ; } + +/* Force execute bit on. */ +for (i =0 ; i < prom_trans_ents; i++) + prom_trans[i].data |= (tlb_type == hypervisor ? + _PAGE_EXEC_4V : _PAGE_EXEC_4U); } static void __init hypervisor_tlb_lock(unsigned long vaddr,
PATCH 8/38 sched/rt: Migrate equal priority tasks to available CPUs
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Shawn Bohrer <[email protected]>
commit 3be209a8e22cedafc1b6945608b7bb8d9887ab61 upstream.
Commit 43fa5460fe60dea5c610490a1d263415419c60f6 ("sched: Try not to migrate higher priority RT tasks") also introduced a change in behavior which keeps RT tasks on the same CPU if there is an equal priority RT task currently running even if there are empty CPUs available.
This can cause unnecessary wakeup latencies, and can prevent the scheduler from balancing all RT tasks across available CPUs.
This change causes an RT task to search for a new CPU if an equal priority RT task is already running on wakeup. Lower priority tasks will still have to wait on higher priority tasks, but the system should still balance out because there is always the possibility that if there are both a high and low priority RT tasks on a given CPU that the high priority task could wakeup while the low priority task is running and force it to search for a better runqueue.
--- kernel/sched_rt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/sched_rt.c +2 -2
@@ -1038,7 +1038,7 @@ select_task_rq_rt(struct task_struct *p,*/ if (curr &&unlikely (rt_task (curr)) && (curr->rt.nr_cpus_allowed <2 || - curr->prio < p->prio) && + curr->prio <= p->prio) && (p->rt.nr_cpus_allowed >1 )) {int target =find_lowest_rq (p);
@@ -1569,7 +1569,7 @@ static void task_woken_rt(struct rq *rq, p->rt.nr_cpus_allowed > 1 && rt_task(rq->curr) && (rq->curr->rt.nr_cpus_allowed < 2 || - rq->curr->prio < p->prio)) + rq->curr->prio <= p->prio))push_rt_tasks (rq); }
PATCH 9/38 sched: Fix up wchan borkage
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Simon Kirby <[email protected]>
commit 6ebbe7a07b3bc40b168d2afc569a6543c020d2e3 upstream.
Commit c259e01a1ec ("sched: Separate the scheduler entry for preemption") contained a boo-boo wrecking wchan output. It forgot to put the new schedule() function in the __sched section and thereby doesn't get properly ignored for things like wchan.
--- kernel/sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched.c +1 -1
@@ -4335,7 +4335,7 @@ static inline void sched_submit_work(strblk_schedule_flush_plug (tsk); } -asmlinkage void schedule(void) +asmlinkage void __sched schedule(void) {struct task_struct *tsk = current;
PATCH 10/38 ide-disk: Fix request requeuing
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Borislav Petkov <[email protected]>
commit 2c8fc867602e385fd2abe76da0b6bda8ed907547 upstream.
Simon Kirby reported that on his RAID setup with idedisk underneath the box OOMs after a couple of days of runtime. Running with CONFIG_DEBUG_KMEMLEAK pointed to idedisk_prep_fn() which unconditionally allocates an ide_cmd struct. However, ide_requeue_and_plug() can be called more than once per request, either from the request issue or the IRQ handler path and do blk_peek_request() ends up in idedisk_prep_fn() repeatedly, allocating a struct ide_cmd everytime and "forgetting" the previous pointer.
Make sure the code reuses the old allocated chunk.
--- drivers/ide/ide-disk.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/ide/ide-disk.c +6 -1
@@ -435,7 +435,12 @@ static int idedisk_prep_fn(struct requesif (!(rq->cmd_flags &REQ_FLUSH ))return BLKPREP_OK ; - cmd =kzalloc (sizeof (*cmd),GFP_ATOMIC ); +if (rq->special) { + cmd = rq->special; +memset (cmd,0 ,sizeof (*cmd)); + }else { + cmd =kzalloc (sizeof (*cmd),GFP_ATOMIC ); + }/* FIXME: map struct ide_taskfile on rq->cmd[] */ BUG_ON (cmd ==NULL );
PATCH 11/38 posix-cpu-timers: Cure SMP wobbles
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Peter Zijlstra <[email protected]>
commit d670ec13178d0fd8680e6742a2bc6e04f28f87d8 upstream.
David reported:
Attached below is a watered-down version of rt/tst-cpuclock2.c from GLIBC. Just build it with "gcc -o test test.c -lpthread -lrt" or similar.
Run it several times, and you will see cases where the main thread will measure a process clock difference before and after the nanosleep which is smaller than the cpu-burner thread's individual thread clock difference. This doesn't make any sense since the cpu-burner thread is part of the top-level process's thread group.
I've reproduced this on both x86-64 and sparc64 (using both 32-bit and 64-bit binaries).
For example:
[davem@boricha build-x86_64-linux]$ ./test
process: before(0.001221967) after(0.498624371) diff(497402404)
thread: before(0.000081692) after(0.498316431) diff(498234739)
self: before(0.001223521) after(0.001240219) diff(16698)
[davem@boricha build-x86_64-linux]$
The diff of 'process' should always be >= the diff of 'thread'.
I make sure to wrap the 'thread' clock measurements the most tightly around the nanosleep() call, and that the 'process' clock measurements are the outer-most ones.
--- #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <fcntl.h> #include <string.h> #include <errno.h> #include <pthread.h>
static pthread_barrier_t barrier;
static void *chew_cpu(void *arg)
{
pthread_barrier_wait(&barrier);
while (1)
__asm__ __volatile__("" : : : "memory");
return NULL;}
int main(void)
{
clockid_t process_clock, my_thread_clock, th_clock;
struct timespec process_before, process_after;
struct timespec me_before, me_after;
struct timespec th_before, th_after;
struct timespec sleeptime;
unsigned long diff;
pthread_t th;
int err;
err = clock_getcpuclockid(0, &process_clock);
if (err)
return 1;
err = pthread_getcpuclockid(pthread_self(), &my_thread_clock);
if (err)
return 1;
pthread_barrier_init(&barrier, NULL, 2);
err = pthread_create(&th, NULL, chew_cpu, NULL);
if (err)
return 1;
err = pthread_getcpuclockid(th, &th_clock);
if (err)
return 1;
pthread_barrier_wait(&barrier);
err = clock_gettime(process_clock, &process_before);
if (err)
return 1;
err = clock_gettime(my_thread_clock, &me_before);
if (err)
return 1;
err = clock_gettime(th_clock, &th_before);
if (err)
return 1;
sleeptime.tv_sec = 0;
sleeptime.tv_nsec = 500000000;
nanosleep(&sleeptime, NULL);
err = clock_gettime(th_clock, &th_after);
if (err)
return 1;
err = clock_gettime(my_thread_clock, &me_after);
if (err)
return 1;
err = clock_gettime(process_clock, &process_after);
if (err)
return 1;
diff = process_after.tv_nsec - process_before.tv_nsec;
printf("process: before(%lu.%.9lu) after(%lu.%.9lu) diff(%lu)\n",
process_before.tv_sec, process_before.tv_nsec,
process_after.tv_sec, process_after.tv_nsec, diff);
diff = th_after.tv_nsec - th_before.tv_nsec;
printf("thread: before(%lu.%.9lu) after(%lu.%.9lu) diff(%lu)\n",
th_before.tv_sec, th_before.tv_nsec,
th_after.tv_sec, th_after.tv_nsec, diff);
diff = me_after.tv_nsec - me_before.tv_nsec;
printf("self: before(%lu.%.9lu) after(%lu.%.9lu) diff(%lu)\n",
me_before.tv_sec, me_before.tv_nsec,
me_after.tv_sec, me_after.tv_nsec, diff);
return 0;}
This is due to us using p->se.sum_exec_runtime in thread_group_cputime() where we iterate the thread group and sum all data. This does not take time since the last schedule operation (tick or otherwise) into account. We can cure this by using task_sched_runtime() at the cost of having to take locks.
This also means we can (and must) do away with thread_group_sched_runtime() since the modified thread_group_cputime() is now more accurate and would deadlock when called from thread_group_sched_runtime().
Aside of that it makes the function safe on 32 bit systems. The old code added t->se.sum_exec_runtime unprotected. sum_exec_runtime is a 64bit value and could be changed on another cpu at the same time.
--- include/linux/sched.h | 1 - kernel/posix-cpu-timers.c | 5 +++-- kernel/sched.c | 24 ------------------------ 3 files changed, 3 insertions(+), 27 deletions(-)
include/linux/sched.h +0 -1
@@ -1937,7 +1937,6 @@ static inline void disable_sched_clock_iextern unsigned long long task_sched_runtime (struct task_struct *task); -extern unsigned long long thread_group_sched_runtime (struct task_struct *task);/* sched_exec is called by processes performing an exec */ #ifdef CONFIG_SMP
kernel/posix-cpu-timers.c +3 -2
@@ -250,7 +250,7 @@ void thread_group_cputime(struct task_st do { times->utime = cputime_add(times->utime, t->utime); times->stime = cputime_add(times->stime, t->stime); - times->sum_exec_runtime += t->se.sum_exec_runtime; + times->sum_exec_runtime += task_sched_runtime(t); } while_each_thread(tsk, t); out: rcu_read_unlock();
@@ -312,7 +312,8 @@ static int cpu_clock_sample_group(const cpu->cpu = cputime.utime;break ;case CPUCLOCK_SCHED : - cpu->sched =thread_group_sched_runtime (p); +thread_group_cputime (p, &cputime); + cpu->sched = cputime.sum_exec_runtime;break ; }return 0 ;
kernel/sched.c +0 -24
@@ -3713,30 +3713,6 @@ unsigned long long task_sched_runtime(st }/* -* Return sum_exec_runtime for the thread group. -* In case the task is currently running, return the sum plus current's -* pending runtime that have not been accounted yet. -* -* Note that the thread group might have other running tasks as well, -* so the return value not includes other pending runtime that other -* running tasks might have. -*/ -unsigned long long thread_group_sched_runtime (struct task_struct *p) -{ -struct task_cputime totals; -unsigned long flags; -struct rq *rq; -u64 ns; - - rq =task_rq_lock (p, &flags); -thread_group_cputime (p, &totals); - ns = totals.sum_exec_runtime +do_task_delta_exec (p, rq); -task_rq_unlock (rq, p, &flags); - -return ns; -} - -/* * Account user cpu time to a process. * @p: the process that the cpu time gets accounted to * @cputime: the cpu time spent in user space since the last update
PATCH 12/38 lis3: fix regression of HP DriveGuard with 8bit chip
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Takashi Iwai <[email protected]>
commit 05faadcf59507e8eea57ffbeea9cbb14c9a2ab3d upstream.
Commit 2a7fade7e03 ("hwmon: lis3: Power on corrections") caused a regression on HP laptops with 8bit chip. Writing CTRL2_BOOT_8B bit seems clearing the BIOS setup, and no proper interrupt for DriveGuard will be triggered any more.
Since the init code there is basically only for embedded devices, put a pdata check so that the problematic initialization will be skipped for hp_accel stuff.
--- drivers/misc/lis3lv02d/lis3lv02d.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/misc/lis3lv02d/lis3lv02d.c +8 -6
@@ -375,12 +375,14 @@ void lis3lv02d_poweron(struct lis3lv02d* both have been read. So the value read will always be correct. * Set BOOT bit to refresh factory tuning values. */ - lis3->read (lis3,CTRL_REG2 , ®); -if (lis3->whoami ==WAI_12B ) - reg |=CTRL2_BDU |CTRL2_BOOT ; -else - reg |=CTRL2_BOOT_8B ; - lis3->write (lis3,CTRL_REG2 , reg); +if (lis3->pdata) { + lis3->read (lis3,CTRL_REG2 , ®); +if (lis3->whoami ==WAI_12B ) + reg |=CTRL2_BDU |CTRL2_BOOT ; +else + reg |=CTRL2_BOOT_8B ; + lis3->write (lis3,CTRL_REG2 , reg); + }/* LIS3 power on delay is quite long */ msleep (lis3->pwron_delay /lis3lv02d_get_odr ());
PATCH 13/38 ASoC: use a valid device for dev_err() in Zylonite
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Arnd Bergmann <[email protected]>
commit eff919ac0fc7565e71ffa35657c333dd8cdc0520 upstream.
A recent conversion has introduced references to &pdev->dev, which does not actually exist in all the contexts it's used in.
Replace this with card->dev where necessary, in order to let the driver build again.
--- sound/soc/pxa/zylonite.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/soc/pxa/zylonite.c +4 -4
@@ -196,20 +196,20 @@ static int zylonite_probe(struct snd_socif (clk_pout) { pout =clk_get (NULL ,"CLK_POUT" );if (IS_ERR (pout)) { -dev_err (&pdev->dev,"Unable to obtain CLK_POUT: %ld\n" , +dev_err (card->dev,"Unable to obtain CLK_POUT: %ld\n" ,PTR_ERR (pout));return PTR_ERR (pout); } ret =clk_enable (pout);if (ret !=0 ) { -dev_err (&pdev->dev,"Unable to enable CLK_POUT: %d\n" , +dev_err (card->dev,"Unable to enable CLK_POUT: %d\n" , ret);clk_put (pout);return ret; } -dev_dbg (&pdev->dev,"MCLK enabled at %luHz\n" , +dev_dbg (card->dev,"MCLK enabled at %luHz\n" ,clk_get_rate (pout)); }
@@ -241,7 +241,7 @@ static int zylonite_resume_pre(struct snif (clk_pout) { ret =clk_enable (pout);if (ret !=0 ) -dev_err (&pdev->dev,"Unable to enable CLK_POUT: %d\n" , +dev_err (card->dev,"Unable to enable CLK_POUT: %d\n" , ret); }
PATCH 14/38 ASoC: Fix setting update bits for WM8753_LADC and WM8753_RADC
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Axel Lin <[email protected]>
commit 21d17dd2a377ba894f26989915eb3c6e427a3656 upstream.
Current code set update bits for WM8753_LDAC and WM8753_RDAC twice, but missed setting update bits for WM8753_LADC and WM8753_RADC.
I think it is a copy-paste bug in commit 776065 "ASoC: codecs: wm8753: Fix register cache incoherency".
--- sound/soc/codecs/wm8753.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/wm8753.c +2 -2
@@ -1454,8 +1454,8 @@ static int wm8753_probe(struct snd_soc_c/* set the update bits */ snd_soc_update_bits (codec,WM8753_LDAC ,0x0100 ,0x0100 );snd_soc_update_bits (codec,WM8753_RDAC ,0x0100 ,0x0100 ); -snd_soc_update_bits (codec,WM8753_LDAC ,0x0100 ,0x0100 ); -snd_soc_update_bits (codec,WM8753_RDAC ,0x0100 ,0x0100 ); +snd_soc_update_bits (codec,WM8753_LADC ,0x0100 ,0x0100 ); +snd_soc_update_bits (codec,WM8753_RADC ,0x0100 ,0x0100 );snd_soc_update_bits (codec,WM8753_LOUT1V ,0x0100 ,0x0100 );snd_soc_update_bits (codec,WM8753_ROUT1V ,0x0100 ,0x0100 );snd_soc_update_bits (codec,WM8753_LOUT2V ,0x0100 ,0x0100 );
PATCH 15/38 drm/radeon: Update AVIVO cursor coordinate origin before x/yorigin calculation.
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <[email protected]>
commit b8aee294d89502469f2d80ae6afb93398d8227e0 upstream.
Fixes cursor disappearing prematurely when moving off a top/left edge which is not located at the desktop top/left edge.
--- drivers/gpu/drm/radeon/radeon_cursor.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/gpu/drm/radeon/radeon_cursor.c +7 -5
@@ -208,6 +208,13 @@ int radeon_crtc_cursor_move(struct drm_cint xorigin =0 , yorigin =0 ;int w = radeon_crtc->cursor_width; +if (ASIC_IS_AVIVO (rdev)) { +/* avivo cursor are offset into the total surface */ + x += crtc->x; + y += crtc->y; + } +DRM_DEBUG ("x %d y %d c->x %d c->y %d\n" , x, y, crtc->x, crtc->y); +if (x <0 ) xorigin = -x +1 ;if (y <0 )
@@ -221,11 +228,6 @@ int radeon_crtc_cursor_move(struct drm_cint i =0 ;struct drm_crtc *crtc_p; -/* avivo cursor are offset into the total surface */ - x += crtc->x; - y += crtc->y; -DRM_DEBUG ("x %d y %d c->x %d c->y %d\n" , x, y, crtc->x, crtc->y); -/* avivo cursor image can't end on 128 pixel boundary or * go past the end of the frame if both crtcs are enabled */
PATCH 16/38 drm/radeon/kms: Fix logic error in DP HPD handler
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit 5ba7ddf81634bfdf32d09261d2959e3f5b7c4263 upstream.
Only disable the pipe if the monitor is physically disconnected. The previous logic also disabled the pipe if the link was trained.
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=41248
--- drivers/gpu/drm/radeon/radeon_connectors.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/radeon/radeon_connectors.c +4 -4
@@ -68,11 +68,11 @@ void radeon_connector_hotplug(struct drmif (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) {int saved_dpms = connector->dpms; -if (radeon_hpd_sense (rdev, radeon_connector->hpd.hpd) && -radeon_dp_needs_link_train (radeon_connector)) -drm_helper_connector_dpms (connector,DRM_MODE_DPMS_ON ); -else +/* Only turn off the display it it's physically disconnected */ +if (!radeon_hpd_sense (rdev, radeon_connector->hpd.hpd))drm_helper_connector_dpms (connector,DRM_MODE_DPMS_OFF ); +else if (radeon_dp_needs_link_train (radeon_connector)) +drm_helper_connector_dpms (connector,DRM_MODE_DPMS_ON ); connector->dpms = saved_dpms; } }
PATCH 17/38 drm/radeon/kms: fix regression in DP aux defer handling
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit 109bc10d30f33e84f1d7289f0039e0c858ade82f upstream.
An incorrect ordering in the error checking code lead to DP aux defer being skipped in the aux native write path. Move the bytes transferred check (ret == 0) below the defer check.
Tracked down by: Brad Campbell <[email protected]>
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=41121
--- drivers/gpu/drm/radeon/atombios_dp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/atombios_dp.c +2 -2
@@ -158,14 +158,14 @@ static int radeon_dp_aux_native_read(strwhile (1 ) { ret =radeon_process_aux_ch (dig_connector->dp_i2c_bus, msg, msg_bytes, recv, recv_bytes, delay, &ack); -if (ret ==0 ) -return -EPROTO ;if (ret <0 )return ret;if ((ack &AUX_NATIVE_REPLY_MASK ) ==AUX_NATIVE_REPLY_ACK )return ret;else if ((ack &AUX_NATIVE_REPLY_MASK ) ==AUX_NATIVE_REPLY_DEFER )udelay (400 ); +else if (ret ==0 ) +return -EPROTO ;else return -EIO ; }
PATCH 18/38 drm/radeon/kms: add retry limits for native DP aux defer
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit 6375bda073724ead7df08746866b724b1799a295 upstream.
The previous code could potentially loop forever. Limit the number of DP aux defer retries to 4 for native aux transactions, same as i2c over aux transactions.
Noticed by: Brad Campbell <[email protected]>
--- drivers/gpu/drm/radeon/atombios_dp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/gpu/drm/radeon/atombios_dp.c +8 -4
@@ -115,6 +115,7 @@ static int radeon_dp_aux_native_write(stu8 msg[20 ];int msg_bytes = send_bytes +4 ;u8 ack; +unsigned retry;if (send_bytes >16 )return -1 ;
@@ -125,20 +126,20 @@ static int radeon_dp_aux_native_write(st msg[3 ] = (msg_bytes <<4 ) | (send_bytes -1 );memcpy (&msg[4 ], send, send_bytes); -while (1 ) { +for (retry =0 ; retry <4 ; retry++) { ret =radeon_process_aux_ch (dig_connector->dp_i2c_bus, msg, msg_bytes,NULL ,0 , delay, &ack);if (ret <0 )return ret;if ((ack &AUX_NATIVE_REPLY_MASK ) ==AUX_NATIVE_REPLY_ACK ) -break ; +return send_bytes;else if ((ack &AUX_NATIVE_REPLY_MASK ) ==AUX_NATIVE_REPLY_DEFER )udelay (400 );else return -EIO ; } -return send_bytes; +return -EIO ; } static int radeon_dp_aux_native_read(struct radeon_connector *radeon_connector,
@@ -149,13 +150,14 @@ static int radeon_dp_aux_native_read(strint msg_bytes =4 ;u8 ack;int ret; +unsigned retry; msg[0 ] = address; msg[1 ] = address >>8 ; msg[2 ] =AUX_NATIVE_READ <<4 ; msg[3 ] = (msg_bytes <<4 ) | (recv_bytes -1 ); -while (1 ) { +for (retry =0 ; retry <4 ; retry++) { ret =radeon_process_aux_ch (dig_connector->dp_i2c_bus, msg, msg_bytes, recv, recv_bytes, delay, &ack);if (ret <0 )
@@ -169,6 +171,8 @@ static int radeon_dp_aux_native_read(strelse return -EIO ; } + +return -EIO ; } static void radeon_write_dpcd_reg(struct radeon_connector *radeon_connector,
PATCH 19/38 drm/radeon/kms: fix channel_remap setup (v2)
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit 12d5180bd7e683a4ae80830b82ba67e7b7fac7b2 upstream.
Most asics just use the hw default value which requires no explicit programming. For those that need a different value, the vbios will program it properly. As such, there's no need to program these registers explicitly in the driver. Changing MC_SHARED_CHREMAP requires a reload of all data in vram otherwise its contents will be scambled.
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=40103
v2: drop now unused channel_remap functions.
--- drivers/gpu/drm/radeon/evergreen.c | 44 ------------------------------- drivers/gpu/drm/radeon/ni.c | 32 ----------------------- drivers/gpu/drm/radeon/rv770.c | 51 ------------------------------------- 3 files changed, 127 deletions(-)
drivers/gpu/drm/radeon/evergreen.c +0 -44
@@ -1593,48 +1593,6 @@ static u32 evergreen_get_tile_pipe_to_bareturn backend_map; } -static void evergreen_program_channel_remap (struct radeon_device *rdev) -{ -u32 tcp_chan_steer_lo, tcp_chan_steer_hi, mc_shared_chremap, tmp; - - tmp =RREG32 (MC_SHARED_CHMAP ); -switch ((tmp &NOOFCHAN_MASK ) >>NOOFCHAN_SHIFT ) { -case 0 : -case 1 : -case 2 : -case 3 : -default : -/* default mapping */ - mc_shared_chremap =0x00fac688 ; -break ; - } - -switch (rdev->family) { -case CHIP_HEMLOCK : -case CHIP_CYPRESS : -case CHIP_BARTS : - tcp_chan_steer_lo =0x54763210 ; - tcp_chan_steer_hi =0x0000ba98 ; -break ; -case CHIP_JUNIPER : -case CHIP_REDWOOD : -case CHIP_CEDAR : -case CHIP_PALM : -case CHIP_SUMO : -case CHIP_SUMO2 : -case CHIP_TURKS : -case CHIP_CAICOS : -default : - tcp_chan_steer_lo =0x76543210 ; - tcp_chan_steer_hi =0x0000ba98 ; -break ; - } - -WREG32 (TCP_CHAN_STEER_LO , tcp_chan_steer_lo); -WREG32 (TCP_CHAN_STEER_HI , tcp_chan_steer_hi); -WREG32 (MC_SHARED_CHREMAP , mc_shared_chremap); -} -static void evergreen_gpu_init (struct radeon_device *rdev) {u32 cc_rb_backend_disable =0 ;
@@ -2080,8 +2038,6 @@ static void evergreen_gpu_init(struct raWREG32 (DMIF_ADDR_CONFIG , gb_addr_config);WREG32 (HDP_ADDR_CONFIG , gb_addr_config); -evergreen_program_channel_remap (rdev); - num_shader_engines = ((RREG32 (GB_ADDR_CONFIG ) &NUM_SHADER_ENGINES (3 )) >>12 ) +1 ; grbm_gfx_index =INSTANCE_BROADCAST_WRITES ;
drivers/gpu/drm/radeon/ni.c +0 -32
@@ -569,36 +569,6 @@ static u32 cayman_get_tile_pipe_to_backereturn backend_map; } -static void cayman_program_channel_remap (struct radeon_device *rdev) -{ -u32 tcp_chan_steer_lo, tcp_chan_steer_hi, mc_shared_chremap, tmp; - - tmp =RREG32 (MC_SHARED_CHMAP ); -switch ((tmp &NOOFCHAN_MASK ) >>NOOFCHAN_SHIFT ) { -case 0 : -case 1 : -case 2 : -case 3 : -default : -/* default mapping */ - mc_shared_chremap =0x00fac688 ; -break ; - } - -switch (rdev->family) { -case CHIP_CAYMAN : -default : -//tcp_chan_steer_lo = 0x54763210 - tcp_chan_steer_lo =0x76543210 ; - tcp_chan_steer_hi =0x0000ba98 ; -break ; - } - -WREG32 (TCP_CHAN_STEER_LO , tcp_chan_steer_lo); -WREG32 (TCP_CHAN_STEER_HI , tcp_chan_steer_hi); -WREG32 (MC_SHARED_CHREMAP , mc_shared_chremap); -} - static u32 cayman_get_disable_mask_per_asic(struct radeon_device *rdev, u32 disable_mask_per_se, u32 max_disable_mask_per_se,
@@ -841,8 +811,6 @@ static void cayman_gpu_init(struct radeoWREG32 (DMIF_ADDR_CONFIG , gb_addr_config);WREG32 (HDP_ADDR_CONFIG , gb_addr_config); -cayman_program_channel_remap (rdev); -/* primary versions */ WREG32 (CC_RB_BACKEND_DISABLE , cc_rb_backend_disable);WREG32 (CC_SYS_RB_BACKEND_DISABLE , cc_rb_backend_disable);
drivers/gpu/drm/radeon/rv770.c +0 -51
63 lines not on this page · raw message
PATCH 20/38 ptp: fix L2 event message recognition
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Richard Cochran <[email protected]>
commit f75159e9936143177b442afc78150b7a7ad8aa07 upstream.
The IEEE 1588 standard defines two kinds of messages, event and general messages. Event messages require time stamping, and general do not. When using UDP transport, two separate ports are used for the two message types.
The BPF designed to recognize event messages incorrectly classifies L2 general messages as event messages. This commit fixes the issue by extending the filter to check the message type field for L2 PTP packets. Event messages are be distinguished from general messages by testing the "general" bit.
--- include/linux/ptp_classify.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
include/linux/ptp_classify.h +10 -3
@@ -51,6 +51,7 @@#define PTP_CLASS_V2_VLAN (PTP_CLASS_V2 | PTP_CLASS_VLAN)#define PTP_EV_PORT 319 +#define PTP_GEN_BIT 0x08/* indicates general message, if set in message type */ #define OFF_ETYPE 12#define OFF_IHL 14
@@ -116,14 +117,20 @@ static inline int ptp_filter_init(struct {OP_OR, 0, 0, PTP_CLASS_IPV6 }, /* */ \ {OP_RETA, 0, 0, 0 }, /* */ \ /*L3x*/ {OP_RETK, 0, 0, PTP_CLASS_NONE }, /* */ \ -/*L40*/ {OP_JEQ, 0, 6, ETH_P_8021Q }, /* f goto L50 */ \ +/*L40*/ {OP_JEQ, 0, 9, ETH_P_8021Q }, /* f goto L50 */ \ {OP_LDH, 0, 0, OFF_ETYPE + 4 }, /* */ \ - {OP_JEQ, 0, 9, ETH_P_1588 }, /* f goto L60 */ \ + {OP_JEQ, 0, 15, ETH_P_1588 }, /* f goto L60 */ \ + {OP_LDB, 0, 0, ETH_HLEN + VLAN_HLEN }, /* */ \ + {OP_AND, 0, 0, PTP_GEN_BIT }, /* */ \ + {OP_JEQ, 0, 12, 0 }, /* f goto L6x */ \ {OP_LDH, 0, 0, ETH_HLEN + VLAN_HLEN }, /* */ \ {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \ {OP_OR, 0, 0, PTP_CLASS_VLAN }, /* */ \ {OP_RETA, 0, 0, 0 }, /* */ \ -/*L50*/ {OP_JEQ, 0, 4, ETH_P_1588 }, /* f goto L61 */ \ +/*L50*/ {OP_JEQ, 0, 7, ETH_P_1588 }, /* f goto L61 */ \ + {OP_LDB, 0, 0, ETH_HLEN }, /* */ \ + {OP_AND, 0, 0, PTP_GEN_BIT }, /* */ \ + {OP_JEQ, 0, 4, 0 }, /* f goto L6x */ \ {OP_LDH, 0, 0, ETH_HLEN }, /* */ \ {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \ {OP_OR, 0, 0, PTP_CLASS_L2 }, /* */ \
PATCH 21/38 rt2x00: Serialize TX operations on a queue.
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Gertjan van Wingerde <[email protected]>
commit 77a861c405da75d81e9e6e32c50eb7f9777777e8 upstream.
The rt2x00 driver gets frequent occurrences of the following error message when operating under load:
phy0 -> rt2x00queue_write_tx_frame: Error - Arrived at non-free entry in the non-full queue 2.
This is caused by simultaneous attempts from mac80211 to send a frame via rt2x00, which are not properly serialized inside rt2x00queue_write_tx_frame, causing the second frame to fail sending with the above mentioned error message.
Fix this by introducing a per-queue spinlock to serialize the TX operations on that queue.
--- drivers/net/wireless/rt2x00/rt2x00queue.c | 21 ++++++++++++++++----- drivers/net/wireless/rt2x00/rt2x00queue.h | 2 ++ 2 files changed, 18 insertions(+), 5 deletions(-)
drivers/net/wireless/rt2x00/rt2x00queue.c +16 -5
@@ -556,15 +556,21 @@ int rt2x00queue_write_tx_frame(struct da bool local) {struct ieee80211_tx_info *tx_info; -struct queue_entry *entry =rt2x00queue_get_entry (queue,Q_INDEX ); +struct queue_entry *entry;struct txentry_desc txdesc;struct skb_frame_desc *skbdesc;u8 rate_idx, rate_flags; +int ret =0 ; + +spin_lock (&queue->tx_lock); + + entry =rt2x00queue_get_entry (queue,Q_INDEX );if (unlikely (rt2x00queue_full (queue))) {ERROR (queue->rt2x00dev,"Dropping frame due to full tx queue %d.\n" , queue->qid); -return -ENOBUFS ; + ret = -ENOBUFS ; + goto out; } if (unlikely(test_and_set_bit(ENTRY_OWNER_DEVICE_DATA,
@@ -573,7 +579,8 @@ int rt2x00queue_write_tx_frame(struct da"Arrived at non-free entry in the non-full queue %d.\n" "Please file bug report to %s.\n" , queue->qid, DRV_PROJECT); -return -EINVAL ; + ret = -EINVAL ; + goto out; }/*
@@ -635,7 +642,8 @@ int rt2x00queue_write_tx_frame(struct daif (unlikely (rt2x00queue_write_tx_data (entry, &txdesc))) {clear_bit (ENTRY_OWNER_DEVICE_DATA , &entry->flags); entry->skb =NULL ; -return -EIO ; + ret = -EIO ; + goto out; }set_bit (ENTRY_DATA_PENDING , &entry->flags);
@@ -644,7 +652,9 @@ int rt2x00queue_write_tx_frame(struct dart2x00queue_write_tx_descriptor (entry, &txdesc);rt2x00queue_kick_tx_queue (queue, &txdesc); -return 0 ; +out: +spin_unlock (&queue->tx_lock); +return ret; } int rt2x00queue_clear_beacon(struct rt2x00_dev *rt2x00dev,
@@ -1185,6 +1195,7 @@ static void rt2x00queue_init(struct rt2x struct data_queue *queue, enum data_queue_qid qid) {mutex_init (&queue->status_lock); +spin_lock_init (&queue->tx_lock);spin_lock_init (&queue->index_lock); queue->rt2x00dev = rt2x00dev;
drivers/net/wireless/rt2x00/rt2x00queue.h +2 -0
@@ -432,6 +432,7 @@ enum data_queue_flags {* @flags: Entry flags, see &enum queue_entry_flags. * @status_lock: The mutex for protecting the start/stop/flush * handling on this queue. +* @tx_lock: Spinlock to serialize tx operations on this queue. * @index_lock: Spinlock to protect index handling. Whenever @index, @index_done or * @index_crypt needs to be changed this lock should be grabbed to prevent * index corruption due to concurrency.
@@ -458,6 +459,7 @@ struct data_queue {unsigned long flags;struct mutex status_lock; +spinlock_t tx_lock;spinlock_t index_lock;unsigned int count;
PATCH 22/38 x86/PCI: use host bridge _CRS info on ASUS M2V-MX SE
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Paul Menzel <[email protected]>
commit 29cf7a30f8a0ce4af2406d93d5a332099be26923 upstream.
In summary, this DMI quirk uses the _CRS info by default for the ASUS M2V-MX SE by turning on pci=use_crs and is similar to the quirk added by commit 2491762cfb47 ("x86/PCI: use host bridge _CRS info on ASRock ALiveSATA2-GLAN") whose commit message should be read for further information.
Since commit 3e3da00c01d0 ("x86/pci: AMD one chain system to use pci read out res") Linux gives the following oops:
parport0: PC-style at 0x378, irq 7 [PCSPP,TRISTATE]
HDA Intel 0000:20:01.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
HDA Intel 0000:20:01.0: setting latency timer to 64
BUG: unable to handle kernel paging request at ffffc90011c08000
IP: [<ffffffffa0578402>] azx_probe+0x3ad/0x86b [snd_hda_intel]
PGD 13781a067 PUD 13781b067 PMD 1300ba067 PTE 800000fd00000173
Oops: 0009 [#1] SMP
last sysfs file: /sys/module/snd_pcm/initstate
CPU 0
Modules linked in: snd_hda_intel(+) snd_hda_codec snd_hwdep snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_midi snd_rawmidi snd_seq_midi_event tpm_tis tpm snd_seq tpm_bios psmouse parport_pc snd_timer snd_seq_device parport processor evdev snd i2c_viapro thermal_sys amd64_edac_mod k8temp i2c_core soundcore shpchp pcspkr serio_raw asus_atk0110 pci_hotplug edac_core button snd_page_alloc edac_mce_amd ext3 jbd mbcache sha256_generic cryptd aes_x86_64 aes_generic cbc dm_crypt dm_mod raid1 md_mod usbhid hid sg sd_mod crc_t10dif sr_mod cdrom ata_generic uhci_hcd sata_via pata_via libata ehci_hcd usbcore scsi_mod via_rhine mii nls_base [last unloaded: scsi_wait_scan]
Pid: 1153, comm: work_for_cpu Not tainted 2.6.37-1-amd64 #1 M2V-MX SE/System Product Name
RIP: 0010:[<ffffffffa0578402>] [<ffffffffa0578402>] azx_probe+0x3ad/0x86b [snd_hda_intel]
RSP: 0018:ffff88013153fe50 EFLAGS: 00010286
RAX: ffffc90011c08000 RBX: ffff88013029ec00 RCX: 0000000000000006
RDX: 0000000000000000 RSI: 0000000000000246 RDI: 0000000000000246
RBP: ffff88013341d000 R08: 0000000000000000 R09: 0000000000000040
R10: 0000000000000286 R11: 0000000000003731 R12: ffff88013029c400
R13: 0000000000000000 R14: 0000000000000000 R15: ffff88013341d090
FS: 0000000000000000(0000) GS:ffff8800bfc00000(0000) knlGS:00000000f7610ab0
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: ffffc90011c08000 CR3: 0000000132f57000 CR4: 00000000000006f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process work_for_cpu (pid: 1153, threadinfo ffff88013153e000, task ffff8801303c86c0)
Stack:
0000000000000005 ffffffff8123ad65 00000000000136c0 ffff88013029c400
ffff8801303c8998 ffff88013341d000 ffff88013341d090 ffff8801322d9dc8
ffff88013341d208 0000000000000000 0000000000000000 ffffffff811ad232
Call Trace:
[<ffffffff8123ad65>] ? __pm_runtime_set_status+0x162/0x186
[<ffffffff811ad232>] ? local_pci_probe+0x49/0x92
[<ffffffff8105afc5>] ? do_work_for_cpu+0x0/0x1b
[<ffffffff8105afc5>] ? do_work_for_cpu+0x0/0x1b
[<ffffffff8105afd0>] ? do_work_for_cpu+0xb/0x1b
[<ffffffff8105fd3f>] ? kthread+0x7a/0x82
[<ffffffff8100a824>] ? kernel_thread_helper+0x4/0x10
[<ffffffff8105fcc5>] ? kthread+0x0/0x82
[<ffffffff8100a820>] ? kernel_thread_helper+0x0/0x10
Code: f4 01 00 00 ef 31 f6 48 89 df e8 29 dd ff ff 85 c0 0f 88 2b 03 00 00 48 89 ef e8 b4 39 c3 e0 8b 7b 40 e8 fc 9d b1 e0 48 8b 43 38 <66> 8b 10 66 89 14 24 8b 43 14 83 e8 03 83 f8 01 77 32 31 d2 be
RIP [<ffffffffa0578402>] azx_probe+0x3ad/0x86b [snd_hda_intel]
RSP <ffff88013153fe50>
CR2: ffffc90011c08000
---[ end trace 8d1f3ebc136437fd ]---Trusting the ACPI _CRS information (pci=use_crs) fixes this problem.
$ dmesg | grep -i crs # with the quirk
PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bugThe match has to be against the DMI board entries though since the vendor entries are not populated.
DMI: System manufacturer System Product Name/M2V-MX SE, BIOS 0304 10/30/2007
This quirk should be removed when pci=use_crs is enabled for machines from 2006 or earlier or some other solution is implemented.
Using coreboot [1] with this board the problem does not exist but this quirk also does not affect it either. To be safe though the check is tightened to only take effect when the BIOS from American Megatrends is used.
15:13 < ruik> but coreboot does not need that 15:13 < ruik> because i have there only one root bus 15:13 < ruik> the audio is behind a bridge
$ sudo dmidecode
BIOS Information
Vendor: American Megatrends Inc.
Version: 0304
Release Date: 10/30/2007
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=30552
--- arch/x86/pci/acpi.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
arch/x86/pci/acpi.c +11 -0
@@ -43,6 +43,17 @@ static const struct dmi_system_id pci_us DMI_MATCH(DMI_PRODUCT_NAME, "ALiveSATA2-GLAN"), }, }, +/* https://bugzilla.kernel.org/show_bug.cgi?id=30552 */ +/* 2006 AMD HT/VIA system with two host bridges */ + { + .callback = set_use_crs, + .ident = "ASUS M2V-MX SE", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), + DMI_MATCH(DMI_BOARD_NAME, "M2V-MX SE"), + DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."), + }, + }, {} };
PATCH 23/38 qla2xxx: Fix crash in qla2x00_abort_all_cmds() on unload
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Roland Dreier <[email protected]>
commit 9bfacd01dc9b7519e1e6da12b01963550b9d09a2 upstream.
I hit a crash in qla2x00_abort_all_cmds() if the qla2xxx module is unloaded right after it is loaded. I debugged this down to the abort handling improperly treating a command of type SRB_ADISC_CMD as if it had a bsg_job to complete when that command actually uses the iocb_cmd part of the union. (I guess to hit this one has to unload the module while the async FC initialization is still in progress)
It seems we should only look for a bsg_job if type is SRB_ELS_CMD_RPT, SRB_ELS_CMD_HST or SRB_CT_CMD, so switch the test to make that explicit.
--- drivers/scsi/qla2xxx/qla_os.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +5 -4
@@ -1240,10 +1240,9 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *qla2x00_sp_compl (ha, sp); }else { ctx = sp->ctx; -if (ctx->type ==SRB_LOGIN_CMD || - ctx->type ==SRB_LOGOUT_CMD ) { - ctx->u.iocb_cmd->free (sp); - }else { +if (ctx->type ==SRB_ELS_CMD_RPT || + ctx->type ==SRB_ELS_CMD_HST || + ctx->type ==SRB_CT_CMD ) {struct fc_bsg_job *bsg_job = ctx->u.bsg_job; if (bsg_job->request->msgcode
@@ -1255,6 +1254,8 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *kfree (sp->ctx);mempool_free (sp, ha->srb_mempool); + }else { + ctx->u.iocb_cmd->free (sp); } } }
PATCH 24/38 libsas: fix panic when single phy is disabled on a wide port
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mark Salyzyn <[email protected]>
commit a73914c35b05d80f8ce78288e10056c91090b666 upstream.
When a wide port is being utilized to a target, if one disables only one of the
phys, we get an OS crash:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000238 IP: [<ffffffff814ca9b1>] mutex_lock+0x21/0x50 PGD 4103f5067 PUD 41dba9067 PMD 0 Oops: 0002 [#1] SMP last sysfs file: /sys/bus/pci/slots/5/address CPU 0 Modules linked in: pm8001(U) ses enclosure fuse nfsd exportfs autofs4
ipmi_devintf ipmi_si ipmi_msghandler nfs lockd fscache nfs_acl auth_rpcgss 8021q fcoe libfcoe garp libfc scsi_transport_fc stp scsi_tgt llc sunrpc cpufreq_ondemand acpi_cpufreq freq_table ipv6 sr_mod cdrom dm_mirror dm_region_hash dm_log uinput sg i2c_i801 i2c_core iTCO_wdt iTCO_vendor_support e1000e mlx4_ib ib_mad ib_core mlx4_en mlx4_core ext3 jbd mbcache sd_mod crc_t10dif usb_storage ata_generic pata_acpi ata_piix libsas(U) scsi_transport_sas dm_mod [last unloaded: pm8001]
Modules linked in: pm8001(U) ses enclosure fuse nfsd exportfs autofs4
ipmi_devintf ipmi_si ipmi_msghandler nfs lockd fscache nfs_acl auth_rpcgss 8021q fcoe libfcoe garp libfc scsi_transport_fc stp scsi_tgt llc sunrpc cpufreq_ondemand acpi_cpufreq freq_table ipv6 sr_mod cdrom dm_mirror dm_region_hash dm_log uinput sg i2c_i801 i2c_core iTCO_wdt iTCO_vendor_support e1000e mlx4_ib ib_mad ib_core mlx4_en mlx4_core ext3 jbd mbcache sd_mod crc_t10dif usb_storage ata_generic pata_acpi ata_piix libsas(U) scsi_transport_sas dm_mod [last unloaded: pm8001]
Pid: 5146, comm: scsi_wq_5 Not tainted 2.6.32-71.29.1.el6.lustre.7.x86_64 #1 Storage Server
RIP: 0010:[<ffffffff814ca9b1>] [<ffffffff814ca9b1>] mutex_lock+0x21/0x50 RSP: 0018:ffff8803e4e33d30 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000238 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffff8803e664c800 RDI: 0000000000000238 RBP: ffff8803e4e33d40 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000 R13: 0000000000000238 R14: ffff88041acb7200 R15: ffff88041c51ada0 FS: 0000000000000000(0000) GS:ffff880028200000(0000)
knlGS:0000000000000000
CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 0000000000000238 CR3: 0000000410143000 CR4: 00000000000006f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process scsi_wq_5 (pid: 5146, threadinfo ffff8803e4e32000, task ffff8803e4e294a0)
Stack: ffff8803e664c800 0000000000000000 ffff8803e4e33d70 ffffffffa001f06e <0> ffff8803e4e33d60 ffff88041c51ada0 ffff88041acb7200 ffff88041bc0aa00 <0> ffff8803e4e33d90 ffffffffa0032b6c 0000000000000014 ffff88041acb7200 Call Trace: [<ffffffffa001f06e>] sas_port_delete_phy+0x2e/0xa0 [scsi_transport_sas] [<ffffffffa0032b6c>] sas_unregister_devs_sas_addr+0xac/0xe0 [libsas] [<ffffffffa0034914>] sas_ex_revalidate_domain+0x204/0x330 [libsas] [<ffffffffa00307f0>] ? sas_revalidate_domain+0x0/0x90 [libsas] [<ffffffffa0030855>] sas_revalidate_domain+0x65/0x90 [libsas] [<ffffffff8108c7d0>] worker_thread+0x170/0x2a0 [<ffffffff81091ea0>] ? autoremove_wake_function+0x0/0x40 [<ffffffff8108c660>] ? worker_thread+0x0/0x2a0 [<ffffffff81091b36>] kthread+0x96/0xa0 [<ffffffff810141ca>] child_rip+0xa/0x20 [<ffffffff81091aa0>] ? kthread+0x0/0xa0 [<ffffffff810141c0>] ? child_rip+0x0/0x20 Code: ff ff 85 c0 75 ed eb d6 66 90 55 48 89 e5 48 83 ec 10 48 89 1c 24
4c 89 64 24 08 0f 1f 44 00 00 48 89 fb e8 92 f4 ff ff 48 89 df <f0> ff 0f 79 05 e8 25 00 00 00 65 48 8b 04 25 08 cc 00 00 48 2d RIP [<ffffffff814ca9b1>] mutex_lock+0x21/0x50
RSP <ffff8803e4e33d30>
CR2: 0000000000000238
The following patch is admittedly a band-aid, and does not solve the root cause, but it still is a good candidate for hardening as a pointer check before reference.
--- drivers/scsi/libsas/sas_expander.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/scsi/libsas/sas_expander.c +6 -4
@@ -1769,10 +1769,12 @@ static void sas_unregister_devs_sas_addrsas_disable_routing (parent, phy->attached_sas_addr); }memset (phy->attached_sas_addr,0 ,SAS_ADDR_SIZE ); -sas_port_delete_phy (phy->port, phy->phy); -if (phy->port->num_phys ==0 ) -sas_port_delete (phy->port); - phy->port =NULL ; +if (phy->port) { +sas_port_delete_phy (phy->port, phy->phy); +if (phy->port->num_phys ==0 ) +sas_port_delete (phy->port); + phy->port =NULL ; + } } static int sas_discover_bfs_by_root_level(struct domain_device *root,
PATCH 25/38 md: Avoid waking up a thread after it has been freed.
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: NeilBrown <[email protected]>
commit 01f96c0a9922cd9919baf9d16febdf7016177a12 upstream.
Two related problems:
1/ some error paths call "md_unregister_thread(mddev->thread)"
without subsequently clearing ->thread. A subsequent call to mddev_unlock will try to wake the thread, and crash.
2/ Most calls to md_wakeup_thread are protected against the thread
disappeared either by:
- holding the ->mutex
- having an active request, so something else must be keeping the array active.
However mddev_unlock calls md_wakeup_thread after dropping the mutex and without any certainty of an active request, so the ->thread could theoretically disappear.
So we need a spinlock to provide some protections.
So change md_unregister_thread to take a pointer to the thread pointer, and ensure that it always does the required locking, and clears the pointer properly.
--- drivers/md/md.c | 22 +++++++++++++++++++--- drivers/md/md.h | 2 +- drivers/md/multipath.c | 3 +-- drivers/md/raid1.c | 3 +-- drivers/md/raid10.c | 5 ++--- drivers/md/raid5.c | 6 ++---- 6 files changed, 26 insertions(+), 15 deletions(-)
drivers/md/md.c +19 -3
@@ -61,6 +61,11 @@static void autostart_arrays (int part);#endif +/* pers_list is a list of registered personalities protected +* by pers_lock. +* pers_lock does extra service to protect accesses to +* mddev->thread when the mutex cannot be held. +*/ static LIST_HEAD (pers_list);static DEFINE_SPINLOCK (pers_lock);
@@ -690,7 +695,12 @@ static void mddev_unlock(mddev_t * mddev }else mutex_unlock (&mddev->reconfig_mutex); +/* was we've dropped the mutex we need a spinlock to +* make sur the thread doesn't disappear +*/ +spin_lock (&pers_lock);md_wakeup_thread (mddev->thread); +spin_unlock (&pers_lock); }static mdk_rdev_t *find_rdev_nr (mddev_t *mddev,int nr)
@@ -6186,11 +6196,18 @@ mdk_thread_t *md_register_thread(void (*return thread; } -void md_unregister_thread (mdk_thread_t *thread) +void md_unregister_thread (mdk_thread_t **threadp) { +mdk_thread_t *thread = *threadp;if (!thread)return ;dprintk ("interrupting MD-thread pid %d\n" ,task_pid_nr (thread->tsk)); +/* Locking ensures that mddev_unlock does not wake_up a +* non-existent thread +*/ +spin_lock (&pers_lock); + *threadp =NULL ; +spin_unlock (&pers_lock);kthread_stop (thread->tsk);kfree (thread);
@@ -7125,8 +7142,7 @@ static void reap_sync_thread(mddev_t *mdmdk_rdev_t *rdev;/* resync has finished, collect result */ -md_unregister_thread (mddev->sync_thread); - mddev->sync_thread =NULL ; +md_unregister_thread (&mddev->sync_thread);if (!test_bit (MD_RECOVERY_INTR , &mddev->recovery) && !test_bit (MD_RECOVERY_REQUESTED , &mddev->recovery)) {/* success...*/
drivers/md/md.h +1 -1
@@ -475,7 +475,7 @@ extern int register_md_personality(strucextern int unregister_md_personality (struct mdk_personality *p);extern mdk_thread_t *md_register_thread (void (*run) (mddev_t *mddev),mddev_t *mddev,const char *name); -extern void md_unregister_thread (mdk_thread_t *thread); +extern void md_unregister_thread (mdk_thread_t **threadp);extern void md_wakeup_thread (mdk_thread_t *thread);extern void md_check_recovery (mddev_t *mddev);extern void md_write_start (mddev_t *mddev,struct bio *bi);
drivers/md/multipath.c +1 -2
@@ -514,8 +514,7 @@ static int multipath_stop (mddev_t *mdde {multipath_conf_t *conf = mddev->private; -md_unregister_thread (mddev->thread); - mddev->thread =NULL ; +md_unregister_thread (&mddev->thread);blk_sync_queue (mddev->queue);/* the unplug fn references 'conf'*/ mempool_destroy (conf->pool);kfree (conf->multipaths);
drivers/md/raid1.c +1 -2
@@ -2045,8 +2045,7 @@ static int stop(mddev_t *mddev)raise_barrier (conf);lower_barrier (conf); -md_unregister_thread (mddev->thread); - mddev->thread =NULL ; +md_unregister_thread (&mddev->thread);if (conf->r1bio_pool)mempool_destroy (conf->r1bio_pool);kfree (conf->mirrors);
drivers/md/raid10.c +2 -3
@@ -2331,7 +2331,7 @@ static int run(mddev_t *mddev)return 0 ; out_free_conf: -md_unregister_thread (mddev->thread); +md_unregister_thread (&mddev->thread);if (conf->r10bio_pool)mempool_destroy (conf->r10bio_pool);safe_put_page (conf->tmppage);
@@ -2349,8 +2349,7 @@ static int stop(mddev_t *mddev)raise_barrier (conf,0 );lower_barrier (conf); -md_unregister_thread (mddev->thread); - mddev->thread =NULL ; +md_unregister_thread (&mddev->thread);blk_sync_queue (mddev->queue);/* the unplug fn references 'conf'*/ if (conf->r10bio_pool)mempool_destroy (conf->r10bio_pool);
drivers/md/raid5.c +2 -4
@@ -5162,8 +5162,7 @@ static int run(mddev_t *mddev)return 0 ; abort: -md_unregister_thread (mddev->thread); - mddev->thread =NULL ; +md_unregister_thread (&mddev->thread);if (conf) {print_raid5_conf (conf);free_conf (conf);
@@ -5177,8 +5176,7 @@ static int stop(mddev_t *mddev) {raid5_conf_t *conf = mddev->private; -md_unregister_thread (mddev->thread); - mddev->thread =NULL ; +md_unregister_thread (&mddev->thread);if (mddev->queue) mddev->queue->backing_dev_info.congested_fn =NULL ;free_conf (conf);
PATCH 26/38 dm table: avoid crash if integrity profile changes
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mike Snitzer <[email protected]>
commit 876fbba1db4a377f050a2bb49b474c7527b2995d upstream.
Commit a63a5cf (dm: improve block integrity support) introduced a two-phase initialization of a DM device's integrity profile. This patch avoids dereferencing a NULL 'template_disk' pointer in blk_integrity_register() if there is an integrity profile mismatch in dm_table_set_integrity().
This can occur if the integrity profiles for stacked devices in a DM table are changed between the call to dm_table_prealloc_integrity() and dm_table_set_integrity().
--- drivers/md/dm-table.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/md/dm-table.c +7 -6
@@ -1184,14 +1184,15 @@ static void dm_table_set_integrity(strucreturn ; template_disk =dm_table_get_integrity_disk (t, true); -if (!template_disk && -blk_integrity_is_initialized (dm_disk (t->md))) { +if (template_disk) +blk_integrity_register (dm_disk (t->md), +blk_get_integrity (template_disk)); +else if (blk_integrity_is_initialized (dm_disk (t->md)))DMWARN ("%s: device no longer has a valid integrity profile" ,dm_device_name (t->md)); -return ; - } -blk_integrity_register (dm_disk (t->md), -blk_get_integrity (template_disk)); +else +DMWARN ("%s: unable to establish an integrity profile" , +dm_device_name (t->md)); } void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
PATCH 27/38 mmc: mxs-mmc: fix clock rate setting
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Koen Beel <[email protected]>
commit d982dcdc4e64eb1881df44b0035a8268bf1ab067 upstream.
Fix clock rate setting in the mxs-mmc driver. Previously, if div2 was 0 then the value for TIMING_CLOCK_RATE would have been 255 instead of 0. The limits for div1 (TIMING_CLOCK_DIVIDE) and div2 (TIMING_CLOCK_RATE+1) were also not correctly defined.
Can easily be reproduced on mx23evk: default clock for high speed sdio cards is 50 MHz. With a SSP_CLK of 28.8 MHz default), this resulted in an actual clock rate of about 56 kHz. Tested on mx23evk.
--- drivers/mmc/host/mxs-mmc.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-)
drivers/mmc/host/mxs-mmc.c +14 -16
@@ -564,40 +564,38 @@ static void mxs_mmc_request(struct mmc_hstatic void mxs_mmc_set_clk_rate (struct mxs_mmc_host *host,unsigned int rate) { -unsigned int ssp_rate, bit_rate; -u32 div1, div2; +unsigned int ssp_clk, ssp_sck; +u32 clock_divide, clock_rate;u32 val; - ssp_rate =clk_get_rate (host->clk); + ssp_clk =clk_get_rate (host->clk); -for (div1 =2 ; div1 <254 ; div1 +=2 ) { - div2 = ssp_rate / rate / div1; -if (div2 <0x100 ) +for (clock_divide =2 ; clock_divide <=254 ; clock_divide +=2 ) { + clock_rate =DIV_ROUND_UP (ssp_clk, rate * clock_divide); + clock_rate = (clock_rate >0 ) ? clock_rate -1 :0 ; +if (clock_rate <=255 )break ; } -if (div1 >=254 ) { +if (clock_divide >254 ) {dev_err (mmc_dev (host->mmc),"%s: cannot set clock to %d\n" , __func__, rate);return ; } -if (div2 ==0 ) - bit_rate = ssp_rate / div1; -else - bit_rate = ssp_rate / div1 / div2; + ssp_sck = ssp_clk / clock_divide / (1 + clock_rate); val =readl (host->base +HW_SSP_TIMING ); val &= ~(BM_SSP_TIMING_CLOCK_DIVIDE |BM_SSP_TIMING_CLOCK_RATE ); - val |=BF_SSP (div1,TIMING_CLOCK_DIVIDE ); - val |=BF_SSP (div2 -1 ,TIMING_CLOCK_RATE ); + val |=BF_SSP (clock_divide,TIMING_CLOCK_DIVIDE ); + val |=BF_SSP (clock_rate,TIMING_CLOCK_RATE );writel (val, host->base +HW_SSP_TIMING ); - host->clk_rate = bit_rate; + host->clk_rate = ssp_sck;dev_dbg (mmc_dev (host->mmc), -"%s: div1 %d, div2 %d, ssp %d, bit %d, rate %d\n" , - __func__, div1, div2, ssp_rate, bit_rate, rate); +"%s: clock_divide %d, clock_rate %d, ssp_clk %d, rate_actual %d, rate_requested %d\n" , + __func__, clock_divide, clock_rate, ssp_clk, ssp_sck, rate); }static void mxs_mmc_set_ios (struct mmc_host *mmc,struct mmc_ios *ios)
PATCH 28/38 exec: do not call request_module() twice from search_binary_handler()
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tetsuo Handa <[email protected]>
commit 912193521b719fbfc2f16776febf5232fe8ba261 upstream.
Currently, search_binary_handler() tries to load binary loader module using request_module() if a loader for the requested program is not yet loaded. But second attempt of request_module() does not affect the result of search_binary_handler().
If request_module() triggered recursion, calling request_module() twice causes 2 to the power of MAX_KMOD_CONCURRENT (= 50) repetitions. It is not an infinite loop but is sufficient for users to consider as a hang up.
Therefore, this patch changes not to call request_module() twice, making 1 to the power of MAX_KMOD_CONCURRENT repetitions in case of recursion.
--- fs/exec.c | 2 ++ 1 file changed, 2 insertions(+)
fs/exec.c +2 -0
@@ -1411,6 +1411,8 @@ int search_binary_handler(struct linux_bprintable (bprm->buf[2 ]) && printable(bprm->buf[3])) break; /* -ENOEXEC */ +if (try) +break ;/* -ENOEXEC */ request_module ("binfmt-%04x" , *(unsigned short *)(&bprm->buf[2 ]));#endif }
PATCH 29/38 ARM: mach-ux500: enable fix for ARM errata 754322
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: srinidhi kasagar <[email protected]>
commit 98e87d57aab9b1594f9cc53a386fcb6f2f2ba6e2 upstream.
This applies ARM errata fix 754322 for all ux500 platforms.
--- arch/arm/mach-ux500/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-ux500/Kconfig +1 -0
@@ -6,6 +6,7 @@ config UX500_SOC_COMMON select ARM_GIC select HAS_MTU select ARM_ERRATA_753970 + select ARM_ERRATA_754322 menu "Ux500 SoC"
PATCH 30/38 drm/radeon/kms: retry aux transactions if there are status flags
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit 4f332844cc87c5f99c5300f788abbe8a8c731390 upstream.
If there are error flags in the aux status, retry the transaction. This makes aux much more reliable, especially on llano systems.
--- drivers/gpu/drm/radeon/atombios_dp.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/radeon/atombios_dp.c +9 -3
@@ -129,7 +129,9 @@ static int radeon_dp_aux_native_write(stfor (retry =0 ; retry <4 ; retry++) { ret =radeon_process_aux_ch (dig_connector->dp_i2c_bus, msg, msg_bytes,NULL ,0 , delay, &ack); -if (ret <0 ) +if (ret == -EBUSY ) +continue ; +else if (ret <0 )return ret;if ((ack &AUX_NATIVE_REPLY_MASK ) ==AUX_NATIVE_REPLY_ACK )return send_bytes;
@@ -160,7 +162,9 @@ static int radeon_dp_aux_native_read(strfor (retry =0 ; retry <4 ; retry++) { ret =radeon_process_aux_ch (dig_connector->dp_i2c_bus, msg, msg_bytes, recv, recv_bytes, delay, &ack); -if (ret <0 ) +if (ret == -EBUSY ) +continue ; +else if (ret <0 )return ret;if ((ack &AUX_NATIVE_REPLY_MASK ) ==AUX_NATIVE_REPLY_ACK )return ret;
@@ -236,7 +240,9 @@ int radeon_dp_i2c_aux_ch(struct i2c_adapfor (retry =0 ; retry <4 ; retry++) { ret =radeon_process_aux_ch (auxch, msg, msg_bytes, reply, reply_bytes,0 , &ack); -if (ret <0 ) { +if (ret == -EBUSY ) +continue ; +else if (ret <0 ) {DRM_DEBUG_KMS ("aux_ch failed %d\n" , ret);return ret; }
PATCH 31/38 drm/radeon/kms: use hardcoded dig encoder to transmitter mapping for DCE4.1
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit cb7cf41961fe10773c491c75ae73539ad4bbed66 upstream.
The encoders are supposedly fully routeable, but changing the mapping doesn't always seem to take. Using a hardcoded mapping is much more reliable.
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=41366
--- drivers/gpu/drm/radeon/radeon_encoders.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/radeon/radeon_encoders.c +6 -3
@@ -1755,9 +1755,12 @@ static int radeon_atom_pick_dig_encoder(/* DCE4/5 */ if (ASIC_IS_DCE4 (rdev)) { dig = radeon_encoder->enc_priv; -if (ASIC_IS_DCE41 (rdev)) -return radeon_crtc->crtc_id; -else { +if (ASIC_IS_DCE41 (rdev)) { +if (dig->linkb) +return 1 ; +else +return 0 ; + }else {switch (radeon_encoder->encoder_id) {case ENCODER_OBJECT_ID_INTERNAL_UNIPHY :if (dig->linkb)
PATCH 32/38 ipv6: fix NULL dereference in udp6_ufo_fragment()
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jason Wang <[email protected]>
This patch fixes the issue caused by ef81bb40bf15f350fe865f31fa42f1082772a576 which is a backport of upstream 87c48fa3b4630905f98268dde838ee43626a060c. The problem does not exist in upstream.
We do not check whether route is attached before trying to assign ip identification through route dest which lead NULL pointer dereference. This happens when host bridge transmit a packet from guest.
This patch changes ipv6_select_ident() to accept in6_addr as its paramter and fix the issue by using the destination address in ipv6 header when no route is attached.
--- include/net/ipv6.h | 2 +- net/ipv6/ip6_output.c | 10 +++++----- net/ipv6/udp.c | 4 +++- 3 files changed, 9 insertions(+), 7 deletions(-)
include/net/ipv6.h +1 -1
@@ -463,7 +463,7 @@ static inline int ipv6_addr_diff(const sreturn __ipv6_addr_diff (a1, a2,sizeof (struct in6_addr )); } -extern void ipv6_select_ident (struct frag_hdr *fhdr,struct rt6_info *rt); +extern void ipv6_select_ident (struct frag_hdr *fhdr,struct in6_addr *addr);/* * Prototypes exported by ipv6
net/ipv6/ip6_output.c +5 -5
@@ -620,9 +620,9 @@ static u32 __ipv6_select_ident(const strreturn hash + newid; } -void ipv6_select_ident (struct frag_hdr *fhdr,struct rt6_info *rt) +void ipv6_select_ident (struct frag_hdr *fhdr,struct in6_addr *addr) { - fhdr->identification =htonl (__ipv6_select_ident (&rt->rt6i_dst.addr)); + fhdr->identification =htonl (__ipv6_select_ident (addr)); }int ip6_fragment (struct sk_buff *skb,int (*output)(struct sk_buff *))
@@ -709,7 +709,7 @@ int ip6_fragment(struct sk_buff *skb, inskb_reset_network_header (skb);memcpy (skb_network_header (skb), tmp_hdr, hlen); -ipv6_select_ident (fh, rt); +ipv6_select_ident (fh, &rt->rt6i_dst.addr); fh->nexthdr = nexthdr; fh->reserved =0 ; fh->frag_off =htons (IP6_MF );
@@ -855,7 +855,7 @@ slow_path: fh->nexthdr = nexthdr; fh->reserved =0 ;if (!frag_id) { -ipv6_select_ident (fh, rt); +ipv6_select_ident (fh, &rt->rt6i_dst.addr); frag_id = fh->identification; }else fh->identification = frag_id;
@@ -1146,7 +1146,7 @@ static inline int ip6_ufo_append_data(stskb_shinfo (skb)->gso_size = (mtu - fragheaderlen -sizeof (struct frag_hdr )) & ~7 ;skb_shinfo (skb)->gso_type =SKB_GSO_UDP ; -ipv6_select_ident (&fhdr, rt); +ipv6_select_ident (&fhdr, &rt->rt6i_dst.addr);skb_shinfo (skb)->ip6_frag_id = fhdr.identification;__skb_queue_tail (&sk->sk_write_queue, skb);
net/ipv6/udp.c +3 -1
@@ -1309,6 +1309,7 @@ static struct sk_buff *udp6_ufo_fragmentu8 frag_hdr_sz =sizeof (struct frag_hdr );int offset;__wsum csum; +struct rt6_info *rt = (struct rt6_info *)skb_dst (skb); mss =skb_shinfo (skb)->gso_size;if (unlikely (skb->len <= mss))
@@ -1359,7 +1360,8 @@ static struct sk_buff *udp6_ufo_fragment fptr = (struct frag_hdr *)(skb_network_header (skb) + unfrag_ip6hlen); fptr->nexthdr = nexthdr; fptr->reserved =0 ; -ipv6_select_ident (fptr, (struct rt6_info *)skb_dst (skb)); +ipv6_select_ident (fptr, + rt ? &rt->rt6i_dst.addr : &ipv6_hdr (skb)->daddr);/* Fragment the skb. ipv6 header and the remaining fields of the * fragment header are updated in ipv6_gso_segment()
PATCH 33/38 ahci: Enable SB600 64bit DMA on Asus M3A
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mark Nelson <[email protected]>
commit 3c4aa91f21f65b7b40bdfb015eacbcb8453ccae2 upstream.
Like e65cc194f7628ecaa02462f22f42fb09b50dcd49 this patch enables 64bit DMA for the AHCI SATA controller of a board that has the SB600 southbridge. In this case though we're enabling 64bit DMA for the Asus M3A motherboard. It is a new enough board that all of the BIOS releases since the initial release (0301 from 2007-10-22) work correctly with 64bit DMA enabled.
--- drivers/ata/ahci.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/ata/ahci.c +12 -0
@@ -812,6 +812,18 @@ static bool ahci_sb600_enable_64bit(stru DMI_MATCH(DMI_BOARD_NAME, "MS-7376"), }, }, +/* +* All BIOS versions for the Asus M3A support 64bit DMA. +* (all release versions from 0301 to 1206 were tested) +*/ + { + .ident = "ASUS M3A", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, + "ASUSTeK Computer INC."), + DMI_MATCH(DMI_BOARD_NAME, "M3A"), + }, + }, { } }; const struct dmi_system_id *match;
PATCH 34/38 MIPS: PM: Use struct syscore_ops instead of sysdevs for PM (v2)
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: "Rafael J. Wysocki" <[email protected]>
commit bd7100099a46b59f433dd15ad60adbb4d4f3d625 upstream.
Convert some MIPS architecture's code to using struct syscore_ops objects for power management instead of sysdev classes and sysdevs.
This simplifies the code and reduces the kernel's memory footprint. It also is necessary for removing sysdevs from the kernel entirely in the future.
Patchwork: http://patchwork.linux-mips.org/patch/2431/
--- arch/mips/jz4740/gpio.c | 52 ++++++++++++++++++++---------------------------- 1 file changed, 22 insertions(+), 30 deletions(-)
arch/mips/jz4740/gpio.c +22 -30
@@ -18,7 +18,7 @@#include <linux/init.h> #include <linux/spinlock.h> -#include <linux/sysdev.h> +#include <linux/syscore_ops.h> #include <linux/io.h> #include <linux/gpio.h> #include <linux/delay.h>
@@ -86,7 +86,6 @@ struct jz_gpio_chip {spinlock_t lock;struct gpio_chip gpio_chip; -struct sys_device sysdev; };static struct jz_gpio_chip jz4740_gpio_chips[];
@@ -459,49 +458,47 @@ static struct jz_gpio_chip jz4740_gpio_c JZ4740_GPIO_CHIP(D), }; -static inline struct jz_gpio_chip *sysdev_to_chip (struct sys_device *dev) +static void jz4740_gpio_suspend_chip (struct jz_gpio_chip *chip) { - return container_of(dev, struct jz_gpio_chip, sysdev); + chip->suspend_mask =readl (chip->base +JZ_REG_GPIO_MASK ); +writel (~(chip->wakeup), chip->base +JZ_REG_GPIO_MASK_SET ); +writel (chip->wakeup, chip->base +JZ_REG_GPIO_MASK_CLEAR ); } -static int jz4740_gpio_suspend (struct sys_device *dev,pm_message_t state) +static int jz4740_gpio_suspend (void ) { -struct jz_gpio_chip *chip =sysdev_to_chip (dev); +int i; - chip->suspend_mask =readl (chip->base +JZ_REG_GPIO_MASK ); -writel (~(chip->wakeup), chip->base +JZ_REG_GPIO_MASK_SET ); -writel (chip->wakeup, chip->base +JZ_REG_GPIO_MASK_CLEAR ); +for (i =0 ; i <ARRAY_SIZE (jz4740_gpio_chips); i++) +jz4740_gpio_suspend_chip (&jz4740_gpio_chips[i]);return 0 ; } -static int jz4740_gpio_resume (struct sys_device *dev) +static void jz4740_gpio_resume_chip (struct jz_gpio_chip *chip) { -struct jz_gpio_chip *chip =sysdev_to_chip (dev);uint32_t mask = chip->suspend_mask;writel (~mask, chip->base +JZ_REG_GPIO_MASK_CLEAR );writel (mask, chip->base +JZ_REG_GPIO_MASK_SET ); +} -return 0 ; +static void jz4740_gpio_resume (void ) +{ +int i; + +for (i =ARRAY_SIZE (jz4740_gpio_chips) -1 ; i >=0 ; i--) +jz4740_gpio_resume_chip (&jz4740_gpio_chips[i]); } -static struct sysdev_class jz4740_gpio_sysdev_class = { - .name ="gpio" , +static struct syscore_ops jz4740_gpio_syscore_ops = { .suspend = jz4740_gpio_suspend, .resume = jz4740_gpio_resume, }; -static int jz4740_gpio_chip_init (struct jz_gpio_chip *chip,unsigned int id) +static void jz4740_gpio_chip_init (struct jz_gpio_chip *chip,unsigned int id) { -int ret, irq; - - chip->sysdev.id = id; - chip->sysdev.cls = &jz4740_gpio_sysdev_class; - ret =sysdev_register (&chip->sysdev); - -if (ret) -return ret; +int irq;spin_lock_init (&chip->lock);
@@ -519,22 +516,17 @@ static int jz4740_gpio_chip_init(structirq_set_chip_and_handler (irq, &jz_gpio_irq_chip, handle_level_irq); } - -return 0 ; }static int __init jz4740_gpio_init (void ) {unsigned int i; -int ret; - - ret =sysdev_class_register (&jz4740_gpio_sysdev_class); -if (ret) -return ret;for (i =0 ; i <ARRAY_SIZE (jz4740_gpio_chips); ++i)jz4740_gpio_chip_init (&jz4740_gpio_chips[i], i); +register_syscore_ops (&jz4740_gpio_syscore_ops); +printk (KERN_INFO "JZ4740 GPIO initialized\n" );return 0 ;
PATCH 35/38 ftrace: Fix regression of :mod:module function enabling
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Steven Rostedt <[email protected]>
commit 43dd61c9a09bd413e837df829e6bfb42159be52a upstream.
The new code that allows different utilities to pick and choose what functions they trace broke the :mod: hook that allows users to trace only functions of a particular module.
The reason is that the :mod: hook bypasses the hash that is setup to allow individual users to trace their own functions and uses the global hash directly. But if the global hash has not been set up, it will cause a bug:
echo '*:mod:radeon' > /sys/kernel/debug/set_ftrace_filter
produces:
[drm:drm_mode_getfb] *ERROR* invalid framebuffer id [drm:radeon_crtc_page_flip] *ERROR* failed to reserve new rbo buffer before flip
BUG: unable to handle kernel paging request at ffffffff8160ec90 IP: [<ffffffff810d9136>] add_hash_entry+0x66/0xd0 PGD 1a05067 PUD 1a09063 PMD 80000000016001e1 Oops: 0003 [#1] SMP Jul 7 04:02:28 phyllis kernel: [55303.858604] CPU 1 Modules linked in: cryptd aes_x86_64 aes_generic binfmt_misc rfcomm bnep ip6table_filter hid radeon r8169 ahci libahci mii ttm drm_kms_helper drm video i2c_algo_bit intel_agp intel_gtt
Pid: 10344, comm: bash Tainted: G WC 3.0.0-rc5 #1 Dell Inc. Inspiron N5010/0YXXJJ
RIP: 0010:[<ffffffff810d9136>] [<ffffffff810d9136>] add_hash_entry+0x66/0xd0 RSP: 0018:ffff88003a96bda8 EFLAGS: 00010246 RAX: ffff8801301735c0 RBX: ffffffff8160ec80 RCX: 0000000000306ee0 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff880137c92940 RBP: ffff88003a96bdb8 R08: ffff880137c95680 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: ffffffff81c9df78 R13: ffff8801153d1000 R14: 0000000000000000 R15: 0000000000000000 FS: 00007f329c18a700(0000) GS:ffff880137c80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffff8160ec90 CR3: 000000003002b000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process bash (pid: 10344, threadinfo ffff88003a96a000, task ffff88012fcfc470) Stack: 0000000000000fd0 00000000000000fc ffff88003a96be38 ffffffff810d92f5 ffff88011c4c4e00 ffff880000000000 000000000b69f4d0 ffffffff8160ec80 ffff8800300e6f06 0000000081130295 0000000000000282 ffff8800300e6f00 Call Trace: [<ffffffff810d92f5>] match_records+0x155/0x1b0 [<ffffffff810d940c>] ftrace_mod_callback+0xbc/0x100 [<ffffffff810dafdf>] ftrace_regex_write+0x16f/0x210 [<ffffffff810db09f>] ftrace_filter_write+0xf/0x20 [<ffffffff81166e48>] vfs_write+0xc8/0x190 [<ffffffff81167001>] sys_write+0x51/0x90 [<ffffffff815c7e02>] system_call_fastpath+0x16/0x1b Code: 48 8b 33 31 d2 48 85 f6 75 33 49 89 d4 4c 03 63 08 49 8b 14 24 48 85 d2 48 89 10 74 04 48 89 42 08 49 89 04 24 4c 89 60 08 31 d2 RIP [<ffffffff810d9136>] add_hash_entry+0x66/0xd0 RSP <ffff88003a96bda8> CR2: ffffffff8160ec90 ---[ end trace a5d031828efdd88e ]---
--- include/linux/ftrace.h | 3 ++- kernel/trace/ftrace.c | 12 +++--------- kernel/trace/trace_functions.c | 3 ++- 3 files changed, 7 insertions(+), 11 deletions(-)
include/linux/ftrace.h +2 -1
@@ -123,7 +123,8 @@ stack_trace_sysctl(struct ctl_table *tabstruct ftrace_func_command {struct list_head list;char *name; -int (*func)(char *func,char *cmd, +int (*func)(struct ftrace_hash *hash, +char *func,char *cmd,char *params,int enable); };
kernel/trace/ftrace.c +3 -9
@@ -2407,10 +2407,9 @@ ftrace_match_module_records(struct ftrac*/ static int -ftrace_mod_callback (char *func,char *cmd,char *param,int enable) +ftrace_mod_callback (struct ftrace_hash *hash, +char *func,char *cmd,char *param,int enable) { -struct ftrace_ops *ops = &global_ops; -struct ftrace_hash *hash;char *mod;int ret = -EINVAL ;
@@ -2430,11 +2429,6 @@ ftrace_mod_callback(char *func, char *cmif (!strlen (mod))return ret; -if (enable) - hash = ops->filter_hash; -else - hash = ops->notrace_hash; - ret =ftrace_match_module_records (hash, func, mod);if (!ret) ret = -EINVAL ;
@@ -2760,7 +2754,7 @@ static int ftrace_process_regex(struct fmutex_lock (&ftrace_cmd_mutex);list_for_each_entry (p, &ftrace_commands, list) {if (strcmp (p->name, command) ==0 ) { - ret = p->func (func, command, next, enable); + ret = p->func (hash, func, command, next, enable); goto out_unlock; } }
kernel/trace/trace_functions.c +2 -1
@@ -324,7 +324,8 @@ ftrace_trace_onoff_unreg(char *glob, cha }static int -ftrace_trace_onoff_callback (char *glob,char *cmd,char *param,int enable) +ftrace_trace_onoff_callback (struct ftrace_hash *hash, +char *glob,char *cmd,char *param,int enable) {struct ftrace_probe_ops *ops;void *count = (void *)-1 ;
PATCH 36/38 ftrace: Fix regression where ftrace breaks when modules are loaded
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Steven Rostedt <[email protected]>
commit f7bc8b61f65726ff98f52e286b28e294499d7a08 upstream.
Enabling function tracer to trace all functions, then load a module and then disable function tracing will cause ftrace to fail.
This can also happen by enabling function tracing on the command line:
ftrace=function
and during boot up, modules are loaded, then you disable function tracing with 'echo nop > current_tracer' you will trigger a bug in ftrace that will shut itself down.
The reason is, the new ftrace code keeps ref counts of all ftrace_ops that are registered for tracing. When one or more ftrace_ops are registered, all the records that represent the functions that the ftrace_ops will trace have a ref count incremented. If this ref count is not zero, when the code modification runs, that function will be enabled for tracing. If the ref count is zero, that function will be disabled from tracing.
To make sure the accounting was working, FTRACE_WARN_ON()s were added to updating of the ref counts.
If the ref count hits its max (> 2^30 ftrace_ops added), or if the ref count goes below zero, a FTRACE_WARN_ON() is triggered which disables all modification of code.
Since it is common for ftrace_ops to trace all functions in the kernel, instead of creating > 20,000 hash items for the ftrace_ops, the hash count is just set to zero, and it represents that the ftrace_ops is to trace all functions. This is where the issues arrise.
If you enable function tracing to trace all functions, and then add a module, the modules function records do not get the ref count updated. When the function tracer is disabled, all function records ref counts are subtracted. Since the modules never had their ref counts incremented, they go below zero and the FTRACE_WARN_ON() is triggered.
The solution to this is rather simple. When modules are loaded, and their functions are added to the the ftrace pool, look to see if any ftrace_ops are registered that trace all functions. And for those, update the ref count for the module function records.
--- kernel/trace/ftrace.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-)
kernel/trace/ftrace.c +28 -2
@@ -1744,10 +1744,36 @@ static cycle_t ftrace_update_time;static unsigned long ftrace_update_cnt;unsigned long ftrace_update_tot_cnt; +static int ops_traces_mod (struct ftrace_ops *ops) +{ +struct ftrace_hash *hash; + + hash = ops->filter_hash; +return !!(!hash || !hash->count); +} +static int ftrace_update_code (struct module *mod) {struct dyn_ftrace *p;cycle_t start, stop; +unsigned long ref =0 ; + +/* +* When adding a module, we need to check if tracers are +* currently enabled and if they are set to trace all functions. +* If they are, we need to enable the module functions as well +* as update the reference counts for those function records. +*/ +if (mod) { +struct ftrace_ops *ops; + +for (ops = ftrace_ops_list; + ops != &ftrace_list_end; ops = ops->next) { +if (ops->flags &FTRACE_OPS_FL_ENABLED && +ops_traces_mod (ops)) + ref++; + } + } start =ftrace_now (raw_smp_processor_id ()); ftrace_update_cnt =0 ;
@@ -1760,7 +1786,7 @@ static int ftrace_update_code(struct mod p = ftrace_new_addrs; ftrace_new_addrs = p->newlist; - p->flags =0L ; + p->flags = ref;/* * Do the initial record conversion from mcount jump
@@ -1783,7 +1809,7 @@ static int ftrace_update_code(struct mod* conversion puts the module to the correct state, thus * passing the ftrace_make_call check. */ -if (ftrace_start_up) { +if (ftrace_start_up && ref) {int failed =__ftrace_replace_code (p,1 );if (failed) {ftrace_bug (failed, p->ip);
PATCH 37/38 ftrace: Fix warning when CONFIG_FUNCTION_TRACER is not defined
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Steven Rostedt <[email protected]>
commit 04da85b86188f224cc9b391b5bdd92a3ba20ffcf upstream.
The struct ftrace_hash was declared within CONFIG_FUNCTION_TRACER but was referenced outside of it.
--- include/linux/ftrace.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/ftrace.h +2 -2
@@ -19,6 +19,8 @@#include <asm/ftrace.h> +struct ftrace_hash ; +#ifdef CONFIG_FUNCTION_TRACER extern int ftrace_enabled;
@@ -29,8 +31,6 @@ ftrace_enable_sysctl(struct ctl_table *ttypedef void (*ftrace_func_t )(unsigned long ip,unsigned long parent_ip); -struct ftrace_hash ; -enum {FTRACE_OPS_FL_ENABLED =1 <<0 ,FTRACE_OPS_FL_GLOBAL =1 <<1 ,
PATCH 38/38 e1000e: workaround for packet drop on 82579 at 100Mbps
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Bruce Allan <[email protected]>
commit 0ed013e28fe853244f4972cf18d8e2bd62eeb8fc upstream.
The MAC can drop short packets when the PHY detects noise on the line at 100Mbps due to a timing issue. Workaround the issue by increasing the PLL counter so the PHY properly recognizes the synchronization pattern from the MAC.
--- drivers/net/e1000e/ich8lan.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
drivers/net/e1000e/ich8lan.c +14 -5
@@ -137,8 +137,9 @@#define HV_PM_CTRL PHY_REG(770, 17)/* PHY Low Power Idle Control */ -#define I82579_LPI_CTRL PHY_REG(772, 20) -#define I82579_LPI_CTRL_ENABLE_MASK 0x6000 +#define I82579_LPI_CTRL PHY_REG(772, 20) +#define I82579_LPI_CTRL_ENABLE_MASK 0x6000 +#define I82579_LPI_CTRL_FORCE_PLL_LOCK_COUNT 0x80/* EMI Registers */ #define I82579_EMI_ADDR 0x10
@@ -1611,6 +1612,7 @@ static s32 e1000_k1_workaround_lv(structs32 ret_val =0 ;u16 status_reg =0 ;u32 mac_reg; +u16 phy_reg;if (hw->mac.type != e1000_pch2lan) goto out;
@@ -1625,12 +1627,19 @@ static s32 e1000_k1_workaround_lv(struct mac_reg =er32 (FEXTNVM4 ); mac_reg &= ~E1000_FEXTNVM4_BEACON_DURATION_MASK ; -if (status_reg &HV_M_STATUS_SPEED_1000 ) + ret_val =e1e_rphy (hw,I82579_LPI_CTRL , &phy_reg); +if (ret_val) + goto out; + +if (status_reg &HV_M_STATUS_SPEED_1000 ) { mac_reg |=E1000_FEXTNVM4_BEACON_DURATION_8USEC ; -else + phy_reg &= ~I82579_LPI_CTRL_FORCE_PLL_LOCK_COUNT ; + }else { mac_reg |=E1000_FEXTNVM4_BEACON_DURATION_16USEC ; - + phy_reg |=I82579_LPI_CTRL_FORCE_PLL_LOCK_COUNT ; + }ew32 (FEXTNVM4 , mac_reg); + ret_val =e1e_wphy (hw,I82579_LPI_CTRL , phy_reg); } out: