On Fri, Feb 23, 2018 at 06:29:02PM +0000, Ard Biesheuvel wrote:
> Stable backport commit 173358a49173 ("arm64: kpti: Add ->enable callback
> to remap swapper using nG mappings") of upstream commit f992b4dfd58b did
> not survive the backporting process unscathed, and ends up writing garbage
> into the TTBR1_EL1 register, rather than pointing it to the zero page to
> disable translations. Fix that.
>
> Cc: <stable(a)vger.kernel.org> #v4.14
> Reported-by: Nicolas Dechesne <nicolas.dechesne(a)linaro.org>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel(a)linaro.org>
> ---
> arch/arm64/mm/proc.S | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Any reason why you didn't cc: the stable list, as this is a patch that
is not needed in mainline, right?
> diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S
> index 08572f95bd8a..2b473ddeb7a3 100644
> --- a/arch/arm64/mm/proc.S
> +++ b/arch/arm64/mm/proc.S
> @@ -155,7 +155,7 @@ ENDPROC(cpu_do_switch_mm)
>
> .macro __idmap_cpu_set_reserved_ttbr1, tmp1, tmp2
> adrp \tmp1, empty_zero_page
> - msr ttbr1_el1, \tmp2
> + msr ttbr1_el1, \tmp1
I don't understand why this isn't also needed in Linus's tree. What
commit there prevents this from being required?
thanks,
greg k-h
This is a note to let you know that I've just added the patch titled
vsprintf: avoid misleading "(null)" for %px
to the 4.15-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
vsprintf-avoid-misleading-null-for-px.patch
and it can be found in the queue-4.15 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From 3a129cc2151425e5aeb69aeb25fbc994ec738137 Mon Sep 17 00:00:00 2001
From: Adam Borowski <kilobyte(a)angband.pl>
Date: Sun, 4 Feb 2018 18:45:21 +0100
Subject: vsprintf: avoid misleading "(null)" for %px
From: Adam Borowski <kilobyte(a)angband.pl>
commit 3a129cc2151425e5aeb69aeb25fbc994ec738137 upstream.
Like %pK already does, print "00000000" instead.
This confused people -- the convention is that "(null)" means you tried to
dereference a null pointer as opposed to printing the address.
Link: http://lkml.kernel.org/r/20180204174521.21383-1-kilobyte@angband.pl
To: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>
To: Steven Rostedt <rostedt(a)goodmis.org>
To: linux-kernel(a)vger.kernel.org
Cc: Andrew Morton <akpm(a)linux-foundation.org>
Cc: Joe Perches <joe(a)perches.com>
Cc: Kees Cook <keescook(a)chromium.org>
Cc: "Roberts, William C" <william.c.roberts(a)intel.com>
Cc: Linus Torvalds <torvalds(a)linux-foundation.org>
Cc: David Laight <David.Laight(a)ACULAB.COM>
Cc: Randy Dunlap <rdunlap(a)infradead.org>
Cc: Geert Uytterhoeven <geert(a)linux-m68k.org>
Signed-off-by: Adam Borowski <kilobyte(a)angband.pl>
Signed-off-by: Petr Mladek <pmladek(a)suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
lib/vsprintf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1849,7 +1849,7 @@ char *pointer(const char *fmt, char *buf
{
const int default_width = 2 * sizeof(void *);
- if (!ptr && *fmt != 'K') {
+ if (!ptr && *fmt != 'K' && *fmt != 'x') {
/*
* Print (null) with the same width as a pointer so it makes
* tabular output look nice.
Patches currently in stable-queue which might be from kilobyte(a)angband.pl are
queue-4.15/vsprintf-avoid-misleading-null-for-px.patch
Hi,
Please include 3a129cc21514 ("vsprintf: avoid misleading "(null)" for
%px") in the 4.15 stable tree. That patch should have had these
fields:
Fixes: 668533dc0764 ("kallsyms: take advantage of the new '%px' format")
Cc: stable(a)vger.kernel.org
But I didn't notice when it went by originally. (Thanks to Steve for
pointing this out as being missed for 4.15.) :)
Thanks!
-Kees
--
Kees Cook
Pixel Security
This is a note to let you know that I've just added the patch titled
ipv6: Skip XFRM lookup if dst_entry in socket cache is valid
to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
ipv6-skip-xfrm-lookup-if-dst_entry-in-socket-cache-is-valid.patch
and it can be found in the queue-3.18 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From 00bc0ef5880dc7b82f9c320dead4afaad48e47be Mon Sep 17 00:00:00 2001
From: Jakub Sitnicki <jkbs(a)redhat.com>
Date: Wed, 8 Jun 2016 15:13:34 +0200
Subject: ipv6: Skip XFRM lookup if dst_entry in socket cache is valid
From: Jakub Sitnicki <jkbs(a)redhat.com>
commit 00bc0ef5880dc7b82f9c320dead4afaad48e47be upstream.
At present we perform an xfrm_lookup() for each UDPv6 message we
send. The lookup involves querying the flow cache (flow_cache_lookup)
and, in case of a cache miss, creating an XFRM bundle.
If we miss the flow cache, we can end up creating a new bundle and
deriving the path MTU (xfrm_init_pmtu) from on an already transformed
dst_entry, which we pass from the socket cache (sk->sk_dst_cache) down
to xfrm_lookup(). This can happen only if we're caching the dst_entry
in the socket, that is when we're using a connected UDP socket.
To put it another way, the path MTU shrinks each time we miss the flow
cache, which later on leads to incorrectly fragmented payload. It can
be observed with ESPv6 in transport mode:
1) Set up a transformation and lower the MTU to trigger fragmentation
# ip xfrm policy add dir out src ::1 dst ::1 \
tmpl src ::1 dst ::1 proto esp spi 1
# ip xfrm state add src ::1 dst ::1 \
proto esp spi 1 enc 'aes' 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
# ip link set dev lo mtu 1500
2) Monitor the packet flow and set up an UDP sink
# tcpdump -ni lo -ttt &
# socat udp6-listen:12345,fork /dev/null &
3) Send a datagram that needs fragmentation with a connected socket
# perl -e 'print "@" x 1470 | socat - udp6:[::1]:12345
2016/06/07 18:52:52 socat[724] E read(3, 0x555bb3d5ba00, 8192): Protocol error
00:00:00.000000 IP6 ::1 > ::1: frag (0|1448) ESP(spi=0x00000001,seq=0x2), length 1448
00:00:00.000014 IP6 ::1 > ::1: frag (1448|32)
00:00:00.000050 IP6 ::1 > ::1: ESP(spi=0x00000001,seq=0x3), length 1272
(^ ICMPv6 Parameter Problem)
00:00:00.000022 IP6 ::1 > ::1: ESP(spi=0x00000001,seq=0x5), length 136
4) Compare it to a non-connected socket
# perl -e 'print "@" x 1500' | socat - udp6-sendto:[::1]:12345
00:00:40.535488 IP6 ::1 > ::1: frag (0|1448) ESP(spi=0x00000001,seq=0x6), length 1448
00:00:00.000010 IP6 ::1 > ::1: frag (1448|64)
What happens in step (3) is:
1) when connecting the socket in __ip6_datagram_connect(), we
perform an XFRM lookup, miss the flow cache, create an XFRM
bundle, and cache the destination,
2) afterwards, when sending the datagram, we perform an XFRM lookup,
again, miss the flow cache (due to mismatch of flowi6_iif and
flowi6_oif, which is an issue of its own), and recreate an XFRM
bundle based on the cached (and already transformed) destination.
To prevent the recreation of an XFRM bundle, avoid an XFRM lookup
altogether whenever we already have a destination entry cached in the
socket. This prevents the path MTU shrinkage and brings us on par with
UDPv4.
The fix also benefits connected PINGv6 sockets, another user of
ip6_sk_dst_lookup_flow(), who also suffer messages being transformed
twice.
Joint work with Hannes Frederic Sowa.
Reported-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Jakub Sitnicki <jkbs(a)redhat.com>
Acked-by: Hannes Frederic Sowa <hannes(a)stressinduktion.org>
Signed-off-by: David S. Miller <davem(a)davemloft.net>
Signed-off-by: Benedict Wong <benedictwong(a)google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
net/ipv6/ip6_output.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1038,17 +1038,12 @@ struct dst_entry *ip6_sk_dst_lookup_flow
const struct in6_addr *final_dst)
{
struct dst_entry *dst = sk_dst_check(sk, inet6_sk(sk)->dst_cookie);
- int err;
dst = ip6_sk_dst_check(sk, dst, fl6);
+ if (!dst)
+ dst = ip6_dst_lookup_flow(sk, fl6, final_dst);
- err = ip6_dst_lookup_tail(sk, &dst, fl6);
- if (err)
- return ERR_PTR(err);
- if (final_dst)
- fl6->daddr = *final_dst;
-
- return xfrm_lookup_route(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0);
+ return dst;
}
EXPORT_SYMBOL_GPL(ip6_sk_dst_lookup_flow);
Patches currently in stable-queue which might be from jkbs(a)redhat.com are
queue-3.18/ipv6-skip-xfrm-lookup-if-dst_entry-in-socket-cache-is-valid.patch
This is the start of the stable review cycle for the 4.14.23 release.
There are 54 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 me know.
Responses should be made by Wed Feb 28 20:21:22 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.14.23-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.14.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.14.23-rc1
Chris Wilson <chris(a)chris-wilson.co.uk>
drm/i915/breadcrumbs: Ignore unsubmitted signalers
Kai-Heng Feng <kai.heng.feng(a)canonical.com>
drm/amdgpu: add new device to use atpx quirk
Alex Deucher <alexander.deucher(a)amd.com>
drm/amdgpu: Avoid leaking PM domain on driver unbind (v2)
Alex Deucher <alexander.deucher(a)amd.com>
drm/amdgpu: add atpx quirk handling (v2)
Alex Deucher <alexander.deucher(a)amd.com>
drm/amdgpu: only check mmBIF_IOV_FUNC_IDENTIFIER on tonga/fiji
Alex Deucher <alexander.deucher(a)amd.com>
drm/amdgpu: Add dpm quirk for Jet PRO (v2)
Huang Rui <ray.huang(a)amd.com>
drm/amdgpu: disable MMHUB power gating on raven
Chris Wilson <chris(a)chris-wilson.co.uk>
drm: Handle unexpected holes in color-eviction
Daniel Vetter <daniel.vetter(a)ffwll.ch>
drm/cirrus: Load lut in crtc_commit
Yoshihiro Shimoda <yoshihiro.shimoda.uh(a)renesas.com>
usb: renesas_usbhs: missed the "running" flag in usb_dmac with rx path
Jack Pham <jackp(a)codeaurora.org>
usb: gadget: f_fs: Use config_ep_by_speed()
Jack Pham <jackp(a)codeaurora.org>
usb: gadget: f_fs: Process all descriptors during bind
Bin Liu <b-liu(a)ti.com>
Revert "usb: musb: host: don't start next rx urb if current one failed"
Karsten Koop <kkoop(a)ld-didactic.de>
usb: ldusb: add PIDs for new CASSY devices supported by this driver
Thinh Nguyen <Thinh.Nguyen(a)synopsys.com>
usb: dwc3: ep0: Reset TRB counter for ep0 IN
Thinh Nguyen <Thinh.Nguyen(a)synopsys.com>
usb: dwc3: gadget: Set maxpacket size for ep0 IN
Peter Chen <hzpeterchen(a)gmail.com>
usb: host: ehci: use correct device pointer for dma ops
Kai-Heng Feng <kai.heng.feng(a)canonical.com>
drm/edid: Add 6 bpc quirk for CPT panel in Asus UX303LA
Jack Stocker <jackstocker.93(a)gmail.com>
Add delay-init quirk for Corsair K70 RGB keyboards
Will Deacon <will.deacon(a)arm.com>
arm64: cpufeature: Fix CTR_EL0 field definitions
Michael Weiser <michael.weiser(a)gmx.de>
arm64: Disable unhandled signal log messages by default
Michael Weiser <michael.weiser(a)gmx.de>
arm64: Remove unimplemented syscall log message
AMAN DEEP <aman.deep(a)samsung.com>
usb: ohci: Proper handling of ed_rm_list to handle race condition between usb_kill_urb() and finish_unlinks()
Shigeru Yoshida <shigeru.yoshida(a)windriver.com>
ohci-hcd: Fix race condition caused by ohci_urb_enqueue() and io_watchdog_func()
Casey Leedom <leedom(a)chelsio.com>
PCI/cxgb4: Extend T3 PCI quirk to T4+ devices
Matt Redfearn <matt.redfearn(a)mips.com>
irqchip/mips-gic: Avoid spuriously handling masked interrupts
Shanker Donthineni <shankerd(a)codeaurora.org>
irqchip/gic-v3: Use wmb() instead of smb_wmb() in gic_raise_softirq()
Huang Ying <huang.ying.caritas(a)gmail.com>
mm, swap, frontswap: fix THP swap if frontswap enabled
Arnd Bergmann <arnd(a)arndb.de>
x86/oprofile: Fix bogus GCC-8 warning in nmi_setup()
Arnd Bergmann <arnd(a)arndb.de>
Kbuild: always define endianess in kconfig.h
Lars-Peter Clausen <lars(a)metafoo.de>
iio: adis_lib: Initialize trigger before requesting interrupt
Stefan Windfeldt-Prytz <stefan.windfeldt(a)axis.com>
iio: buffer: check if a buffer has been set up when poll is called
Andreas Klinger <ak(a)it-klinger.de>
iio: srf08: fix link error "devm_iio_triggered_buffer_setup" undefined
Fabrice Gasnier <fabrice.gasnier(a)st.com>
iio: adc: stm32: fix stm32h7_adc_enable error handling
Leon Romanovsky <leonro(a)mellanox.com>
RDMA/uverbs: Sanitize user entered port numbers prior to access it
Leon Romanovsky <leonro(a)mellanox.com>
RDMA/uverbs: Fix circular locking dependency
Leon Romanovsky <leonro(a)mellanox.com>
RDMA/uverbs: Fix bad unlock balance in ib_uverbs_close_xrcd
Leon Romanovsky <leonro(a)mellanox.com>
RDMA/uverbs: Protect from command mask overflow
Leon Romanovsky <leonro(a)mellanox.com>
RDMA/uverbs: Protect from races between lookup and destroy of uobjects
Hans de Goede <hdegoede(a)redhat.com>
extcon: int3496: process id-pin first so that we start with the right status
Eric Biggers <ebiggers(a)google.com>
PKCS#7: fix certificate blacklisting
Eric Biggers <ebiggers(a)google.com>
PKCS#7: fix certificate chain verification
Eric Biggers <ebiggers(a)google.com>
X.509: fix NULL dereference when restricting key with unsupported_sig
Eric Biggers <ebiggers(a)google.com>
X.509: fix BUG_ON() when hash algorithm is unsupported
Eric Anholt <eric(a)anholt.net>
i2c: bcm2835: Set up the rising/falling edge delays
Ben Gardner <gardner.ben(a)gmail.com>
i2c: designware: must wait for enable
Arnd Bergmann <arnd(a)arndb.de>
cfg80211: fix cfg80211_beacon_dup
James Hogan <jhogan(a)kernel.org>
MIPS: Drop spurious __unused in struct compat_flock
Tyrel Datwyler <tyreld(a)linux.vnet.ibm.com>
scsi: ibmvfc: fix misdefined reserved field in ibmvfc_fcp_rsp_info
Max Filippov <jcmvbkbc(a)gmail.com>
xtensa: fix high memory/reserved memory collision
Kees Cook <keescook(a)chromium.org>
MIPS: boot: Define __ASSEMBLY__ for its.S build
Kees Cook <keescook(a)chromium.org>
kconfig.h: Include compiler types to avoid missed struct attributes
Ard Biesheuvel <ard.biesheuvel(a)linaro.org>
arm64: mm: don't write garbage into TTBR1_EL1 register
Paolo Abeni <pabeni(a)redhat.com>
netfilter: drop outermost socket lock in getsockopt()
-------------
Diffstat:
Makefile | 4 +-
arch/arm64/kernel/cpufeature.c | 6 +-
arch/arm64/kernel/traps.c | 10 +---
arch/arm64/mm/proc.S | 2 +-
arch/mips/boot/Makefile | 1 +
arch/mips/include/asm/compat.h | 1 -
arch/x86/oprofile/nmi_int.c | 2 +-
arch/xtensa/mm/init.c | 70 +++++++++++++++++++++---
crypto/asymmetric_keys/pkcs7_verify.c | 12 ++--
crypto/asymmetric_keys/public_key.c | 4 +-
crypto/asymmetric_keys/restrict.c | 21 ++++---
drivers/extcon/extcon-intel-int3496.c | 3 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 58 +++++++++++++++++---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 -
drivers/gpu/drm/amd/amdgpu/si_dpm.c | 5 ++
drivers/gpu/drm/amd/amdgpu/soc15.c | 4 +-
drivers/gpu/drm/amd/amdgpu/vi.c | 21 ++++---
drivers/gpu/drm/cirrus/cirrus_mode.c | 40 ++++++++------
drivers/gpu/drm/drm_edid.c | 3 +
drivers/gpu/drm/drm_mm.c | 21 ++++++-
drivers/gpu/drm/i915/intel_breadcrumbs.c | 29 ++++------
drivers/hid/hid-core.c | 3 +
drivers/hid/hid-ids.h | 3 +
drivers/i2c/busses/i2c-bcm2835.c | 21 ++++++-
drivers/i2c/busses/i2c-designware-master.c | 2 +-
drivers/iio/adc/stm32-adc.c | 7 ++-
drivers/iio/imu/adis_trigger.c | 7 ++-
drivers/iio/industrialio-buffer.c | 2 +-
drivers/iio/proximity/Kconfig | 2 +
drivers/infiniband/core/rdma_core.c | 10 +++-
drivers/infiniband/core/uverbs_cmd.c | 16 ++++--
drivers/infiniband/core/uverbs_main.c | 27 ++++++---
drivers/irqchip/irq-gic-v3.c | 2 +-
drivers/irqchip/irq-mips-gic.c | 2 -
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 10 ----
drivers/pci/quirks.c | 39 +++++++------
drivers/scsi/ibmvscsi/ibmvfc.h | 2 +-
drivers/usb/core/quirks.c | 3 +
drivers/usb/dwc3/ep0.c | 7 ++-
drivers/usb/dwc3/gadget.c | 2 +
drivers/usb/gadget/function/f_fs.c | 44 +++------------
drivers/usb/host/ehci-hub.c | 4 +-
drivers/usb/host/ohci-hcd.c | 10 +++-
drivers/usb/host/ohci-hub.c | 4 +-
drivers/usb/host/ohci-q.c | 17 +++---
drivers/usb/misc/ldusb.c | 6 ++
drivers/usb/musb/musb_host.c | 8 +--
drivers/usb/renesas_usbhs/fifo.c | 5 ++
drivers/xen/tmem.c | 4 ++
include/linux/kconfig.h | 9 +++
mm/zswap.c | 6 ++
net/ipv4/ip_sockglue.c | 7 +--
net/ipv6/ipv6_sockglue.c | 10 +---
net/mac80211/cfg.c | 2 +-
54 files changed, 403 insertions(+), 219 deletions(-)
On 2/27/18 7:57 AM, Mark Brown wrote:
> On Tue, Feb 27, 2018 at 07:13:17AM -0800, Pierre-Louis Bossart wrote:
>> On 2/27/18 2:38 AM, Mark Brown wrote:
>>> On Mon, Feb 26, 2018 at 06:30:15PM -0800, Pierre-Louis Bossart wrote:
>
>>>> This issue was found during the development of SOF (Sound Open Firmware)
>>>> where we get the reverse of the intended behavior when using the same
>>>> conventions in topology files as in machine drivers.
>
>>> Is this perhaps something that the earlier firmware is handling inside
>>> the firmware?
>
>> For SKL+ the SSP settings come from binary blobs read from ACPI/NHLT tables
>> so I am wondering if this inversion is compensated for in the tools used to
>> generate the blobs.
>
> Ugh, I'm confused here. Is this a case of SoF differing from the
> regular firmware somehow - presumably the stuff coming from the NHLT
> table is the same for both firmwares?
no we are not using the NHLT info for now but using the one provided in
topology files. the SOF firmware does not rely on blobs but programs the
registers based on masks and settings passed. This difference is
precisely how we exposed a difference in behavior.
Hi All,
This backport patchset fixed the spectre issue, it's original branch:
https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/log/?h=kpti
A few dependency or fixingpatches are also picked up, if they are necessary
or no functional changes.
arm64: cpu_errata: Allow an erratum to be match for all revisions of a core
arm64: cpufeature: __this_cpu_has_cap() shouldn't stop early
arm64: syscallno is secretly an int, make it official
arm64: uaccess: consistently check object sizes
arm64: Factor out TTBR0_EL1 post-update workaround into a specific asm macro
arm64: Factor out PAN enabling/disabling into separate uaccess_* macros
arm64: move TASK_* definitions to <asm/processor.h>
arm64: alternatives: apply boot time fixups via the linear mapping
mm: Introduce lm_alias
The patchset also on repository:
git://git.linaro.org/kernel/linux-linaro-stable.git lts-4.9-spectrevv2
The kernelci.org and lkft testing show no regressions.
Any comments are appreciated!
Regards
Alex
---
Ard Biesheuvel <ard.biesheuvel(a)linaro.org> (1):
arm64: alternatives: apply boot time fixups via the linear mapping
Catalin Marinas <catalin.marinas(a)arm.com> (2):
arm64: Factor out PAN enabling/disabling into separate uaccess_* macros
arm64: Factor out TTBR0_EL1 post-update workaround into a specific asm macro
Dave Martin <Dave.Martin(a)arm.com> (1):
arm64: syscallno is secretly an int, make it official
James Morse <james.morse(a)arm.com> (1):
arm64: cpufeature: __this_cpu_has_cap() shouldn't stop early
Laura Abbott <labbott(a)redhat.com> (1):
mm: Introduce lm_alias
Marc Zyngier <marc.zyngier(a)arm.com> (26):
arm64: cpu_errata: Allow an erratum to be match for all revisions of a core
arm64: Move post_ttbr_update_workaround to C code
arm64: Move BP hardening to check_and_switch_context
arm64: KVM: Use per-CPU vector when BP hardening is enabled
arm64: KVM: Increment PC after handling an SMC trap
arm/arm64: KVM: Consolidate the PSCI include files
arm/arm64: KVM: Add PSCI_VERSION helper
arm/arm64: KVM: Add smccc accessors to PSCI code
arm/arm64: KVM: Implement PSCI 1.0 support
arm/arm64: KVM: Advertise SMCCC v1.1
arm64: KVM: Make PSCI_VERSION a fast path
arm/arm64: KVM: Turn kvm_psci_version into a static inline
arm64: KVM: Report SMCCC_ARCH_WORKAROUND_1 BP hardening support
arm64: KVM: Add SMCCC_ARCH_WORKAROUND_1 fast handling
firmware/psci: Expose PSCI conduit
firmware/psci: Expose SMCCC version through psci_ops
arm/arm64: smccc: Make function identifiers an unsigned quantity
arm/arm64: smccc: Implement SMCCC v1.1 inline primitive
arm64: Add ARM_SMCCC_ARCH_WORKAROUND_1 BP hardening support
arm64: Kill PSCI_GET_VERSION as a variant-2 workaround
arm: Add BTB invalidation on switch_mm for Cortex-A9, A12 and A17
arm: Invalidate BTB on prefetch abort outside of user mapping on Cortex A8, A9, A12 and A17
arm: KVM: Invalidate BTB on guest exit for Cortex-A12/A17
arm: Add icache invalidation on switch_mm for Cortex-A15
arm: Invalidate icache on prefetch abort outside of user mapping on Cortex-A15
arm: KVM: Invalidate icache on guest exit for Cortex-A15
Mark Rutland <mark.rutland(a)arm.com> (1):
arm64: uaccess: consistently check object sizes
Robin Murphy <robin.murphy(a)arm.com> (3):
arm64: Implement array_index_mask_nospec()
arm64: Make USER_DS an inclusive limit
arm64: Use pointer masking to limit uaccess speculation
Suzuki K Poulose <suzuki.poulose(a)arm.com> (1):
arm64: Run enable method for errata work arounds on late CPUs
Will Deacon <will.deacon(a)arm.com> (14):
arm64: barrier: Add CSDB macros to control data-value prediction
arm64: entry: Ensure branch through syscall table is bounded under speculation
arm64: uaccess: Prevent speculative use of the current addr_limit
arm64: uaccess: Don't bother eliding access_ok checks in __{get, put}_user
arm64: uaccess: Mask __user pointers for __arch_{clear, copy_*}_user
arm64: futex: Mask __user pointers prior to dereference
drivers/firmware: Expose psci_get_version through psci_ops structure
arm64: cpufeature: Pass capability structure to ->enable callback
arm64: Add skeleton to harden the branch predictor against aliasing attacks
arm64: entry: Apply BP hardening for high-priority synchronous exceptions
arm64: entry: Apply BP hardening for suspicious interrupts from EL0
arm64: cputype: Add missing MIDR values for Cortex-A72 and Cortex-A75
arm64: Implement branch predictor hardening for affected Cortex-A CPUs
arm64: Add README describing the branch
Yury Norov <ynorov(a)caviumnetworks.com> (1):
arm64: move TASK_* definitions to <asm/processor.h>
proc_sys_link_fill_cache() does not take currently unregistering
sysctl tables into account, which might result into a page fault in
sysctl_follow_link() - add a check to fix it.
This bug has been present since v3.4.
Fixes: 0e47c99d7fe25 ("sysctl: Replace root_list with links between sysctl_table_sets")
Cc: stable(a)vger.kernel.org
Acked-by: Kees Cook <keescook(a)chromium.org>
Signed-off-by: Danilo Krummrich <danilokrummrich(a)dk-develop.de>
---
v2: removed empty line between between sysctl_head_grab and IS_ERR
v3: extend commit message, add tags and cc stable
---
fs/proc/proc_sysctl.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index c5cbbdff3c3d..82ac5f682b73 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -707,7 +707,10 @@ static bool proc_sys_link_fill_cache(struct file *file,
struct ctl_table *table)
{
bool ret = true;
+
head = sysctl_head_grab(head);
+ if (IS_ERR(head))
+ return false;
if (S_ISLNK(table->mode)) {
/* It is not an error if we can not follow the link ignore it */
--
2.14.1
The following series implements...
Changes since v3 [1]:
* Kill IS_DAX() in favor of explicit IS_FSDAX() and IS_DEVDAX() helpers.
Jan noted, "having IS_DAX() and IS_FSDAX() doing almost the same, just
not exactly the same, is IMHO a recipe for confusion", and I agree. A
nice side effect of this elimination is a cleanup to remove occasions of
"#ifdef CONFIG_FS_DAX" in C files, it is all moved to header files
now. (Jan)
---
The vfio interface, like RDMA, wants to setup long term (indefinite)
pins of the pages backing an address range so that a guest or userspace
driver can perform DMA to the with physical address. Given that this
pinning may lead to filesystem operations deadlocking in the
filesystem-dax case, the pinning request needs to be rejected.
The longer term fix for vfio, RDMA, and any other long term pin user, is
to provide a 'pin with lease' mechanism. Similar to the leases that are
hold for pNFS RDMA layouts, this userspace lease gives the kernel a way
to notify userspace that the block layout of the file is changing and
the kernel is revoking access to pinned pages.
Related to this change is the discovery that vma_is_fsdax() was causing
device-dax inode detection to fail. That lead to series of fixes and
cleanups to make sure that S_DAX is defined correctly in the
CONFIG_FS_DAX=n + CONFIG_DEV_DAX=y case.
---
Dan Williams (12):
dax: fix vma_is_fsdax() helper
dax: introduce IS_DEVDAX() and IS_FSDAX()
ext2, dax: finish implementing dax_sem helpers
ext2, dax: define ext2_dax_*() infrastructure in all cases
ext4, dax: define ext4_dax_*() infrastructure in all cases
ext2, dax: replace IS_DAX() with IS_FSDAX()
ext4, dax: replace IS_DAX() with IS_FSDAX()
xfs, dax: replace IS_DAX() with IS_FSDAX()
mm, dax: replace IS_DAX() with IS_DEVDAX() or IS_FSDAX()
fs, dax: kill IS_DAX()
dax: fix S_DAX definition
vfio: disable filesystem-dax page pinning
drivers/vfio/vfio_iommu_type1.c | 18 ++++++++++++++--
fs/ext2/ext2.h | 6 +++++
fs/ext2/file.c | 19 +++++------------
fs/ext2/inode.c | 10 ++++-----
fs/ext4/file.c | 18 +++++-----------
fs/ext4/inode.c | 4 ++--
fs/ext4/ioctl.c | 2 +-
fs/ext4/super.c | 2 +-
fs/iomap.c | 2 +-
fs/xfs/xfs_file.c | 14 ++++++-------
fs/xfs/xfs_ioctl.c | 4 ++--
fs/xfs/xfs_iomap.c | 6 +++--
fs/xfs/xfs_reflink.c | 2 +-
include/linux/dax.h | 12 ++++++++---
include/linux/fs.h | 43 ++++++++++++++++++++++++++++-----------
mm/fadvise.c | 3 ++-
mm/filemap.c | 4 ++--
mm/huge_memory.c | 4 +++-
mm/madvise.c | 3 ++-
19 files changed, 102 insertions(+), 74 deletions(-)
This is the start of the stable review cycle for the 4.15.7 release.
There are 64 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 me know.
Responses should be made by Wed Feb 28 20:21:30 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.15.7-rc1…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.15.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.15.7-rc1
Chris Wilson <chris(a)chris-wilson.co.uk>
drm/i915/breadcrumbs: Ignore unsubmitted signalers
Will Deacon <will.deacon(a)arm.com>
arm64: __show_regs: Only resolve kernel symbols when running at EL1
Kai-Heng Feng <kai.heng.feng(a)canonical.com>
drm/amdgpu: add new device to use atpx quirk
Alex Deucher <alexander.deucher(a)amd.com>
drm/amdgpu: Avoid leaking PM domain on driver unbind (v2)
Alex Deucher <alexander.deucher(a)amd.com>
drm/amdgpu: add atpx quirk handling (v2)
Alex Deucher <alexander.deucher(a)amd.com>
drm/amdgpu: only check mmBIF_IOV_FUNC_IDENTIFIER on tonga/fiji
Alex Deucher <alexander.deucher(a)amd.com>
drm/amdgpu: Add dpm quirk for Jet PRO (v2)
Christian König <christian.koenig(a)amd.com>
drm/amdgpu: fix VA hole handling on Vega10 v3
Huang Rui <ray.huang(a)amd.com>
drm/amdgpu: disable MMHUB power gating on raven
Chris Wilson <chris(a)chris-wilson.co.uk>
drm: Handle unexpected holes in color-eviction
Leo (Sunpeng) Li <sunpeng.li(a)amd.com>
drm/atomic: Fix memleak on ERESTARTSYS during non-blocking commits
Daniel Vetter <daniel.vetter(a)ffwll.ch>
drm/cirrus: Load lut in crtc_commit
Yoshihiro Shimoda <yoshihiro.shimoda.uh(a)renesas.com>
usb: renesas_usbhs: missed the "running" flag in usb_dmac with rx path
Jack Pham <jackp(a)codeaurora.org>
usb: gadget: f_fs: Use config_ep_by_speed()
Jack Pham <jackp(a)codeaurora.org>
usb: gadget: f_fs: Process all descriptors during bind
Bin Liu <b-liu(a)ti.com>
Revert "usb: musb: host: don't start next rx urb if current one failed"
Karsten Koop <kkoop(a)ld-didactic.de>
usb: ldusb: add PIDs for new CASSY devices supported by this driver
Fabio Estevam <fabio.estevam(a)nxp.com>
usb: phy: mxs: Fix NULL pointer dereference on i.MX23/28
Thinh Nguyen <Thinh.Nguyen(a)synopsys.com>
usb: dwc3: ep0: Reset TRB counter for ep0 IN
Thinh Nguyen <Thinh.Nguyen(a)synopsys.com>
usb: dwc3: gadget: Set maxpacket size for ep0 IN
Peter Chen <hzpeterchen(a)gmail.com>
usb: host: ehci: use correct device pointer for dma ops
Kai-Heng Feng <kai.heng.feng(a)canonical.com>
drm/edid: Add 6 bpc quirk for CPT panel in Asus UX303LA
Jack Stocker <jackstocker.93(a)gmail.com>
Add delay-init quirk for Corsair K70 RGB keyboards
Will Deacon <will.deacon(a)arm.com>
arm64: cpufeature: Fix CTR_EL0 field definitions
Michael Weiser <michael.weiser(a)gmx.de>
arm64: Disable unhandled signal log messages by default
Michael Weiser <michael.weiser(a)gmx.de>
arm64: Remove unimplemented syscall log message
AMAN DEEP <aman.deep(a)samsung.com>
usb: ohci: Proper handling of ed_rm_list to handle race condition between usb_kill_urb() and finish_unlinks()
Shigeru Yoshida <shigeru.yoshida(a)windriver.com>
ohci-hcd: Fix race condition caused by ohci_urb_enqueue() and io_watchdog_func()
Mika Westerberg <mika.westerberg(a)linux.intel.com>
net: thunderbolt: Run disconnect flow asynchronously when logout is received
Mika Westerberg <mika.westerberg(a)linux.intel.com>
net: thunderbolt: Tear down connection properly on suspend
Casey Leedom <leedom(a)chelsio.com>
PCI/cxgb4: Extend T3 PCI quirk to T4+ devices
Matt Redfearn <matt.redfearn(a)mips.com>
irqchip/mips-gic: Avoid spuriously handling masked interrupts
Shanker Donthineni <shankerd(a)codeaurora.org>
irqchip/gic-v3: Use wmb() instead of smb_wmb() in gic_raise_softirq()
Hauke Mehrtens <hauke(a)hauke-m.de>
uapi/if_ether.h: move __UAPI_DEF_ETHHDR libc define
Juergen Gross <jgross(a)suse.com>
mm: don't defer struct page initialization for Xen pv guests
Huang Ying <huang.ying.caritas(a)gmail.com>
mm, swap, frontswap: fix THP swap if frontswap enabled
Arnd Bergmann <arnd(a)arndb.de>
x86/oprofile: Fix bogus GCC-8 warning in nmi_setup()
Thomas Gleixner <tglx(a)linutronix.de>
x86/apic/vector: Handle vector release on CPU unplug correctly
Arnd Bergmann <arnd(a)arndb.de>
Kbuild: always define endianess in kconfig.h
Lars-Peter Clausen <lars(a)metafoo.de>
iio: adis_lib: Initialize trigger before requesting interrupt
Stefan Windfeldt-Prytz <stefan.windfeldt(a)axis.com>
iio: buffer: check if a buffer has been set up when poll is called
Andreas Klinger <ak(a)it-klinger.de>
iio: srf08: fix link error "devm_iio_triggered_buffer_setup" undefined
Fabrice Gasnier <fabrice.gasnier(a)st.com>
iio: adc: stm32: fix stm32h7_adc_enable error handling
Leon Romanovsky <leonro(a)mellanox.com>
RDMA/uverbs: Sanitize user entered port numbers prior to access it
Leon Romanovsky <leonro(a)mellanox.com>
RDMA/uverbs: Fix circular locking dependency
Leon Romanovsky <leonro(a)mellanox.com>
RDMA/uverbs: Fix bad unlock balance in ib_uverbs_close_xrcd
Leon Romanovsky <leonro(a)mellanox.com>
RDMA/uverbs: Protect from command mask overflow
Leon Romanovsky <leonro(a)mellanox.com>
RDMA/uverbs: Protect from races between lookup and destroy of uobjects
Thomas Gleixner <tglx(a)linutronix.de>
genirq/matrix: Handle CPU offlining proper
Hans de Goede <hdegoede(a)redhat.com>
extcon: int3496: process id-pin first so that we start with the right status
Eric Biggers <ebiggers(a)google.com>
PKCS#7: fix certificate blacklisting
Eric Biggers <ebiggers(a)google.com>
PKCS#7: fix certificate chain verification
Eric Biggers <ebiggers(a)google.com>
X.509: fix NULL dereference when restricting key with unsupported_sig
Eric Biggers <ebiggers(a)google.com>
X.509: fix BUG_ON() when hash algorithm is unsupported
Eric Anholt <eric(a)anholt.net>
i2c: bcm2835: Set up the rising/falling edge delays
Ben Gardner <gardner.ben(a)gmail.com>
i2c: designware: must wait for enable
Arnd Bergmann <arnd(a)arndb.de>
cfg80211: fix cfg80211_beacon_dup
James Hogan <jhogan(a)kernel.org>
MIPS: Drop spurious __unused in struct compat_flock
Tyrel Datwyler <tyreld(a)linux.vnet.ibm.com>
scsi: ibmvfc: fix misdefined reserved field in ibmvfc_fcp_rsp_info
Max Filippov <jcmvbkbc(a)gmail.com>
xtensa: fix high memory/reserved memory collision
Kees Cook <keescook(a)chromium.org>
MIPS: boot: Define __ASSEMBLY__ for its.S build
Kees Cook <keescook(a)chromium.org>
kconfig.h: Include compiler types to avoid missed struct attributes
Ard Biesheuvel <ard.biesheuvel(a)linaro.org>
arm64: mm: don't write garbage into TTBR1_EL1 register
Paolo Abeni <pabeni(a)redhat.com>
netfilter: drop outermost socket lock in getsockopt()
-------------
Diffstat:
Makefile | 4 +-
arch/arm64/kernel/cpufeature.c | 6 +-
arch/arm64/kernel/process.c | 11 +++-
arch/arm64/kernel/traps.c | 10 +---
arch/arm64/mm/proc.S | 2 +-
arch/mips/boot/Makefile | 1 +
arch/mips/include/asm/compat.h | 1 -
arch/x86/kernel/apic/vector.c | 25 ++++++++-
arch/x86/oprofile/nmi_int.c | 2 +-
arch/xtensa/mm/init.c | 70 +++++++++++++++++++++---
crypto/asymmetric_keys/pkcs7_verify.c | 12 ++--
crypto/asymmetric_keys/public_key.c | 4 +-
crypto/asymmetric_keys/restrict.c | 21 ++++---
drivers/extcon/extcon-intel-int3496.c | 3 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 58 +++++++++++++++++---
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 10 ++--
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 -
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 11 ++++
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 13 +++++
drivers/gpu/drm/amd/amdgpu/si_dpm.c | 5 ++
drivers/gpu/drm/amd/amdgpu/soc15.c | 4 +-
drivers/gpu/drm/amd/amdgpu/vi.c | 21 ++++---
drivers/gpu/drm/cirrus/cirrus_mode.c | 40 ++++++++------
drivers/gpu/drm/drm_atomic_helper.c | 15 +++++
drivers/gpu/drm/drm_edid.c | 3 +
drivers/gpu/drm/drm_mm.c | 21 ++++++-
drivers/gpu/drm/i915/intel_breadcrumbs.c | 29 ++++------
drivers/hid/hid-core.c | 3 +
drivers/hid/hid-ids.h | 3 +
drivers/i2c/busses/i2c-bcm2835.c | 21 ++++++-
drivers/i2c/busses/i2c-designware-master.c | 2 +-
drivers/iio/adc/stm32-adc.c | 7 ++-
drivers/iio/imu/adis_trigger.c | 7 ++-
drivers/iio/industrialio-buffer.c | 2 +-
drivers/iio/proximity/Kconfig | 2 +
drivers/infiniband/core/rdma_core.c | 10 +++-
drivers/infiniband/core/uverbs_cmd.c | 16 ++++--
drivers/infiniband/core/uverbs_main.c | 27 ++++++---
drivers/irqchip/irq-gic-v3.c | 2 +-
drivers/irqchip/irq-mips-gic.c | 2 -
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 10 ----
drivers/net/thunderbolt.c | 19 +++++--
drivers/pci/quirks.c | 39 +++++++------
drivers/scsi/ibmvscsi/ibmvfc.h | 2 +-
drivers/usb/core/quirks.c | 3 +
drivers/usb/dwc3/ep0.c | 7 ++-
drivers/usb/dwc3/gadget.c | 2 +
drivers/usb/gadget/function/f_fs.c | 44 +++------------
drivers/usb/host/ehci-hub.c | 4 +-
drivers/usb/host/ohci-hcd.c | 10 +++-
drivers/usb/host/ohci-hub.c | 4 +-
drivers/usb/host/ohci-q.c | 17 +++---
drivers/usb/misc/ldusb.c | 6 ++
drivers/usb/musb/musb_host.c | 8 +--
drivers/usb/phy/phy-mxs-usb.c | 3 +
drivers/usb/renesas_usbhs/fifo.c | 5 ++
drivers/xen/tmem.c | 4 ++
include/drm/drm_atomic.h | 9 +++
include/linux/kconfig.h | 9 +++
include/uapi/linux/if_ether.h | 6 +-
include/uapi/linux/libc-compat.h | 6 --
kernel/irq/matrix.c | 23 +++++---
mm/page_alloc.c | 4 ++
mm/zswap.c | 6 ++
net/ipv4/ip_sockglue.c | 7 +--
net/ipv6/ipv6_sockglue.c | 10 +---
net/mac80211/cfg.c | 2 +-
68 files changed, 530 insertions(+), 251 deletions(-)
This is a note to let you know that I've just added the patch titled
microblaze: fix endian handling
to the 4.15-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
microblaze-fix-endian-handling.patch
and it can be found in the queue-4.15 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From 71e7673dadfdae0605d4c1f66ecb4b045c79fe0f Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd(a)arndb.de>
Date: Tue, 2 Jan 2018 12:47:19 +0100
Subject: microblaze: fix endian handling
From: Arnd Bergmann <arnd(a)arndb.de>
commit 71e7673dadfdae0605d4c1f66ecb4b045c79fe0f upstream.
Building an allmodconfig kernel fails horribly because of
endian mismatch. It turns out that the -mlittle-endian
switch was not honored at all as we were using the wrong
Kconfig symbol and failing to apply CPUFLAGS to the CFLAGS.
Finally, the linker flags did not get set right.
This addresses all three of those issues, which now lets
me build both big-endian and little-endian kernels for
testing.
Fixes: 428dbf156cc5 ("arch: change default endian for microblaze")
Fixes: 206d3642d8ee ("arch/microblaze: add choice for endianness and update Makefile")
Signed-off-by: Arnd Bergmann <arnd(a)arndb.de>
Signed-off-by: Michal Simek <michal.simek(a)xilinx.com>
Cc: Guenter Roeck <linux(a)roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
arch/microblaze/Makefile | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
--- a/arch/microblaze/Makefile
+++ b/arch/microblaze/Makefile
@@ -36,16 +36,21 @@ endif
CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_DIV) += -mno-xl-soft-div
CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_BARREL) += -mxl-barrel-shift
CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare
-CPUFLAGS-$(CONFIG_BIG_ENDIAN) += -mbig-endian
-CPUFLAGS-$(CONFIG_LITTLE_ENDIAN) += -mlittle-endian
+
+ifdef CONFIG_CPU_BIG_ENDIAN
+KBUILD_CFLAGS += -mbig-endian
+KBUILD_AFLAGS += -mbig-endian
+LD += -EB
+else
+KBUILD_CFLAGS += -mlittle-endian
+KBUILD_AFLAGS += -mlittle-endian
+LD += -EL
+endif
CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER))
# r31 holds current when in kernel mode
-KBUILD_CFLAGS += -ffixed-r31 $(CPUFLAGS-1) $(CPUFLAGS-2)
-
-LDFLAGS :=
-LDFLAGS_vmlinux :=
+KBUILD_CFLAGS += -ffixed-r31 $(CPUFLAGS-y) $(CPUFLAGS-1) $(CPUFLAGS-2)
head-y := arch/microblaze/kernel/head.o
libs-y += arch/microblaze/lib/
Patches currently in stable-queue which might be from arnd(a)arndb.de are
queue-4.15/microblaze-fix-endian-handling.patch
queue-4.15/x86-oprofile-fix-bogus-gcc-8-warning-in-nmi_setup.patch
queue-4.15/cfg80211-fix-cfg80211_beacon_dup.patch
queue-4.15/kbuild-always-define-endianess-in-kconfig.h.patch
This is a note to let you know that I've just added the patch titled
microblaze: fix endian handling
to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
microblaze-fix-endian-handling.patch
and it can be found in the queue-4.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From 71e7673dadfdae0605d4c1f66ecb4b045c79fe0f Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd(a)arndb.de>
Date: Tue, 2 Jan 2018 12:47:19 +0100
Subject: microblaze: fix endian handling
From: Arnd Bergmann <arnd(a)arndb.de>
commit 71e7673dadfdae0605d4c1f66ecb4b045c79fe0f upstream.
Building an allmodconfig kernel fails horribly because of
endian mismatch. It turns out that the -mlittle-endian
switch was not honored at all as we were using the wrong
Kconfig symbol and failing to apply CPUFLAGS to the CFLAGS.
Finally, the linker flags did not get set right.
This addresses all three of those issues, which now lets
me build both big-endian and little-endian kernels for
testing.
Fixes: 428dbf156cc5 ("arch: change default endian for microblaze")
Fixes: 206d3642d8ee ("arch/microblaze: add choice for endianness and update Makefile")
Signed-off-by: Arnd Bergmann <arnd(a)arndb.de>
Signed-off-by: Michal Simek <michal.simek(a)xilinx.com>
Cc: Guenter Roeck <linux(a)roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
arch/microblaze/Makefile | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
--- a/arch/microblaze/Makefile
+++ b/arch/microblaze/Makefile
@@ -36,16 +36,21 @@ endif
CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_DIV) += -mno-xl-soft-div
CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_BARREL) += -mxl-barrel-shift
CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare
-CPUFLAGS-$(CONFIG_BIG_ENDIAN) += -mbig-endian
-CPUFLAGS-$(CONFIG_LITTLE_ENDIAN) += -mlittle-endian
+
+ifdef CONFIG_CPU_BIG_ENDIAN
+KBUILD_CFLAGS += -mbig-endian
+KBUILD_AFLAGS += -mbig-endian
+LD += -EB
+else
+KBUILD_CFLAGS += -mlittle-endian
+KBUILD_AFLAGS += -mlittle-endian
+LD += -EL
+endif
CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER))
# r31 holds current when in kernel mode
-KBUILD_CFLAGS += -ffixed-r31 $(CPUFLAGS-1) $(CPUFLAGS-2)
-
-LDFLAGS :=
-LDFLAGS_vmlinux :=
+KBUILD_CFLAGS += -ffixed-r31 $(CPUFLAGS-y) $(CPUFLAGS-1) $(CPUFLAGS-2)
head-y := arch/microblaze/kernel/head.o
libs-y += arch/microblaze/lib/
Patches currently in stable-queue which might be from arnd(a)arndb.de are
queue-4.14/microblaze-fix-endian-handling.patch
queue-4.14/x86-oprofile-fix-bogus-gcc-8-warning-in-nmi_setup.patch
queue-4.14/cfg80211-fix-cfg80211_beacon_dup.patch
queue-4.14/kbuild-always-define-endianess-in-kconfig.h.patch
This is a note to let you know that I've just added the patch titled
m32r: fix endianness constraints
to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
m32r-fix-endianness-constraints.patch
and it can be found in the queue-4.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From c95f121142a41c951fd62683a5574f2a7b37c573 Mon Sep 17 00:00:00 2001
From: Geert Uytterhoeven <geert(a)linux-m68k.org>
Date: Wed, 15 Nov 2017 17:31:18 -0800
Subject: m32r: fix endianness constraints
From: Geert Uytterhoeven <geert(a)linux-m68k.org>
commit c95f121142a41c951fd62683a5574f2a7b37c573 upstream.
The m32r Kconfig provides both CPU_BIG_ENDIAN and CPU_LITTLE_ENDIAN
configuration options. As they are user-selectable and independent,
this allows invalid configurations:
- All m32r defconfigs build a big endian kernel, but CPU_BIG_ENDIAN is
not set, causing compiler warnings like:
include/linux/byteorder/big_endian.h:7:2: warning: #warning inconsistent configuration, needs CONFIG_CPU_BIG_ENDIAN [-Wcpp]
#warning inconsistent configuration, needs CONFIG_CPU_BIG_ENDIAN
^
- Since commit 5bdfca6435b82944 ("m32r: define CPU_BIG_ENDIAN"),
building an allmodconfig or allyesconfig enables both
CONFIG_CPU_BIG_ENDIAN and CONFIG_CPU_LITTLE_ENDIAN.
While this did get rid of the warning above, both options are
obviously mutually exclusive.
Fix this by making only CPU_LITTLE_ENDIAN configurable by the user, as
before, and by making sure exactly one of CPU_BIG_ENDIAN and
CPU_LITTLE_ENDIAN is always enabled.
Link: http://lkml.kernel.org/r/1509361505-18150-1-git-send-email-geert@linux-m68k…
Fixes: 5bdfca6435b82944 ("m32r: define CPU_BIG_ENDIAN")
Signed-off-by: Geert Uytterhoeven <geert(a)linux-m68k.org>
Cc: Sudip Mukherjee <sudipm.mukherjee(a)gmail.com>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds(a)linux-foundation.org>
Cc: Guenter Roeck <linux(a)roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
arch/m32r/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -196,8 +196,8 @@ config TIMER_DIVIDE
default "128"
config CPU_BIG_ENDIAN
- bool "Generate big endian code"
- default n
+ bool
+ default !CPU_LITTLE_ENDIAN
config CPU_LITTLE_ENDIAN
bool "Generate little endian code"
Patches currently in stable-queue which might be from geert(a)linux-m68k.org are
queue-4.14/m32r-fix-endianness-constraints.patch
This is the start of the stable review cycle for the 4.9.85 release.
There are 39 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 me know.
Responses should be made by Wed Feb 28 20:16:31 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.85-rc1…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.9.85-rc1
Dan Williams <dan.j.williams(a)intel.com>
x86/entry/64: Clear extra registers beyond syscall arguments, to reduce speculation attack surface
Dan Williams <dan.j.williams(a)intel.com>
mm: fail get_vaddr_frames() for filesystem-dax mappings
Jan H. Schönherr <jschoenh(a)amazon.de>
mm: Fix devm_memremap_pages() collision handling
Dan Williams <dan.j.williams(a)intel.com>
libnvdimm, dax: fix 1GB-aligned namespaces vs physical misalignment
Dan Williams <dan.j.williams(a)intel.com>
IB/core: disable memory registration of filesystem-dax vmas
Dan Williams <dan.j.williams(a)intel.com>
v4l2: disable filesystem-dax mapping support
Dan Williams <dan.j.williams(a)intel.com>
mm: introduce get_user_pages_longterm
Dan Williams <dan.j.williams(a)intel.com>
device-dax: implement ->split() to catch invalid munmap attempts
Dan Williams <dan.j.williams(a)intel.com>
libnvdimm: fix integer overflow static analysis warning
Jan Kara <jack(a)suse.cz>
fs/dax.c: fix inefficiency in dax_writeback_mapping_range()
Ross Zwisler <ross.zwisler(a)linux.intel.com>
mm: avoid spurious 'bad pmd' warning messages
Eric Biggers <ebiggers(a)google.com>
X.509: fix NULL dereference when restricting key with unsupported_sig
Eric Biggers <ebiggers(a)google.com>
binder: add missing binder_unlock()
Kai-Heng Feng <kai.heng.feng(a)canonical.com>
drm/amdgpu: add new device to use atpx quirk
Alex Deucher <alexander.deucher(a)amd.com>
drm/amdgpu: Avoid leaking PM domain on driver unbind (v2)
Alex Deucher <alexander.deucher(a)amd.com>
drm/amdgpu: add atpx quirk handling (v2)
Alex Deucher <alexander.deucher(a)amd.com>
drm/amdgpu: Add dpm quirk for Jet PRO (v2)
Yoshihiro Shimoda <yoshihiro.shimoda.uh(a)renesas.com>
usb: renesas_usbhs: missed the "running" flag in usb_dmac with rx path
Jack Pham <jackp(a)codeaurora.org>
usb: gadget: f_fs: Process all descriptors during bind
Bin Liu <b-liu(a)ti.com>
Revert "usb: musb: host: don't start next rx urb if current one failed"
Karsten Koop <kkoop(a)ld-didactic.de>
usb: ldusb: add PIDs for new CASSY devices supported by this driver
Thinh Nguyen <Thinh.Nguyen(a)synopsys.com>
usb: dwc3: gadget: Set maxpacket size for ep0 IN
Kai-Heng Feng <kai.heng.feng(a)canonical.com>
drm/edid: Add 6 bpc quirk for CPT panel in Asus UX303LA
Jack Stocker <jackstocker.93(a)gmail.com>
Add delay-init quirk for Corsair K70 RGB keyboards
Michael Weiser <michael.weiser(a)gmx.de>
arm64: Disable unhandled signal log messages by default
AMAN DEEP <aman.deep(a)samsung.com>
usb: ohci: Proper handling of ed_rm_list to handle race condition between usb_kill_urb() and finish_unlinks()
Shigeru Yoshida <shigeru.yoshida(a)windriver.com>
ohci-hcd: Fix race condition caused by ohci_urb_enqueue() and io_watchdog_func()
Casey Leedom <leedom(a)chelsio.com>
PCI/cxgb4: Extend T3 PCI quirk to T4+ devices
Shanker Donthineni <shankerd(a)codeaurora.org>
irqchip/gic-v3: Use wmb() instead of smb_wmb() in gic_raise_softirq()
Arnd Bergmann <arnd(a)arndb.de>
x86/oprofile: Fix bogus GCC-8 warning in nmi_setup()
Lars-Peter Clausen <lars(a)metafoo.de>
iio: adis_lib: Initialize trigger before requesting interrupt
Stefan Windfeldt-Prytz <stefan.windfeldt(a)axis.com>
iio: buffer: check if a buffer has been set up when poll is called
Leon Romanovsky <leonro(a)mellanox.com>
RDMA/uverbs: Protect from command mask overflow
Eric Biggers <ebiggers(a)google.com>
PKCS#7: fix certificate chain verification
Eric Biggers <ebiggers(a)google.com>
X.509: fix BUG_ON() when hash algorithm is unsupported
Arnd Bergmann <arnd(a)arndb.de>
cfg80211: fix cfg80211_beacon_dup
Tyrel Datwyler <tyreld(a)linux.vnet.ibm.com>
scsi: ibmvfc: fix misdefined reserved field in ibmvfc_fcp_rsp_info
Max Filippov <jcmvbkbc(a)gmail.com>
xtensa: fix high memory/reserved memory collision
Paolo Abeni <pabeni(a)redhat.com>
netfilter: drop outermost socket lock in getsockopt()
-------------
Diffstat:
Makefile | 4 +-
arch/arm64/kernel/traps.c | 2 +-
arch/x86/entry/entry_64.S | 13 +++++
arch/x86/oprofile/nmi_int.c | 2 +-
arch/xtensa/mm/init.c | 70 +++++++++++++++++++++---
crypto/asymmetric_keys/pkcs7_verify.c | 2 +-
crypto/asymmetric_keys/public_key.c | 4 +-
crypto/asymmetric_keys/restrict.c | 7 ++-
drivers/android/binder.c | 4 +-
drivers/dax/dax.c | 12 ++++
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 58 +++++++++++++++++---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 -
drivers/gpu/drm/amd/amdgpu/si_dpm.c | 5 ++
drivers/gpu/drm/drm_edid.c | 3 +
drivers/hid/hid-core.c | 3 +
drivers/hid/hid-ids.h | 3 +
drivers/iio/imu/adis_trigger.c | 7 ++-
drivers/iio/industrialio-buffer.c | 2 +-
drivers/infiniband/core/umem.c | 2 +-
drivers/infiniband/core/uverbs_main.c | 27 ++++++---
drivers/irqchip/irq-gic-v3.c | 2 +-
drivers/media/v4l2-core/videobuf-dma-sg.c | 5 +-
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 10 ----
drivers/nvdimm/bus.c | 11 ++--
drivers/nvdimm/pfn_devs.c | 15 ++++-
drivers/pci/quirks.c | 39 +++++++------
drivers/scsi/ibmvscsi/ibmvfc.h | 2 +-
drivers/usb/core/quirks.c | 3 +
drivers/usb/dwc3/gadget.c | 2 +
drivers/usb/gadget/function/f_fs.c | 6 +-
drivers/usb/host/ohci-hcd.c | 10 +++-
drivers/usb/host/ohci-hub.c | 4 +-
drivers/usb/host/ohci-q.c | 17 +++---
drivers/usb/misc/ldusb.c | 6 ++
drivers/usb/musb/musb_host.c | 8 +--
drivers/usb/renesas_usbhs/fifo.c | 5 ++
fs/dax.c | 1 +
include/linux/dax.h | 5 --
include/linux/fs.h | 20 +++++++
include/linux/kernel.h | 1 +
include/linux/mm.h | 13 +++++
kernel/memremap.c | 13 +++--
mm/frame_vector.c | 12 ++++
mm/gup.c | 64 ++++++++++++++++++++++
mm/memory.c | 40 ++++++++++----
net/ipv4/ip_sockglue.c | 7 +--
net/ipv6/ipv6_sockglue.c | 10 +---
net/mac80211/cfg.c | 2 +-
48 files changed, 433 insertions(+), 132 deletions(-)
This is the start of the stable review cycle for the 3.18.97 release.
There are 13 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 me know.
Responses should be made by Wed Feb 28 20:15:12 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.97-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-3.18.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 3.18.97-rc1
Eric Biggers <ebiggers(a)google.com>
ASN.1: fix out-of-bounds read when parsing indefinite length item
Jack Pham <jackp(a)codeaurora.org>
usb: gadget: f_fs: Process all descriptors during bind
Thinh Nguyen <Thinh.Nguyen(a)synopsys.com>
usb: dwc3: gadget: Set maxpacket size for ep0 IN
Michael Weiser <michael.weiser(a)gmx.de>
arm64: Disable unhandled signal log messages by default
Shanker Donthineni <shankerd(a)codeaurora.org>
irqchip/gic-v3: Use wmb() instead of smb_wmb() in gic_raise_softirq()
Arnd Bergmann <arnd(a)arndb.de>
x86/oprofile: Fix bogus GCC-8 warning in nmi_setup()
Lars-Peter Clausen <lars(a)metafoo.de>
iio: adis_lib: Initialize trigger before requesting interrupt
Stefan Windfeldt-Prytz <stefan.windfeldt(a)axis.com>
iio: buffer: check if a buffer has been set up when poll is called
Arnd Bergmann <arnd(a)arndb.de>
cfg80211: fix cfg80211_beacon_dup
Tyrel Datwyler <tyreld(a)linux.vnet.ibm.com>
scsi: ibmvfc: fix misdefined reserved field in ibmvfc_fcp_rsp_info
Max Filippov <jcmvbkbc(a)gmail.com>
xtensa: fix high memory/reserved memory collision
Johan Hovold <johan(a)kernel.org>
PCI: keystone: Fix interrupt-controller-node lookup
Paolo Abeni <pabeni(a)redhat.com>
netfilter: drop outermost socket lock in getsockopt()
-------------
Diffstat:
Makefile | 4 +--
arch/arm64/kernel/traps.c | 2 +-
arch/x86/oprofile/nmi_int.c | 2 +-
arch/xtensa/mm/init.c | 70 ++++++++++++++++++++++++++++++++++----
drivers/iio/imu/adis_trigger.c | 7 ++--
drivers/iio/industrialio-buffer.c | 2 +-
drivers/irqchip/irq-gic-v3.c | 2 +-
drivers/pci/host/pci-keystone.c | 9 +++--
drivers/scsi/ibmvscsi/ibmvfc.h | 2 +-
drivers/usb/dwc3/gadget.c | 2 ++
drivers/usb/gadget/function/f_fs.c | 6 ++--
lib/asn1_decoder.c | 43 ++++++++++++-----------
net/ipv4/ip_sockglue.c | 7 +---
net/ipv6/ipv6_sockglue.c | 10 ++----
net/mac80211/cfg.c | 2 +-
15 files changed, 113 insertions(+), 57 deletions(-)
When an MSI descriptor was not available, the error path would try to
unbind an irq that was never acquired - potentially unbinding an
unrelated irq.
Fixes: 4892c9b4ada9f9 ("xen: add support for MSI message groups")
Reported-by: Hooman Mirhadi <mirhadih(a)amazon.com>
CC: <stable(a)vger.kernel.org>
CC: Roger Pau Monné <roger.pau(a)citrix.com>
CC: Boris Ostrovsky <boris.ostrovsky(a)oracle.com>
CC: Eduardo Valentin <eduval(a)amazon.com>
CC: Juergen Gross <jgross(a)suse.com>
CC: Thomas Gleixner <tglx(a)linutronix.de>
CC: "K. Y. Srinivasan" <kys(a)microsoft.com>
CC: Liu Shuo <shuo.a.liu(a)intel.com>
CC: Anoob Soman <anoob.soman(a)citrix.com>
Signed-off-by: Amit Shah <aams(a)amazon.com>
---
drivers/xen/events/events_base.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index 1ab4bd1..c86d10e 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -755,8 +755,10 @@ int xen_bind_pirq_msi_to_irq(struct pci_dev *dev, struct msi_desc *msidesc,
mutex_unlock(&irq_mapping_update_lock);
return irq;
error_irq:
- for (; i >= 0; i--)
+ while (i > 0) {
+ i--;
__unbind_from_irq(irq + i);
+ }
mutex_unlock(&irq_mapping_update_lock);
return ret;
}
--
2.7.3.AMZN
Amazon Development Center Germany GmbH
Berlin - Dresden - Aachen
main office: Krausenstr. 38, 10117 Berlin
Geschaeftsfuehrer: Dr. Ralf Herbrich, Christian Schlaeger
Ust-ID: DE289237879
Eingetragen am Amtsgericht Charlottenburg HRB 149173 B
tmu_read() in case of Exynos4210 might return error for out of bound
values. Current code ignores such value, what leads to reporting critical
temperature value. Add proper error code propagation to exynos_get_temp()
function.
Signed-off-by: Marek Szyprowski <m.szyprowski(a)samsung.com>
CC: stable(a)vger.kernel.org # v4.6+
---
This patch is prepared on top of "thermal: exynos: Reading temperature
makes sense only when TMU is turned on" patch. Both are required
to finally fix thermal support on Exynos4210 based boards.
This patch only applies cleanly together with the mentioned "thermal:
exynos: Reading temperature makes sense only when TMU is turned on"
patch on v4.6+ kernels.
---
drivers/thermal/samsung/exynos_tmu.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 986cbd01aaaa..74adeb1d2daf 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -892,6 +892,7 @@ static void exynos7_tmu_control(struct platform_device *pdev, bool on)
static int exynos_get_temp(void *p, int *temp)
{
struct exynos_tmu_data *data = p;
+ int value, ret = 0;
if (!data || !data->tmu_read || !data->enabled)
return -EINVAL;
@@ -899,12 +900,16 @@ static int exynos_get_temp(void *p, int *temp)
mutex_lock(&data->lock);
clk_enable(data->clk);
- *temp = code_to_temp(data, data->tmu_read(data)) * MCELSIUS;
+ value = data->tmu_read(data);
+ if (value < 0)
+ ret = value;
+ else
+ *temp = code_to_temp(data, value) * MCELSIUS;
clk_disable(data->clk);
mutex_unlock(&data->lock);
- return 0;
+ return ret;
}
#ifdef CONFIG_THERMAL_EMULATION
--
2.15.0
On 2/27/18 2:38 AM, Mark Brown wrote:
> On Mon, Feb 26, 2018 at 06:30:15PM -0800, Pierre-Louis Bossart wrote:
>> On 2/26/18 10:34 AM, Kirill Marinushkin wrote:
>
>>> According to the comment, the existing functionality works correctly "WRT the
>>> interface". The suggested commit doesn't fix the behaviour: instead, it reverts
>>> the logic to "WRT the codec". But the existing implementation is also valid.
>
>> Look at all the machine drivers, they always use the mask by looking at the
>> codec side. The comment on top means that the SOC side ('the interface') is
>> the dual of the codec side.
>
>> This issue was found during the development of SOF (Sound Open Firmware)
>> where we get the reverse of the intended behavior when using the same
>> conventions in topology files as in machine drivers.
>
> Is this perhaps something that the earlier firmware is handling inside
> the firmware?
For SKL+ the SSP settings come from binary blobs read from ACPI/NHLT
tables so I am wondering if this inversion is compensated for in the
tools used to generate the blobs.
When thermal sensor is not yet enabled, reading temperature might return
random value. This might even result in stopping system booting when such
temperature is higher than the critical value. Fix this by checking if TMU
has been actually enabled before reading the temperature.
This change fixes booting of Exynos4210-based board with TMU enabled (for
example Samsung Trats board), which was broken since v4.4 kernel release.
Signed-off-by: Marek Szyprowski <m.szyprowski(a)samsung.com>
Fixes: 9e4249b40340 ("thermal: exynos: Fix first temperature read after registering sensor")
CC: stable(a)vger.kernel.org # v4.6+
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie(a)samsung.com>
---
This issue is there since commit 9e4249b40340 ("thermal: exynos: Fix
first temperature read after registering sensor"), but this patch applies
cleanly only to v4.6+ kernels.
---
drivers/thermal/samsung/exynos_tmu.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index ed805c7c5ace..986cbd01aaaa 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -185,6 +185,7 @@
* @regulator: pointer to the TMU regulator structure.
* @reg_conf: pointer to structure to register with core thermal.
* @ntrip: number of supported trip points.
+ * @enabled: current status of TMU device
* @tmu_initialize: SoC specific TMU initialization method
* @tmu_control: SoC specific TMU control method
* @tmu_read: SoC specific TMU temperature read method
@@ -205,6 +206,7 @@ struct exynos_tmu_data {
struct regulator *regulator;
struct thermal_zone_device *tzd;
unsigned int ntrip;
+ bool enabled;
int (*tmu_initialize)(struct platform_device *pdev);
void (*tmu_control)(struct platform_device *pdev, bool on);
@@ -398,6 +400,7 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on)
mutex_lock(&data->lock);
clk_enable(data->clk);
data->tmu_control(pdev, on);
+ data->enabled = on;
clk_disable(data->clk);
mutex_unlock(&data->lock);
}
@@ -890,7 +893,7 @@ static int exynos_get_temp(void *p, int *temp)
{
struct exynos_tmu_data *data = p;
- if (!data || !data->tmu_read)
+ if (!data || !data->tmu_read || !data->enabled)
return -EINVAL;
mutex_lock(&data->lock);
--
2.15.0