David S. Miller
7d9996870a
Merge branch 'sfc-refactor-mcdi-filtering-code'
...
Alex Maftei says:
====================
sfc: refactor mcdi filtering code
Splitting final bits of the driver code into different files, which
will later be used in another driver for a new product.
This is a continuation to my previous patch series. (three of them)
Refactoring will be concluded with this series, for now.
As instructed, split the renaming and moving into different patches.
Removed stray spaces before tabs... twice.
Minor refactoring was done with the renaming, as explained in the
first patch.
====================
Signed-off-by: David S. Miller <davem@davemloft.net >
2020-01-27 13:05:43 +01:00
Alex Maftei (amaftei)
6c77065bbd
sfc: move mcdi filtering code
...
Signed-off-by: Alexandru-Mihai Maftei <amaftei@solarflare.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2020-01-27 13:05:43 +01:00
Alex Maftei (amaftei)
00aaf7e56f
sfc: create header for mcdi filtering code
...
Moved structs, enums, and added function prototypes.
The affected functions are no longer static.
Signed-off-by: Alexandru-Mihai Maftei <amaftei@solarflare.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2020-01-27 13:05:43 +01:00
Alex Maftei (amaftei)
90c914d2a3
sfc: rename mcdi filtering functions/structs
...
Minor style fixes included due to name lengths changing.
Signed-off-by: Alexandru-Mihai Maftei <amaftei@solarflare.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2020-01-27 13:05:43 +01:00
Christophe Leroy
21613cfad1
powerpc/32: Reuse orphaned memblocks in kasan_init_shadow_page_tables()
...
If concurrent PMD population has happened, re-use orphaned memblocks.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr >
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au >
Link: https://lore.kernel.org/r/b29ffffb9206dc14541fa420c17604240728041b.1579024426.git.christophe.leroy@c-s.fr
2020-01-27 22:37:45 +11:00
Christophe Leroy
509cd3f2b4
powerpc/32: Simplify KASAN init
...
Since kasan_init_region() is not used anymore for modules,
KASAN init is done while slab_is_available() is false.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr >
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au >
Link: https://lore.kernel.org/r/84b27bf08b41c8343efd88e10f2eccd8e9f85593.1579024426.git.christophe.leroy@c-s.fr
2020-01-27 22:37:45 +11:00
Christophe Leroy
47febbeeec
powerpc/32: Force KASAN_VMALLOC for modules
...
Unloading/Reloading of modules seems to fail with KASAN_VMALLOC
but works properly with it.
Force selection of KASAN_VMALLOC when MODULES are selected, and
drop module_alloc() which was dedicated to KASAN for modules.
Reported-by: <erhard_f@mailbox.org >
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr >
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au >
Link: https://bugzilla.kernel.org/show_bug.cgi?id=205283
Link: https://lore.kernel.org/r/f909da11aecb59ab7f32ba01fae6f356eaa4d7bc.1579024426.git.christophe.leroy@c-s.fr
2020-01-27 22:37:41 +11:00
Christophe Leroy
af1725d249
powerpc/kconfig: Move CONFIG_PPC32 into Kconfig.cputype
...
Move CONFIG_PPC32 at the same place as CONFIG_PPC64 for consistency.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr >
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au >
Link: https://lore.kernel.org/r/6f28085c2a1aa987093d50db17586633bbf8e206.1579024426.git.christophe.leroy@c-s.fr
2020-01-27 22:37:37 +11:00
Christophe Leroy
3d4247fcc9
powerpc/32: Add support of KASAN_VMALLOC
...
Add support of KASAN_VMALLOC on PPC32.
To allow this, the early shadow covering the VMALLOC space
need to be removed once high_memory var is set and before
freeing memblock.
And the VMALLOC area need to be aligned such that boundaries
are covered by a full shadow page.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr >
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au >
Link: https://lore.kernel.org/r/031dec5487bde9b2181c8b3c9800e1879cf98c1a.1579024426.git.christophe.leroy@c-s.fr
2020-01-27 22:37:33 +11:00
Christophe Leroy
0f9aee0cb9
powerpc/mm: Don't log user reads to 0xffffffff
...
Running vdsotest leaves many times the following log:
[ 79.629901] vdsotest[396]: User access of kernel address (ffffffff) - exploit attempt? (uid: 0)
A pointer set to (-1) is likely a programming error similar to
a NULL pointer and is not worth logging as an exploit attempt.
Don't log user accesses to 0xffffffff.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr >
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au >
Link: https://lore.kernel.org/r/0728849e826ba16f1fbd6fa7f5c6cc87bd64e097.1577087627.git.christophe.leroy@c-s.fr
2020-01-27 22:37:24 +11:00
Christophe Leroy
cd08f109e2
powerpc/32s: Enable CONFIG_VMAP_STACK
...
A few changes to retrieve DAR and DSISR from struct regs
instead of retrieving them directly, as they may have
changed due to a TLB miss.
Also modifies hash_page() and friends to work with virtual
data addresses instead of physical ones. Same on load_up_fpu()
and load_up_altivec().
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr >
[mpe: Fix tovirt_vmstack call in head_32.S to fix CHRP build]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au >
Link: https://lore.kernel.org/r/2e2509a242fd5f3e23df4a06530c18060c4d321e.1576916812.git.christophe.leroy@c-s.fr
2020-01-27 22:37:24 +11:00
Christophe Leroy
94dd54c51a
powerpc/32s: Avoid crossing page boundary while changing SRR0/1.
...
Trying VMAP_STACK with KVM, vmlinux was not starting.
This was due to SRR0 and SRR1 clobbered by an ISI due to
the rfi being in a different page than the mtsrr0/1:
c0003fe0 <mmu_off>:
c0003fe0: 38 83 00 54 addi r4,r3,84
c0003fe4: 7c 60 00 a6 mfmsr r3
c0003fe8: 70 60 00 30 andi. r0,r3,48
c0003fec: 4d 82 00 20 beqlr
c0003ff0: 7c 63 00 78 andc r3,r3,r0
c0003ff4: 7c 9a 03 a6 mtsrr0 r4
c0003ff8: 7c 7b 03 a6 mtsrr1 r3
c0003ffc: 7c 00 04 ac hwsync
c0004000: 4c 00 00 64 rfi
Align the 4 instruction block used to deactivate MMU to order 4,
so that the block never crosses a page boundary.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr >
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au >
Link: https://lore.kernel.org/r/30d2cda111b7977227fff067fa7e358440e2b3a4.1576916812.git.christophe.leroy@c-s.fr
2020-01-27 22:37:03 +11:00
Christophe Leroy
2e15001ea9
powerpc/32s: Reorganise DSI handler.
...
The part decidated to handling hash_page() is fully unneeded for
processors not having real hash pages like the 603.
Lets enlarge the content of the feature fixup, and provide
an alternative which jumps directly instead of getting NIPs.
Also, in preparation of VMAP stacks, the end of DSI handler has moved
to later in the code as it won't fit anymore once VMAP stacks
are there.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr >
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au >
Link: https://lore.kernel.org/r/c31b22c91af8b011d0a4fd9e52ad6afb4b593f71.1576916812.git.christophe.leroy@c-s.fr
2020-01-27 22:36:59 +11:00
Christophe Leroy
99b229161f
powerpc/8xx: Enable CONFIG_VMAP_STACK
...
This patch enables CONFIG_VMAP_STACK. For that, a few changes are
done in head_8xx.S.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr >
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au >
Link: https://lore.kernel.org/r/d7ba1e34e80898310d6a314cbebe48baa32894ef.1576916812.git.christophe.leroy@c-s.fr
2020-01-27 22:36:59 +11:00
Michael Ellerman
d52668f6b3
powerpc/8xx: Move tail of alignment exception out of line
...
When we enable VMAP_STACK there will not be enough room for the
alignment handler at 0x600 in head_8xx.S. For now move the tail of the
alignment handler out of line, and branch to it.
Suggested-by: Christophe Leroy <christophe.leroy@c-s.fr >
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au >
2020-01-27 22:36:59 +11:00
Christophe Leroy
afe1ec5ab8
powerpc/8xx: Split breakpoint exception
...
Breakpoint exception is big.
Split it to support future growth on exception prolog.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr >
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au >
Link: https://lore.kernel.org/r/1dda3293d86d0f715b13b2633c95d2188a42a02c.1576916812.git.christophe.leroy@c-s.fr
2020-01-27 22:36:55 +11:00
Christophe Leroy
596419afed
powerpc/8xx: Move DataStoreTLBMiss perf handler
...
Move DataStoreTLBMiss perf handler in order to cope
with future growing exception prolog.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr >
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au >
Link: https://lore.kernel.org/r/75dd28b04efd2cbdbf01153173d99c11cdff2f08.1576916812.git.christophe.leroy@c-s.fr
2020-01-27 22:36:50 +11:00
Christophe Leroy
9260f76ae2
powerpc/8xx: Drop exception entries for non-existing exceptions
...
head_8xx.S has entries for all exceptions from 0x100 to 0x1f00.
Several of them do not exist and are never generated by the 8xx
in accordance with the documentation.
Remove those entry points to make some room for future growing
exception code.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr >
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au >
Link: https://lore.kernel.org/r/66f92866fe9524cf0f056016921c7d53adaef3a0.1576916812.git.christophe.leroy@c-s.fr
2020-01-27 22:36:45 +11:00
Christophe Leroy
6edc318585
powerpc/8xx: Use alternative scratch registers in DTLB miss handler
...
In preparation of handling CONFIG_VMAP_STACK, DTLB miss handler need
to use different scratch registers than other exception handlers in
order to not jeopardise exception entry on stack DTLB misses.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr >
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au >
Link: https://lore.kernel.org/r/c5287ea59ae9630f505019b309bf94029241635f.1576916812.git.christophe.leroy@c-s.fr
2020-01-27 22:36:16 +11:00
Christophe Leroy
547db12fd8
powerpc/32: Use vmapped stacks for interrupts
...
In order to also catch overflows on IRQ stacks, use vmapped stacks.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr >
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au >
Link: https://lore.kernel.org/r/d33ad1b36ddff4dcc19f96c592c12a61cf85d406.1576916812.git.christophe.leroy@c-s.fr
2020-01-27 22:36:15 +11:00
Christophe Leroy
3978eb7851
powerpc/32: Add early stack overflow detection with VMAP stack.
...
To avoid recursive faults, stack overflow detection has to be
performed before writing in the stack in exception prologs.
Do it by checking the alignment. If the stack pointer alignment is
wrong, it means it is pointing to the following or preceding page.
Without VMAP stack, a stack overflow is catastrophic. With VMAP
stack, a stack overflow isn't destructive, so don't panic. Kill
the task with SIGSEGV instead.
A dedicated overflow stack is set up for each CPU.
lkdtm: Performing direct entry EXHAUST_STACK
lkdtm: Calling function with 512 frame size to depth 32 ...
lkdtm: loop 32/32 ...
lkdtm: loop 31/32 ...
lkdtm: loop 30/32 ...
lkdtm: loop 29/32 ...
lkdtm: loop 28/32 ...
lkdtm: loop 27/32 ...
lkdtm: loop 26/32 ...
lkdtm: loop 25/32 ...
lkdtm: loop 24/32 ...
lkdtm: loop 23/32 ...
lkdtm: loop 22/32 ...
lkdtm: loop 21/32 ...
lkdtm: loop 20/32 ...
Kernel stack overflow in process test[359], r1=c900c008
Oops: Kernel stack overflow, sig: 6 [#1 ]
BE PAGE_SIZE=4K MMU=Hash PowerMac
Modules linked in:
CPU: 0 PID: 359 Comm: test Not tainted 5.3.0-rc7+ #2225
NIP: c0622060 LR: c0626710 CTR: 00000000
REGS: c0895f48 TRAP: 0000 Not tainted (5.3.0-rc7+)
MSR: 00001032 <ME,IR,DR,RI> CR: 28004224 XER: 00000000
GPR00: c0626ca4 c900c008 c783c000 c07335cc c900c010 c07335cc c900c0f0 c07335cc
GPR08: c900c0f0 00000001 00000000 00000000 28008222 00000000 00000000 00000000
GPR16: 00000000 00000000 10010128 10010000 b799c245 10010158 c07335cc 00000025
GPR24: c0690000 c08b91d4 c068f688 00000020 c900c0f0 c068f668 c08b95b4 c08b91d4
NIP [c0622060] format_decode+0x0/0x4d4
LR [c0626710] vsnprintf+0x80/0x5fc
Call Trace:
[c900c068] [c0626ca4] vscnprintf+0x18/0x48
[c900c078] [c007b944] vprintk_store+0x40/0x214
[c900c0b8] [c007bf50] vprintk_emit+0x90/0x1dc
[c900c0e8] [c007c5cc] printk+0x50/0x60
[c900c128] [c03da5b0] recursive_loop+0x44/0x6c
[c900c338] [c03da5c4] recursive_loop+0x58/0x6c
[c900c548] [c03da5c4] recursive_loop+0x58/0x6c
[c900c758] [c03da5c4] recursive_loop+0x58/0x6c
[c900c968] [c03da5c4] recursive_loop+0x58/0x6c
[c900cb78] [c03da5c4] recursive_loop+0x58/0x6c
[c900cd88] [c03da5c4] recursive_loop+0x58/0x6c
[c900cf98] [c03da5c4] recursive_loop+0x58/0x6c
[c900d1a8] [c03da5c4] recursive_loop+0x58/0x6c
[c900d3b8] [c03da5c4] recursive_loop+0x58/0x6c
[c900d5c8] [c03da5c4] recursive_loop+0x58/0x6c
[c900d7d8] [c03da5c4] recursive_loop+0x58/0x6c
[c900d9e8] [c03da5c4] recursive_loop+0x58/0x6c
[c900dbf8] [c03da5c4] recursive_loop+0x58/0x6c
[c900de08] [c03da67c] lkdtm_EXHAUST_STACK+0x30/0x4c
[c900de18] [c03da3e8] direct_entry+0xc8/0x140
[c900de48] [c029fb40] full_proxy_write+0x64/0xcc
[c900de68] [c01500f8] __vfs_write+0x30/0x1d0
[c900dee8] [c0152cb8] vfs_write+0xb8/0x1d4
[c900df08] [c0152f7c] ksys_write+0x58/0xe8
[c900df38] [c0014208] ret_from_syscall+0x0/0x34
--- interrupt: c01 at 0xf806664
LR = 0x1000c868
Instruction dump:
4bffff91 80010014 7c832378 7c0803a6 38210010 4e800020 3d20c08a 3ca0c089
8089a0cc 38a58f0c 38600001 4ba2d494 <9421ffe0> 7c0802a6 bfc10018 7c9f2378
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr >
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au >
Link: https://lore.kernel.org/r/1b89c121b4070c7ee99e4f22cc178f15a736b07b.1576916812.git.christophe.leroy@c-s.fr
2020-01-27 22:35:49 +11:00
Niklas Söderlund
0f510a2457
thermal: rcar_gen3_thermal: Remove temperature bound
...
The hardware manual states that the operation of the sensor is not
guaranteed with temperatures above 125°C, not that the readings are
invalid. Remove the bound check and try to deliver temperature readings
even if we are outside the guaranteed operation range.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se >
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/20200117160554.3812787-3-niklas.soderlund+renesas@ragnatech.se
2020-01-27 11:43:24 +01:00
Niklas Söderlund
dff6d4f805
thermal: rcar_thermal: Remove temperature bound
...
The hardware manual states that the operation of the sensor is not
guaranteed outside the range of -45°C to 125°C, not that the readings
are invalid. Remove the bound check and try to deliver temperature
readings even if we are outside the guaranteed operation range.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se >
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/20200117160554.3812787-2-niklas.soderlund+renesas@ragnatech.se
2020-01-27 11:43:24 +01:00
Gayatri Kammela
35709c4ee7
thermal: intel: intel_pch_thermal: Add Comet Lake (CML) platform support
...
Add Comet Lake to the list of the platforms to support intel_pch_thermal
driver.
Cc: Zhang rui <rui.zhang@intel.com >
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com >
Signed-off-by: Gayatri Kammela <gayatri.kammela@intel.com >
Acked-by: Zhang Rui <rui.zhang@intel.com >
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/20191211200043.4985-1-gayatri.kammela@intel.com
2020-01-27 11:43:24 +01:00
Chuhong Yuan
66dd8b802c
thermal: intel: Fix unmatched pci_release_region
...
The driver calls pci_request_regions() in probe and uses
pci_release_regions() in probe failure.
However, it calls pci_release_region() in remove, which does
match the other two calls.
Use pci_release_regions() instead to unify them.
Signed-off-by: Chuhong Yuan <hslester96@gmail.com >
Acked-by: Zhang Rui <rui.zhang@intel.com >
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/20191206075531.18637-1-hslester96@gmail.com
2020-01-27 11:43:24 +01:00
Swaminathan, Nivedita
f64a6583d3
thermal: int340x: processor_thermal: Add Jasper Lake support
...
Added new PCI id for Jasper Lake processor thermal device.
Signed-off-by: Swaminathan, Nivedita <nivedita.swaminathan@intel.com >
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com >
Acked-by: Zhang Rui <rui.zhang@intel.com >
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/20191212203025.36310-1-srinivas.pandruvada@linux.intel.com
2020-01-27 11:43:24 +01:00
Stefan Wahren
c168baec00
dt-bindings: brcm,avs-ro-thermal: Fix binding check issues
...
Drop the reg property since this only necessary for the parent and
add the missing thermal-sensor-cells property description.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com >
Fixes: 37e9cc08e9678 ("dt-bindings: Add Broadcom AVS RO thermal")
Reviewed-by: Rob Herring <robh@kernel.org >
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/1579200077-17496-1-git-send-email-stefan.wahren@i2se.com
2020-01-27 11:43:24 +01:00
Florian Fainelli
5fdd4e310b
thermal: brcmstb_thermal: Register different ops per process
...
Since we do not have interrupts on BCM7216, we cannot have trip point
crossing, the thermal subsystem expects us to provide a NULL set_trips
operation in that case, so make it possible to provide per-process
thermal_zone_of_device_ops
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org >
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com >
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/20200114190607.29339-7-f.fainelli@gmail.com
2020-01-27 11:41:08 +01:00
Florian Fainelli
eaf7a88d4f
thermal: brcmstb_thermal: Restructure interrupt registration
...
If we are successful grabbing the interrupt resource, then register an
interrupt handler, this makes it easier to support the interrupt as
being optional, which is it for 7216.
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org >
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com >
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/20200114190607.29339-6-f.fainelli@gmail.com
2020-01-27 11:41:08 +01:00
Florian Fainelli
c9a506139b
thermal: brcmstb_thermal: Add 16nm process thermal parameters
...
Match the 7216 compatible string in order to derive the correct 16nm
process thermal parameters to obtain correct readings.
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org >
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com >
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/20200114190607.29339-5-f.fainelli@gmail.com
2020-01-27 11:41:08 +01:00
Florian Fainelli
ea0ad0ff38
dt-bindings: thermal: Define BCM7216 thermal sensor compatible
...
BCM7216 is a 16nm process STB chip, which requires a different
compatible string to differentiate different temperature formulas.
Reviewed-by: Rob Herring <robh@kernel.org >
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com >
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/20200114190607.29339-4-f.fainelli@gmail.com
2020-01-27 11:41:08 +01:00
Florian Fainelli
8bcda3257a
thermal: brcmstb_thermal: Prepare to support a different process
...
The driver is currently assuming that it is operating with a 28nm
process chip, which has a specific formula to convert temperature to a
code and vice versa. Update the code to support providing two key
values: offset and multiplier to derive the correct formulas.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com >
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org >
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/20200114190607.29339-3-f.fainelli@gmail.com
2020-01-27 11:41:08 +01:00
Florian Fainelli
e1ff6fc22f
thermal: brcmstb_thermal: Do not use DT coefficients
...
At the time the brcmstb_thermal driver and its binding were merged, the
DT binding did not make the coefficients properties a mandatory one,
therefore all users of the brcmstb_thermal driver out there have a non
functional implementation with zero coefficients. Even if these
properties were provided, the formula used for computation is incorrect.
The coefficients are entirely process specific (right now, only 28nm is
supported) and not board or SoC specific, it is therefore appropriate to
hard code them in the driver given the compatibility string we are
probed with which has to be updated whenever a new process is
introduced.
We remove the existing coefficients definition since subsequent patches
are going to add support for a new process and will introduce new
coefficients as well.
Fixes: 9e03cf1b2d ("thermal: add brcmstb AVS TMON driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com >
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org >
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/20200114190607.29339-2-f.fainelli@gmail.com
2020-01-27 11:41:08 +01:00
Geert Uytterhoeven
263c8c4c76
thermal: rcar_thermal: Use usleep_range() instead of udelay()
...
rcar_thermal_update_temp() takes a mutex, so it is always called in a
context that can sleep. Hence replace the 300 µs busy loop by a call to
usleep_range(), to allow other threads to run.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be >
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/20200115125417.5263-1-geert+renesas@glider.be
2020-01-27 11:41:08 +01:00
Stefan Wahren
1a90e73248
ARM: configs: Build BCM2711 thermal as module
...
This builds the BCM2711 thermal driver as module for the Raspberry Pi 4.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com >
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com >
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de >
Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de >
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/1578941778-23321-5-git-send-email-stefan.wahren@i2se.com
2020-01-27 11:41:08 +01:00
Stefan Wahren
a1d6989bf1
ARM: dts: bcm2711: Enable thermal
...
This enables thermal for the BCM2711 (used on Raspberry Pi 4) by adding
the AVS monitor and a subnode for the thermal part.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com >
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de >
Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de >
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com >
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/1578941778-23321-4-git-send-email-stefan.wahren@i2se.com
2020-01-27 11:41:08 +01:00
Stefan Wahren
59b781352d
thermal: Add BCM2711 thermal driver
...
This adds the thermal sensor driver for the Broadcom BCM2711 SoC,
which is placed on the Raspberry Pi 4. The driver only provides
SoC temperature reading so far.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com >
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com >
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de >
Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de >
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/1578941778-23321-3-git-send-email-stefan.wahren@i2se.com
2020-01-27 11:41:08 +01:00
Stefan Wahren
ee31ff373d
dt-bindings: Add Broadcom AVS RO thermal
...
Since the BCM2711 doesn't have a AVS TMON block, the thermal information
must be retrieved from the AVS ring oscillator block. This block is part
of the AVS monitor which contains a bunch of raw sensors.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de >
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/1578941778-23321-2-git-send-email-stefan.wahren@i2se.com
2020-01-27 11:42:00 +01:00
Yangtao Li
85f0ad2213
thermal: sun8i: Add hwmon support
...
Expose sun8i thermal as a HWMON device.
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com >
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/20191228171904.24618-1-tiny.windzz@gmail.com
2020-01-27 11:41:08 +01:00
Yangtao Li
291292cddc
thermal: sun8i: Remove unused variable and unneeded macros
...
The cp_ft_flag variable is not used after initialization, so delete
it. After that, THS_EFUSE_CP_FT_MASK, THS_EFUSE_CP_FT_BIT and
THS_CALIBRATION_IN_FT are not needed, so delete them.
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com >
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/20200112180925.23705-1-tiny.windzz@gmail.com
2020-01-27 11:41:08 +01:00
Yangtao Li
69d5f3a9c0
thermal: sun8i: Fix using plain integer as NULL pointer in sun8i_ths_resource_init
...
sparse returns a warning:
"drivers/thermal/sun8i_thermal.c:341:60: sparse: sparse: Using plain
integer as NULL pointer".
Fix it by replacing the zero integer by a NULL pointer.
Reported-by: kbuild test robot <lkp@intel.com >
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com >
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/20200112171318.23025-1-tiny.windzz@gmail.com
2020-01-27 11:41:08 +01:00
Yangtao Li
d8186285f1
thermal: sun8i: Fix r40 ths number
...
According to the spec, r40 has 2 thermal sensors.
Sensor0 located in the CPU, another in the GPU.
Fixes: dccc5c3b6f ("thermal/drivers/sun8i: Add thermal driver for H6/H5/H3/A64/A83T/R40")
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com >
Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com >
Tested-on: sun8i-r40-bananapi-m2-ultra
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Link: https://lore.kernel.org/r/20200106174639.20862-1-tiny.windzz@gmail.com
2020-01-27 11:41:08 +01:00
David S. Miller
4d94e4350e
Merge branch 'bnxt_en-next'
...
Michael Chan says:
====================
bnxt_en: Updates for net-next.
This patch-set includes link up and link initialization improvements,
RSS and aRFS improvements, devlink refactoring and registration
improvements, devlink info support including documentation.
v2: Removed the TC ingress rate limiting patch. The developer Harsha needs
to rework some code.
Use fw.psid suggested by Jakub Kicinski.
====================
Signed-off-by: David S. Miller <davem@davemloft.net >
2020-01-27 11:33:29 +01:00
Vasundhara Volam
92439915e0
devlink: document devlink info versions reported by bnxt_en driver
...
Add the set of info versions reported by bnxt_en driver, including
a description of what the version represents, and what modes (fixed,
running, stored) it reports.
v2: Use fw.psid.
Cc: Jiri Pirko <jiri@mellanox.com >
Cc: Jakub Kicinski <kuba@kernel.org >
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com >
Signed-off-by: Michael Chan <michael.chan@broadcom.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2020-01-27 11:33:29 +01:00
Vasundhara Volam
9599e036b1
bnxt_en: Add support for devlink info command
...
Display the following information via devlink info command:
- Driver name
- Board id
- Broad revision
- Board Serial number
- Board FW version
- FW parameter set version
- FW App version
- FW management version
- FW RoCE version
Standard output example:
$ devlink dev info pci/0000:3b:00.0
pci/0000:3b:00.0:
driver bnxt_en
serial_number 00-10-18-FF-FE-AD-05-00
versions:
fixed:
asic.id D802
asic.rev 1
running:
fw 216.1.124.0
fw.psid 0.0.0
fw.app 216.1.122.0
fw.mgmt 864.0.32.0
fw.roce 216.1.15.0
[ This version has incorporated changes suggested by Jakub Kicinski to
use generic devlink version tags. ]
v2: Use fw.psid
Cc: Jiri Pirko <jiri@mellanox.com >
Cc: Jakub Kicinski <kuba@kernel.org >
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com >
Signed-off-by: Michael Chan <michael.chan@broadcom.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2020-01-27 11:33:29 +01:00
Vasundhara Volam
41c0d917d1
devlink: add macro for "fw.roce"
...
Add definition and documentation for the new generic info "fw.roce".
v2: Remove board.nvm_cfg since fw.psid is similar.
Cc: Jiri Pirko <jiri@mellanox.com >
Cc: Jakub Kicinski <kuba@kernel.org >
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com >
Signed-off-by: Michael Chan <michael.chan@broadcom.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2020-01-27 11:33:29 +01:00
Vasundhara Volam
b014232f7f
bnxt_en: Rename switch_id to dsn
...
Instead of switch_id, renaming it to dsn will be more meaningful
so that it can be used to display device serial number in follow up
patch via devlink_info command.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com >
Signed-off-by: Michael Chan <michael.chan@broadcom.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2020-01-27 11:33:28 +01:00
Vasundhara Volam
8159cbe3e0
bnxt_en: Add support to update progress of flash update
...
This patch adds status notification to devlink flash update
while flashing is in progress.
$ devlink dev flash pci/0000:05:00.0 file 103.pkg
Preparing to flash
Flashing done
Cc: Jiri Pirko <jiri@mellanox.com >
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com >
Signed-off-by: Michael Chan <michael.chan@broadcom.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2020-01-27 11:33:28 +01:00
Vasundhara Volam
cda2cab077
bnxt_en: Move devlink_register before registering netdev
...
Latest kernels get the phys_port_name via devlink, if
ndo_get_phys_port_name is not defined. To provide the phys_port_name
correctly, register devlink before registering netdev.
Also call devlink_port_type_eth_set() after registering netdev as
devlink port updates the netdev structure and notifies user.
Cc: Jiri Pirko <jiri@mellanox.com >
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com >
Signed-off-by: Michael Chan <michael.chan@broadcom.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2020-01-27 11:33:28 +01:00
Vasundhara Volam
002870ebda
bnxt_en: Register devlink irrespective of firmware spec version
...
This will allow to register for devlink port and use port features.
Also register params only if firmware spec version is at least 0x10600
which will support reading/setting numbered variables in NVRAM.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com >
Signed-off-by: Michael Chan <michael.chan@broadcom.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2020-01-27 11:33:28 +01:00