aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2016-05-17ravb: Add missing free_irq() calls to ravb_close()Geert Uytterhoeven1-1/+6
When reopening the network device on ra7795/salvator-x, e.g. after a DHCP timeout: IP-Config: Reopening network devices... genirq: Flags mismatch irq 139. 00000000 (eth0:ch0:rx_be) vs. 00000000 (ravb e6800000.ethernet eth0: cannot request IRQ eth0:ch0:rx_be IP-Config: Failed to open eth0 IP-Config: No network devices available The "mismatch" is due to requesting an IRQ that is already in use, while IRQF_PROBE_SHARED wasn't set. However, the real cause is that ravb_close() doesn't release any of the R-Car Gen3-specific secondary IRQs. Add the missing free_irq() calls to fix this. Fixes: f51bdc236b6c5835 ("ravb: Add dma queue interrupt support") Signed-off-by: Geert Uytterhoeven <[email protected]> Acked-by: Sergei Shtylyov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-05-17qed: Remove a stray tabDan Carpenter1-1/+1
This line was indented more than it should be. Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Yuval Mintz <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-05-17Merge branch '10GbE' of ↵David S. Miller1-6/+6
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== 10GbE Intel Wired LAN Driver Updates 2016-05-16 This series contains 2 fixes to ixgbe only. Emil fixes transmit hangs when enabling SRIOV by swapping the parameters in GENMASK in order to generate the correct mask. Alex fixes his previous patch b83e30104bd9 ("ixgbe/ixgbevf: Add support for GSO partial") where he somehow transposed the location of setting the VLAN features in netdev->features and the configuration of the vlan_features. ==================== Signed-off-by: David S. Miller <[email protected]>
2016-05-17mmc: block: Pause re-tuning while switched to the RPMB partitionAdrian Hunter1-1/+10
Re-tuning is not possible when switched to the RPMB partition. However re-tuning should not be needed if re-tuning is done immediately before switching, a small set of operations is done, and then we immediately switch back to the main partition. A previous patch ensured that we immediately switch back to the main partition. This patch uses the new facility to "pause" re-tuning before switching to the RPMB partition, and to "unpause" it after switching from the RPMB partition. Signed-off-by: Adrian Hunter <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
2016-05-17mmc: block: Always switch back to main area after RPMB accessAdrian Hunter1-0/+8
In preparation to support the use of the RPMB partition with transfer modes that might require re-tuning, always switch back to the main area after RPMB access. RPMB is accessible only via IOCTL so only those paths are affected. Signed-off-by: Adrian Hunter <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
2016-05-17mmc: core: Add a facility to "pause" re-tuningAdrian Hunter1-0/+24
Re-tuning is not possible when switched to the RPMB partition. However re-tuning should not be needed if re-tuning is done immediately before switching, a small set of operations is done, and then we immediately switch back to the main partition. To ensure that re-tuning can't be done for a short while, add a facility to "pause" re-tuning. The existing facility to hold / release re-tuning is used but it also flags re-tuning as needed to cause re-tuning before the next command (which will be the switch to RPMB). We also need to "unpause" in the recovery path, which is catered for by adding it to mmc_retune_disable(). Signed-off-by: Adrian Hunter <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
2016-05-17thermal: tango: initialize TEMPSI_CFGMarc Gonzalez1-0/+1
TEMPSI_CFG is not equal to 0 at reset. It must be initialized. Signed-off-by: Marc Gonzalez <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: rockchip: use the usleep_range instead of udelayCaesar Wang1-2/+2
Documentation/timers/timers-howto.txt recommends to use usleep_range on delays > 10usec. The usleep_range indeed reduces CPU load, since the udelay will busy wait for enough loop cycles to achieve the desired delay. Fixes commit b06c52db39fd ("thermal: rockchip: handle the power sequence for tsadc controller"). Cc: Zhang Rui <[email protected]> Cc: Eduardo Valentin <[email protected]> Cc: Heiko Stuebner <[email protected]> Suggested-by: Eduardo Valentin <[email protected]> Signed-off-by: Caesar Wang <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: rockchip: add the notes for better readingCaesar Wang1-21/+53
To update the notes for keeping in mind that quickly in case someone re-read this driver in the future. Signed-off-by: Caesar Wang <[email protected]> Cc: Zhang Rui <[email protected]> Cc: Eduardo Valentin <[email protected]> Cc: Heiko Stuebner <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: rockchip: Support RK3366 SoCs in the thermal driverElaine Zhang1-0/+28
The RK3366 SoCs have two Temperature Sensors, channel 0 is for CPU channel 1 is for GPU. Signed-off-by: Elaine Zhang <[email protected]> Signed-off-by: Caesar Wang <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: rockchip: handle the power sequence for tsadc controllerCaesar Wang1-5/+82
This adds the grf property to handle the tsadc power sequence on rockchip some SoCs. Verified on rk3399 can work with this patch on now. while true; do grep "" /sys/class/thermal/thermal_zone[0-1]/temp sleep .5; done /sys/class/thermal/thermal_zone0/temp:40555 /sys/class/thermal/thermal_zone1/temp:41111 /sys/class/thermal/thermal_zone0/temp:40555 /sys/class/thermal/thermal_zone1/temp:41111 /sys/class/thermal/thermal_zone0/temp:40555 /sys/class/thermal/thermal_zone1/temp:41666 /sys/class/thermal/thermal_zone0/temp:40555 /sys/class/thermal/thermal_zone1/temp:41111 /sys/class/thermal/thermal_zone0/temp:40555 /sys/class/thermal/thermal_zone1/temp:41111 /sys/class/thermal/thermal_zone0/temp:40555 Signed-off-by: Caesar Wang <[email protected]> Cc: Zhang Rui <[email protected]> Cc: Eduardo Valentin <[email protected]> Cc: Heiko Stuebner <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: rockchip: update the tsadc table for rk3399Caesar Wang1-34/+34
This patch fixes the incorrect conversion table. The Code to Temperature mapping is updated based on sillcon results. Fixes commit b0d70338bca22cb14 ("thermal: rockchip: Support the RK3399 SoCs in thermal driver"). Signed-off-by: Caesar Wang <[email protected]> Cc: Zhang Rui <[email protected]> Cc: Eduardo Valentin <[email protected]> Cc: Heiko Stuebner <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: rockchip: fixes the code_to_temp for tsadc driverCaesar Wang1-2/+2
We should judge the table.id[mid].code insearch algorithm on matter the adc value increment or decrement. Or otherwise, the temperature return the incorrect value in some cases. [ 1.438589] adc_val=402,temp=-40000 [ 1.438903] adc_val=403,temp=-39375 [ 1.439217] adc_val=404,temp=-38750 ... [ 1.441102] adc_val=410,temp=-40000 [ 1.441416] adc_val=411,temp=-34445 [ 1.441737] adc_val=412,temp=-33889 ... Let's fix it right now. Fixes commit 020ba95dbbbe ("thermal: rockchip: Add the sort mode for adc value increment or decrement"). Reported-by: Rocky Hao <[email protected]> Signed-off-by: Caesar Wang <[email protected]> Cc: Zhang Rui <[email protected]> Cc: Eduardo Valentin <[email protected]> Cc: Heiko Stuebner <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: rockchip: disable thermal->clk in err caseShawn Lin1-1/+3
Disable thermal->clk when enabling pclk fails in resume routine. Signed-off-by: Shawn Lin <[email protected]> Reviewed-by: Heiko Stuebner <[email protected]> Reviewed-by: Caesar Wang <[email protected]> Signed-off-by: Caesar Wang <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: tegra: add Tegra132 specific SOC_THERM driverWei Ni4-0/+207
add Tegra132 specific SOC_THERM driver. Signed-off-by: Wei Ni <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: fix ptr_ret.cocci warningskbuild test robot1-4/+1
drivers/thermal/tango_thermal.c:86:1-3: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci CC: Marc Gonzalez <[email protected]> Signed-off-by: Fengguang Wu <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: mediatek: Add cpu dynamic power cooling model.Dawei Chien1-2/+9
MT8173 cpufreq driver select of_cpufreq_power_cooling_register registering cooling devices with dynamic power coefficient. Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Dawei Chien <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: generic-adc: Add ADC based thermal sensor driverLaxman Dewangan3-0/+193
In some of platform, thermal sensors like NCT thermistors are connected to the one of ADC channel. The temperature is read by reading the voltage across the sensor resistance via ADC. Lookup table for ADC read value to temperature is referred to get temperature. ADC is read via IIO framework. Add support for thermal sensor driver which read the voltage across sensor resistance from ADC through IIO framework. Acked-by: Jonathan Cameron <[email protected]> Signed-off-by: Laxman Dewangan <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: tegra: fix static checker warningWei Ni1-4/+1
There has a static checker warning: warn: variable dereferenced before check 'dev' (see line 222) Since check 'dev' is unnecessary, so remove this check. Fixes: ee6d79f202a4 ("thermal: tegra: add thermtrip function") Signed-off-by: Wei Ni <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: tegra: mark PM functions __maybe_unusedArnd Bergmann1-2/+2
After the PM support has been added to this driver, we get a harmless warning when that support is disabled at compile time: drivers/thermal/tegra/soctherm.c:641:12: error: 'soctherm_resume' defined but not used [-Werror=unused-function] static int soctherm_resume(struct device *dev) This marks the two PM functions as __maybe_unused to shut up the warning. This is preferred over adding an #ifdef around them, as it is harder to get wrong, and provides better compile-time coverage. Signed-off-by: Arnd Bergmann <[email protected]> Fixes: a134b4143b65 ("thermal: tegra: add PM support") Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: add temperature sensor support for tango SoCMarc Gonzalez3-0/+121
The Tango thermal driver provides support for the primitive temperature sensor embedded in Tango chips since the SMP8758. This sensor only generates a 1-bit signal to indicate whether the die temperature exceeds a programmable threshold. Signed-off-by: Marc Gonzalez <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: hisilicon: fix IRQ imbalance enablingLeo Yan1-3/+4
When register sensors into thermal zone during initialization phase, it reports error for IRQ imbalance enabling: [ 2.040713] WARNING: at kernel/irq/manage.c:513 [ 2.040719] Modules linked in: [ 2.040721] [ 2.040729] CPU: 1 PID: 804 Comm: irq/33-hisi_the Not tainted 4.5.0-rc4+ #505 [ 2.040732] Hardware name: HiKey Development Board (DT) [ 2.040736] task: ffffffc03ae82580 ti: ffffffc0379c8000 task.ti: ffffffc0379c8000 [ 2.040745] PC is at __enable_irq+0x74/0x84 [ 2.040749] LR is at __enable_irq+0x74/0x84 This warning is for IRQ imbalance enabling, which is caused by enable_irq() twice. During sensor's initialization it tries to enable IRQ, the driver will call thermal_zone_of_sensor_register() to bind sensors and read sensor's temperature. But at this moment the flag "data->irq_enabled" has been not initialized as correct state, so it finally introduces the function enabled_irq() to be called twice. In essentially this is caused by the flag "data->irq_enabled" is inconsistent with real hardware IRQ enabling state. So this patch is to fix this issue, firstly init "irq_enabled" flag before binding sensors to thermal zone. Also change to use the function irq_get_irqchip_state() to read back real interrupt line state. Signed-off-by: Leo Yan <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: hisilicon: support to use any sensorLeo Yan1-13/+20
In current code sensor driver registers all 4 sensors together and if any of them has not bound to thermal zone successfully then driver will return failure for driver's initialization. As a result, if DT binds thermal zone with only one sensor, then the thermal driver will not work well anymore. So this patch is to fix this issue. It allows the thermal sensor driver can register any number sensors at initialization phase, and fix up code for other related code to skip related sensor's accessing if the sensor has not been enabled in initialization phase. Signed-off-by: Leo Yan <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: tegra: add PM supportWei Ni1-0/+46
Add suspend/resume function in soctherm driver. Signed-off-by: Wei Ni <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: tegra: handle HW initialization in one funcotionWei Ni1-41/+44
Handle HW initialization in one function soctherm_init(), so that the codes are more clear. Signed-off-by: Wei Ni <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: tegra: handle clocks in one functionWei Ni1-15/+36
Handle clock enable/disable codes in one function soctherm_clk_enable(), so that the codes are more clear. Signed-off-by: Wei Ni <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: tegra: add thermtrip functionWei Ni4-5/+216
Add support for hardware critical thermal limits to the SOC_THERM driver. It use the Linux thermal framework to create critical trip temp, and set it to SOC_THERM hardware. If these limits are breached, the chip will reset, and if appropriately configured, will turn off the PMIC. This support is critical for safe usage of the chip. Signed-off-by: Wei Ni <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: of-thermal: allow setting trip_temp on hardwareWei Ni1-0/+8
In current of-thermal, the .set_trip_temp only support to set trip_temp for SW. But some sensors support to set trip_temp on hardware, so that can trigger interrupt, shutdown or any other events. This patch adds .set_trip_temp() callback in thermal_zone_of_device_ops{}, so that the sensor device can use it to set trip_temp on hardware. Signed-off-by: Wei Ni <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: tegra: add a debugfs to show registersWei Ni2-3/+145
Add a debugfs interface to show register contents for debug. Signed-off-by: Wei Ni <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: tegra: add Tegra210 specific SOC_THERM driverWei Ni5-0/+195
Add Tegra210 specific SOC_THERM driver. Signed-off-by: Wei Ni <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: tegra: split tegra_soctherm driverWei Ni7-566/+754
Split most of the Tegra124 data and code into a Tegra124-specific file. Split most of the fuse-related code into a fuse-related source file. This is in preparation for adding a Tegra210-specific driver in a future patch. Beyond the maintainability improvements, this is intended to separate chip-specific ATE and characterization-related hacks into chip-specific files, in the hopes that they won't pollute code for other chips. Signed-off-by: Wei Ni <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: tegra: get rid of PDIV/HOTSPOT hackWei Ni1-4/+15
Get rid of T124-specific PDIV/HOTSPOT hack. tegra-soctherm.c contained a hack to set the SENSOR_PDIV and SENSOR_HOTSPOT_OFFSET registers - it just did two writes of T124-specific opaque values. Convert these into a form that can be substituted on a per-chip basis, and into structure fields that have at least some independent meaning. Signed-off-by: Wei Ni <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: tegra: combine sensor group-related dataWei Ni1-27/+118
Combine sensor group-related data structures into struct tegra_tsensor_group. This provides a single location for sensor group data storage. More sensor group data will be added in subsequent patches. Signed-off-by: Wei Ni <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: tegra: move tegra thermal files into tegra directoryWei Ni5-11/+17
Move Tegra soctherm driver to tegra directory, it's easy to maintain and add more new function support for Tegra platforms. This will also help to split soctherm driver into common parts and chip specific data related parts. Signed-off-by: Wei Ni <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: convert ti-thermal to use devm_thermal_zone_of_sensor_registerEduardo Valentin1-4/+1
This changes the driver to use the devm_ version of thermal_zone_of_sensor_register and cleans up the local points and unregister calls. Cc: Zhang Rui <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Tested-by: Keerthy <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: convert tegra_thermal to use devm_thermal_zone_of_sensor_registerEduardo Valentin1-22/+9
This changes the driver to use the devm_ version of thermal_zone_of_sensor_register and cleans up the local points and unregister calls. Cc: Zhang Rui <[email protected]> Cc: Stephen Warren <[email protected]> Cc: Thierry Reding <[email protected]> Cc: Alexandre Courbot <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: convert rockchip_thermal to use devm_thermal_zone_of_sensor_registerEduardo Valentin1-13/+4
This changes the driver to use the devm_ version of thermal_zone_of_sensor_register and cleans up the local points and unregister calls. Cc: Zhang Rui <[email protected]> Cc: Heiko Stuebner <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Tested-by: Caesar Wang <[email protected]> Reviewed-by: Caesar Wang <[email protected]> Reviewed-by: Heiko Stuebner <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: convert rcar_thermal to use devm_thermal_zone_of_sensor_registerEduardo Valentin1-1/+1
This changes the driver to use the devm_ version of thermal_zone_of_sensor_register and cleans up the local points and unregister calls. Cc: Zhang Rui <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: convert qcom-spmi to use devm_thermal_zone_of_sensor_registerEduardo Valentin1-2/+1
This changes the driver to use the devm_ version of thermal_zone_of_sensor_register and cleans up the local points and unregister calls. Cc: Zhang Rui <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: convert mtk_thermal to use devm_thermal_zone_of_sensor_registerEduardo Valentin1-10/+2
This changes the driver to use the devm_ version of thermal_zone_of_sensor_register and cleans up the local points and unregister calls. Cc: Zhang Rui <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: convert hisi_thermal to use devm_thermal_zone_of_sensor_registerEduardo Valentin1-3/+2
This changes the driver to use the devm_ version of thermal_zone_of_sensor_register and cleans up the local points and unregister calls. Cc: Zhang Rui <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17input: convert sun4i-ts to use devm_thermal_zone_of_sensor_registerEduardo Valentin1-8/+1
This changes the driver to use the devm_ version of thermal_zone_of_sensor_register and cleans up the local points and unregister calls. Cc: Dmitry Torokhov <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Chen-Yu Tsai <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Zhang Rui <[email protected]> Cc: Lukasz Majewski <[email protected]> Cc: Heiko Stuebner <[email protected]> Cc: Sascha Hauer <[email protected]> Cc: Jens Thiele <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Acked-by: Dmitry Torokhov <[email protected]> Acked-by: Hans de Goede <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17hwmon: convert scpi-hwmon to use devm_thermal_zone_of_sensor_registerEduardo Valentin1-39/+9
This changes the driver to use the devm_ version of thermal_zone_of_sensor_register and cleans up the local points and unregister calls. Cc: Jean Delvare <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17hwmon: convert tmp102 to use devm_thermal_zone_of_sensor_registerEduardo Valentin1-6/+2
This changes the driver to use the devm_ version of thermal_zone_of_sensor_register and cleans up the local points and unregister calls. Cc: Jean Delvare <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: [email protected] Cc: [email protected] Acked-by: Guenter Roeck <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17hwmon: convert ntc_thermistor to use devm_thermal_zone_of_sensor_registerEduardo Valentin1-8/+4
This changes the driver to use the devm_ version of thermal_zone_of_sensor_register and cleans up the local points and unregister calls. Cc: Jean Delvare <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: [email protected] Cc: [email protected] Acked-by: Guenter Roeck <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17hwmon: convert lm75 to use devm_thermal_zone_of_sensor_registerEduardo Valentin1-7/+3
This changes the driver to use the devm_ version of thermal_zone_of_sensor_register and cleans up the local points and unregister calls. Cc: Jean Delvare <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: [email protected] Cc: [email protected] Acked-by: Guenter Roeck <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17thermal: of: fix cleanup when building a thermal zoneUlises Brindis1-1/+1
of_node_put is iterating through all terms in the tbps array even though the bind has failed. We need to only iterate through the terms that have already passed the binding step. Cc: Zhang Rui <[email protected]> Cc: Eduardo Valentin <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Ulises Brindis <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2016-05-17drm/fb_helper: Fix references to dev->mode_config.num_connectorLyude1-3/+2
During boot, MST hotplugs are generally expected (even if no physical hotplugging occurs) and result in DRM's connector topology changing. This means that using num_connector from the current mode configuration can lead to the number of connectors changing under us. This can lead to some nasty scenarios in fbcon: - We allocate an array to the size of dev->mode_config.num_connectors. - MST hotplug occurs, dev->mode_config.num_connectors gets incremented. - We try to loop through each element in the array using the new value of dev->mode_config.num_connectors, and end up going out of bounds since dev->mode_config.num_connectors is now larger then the array we allocated. fb_helper->connector_count however, will always remain consistent while we do a modeset in fb_helper. Note: This is just polish for 4.7, Dave Airlie's drm_connector refcounting fixed these bugs for real. But it's good enough duct-tape for stable kernel backporting, since backporting the refcounting changes is way too invasive. Cc: [email protected] Signed-off-by: Lyude <[email protected]> [danvet: Clarify why we need this. Also remove the now unused "dev" local variable to appease gcc.] Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2016-05-17drm/i915/fbdev: Fix num_connector references in intel_fb_initial_config()Lyude1-3/+3
During boot time, MST devices usually send a ton of hotplug events irregardless of whether or not any physical hotplugs actually occurred. Hotplugs mean connectors being created/destroyed, and the number of DRM connectors changing under us. This isn't a problem if we use fb_helper->connector_count since we only set it once in the code, however if we use num_connector from struct drm_mode_config we risk it's value changing under us. On top of that, there's even a chance that dev->mode_config.num_connector != fb_helper->connector_count. If the number of connectors happens to increase under us, we'll end up using the wrong array size for memcpy and start writing beyond the actual length of the array, occasionally resulting in kernel panics. Note: This is just polish for 4.7, Dave Airlie's drm_connector refcounting fixed these bugs for real. But it's good enough duct-tape for stable kernel backporting, since backporting the refcounting changes is way too invasive. Cc: [email protected] Signed-off-by: Lyude <[email protected]> [danvet: Clarify why we need this.] Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2016-05-17Merge branches 'next/cleanup' and 'next/fixes-non-critical' into ↵Arnd Bergmann1-5/+23
next/cleanups-fixes This is a merge of the cleanup and fixes-non-critical branches for the 4.7 merge window. It seems more appropriate to send a single pull request for these than two separate ones, as both branches really contain both fixes and cleanups. * next/cleanup: ARM: debug: remove extraneous DEBUG_HI3716_UART option ARM: davinci: use IRQCHIP_DECLARE for cp_intc ARM: davinci: remove unused DA8XX_NUM_UARTS ARM: davinci: simplify call to of populate ARM: DaVinci USB: removed deprecated properties from MUSB config ARM: rockchip: Fix use of plain integer as NULL pointer ARM: realview: hide unused 'pmu_device' object soc: versatile: dynamically detect RealView HBI numbers * next/fixes-non-critical: ARM: dts: exynos: Add interrupt line to MAX8997 PMIC on exynos4210-trats ARM: dts: exynos: Fix regulator name to avoid forbidden character on exynos4210-trats ARM: dts: exynos: Add MFC memory banks for Peach boards ARM: OMAP2+: n900 needs MMC slot names for legacy user space ARM: OMAP2+: Add more functions to pwm pdata for ir-rx51 ARM: EXYNOS: Properly skip unitialized parent clock in power domain on ARM: OMAP2+: Simplify auxdata by using the generic match of/platform: Allow secondary compatible match in of_dev_lookup