aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2017-05-29Merge remote-tracking branch 'ieee1394/for-next'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'thermal-soc/next'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'pm/linux-next'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'v4l-dvb/master'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'jc_docs/docs-next'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'hwmon-staging/hwmon-next'Stephen Rothwell
2017-05-29Merge branch 'dmi/master'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'hid/for-next'Stephen Rothwell
2017-05-29Merge remote-tracking branch 's390/features'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'm68k/for-next'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'clk/clk-next'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'sunxi/sunxi/for-next'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'rockchip/for-next'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'imx-mxs/for-next'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'at91/at91-next'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'drm-intel-fixes/for-linux-next-fixes'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'v4l-dvb-fixes/fixes'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'nand-fixes/nand/fixes'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'char-misc.current/char-misc-linus'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'staging.current/staging-linus'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'phy/fixes'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'usb.current/usb-linus'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'pci-current/for-linus'Stephen Rothwell
2017-05-29Merge remote-tracking branch 'net/master'Stephen Rothwell
2017-05-28mtk-vcodec: Use designated initializersKees Cook
The randstruct plugin requires designated initializers for structures that are entirely function pointers. Cc: Wu-Cheng Li <wuchengli@chromium.org> Cc: Tiffany Lin <tiffany.lin@mediatek.com> Cc: Hans Verkuil <hans.verkuil@cisco.com> Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Kees Cook <keescook@chromium.org>
2017-05-28drm/amd/powerplay: Use designated initializersKees Cook
The randstruct plugin requires designated initializers for structures that are entirely function pointers. Cc: Christian König <christian.koenig@amd.com> Cc: Eric Huang <JinHuiEric.Huang@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Kees Cook <keescook@chromium.org>
2017-05-28drm/amdgpu: Use designated initializersKees Cook
The randstruct plugin requires structures that are entirely function pointers be initialized using designated initializers. Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Signed-off-by: Kees Cook <keescook@chromium.org>
2017-05-28sgi-xp: Use designated initializersKees Cook
Prepare to mark sensitive kernel structures for randomization by making sure they're using designated initializers. In this case, no initializers are needed (they can be NULL initialized and callers adjusted to check for NULL, which is more efficient than an indirect call). Cc: Robin Holt <robinmholt@gmail.com> Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-by: Christoph Hellwig <hch@infradead.org>
2017-05-28net: dsa: mv88e6xxx: Add missing static to stub functionsAndrew Lunn
Stub functions in header files need to be static, or we can have multiple definitions errors. Reported-by: kbuild test robot <fengguang.wu@intel.com> Fixes: 6335e9f2446b ("net: dsa: mv88e6xxx: mv88e6390X SERDES support") Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-27Merge branch 'work-linus' into work-nextEduardo Valentin
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2017-05-27thermal: cpu_cooling: Replace kmalloc with kmalloc_arrayViresh Kumar
Checkpatch reports following: WARNING: Prefer kmalloc_array over kmalloc with multiply + cpufreq_cdev->freq_table = kmalloc(sizeof(*cpufreq_cdev->freq_table) * i, Fix that. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2017-05-27thermal: cpu_cooling: Rearrange struct cpufreq_cooling_deviceViresh Kumar
This shrinks the size of the structure on arm64 by 8 bytes by avoiding padding of 4 bytes at two places. Also add missing doc comment for freq_table Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2017-05-27thermal: cpu_cooling: 'freq' can't be zero in cpufreq_state2power()Viresh Kumar
The frequency table shouldn't have any zero frequency entries and so such a check isn't required. Though it would be better to make sure 'state' is within limits. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2017-05-27thermal: cpu_cooling: don't store cpu_dev in cpufreq_cdevViresh Kumar
'cpu_dev' is used by only one function, get_static_power(), and it wouldn't be time consuming to get the cpu device structure within it. This would help removing cpu_dev from struct cpufreq_cooling_device. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2017-05-27thermal: cpu_cooling: get_level() can't failViresh Kumar
The frequency passed to get_level() is returned by cpu_power_to_freq() and it is guaranteed that get_level() can't fail. Get rid of error code. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2017-05-27thermal: cpu_cooling: create structure for idle time statsViresh Kumar
We keep two arrays for idle time stats and allocate memory for them separately. It would be much easier to follow if we create an array of idle stats structure instead and allocate it once. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2017-05-27thermal: cpu_cooling: merge frequency and power tablesViresh Kumar
The cpu_cooling driver keeps two tables: - freq_table: table of frequencies in descending order, built from policy->freq_table. - power_table: table of frequencies and power in ascending order, built from OPP table. If the OPPs are used for the CPU device then both these tables are actually built using the OPP core and should have the same frequency entries. And there is no need to keep separate tables for this. Lets merge them both. Note that the new table is in descending order of frequencies and so the 'for' loops were required to be fixed at few places to make it work. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2017-05-27thermal: cpu_cooling: get rid of 'allowed_cpus'Viresh Kumar
'allowed_cpus' is a copy of policy->related_cpus and can be replaced by it directly. At some places we are only concerned about online CPUs and policy->cpus can be used there. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2017-05-27thermal: cpu_cooling: OPPs are registered for all CPUsViresh Kumar
The OPPs are registered for all CPUs of a cpufreq policy now and we don't need to run the loop in build_dyn_power_table(). Just check for the policy->cpu and we should be fine. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2017-05-27thermal: cpu_cooling: store cpufreq policyViresh Kumar
The cpufreq policy can be used by the cpu_cooling driver, lets store it in the cpufreq_cooling_device structure. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2017-05-27cpufreq: create cpufreq_table_count_valid_entries()Viresh Kumar
We need such a routine at two places already, lets create one. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2017-05-27thermal: cpu_cooling: use cpufreq_policy to register cooling deviceViresh Kumar
The CPU cooling driver uses the cpufreq policy, to get clip_cpus, the frequency table, etc. Most of the callers of CPU cooling driver's registration routines have the cpufreq policy with them, but they only pass the policy->related_cpus cpumask. The __cpufreq_cooling_register() routine then gets the policy by itself and uses it. It would be much better if the callers can pass the policy instead directly. This also fixes a basic design flaw, where the policy can be freed while the CPU cooling driver is still active. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2017-05-27thermal: cpu_cooling: get rid of a variable in cpufreq_set_cur_state()Viresh Kumar
'cpu' is used at only one place and there is no need to keep a separate variable for it. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2017-05-27thermal: cpu_cooling: remove cpufreq_cooling_get_level()Viresh Kumar
There is only one user of cpufreq_cooling_get_level() and that already has pointer to the cpufreq_cdev structure. It can directly call get_level() instead and we can get rid of cpufreq_cooling_get_level(). Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2017-05-27thermal: cpu_cooling: replace cool_dev with cdevViresh Kumar
Objects of "struct thermal_cooling_device" are named a bit inconsistently. Lets use cdev everywhere. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2017-05-27thermal: cpu_cooling: Name cpufreq cooling devices as cpufreq_cdevViresh Kumar
Objects of "struct cpufreq_cooling_device" are named a bit inconsistently. Lets use cpufreq_cdev everywhere. Also note that the lists containing such devices is renamed similarly too. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2017-05-27thermal: cpu_cooling: rearrange globalsViresh Kumar
Just to make it look better. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2017-05-27thermal: cpu_cooling: Avoid accessing potentially freed structuresViresh Kumar
After the lock is dropped, it is possible that the cpufreq_dev gets freed before we call get_level() and that can cause kernel to crash. Drop the lock after we are done using the structure. Cc: 4.2+ <stable@vger.kernel.org> # 4.2+ Fixes: 02373d7c69b4 ("thermal: cpu_cooling: fix lockdep problems in cpu_cooling") Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2017-05-27net: phy: Relax error checking on sysfs_create_link()Florian Fainelli
Some Ethernet drivers will attach/connect to a PHY device before calling register_netdevice() which is responsible for calling netdev_register_kobject() which would do the network device's kobject initialization. In such a case, sysfs_create_link() would return -ENOENT because the network device's kobject is not ready yet, and we would fail to connect to the PHY device. In order to keep things simple and symetrical, we just take the success path as indicative of the ability to access the network device's kobject, and create the second link if that's the case. Fixes: 5568363f0cb3 ("net: phy: Create sysfs reciprocal links for attached_dev/phydev") Reported-by: Woojung Hung <Woojung.Huh@microchip.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-27net: dsa: mv88e6xxx: handle SERDES error appropriatelyVivien Didelot
mv88e6xxx_serdes_power returns an error, so no need to print an error message inside of it. Rather print it in its caller when the error is ignored, which is in the mv88e6xxx_port_disable void function. Catch and return its error in the counterpart mv88e6xxx_port_enable. Fixes: 04aca9938255 ("dsa: mv88e6xxx: Enable/Disable SERDES on port enable/disable") Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>