Commit Graph

640029 Commits

Author SHA1 Message Date
jianxin.pan
ed157e73ad defconfig: meson32: enable LOCKUP detector
PD#141217: enable LOCKUP detector for meson32

Change-Id: I2a70e7b29ddc12a720704a4edf5d6334802263a5
Signed-off-by: jianxin.pan <jianxin.pan@amlogic.com>
2017-08-03 10:21:17 +08:00
Hualing Chen
a27d8ad898 dvb: modify dvb-frontend
PD#147721: dvb: modify dvb-frontend some struct and add dvb dts

1. add dvbs dvbt info at frontend
2. add blind cmd
3. add dvb dts

Change-Id: I22ab5284e646a17ae060f229bcf7c27ee5b6211f
Signed-off-by: Hualing Chen <hualing.chen@amlogic.com>
2017-08-01 04:59:59 -07:00
Victor Wan
121ca50c57 Merge branch 'android-4.9' into amlogic-4.9-dev 2017-08-01 18:38:14 +08:00
Xuhua Zhang
b63832bae3 i2c: add i2c auto test and fix i2c clk error.
PD#146534: add i2c auto test and fix i2c clk error.

1. add i2c auto test function form 50KHZ to 3.4MHZ.
2. fix i2c clk distortion when the clk go beyond 1MHZ.
3. fix i2c clk distortion when the clk less than 100KHZ.
4. fit for i2c T_low/T_higt time standard.
5. reduce i2c error log.

Change-Id: I2bb5598684848478aa18349b87eaac5bcc44065d
Signed-off-by: Xuhua Zhang <xuhua.zhang@amlogic.com>
2017-07-31 23:31:42 -07:00
Rongjun Chen
6041ed31a0 wifi: fix iptable forward cmd issue[1/1]
PD#147462: add some iptabe nat support to fix android NatController
cmd issue

Change-Id: Ia2e8e4f14898c5e3c6b2e2b61007260ff74db193
Signed-off-by: Rongjun Chen <rongjun.chen@amlogic.com>
2017-07-31 22:58:38 -07:00
Jianxin Pan
fe0ed6cf13 Merge "lcd: enable clkree gate" into amlogic-4.9-dev 2017-07-31 05:22:19 -07:00
Weiming Liu
cc700864fe lcd: enable clkree gate
PD#146437: lcd: enable clktree gate

Change-Id: I9fcc1b37ec291a27a169092a129663fbdab5aefa
Signed-off-by: Weiming Liu <weiming.liu@amlogic.com>
2017-07-31 20:04:30 +08:00
Yixun Lan
7ec3e25cd7 defconfig: fix coldboot_done too long,reduce /dev/pty* devices
PD#148403: fix coldboot_done too long,reduce /dev/pty* devices

with this change, boot from android
needle:/ # dmesg | grep ueventd
[ 3.657267@2] init: Starting service 'ueventd'...
[ 3.662364@0] ueventd: ueventd started!
[ 4.364547@2] ueventd: Coldboot took 0.70s. // prevous 1.44s

Change-Id: Iedf6b530bffb3aa6411f538e1c0dadb611dc616e
Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
2017-07-31 04:05:59 -07:00
Yun Cai
3261541e35 clk: add mipi enable and bandgap gate
PD#146437: axg: add mipi enable and bandgap gate and
	update clkmsr for cts_encl_clk

Change-Id: If14ede7ab0a0b649879153cb1089bec04c7412b2
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
2017-07-31 10:24:30 +08:00
Jiamin Ma
d6950e214c unifykey: support both old and new unifykey format
PD#148057: for m8bb m200 platform, we have the latest linux kernel
and a relative old version uboot running on it. For some historic
resons, the unifykey data stored in emmc/nand has totally different
format, which means the key stored by old uboot cannot be fetched
out by new kernel. To solve this problem, we have to support both
the old and new unifykey dataformat in lasted kernel.

Change-Id: Ic70df6543466b345a5ff513bfaabfe4cfcf647ed
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
2017-07-28 19:52:52 +08:00
liangzhuo.xie
7a0943a42e dts: gxl: add p231 buildroot dts.
PD#147281: P231 4.9 add wpe-launcher and chromium

Change-Id: Iba74fce849e86f71742526e4a6cf6b999084b2dd
Signed-off-by: liangzhuo.xie <liangzhuo.xie@amlogic.com>
2017-07-28 04:13:19 -07:00
Jian Hu
72d840c8f7 pwm: fix kernel crash using spinlock_t lock
PD#148269: fix kernel panic when hibenating

1.Using mutex lock instead of spinlock_t lock.
2.Clk_prepare_enable might sleep could not use
  spinlock_t lock.
3.Add spinlock_t lock for clock_mux.
4.Panic message:
	BUG: sleeping function called from invalid context at
	kernel/locking/mutex.c:97
	in_atomic(): 1, irqs_disabled(): 128, pid: 2501, name: sh
	Preemption disabled at:[   69.935889@1] [<ffffff80097af728>]
	meson_pwm_apply+0x48/0x398

Change-Id: Ib2f42c4d757d1bb4bd8e4df0f90f7924be2fa799
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
2017-07-28 03:36:15 -07:00
Xing Wang
6df60b00fe audio: fix tdm audio format
PD#146334: audio: fix tdm bclk and fclk revert and skew issue

Change-Id: I1dcb6f8559b3c04a2ddbb7c13a6115001c249c18
Signed-off-by: Xing Wang <xing.wang@amlogic.com>
2017-07-28 01:37:43 -07:00
jianxin.pan
44275f73b1 defconfig: disable LOCKUP detect for meson32/64_defconfig
PD#138714: disable LOCKUP detect
-CONFIG_LOCKUP_DETECTOR=y
-CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y

Change-Id: I74df363b34e6a2fa95cd0aa30485fd941764be09
Signed-off-by: jianxin.pan <jianxin.pan@amlogic.com>
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
2017-07-28 14:36:58 +08:00
Yue Wang
817c44f524 usb: fix adb reboot panic.
PD#146539: usb: fix adb reboot panic.

Avoid kernel panic caused by race condition. For example,
1. In the ffs_epfile_io function, data buffer is allocated
for non-halt requests and the address of this buffer is
writed to usb controller registers.
2. After adb process be killed, data buffer is freed and
this memory is allocated for the other. But the address
is hold by the controller.
3. Adbd in PC is running. So, the controller receive the
data and write to this memory.
4. The value of this memory is modified by the controller.
This could cause the kernel panic.

To avoid this, during FunctionFS mount, we allocated the
data buffer for requests. And the memory resources has
been released in kill_sb.

Change-Id: Ie06fae8ce18ea553d71f4841458c3c3af096ff4b
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
2017-07-27 19:21:44 -07:00
Peipeng Zhao
cae7e74f50 audio: disable analog mic on board S400
PD#148261: disable analog mic on board S400
	because new mic board will not connnect analog mic
        if enable analog mic, it will generate much i2c error

Change-Id: I0bc63dcdb2b4dbf47b740266008529490bcac937
Signed-off-by: Peipeng Zhao <peipeng.zhao@amlogic.com>
2017-07-27 16:49:23 +08:00
Xing Wang
a9438f3f2c audio: resume tdm mclk for revA
PD#147886: audio: resume tdm mclk for revA

Change-Id: I6365a9b218fd022ded746d183673f53ee70b6183
Signed-off-by: Xing Wang <xing.wang@amlogic.com>
2017-07-26 01:55:35 -07:00
Jian Hu
26fe46381c wifi: appending wifi dts
PD#146172: wifi: appending wifi dts

Change-Id: I0d208bda96192d6198e7cf959abb0dce6fe96a5f
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
2017-07-25 19:22:17 -07:00
Yue Wang
baf42f6dbb pcie: fix pcie power on timing.
PD#147564: pcie: fix pxie power on timing.

Change-Id: I28d39f0ed030f8886adecc9b575540c0ffc13716
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
2017-07-25 02:38:01 -07:00
Weiming Liu
043ff0471e bl: update bl_pwm driver to adjust new api
PD#146172: bl: update bl_pwm driver to adjust new api

Change-Id: I8f1fa55e7276424086fe4f4e9dc011ccaa259740
Signed-off-by: Weiming Liu <weiming.liu@amlogic.com>
2017-07-24 22:24:38 -07:00
Qiufang Dai
1106482a52 PM/sleep: fine-tune meson legacy early_suspend/late_resume flow
PD#147988: PM / sleep: meson: fine-tune legacy early_suspend/late_resume flow
1. early_suspend/late_resume could be call via sysfs or pm notify.
2. enable remote wakesource irq for wakeup freeze mode.

Change-Id: Ic667e19b9262af2a2a5c3534bd3ab4e240a868be
Signed-off-by: Qiufang Dai <qiufang.dai@amlogic.com>
2017-07-24 19:11:44 -07:00
Shuai Li
00696a0ddc audio: fix dai-link multi-codec confs issue [1/1]
PD#147919: If more than one dai-link configure the codec prefix name,
tinymix shows only the last dai-link codec which has prefix-names.

This fix adds a for-loop to realloc confs for each dai-link setting.
Thus every prefix name will show in tinymix.

Change-Id: I347328a3329eb2bdba0e0b7e2295c75c8f3ec1e8
Signed-off-by: Shuai Li <shuai.li@amlogic.com>
2017-07-22 08:44:58 -07:00
Jian Hu
9875a0281d pwm: add new pwm driver initially
PD#146172: pwm: add new pwm driver

1.Reference to upstream, add meson pwm driver initially.
2.pwm driver Verify passed on axg.
3.config for wifi 32k using latest driver.
4.wifi 32k verified on gxl/gxm/axg.

Change-Id: Ie602c879cf348c979d6783f1b295574c2fd782f2
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
2017-07-21 01:13:44 -07:00
xingyu.chen
b6397a5f59 saradc/adc_keypad: reduce the probability bl30 fail to get race flag
PD#146381: saradc/adc_keypad: reduce the probability bl30 fail to get race flag

1. unify the way to obtain race flag with bl30
2. replace the irq mode with polling mode
3. delay adc key scan time by 25ms

Change-Id: If072ee0a0a62c55e9c671baee0d25d1647e29ad9
Signed-off-by: xingyu.chen <xingyu.chen@amlogic.com>
2017-07-21 00:31:18 -07:00
Jiyu Yang
b7a55c773f drm: dts include meson_drm
PD#147238: rm dep for ARCH_MESON, include meson_drm.dtsi

Change-Id: I08a973569d062338fc6084c55a765d08c2e6aaf5
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
2017-07-20 04:18:14 -07:00
Jiyu Yang
340d8a0cba drm: add drm support
PD#147238: drm tempoperily bringup on 4.9

Change-Id: I3fa93b57404445985f5f3380f9b9a64161ff720a
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
2017-07-20 19:12:59 +08:00
Neil Armstrong
4a8833fdc5 drm/meson: Fix plane atomic check when no crtc for the plane
PD#147238: enable DRM driver on kernel 4.9
When no CRTC is associated with the plane, the meson_plane_atomic_check()
call breaks the kernel with an Oops.

Change-Id: I9d31c405316460420c0ed56dfcb0fc4ef6f86938
Fixes: bbbe775ec5 ("drm: Add support for Amlogic Meson Graphic Controller")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-07-20 02:26:25 -07:00
Neil Armstrong
489d1291f2 drm/meson: Fix CVBS initialization when HDMI is configured by bootloader
PD#147238: enable DRM driver on kernel 4.9
When the HDMI output is configured by the bootloader, there is mismatch is the
pipeline configuration and the Vsync interrupt fails to trigger.

This commit disables the HDMI blocks in the probe phase.

Change-Id: Ibf7b6384e9d34f790bd87a5e6f34a93a2d274d7c
Fixes: bbbe775ec5 ("drm: Add support for Amlogic Meson Graphic Controller")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-07-20 02:08:56 -07:00
Neil Armstrong
1e10e99d7c drm/meson: Fix CVBS VDAC disable
PD#147238: enable DRM driver on kernel 4.9
This commit fixes the VDAC disabling register write values.

Change-Id: I5534a15e52730ee2a5b54d1aa82bbe59c2e01b50
Fixes: bbbe775ec5 ("drm: Add support for Amlogic Meson Graphic Controller")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-07-20 00:03:50 -07:00
Neil Armstrong
f3f89bcca8 drm: Add support for Amlogic Meson Graphic Controller
PD#147238: enable DRM driver on kernel 4.9
The Amlogic Meson Display controller is composed of several components :

DMC|---------------VPU (Video Processing Unit)----------------|------HHI------|
   | vd1   _______     _____________    _________________     |               |
D  |-------|      |----|            |   |                |    |   HDMI PLL    |
D  | vd2   | VIU  |    | Video Post |   | Video Encoders |<---|-----VCLK      |
R  |-------|      |----| Processing |   |                |    |               |
   | osd2  |      |    |            |---| Enci ----------|----|-----VDAC------|
R  |-------| CSC  |----| Scalers    |   | Encp ----------|----|----HDMI-TX----|
A  | osd1  |      |    | Blenders   |   | Encl ----------|----|---------------|
M  |-------|______|----|____________|   |________________|    |               |
___|__________________________________________________________|_______________|

VIU: Video Input Unit
---------------------

The Video Input Unit is in charge of the pixel scanout from the DDR memory.
It fetches the frames addresses, stride and parameters from the "Canvas" memory.
This part is also in charge of the CSC (Colorspace Conversion).
It can handle 2 OSD Planes and 2 Video Planes.

VPP: Video Post Processing
--------------------------

The Video Post Processing is in charge of the scaling and blending of the
various planes into a single pixel stream.
There is a special "pre-blending" used by the video planes with a dedicated
scaler and a "post-blending" to merge with the OSD Planes.
The OSD planes also have a dedicated scaler for one of the OSD.

VENC: Video Encoders
--------------------

The VENC is composed of the multiple pixel encoders :
 - ENCI : Interlace Video encoder for CVBS and Interlace HDMI
 - ENCP : Progressive Video Encoder for HDMI
 - ENCL : LCD LVDS Encoder
The VENC Unit gets a Pixel Clocks (VCLK) from a dedicated HDMI PLL and clock
tree and provides the scanout clock to the VPP and VIU.
The ENCI is connected to a single VDAC for Composite Output.
The ENCI and ENCP are connected to an on-chip HDMI Transceiver.

This driver is a DRM/KMS driver using the following DRM components :
 - GEM-CMA
 - PRIME-CMA
 - Atomic Modesetting
 - FBDev-CMA

For the following SoCs :
 - GXBB Family (S905)
 - GXL Family (S905X, S905D)
 - GXM Family (S912)

The current driver only supports the CVBS PAL/NTSC output modes, but the
CRTC/Planes management should support bigger modes.
But Advanced Colorspace Conversion, Scaling and HDMI Modes will be added in
a second time.

The Device Tree bindings makes use of the endpoints video interface definitions
to connect to the optional CVBS and in the future the HDMI Connector nodes.

HDMI Support is planned for a next release.

Change-Id: I72d50f54b4e7ab73d447cf664e959a3c43e58809
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-07-19 23:54:27 -07:00
Jiamin Ma
485b80c106 configs: disable hardlockup
PD#138714: disable hardlockup

Change-Id: I0b10bfdc65b0a99b8a9fe213b274cacfd16110f7
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
2017-07-19 23:28:23 -07:00
Neil Armstrong
a1c56e75b3 dt-bindings: display: add Amlogic Meson DRM Bindings
PD#147238: enable DRM driver on Kernel4.9

Change-Id: I5a7e60857384de6690a08cc496163377c0b26b7a
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-07-19 23:18:48 -07:00
Victor Wan
c97a98830a Merge branch 'android-4.9' into amlogic-4.9-dev 2017-07-19 23:20:20 +08:00
Qiufang Dai
743c337830 clk: axg: fine-tune pll set_rate op [1/1]
PD#146411: if set_rate target rate equal to old rate, just skip.

Change-Id: I945fdf6f72c5fccc6e0e701fe8f50fba8458d99f
Signed-off-by: Qiufang Dai <qiufang.dai@amlogic.com>
2017-07-19 17:17:05 +08:00
Colin Cross
833babb39f Add BINDER_GET_NODE_DEBUG_INFO ioctl
The BINDER_GET_NODE_DEBUG_INFO ioctl will return debug info on
a node.  Each successive call reusing the previous return value
will return the next node.  The data will be used by
libmemunreachable to mark the pointers with kernel references
as reachable.

Bug: 28275695
Change-Id: Idbbafa648a33822dc023862cd92b51a595cf7c1c
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Martijn Coenen <maco@android.com>
2017-07-19 10:35:09 +02:00
Martijn Coenen
c46810c235 ANDROID: binder: add RT inheritance flag to node.
Allows a binder node to specify whether it wants to
inherit real-time scheduling policy from a caller.

Change-Id: I375b6094bf441c19f19cba06d5a6be02cd07d714
Signed-off-by: Martijn Coenen <maco@android.com>
2017-07-19 10:12:53 +02:00
Martijn Coenen
07a30fe025 ANDROID: binder: improve priority inheritance.
By raising the priority of a thread selected for
a transaction *before* we wake it up.

Delay restoring the priority when doing a reply
until after we wake-up the process receiving
the reply.

Change-Id: Ic332e4e0ed7d2d3ca6ab1034da4629c9eadd3405
Signed-off-by: Martijn Coenen <maco@google.com>
2017-07-19 10:12:52 +02:00
Martijn Coenen
6aac9798d8 ANDROID: binder: add min sched_policy to node.
This change adds flags to flat_binder_object.flags
to allow indicating a minimum scheduling policy for
the node. It also clarifies the valid value range
for the priority bits in the flags.

Internally, we use the priority map that the kernel
uses, e.g. [0..99] for real-time policies and [100..139]
for the SCHED_NORMAL/SCHED_BATCH policies.

Bug: 34461621
Bug: 37293077
Change-Id: I12438deecb53df432da18c6fc77460768ae726d2
Signed-off-by: Martijn Coenen <maco@google.com>
2017-07-19 10:12:52 +02:00
Martijn Coenen
57b2ac6c8e ANDROID: binder: add support for RT prio inheritance.
Adds support for SCHED_BATCH/SCHED_FIFO/SCHED_RR
priority inheritance.

Change-Id: I71f356e476be2933713a0ecfa2cc31aa141e2dc6
Signed-off-by: Martijn Coenen <maco@google.com>
2017-07-19 10:12:51 +02:00
Martijn Coenen
053be42dee ANDROID: binder: push new transactions to waiting threads.
Instead of pushing new transactions to the process
waitqueue, select a thread that is waiting on proc
work to handle the transaction. This will make it
easier to improve priority inheritance in future
patches, by setting the priority before we wake up
a thread.

If we can't find a waiting thread, submit the work
to the proc waitqueue instead as we did previously.

Change-Id: I23cbfcca867bed7b86007e22137d0a8fad4b4001
Signed-off-by: Martijn Coenen <maco@google.com>
2017-07-19 10:12:51 +02:00
Martijn Coenen
22d64e432c ANDROID: binder: remove proc waitqueue
Removes the process waitqueue, so that threads
can only wait on the thread waitqueue. Whenever
there is process work to do, pick a thread and
wake it up.

This also fixes an issue with using epoll(),
since we no longer have to block on different
waitqueues.

Bug: 34461621
Change-Id: I2950b9de6fa078ee72d53c667a03cbaf587f0849
Signed-off-by: Martijn Coenen <maco@google.com>
2017-07-19 10:12:50 +02:00
Lianghu Su
229c49d71f PD#147376: fix hdmitx extcon NULL pointer error.
Change-Id: Idabf1f61f4b264115ecdbf147715cbed3c938df1
Signed-off-by: Lianghu Su <lianghu.su@amlogic.com>
2017-07-18 03:04:09 -07:00
Xing Wang
7f841659f4 audio: add loopback
PD#147538: audio: loopback for pdm/spdif/tdm

1. pdm/spdif/tdm as loopback datain soruce, tdmin_lb as datalb source
2. add mixer kcontrols for loopback

Change-Id: I579db913080b3bb02bc99885eb330e24af8a0edb
Signed-off-by: Xing Wang <xing.wang@amlogic.com>
2017-07-16 21:24:33 -07:00
Xing Wang
826fba96f2 audio: pdm dclk support 3.072m/1.024m/768k
PD#147320: audio: pdm dclk support 3.072m/1.024m/768k

Change-Id: I3904fa73fed7c91bf7f709317e211053cf4bb9b2
Signed-off-by: Xing Wang <xing.wang@amlogic.com>
2017-07-16 20:53:28 -07:00
Greg Kroah-Hartman
3f353c3ed4 Merge 4.9.38 into android-4.9
Changes in 4.9.38
	mqueue: fix a use-after-free in sys_mq_notify()
	Add "shutdown" to "struct class".
	tpm: Issue a TPM2_Shutdown for TPM2 devices.
	tools include: Add a __fallthrough statement
	tools string: Use __fallthrough in perf_atoll()
	tools strfilter: Use __fallthrough
	perf top: Use __fallthrough
	perf thread_map: Correctly size buffer used with dirent->dt_name
	perf intel-pt: Use __fallthrough
	perf tests: Avoid possible truncation with dirent->d_name + snprintf
	perf bench numa: Avoid possible truncation when using snprintf()
	perf header: Fix handling of PERF_EVENT_UPDATE__SCALE
	perf scripting perl: Fix compile error with some perl5 versions
	perf probe: Fix to probe on gcc generated symbols for offline kernel
	perf probe: Add error checks to offline probe post-processing
	md: fix incorrect use of lexx_to_cpu in does_sb_need_changing
	md: fix super_offset endianness in super_1_rdev_size_change
	locking/rwsem-spinlock: Fix EINTR branch in __down_write_common()
	staging: vt6556: vnt_start Fix missing call to vnt_key_init_table.
	staging: comedi: fix clean-up of comedi_class in comedi_init()
	crypto: caam - fix gfp allocation flags (part I)
	crypto: rsa-pkcs1pad - use constant time memory comparison for MACs
	ext4: check return value of kstrtoull correctly in reserved_clusters_store
	x86/mm/pat: Don't report PAT on CPUs that don't support it
	saa7134: fix warm Medion 7134 EEPROM read
	Linux 4.9.38

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2017-07-15 13:31:27 +02:00
Greg Kroah-Hartman
f0cd77ded5 Linux 4.9.38 2017-07-15 12:17:55 +02:00
Maciej S. Szmigiero
fb2dc28cf2 saa7134: fix warm Medion 7134 EEPROM read
commit 5a91206ff0 upstream.

When saa7134 module driving a Medion 7134 card is reloaded reads of this
card EEPROM (required for automatic detection of tuner model) will be
corrupted due to I2C gate in DVB-T demod being left closed.
This sometimes also happens on first saa7134 module load after a warm
reboot.

Fix this by opening this I2C gate before doing EEPROM read during i2c
initialization.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Cc: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-15 12:16:17 +02:00
Mikulas Patocka
81ba752aa4 x86/mm/pat: Don't report PAT on CPUs that don't support it
commit 99c13b8c88 upstream.

The pat_enabled() logic is broken on CPUs which do not support PAT and
where the initialization code fails to call pat_init(). Due to that the
enabled flag stays true and pat_enabled() returns true wrongfully.

As a consequence the mappings, e.g. for Xorg, are set up with the wrong
caching mode and the required MTRR setups are omitted.

To cure this the following changes are required:

  1) Make pat_enabled() return true only if PAT initialization was
     invoked and successful.

  2) Invoke init_cache_modes() unconditionally in setup_arch() and
     remove the extra callsites in pat_disable() and the pat disabled
     code path in pat_init().

Also rename __pat_enabled to pat_disabled to reflect the real purpose of
this variable.

Fixes: 9cd25aac1f ("x86/mm/pat: Emulate PAT when it is disabled")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Bernhard Held <berny156@gmx.de>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: "Luis R. Rodriguez" <mcgrof@suse.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/alpine.LRH.2.02.1707041749300.3456@file01.intranet.prod.int.rdu2.redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-15 12:16:17 +02:00
Chao Yu
c0d3a7bdc7 ext4: check return value of kstrtoull correctly in reserved_clusters_store
commit 1ea1516fbb upstream.

kstrtoull returns 0 on success, however, in reserved_clusters_store we
will return -EINVAL if kstrtoull returns 0, it makes us fail to update
reserved_clusters value through sysfs.

Fixes: 76d33bca55
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Miao Xie <miaoxie@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-15 12:16:16 +02:00
Jason A. Donenfeld
716986547f crypto: rsa-pkcs1pad - use constant time memory comparison for MACs
commit fec17cb223 upstream.

Otherwise, we enable all sorts of forgeries via timing attack.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Suggested-by: Stephan Müller <smueller@chronox.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-15 12:16:16 +02:00