* Re: [PATCH v3 01/10] powerpc/8xx: move CPM1 related files from sysdev/ to platforms/8xx
From: Michael Ellerman @ 2019-07-08 1:19 UTC (permalink / raw)
To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras, oss
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <04852442b540e73be0a20e13f69ab8427fd102e0.1560494348.git.christophe.leroy@c-s.fr>
On Fri, 2019-06-14 at 06:41:38 UTC, Christophe Leroy wrote:
> Only 8xx selects CPM1 and related CONFIG options are already
> in platforms/8xx/Kconfig
>
> Move the related C files to platforms/8xx/.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Series applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/4128a89ac80d3714babde5b2811ffd058b09c229
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/scm: Use a specific endian format for storing uuid from the device tree
From: Michael Ellerman @ 2019-07-08 1:19 UTC (permalink / raw)
To: Aneesh Kumar K.V, npiggin, paulus, oohall; +Cc: Aneesh Kumar K.V, linuxppc-dev
In-Reply-To: <20190607064705.29043-1-aneesh.kumar@linux.ibm.com>
On Fri, 2019-06-07 at 06:47:05 UTC, "Aneesh Kumar K.V" wrote:
> We used uuid_parse to convert uuid string from device tree to two u64
> components. We want to make sure we look at the uuid read from device
> tree in an endian-neutral fashion. For now, I am picking little-endian
> to be format so that we don't end up doing an additional conversion.
>
> The reason to store in a specific endian format is to enable reading
> the namespace created with a little-endian kernel config on a big-endian kernel.
> We do store the device tree uuid string as a 64-bit little-endian cookie in the
> label area. When booting the kernel we also compare this cookie
> against what is read from the device tree. For this, to work we have
> to store and compare these values in a CPU endian config independent fashion.
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/259a948c4ba1829ae4a3c31bb6e40ad458a21254
cheers
^ permalink raw reply
* Re: [PATCH v3 1/3] powerpc/boot: don't force gzipped uImage
From: Michael Ellerman @ 2019-07-08 1:19 UTC (permalink / raw)
To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <1b4946c9e580b51b6ca2ddc5963d66406c013c2d.1560507284.git.christophe.leroy@c-s.fr>
On Fri, 2019-06-14 at 10:16:23 UTC, Christophe Leroy wrote:
> This patch modifies the generation of uImage by handing over
> the selected compression type instead of forcing gzip
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Series applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/fbded57c962e7c42c932e1a46c8d801441726662
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/4xx/uic: clear pending interrupt after irq type/pol change
From: Michael Ellerman @ 2019-07-08 1:19 UTC (permalink / raw)
To: Christian Lamparter, linuxppc-dev; +Cc: Thomas Gleixner, Paul Mackerras
In-Reply-To: <20190615152313.26288-1-chunkeey@gmail.com>
On Sat, 2019-06-15 at 15:23:13 UTC, Christian Lamparter wrote:
> When testing out gpio-keys with a button, a spurious
> interrupt (and therefore a key press or release event)
> gets triggered as soon as the driver enables the irq
> line for the first time.
>
> This patch clears any potential bogus generated interrupt
> that was caused by the switching of the associated irq's
> type and polarity.
>
> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/3ab3a0689e74e6aa5b41360bc18861040ddef5b1
cheers
^ permalink raw reply
* Re: [PATCH] selftests/powerpc: Add missing newline at end of file
From: Michael Ellerman @ 2019-07-08 1:19 UTC (permalink / raw)
To: Geert Uytterhoeven, Benjamin Herrenschmidt, Paul Mackerras,
Shuah Khan
Cc: linux-kselftest, linuxppc-dev, linux-kernel, Geert Uytterhoeven
In-Reply-To: <20190617145204.6810-1-geert+renesas@glider.be>
On Mon, 2019-06-17 at 14:52:04 UTC, Geert Uytterhoeven wrote:
> "git diff" says:
>
> \ No newline at end of file
>
> after modifying the file.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/7b570361f6f66c91443541b19121038c076e7d64
cheers
^ permalink raw reply
* Re: [PATCH] KVM: PPC: Book3S HV: Fix CR0 setting in TM emulation
From: Michael Ellerman @ 2019-07-08 1:19 UTC (permalink / raw)
To: Michael Neuling; +Cc: mikey, linuxppc-dev, kvm-ppc, sjitindarsingh
In-Reply-To: <20190620060040.26945-1-mikey@neuling.org>
On Thu, 2019-06-20 at 06:00:40 UTC, Michael Neuling wrote:
> When emulating tsr, treclaim and trechkpt, we incorrectly set CR0. The
> code currently sets:
> CR0 <- 00 || MSR[TS]
> but according to the ISA it should be:
> CR0 <- 0 || MSR[TS] || 0
>
> This fixes the bit shift to put the bits in the correct location.
>
> Tested-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
> Signed-off-by: Michael Neuling <mikey@neuling.org>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/3fefd1cd95df04da67c83c1cb93b663f04b3324f
cheers
^ permalink raw reply
* Re: [PATCH kernel] powerpc/powernv: Fix stale iommu table base after VFIO
From: Michael Ellerman @ 2019-07-08 1:19 UTC (permalink / raw)
To: Alexey Kardashevskiy, linuxppc-dev
Cc: Alexey Kardashevskiy, Alistair Popple, Sam Bobroff, David Gibson
In-Reply-To: <20190628065300.41674-1-aik@ozlabs.ru>
On Fri, 2019-06-28 at 06:53:00 UTC, Alexey Kardashevskiy wrote:
> The powernv platform uses @dma_iommu_ops for non-bypass DMA. These ops
> need an iommu_table pointer which is stored in
> dev->archdata.iommu_table_base. It is initialized during
> pcibios_setup_device() which handles boot time devices. However when
> a device is taken from the system in order to pass it through, the default
> IOMMU table is destroyed but the pointer in a device is not updated;
> also when a device is returned back to the system, a new table pointer
> is not stored in dev->archdata.iommu_table_base either. So when a just
> returned device tries using IOMMU, it crashes on accessing stale
> iommu_table or its members.
>
> This calls set_iommu_table_base() when the default window is created.
> Note it used to be there before but was wrongly removed (see "fixes").
> It did not appear before as these days most devices simply use bypass.
>
> This adds set_iommu_table_base(NULL) when a device is taken from
> the system to make it clear that IOMMU DMA cannot be used past that point.
>
> Fixes: c4e9d3c1e65a ("powerpc/powernv/pseries: Rework device adding to IOMMU groups")
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/5636427d087a55842c1a199dfb839e6545d30e5d
cheers
^ permalink raw reply
* Re: [PATCH kernel v2] powerpc/pci/of: Parse unassigned resources
From: Michael Ellerman @ 2019-07-08 1:19 UTC (permalink / raw)
To: Alexey Kardashevskiy, linuxppc-dev
Cc: Alexey Kardashevskiy, Alistair Popple, Sam Bobroff,
Oliver O'Halloran, Paul Mackerras, David Gibson
In-Reply-To: <20190626023746.94250-1-aik@ozlabs.ru>
On Wed, 2019-06-26 at 02:37:46 UTC, Alexey Kardashevskiy wrote:
> The pseries platform uses the PCI_PROBE_DEVTREE method of PCI probing
> which reads "assigned-addresses" of every PCI device and initializes
> the device resources. However if the property is missing or zero sized,
> then there is no fallback of any kind and the PCI resources remain
> undiscovered, i.e. pdev->resource[] array remains empty.
>
> This adds a fallback which parses the "reg" property in pretty much same
> way except it marks resources as "unset" which later make Linux assign
> those resources proper addresses.
>
> This has an effect when:
> 1. a hypervisor failed to assign any resource for a device;
> 2. /chosen/linux,pci-probe-only=0 is in the DT so the system may try
> assigning a resource.
> Neither is likely to happen under PowerVM.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/dead1c845dbe97e0061dae2017eaf3bd8f8f06ee
cheers
^ permalink raw reply
* Re: [PATCH v2 1/2] powerpc/mm/hash/4k: Don't use 64K page size for vmemmap with 4K pagesize
From: Michael Ellerman @ 2019-07-08 1:19 UTC (permalink / raw)
To: Aneesh Kumar K.V, npiggin, paulus; +Cc: Aneesh Kumar K.V, linuxppc-dev
In-Reply-To: <20190701143442.17174-1-aneesh.kumar@linux.ibm.com>
On Mon, 2019-07-01 at 14:34:41 UTC, "Aneesh Kumar K.V" wrote:
> With hash translation and 4K PAGE_SIZE config, we need to make sure we don't
> use 64K page size for vmemmap.
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Series applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/78c949888549a6318ae420802703408caae999f5
cheers
^ permalink raw reply
* Re: [PATCH v2 1/3] powerpc/mm/drconf: Use NUMA_NO_NODE on failures instead of node 0
From: Michael Ellerman @ 2019-07-08 1:19 UTC (permalink / raw)
To: Aneesh Kumar K.V, npiggin, paulus
Cc: Vaibhav Jain, linuxppc-dev, Aneesh Kumar K.V
In-Reply-To: <20190701143626.17628-1-aneesh.kumar@linux.ibm.com>
On Mon, 2019-07-01 at 14:36:24 UTC, "Aneesh Kumar K.V" wrote:
> If we fail to parse the associativity array we should default to
> NUMA_NO_NODE instead of NODE 0. Rest of the code fallback to the
> right default if we find the numa node value NUMA_NO_NODE.
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Series applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/ea9f5b702fe0215188fba2eda117419e4ae90a67
cheers
^ permalink raw reply
* Re: [PATCH] powerpc: Remove unused variable declaration
From: Michael Ellerman @ 2019-07-08 1:19 UTC (permalink / raw)
To: Aneesh Kumar K.V, npiggin, paulus; +Cc: Aneesh Kumar K.V, linuxppc-dev
In-Reply-To: <20190701143700.17894-1-aneesh.kumar@linux.ibm.com>
On Mon, 2019-07-01 at 14:37:00 UTC, "Aneesh Kumar K.V" wrote:
> __kernel_virt_size is not used anymore.
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/b8c8a524ccad1244916a203ae40292e2786e1b26
cheers
^ permalink raw reply
* Re: [PATCH v2] powerpc/mm/nvdimm: Add an informative message if we fail to allocate altmap block
From: Michael Ellerman @ 2019-07-08 1:19 UTC (permalink / raw)
To: Aneesh Kumar K.V, npiggin, paulus
Cc: linuxppc-dev, Oliver O'Halloran, Aneesh Kumar K.V
In-Reply-To: <20190701143338.16824-1-aneesh.kumar@linux.ibm.com>
On Mon, 2019-07-01 at 14:33:38 UTC, "Aneesh Kumar K.V" wrote:
> Allocation from altmap area can fail based on vmemmap page size used. Add kernel
> info message to indicate the failure. That allows the user to identify whether they
> are really using persistent memory reserved space for per-page metadata.
>
> The message looks like:
> [ 136.587212] altmap block allocation failed, falling back to system memory
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
> Reviewed-by: Oliver O'Halloran <oohall@gmail.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/c0b1b23b9c87569d5f90d06e86f26b31b544fa1e
cheers
^ permalink raw reply
* Re: [PATCH] powerpc: Enable CONFIG_IPV6 in ppc64_defconfig
From: Michael Ellerman @ 2019-07-08 1:19 UTC (permalink / raw)
To: sathnaga, linuxppc-dev; +Cc: Satheesh Rajendran
In-Reply-To: <20190702154745.4667-1-sathnaga@linux.vnet.ibm.com>
On Tue, 2019-07-02 at 15:47:45 UTC, sathnaga@linux.vnet.ibm.com wrote:
> From: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
>
> Enable CONFIG_IPV6 in ppc64_defconfig to enable
> certain network functionalities required for tests.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> Signed-off-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/31afa05bf90ea5561307be83893c670555bd736d
cheers
^ permalink raw reply
* Re: [PATCH v3 1/9] powerpc/pseries: Use macros for referring to the DTL enable mask
From: Michael Ellerman @ 2019-07-08 1:19 UTC (permalink / raw)
To: Naveen N. Rao; +Cc: Nathan Lynch, Aneesh Kumar K.V, Mingming Cao, linuxppc-dev
In-Reply-To: <0bb01059d527cd90b1b639a195ce40e87f6fc468.1562171646.git.naveen.n.rao@linux.vnet.ibm.com>
On Wed, 2019-07-03 at 17:03:54 UTC, "Naveen N. Rao" wrote:
> Introduce macros to encode the DTL enable mask fields and use those
> instead of hardcoding numbers.
>
> Acked-by: Nathan Lynch <nathanl@linux.ibm.com>
> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Series applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/515bbc8ab488e4bc16fe26df097502c04d3649d4
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/perf/24x7: use rb_entry
From: Michael Ellerman @ 2019-07-08 1:19 UTC (permalink / raw)
To: Geliang Tang, Benjamin Herrenschmidt, Paul Mackerras,
Sukadev Bhattiprolu, Alexey Kardashevskiy, David Gibson
Cc: Geliang Tang, linuxppc-dev, linux-kernel
In-Reply-To: <38870b7604726c87e468f365ebe9236994c33f29.1482203132.git.geliangtang@gmail.com>
On Tue, 2016-12-20 at 14:02:17 UTC, Geliang Tang wrote:
> To make the code clearer, use rb_entry() instead of container_of() to
> deal with rbtree.
>
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/c197922f0a8072d286dff8001f8ad0d4b95ec1dd
cheers
^ permalink raw reply
* Re: [PATCH] arch: powerpc: Kconfig: pedantic formatting
From: Michael Ellerman @ 2019-07-08 1:19 UTC (permalink / raw)
To: Enrico Weigelt, metux IT consult, linux-kernel
Cc: oss, alistair, linuxppc-dev, kvm-ppc
In-Reply-To: <1562169853-12593-1-git-send-email-info@metux.net>
On Wed, 2019-07-03 at 16:04:13 UTC, "Enrico Weigelt, metux IT consult" wrote:
> Formatting of Kconfig files doesn't look so pretty, so let the
> Great White Handkerchief come around and clean it up.
>
> Also convert "---help---" as requested on lkml.
>
> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/4f44e8aeaf1937d9148dfcc4c028cd8aff27902e
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/cell: set no_llseek in spufs_cntl_fops
From: Michael Ellerman @ 2019-07-08 1:19 UTC (permalink / raw)
To: Geliang Tang, Jeremy Kerr, Arnd Bergmann, Benjamin Herrenschmidt,
Paul Mackerras
Cc: Geliang Tang, linuxppc-dev, linux-kernel
In-Reply-To: <2b82a1562fc18d9cef80ad2481957ea2f30f9825.1493799907.git.geliangtang@gmail.com>
On Sat, 2017-05-06 at 15:37:20 UTC, Geliang Tang wrote:
> In spufs_cntl_fops, since we use nonseekable_open() to open, we
> should use no_llseek() to seek, not generic_file_llseek().
>
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/658829dfe75c49e879e0c4c9cbcd3bd1e4fbdcf5
cheers
^ permalink raw reply
* Re: [PATCH] mm/kprobes: Add generic kprobe_fault_handler() fallback definition
From: Anshuman Khandual @ 2019-07-08 3:33 UTC (permalink / raw)
To: Masami Hiramatsu
Cc: Kate Stewart, Mark Rutland, Rich Felker, linux-ia64, linux-sh,
Heiko Carstens, linux-mips, linux-mm, Paul Mackerras,
H. Peter Anvin, sparclinux, Will Deacon, linux-s390,
Yoshinori Sato, x86, Russell King, Anil S Keshavamurthy,
Christian Borntraeger, Ingo Molnar, linux-arm-kernel,
Catalin Marinas, James Hogan, linux-snps-arc, Guenter Roeck,
Fenghua Yu, Vasily Gorbik, linuxppc-dev, Naveen N. Rao,
Borislav Petkov, Thomas Gleixner, Allison Randal, Tony Luck,
Richard Fontana, Vineet Gupta, linux-kernel, Ralf Baechle,
Paul Burton, Greg Kroah-Hartman, Andrew Morton, Enrico Weigelt,
David S. Miller
In-Reply-To: <20190705193028.f9e08fe9cf1ee86bc5c0bb82@kernel.org>
On 07/05/2019 04:00 PM, Masami Hiramatsu wrote:
> Hi Anshuman,
Hello Masami,
>
> On Fri, 5 Jul 2019 11:00:29 +0530
> Anshuman Khandual <anshuman.khandual@arm.com> wrote:
>
>> Architectures like parisc enable CONFIG_KROBES without having a definition
>> for kprobe_fault_handler() which results in a build failure.
>
> Hmm, as far as I can see, kprobe_fault_handler() is closed inside each arch
> specific code. The reason why include/linux/kprobes.h defines
> dummy inline function is only for !CONFIG_KPROBES case.
IIRC Andrew mentioned [1] that we should remove this stub from the generic kprobes
header because this is very much architecture specific. As we see in this proposed
patch, except x86 there is no other current user which actually calls this from
some where when CONFIG_KPROBES is not enabled.
[1] https://www.spinics.net/lists/linux-mm/msg182649.html
>
>> Arch needs to
>> provide kprobe_fault_handler() as it is platform specific and cannot have
>> a generic working alternative. But in the event when platform lacks such a
>> definition there needs to be a fallback.
>
> Wait, indeed that each arch need to implement it, but that is for calling
> kprobe->fault_handler() as user expected.
> Hmm, why not fixing those architecture implementations?
After the recent change which introduced a generic kprobe_page_fault() every
architecture enabling CONFIG_KPROBES must have a kprobe_fault_handler() which
was not the case earlier. Architectures like parisc which does enable KPROBES but
never used (kprobe_page_fault or kprobe->fault_handler) kprobe_fault_handler() now
needs one as well. I am not sure and will probably require inputs from arch parsic
folks whether it at all needs one. We dont have a stub or fallback definition for
kprobe_fault_handler() when CONFIG_KPROBES is enabled just to prevent a build
failure in such cases.
In such a situation it might be better defining a stub symbol fallback than to try
to implement one definition which the architecture previously never needed or used.
AFAICS there is no generic MM callers for kprobe_fault_handler() as well which would
have made it mandatory for parisc to define a real one.
>
>> This adds a stub kprobe_fault_handler() definition which not only prevents
>> a build failure but also makes sure that kprobe_page_fault() if called will
>> always return negative in absence of a sane platform specific alternative.
>
> I don't like introducing this complicated macro only for avoiding (not fixing)
> build error. To fix that, kprobes on parisc should implement kprobe_fault_handler
> correctly (and call kprobe->fault_handler).
As I mentioned before parsic might not need a real one. But you are right this
complicated (if perceived as such) change can be just avoided at least for the
build failure problem by just defining a stub definition kprobe_fault_handler()
for arch parsic when CONFIG_KPROBES is enabled. But this patch does some more
and solves the kprobe_fault_handler() symbol dependency in a more generic way and
forces kprobe_page_fault() to fail in absence a real arch kprobe_fault_handler().
Is not it worth solving in this way ?
>
> BTW, even if you need such generic stub, please use a weak function instead
> of macros for every arch headers.
There is a bit problem with that. The existing definitions are with different
signatures and an weak function will need them to be exact same for override
requiring more code changes. Hence choose to go with a macro in each header.
arch/arc/include/asm/kprobes.h:int kprobe_fault_handler(struct pt_regs *regs, unsigned long cause);
arch/arm/include/asm/kprobes.h:int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr);
arch/arm64/include/asm/kprobes.h:int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr);
arch/ia64/include/asm/kprobes.h:extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
arch/powerpc/include/asm/kprobes.h:extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
arch/s390/include/asm/kprobes.h:int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
arch/sh/include/asm/kprobes.h:extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
arch/sparc/include/asm/kprobes.h:int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
arch/x86/include/asm/kprobes.h:extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
>
>> While here wrap kprobe_page_fault() in CONFIG_KPROBES. This enables stud
>> definitions for generic kporbe_fault_handler() and kprobes_built_in() can
>> just be dropped. Only on x86 it needs to be added back locally as it gets
>> used in a !CONFIG_KPROBES function do_general_protection().
>
> If you want to remove kprobes_built_in(), you should replace it with
> IS_ENABLED(CONFIG_KPROBES), instead of this...
Apart from kprobes_built_in() the intent was to remove !CONFIG_KPROBES
stub for kprobe_fault_handler() as well which required making generic
kprobe_page_fault() to be empty in such case.
^ permalink raw reply
* Re: [PATCH] powerpc/hw_breakpoint: move instruction stepping out of hw_breakpoint_handler()
From: Ravi Bangoria @ 2019-07-08 3:40 UTC (permalink / raw)
To: Christophe Leroy
Cc: Ravi Bangoria, linux-kernel, Paul Mackerras, linuxppc-dev
In-Reply-To: <bef43f48-fa40-284e-a299-bc73ebc3e725@c-s.fr>
On 7/6/19 1:56 PM, Christophe Leroy wrote:
>
>
> Le 03/07/2019 à 08:20, Ravi Bangoria a écrit :
>>
>>
>> On 6/28/19 9:25 PM, Christophe Leroy wrote:
>>> On 8xx, breakpoints stop after executing the instruction, so
>>> stepping/emulation is not needed. Move it into a sub-function and
>>> remove the #ifdefs.
>>>
>>> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>>> ---
>>
>> Reviewed-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
>>
>> Just one neat below...
>
> Thanks for the review.
>
>>
>> [...]
>>
>>> -#ifndef CONFIG_PPC_8xx
>>> - /* Do not emulate user-space instructions, instead single-step them */
>>> - if (user_mode(regs)) {
>>> - current->thread.last_hit_ubp = bp;
>>> - regs->msr |= MSR_SE;
>>> + if (!IS_ENABLED(CONFIG_PPC_8xx) && !stepping_handler(regs, bp, info->address))
>>
>> May be split this line. It's 86 chars long and checkpatch.pl is warning
>> about this:
>
> Didn't you use arch/powerpc/tools/checkpatch.sh ?
>
> powerpc accepts 90 chars per line.
Hmm.. wasn't aware of it. Thanks!
^ permalink raw reply
* Re: [PATCH v9 10/10] selftests: add openat2(2) selftests
From: Aleksa Sarai @ 2019-07-08 5:47 UTC (permalink / raw)
To: Michael Ellerman
Cc: linux-ia64, linux-sh, Alexei Starovoitov, linux-kernel,
David Howells, linux-kselftest, sparclinux, Shuah Khan,
linux-arch, linux-s390, Tycho Andersen, Aleksa Sarai,
linux-arm-kernel, linux-mips, linux-xtensa, Kees Cook,
Arnd Bergmann, Jann Horn, linuxppc-dev, linux-m68k, Al Viro,
Andy Lutomirski, Shuah Khan, David Drysdale, Christian Brauner,
J. Bruce Fields, linux-parisc, linux-api, Chanho Min, Jeff Layton,
Oleg Nesterov, Eric Biederman, linux-alpha, linux-fsdevel,
Andrew Morton, Linus Torvalds, containers
In-Reply-To: <878st9iax4.fsf@concordia.ellerman.id.au>
[-- Attachment #1: Type: text/plain, Size: 1620 bytes --]
On 2019-07-08, Michael Ellerman <mpe@ellerman.id.au> wrote:
> Aleksa Sarai <cyphar@cyphar.com> writes:
> > diff --git a/tools/testing/selftests/openat2/Makefile b/tools/testing/selftests/openat2/Makefile
> > new file mode 100644
> > index 000000000000..8235a49928f6
> > --- /dev/null
> > +++ b/tools/testing/selftests/openat2/Makefile
> > @@ -0,0 +1,12 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +
> > +CFLAGS += -Wall -O2 -g
> > +TEST_GEN_PROGS := linkmode_test resolve_test rename_attack_test
> > +
> > +include ../lib.mk
> > +
> > +$(OUTPUT)/linkmode_test: linkmode_test.c helpers.o
> > +$(OUTPUT)/rename_attack_test: rename_attack_test.c helpers.o
> > +$(OUTPUT)/resolve_test: resolve_test.c helpers.o
>
> You don't need to tell make that foo depends on foo.c.
>
> Also if you make the dependency be on helpers.c then you won't get an
> intermediate helpers.o, and then you don't need to clean it.
>
> So the above three lines could just be:
>
> $(TEST_GEN_PROGS): helpers.c
I had some trouble getting this to work (hence why I went with the
version in the patch), but it looks like this works. I'll include it in
the next set.
> > +EXTRA_CLEAN = helpers.o $(wildcard /tmp/ksft-openat2-*)
>
> If you follow my advice above you don't need helpers.o in there.
>
> Deleting things from /tmp is also a bit fishy on shared machines, ie. it
> will error if those files happen to be owned by another user.
Good point. I'll drop that hunk in the next set.
Thanks!
--
Aleksa Sarai
Senior Software Engineer (Containers)
SUSE Linux GmbH
<https://www.cyphar.com/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply
* [PATCH] powerpc/irq: Don't WARN continuously in arch_local_irq_restore()
From: Michael Ellerman @ 2019-07-08 6:10 UTC (permalink / raw)
To: linuxppc-dev; +Cc: npiggin
When CONFIG_PPC_IRQ_SOFT_MASK_DEBUG is enabled (uncommon), we have a
series of WARN_ON's in arch_local_irq_restore().
These are "should never happen" conditions, but if they do happen they
can flood the console and render the system unusable. So switch them
to WARN_ON_ONCE().
Fixes: e2b36d591720 ("powerpc/64: Don't trace code that runs with the soft irq mask unreconciled")
Fixes: 9b81c0211c24 ("powerpc/64s: make PACA_IRQ_HARD_DIS track MSR[EE] closely")
Fixes: 7c0482e3d055 ("powerpc/irq: Fix another case of lazy IRQ state getting out of sync")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/kernel/irq.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index ada901af4950..c9a6eac3075c 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -259,7 +259,7 @@ notrace void arch_local_irq_restore(unsigned long mask)
irq_happened = get_irq_happened();
if (!irq_happened) {
#ifdef CONFIG_PPC_IRQ_SOFT_MASK_DEBUG
- WARN_ON(!(mfmsr() & MSR_EE));
+ WARN_ON_ONCE(!(mfmsr() & MSR_EE));
#endif
return;
}
@@ -272,7 +272,7 @@ notrace void arch_local_irq_restore(unsigned long mask)
*/
if (!(irq_happened & PACA_IRQ_HARD_DIS)) {
#ifdef CONFIG_PPC_IRQ_SOFT_MASK_DEBUG
- WARN_ON(!(mfmsr() & MSR_EE));
+ WARN_ON_ONCE(!(mfmsr() & MSR_EE));
#endif
__hard_irq_disable();
#ifdef CONFIG_PPC_IRQ_SOFT_MASK_DEBUG
@@ -283,7 +283,7 @@ notrace void arch_local_irq_restore(unsigned long mask)
* warn if we are wrong. Only do that when IRQ tracing
* is enabled as mfmsr() can be costly.
*/
- if (WARN_ON(mfmsr() & MSR_EE))
+ if (WARN_ON_ONCE(mfmsr() & MSR_EE))
__hard_irq_disable();
#endif
}
--
2.20.1
^ permalink raw reply related
* [PATCH] cpufreq/pasemi: fix an use-after-free in pas_cpufreq_cpu_init()
From: Wen Yang @ 2019-07-08 6:19 UTC (permalink / raw)
To: linux-kernel
Cc: wang.yi59, linux-pm, Viresh Kumar, Rafael J. Wysocki, xue.zhihong,
cheng.shengyu, linuxppc-dev, Wen Yang
The cpu variable is still being used in the of_get_property() call
after the of_node_put() call, which may result in use-after-free.
Fixes: a9acc26b75f ("cpufreq/pasemi: fix possible object reference leak")
Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/cpufreq/pasemi-cpufreq.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/pasemi-cpufreq.c b/drivers/cpufreq/pasemi-cpufreq.c
index 6b1e4ab..d2dd47b 100644
--- a/drivers/cpufreq/pasemi-cpufreq.c
+++ b/drivers/cpufreq/pasemi-cpufreq.c
@@ -132,7 +132,6 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
cpu = of_get_cpu_node(policy->cpu, NULL);
- of_node_put(cpu);
if (!cpu)
goto out;
@@ -141,15 +140,15 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
dn = of_find_compatible_node(NULL, NULL,
"pasemi,pwrficient-sdc");
if (!dn)
- goto out;
+ goto out_put_cpu_node;
err = of_address_to_resource(dn, 0, &res);
of_node_put(dn);
if (err)
- goto out;
+ goto out_put_cpu_node;
sdcasr_mapbase = ioremap(res.start + SDCASR_OFFSET, 0x2000);
if (!sdcasr_mapbase) {
err = -EINVAL;
- goto out;
+ goto out_put_cpu_node;
}
dn = of_find_compatible_node(NULL, NULL, "1682m-gizmo");
@@ -177,6 +176,7 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
err = -EINVAL;
goto out_unmap_sdcpwr;
}
+ of_node_put(cpu);
/* we need the freq in kHz */
max_freq = *max_freqp / 1000;
@@ -203,6 +203,8 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
out_unmap_sdcasr:
iounmap(sdcasr_mapbase);
+out_put_cpu_node:
+ of_node_put(cpu);
out:
return err;
}
--
2.9.5
^ permalink raw reply related
* Re: [PATCH] cpufreq/pasemi: fix an use-after-free in pas_cpufreq_cpu_init()
From: Viresh Kumar @ 2019-07-08 6:27 UTC (permalink / raw)
To: Wen Yang
Cc: wang.yi59, linux-pm, Rafael J. Wysocki, linux-kernel, xue.zhihong,
cheng.shengyu, linuxppc-dev
In-Reply-To: <1562566745-7447-1-git-send-email-wen.yang99@zte.com.cn>
On 08-07-19, 14:19, Wen Yang wrote:
> The cpu variable is still being used in the of_get_property() call
> after the of_node_put() call, which may result in use-after-free.
>
> Fixes: a9acc26b75f ("cpufreq/pasemi: fix possible object reference leak")
> Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-pm@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
> drivers/cpufreq/pasemi-cpufreq.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
I will suggest some changes here.
> diff --git a/drivers/cpufreq/pasemi-cpufreq.c b/drivers/cpufreq/pasemi-cpufreq.c
> index 6b1e4ab..d2dd47b 100644
> --- a/drivers/cpufreq/pasemi-cpufreq.c
> +++ b/drivers/cpufreq/pasemi-cpufreq.c
> @@ -132,7 +132,6 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
Don't initialize "err" anymore.
> cpu = of_get_cpu_node(policy->cpu, NULL);
>
> - of_node_put(cpu);
> if (!cpu)
> goto out;
Do return -ENODEV; here.
>
> @@ -141,15 +140,15 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
> dn = of_find_compatible_node(NULL, NULL,
> "pasemi,pwrficient-sdc");
> if (!dn)
> - goto out;
> + goto out_put_cpu_node;
> err = of_address_to_resource(dn, 0, &res);
> of_node_put(dn);
> if (err)
> - goto out;
> + goto out_put_cpu_node;
> sdcasr_mapbase = ioremap(res.start + SDCASR_OFFSET, 0x2000);
> if (!sdcasr_mapbase) {
> err = -EINVAL;
> - goto out;
> + goto out_put_cpu_node;
> }
Don't do above changes.
>
> dn = of_find_compatible_node(NULL, NULL, "1682m-gizmo");
> @@ -177,6 +176,7 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
> err = -EINVAL;
> goto out_unmap_sdcpwr;
> }
> + of_node_put(cpu);
>
> /* we need the freq in kHz */
> max_freq = *max_freqp / 1000;
> @@ -203,6 +203,8 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
>
> out_unmap_sdcasr:
> iounmap(sdcasr_mapbase);
> +out_put_cpu_node:
Don't add this label, instead use "out" for also having the below
code.
> + of_node_put(cpu);
> out:
> return err;
> }
> --
> 2.9.5
--
viresh
^ permalink raw reply
* [PATCH V3 0/2] recover the channel swap after xrun
From: shengjiu.wang @ 2019-07-08 6:38 UTC (permalink / raw)
To: timur, nicoleotsuka, Xiubo.Lee, festevam, broonie, alsa-devel
Cc: linuxppc-dev, linux-kernel
From: Shengjiu Wang <shengjiu.wang@nxp.com>
recover the channel swap after xrun
Shengjiu Wang (2):
ASoC: fsl_esai: Wrap some operations to be functions
ASoC: fsl_esai: recover the channel swap after xrun
sound/soc/fsl/fsl_esai.c | 270 ++++++++++++++++++++++++++++-----------
1 file changed, 197 insertions(+), 73 deletions(-)
Changes in V3
- update code sytle.
Changes in v2
- add one patch for wrap operations to functions.
- fix some coding style issue
--
2.21.0
^ permalink raw reply
* [PATCH V3 1/2] ASoC: fsl_esai: Wrap some operations to be functions
From: shengjiu.wang @ 2019-07-08 6:38 UTC (permalink / raw)
To: timur, nicoleotsuka, Xiubo.Lee, festevam, broonie, alsa-devel
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <cover.1562566531.git.shengjiu.wang@nxp.com>
From: Shengjiu Wang <shengjiu.wang@nxp.com>
Extract the operation to be functions, to improve the
readability.
In this patch, fsl_esai_hw_init, fsl_esai_register_restore,
fsl_esai_trigger_start and fsl_esai_trigger_stop are
extracted.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
---
sound/soc/fsl/fsl_esai.c | 192 ++++++++++++++++++++++++---------------
1 file changed, 119 insertions(+), 73 deletions(-)
diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index 10d2210c91ef..ab460d6d7432 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -35,6 +35,7 @@
* @fifo_depth: depth of tx/rx FIFO
* @slot_width: width of each DAI slot
* @slots: number of slots
+ * @channels: channel num for tx or rx
* @hck_rate: clock rate of desired HCKx clock
* @sck_rate: clock rate of desired SCKx clock
* @hck_dir: the direction of HCKx pads
@@ -57,6 +58,7 @@ struct fsl_esai {
u32 slots;
u32 tx_mask;
u32 rx_mask;
+ u32 channels[2];
u32 hck_rate[2];
u32 sck_rate[2];
bool hck_dir[2];
@@ -543,64 +545,132 @@ static int fsl_esai_hw_params(struct snd_pcm_substream *substream,
return 0;
}
-static int fsl_esai_trigger(struct snd_pcm_substream *substream, int cmd,
- struct snd_soc_dai *dai)
+static int fsl_esai_hw_init(struct fsl_esai *esai_priv)
{
- struct fsl_esai *esai_priv = snd_soc_dai_get_drvdata(dai);
- bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
- u8 i, channels = substream->runtime->channels;
+ struct platform_device *pdev = esai_priv->pdev;
+ int ret;
+
+ /* Reset ESAI unit */
+ ret = regmap_update_bits(esai_priv->regmap, REG_ESAI_ECR,
+ ESAI_ECR_ESAIEN_MASK | ESAI_ECR_ERST_MASK,
+ ESAI_ECR_ESAIEN | ESAI_ECR_ERST);
+ if (ret) {
+ dev_err(&pdev->dev, "failed to reset ESAI: %d\n", ret);
+ return ret;
+ }
+
+ /*
+ * We need to enable ESAI so as to access some of its registers.
+ * Otherwise, we would fail to dump regmap from user space.
+ */
+ ret = regmap_update_bits(esai_priv->regmap, REG_ESAI_ECR,
+ ESAI_ECR_ESAIEN_MASK | ESAI_ECR_ERST_MASK,
+ ESAI_ECR_ESAIEN);
+ if (ret) {
+ dev_err(&pdev->dev, "failed to enable ESAI: %d\n", ret);
+ return ret;
+ }
+
+ regmap_update_bits(esai_priv->regmap, REG_ESAI_PRRC,
+ ESAI_PRRC_PDC_MASK, 0);
+ regmap_update_bits(esai_priv->regmap, REG_ESAI_PCRC,
+ ESAI_PCRC_PC_MASK, 0);
+
+ return 0;
+}
+
+static int fsl_esai_register_restore(struct fsl_esai *esai_priv)
+{
+ int ret;
+
+ /* FIFO reset for safety */
+ regmap_update_bits(esai_priv->regmap, REG_ESAI_TFCR,
+ ESAI_xFCR_xFR, ESAI_xFCR_xFR);
+ regmap_update_bits(esai_priv->regmap, REG_ESAI_RFCR,
+ ESAI_xFCR_xFR, ESAI_xFCR_xFR);
+
+ regcache_mark_dirty(esai_priv->regmap);
+ ret = regcache_sync(esai_priv->regmap);
+ if (ret)
+ return ret;
+
+ /* FIFO reset done */
+ regmap_update_bits(esai_priv->regmap, REG_ESAI_TFCR, ESAI_xFCR_xFR, 0);
+ regmap_update_bits(esai_priv->regmap, REG_ESAI_RFCR, ESAI_xFCR_xFR, 0);
+
+ return 0;
+}
+
+static void fsl_esai_trigger_start(struct fsl_esai *esai_priv, bool tx)
+{
+ u8 i, channels = esai_priv->channels[tx];
u32 pins = DIV_ROUND_UP(channels, esai_priv->slots);
u32 mask;
+ regmap_update_bits(esai_priv->regmap, REG_ESAI_xFCR(tx),
+ ESAI_xFCR_xFEN_MASK, ESAI_xFCR_xFEN);
+
+ /* Write initial words reqiured by ESAI as normal procedure */
+ for (i = 0; tx && i < channels; i++)
+ regmap_write(esai_priv->regmap, REG_ESAI_ETDR, 0x0);
+
+ /*
+ * When set the TE/RE in the end of enablement flow, there
+ * will be channel swap issue for multi data line case.
+ * In order to workaround this issue, we switch the bit
+ * enablement sequence to below sequence
+ * 1) clear the xSMB & xSMA: which is done in probe and
+ * stop state.
+ * 2) set TE/RE
+ * 3) set xSMB
+ * 4) set xSMA: xSMA is the last one in this flow, which
+ * will trigger esai to start.
+ */
+ regmap_update_bits(esai_priv->regmap, REG_ESAI_xCR(tx),
+ tx ? ESAI_xCR_TE_MASK : ESAI_xCR_RE_MASK,
+ tx ? ESAI_xCR_TE(pins) : ESAI_xCR_RE(pins));
+ mask = tx ? esai_priv->tx_mask : esai_priv->rx_mask;
+
+ regmap_update_bits(esai_priv->regmap, REG_ESAI_xSMB(tx),
+ ESAI_xSMB_xS_MASK, ESAI_xSMB_xS(mask));
+ regmap_update_bits(esai_priv->regmap, REG_ESAI_xSMA(tx),
+ ESAI_xSMA_xS_MASK, ESAI_xSMA_xS(mask));
+}
+
+static void fsl_esai_trigger_stop(struct fsl_esai *esai_priv, bool tx)
+{
+ regmap_update_bits(esai_priv->regmap, REG_ESAI_xCR(tx),
+ tx ? ESAI_xCR_TE_MASK : ESAI_xCR_RE_MASK, 0);
+ regmap_update_bits(esai_priv->regmap, REG_ESAI_xSMA(tx),
+ ESAI_xSMA_xS_MASK, 0);
+ regmap_update_bits(esai_priv->regmap, REG_ESAI_xSMB(tx),
+ ESAI_xSMB_xS_MASK, 0);
+
+ /* Disable and reset FIFO */
+ regmap_update_bits(esai_priv->regmap, REG_ESAI_xFCR(tx),
+ ESAI_xFCR_xFR | ESAI_xFCR_xFEN, ESAI_xFCR_xFR);
+ regmap_update_bits(esai_priv->regmap, REG_ESAI_xFCR(tx),
+ ESAI_xFCR_xFR, 0);
+}
+
+static int fsl_esai_trigger(struct snd_pcm_substream *substream, int cmd,
+ struct snd_soc_dai *dai)
+{
+ struct fsl_esai *esai_priv = snd_soc_dai_get_drvdata(dai);
+ bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
+
+ esai_priv->channels[tx] = substream->runtime->channels;
+
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
- regmap_update_bits(esai_priv->regmap, REG_ESAI_xFCR(tx),
- ESAI_xFCR_xFEN_MASK, ESAI_xFCR_xFEN);
-
- /* Write initial words reqiured by ESAI as normal procedure */
- for (i = 0; tx && i < channels; i++)
- regmap_write(esai_priv->regmap, REG_ESAI_ETDR, 0x0);
-
- /*
- * When set the TE/RE in the end of enablement flow, there
- * will be channel swap issue for multi data line case.
- * In order to workaround this issue, we switch the bit
- * enablement sequence to below sequence
- * 1) clear the xSMB & xSMA: which is done in probe and
- * stop state.
- * 2) set TE/RE
- * 3) set xSMB
- * 4) set xSMA: xSMA is the last one in this flow, which
- * will trigger esai to start.
- */
- regmap_update_bits(esai_priv->regmap, REG_ESAI_xCR(tx),
- tx ? ESAI_xCR_TE_MASK : ESAI_xCR_RE_MASK,
- tx ? ESAI_xCR_TE(pins) : ESAI_xCR_RE(pins));
- mask = tx ? esai_priv->tx_mask : esai_priv->rx_mask;
-
- regmap_update_bits(esai_priv->regmap, REG_ESAI_xSMB(tx),
- ESAI_xSMB_xS_MASK, ESAI_xSMB_xS(mask));
- regmap_update_bits(esai_priv->regmap, REG_ESAI_xSMA(tx),
- ESAI_xSMA_xS_MASK, ESAI_xSMA_xS(mask));
-
+ fsl_esai_trigger_start(esai_priv, tx);
break;
case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
- regmap_update_bits(esai_priv->regmap, REG_ESAI_xCR(tx),
- tx ? ESAI_xCR_TE_MASK : ESAI_xCR_RE_MASK, 0);
- regmap_update_bits(esai_priv->regmap, REG_ESAI_xSMA(tx),
- ESAI_xSMA_xS_MASK, 0);
- regmap_update_bits(esai_priv->regmap, REG_ESAI_xSMB(tx),
- ESAI_xSMB_xS_MASK, 0);
-
- /* Disable and reset FIFO */
- regmap_update_bits(esai_priv->regmap, REG_ESAI_xFCR(tx),
- ESAI_xFCR_xFR | ESAI_xFCR_xFEN, ESAI_xFCR_xFR);
- regmap_update_bits(esai_priv->regmap, REG_ESAI_xFCR(tx),
- ESAI_xFCR_xFR, 0);
+ fsl_esai_trigger_stop(esai_priv, tx);
break;
default:
return -EINVAL;
@@ -866,22 +936,9 @@ static int fsl_esai_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, esai_priv);
- /* Reset ESAI unit */
- ret = regmap_write(esai_priv->regmap, REG_ESAI_ECR, ESAI_ECR_ERST);
- if (ret) {
- dev_err(&pdev->dev, "failed to reset ESAI: %d\n", ret);
+ ret = fsl_esai_hw_init(esai_priv);
+ if (ret)
return ret;
- }
-
- /*
- * We need to enable ESAI so as to access some of its registers.
- * Otherwise, we would fail to dump regmap from user space.
- */
- ret = regmap_write(esai_priv->regmap, REG_ESAI_ECR, ESAI_ECR_ESAIEN);
- if (ret) {
- dev_err(&pdev->dev, "failed to enable ESAI: %d\n", ret);
- return ret;
- }
esai_priv->tx_mask = 0xFFFFFFFF;
esai_priv->rx_mask = 0xFFFFFFFF;
@@ -955,20 +1012,10 @@ static int fsl_esai_runtime_resume(struct device *dev)
regcache_cache_only(esai->regmap, false);
- /* FIFO reset for safety */
- regmap_update_bits(esai->regmap, REG_ESAI_TFCR,
- ESAI_xFCR_xFR, ESAI_xFCR_xFR);
- regmap_update_bits(esai->regmap, REG_ESAI_RFCR,
- ESAI_xFCR_xFR, ESAI_xFCR_xFR);
-
- ret = regcache_sync(esai->regmap);
+ ret = fsl_esai_register_restore(esai);
if (ret)
goto err_regcache_sync;
- /* FIFO reset done */
- regmap_update_bits(esai->regmap, REG_ESAI_TFCR, ESAI_xFCR_xFR, 0);
- regmap_update_bits(esai->regmap, REG_ESAI_RFCR, ESAI_xFCR_xFR, 0);
-
return 0;
err_regcache_sync:
@@ -991,7 +1038,6 @@ static int fsl_esai_runtime_suspend(struct device *dev)
struct fsl_esai *esai = dev_get_drvdata(dev);
regcache_cache_only(esai->regmap, true);
- regcache_mark_dirty(esai->regmap);
if (!IS_ERR(esai->fsysclk))
clk_disable_unprepare(esai->fsysclk);
--
2.21.0
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox