Re: [PATCH] crypto: talitos - Fix sparse warnings

2020-10-06 Thread Herbert Xu
On Sat, Oct 03, 2020 at 07:15:53PM +0200, Christophe Leroy wrote:
>
> The following changes fix the sparse warnings with less churn:

Yes that works too.  Can you please submit this patch?

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [powerpc:next-test 76/183] arch/powerpc/kernel/vdso32/gettimeofday.S:40: Error: syntax error; found `@', expected `,'

2020-10-06 Thread Christophe Leroy




Le 06/10/2020 à 22:41, kernel test robot a écrit :

Hi Michael,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git 
next-test
head:   72cdd117c449896c707fc6cfe5b90978160697d0
commit: 231b232df8f67e7d37af01259c21f2a131c3911e [76/183] powerpc/64: Make 
VDSO32 track COMPAT on 64-bit
config: powerpc-randconfig-r033-20201005 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 
1127662c6dc2a276839c75a42238b11a3ad00f32)


There has been already a discussion on this, see 
https://groups.google.com/g/clang-built-linux/c/ayNmi3HoNdY/m/ROdg7avVBwAJ


This apparently is a clang issue. The commit mentionned here is only exposing the issue, but the 
issue is not in the commit itself.


Regardless, this error should go away when we switch to the generic C VDSO.

Christophe


Re: [PATCH v2 3/4] powerpc/memhotplug: Make lmb size 64bit

2020-10-06 Thread Michael Ellerman
Nathan Lynch  writes:
> "Aneesh Kumar K.V"  writes:
>> @@ -322,12 +322,16 @@ static int pseries_remove_mem_node(struct device_node 
>> *np)
>>  /*
>>   * Find the base address and size of the memblock
>>   */
>> -regs = of_get_property(np, "reg", NULL);
>> -if (!regs)
>> +prop = of_get_property(np, "reg", NULL);
>> +if (!prop)
>>  return ret;
>>  
>> -base = be64_to_cpu(*(unsigned long *)regs);
>> -lmb_size = be32_to_cpu(regs[3]);
>> +/*
>> + * "reg" property represents (addr,size) tuple.
>> + */
>> +base = of_read_number(prop, mem_addr_cells);
>> +prop += mem_addr_cells;
>> +lmb_size = of_read_number(prop, mem_size_cells);
>
> Would of_n_size_cells() and of_n_addr_cells() work here?

Yes that should work and be cleaner.

cheers


[PATCH v2] powerpc/mm: Update tlbiel loop on POWER10

2020-10-06 Thread Aneesh Kumar K.V
With POWER10, single tlbiel instruction invalidates all the congruence
class of the TLB and hence we need to issue only one tlbiel with SET=0.

Signed-off-by: Aneesh Kumar K.V 
---
 arch/powerpc/kvm/book3s_hv.c |  7 ++-
 arch/powerpc/kvm/book3s_hv_builtin.c | 11 ++-
 arch/powerpc/mm/book3s64/radix_tlb.c | 23 ---
 3 files changed, 32 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 3bd3118c7633..00b5c5981db5 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -4939,7 +4939,12 @@ static int kvmppc_core_init_vm_hv(struct kvm *kvm)
 * Work out how many sets the TLB has, for the use of
 * the TLB invalidation loop in book3s_hv_rmhandlers.S.
 */
-   if (radix_enabled())
+   if (cpu_has_feature(CPU_FTR_ARCH_31)) {
+   /*
+* P10 will flush all the congruence class with a single tlbiel
+*/
+   kvm->arch.tlb_sets = 1;
+   } else if (radix_enabled())
kvm->arch.tlb_sets = POWER9_TLB_SETS_RADIX; /* 128 */
else if (cpu_has_feature(CPU_FTR_ARCH_300))
kvm->arch.tlb_sets = POWER9_TLB_SETS_HASH;  /* 256 */
diff --git a/arch/powerpc/kvm/book3s_hv_builtin.c 
b/arch/powerpc/kvm/book3s_hv_builtin.c
index 073617ce83e0..2803a4b01109 100644
--- a/arch/powerpc/kvm/book3s_hv_builtin.c
+++ b/arch/powerpc/kvm/book3s_hv_builtin.c
@@ -702,6 +702,7 @@ static void wait_for_sync(struct kvm_split_mode *sip, int 
phase)
 
 void kvmhv_p9_set_lpcr(struct kvm_split_mode *sip)
 {
+   int num_sets;
unsigned long rb, set;
 
/* wait for every other thread to get to real mode */
@@ -712,11 +713,19 @@ void kvmhv_p9_set_lpcr(struct kvm_split_mode *sip)
mtspr(SPRN_LPID, sip->lpidr_req);
isync();
 
+   /*
+* P10 will flush all the congruence class with a single tlbiel
+*/
+   if (cpu_has_feature(CPU_FTR_ARCH_31))
+   num_sets =  1;
+   else
+   num_sets = POWER9_TLB_SETS_RADIX;
+
/* Invalidate the TLB on thread 0 */
if (local_paca->kvm_hstate.tid == 0) {
sip->do_set = 0;
asm volatile("ptesync" : : : "memory");
-   for (set = 0; set < POWER9_TLB_SETS_RADIX; ++set) {
+   for (set = 0; set < num_sets; ++set) {
rb = TLBIEL_INVAL_SET_LPID +
(set << TLBIEL_INVAL_SET_SHIFT);
asm volatile(PPC_TLBIEL(%0, %1, 0, 0, 0) : :
diff --git a/arch/powerpc/mm/book3s64/radix_tlb.c 
b/arch/powerpc/mm/book3s64/radix_tlb.c
index 143b4fd396f0..9e76ba766b3c 100644
--- a/arch/powerpc/mm/book3s64/radix_tlb.c
+++ b/arch/powerpc/mm/book3s64/radix_tlb.c
@@ -56,14 +56,21 @@ static void tlbiel_all_isa300(unsigned int num_sets, 
unsigned int is)
if (early_cpu_has_feature(CPU_FTR_HVMODE)) {
/* MSR[HV] should flush partition scope translations first. */
tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 0);
-   for (set = 1; set < num_sets; set++)
-   tlbiel_radix_set_isa300(set, is, 0, RIC_FLUSH_TLB, 0);
+
+   if (!early_cpu_has_feature(CPU_FTR_ARCH_31)) {
+   for (set = 1; set < num_sets; set++)
+   tlbiel_radix_set_isa300(set, is, 0,
+   RIC_FLUSH_TLB, 0);
+   }
}
 
/* Flush process scoped entries. */
tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 1);
-   for (set = 1; set < num_sets; set++)
-   tlbiel_radix_set_isa300(set, is, 0, RIC_FLUSH_TLB, 1);
+
+   if (!early_cpu_has_feature(CPU_FTR_ARCH_31)) {
+   for (set = 1; set < num_sets; set++)
+   tlbiel_radix_set_isa300(set, is, 0, RIC_FLUSH_TLB, 1);
+   }
 
asm volatile("ptesync": : :"memory");
 }
@@ -300,9 +307,11 @@ static __always_inline void _tlbiel_pid(unsigned long pid, 
unsigned long ric)
return;
}
 
-   /* For the remaining sets, just flush the TLB */
-   for (set = 1; set < POWER9_TLB_SETS_RADIX ; set++)
-   __tlbiel_pid(pid, set, RIC_FLUSH_TLB);
+   if (!cpu_has_feature(CPU_FTR_ARCH_31)) {
+   /* For the remaining sets, just flush the TLB */
+   for (set = 1; set < POWER9_TLB_SETS_RADIX ; set++)
+   __tlbiel_pid(pid, set, RIC_FLUSH_TLB);
+   }
 
asm volatile("ptesync": : :"memory");
asm volatile(PPC_RADIX_INVALIDATE_ERAT_USER "; isync" : : :"memory");
-- 
2.26.2



Re: [PATCH v2 1/2] powerpc/rtas: Restrict RTAS requests from userspace

2020-10-06 Thread Andrew Donnellan

On 26/8/20 11:53 pm, Sasha Levin wrote:

How should we proceed with this patch?


mpe: I believe we came to the conclusion that we shouldn't put this in 
stable just yet?


--
Andrew Donnellan  OzLabs, ADL Canberra
a...@linux.ibm.com IBM Australia Limited


[PATCH 2/2] powerpc/pseries/eeh: Fix use of uninitialised variable

2020-10-06 Thread Oliver O'Halloran
If the RTAS call to query the PE address for a device fails we jump the
err: label where an error message is printed along with the return code.
However, the printed return code is from the "ret" variable which isn't set
at that point since we assigned the result to "addr" instead. Fix this by
consistently using the "ret" variable for the result of the RTAS call
helpers an dropping the "addr" local variable"

Fixes: 98ba956f6a38 ("powerpc/pseries/eeh: Rework device EEH PE determination")
Signed-off-by: Oliver O'Halloran 
---
 arch/powerpc/platforms/pseries/eeh_pseries.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c 
b/arch/powerpc/platforms/pseries/eeh_pseries.c
index d8fd5f7b2143..cf024fa37bda 100644
--- a/arch/powerpc/platforms/pseries/eeh_pseries.c
+++ b/arch/powerpc/platforms/pseries/eeh_pseries.c
@@ -363,7 +363,6 @@ void pseries_eeh_init_edev(struct pci_dn *pdn)
 {
struct eeh_pe pe, *parent;
struct eeh_dev *edev;
-   int addr;
u32 pcie_flags;
int ret;
 
@@ -422,8 +421,8 @@ void pseries_eeh_init_edev(struct pci_dn *pdn)
}
 
/* first up, find the pe_config_addr for the PE containing the device */
-   addr = pseries_eeh_get_pe_config_addr(pdn);
-   if (addr < 0) {
+   ret = pseries_eeh_get_pe_config_addr(pdn);
+   if (ret < 0) {
eeh_edev_dbg(edev, "Unable to find pe_config_addr\n");
goto err;
}
@@ -431,7 +430,7 @@ void pseries_eeh_init_edev(struct pci_dn *pdn)
/* Try enable EEH on the fake PE */
memset(&pe, 0, sizeof(struct eeh_pe));
pe.phb = pdn->phb;
-   pe.addr = addr;
+   pe.addr = ret;
 
eeh_edev_dbg(edev, "Enabling EEH on device\n");
ret = eeh_ops->set_option(&pe, EEH_OPT_ENABLE);
@@ -440,7 +439,7 @@ void pseries_eeh_init_edev(struct pci_dn *pdn)
goto err;
}
 
-   edev->pe_config_addr = addr;
+   edev->pe_config_addr = pe.addr;
 
eeh_add_flag(EEH_ENABLED);
 
-- 
2.26.2



[PATCH 1/2] powerpc/eeh: Delete eeh_pe->config_addr

2020-10-06 Thread Oliver O'Halloran
The eeh_pe->config_addr field was supposed to be removed in
commit 35d64734b643 ("powerpc/eeh: Clean up PE addressing") which made it
largely unused. Finish the job.

Signed-off-by: Oliver O'Halloran 
---
mpe: the Fixes SHA is from ppc/next, fold it into that if you want.
---
 arch/powerpc/include/asm/eeh.h | 1 -
 arch/powerpc/kernel/eeh.c  | 2 +-
 arch/powerpc/kernel/eeh_pe.c   | 4 ++--
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h
index dd6a4ac6c713..b1a5bba2e0b9 100644
--- a/arch/powerpc/include/asm/eeh.h
+++ b/arch/powerpc/include/asm/eeh.h
@@ -73,7 +73,6 @@ struct pci_dn;
 struct eeh_pe {
int type;   /* PE type: PHB/Bus/Device  */
int state;  /* PE EEH dependent mode*/
-   int config_addr;/* Traditional PCI address  */
int addr;   /* PE configuration address */
struct pci_controller *phb; /* Associated PHB   */
struct pci_bus *bus;/* Top PCI bus for bus PE   */
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index 87de8b798b2d..0e160dffcb86 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -466,7 +466,7 @@ int eeh_dev_check_failure(struct eeh_dev *edev)
return 0;
}
 
-   if (!pe->addr && !pe->config_addr) {
+   if (!pe->addr) {
eeh_stats.no_cfg_addr++;
return 0;
}
diff --git a/arch/powerpc/kernel/eeh_pe.c b/arch/powerpc/kernel/eeh_pe.c
index 61b7d4019051..845e024321d4 100644
--- a/arch/powerpc/kernel/eeh_pe.c
+++ b/arch/powerpc/kernel/eeh_pe.c
@@ -354,8 +354,8 @@ int eeh_pe_tree_insert(struct eeh_dev *edev, struct eeh_pe 
*new_pe_parent)
pr_err("%s: out of memory!\n", __func__);
return -ENOMEM;
}
-   pe->addr= edev->pe_config_addr;
-   pe->config_addr = edev->bdfn;
+
+   pe->addr = edev->pe_config_addr;
 
/*
 * Put the new EEH PE into hierarchy tree. If the parent
-- 
2.26.2



Re: [PATCH v5] powerpc/powernv/elog: Fix race while processing OPAL error log event.

2020-10-06 Thread Michael Ellerman
On Tue, 6 Oct 2020 23:20:51 +1100, Michael Ellerman wrote:
> Every error log reported by OPAL is exported to userspace through a
> sysfs interface and notified using kobject_uevent(). The userspace
> daemon (opal_errd) then reads the error log and acknowledges the error
> log is saved safely to disk. Once acknowledged the kernel removes the
> respective sysfs file entry causing respective resources to be
> released including kobject.
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/powernv/elog: Fix race while processing OPAL error log event.
  https://git.kernel.org/powerpc/c/aea948bb80b478ddc2448f7359d574387521a52d

cheers


Re: [PATCH v4] pseries/hotplug-memory: hot-add: skip redundant LMB lookup

2020-10-06 Thread Michael Ellerman
On Wed, 16 Sep 2020 09:51:22 -0500, Scott Cheloha wrote:
> During memory hot-add, dlpar_add_lmb() calls memory_add_physaddr_to_nid()
> to determine which node id (nid) to use when later calling __add_memory().
> 
> This is wasteful.  On pseries, memory_add_physaddr_to_nid() finds an
> appropriate nid for a given address by looking up the LMB containing the
> address and then passing that LMB to of_drconf_to_nid_single() to get the
> nid.  In dlpar_add_lmb() we get this address from the LMB itself.
> 
> [...]

Applied to powerpc/next.

[1/1] pseries/hotplug-memory: hot-add: skip redundant LMB lookup
  https://git.kernel.org/powerpc/c/72cdd117c449896c707fc6cfe5b90978160697d0

cheers


Re: [PATCH -next] powerpc/papr_scm: Fix warnings about undeclared variable

2020-10-06 Thread Michael Ellerman
On Fri, 18 Sep 2020 08:59:51 +, Wang Wensheng wrote:
> Build the kernel with 'make C=2':
> arch/powerpc/platforms/pseries/papr_scm.c:825:1: warning: symbol
> 'dev_attr_perf_stats' was not declared. Should it be static?

Applied to powerpc/next.

[1/1] powerpc/papr_scm: Fix warnings about undeclared variable
  https://git.kernel.org/powerpc/c/4366337490cbe5a35b50e83755be629a502ec7e2

cheers


Re: [PATCH v2 00/11] Optimization to improve CPU online/offline on Powerpc

2020-10-06 Thread Michael Ellerman
On Mon, 21 Sep 2020 15:26:42 +0530, Srikar Dronamraju wrote:
> Here are some optimizations and fixes to make CPU online/offline
> faster and hence result in faster bootup.
> 
> Its based on top of my v5 coregroup support patchset.
> https://lore.kernel.org/linuxppc-dev/20200810071834.92514-1-sri...@linux.vnet.ibm.com/t/#u
> 
> Anton reported that his 4096 cpu (1024 cores in a socket) was taking too
> long to boot. He also analyzed that most of the time was being spent on
> updating cpu_core_mask.
> 
> [...]

Applied to powerpc/next.

[01/11] powerpc/topology: Update topology_core_cpumask

https://git.kernel.org/powerpc/c/4bce545903fa0290e011cf118997717f0c4f4d20
[02/11] powerpc/smp: Stop updating cpu_core_mask

https://git.kernel.org/powerpc/c/4ca234a9cbd7c3a656b34dd98c8b156f70ed7849
[03/11] powerpc/smp: Remove get_physical_package_id

https://git.kernel.org/powerpc/c/e29e9ed665eeb6f98cd88672994ecf4aaefdb943
[04/11] powerpc/smp: Optimize remove_cpu_from_masks

https://git.kernel.org/powerpc/c/70edd4a7c753ba18e3e4bb9e97b6d85156cea738
[05/11] powerpc/smp: Limit CPUs traversed to within a node.

https://git.kernel.org/powerpc/c/53516d4abacfab1faaa075c1f79957abc3da358c
[06/11] powerpc/smp: Stop passing mask to update_mask_by_l2

https://git.kernel.org/powerpc/c/1f3a4181042107e32e44047e9dde990aced845b5
[07/11] powerpc/smp: Depend on cpu_l1_cache_map when adding CPUs

https://git.kernel.org/powerpc/c/661e3d42f99193b7fdd71467a87e48f6e597c285
[08/11] powerpc/smp: Check for duplicate topologies and consolidate

https://git.kernel.org/powerpc/c/375370a10d061d5c75c6bc5b09c5db4cc0b0fcfe
[09/11] powerpc/smp: Optimize update_mask_by_l2

https://git.kernel.org/powerpc/c/3ab33d6dc3e98e83b55732049e1d1d488207bb6d
[10/11] powerpc/smp: Move coregroup mask updation to a new function

https://git.kernel.org/powerpc/c/b8a97cb4599cda28bd3b3bc13042f5803b42ad65
[11/11] powerpc/smp: Optimize update_coregroup_mask

https://git.kernel.org/powerpc/c/70a94089d7f7fa91bc1795622426b3ed017ec71a

cheers


Re: [PATCH v2 1/9] powerpc/eeh: Rework EEH initialisation

2020-10-06 Thread Michael Ellerman
On Fri, 18 Sep 2020 19:30:42 +1000, Oliver O'Halloran wrote:
> Drop the EEH register / unregister ops thing and have the platform pass the
> ops structure into eeh_init() directly. This takes one initcall out of the
> EEH setup path and it means we're only doing EEH setup on the platforms
> which actually support it. It's also less code and generally easier to
> follow.
> 
> No functional changes.

Applied to powerpc/next.

[1/9] powerpc/eeh: Rework EEH initialisation
  https://git.kernel.org/powerpc/c/d125aedb404204de0579b16028096b2cc09e4deb
[2/9] powerpc/powernv: Stop using eeh_ops->init()
  https://git.kernel.org/powerpc/c/82a1ea21f1bac42eb8e3f77d5d249201855f2c85
[3/9] powerpc/pseries: Stop using eeh_ops->init()
  https://git.kernel.org/powerpc/c/1f8fa0cd6a848ff072bffe0ee776554387128f60
[4/9] powerpc/eeh: Delete eeh_ops->init
  https://git.kernel.org/powerpc/c/5d69e46a2104050c0a458c6bf6abba5f58f56e4c
[5/9] powerpc/eeh: Move EEH initialisation to an arch initcall
  https://git.kernel.org/powerpc/c/395ee2a2a15ba1c4c7c414db24dc3082ba8feab8
[6/9] powerpc/pseries/eeh: Clean up pe_config_addr lookups
  https://git.kernel.org/powerpc/c/f61c859feb5d19787c93d6b2b3d4beeca7260034
[7/9] powerpc/pseries/eeh: Rework device EEH PE determination
  https://git.kernel.org/powerpc/c/98ba956f6a3891b233466b8da064f17d16dc2090
[8/9] powerpc/pseries/eeh: Allow zero to be a valid PE configuration address
  https://git.kernel.org/powerpc/c/42de19d5ef71b91765266557705394e52954adb3
[9/9] powerpc/eeh: Clean up PE addressing
  https://git.kernel.org/powerpc/c/35d64734b64315f2c5716c5a0a380ed1ba8fbe4a

cheers


Re: [PATCH v2 1/2] powerpc: untangle cputable mce include

2020-10-06 Thread Michael Ellerman
On Wed, 16 Sep 2020 13:02:33 +1000, Nicholas Piggin wrote:
> Having cputable.h include mce.h means it pulls in a bunch of low level
> headers (e.g., synch.h) which then can't use CPU_FTR_ definitions.

Applied to powerpc/next.

[1/2] powerpc: untangle cputable mce include
  https://git.kernel.org/powerpc/c/9983efa83b0a98da33807ccf5c047e204fdcac4c
[2/2] powerpc/64s: Add cp_abort after tlbiel to invalidate copy-buffer address
  https://git.kernel.org/powerpc/c/05504b42562066ae27ce3e7dcec37f81dea476cb

cheers


Re: [PATCH] powerpc/pseries: add new branch prediction security bits for link stack

2020-10-06 Thread Michael Ellerman
On Tue, 25 Aug 2020 17:56:12 +1000, Nicholas Piggin wrote:
> The hypervisor interface has defined branch prediction security bits for
> handling the link stack. Wire them up.

Applied to powerpc/next.

[1/1] powerpc/pseries: add new branch prediction security bits for link stack
  https://git.kernel.org/powerpc/c/cdb1ea0276bd6a225aa1203b4829b8c3c0d4d069

cheers


Re: [PATCH 1/6] powerpc/64: fix irq replay missing preempt

2020-10-06 Thread Michael Ellerman
On Tue, 15 Sep 2020 21:46:45 +1000, Nicholas Piggin wrote:
> Prior to commit 3282a3da25bd ("powerpc/64: Implement soft interrupt
> replay in C"), replayed interrupts returned by the regular interrupt
> exit code, which performs preemption in case an interrupt had set
> need_resched.
> 
> This logic was missed by the conversion. Adding preempt_disable/enable
> around the interrupt replay and final irq enable will reschedule if
> needed.

Patches 1-5 applied to powerpc/next.

[1/6] powerpc/64: fix irq replay missing preempt
  https://git.kernel.org/powerpc/c/903fd31d3212ab72d564c68f6cfb5d04db68773e
[2/6] powerpc/64: fix irq replay pt_regs->softe value
  https://git.kernel.org/powerpc/c/2b48e96be2f9f7151197fd25dc41487054bc6f5b
[3/6] powerpc/64e: remove PACA_IRQ_EE_EDGE
  https://git.kernel.org/powerpc/c/012a9a97a8fd6c96d5ec64eb0583220490d95e73
[4/6] powerpc/64e: remove 64s specific interrupt soft-mask code
  https://git.kernel.org/powerpc/c/903dd1ff453e458fc7608ee4df42a6df16d3d1a0
[5/6] powerpc/64: make restore_interrupts 64e only
  https://git.kernel.org/powerpc/c/455575533c7aa294d3c0284d59a77ae9a60c0537

cheers


Re: [PATCH] powerpc: switch 85xx defconfigs from legacy ide to libata

2020-10-06 Thread Michael Ellerman
On Thu, 24 Sep 2020 06:13:10 +0200, Christoph Hellwig wrote:
> Switch the 85xx defconfigs from the soon to be removed legacy ide
> driver to libata.

Applied to powerpc/next.

[1/1] powerpc: switch 85xx defconfigs from legacy ide to libata
  https://git.kernel.org/powerpc/c/874dc62f548f28649ac3d7e31025b1e8cec3868a

cheers


Re: [PATCH v2] powerpc/tm: Save and restore AMR on treclaim and trechkpt

2020-10-06 Thread Michael Ellerman
On Sat, 19 Sep 2020 12:00:25 -0300, Gustavo Romero wrote:
> Althought AMR is stashed in the checkpoint area, currently we don't save
> it to the per thread checkpoint struct after a treclaim and so we don't
> restore it either from that struct when we trechkpt. As a consequence when
> the transaction is later rolled back the kernel space AMR value when the
> trechkpt was done appears in userspace.
> 
> That commit saves and restores AMR accordingly on treclaim and trechkpt.
> Since AMR value is also used in kernel space in other functions, it also
> takes care of stashing kernel live AMR into the stack before treclaim and
> before trechkpt, restoring it later, just before returning from tm_reclaim
> and __tm_recheckpoint.
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/tm: Save and restore AMR on treclaim and trechkpt
  https://git.kernel.org/powerpc/c/d0ffdee8ff01fb21085d835ee54dc8c1c4d19226

cheers


Re: [PATCH] powerpc: PPC_SECURE_BOOT should not require PowerNV

2020-10-06 Thread Michael Ellerman
On Thu, 24 Sep 2020 11:49:22 +1000, Daniel Axtens wrote:
> In commit 61f879d97ce4 ("powerpc/pseries: Detect secure and trusted
> boot state of the system.") we taught the kernel how to understand the
> secure-boot parameters used by a pseries guest.
> 
> However, CONFIG_PPC_SECURE_BOOT still requires PowerNV. I didn't
> catch this because pseries_le_defconfig includes support for
> PowerNV and so everything still worked. Indeed, most configs will.
> Nonetheless, technically PPC_SECURE_BOOT doesn't require PowerNV
> any more.
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc: PPC_SECURE_BOOT should not require PowerNV
  https://git.kernel.org/powerpc/c/5c5e46dad939b2bf4df04293ab9ac68abd7c1f55

cheers


Re: [PATCH v3] pseries/hotplug-memory: hot-add: skip redundant LMB lookup

2020-10-06 Thread Michael Ellerman
On Tue, 15 Sep 2020 14:46:47 -0500, Scott Cheloha wrote:
> During memory hot-add, dlpar_add_lmb() calls memory_add_physaddr_to_nid()
> to determine which node id (nid) to use when later calling __add_memory().
> 
> This is wasteful.  On pseries, memory_add_physaddr_to_nid() finds an
> appropriate nid for a given address by looking up the LMB containing the
> address and then passing that LMB to of_drconf_to_nid_single() to get the
> nid.  In dlpar_add_lmb() we get this address from the LMB itself.
> 
> [...]

Applied to powerpc/next.

[1/1] pseries/hotplug-memory: hot-add: skip redundant LMB lookup
  https://git.kernel.org/powerpc/c/72cdd117c449896c707fc6cfe5b90978160697d0

cheers


Re: [PATCH v4] pseries/hotplug-memory: hot-add: skip redundant LMB lookup

2020-10-06 Thread Michael Ellerman
On Wed, 16 Sep 2020 09:51:22 -0500, Scott Cheloha wrote:
> During memory hot-add, dlpar_add_lmb() calls memory_add_physaddr_to_nid()
> to determine which node id (nid) to use when later calling __add_memory().
> 
> This is wasteful.  On pseries, memory_add_physaddr_to_nid() finds an
> appropriate nid for a given address by looking up the LMB containing the
> address and then passing that LMB to of_drconf_to_nid_single() to get the
> nid.  In dlpar_add_lmb() we get this address from the LMB itself.
> 
> [...]

Applied to powerpc/next.

[1/1] pseries/hotplug-memory: hot-add: skip redundant LMB lookup
  https://git.kernel.org/powerpc/c/72cdd117c449896c707fc6cfe5b90978160697d0

cheers


Re: [PATCH v2 1/2] powerpc/rtas: Restrict RTAS requests from userspace

2020-10-06 Thread Michael Ellerman
On Thu, 20 Aug 2020 14:45:12 +1000, Andrew Donnellan wrote:
> A number of userspace utilities depend on making calls to RTAS to retrieve
> information and update various things.
> 
> The existing API through which we expose RTAS to userspace exposes more
> RTAS functionality than we actually need, through the sys_rtas syscall,
> which allows root (or anyone with CAP_SYS_ADMIN) to make any RTAS call they
> want with arbitrary arguments.
> 
> [...]

Applied to powerpc/next.

[1/2] powerpc/rtas: Restrict RTAS requests from userspace
  https://git.kernel.org/powerpc/c/bd59380c5ba4147dcbaad3e582b55ccfd120b764
[2/2] selftests/powerpc: Add a rtas_filter selftest
  https://git.kernel.org/powerpc/c/dc9af82ea0614bb138705d1f5230d53b3b1dfb83

cheers


Re: [PATCH V2] powerpc/perf: Exclude pmc5/6 from the irrelevant PMU group constraints

2020-10-06 Thread Michael Ellerman
On Mon, 21 Sep 2020 03:10:04 -0400, Athira Rajeev wrote:
> PMU counter support functions enforces event constraints for group of
> events to check if all events in a group can be monitored. Incase of
> event codes using PMC5 and PMC6 ( 500fa and 600f4 respectively ),
> not all constraints are applicable, say the threshold or sample bits.
> But current code includes pmc5 and pmc6 in some group constraints (like
> IC_DC Qualifier bits) which is actually not applicable and hence results
> in those events not getting counted when scheduled along with group of
> other events. Patch fixes this by excluding PMC5/6 from constraints
> which are not relevant for it.

Applied to powerpc/next.

[1/1] powerpc/perf: Exclude pmc5/6 from the irrelevant PMU group constraints
  https://git.kernel.org/powerpc/c/3b6c3adbb2fa42749c3d38cfc4d4d0b7e096bb7b

cheers


Re: linux-next: Fixes tag needs some work in the powerpc tree

2020-10-06 Thread Michael Ellerman
Stephen Rothwell  writes:
> Hi all,
>
> In commit
>
>   3b6c3adbb2fa ("powerpc/perf: Exclude pmc5/6 from the irrelevant PMU group 
> constraints")
>
> Fixes tag
>
>   Fixes: 7ffd948 ("powerpc/perf: factor out power8 pmu functions")
>
> has these problem(s):
>
>   - SHA1 should be at least 12 digits long
> Can be fixed by setting core.abbrev to 12 (or more) or (for git v2.11
> or later) just making sure it is not set (or set to "auto").
>
> Since Michael doesn't generally rebase his tree, this is more to be
> remebered for next time.

Yeah, if it was the wrong SHA I would rebase, but not just for a short
SHA.

You can avoid this in future by doing:

$ git config --add core.abbrev 12
$ git config --add pretty.fixes 'Fixes: %h ("%s")'
$ git config --add alias.showfix 'log -1 --format=fixes'

Then you can do:

$ git showfix 7ffd948
Fixes: 7ffd948fae4c ("powerpc/perf: factor out power8 pmu functions")


cheers


[powerpc:next] BUILD REGRESSION 72cdd117c449896c707fc6cfe5b90978160697d0

2020-10-06 Thread kernel test robot
ldefconfig
mips  ath79_defconfig
h8300   h8s-sim_defconfig
powerpcge_imp3a_defconfig
mips  malta_kvm_defconfig
csky alldefconfig
pariscgeneric-32bit_defconfig
sh   se7705_defconfig
sh   alldefconfig
arm  footbridge_defconfig
c6xevmc6472_defconfig
sh ecovec24_defconfig
arm   efm32_defconfig
mips   ip27_defconfig
powerpc   lite5200b_defconfig
arm   omap1_defconfig
m68k  hp300_defconfig
arm mv78xx0_defconfig
shedosk7705_defconfig
nios2alldefconfig
m68k   m5208evb_defconfig
powerpc   eiger_defconfig
mips tb0226_defconfig
mipsnlm_xlr_defconfig
sh   se7722_defconfig
m68km5272c3_defconfig
m68kdefconfig
powerpc mpc85xx_cds_defconfig
powerpc redwood_defconfig
sh  rsk7269_defconfig
arm  alldefconfig
armvt8500_v6_v7_defconfig
sh espt_defconfig
m68k   bvme6000_defconfig
powerpc mpc836x_mds_defconfig
powerpc mpc837x_rdb_defconfig
arc  axs101_defconfig
sh  landisk_defconfig
arm   sama5_defconfig
shsh7785lcr_defconfig
powerpc  iss476-smp_defconfig
mipsmaltaup_xpa_defconfig
mips  loongson3_defconfig
ia64 allmodconfig
ia64defconfig
ia64 allyesconfig
m68k allmodconfig
m68k allyesconfig
nios2   defconfig
arc  allyesconfig
nds32 allnoconfig
c6x  allyesconfig
nios2allyesconfig
cskydefconfig
alpha   defconfig
alphaallyesconfig
xtensa   allyesconfig
h8300allyesconfig
arc defconfig
sh   allmodconfig
parisc  defconfig
s390 allyesconfig
parisc   allyesconfig
s390defconfig
i386 allyesconfig
sparcallyesconfig
sparc   defconfig
i386defconfig
mips allyesconfig
mips allmodconfig
powerpc  allyesconfig
powerpc  allmodconfig
powerpc   allnoconfig
x86_64   randconfig-a004-20201006
x86_64   randconfig-a002-20201006
x86_64   randconfig-a001-20201006
x86_64   randconfig-a005-20201006
x86_64   randconfig-a003-20201006
x86_64   randconfig-a006-20201006
i386 randconfig-a006-20201005
i386 randconfig-a005-20201005
i386 randconfig-a001-20201005
i386 randconfig-a004-20201005
i386 randconfig-a003-20201005
i386 randconfig-a002-20201005
x86_64   randconfig-a012-20201005
x86_64   randconfig-a015-20201005
x86_64   randconfig-a014-20201005
x86_64   randconfig-a013-20201005
x86_64   randconfig-a011-20201005
x86_64   randconfig-a016-20201005
i386 randconfig-a014-20201005
i386 randconfig-a015-20201005
i386 randconfig-a013-20201005
i386 randconfig-a016-20201005
i386 randconfig-a011-20201005
i386 randconfig-a012-20201005
i386 randconfig-a014-20201007
i386 randconfig-a013-20201007
i386 randconfig-a015-20201007
i386 randconfig-a016-20201007
i386 randconfig-a011-20201007
i386 randconfig-a012-20201007
riscvnommu_k210_defconfig
riscvallyesconfig
riscvnommu_virt_defconfig
riscv allnoconfig
riscv   defconfig
riscv  rv32_defconfig
x86_64   

[powerpc:merge] BUILD SUCCESS d1def5df359f3f1882cc29d8baa5cd2a4861a6c6

2020-10-06 Thread kernel test robot
onfig
mips mpc30x_defconfig
armspear3xx_defconfig
m68k   bvme6000_defconfig
arm palmz72_defconfig
powerpc mpc836x_mds_defconfig
powerpc mpc837x_rdb_defconfig
arc  axs101_defconfig
sh  landisk_defconfig
arm   sama5_defconfig
shsh7785lcr_defconfig
powerpc  iss476-smp_defconfig
mips  maltasmvp_eva_defconfig
powerpc   mpc834x_itxgp_defconfig
s390 alldefconfig
arm   h5000_defconfig
arm  integrator_defconfig
arm orion5x_defconfig
ia64 allmodconfig
ia64defconfig
ia64 allyesconfig
m68k allmodconfig
m68kdefconfig
m68k allyesconfig
nios2   defconfig
arc  allyesconfig
nds32 allnoconfig
c6x  allyesconfig
nds32   defconfig
nios2allyesconfig
cskydefconfig
alpha   defconfig
alphaallyesconfig
xtensa   allyesconfig
h8300allyesconfig
arc defconfig
sh   allmodconfig
parisc  defconfig
s390 allyesconfig
parisc   allyesconfig
s390defconfig
i386 allyesconfig
sparcallyesconfig
sparc   defconfig
i386defconfig
mips allyesconfig
mips allmodconfig
powerpc  allyesconfig
powerpc  allmodconfig
powerpc   allnoconfig
x86_64   randconfig-a004-20201006
x86_64   randconfig-a002-20201006
x86_64   randconfig-a001-20201006
x86_64   randconfig-a005-20201006
x86_64   randconfig-a003-20201006
x86_64   randconfig-a006-20201006
i386 randconfig-a006-20201005
i386 randconfig-a005-20201005
i386 randconfig-a001-20201005
i386 randconfig-a004-20201005
i386 randconfig-a003-20201005
i386 randconfig-a002-20201005
x86_64   randconfig-a012-20201005
x86_64   randconfig-a015-20201005
x86_64   randconfig-a014-20201005
x86_64   randconfig-a013-20201005
x86_64   randconfig-a011-20201005
x86_64   randconfig-a016-20201005
i386 randconfig-a014-20201005
i386 randconfig-a015-20201005
i386 randconfig-a013-20201005
i386 randconfig-a016-20201005
i386 randconfig-a011-20201005
i386 randconfig-a012-20201005
i386 randconfig-a014-20201007
i386 randconfig-a013-20201007
i386 randconfig-a015-20201007
i386 randconfig-a016-20201007
i386 randconfig-a011-20201007
i386 randconfig-a012-20201007
riscvnommu_k210_defconfig
riscvallyesconfig
riscv allnoconfig
riscv   defconfig
riscvallmodconfig
x86_64   rhel
x86_64   allyesconfig
x86_64rhel-7.6-kselftests
x86_64  defconfig
x86_64   rhel-8.3
x86_64  kexec

clang tested configs:
x86_64   randconfig-a004-20201005
x86_64   randconfig-a002-20201005
x86_64   randconfig-a001-20201005
x86_64   randconfig-a003-20201005
x86_64   randconfig-a005-20201005
x86_64   randconfig-a006-20201005

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org


[powerpc:next-test 76/183] arch/powerpc/kernel/vdso32/gettimeofday.S:40: Error: syntax error; found `@', expected `,'

2020-10-06 Thread kernel test robot
Hi Michael,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git 
next-test
head:   72cdd117c449896c707fc6cfe5b90978160697d0
commit: 231b232df8f67e7d37af01259c21f2a131c3911e [76/183] powerpc/64: Make 
VDSO32 track COMPAT on 64-bit
config: powerpc-randconfig-r033-20201005 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 
1127662c6dc2a276839c75a42238b11a3ad00f32)
reproduce (this is a W=1 build):
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
# 
https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=231b232df8f67e7d37af01259c21f2a131c3911e
git remote add powerpc 
https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git
git fetch --no-tags powerpc next-test
git checkout 231b232df8f67e7d37af01259c21f2a131c3911e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 

All errors (new ones prefixed by >>):

   arch/powerpc/kernel/vdso32/gettimeofday.S: Assembler messages:
>> arch/powerpc/kernel/vdso32/gettimeofday.S:40: Error: syntax error; found 
>> `@', expected `,'
>> arch/powerpc/kernel/vdso32/gettimeofday.S:40: Error: junk at end of line: 
>> `@local'
   arch/powerpc/kernel/vdso32/gettimeofday.S:68: Warning: invalid register 
expression
>> arch/powerpc/kernel/vdso32/gettimeofday.S:68: Error: operand out of range (3 
>> is not between 0 and 1)
   arch/powerpc/kernel/vdso32/gettimeofday.S:68: Error: missing operand
   arch/powerpc/kernel/vdso32/gettimeofday.S:69: Warning: invalid register 
expression
   arch/powerpc/kernel/vdso32/gettimeofday.S:69: Error: operand out of range (3 
is not between 0 and 1)
   arch/powerpc/kernel/vdso32/gettimeofday.S:69: Error: missing operand
   arch/powerpc/kernel/vdso32/gettimeofday.S:72: Warning: invalid register 
expression
   arch/powerpc/kernel/vdso32/gettimeofday.S:72: Error: operand out of range (3 
is not between 0 and 1)
   arch/powerpc/kernel/vdso32/gettimeofday.S:72: Error: missing operand
   arch/powerpc/kernel/vdso32/gettimeofday.S:73: Warning: invalid register 
expression
   arch/powerpc/kernel/vdso32/gettimeofday.S:73: Error: operand out of range (3 
is not between 0 and 1)
   arch/powerpc/kernel/vdso32/gettimeofday.S:73: Error: missing operand
   arch/powerpc/kernel/vdso32/gettimeofday.S:86: Error: syntax error; found 
`@', expected `,'
   arch/powerpc/kernel/vdso32/gettimeofday.S:86: Error: junk at end of line: 
`@local'
   arch/powerpc/kernel/vdso32/gettimeofday.S:110: Warning: invalid register 
expression
   arch/powerpc/kernel/vdso32/gettimeofday.S:110: Error: operand out of range 
(8 is not between 0 and 1)
   arch/powerpc/kernel/vdso32/gettimeofday.S:110: Error: missing operand
   arch/powerpc/kernel/vdso32/gettimeofday.S:144: Warning: invalid register 
expression
   arch/powerpc/kernel/vdso32/gettimeofday.S:144: Error: missing operand
   arch/powerpc/kernel/vdso32/gettimeofday.S:213: Warning: invalid register 
expression
   arch/powerpc/kernel/vdso32/gettimeofday.S:213: Error: operand out of range 
(4 is not between 0 and 1)
   arch/powerpc/kernel/vdso32/gettimeofday.S:213: Error: missing operand
   clang-12: error: assembler command failed with exit code 1 (use -v to see 
invocation)

vim +40 arch/powerpc/kernel/vdso32/gettimeofday.S

597bc5c00b666fe Paul Mackerras 2008-10-27   22  
a7f290dad32ee34 Benjamin Herrenschmidt 2005-11-11   23  .text
a7f290dad32ee34 Benjamin Herrenschmidt 2005-11-11   24  /*
a7f290dad32ee34 Benjamin Herrenschmidt 2005-11-11   25   * Exact prototype of 
gettimeofday
a7f290dad32ee34 Benjamin Herrenschmidt 2005-11-11   26   *
a7f290dad32ee34 Benjamin Herrenschmidt 2005-11-11   27   * int 
__kernel_gettimeofday(struct timeval *tv, struct timezone *tz);
a7f290dad32ee34 Benjamin Herrenschmidt 2005-11-11   28   *
a7f290dad32ee34 Benjamin Herrenschmidt 2005-11-11   29   */
a7f290dad32ee34 Benjamin Herrenschmidt 2005-11-11   30  
V_FUNCTION_BEGIN(__kernel_gettimeofday)
a7f290dad32ee34 Benjamin Herrenschmidt 2005-11-11   31.cfi_startproc
a7f290dad32ee34 Benjamin Herrenschmidt 2005-11-11   32  mflrr12
a7f290dad32ee34 Benjamin Herrenschmidt 2005-11-11   33.cfi_register lr,r12
a7f290dad32ee34 Benjamin Herrenschmidt 2005-11-11   34  
bfc2eae0ad72a43 Christophe Leroy   2019-12-02   35  mr. r10,r3  
/* r10 saves tv */
a7f290dad32ee34 Benjamin Herrenschmidt 2005-11-11   36  mr  r11,r4  
/* r11 saves tz */
ec0895f08f99515 Christophe Leroy   2019-12-02   37  get_datapage
r9, r0
74609f4536f2b8

Re: [PATCH v3 2/2] ASoC: dt-bindings: fsl_xcvr: Add document for XCVR

2020-10-06 Thread Rob Herring
On Tue, Sep 29, 2020 at 12:19:27PM +0300, Viorel Suman (OSS) wrote:
> From: Viorel Suman 
> 
> XCVR (Audio Transceiver) is a new IP module found on i.MX8MP.
> 
> Signed-off-by: Viorel Suman 
> ---
>  .../devicetree/bindings/sound/fsl,xcvr.yaml| 103 
> +
>  1 file changed, 103 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/sound/fsl,xcvr.yaml
> 
> diff --git a/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml 
> b/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml
> new file mode 100644
> index ..8abab2d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml
> @@ -0,0 +1,103 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/fsl,xcvr.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NXP Audio Transceiver (XCVR) Controller
> +
> +maintainers:
> +  - Viorel Suman 
> +
> +properties:
> +  $nodename:
> +pattern: "^xcvr@.*"
> +
> +  compatible:
> +const: fsl,imx8mp-xcvr
> +
> +  reg:
> +items:
> +  - description: 20K RAM for code and data
> +  - description: registers space
> +  - description: RX FIFO address
> +  - description: TX FIFO address
> +
> +  reg-names:
> +items:
> +  - const: ram
> +  - const: regs
> +  - const: rxfifo
> +  - const: txfifo
> +
> +  interrupts:
> +maxItems: 1
> +
> +  clocks:
> +items:
> +  - description: Peripheral clock
> +  - description: PHY clock
> +  - description: SPBA clock
> +  - description: PLL clock
> +
> +  clock-names:
> +items:
> +  - const: ipg
> +  - const: phy
> +  - const: spba
> +  - const: pll_ipg
> +
> +  dmas:
> +maxItems: 2
> +
> +  dma-names:
> +items:
> +  - const: rx
> +  - const: tx
> +
> +  firmware-name:
> +$ref: /schemas/types.yaml#/definitions/string
> +const: imx/xcvr/xcvr-imx8mp.bin
> +description: |
> +  Should contain the name of the default firmware image
> +  file located on the firmware search path

We generally only have this if the name/path can't be fixed (per 
compatible) in the driver. Given you only have 1 possible value, that 
doesn't seem to be the case here.

> +
> +  resets:
> +maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +  - reg-names
> +  - interrupts
> +  - clocks
> +  - clock-names
> +  - dmas
> +  - dma-names
> +  - firmware-name
> +  - resets

additionalProperties: false

> +
> +examples:
> +  - |
> +#include 
> +#include 
> +#include 
> +
> +xcvr: xcvr@30cc {
> +   compatible = "fsl,imx8mp-xcvr";
> +   reg = <0x30cc 0x800>,
> + <0x30cc0800 0x400>,
> + <0x30cc0c00 0x080>,
> + <0x30cc0e00 0x080>;
> +   reg-names = "ram", "regs", "rxfifo", "txfifo";
> +   interrupts = <0x0 128 IRQ_TYPE_LEVEL_HIGH>;
> +   clocks = <&audiomix_clk IMX8MP_CLK_AUDIOMIX_EARC_IPG>,
> +<&audiomix_clk IMX8MP_CLK_AUDIOMIX_EARC_PHY>,
> +<&audiomix_clk IMX8MP_CLK_AUDIOMIX_SPBA2_ROOT>,
> +<&audiomix_clk IMX8MP_CLK_AUDIOMIX_AUDPLL_ROOT>;
> +   clock-names = "ipg", "phy", "spba", "pll_ipg";
> +   dmas = <&sdma2 30 2 0>, <&sdma2 31 2 0>;
> +   dma-names = "rx", "tx";
> +   firmware-name = "imx/xcvr/xcvr-imx8mp.bin";
> +   resets = <&audiomix_reset 0>;
> +};
> -- 
> 2.7.4
> 


linux-next: Fixes tag needs some work in the powerpc tree

2020-10-06 Thread Stephen Rothwell
Hi all,

In commit

  3b6c3adbb2fa ("powerpc/perf: Exclude pmc5/6 from the irrelevant PMU group 
constraints")

Fixes tag

  Fixes: 7ffd948 ("powerpc/perf: factor out power8 pmu functions")

has these problem(s):

  - SHA1 should be at least 12 digits long
Can be fixed by setting core.abbrev to 12 (or more) or (for git v2.11
or later) just making sure it is not set (or set to "auto").

Since Michael doesn't generally rebase his tree, this is more to be
remebered for next time.

-- 
Cheers,
Stephen Rothwell


pgpXds6VuVf0C.pgp
Description: OpenPGP digital signature


[PATCH v5] powerpc/powernv/elog: Fix race while processing OPAL error log event.

2020-10-06 Thread Michael Ellerman
From: Mahesh Salgaonkar 

Every error log reported by OPAL is exported to userspace through a
sysfs interface and notified using kobject_uevent(). The userspace
daemon (opal_errd) then reads the error log and acknowledges the error
log is saved safely to disk. Once acknowledged the kernel removes the
respective sysfs file entry causing respective resources to be
released including kobject.

However it's possible the userspace daemon may already be scanning
elog entries when a new sysfs elog entry is created by the kernel.
User daemon may read this new entry and ack it even before kernel can
notify userspace about it through kobject_uevent() call. If that
happens then we have a potential race between
elog_ack_store->kobject_put() and kobject_uevent which can lead to
use-after-free of a kernfs object resulting in a kernel crash. eg:

  BUG: Unable to handle kernel data access on read at 0x6b6b6b6b6b6b6bfb
  Faulting instruction address: 0xc08ff2a0
  Oops: Kernel access of bad area, sig: 11 [#1]
  LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA PowerNV
  CPU: 27 PID: 805 Comm: irq/29-opal-elo Not tainted 
5.9.0-rc2-gcc-8.2.0-00214-g6f56a67bcbb5-dirty #363
  ...
  NIP kobject_uevent_env+0xa0/0x910
  LR  elog_event+0x1f4/0x2d0
  Call Trace:
0x5deadbeef122 (unreliable)
elog_event+0x1f4/0x2d0
irq_thread_fn+0x4c/0xc0
irq_thread+0x1c0/0x2b0
kthread+0x1c4/0x1d0
ret_from_kernel_thread+0x5c/0x6c

This patch fixes this race by protecting the sysfs file
creation/notification by holding a reference count on kobject until we
safely send kobject_uevent().

The function create_elog_obj() returns the elog object which if used
by caller function will end up in use-after-free problem again.
However, the return value of create_elog_obj() function isn't being
used today and there is no need as well. Hence change it to return
void to make this fix complete.

Fixes: 774fea1a38c6 ("powerpc/powernv: Read OPAL error log and export it 
through sysfs")
Cc: sta...@vger.kernel.org # v3.15+
Reported-by: Oliver O'Halloran 
Signed-off-by: Mahesh Salgaonkar 
Signed-off-by: Aneesh Kumar K.V 
Reviewed-by: Oliver O'Halloran 
Reviewed-by: Vasant Hegde 
[mpe: Rework the logic to use a single return, reword comments, add oops]
Signed-off-by: Michael Ellerman 
---
 arch/powerpc/platforms/powernv/opal-elog.c | 33 +-
 1 file changed, 26 insertions(+), 7 deletions(-)

v5: mpe: Rework the logic to use a single return, ie. move the kobject_uevent()
 into the success case of the if.
 Reword comments.
 Add example oops to change log.

Change in v4:
  - Re-worded comments. No code change.
Change in v3:
  - Change create_elog_obj function signature to return void.
Change in v2:
  - Instead of mutex and use extra reference count on kobject to avoid the race.

diff --git a/arch/powerpc/platforms/powernv/opal-elog.c 
b/arch/powerpc/platforms/powernv/opal-elog.c
index 62ef7ad995da..5e33b1fc67c2 100644
--- a/arch/powerpc/platforms/powernv/opal-elog.c
+++ b/arch/powerpc/platforms/powernv/opal-elog.c
@@ -179,14 +179,14 @@ static ssize_t raw_attr_read(struct file *filep, struct 
kobject *kobj,
return count;
 }
 
-static struct elog_obj *create_elog_obj(uint64_t id, size_t size, uint64_t 
type)
+static void create_elog_obj(uint64_t id, size_t size, uint64_t type)
 {
struct elog_obj *elog;
int rc;
 
elog = kzalloc(sizeof(*elog), GFP_KERNEL);
if (!elog)
-   return NULL;
+   return;
 
elog->kobj.kset = elog_kset;
 
@@ -219,18 +219,37 @@ static struct elog_obj *create_elog_obj(uint64_t id, 
size_t size, uint64_t type)
rc = kobject_add(&elog->kobj, NULL, "0x%llx", id);
if (rc) {
kobject_put(&elog->kobj);
-   return NULL;
+   return;
}
 
+   /*
+* As soon as the sysfs file for this elog is created/activated there is
+* a chance the opal_errd daemon (or any userspace) might read and
+* acknowledge the elog before kobject_uevent() is called. If that
+* happens then there is a potential race between
+* elog_ack_store->kobject_put() and kobject_uevent() which leads to a
+* use-after-free of a kernfs object resulting in a kernel crash.
+*
+* To avoid that, we need to take a reference on behalf of the bin file,
+* so that our reference remains valid while we call kobject_uevent().
+* We then drop our reference before exiting the function, leaving the
+* bin file to drop the last reference (if it hasn't already).
+*/
+
+   /* Take a reference for the bin file */
+   kobject_get(&elog->kobj);
rc = sysfs_create_bin_file(&elog->kobj, &elog->raw_attr);
-   if (rc) {
+   if (rc == 0) {
+   kobject_uevent(&elog->kobj, KOBJ_ADD);
+   } else {
+   /* Drop the reference taken for the bin file */
kobject_put(&el

[PATCH 1/2] powerpc/32s: Rename head_32.S to head_book3s_32.S

2020-10-06 Thread Christophe Leroy
Unlike PPC64 which had a single head_64.S, PPC32 are multiple ones.
There is the head_32.S, selected by default based on the value of BITS
and overridden based on some CONFIG_ values. This leads to thinking
that it may be selected by different types of PPC32 platform but
indeed it ends up being selected by book3s/32 only.

Make that explicit by:
- Not doing any default selection based on BITS.
- Renaming head_32.S to head_book3s_32.S.
- Get head_book3s_32.S selected only by CONFIG_PPC_BOOK3S_32.

Signed-off-by: Christophe Leroy 
---
 arch/powerpc/kernel/Makefile| 3 ++-
 arch/powerpc/kernel/{head_32.S => head_book3s_32.S} | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
 rename arch/powerpc/kernel/{head_32.S => head_book3s_32.S} (99%)

diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index a5550c2b24c4..bf0bf1b900d2 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -95,7 +95,8 @@ obj-$(CONFIG_PPC_FSL_BOOK3E)  += cpu_setup_fsl_booke.o
 obj-$(CONFIG_PPC_DOORBELL) += dbell.o
 obj-$(CONFIG_JUMP_LABEL)   += jump_label.o
 
-extra-y:= head_$(BITS).o
+extra-$(CONFIG_PPC64)  := head_64.o
+extra-$(CONFIG_PPC_BOOK3S_32)  := head_book3s_32.o
 extra-$(CONFIG_40x):= head_40x.o
 extra-$(CONFIG_44x):= head_44x.o
 extra-$(CONFIG_FSL_BOOKE)  := head_fsl_booke.o
diff --git a/arch/powerpc/kernel/head_32.S 
b/arch/powerpc/kernel/head_book3s_32.S
similarity index 99%
rename from arch/powerpc/kernel/head_32.S
rename to arch/powerpc/kernel/head_book3s_32.S
index 35627693c2a4..e07a2c07ffe4 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_book3s_32.S
@@ -61,7 +61,7 @@
 
__HEAD
.stabs  "arch/powerpc/kernel/",N_SO,0,0,0f
-   .stabs  "head_32.S",N_SO,0,0,0f
+   .stabs  "head_book3s_32.S",N_SO,0,0,0f
 0:
 _ENTRY(_stext);
 
-- 
2.25.0



[PATCH 2/2] powerpc/32s: Remove #ifdef CONFIG_PPC_BOOK3S_32 in head_book3s_32.S

2020-10-06 Thread Christophe Leroy
head_book3s_32.S is only built when CONFIG_PPC_BOOK3S_32 is selected.

Remove all conditions based on CONFIG_PPC_BOOK3S_32 in the file.

Signed-off-by: Christophe Leroy 
---
 arch/powerpc/kernel/head_book3s_32.S | 15 ---
 1 file changed, 15 deletions(-)

diff --git a/arch/powerpc/kernel/head_book3s_32.S 
b/arch/powerpc/kernel/head_book3s_32.S
index e07a2c07ffe4..f659378adaf3 100644
--- a/arch/powerpc/kernel/head_book3s_32.S
+++ b/arch/powerpc/kernel/head_book3s_32.S
@@ -183,10 +183,8 @@ __after_mmu_off:
bl  reloc_offset
li  r24,0   /* cpu# */
bl  call_setup_cpu  /* Call setup_cpu for this CPU */
-#ifdef CONFIG_PPC_BOOK3S_32
bl  reloc_offset
bl  init_idle_6xx
-#endif /* CONFIG_PPC_BOOK3S_32 */
 
 
 /*
@@ -892,10 +890,8 @@ __secondary_start:
lis r3,-KERNELBASE@h
mr  r4,r24
bl  call_setup_cpu  /* Call setup_cpu for this CPU */
-#ifdef CONFIG_PPC_BOOK3S_32
lis r3,-KERNELBASE@h
bl  init_idle_6xx
-#endif /* CONFIG_PPC_BOOK3S_32 */
 
/* get current's stack and current */
lis r2,secondary_current@ha
@@ -936,17 +932,6 @@ __secondary_start:
 #include "../kvm/book3s_rmhandlers.S"
 #endif
 
-/*
- * Those generic dummy functions are kept for CPUs not
- * included in CONFIG_PPC_BOOK3S_32
- */
-#if !defined(CONFIG_PPC_BOOK3S_32)
-_ENTRY(__save_cpu_setup)
-   blr
-_ENTRY(__restore_cpu_setup)
-   blr
-#endif /* !defined(CONFIG_PPC_BOOK3S_32) */
-
 /*
  * Load stuff into the MMU.  Intended to be called with
  * IR=0 and DR=0.
-- 
2.25.0



Re: linux-next: manual merge of the char-misc tree with the powerpc tree

2020-10-06 Thread Greg KH
On Tue, Oct 06, 2020 at 06:35:06PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the char-misc tree got a conflict in:
> 
>   drivers/misc/ocxl/Kconfig
> 
> between commit:
> 
>   dde6f18a8779 ("ocxl: Don't return trigger page when allocating an 
> interrupt")
> 
> from the powerpc tree and commit:
> 
>   4b53a3c72116 ("ocxl: fix kconfig dependency warning for OCXL")
> 
> from the char-misc tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
> 
> -- 
> Cheers,
> Stephen Rothwell
> 
> diff --cc drivers/misc/ocxl/Kconfig
> index 0d815b2a40b3,947294f6d7f4..
> --- a/drivers/misc/ocxl/Kconfig
> +++ b/drivers/misc/ocxl/Kconfig
> @@@ -9,9 -9,8 +9,9 @@@ config OCXL_BAS
>   
>   config OCXL
>   tristate "OpenCAPI coherent accelerator support"
>  -depends on PPC_POWERNV && PCI && EEH && HOTPLUG_PCI_POWERNV
>  +depends on PPC_POWERNV && PCI && EEH && PPC_XIVE_NATIVE
> ++depends on HOTPLUG_PCI_POWERNV
>   select OCXL_BASE
> - select HOTPLUG_PCI_POWERNV
>   default m
>   help
> Select this option to enable the ocxl driver for Open

Looks good, thanks!

greg k-h


[RFC PATCH] powerpc/mm: Support tlbiel set value of 1 on POWER10

2020-10-06 Thread Aneesh Kumar K.V
With POWER10, tlbiel invalidates all the congruence class of TLB
and hence we need to issue only one tlbiel with SET=0. Update
POWER10_TLB_SETS to 1 and use that in the rest of the code.

Signed-off-by: Aneesh Kumar K.V 
---
 arch/powerpc/include/asm/book3s/64/mmu-hash.h |  1 +
 arch/powerpc/kvm/book3s_hv.c  |  4 +++-
 arch/powerpc/kvm/book3s_hv_builtin.c  |  8 +++-
 arch/powerpc/mm/book3s64/hash_native.c|  4 +++-
 arch/powerpc/mm/book3s64/radix_tlb.c  | 13 ++---
 5 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/include/asm/book3s/64/mmu-hash.h 
b/arch/powerpc/include/asm/book3s/64/mmu-hash.h
index 683a9c7d1b03..755ae1ea910a 100644
--- a/arch/powerpc/include/asm/book3s/64/mmu-hash.h
+++ b/arch/powerpc/include/asm/book3s/64/mmu-hash.h
@@ -129,6 +129,7 @@
 #define POWER8_TLB_SETS512 /* # sets in POWER8 TLB */
 #define POWER9_TLB_SETS_HASH   256 /* # sets in POWER9 TLB Hash mode */
 #define POWER9_TLB_SETS_RADIX  128 /* # sets in POWER9 TLB Radix mode */
+#define POWER10_TLB_SETS   1   /* # sets in POWER10 TLB */
 
 #ifndef __ASSEMBLY__
 
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 3bd3118c7633..12553cb55ede 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -4939,7 +4939,9 @@ static int kvmppc_core_init_vm_hv(struct kvm *kvm)
 * Work out how many sets the TLB has, for the use of
 * the TLB invalidation loop in book3s_hv_rmhandlers.S.
 */
-   if (radix_enabled())
+   if (cpu_has_feature(CPU_FTR_ARCH_31))
+   kvm->arch.tlb_sets = POWER10_TLB_SETS;  /* 1 */
+   else if (radix_enabled())
kvm->arch.tlb_sets = POWER9_TLB_SETS_RADIX; /* 128 */
else if (cpu_has_feature(CPU_FTR_ARCH_300))
kvm->arch.tlb_sets = POWER9_TLB_SETS_HASH;  /* 256 */
diff --git a/arch/powerpc/kvm/book3s_hv_builtin.c 
b/arch/powerpc/kvm/book3s_hv_builtin.c
index 073617ce83e0..7dfe38771f3c 100644
--- a/arch/powerpc/kvm/book3s_hv_builtin.c
+++ b/arch/powerpc/kvm/book3s_hv_builtin.c
@@ -702,6 +702,7 @@ static void wait_for_sync(struct kvm_split_mode *sip, int 
phase)
 
 void kvmhv_p9_set_lpcr(struct kvm_split_mode *sip)
 {
+   int num_sets;
unsigned long rb, set;
 
/* wait for every other thread to get to real mode */
@@ -712,11 +713,16 @@ void kvmhv_p9_set_lpcr(struct kvm_split_mode *sip)
mtspr(SPRN_LPID, sip->lpidr_req);
isync();
 
+   if (cpu_has_feature(CPU_FTR_ARCH_31))
+   num_sets = POWER10_TLB_SETS;
+   else
+   num_sets = POWER9_TLB_SETS_RADIX;
+
/* Invalidate the TLB on thread 0 */
if (local_paca->kvm_hstate.tid == 0) {
sip->do_set = 0;
asm volatile("ptesync" : : : "memory");
-   for (set = 0; set < POWER9_TLB_SETS_RADIX; ++set) {
+   for (set = 0; set < num_sets; ++set) {
rb = TLBIEL_INVAL_SET_LPID +
(set << TLBIEL_INVAL_SET_SHIFT);
asm volatile(PPC_TLBIEL(%0, %1, 0, 0, 0) : :
diff --git a/arch/powerpc/mm/book3s64/hash_native.c 
b/arch/powerpc/mm/book3s64/hash_native.c
index cf20e5229ce1..abea64c804b2 100644
--- a/arch/powerpc/mm/book3s64/hash_native.c
+++ b/arch/powerpc/mm/book3s64/hash_native.c
@@ -130,7 +130,9 @@ void hash__tlbiel_all(unsigned int action)
BUG();
}
 
-   if (early_cpu_has_feature(CPU_FTR_ARCH_300))
+   if (early_cpu_has_feature(CPU_FTR_ARCH_31))
+   tlbiel_all_isa300(POWER10_TLB_SETS, is);
+   else if (early_cpu_has_feature(CPU_FTR_ARCH_300))
tlbiel_all_isa300(POWER9_TLB_SETS_HASH, is);
else if (early_cpu_has_feature(CPU_FTR_ARCH_207S))
tlbiel_all_isa206(POWER8_TLB_SETS, is);
diff --git a/arch/powerpc/mm/book3s64/radix_tlb.c 
b/arch/powerpc/mm/book3s64/radix_tlb.c
index 143b4fd396f0..47db637755c4 100644
--- a/arch/powerpc/mm/book3s64/radix_tlb.c
+++ b/arch/powerpc/mm/book3s64/radix_tlb.c
@@ -83,7 +83,9 @@ void radix__tlbiel_all(unsigned int action)
BUG();
}
 
-   if (early_cpu_has_feature(CPU_FTR_ARCH_300))
+   if (early_cpu_has_feature(CPU_FTR_ARCH_31))
+   tlbiel_all_isa300(POWER10_TLB_SETS, is);
+   else if (early_cpu_has_feature(CPU_FTR_ARCH_300))
tlbiel_all_isa300(POWER9_TLB_SETS_RADIX, is);
else
WARN(1, "%s called on pre-POWER9 CPU\n", __func__);
@@ -284,7 +286,7 @@ static inline void fixup_tlbie_lpid(unsigned long lpid)
  */
 static __always_inline void _tlbiel_pid(unsigned long pid, unsigned long ric)
 {
-   int set;
+   int set, num_sets;
 
asm volatile("ptesync": : :"memory");
 
@@ -300,8 +302,13 @@ static __always_inline void _tlbiel_pid(unsigned long pid, 
unsigned long ric)
return;
}
 
+   if (cpu_has_

linux-next: manual merge of the char-misc tree with the powerpc tree

2020-10-06 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the char-misc tree got a conflict in:

  drivers/misc/ocxl/Kconfig

between commit:

  dde6f18a8779 ("ocxl: Don't return trigger page when allocating an interrupt")

from the powerpc tree and commit:

  4b53a3c72116 ("ocxl: fix kconfig dependency warning for OCXL")

from the char-misc tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/misc/ocxl/Kconfig
index 0d815b2a40b3,947294f6d7f4..
--- a/drivers/misc/ocxl/Kconfig
+++ b/drivers/misc/ocxl/Kconfig
@@@ -9,9 -9,8 +9,9 @@@ config OCXL_BAS
  
  config OCXL
tristate "OpenCAPI coherent accelerator support"
 -  depends on PPC_POWERNV && PCI && EEH && HOTPLUG_PCI_POWERNV
 +  depends on PPC_POWERNV && PCI && EEH && PPC_XIVE_NATIVE
++  depends on HOTPLUG_PCI_POWERNV
select OCXL_BASE
-   select HOTPLUG_PCI_POWERNV
default m
help
  Select this option to enable the ocxl driver for Open


pgps5rok_MplY.pgp
Description: OpenPGP digital signature


[PATCH v4] powernv/elog: Fix the race while processing OPAL error log event.

2020-10-06 Thread Mahesh Salgaonkar
Every error log reported by OPAL is exported to userspace through a sysfs
interface and notified using kobject_uevent(). The userspace daemon
(opal_errd) then reads the error log and acknowledges it error log is saved
safely to disk. Once acknowledged the kernel removes the respective sysfs
file entry causing respective resources getting released including kobject.

However there are chances where user daemon may already be scanning elog
entries while new sysfs elog entry is being created by kernel. User daemon
may read this new entry and ack it even before kernel can notify userspace
about it through kobject_uevent() call. If that happens then we have a
potential race between elog_ack_store->kobject_put() and kobject_uevent
which can lead to use-after-free issue of a kernfs object resulting into a
kernel crash. This patch fixes this race by protecting a sysfs file
creation/notification by holding a reference count on kobject until we
safely send kobject_uevent().

The function create_elog_obj() returns the elog object which if used by
caller function will end up in use-after-free problem again. However, the
return value of create_elog_obj() function isn't being used today and there
is need as well. Hence change it to return void to make this fix complete.

Fixes: 774fea1a38c6 ("powerpc/powernv: Read OPAL error log and export it 
through sysfs")
Cc:  # v3.15+
Reported-by: Oliver O'Halloran 
Signed-off-by: Mahesh Salgaonkar 
Signed-off-by: Aneesh Kumar K.V 
Reviewed-by: Oliver O'Halloran 
Reviewed-by: Vasant Hegde 
---
Chnage in v4:
- Re-worded comments. No code change.
Change in v3:
- Change create_elog_obj function signature to return void.
Change in v2:
- Instead of mutex and use extra reference count on kobject to avoid the
  race.
---
 arch/powerpc/platforms/powernv/opal-elog.c |   34 
 1 file changed, 29 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/opal-elog.c 
b/arch/powerpc/platforms/powernv/opal-elog.c
index 62ef7ad995da..adf4ff8d0bea 100644
--- a/arch/powerpc/platforms/powernv/opal-elog.c
+++ b/arch/powerpc/platforms/powernv/opal-elog.c
@@ -179,14 +179,14 @@ static ssize_t raw_attr_read(struct file *filep, struct 
kobject *kobj,
return count;
 }
 
-static struct elog_obj *create_elog_obj(uint64_t id, size_t size, uint64_t 
type)
+static void create_elog_obj(uint64_t id, size_t size, uint64_t type)
 {
struct elog_obj *elog;
int rc;
 
elog = kzalloc(sizeof(*elog), GFP_KERNEL);
if (!elog)
-   return NULL;
+   return;
 
elog->kobj.kset = elog_kset;
 
@@ -219,18 +219,42 @@ static struct elog_obj *create_elog_obj(uint64_t id, 
size_t size, uint64_t type)
rc = kobject_add(&elog->kobj, NULL, "0x%llx", id);
if (rc) {
kobject_put(&elog->kobj);
-   return NULL;
+   return;
}
 
+   /*
+* As soon as sysfs file for this elog is created/activated there is
+* chance opal_errd daemon might read and acknowledge this elog before
+* kobject_uevent() is called. If that happens then we have a potential
+* race between elog_ack_store->kobject_put() and kobject_uevent which
+* leads to use-after-free issue of a kernfs object resulting into
+* kernel crash.
+*
+* We already have one reference count on kobject and is been used for
+* sysfs_create_bin_file() function. This initial one reference count
+* is valid until it is dropped by elog_ack_store() function.
+*
+* However if userspace acknowledges the elog before this code reaches
+* to kobject_uevent(), the reference count on kobject drops to zero
+* and no longer stay valid for kobject_uevent() invocation. To avoid
+* this race take reference count on kobject for bin file creation and
+* drop it after kobject_uevent() is sent.
+*/
+
+   kobject_get(&elog->kobj);  /* take a reference for the bin file. */
rc = sysfs_create_bin_file(&elog->kobj, &elog->raw_attr);
if (rc) {
kobject_put(&elog->kobj);
-   return NULL;
+   /* Drop reference count taken for bin file.  */
+   kobject_put(&elog->kobj);
+   return;
}
 
kobject_uevent(&elog->kobj, KOBJ_ADD);
+   /* Drop reference count taken for bin file.  */
+   kobject_put(&elog->kobj);
 
-   return elog;
+   return;
 }
 
 static irqreturn_t elog_event(int irq, void *data)