Re: Using Firefox hangs system

2020-07-07 Thread Nicholas Piggin
Excerpts from Paul Menzel's message of July 6, 2020 3:20 pm:
> Dear Nicholas,
> 
> 
> Thank you for the quick response.
> 
> 
> Am 06.07.20 um 02:41 schrieb Nicholas Piggin:
>> Excerpts from Paul Menzel's message of July 5, 2020 8:30 pm:
> 
>>> Am 05.07.20 um 11:22 schrieb Paul Menzel:
 [  572.253008] Oops: Exception in kernel mode, sig: 5 [#1]
 [  572.253198] LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA PowerNV
 [  572.253232] Modules linked in: tcp_diag inet_diag unix_diag xt_CHECKSUM 
 xt_MASQUERADE xt_conntrack ipt_REJECT nf_reject_ipv4 xt_tcpudp 
 ip6table_mangle ip6table_nat iptable_mangle iptable_nat nf_nat 
 nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables nfnetlink 
 ip6table_filter ip6_tables iptable_filter bridge stp llc overlay xfs 
 kvm_hv kvm binfmt_misc joydev uas usb_storage vmx_crypto bnx2x 
 crct10dif_vpmsum ofpart cmdlinepart powernv_flash mtd mdio ibmpowernv at24 
 ipmi_powernv ipmi_devintf ipmi_msghandler opal_prd powernv_rng 
 sch_fq_codel parport_pc ppdev lp nfsd parport auth_rpcgss nfs_acl lockd 
 grace sunrpc ip_tables x_tables autofs4 btrfs blake2b_generic libcrc32c 
 xor zstd_compress raid6_pq input_leds mac_hid hid_generic ast 
 drm_vram_helper drm_ttm_helper i2c_algo_bit ttm drm_kms_helper syscopyarea 
 sysfillrect sysimgblt fb_sys_fops drm ahci drm_panel_orientation_quirks 
 libahci usbhid hid crc32c_vpmsum uio_pdrv_genirq uio
 [  572.253639] CPU: 4 PID: 6728 Comm: Web Content Not tainted 5.8.0-rc3+ #1
 [  572.253659] NIP:  c000ff5c LR: c001a8f8 CTR: 
 c01d5f00
 [  572.253835] REGS: c07f31f0f420 TRAP: 1500   Not tainted  
 (5.8.0-rc3+)
 [  572.253854] MSR:  9290b033  
  CR: 28c48482  XER: 2000
 [  572.253888] CFAR: c000fecc IRQMASK: 1
 [  572.253888] GPR00: c001b228 c07f31f0f6b0 c1f9a900 
 c07f351544d0
 [  572.253888] GPR04:  c07f31f0fe90 c07f351544f0 
 c07f32e522b0
 [  572.253888] GPR08:  2000 90009033 
 c07fbcd85800
 [  572.253888] GPR12: 8800 c07fb680 0005 
 0004
 [  572.253888] GPR16: c07f35153800 c07f35154130 0005 
 0001
 [  572.253888] GPR20: 0024 c07f32e51e68 c07f35154028 
 007fd8da
 [  572.253888] GPR24: 007fd8da c07f351544d0 c07e9a4024d0 
 c1665f18
 [  572.253888] GPR28: c07f351544d0 c07f35153800 9290f033 
 c07f35153800
 [  572.254079] NIP [c000ff5c] save_fpu+0xa8/0x2ac
 [  572.254098] LR [c001a8f8] __giveup_fpu+0x28/0x80
 [  572.254114] Call Trace:
 [  572.254128] [c07f31f0f6b0] [c07f35153980] 0xc07f35153980 
 (unreliable)
 [  572.254156] [c07f31f0f6e0] [c001b228] giveup_all+0x128/0x150
 [  572.254327] [c07f31f0f710] [c001c124] 
 __switch_to+0x104/0x490
 [  572.254352] [c07f31f0f770] [c10d2e34] __schedule+0x2e4/0xa10
 [  572.254374] [c07f31f0f840] [c10d35d4] schedule+0x74/0x140
 [  572.254397] [c07f31f0f870] [c10d9478] 
 schedule_timeout+0x358/0x5d0
 [  572.254424] [c07f31f0f980] [c10d5638] 
 wait_for_completion+0xc8/0x210
 [  572.254451] [c07f31f0fa00] [c0608ed4] 
 do_coredump+0x3a4/0xd60
 [  572.254625] [c07f31f0fba0] [c018d1cc] get_signal+0x1dc/0xd00
 [  572.254648] [c07f31f0fcc0] [c001f088] 
 do_notify_resume+0x158/0x450
 [  572.254672] [c07f31f0fda0] [c0037d04] 
 interrupt_exit_user_prepare+0x1c4/0x230
 [  572.254699] [c07f31f0fe20] [c000f2b4] 
 interrupt_return+0x14/0x1c0
 [  572.254720] Instruction dump:
 [  572.254882] dae60170 db060180 db260190 db4601a0 db6601b0 db8601c0 
 dba601d0 dbc601e0
 [  572.254912] dbe601f0 48000204 3880 f250 <7c062798> f250 
 38800010 f0210a50
 [  572.254946] ---[ end trace ba4452ee5c77d58e ]---
>>>
>>> Please find all the messages attached.
>> 
>> "Oops: Exception in kernel mode, sig: 5 [#1]"
>> 
>> Unfortunately it's a very poor error message. I think it is a 0x1500
>> exception triggering in the kernel FP register saving. Do you have the
>> CONFIG_PPC_DENORMALISATION config option set?
> 
> Yes, as it’s set in the Ubuntu Linux kernel configuration, I have it set 
> too.
> 
>  $ grep DENORMALI /boot/config-*
>  /boot/config-4.15.0-23-generic:CONFIG_PPC_DENORMALISATION=y
>  /boot/config-5.4.0-40-generic:CONFIG_PPC_DENORMALISATION=y
>  /boot/config-5.7.0-rc5+:CONFIG_PPC_DENORMALISATION=y
>  /boot/config-5.8.0-rc3+:CONFIG_PPC_DENORMALISATION=y

Ah thanks I was able to reproduce with a little denorm test case.

The denorm interrupt handler got broken by some careless person.

This patch

Re: [PATCH v2 07/10] powerpc/perf: support BHRB disable bit and new filtering modes

2020-07-07 Thread Michael Neuling
On Wed, 2020-07-01 at 05:20 -0400, Athira Rajeev wrote:
> PowerISA v3.1 has few updates for the Branch History Rolling Buffer(BHRB).
> First is the addition of BHRB disable bit and second new filtering
> modes for BHRB.
> 
> BHRB disable is controlled via Monitor Mode Control Register A (MMCRA)
> bit 26, namely "BHRB Recording Disable (BHRBRD)". This field controls
> whether BHRB entries are written when BHRB recording is enabled by other
> bits. Patch implements support for this BHRB disable bit.

Probably good to note here that this is backwards compatible. So if you have a
kernel that doesn't know about this bit, it'll clear it and hence you still get
BHRB. 

You should also note why you'd want to do disable this (ie. the core will run
faster).

> Secondly PowerISA v3.1 introduce filtering support for
> PERF_SAMPLE_BRANCH_IND_CALL/COND. The patch adds BHRB filter support
> for "ind_call" and "cond" in power10_bhrb_filter_map().
> 
> 'commit bb19af816025 ("powerpc/perf: Prevent kernel address leak to userspace
> via BHRB buffer")'
> added a check in bhrb_read() to filter the kernel address from BHRB buffer.
> Patch here modified
> it to avoid that check for PowerISA v3.1 based processors, since PowerISA v3.1
> allows
> only MSR[PR]=1 address to be written to BHRB buffer.
> 
> Signed-off-by: Athira Rajeev 
> ---
>  arch/powerpc/perf/core-book3s.c   | 27 +--
>  arch/powerpc/perf/isa207-common.c | 13 +
>  arch/powerpc/perf/power10-pmu.c   | 13 +++--
>  arch/powerpc/platforms/powernv/idle.c | 14 ++

This touches the idle code so we should get those guys on CC (adding Vaidy and
Ego).

>  4 files changed, 59 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
> index fad5159..9709606 100644
> --- a/arch/powerpc/perf/core-book3s.c
> +++ b/arch/powerpc/perf/core-book3s.c
> @@ -466,9 +466,13 @@ static void power_pmu_bhrb_read(struct perf_event *event,
> struct cpu_hw_events *
>* addresses at this point. Check the privileges before
>* exporting it to userspace (avoid exposure of regions
>* where we could have speculative execution)
> +  * Incase of ISA 310, BHRB will capture only user-space
> +  * address,hence include a check before filtering code
>*/
> - if (is_kernel_addr(addr) && perf_allow_kernel(&event-
> >attr) != 0)
> - continue;
> + if (!(ppmu->flags & PPMU_ARCH_310S))
> + if (is_kernel_addr(addr) &&
> + perf_allow_kernel(&event->attr) != 0)
> + continue;
>  
>   /* Branches are read most recent first (ie. mfbhrb 0 is
>* the most recent branch).
> @@ -1212,7 +1216,7 @@ static void write_mmcr0(struct cpu_hw_events *cpuhw,
> unsigned long mmcr0)
>  static void power_pmu_disable(struct pmu *pmu)
>  {
>   struct cpu_hw_events *cpuhw;
> - unsigned long flags, mmcr0, val;
> + unsigned long flags, mmcr0, val, mmcra = 0;
>  
>   if (!ppmu)
>   return;
> @@ -1245,12 +1249,23 @@ static void power_pmu_disable(struct pmu *pmu)
>   mb();
>   isync();
>  
> + val = mmcra = cpuhw->mmcr[2];
> +
>   /*
>* Disable instruction sampling if it was enabled
>*/
> - if (cpuhw->mmcr[2] & MMCRA_SAMPLE_ENABLE) {
> - mtspr(SPRN_MMCRA,
> -   cpuhw->mmcr[2] & ~MMCRA_SAMPLE_ENABLE);
> + if (cpuhw->mmcr[2] & MMCRA_SAMPLE_ENABLE)
> + mmcra = cpuhw->mmcr[2] & ~MMCRA_SAMPLE_ENABLE;
> +
> + /* Disable BHRB via mmcra [:26] for p10 if needed */
> + if (!(cpuhw->mmcr[2] & MMCRA_BHRB_DISABLE))
> + mmcra |= MMCRA_BHRB_DISABLE;
> +
> + /* Write SPRN_MMCRA if mmcra has either disabled
> +  * instruction sampling or BHRB
> +  */
> + if (val != mmcra) {
> + mtspr(SPRN_MMCRA, mmcra);
>   mb();
>   isync();
>   }
> diff --git a/arch/powerpc/perf/isa207-common.c b/arch/powerpc/perf/isa207-
> common.c
> index 7d4839e..463d925 100644
> --- a/arch/powerpc/perf/isa207-common.c
> +++ b/arch/powerpc/perf/isa207-common.c
> @@ -404,6 +404,12 @@ int isa207_compute_mmcr(u64 event[], int n_ev,
>  
>   mmcra = mmcr1 = mmcr2 = mmcr3 = 0;
>  
> + /* Disable bhrb unless explicitly requested
> +  * by setting MMCRA [:26] bit.
> +  */
> + if (cpu_has_feature(CPU_FTR_ARCH_31))
> + mmcra |= MMCRA_BHRB_DISABLE;
> +
>   /* Second pass: assign PMCs, set all MMCR1 fields */
>   for (i = 0; i < n_ev; ++i) {
>  

[Bug 208197] OF: /pci@f2000000/mac-io@17/gpio@50/...: could not find phandle

2020-07-07 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=208197

Michael Ellerman (mich...@ellerman.id.au) changed:

   What|Removed |Added

 Status|NEW |NEEDINFO
 CC||mich...@ellerman.id.au

--- Comment #3 from Michael Ellerman (mich...@ellerman.id.au) ---
Try this?

diff --git a/drivers/of/base.c b/drivers/of/base.c
index ae03b1218b06..b2961bec57d9 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1299,6 +1299,7 @@ int of_phandle_iterator_next(struct of_phandle_iterator
*it)
if (!it->node) {
pr_err("%pOF: could not find phandle\n",
   it->parent);
+   WARN_ON(1);
goto err;
}

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

Re: FSL P5020/P5040: DPAA Ethernet issue with the latest Git kernel

2020-07-07 Thread Christian Zigotzky

On 25 June 2020 at 12:22 pm, Alexander Gordeev wrote:

On Thu, Jun 25, 2020 at 01:01:52AM +0200, Christian Zigotzky wrote:
[...]

I compiled a test kernel with the option "CONFIG_TEST_BITMAP=y"
yesterday. After that Skateman and I booted it and looked for the
bitmap tests with "dmesg | grep -i bitmap".

Results:

FSL P5020:

[    0.297756] test_bitmap: loaded.
[    0.298113] test_bitmap: parselist: 14: input is '0-2047:128/256'
OK, Time: 562
[    0.298142] test_bitmap: parselist_user: 14: input is
'0-2047:128/256' OK, Time: 761
[    0.301553] test_bitmap: all 1663 tests passed

FSL P5040:

[    0.296563] test_bitmap: loaded.
[    0.296894] test_bitmap: parselist: 14: input is '0-2047:128/256'
OK, Time: 540
[    0.296920] test_bitmap: parselist_user: 14: input is
'0-2047:128/256' OK, Time: 680
[    0.24] test_bitmap: all 1663 tests passed

Thanks for the test! So it works as expected.

I would suggest to compare what is going on on the device probing
with and without the bisected commit.

There seems to be MAC and PHY mode initialization issue that might
resulted from the bitmap format change.

I put Madalin and Sascha on CC as they have done some works on
this part recently.

Thanks!



Hi All,

The issue still exists [1] so we still need the dpaa patch [2]. Could 
you please check the problematic commit [3]?


Thanks,
Christian

[1] https://forum.hyperion-entertainment.com/viewtopic.php?p=50885#p50885
[2] https://forum.hyperion-entertainment.com/viewtopic.php?p=50982#p50982
[3] https://forum.hyperion-entertainment.com/viewtopic.php?p=50980#p50980


Re: [PATCH] powerpc/numa: Restrict possible nodes based on platform

2020-07-07 Thread Srikar Dronamraju
* Michael Ellerman  [2020-07-07 15:02:17]:

> Srikar Dronamraju  writes:
> > As per PAPR, there are 2 device tree property
> > ibm,max-associativity-domains (which defines the maximum number of
> > domains that the firmware i.e PowerVM can support) and
> > ibm,current-associativity-domains (which defines the maximum number of
> > domains that the platform can support). Value of
> > ibm,max-associativity-domains property is always greater than or equal
> > to ibm,current-associativity-domains property.
> 
> Where is it documented?
> 
> It's definitely not in LoPAPR.
> 

https://openpowerfoundation.org/wp-content/uploads/2020/07/LoPAR-20200611.pdf
Page number 833.

which says 
ibm,current-associativity-domains”
property name to define the current number of associativity
domains for this platform.
prop-encoded-array: An associativity list such that all values are
the number of unique values that the current platform supports
in that location. The associativity list consisting of a number of
entries integer (N) encoded as with encode-int followed by N
integers encoded as with encode-int each representing current
number of unique associativity domains the platform supports at
that level.

> > Powerpc currently uses ibm,max-associativity-domains  property while
> > setting the possible number of nodes. This is currently set at 32.
> > However the possible number of nodes for a platform may be significantly
> > less. Hence set the possible number of nodes based on
> > ibm,current-associativity-domains property.
> >
> > $ lsprop /proc/device-tree/rtas/ibm,*associ*-domains
> > /proc/device-tree/rtas/ibm,current-associativity-domains
> >  0005 0001 0002 0002 0002 0010
> > /proc/device-tree/rtas/ibm,max-associativity-domains
> >  0005 0001 0008 0020 0020 0100
> >
> > $ cat /sys/devices/system/node/possible ##Before patch
> > 0-31
> >
> > $ cat /sys/devices/system/node/possible ##After patch
> > 0-1
> >
> > Note the maximum nodes this platform can support is only 2 but the
> > possible nodes is set to 32.
> 
> But what about LPM to a system with more nodes?
> 

I have very less info on LPM, so I checked with Nathan Lynch before posting
and as per Nathan in the current design of LPM, Linux wouldn't use the new
node numbers. 

-- 
Thanks and Regards
Srikar Dronamraju


[PATCH 1/2] ASoC: fsl_spdif: Clear the validity bit for TX

2020-07-07 Thread Shengjiu Wang
In IEC958 spec, "The validity bit is logical "0" if the
information in the main data field is reliable, and it
is logical "1" if it is not".

The default value of "ValCtrl" is zero, which means
"Outgoing Validity always set", then all the data is not
reliable, then some spdif sink device will drop the data.

So set "ValCtrl" to 1, that is to clear "Outgoing Validity"
in default.

Signed-off-by: Shengjiu Wang 
---
 sound/soc/fsl/fsl_spdif.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c
index 9fb95c6ee7ba..576370dc6e70 100644
--- a/sound/soc/fsl/fsl_spdif.c
+++ b/sound/soc/fsl/fsl_spdif.c
@@ -985,6 +985,10 @@ static int fsl_spdif_dai_probe(struct snd_soc_dai *dai)
 
snd_soc_add_dai_controls(dai, fsl_spdif_ctrls, 
ARRAY_SIZE(fsl_spdif_ctrls));
 
+   /*Clear the val bit for Tx*/
+   regmap_update_bits(spdif_private->regmap, REG_SPDIF_SCR,
+  SCR_VAL_MASK, SCR_VAL_CLEAR);
+
return 0;
 }
 
-- 
2.21.0



[PATCH 0/2] ASoC: fsl_spdif: Clear the validity bit for TX

2020-07-07 Thread Shengjiu Wang
Clear the validity bit for TX
Add kctl for configuring TX validity bit

Shengjiu Wang (2):
  ASoC: fsl_spdif: Clear the validity bit for TX
  ASoC: fsl_spdif: Add kctl for configuring TX validity bit

 sound/soc/fsl/fsl_spdif.c | 51 ---
 1 file changed, 47 insertions(+), 4 deletions(-)

-- 
2.21.0



[PATCH 2/2] ASoC: fsl_spdif: Add kctl for configuring TX validity bit

2020-07-07 Thread Shengjiu Wang
Add one kctl for configuring TX validity bit from user
space.

The type of this kctl is boolean:
on - Outgoing validity always set
off - Outgoing validity always clear

Signed-off-by: Shengjiu Wang 
---
 sound/soc/fsl/fsl_spdif.c | 47 +++
 1 file changed, 43 insertions(+), 4 deletions(-)

diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c
index 576370dc6e70..37053e8f29d0 100644
--- a/sound/soc/fsl/fsl_spdif.c
+++ b/sound/soc/fsl/fsl_spdif.c
@@ -776,8 +776,8 @@ static int fsl_spdif_vbit_info(struct snd_kcontrol 
*kcontrol,
 }
 
 /* Get valid good bit from interrupt status register */
-static int fsl_spdif_vbit_get(struct snd_kcontrol *kcontrol,
-   struct snd_ctl_elem_value *ucontrol)
+static int fsl_spdif_rx_vbit_get(struct snd_kcontrol *kcontrol,
+struct snd_ctl_elem_value *ucontrol)
 {
struct snd_soc_dai *cpu_dai = snd_kcontrol_chip(kcontrol);
struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(cpu_dai);
@@ -791,6 +791,35 @@ static int fsl_spdif_vbit_get(struct snd_kcontrol 
*kcontrol,
return 0;
 }
 
+static int fsl_spdif_tx_vbit_get(struct snd_kcontrol *kcontrol,
+struct snd_ctl_elem_value *ucontrol)
+{
+   struct snd_soc_dai *cpu_dai = snd_kcontrol_chip(kcontrol);
+   struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(cpu_dai);
+   struct regmap *regmap = spdif_priv->regmap;
+   u32 val;
+
+   regmap_read(regmap, REG_SPDIF_SCR, &val);
+   val = (val & SCR_VAL_MASK) >> SCR_VAL_OFFSET;
+   val = 1 - val;
+   ucontrol->value.integer.value[0] = val;
+
+   return 0;
+}
+
+static int fsl_spdif_tx_vbit_put(struct snd_kcontrol *kcontrol,
+struct snd_ctl_elem_value *ucontrol)
+{
+   struct snd_soc_dai *cpu_dai = snd_kcontrol_chip(kcontrol);
+   struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(cpu_dai);
+   struct regmap *regmap = spdif_priv->regmap;
+   u32 val = (1 - ucontrol->value.integer.value[0]) << SCR_VAL_OFFSET;
+
+   regmap_update_bits(regmap, REG_SPDIF_SCR, SCR_VAL_MASK, val);
+
+   return 0;
+}
+
 /* DPLL lock information */
 static int fsl_spdif_rxrate_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
@@ -948,11 +977,21 @@ static struct snd_kcontrol_new fsl_spdif_ctrls[] = {
/* Valid bit error controller */
{
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
-   .name = "IEC958 V-Bit Errors",
+   .name = "IEC958 RX V-Bit Errors",
.access = SNDRV_CTL_ELEM_ACCESS_READ |
SNDRV_CTL_ELEM_ACCESS_VOLATILE,
.info = fsl_spdif_vbit_info,
-   .get = fsl_spdif_vbit_get,
+   .get = fsl_spdif_rx_vbit_get,
+   },
+   {
+   .iface = SNDRV_CTL_ELEM_IFACE_PCM,
+   .name = "IEC958 TX V-Bit",
+   .access = SNDRV_CTL_ELEM_ACCESS_READ |
+   SNDRV_CTL_ELEM_ACCESS_WRITE |
+   SNDRV_CTL_ELEM_ACCESS_VOLATILE,
+   .info = fsl_spdif_vbit_info,
+   .get = fsl_spdif_tx_vbit_get,
+   .put = fsl_spdif_tx_vbit_put,
},
/* DPLL lock info get controller */
{
-- 
2.21.0



[PATCH v2 1/2] kbuild: introduce ccflags-remove-y and asflags-remove-y

2020-07-07 Thread Masahiro Yamada
CFLAGS_REMOVE_.o filters out flags when compiling a particular
object, but there is no convenient way to do that for every object in
a directory.

Add ccflags-remove-y and asflags-remove-y to make it easily.

Use ccflags-remove-y to clean up some Makefiles.

The add/remove order works as follows:

 [1] KBUILD_CFLAGS specifies compiler flags used globally

 [2] ccflags-y adds compiler flags for all objects in the
 current Makefile

 [3] ccflags-remove-y removes compiler flags for all objects in the
 current Makefile (New feature)

 [4] CFLAGS_ adds compiler flags per file.

 [5] CFLAGS_REMOVE_ removes compiler flags per file.

Having [3] before [4] allows us to remove flags from most (but not all)
objects in the current Makefile.

For example, kernel/trace/Makefile removes $(CC_FLAGS_FTRACE)
from all objects in the directory, then adds it back to
trace_selftest_dynamic.o and CFLAGS_trace_kprobe_selftest.o

Please note ccflags-remove-y has no effect to the sub-directories.
In contrast, the previous notation got rid of compiler flags also from
all the sub-directories.

  arch/arm/boot/compressed/
  arch/powerpc/xmon/
  arch/sh/
  kernel/trace/

... have no sub-directories.

  lib/

... has several sub-directories.

To keep the behavior, I added ccflags-remove-y to all Makefiles
in subdirectories of lib/, except:

  lib/vdso/Makefile- Kbuild does not descend into this Makefile
  lib/raid/test/Makefile   - This is not used for the kernel build

I think commit 2464a609ded0 ("ftrace: do not trace library functions")
excluded too much. In later commit, I will try to remove ccflags-remove-y
from sub-directory Makefiles.

Suggested-by: Sami Tolvanen 
Signed-off-by: Masahiro Yamada 
Acked-by: Steven Rostedt (VMware) 
Acked-by: Michael Ellerman  (powerpc)
---

Changes in v2:
  - Swap the order of [3] and [4] to keep the current behavior of
kernel/trace/Makefile.
  - Add ccflags-remove-y to subdir Makefiles of lib/

 Documentation/kbuild/makefiles.rst | 14 ++
 arch/arm/boot/compressed/Makefile  |  6 +-
 arch/powerpc/xmon/Makefile |  3 +--
 arch/sh/boot/compressed/Makefile   |  5 +
 kernel/trace/Makefile  |  4 ++--
 lib/842/Makefile   |  3 +++
 lib/Makefile   |  5 +
 lib/crypto/Makefile|  2 ++
 lib/dim/Makefile   |  2 ++
 lib/fonts/Makefile |  2 ++
 lib/kunit/Makefile |  3 +++
 lib/livepatch/Makefile |  2 ++
 lib/lz4/Makefile   |  1 +
 lib/lzo/Makefile   |  2 ++
 lib/math/Makefile  |  2 ++
 lib/mpi/Makefile   |  2 ++
 lib/raid6/Makefile |  3 +++
 lib/reed_solomon/Makefile  |  2 ++
 lib/xz/Makefile|  3 +++
 lib/zlib_deflate/Makefile  |  2 ++
 lib/zlib_dfltcc/Makefile   |  2 ++
 lib/zlib_inflate/Makefile  |  2 ++
 lib/zstd/Makefile  |  1 +
 scripts/Makefile.lib   | 14 --
 24 files changed, 64 insertions(+), 23 deletions(-)

diff --git a/Documentation/kbuild/makefiles.rst 
b/Documentation/kbuild/makefiles.rst
index 6515ebc12b6f..14d8e7d23c04 100644
--- a/Documentation/kbuild/makefiles.rst
+++ b/Documentation/kbuild/makefiles.rst
@@ -368,6 +368,14 @@ more details, with real examples.
 
subdir-ccflags-y := -Werror
 
+ccflags-remove-y, asflags-remove-y
+   These flags are used to remove particular flags for the compiler,
+   assembler invocations.
+
+   Example::
+
+   ccflags-remove-$(CONFIG_MCOUNT) += -pg
+
 CFLAGS_$@, AFLAGS_$@
CFLAGS_$@ and AFLAGS_$@ only apply to commands in current
kbuild makefile.
@@ -375,6 +383,9 @@ more details, with real examples.
$(CFLAGS_$@) specifies per-file options for $(CC).  The $@
part has a literal value which specifies the file that it is for.
 
+   CFLAGS_$@ has the higher priority than ccflags-remove-y; CFLAGS_$@
+   can re-add compiler flags that were removed by ccflags-remove-y.
+
Example::
 
# drivers/scsi/Makefile
@@ -387,6 +398,9 @@ more details, with real examples.
$(AFLAGS_$@) is a similar feature for source files in assembly
languages.
 
+   AFLAGS_$@ has the higher priority than asflags-remove-y; AFLAGS_$@
+   can re-add assembler flags that were removed by asflags-remove-y.
+
Example::
 
# arch/arm/kernel/Makefile
diff --git a/arch/arm/boot/compressed/Makefile 
b/arch/arm/boot/compressed/Makefile
index 00602a6fba04..3d5691b23951 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -103,13 +103,9 @@ clean-files += piggy_data lib1funcs.S ashldi3.S 
bswapsdi2.S hyp-stub.S
 
 KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
 
-ifeq ($(CONFIG_FUNCTION_TRACER),y)
-ORIG_CFLAGS := $(KBUILD_CFLAGS)
-KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
-endif
-
 c

[PATCH 05/28] ASoC: fsl: fsl_ssi: Demote obvious misuse of kerneldoc to standard comment blocks

2020-07-07 Thread Lee Jones
No attempt has been made to document any of the demoted functions here.

Fixes the following W=1 kernel build warning(s):

 sound/soc/fsl/fsl_ssi.c:380: warning: Function parameter or member 'irq' not 
described in 'fsl_ssi_isr'
 sound/soc/fsl/fsl_ssi.c:380: warning: Function parameter or member 'dev_id' 
not described in 'fsl_ssi_isr'
 sound/soc/fsl/fsl_ssi.c:406: warning: Function parameter or member 'ssi' not 
described in 'fsl_ssi_config_enable'
 sound/soc/fsl/fsl_ssi.c:406: warning: Function parameter or member 'tx' not 
described in 'fsl_ssi_config_enable'
 sound/soc/fsl/fsl_ssi.c:506: warning: Function parameter or member 'ssi' not 
described in 'fsl_ssi_config_disable'
 sound/soc/fsl/fsl_ssi.c:506: warning: Function parameter or member 'tx' not 
described in 'fsl_ssi_config_disable'
 sound/soc/fsl/fsl_ssi.c:583: warning: Function parameter or member 'ssi' not 
described in 'fsl_ssi_setup_regvals'
 sound/soc/fsl/fsl_ssi.c:675: warning: Function parameter or member 'substream' 
not described in 'fsl_ssi_set_bclk'
 sound/soc/fsl/fsl_ssi.c:675: warning: Function parameter or member 'dai' not 
described in 'fsl_ssi_set_bclk'
 sound/soc/fsl/fsl_ssi.c:675: warning: Function parameter or member 'hw_params' 
not described in 'fsl_ssi_set_bclk'
 sound/soc/fsl/fsl_ssi.c:798: warning: Function parameter or member 'substream' 
not described in 'fsl_ssi_hw_params'
 sound/soc/fsl/fsl_ssi.c:798: warning: Function parameter or member 'hw_params' 
not described in 'fsl_ssi_hw_params'
 sound/soc/fsl/fsl_ssi.c:798: warning: Function parameter or member 'dai' not 
described in 'fsl_ssi_hw_params'
 sound/soc/fsl/fsl_ssi.c:1003: warning: Function parameter or member 'dai' not 
described in 'fsl_ssi_set_dai_fmt'
 sound/soc/fsl/fsl_ssi.c:1003: warning: Function parameter or member 'fmt' not 
described in 'fsl_ssi_set_dai_fmt'
 sound/soc/fsl/fsl_ssi.c:1018: warning: Function parameter or member 'dai' not 
described in 'fsl_ssi_set_dai_tdm_slot'
 sound/soc/fsl/fsl_ssi.c:1018: warning: Function parameter or member 'tx_mask' 
not described in 'fsl_ssi_set_dai_tdm_slot'
 sound/soc/fsl/fsl_ssi.c:1018: warning: Function parameter or member 'rx_mask' 
not described in 'fsl_ssi_set_dai_tdm_slot'
 sound/soc/fsl/fsl_ssi.c:1018: warning: Function parameter or member 'slots' 
not described in 'fsl_ssi_set_dai_tdm_slot'
 sound/soc/fsl/fsl_ssi.c:1018: warning: Function parameter or member 
'slot_width' not described in 'fsl_ssi_set_dai_tdm_slot'
 sound/soc/fsl/fsl_ssi.c:1065: warning: Function parameter or member 
'substream' not described in 'fsl_ssi_trigger'
 sound/soc/fsl/fsl_ssi.c:1065: warning: Function parameter or member 'cmd' not 
described in 'fsl_ssi_trigger'
 sound/soc/fsl/fsl_ssi.c:1065: warning: Function parameter or member 'dai' not 
described in 'fsl_ssi_trigger'
 sound/soc/fsl/fsl_ssi.c:1245: warning: Function parameter or member 'ssi' not 
described in 'fsl_ssi_hw_init'
 sound/soc/fsl/fsl_ssi.c:1274: warning: Function parameter or member 'ssi' not 
described in 'fsl_ssi_hw_clean'
 sound/soc/fsl/fsl_ssi.c:1292: warning: Function parameter or member 's' not 
described in 'make_lowercase'

Also use correct formatting when documenting structs:

 sound/soc/fsl/fsl_ssi.c:258: warning: cannot understand function prototype: 
'struct fsl_ssi '

Cc: Timur Tabi 
Cc: Nicolin Chen 
Cc: Xiubo Li 
Cc: Fabio Estevam 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Lee Jones 
---
 sound/soc/fsl/fsl_ssi.c | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 1a2fa7f181423..5717d664cde1e 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -203,7 +203,7 @@ struct fsl_ssi_soc_data {
 };
 
 /**
- * fsl_ssi: per-SSI private data
+ * struct fsl_ssi - per-SSI private data
  *
  * @regs: Pointer to the regmap registers
  * @irq: IRQ of this SSI
@@ -373,7 +373,7 @@ static bool fsl_ssi_is_i2s_cbm_cfs(struct fsl_ssi *ssi)
SND_SOC_DAIFMT_CBM_CFS;
 }
 
-/**
+/*
  * Interrupt handler to gather states
  */
 static irqreturn_t fsl_ssi_isr(int irq, void *dev_id)
@@ -394,7 +394,7 @@ static irqreturn_t fsl_ssi_isr(int irq, void *dev_id)
return IRQ_HANDLED;
 }
 
-/**
+/*
  * Set SCR, SIER, STCR and SRCR registers with cached values in regvals
  *
  * Notes:
@@ -474,7 +474,7 @@ static void fsl_ssi_config_enable(struct fsl_ssi *ssi, bool 
tx)
ssi->streams |= BIT(dir);
 }
 
-/**
+/*
  * Exclude bits that are used by the opposite stream
  *
  * When both streams are active, disabling some bits for the current stream
@@ -494,7 +494,7 @@ static void fsl_ssi_config_enable(struct fsl_ssi *ssi, bool 
tx)
 #define ssi_excl_shared_bits(vals, avals, aactive) \
((vals) & _ssi_xor_shared_bits(vals, avals, aactive))
 
-/**
+/*
  * Unset SCR, SIER, STCR and SRCR registers with cached values in regvals
  *
  * Notes:
@@ -576,7 +576,7 @@ static void fsl_ssi_tx_ac97_saccst_setup(struct fsl_ssi 
*ssi)
}
 }
 
-/**

[PATCH 03/28] ASoC: fsl: fsl-asoc-card: Use correct format when providing struct documentation

2020-07-07 Thread Lee Jones
Struct kerneldoc headers need to be prefixed with 'struct $NAME', else
the checker gets confused.

Fixes the following W=1 kernel build warning(s):

 sound/soc/fsl/fsl-asoc-card.c:43: warning: cannot understand function 
prototype: 'struct codec_priv '
 sound/soc/fsl/fsl-asoc-card.c:60: warning: cannot understand function 
prototype: 'struct cpu_priv '
 sound/soc/fsl/fsl-asoc-card.c:83: warning: cannot understand function 
prototype: 'struct fsl_asoc_card_priv '
 sound/soc/fsl/fsl-asoc-card.c:104: warning: cannot understand function 
prototype: 'const struct snd_soc_dapm_route audio_map[] = '

Also the size of the struct does not belong in the description:

 sound/soc/fsl/fsl-asoc-card.c:65: warning: Function parameter or member 
'sysclk_freq' not described in 'cpu_priv'
 sound/soc/fsl/fsl-asoc-card.c:65: warning: Function parameter or member 
'sysclk_dir' not described in 'cpu_priv'
 sound/soc/fsl/fsl-asoc-card.c:65: warning: Function parameter or member 
'sysclk_id' not described in 'cpu_priv'
 sound/soc/fsl/fsl-asoc-card.c:95: warning: Function parameter or member 
'dai_link' not described in 'fsl_asoc_card_priv'

Cc: Timur Tabi 
Cc: Nicolin Chen 
Cc: Xiubo Li 
Cc: Fabio Estevam 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Lee Jones 
---
 sound/soc/fsl/fsl-asoc-card.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 57ea1b072326b..3b1fd8c9316d8 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -33,7 +33,7 @@
 #define DAI_FMT_BASE (SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF)
 
 /**
- * CODEC private data
+ * struct codec_priv - CODEC private data
  *
  * @mclk_freq: Clock rate of MCLK
  * @mclk_id: MCLK (or main clock) id for set_sysclk()
@@ -48,11 +48,11 @@ struct codec_priv {
 };
 
 /**
- * CPU private data
+ * struct cpu_priv - CPU private data
  *
- * @sysclk_freq[2]: SYSCLK rates for set_sysclk()
- * @sysclk_dir[2]: SYSCLK directions for set_sysclk()
- * @sysclk_id[2]: SYSCLK ids for set_sysclk()
+ * @sysclk_freq: SYSCLK rates for set_sysclk()
+ * @sysclk_dir: SYSCLK directions for set_sysclk()
+ * @sysclk_id: SYSCLK ids for set_sysclk()
  * @slot_width: Slot width of each frame
  *
  * Note: [1] for tx and [0] for rx
@@ -65,9 +65,9 @@ struct cpu_priv {
 };
 
 /**
- * Freescale Generic ASOC card private data
+ * struct fsl_asoc_card_priv - Freescale Generic ASOC card private data
  *
- * @dai_link[3]: DAI link structure including normal one and DPCM link
+ * @dai_link: DAI link structure including normal one and DPCM link
  * @pdev: platform device pointer
  * @codec_priv: CODEC private data
  * @cpu_priv: CPU private data
@@ -94,7 +94,7 @@ struct fsl_asoc_card_priv {
char name[32];
 };
 
-/**
+/*
  * This dapm route map exsits for DPCM link only.
  * The other routes shall go through Device Tree.
  *
-- 
2.25.1



[PATCH 06/28] ASoC: fsl: fsl_ssi_dbg: Demote obvious misuse of kerneldoc to standard comment blocks

2020-07-07 Thread Lee Jones
No attempt has been made to document either of the demoted functions here.

Fixes the following W=1 kernel build warning(s):

 sound/soc/fsl/fsl_ssi_dbg.c:90: warning: Function parameter or member 'flag' 
not described in 'SIER_SHOW'
 sound/soc/fsl/fsl_ssi_dbg.c:90: warning: Function parameter or member 'name' 
not described in 'SIER_SHOW'
 sound/soc/fsl/fsl_ssi_dbg.c:99: warning: Function parameter or member 's' not 
described in 'fsl_ssi_stats_show'
 sound/soc/fsl/fsl_ssi_dbg.c:99: warning: Function parameter or member 'unused' 
not described in 'fsl_ssi_stats_show'

Cc: Timur Tabi 
Cc: Nicolin Chen 
Cc: Xiubo Li 
Cc: Fabio Estevam 
Cc: Markus Pargmann 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Lee Jones 
---
 sound/soc/fsl/fsl_ssi_dbg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/fsl/fsl_ssi_dbg.c b/sound/soc/fsl/fsl_ssi_dbg.c
index 2a20ee23dc52d..2c46c55f0a882 100644
--- a/sound/soc/fsl/fsl_ssi_dbg.c
+++ b/sound/soc/fsl/fsl_ssi_dbg.c
@@ -78,7 +78,7 @@ void fsl_ssi_dbg_isr(struct fsl_ssi_dbg *dbg, u32 sisr)
dbg->stats.tfe0++;
 }
 
-/**
+/*
  * Show the statistics of a flag only if its interrupt is enabled
  *
  * Compilers will optimize it to a no-op if the interrupt is disabled
@@ -90,7 +90,7 @@ void fsl_ssi_dbg_isr(struct fsl_ssi_dbg *dbg, u32 sisr)
} while (0)
 
 
-/**
+/*
  * Display the statistics for the current SSI device
  *
  * To avoid confusion, only show those counts that are enabled
-- 
2.25.1



[PATCH 04/28] ASoC: fsl: fsl_asrc: Demote obvious misuse of kerneldoc to standard comment blocks

2020-07-07 Thread Lee Jones
No attempt has been made to document any of the demoted functions here.

Fixes the following W=1 kernel build warning(s):

 sound/soc/fsl/fsl_asrc.c:44: warning: cannot understand function prototype: 
'unsigned char input_clk_map_imx35[ASRC_CLK_MAP_LEN] = '
 sound/soc/fsl/fsl_asrc.c:78: warning: cannot understand function prototype: 
'unsigned char clk_map_imx8qm[2][ASRC_CLK_MAP_LEN] = '
 sound/soc/fsl/fsl_asrc.c:118: warning: Function parameter or member 'inrate' 
not described in 'fsl_asrc_sel_proc'
 sound/soc/fsl/fsl_asrc.c:118: warning: Function parameter or member 'outrate' 
not described in 'fsl_asrc_sel_proc'
 sound/soc/fsl/fsl_asrc.c:118: warning: Function parameter or member 'pre_proc' 
not described in 'fsl_asrc_sel_proc'
 sound/soc/fsl/fsl_asrc.c:118: warning: Function parameter or member 
'post_proc' not described in 'fsl_asrc_sel_proc'
 sound/soc/fsl/fsl_asrc.c:158: warning: Function parameter or member 'channels' 
not described in 'fsl_asrc_request_pair'
 sound/soc/fsl/fsl_asrc.c:158: warning: Function parameter or member 'pair' not 
described in 'fsl_asrc_request_pair'
 sound/soc/fsl/fsl_asrc.c:201: warning: Function parameter or member 'pair' not 
described in 'fsl_asrc_release_pair'
 sound/soc/fsl/fsl_asrc.c:223: warning: Function parameter or member 'pair' not 
described in 'fsl_asrc_set_watermarks'
 sound/soc/fsl/fsl_asrc.c:223: warning: Function parameter or member 'in' not 
described in 'fsl_asrc_set_watermarks'
 sound/soc/fsl/fsl_asrc.c:223: warning: Function parameter or member 'out' not 
described in 'fsl_asrc_set_watermarks'
 sound/soc/fsl/fsl_asrc.c:242: warning: Function parameter or member 'pair' not 
described in 'fsl_asrc_cal_asrck_divisor'
 sound/soc/fsl/fsl_asrc.c:242: warning: Function parameter or member 'div' not 
described in 'fsl_asrc_cal_asrck_divisor'
 sound/soc/fsl/fsl_asrc.c:259: warning: Function parameter or member 'pair' not 
described in 'fsl_asrc_set_ideal_ratio'
 sound/soc/fsl/fsl_asrc.c:259: warning: Function parameter or member 'inrate' 
not described in 'fsl_asrc_set_ideal_ratio'
 sound/soc/fsl/fsl_asrc.c:259: warning: Function parameter or member 'outrate' 
not described in 'fsl_asrc_set_ideal_ratio'
 sound/soc/fsl/fsl_asrc.c:310: warning: Function parameter or member 'pair' not 
described in 'fsl_asrc_config_pair'
 sound/soc/fsl/fsl_asrc.c:310: warning: Function parameter or member 
'use_ideal_rate' not described in 'fsl_asrc_config_pair'
 sound/soc/fsl/fsl_asrc.c:516: warning: Function parameter or member 'pair' not 
described in 'fsl_asrc_start_pair'
 sound/soc/fsl/fsl_asrc.c:545: warning: Function parameter or member 'pair' not 
described in 'fsl_asrc_stop_pair'
 sound/soc/fsl/fsl_asrc.c:559: warning: Function parameter or member 'pair' not 
described in 'fsl_asrc_get_dma_channel'
 sound/soc/fsl/fsl_asrc.c:559: warning: Function parameter or member 'dir' not 
described in 'fsl_asrc_get_dma_channel'
 sound/soc/fsl/fsl_asrc.c:902: warning: Function parameter or member 'asrc' not 
described in 'fsl_asrc_init'
 sound/soc/fsl/fsl_asrc.c:936: warning: Function parameter or member 'irq' not 
described in 'fsl_asrc_isr'
 sound/soc/fsl/fsl_asrc.c:936: warning: Function parameter or member 'dev_id' 
not described in 'fsl_asrc_isr'

Cc: Timur Tabi 
Cc: Nicolin Chen 
Cc: Xiubo Li 
Cc: Fabio Estevam 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Lee Jones 
---
 sound/soc/fsl/fsl_asrc.c | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
index 462ce9f9ab488..209bf80dc3670 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -37,7 +37,7 @@ static struct snd_pcm_hw_constraint_list 
fsl_asrc_rate_constraints = {
.list = supported_asrc_rate,
 };
 
-/**
+/*
  * The following tables map the relationship between asrc_inclk/asrc_outclk in
  * fsl_asrc.h and the registers of ASRCSR
  */
@@ -68,7 +68,7 @@ static unsigned char output_clk_map_imx53[ASRC_CLK_MAP_LEN] = 
{
0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 
0x7, 0x7,
 };
 
-/**
+/*
  * i.MX8QM/i.MX8QXP uses the same map for input and output.
  * clk_map_imx8qm[0] is for i.MX8QM asrc0
  * clk_map_imx8qm[1] is for i.MX8QM asrc1
@@ -101,7 +101,7 @@ static unsigned char clk_map_imx8qxp[2][ASRC_CLK_MAP_LEN] = 
{
},
 };
 
-/**
+/*
  * Select the pre-processing and post-processing options
  * Make sure to exclude following unsupported cases before
  * calling this function:
@@ -147,7 +147,7 @@ static void fsl_asrc_sel_proc(int inrate, int outrate,
*post_proc = 1;
 }
 
-/**
+/*
  * Request ASRC pair
  *
  * It assigns pair by the order of A->C->B because allocation of pair B,
@@ -192,7 +192,7 @@ static int fsl_asrc_request_pair(int channels, struct 
fsl_asrc_pair *pair)
return ret;
 }
 
-/**
+/*
  * Release ASRC pair
  *
  * It clears the resource from asrc and releases the occupied channels.
@@ -216,7 +216,7 @@ static void fsl_asrc_rel

[PATCH 07/28] ASoC: fsl: fsl_spdif: Use correct formatting when denoting struct documentation

2020-07-07 Thread Lee Jones
Kerneldoc expects struct documentation to start with "struct $NAME".

Fixes the following W=1 kernel build warning(s):

 sound/soc/fsl/fsl_spdif.c:104: warning: cannot understand function prototype: 
'struct fsl_spdif_priv '

Cc: Timur Tabi 
Cc: Nicolin Chen 
Cc: Xiubo Li 
Cc: Fabio Estevam 
Cc: Vladimir Barinov 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Lee Jones 
---
 sound/soc/fsl/fsl_spdif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c
index 5b2689ae63d4d..7aa3bdec5b6b5 100644
--- a/sound/soc/fsl/fsl_spdif.c
+++ b/sound/soc/fsl/fsl_spdif.c
@@ -81,7 +81,7 @@ struct spdif_mixer_control {
 };
 
 /**
- * fsl_spdif_priv: Freescale SPDIF private data
+ * struct fsl_spdif_priv - Freescale SPDIF private data
  *
  * @fsl_spdif_control: SPDIF control data
  * @cpu_dai_drv: cpu dai driver
-- 
2.25.1



[PATCH 08/28] ASoC: fsl: fsl_spdif: Update 'struct fsl_spdif_priv's descriptions

2020-07-07 Thread Lee Jones
Two descriptions for 'soc' and 'regcache_srpc' were missing.  Add them.

Fixes the following W=1 kernel build warning(s):

 sound/soc/fsl/fsl_spdif.c:125: warning: Function parameter or member 'soc' not 
described in 'fsl_spdif_priv'
 sound/soc/fsl/fsl_spdif.c:125: warning: Function parameter or member 
'regcache_srpc' not described in 'fsl_spdif_priv'

Cc: Timur Tabi 
Cc: Nicolin Chen 
Cc: Xiubo Li 
Cc: Fabio Estevam 
Cc: Vladimir Barinov 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Lee Jones 
---
 sound/soc/fsl/fsl_spdif.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c
index 7aa3bdec5b6b5..f0b2375a9246f 100644
--- a/sound/soc/fsl/fsl_spdif.c
+++ b/sound/soc/fsl/fsl_spdif.c
@@ -83,6 +83,7 @@ struct spdif_mixer_control {
 /**
  * struct fsl_spdif_priv - Freescale SPDIF private data
  *
+ * @soc: SoC specific data
  * @fsl_spdif_control: SPDIF control data
  * @cpu_dai_drv: cpu dai driver
  * @pdev: platform device pointer
@@ -100,6 +101,7 @@ struct spdif_mixer_control {
  * @spbaclk: SPBA clock (optional, depending on SoC design)
  * @dma_params_tx: DMA parameters for transmit channel
  * @dma_params_rx: DMA parameters for receive channel
+ * @regcache_srpc: regcache for SRPC
  */
 struct fsl_spdif_priv {
const struct fsl_spdif_soc_data *soc;
@@ -120,7 +122,6 @@ struct fsl_spdif_priv {
struct clk *spbaclk;
struct snd_dmaengine_dai_dma_data dma_params_tx;
struct snd_dmaengine_dai_dma_data dma_params_rx;
-   /* regcache for SRPC */
u32 regcache_srpc;
 };
 
-- 
2.25.1



[PATCH 09/28] ASoC: fsl: fsl_esai: Fix a bunch of kerneldoc issues

2020-07-07 Thread Lee Jones
Struct headers require a 'struct $NAME' title, all function parameters
require a description and need to be in the format '@.*:', else the
checker gets confused.  Also demote one kerneldoc header where no effort
was made to document any of the function's params.

Fixes the following W=1 kernel build warning(s):

 sound/soc/fsl/fsl_esai.c:30: warning: cannot understand function prototype: 
'struct fsl_esai_soc_data '
 sound/soc/fsl/fsl_esai.c:61: warning: cannot understand function prototype: 
'struct fsl_esai '
 sound/soc/fsl/fsl_esai.c:170: warning: Function parameter or member 'dai' not 
described in 'fsl_esai_divisor_cal'
 sound/soc/fsl/fsl_esai.c:265: warning: Function parameter or member 'dai' not 
described in 'fsl_esai_set_dai_sysclk'
 sound/soc/fsl/fsl_esai.c:265: warning: Function parameter or member 'clk_id' 
not described in 'fsl_esai_set_dai_sysclk'
 sound/soc/fsl/fsl_esai.c:265: warning: Function parameter or member 'freq' not 
described in 'fsl_esai_set_dai_sysclk'
 sound/soc/fsl/fsl_esai.c:265: warning: Function parameter or member 'dir' not 
described in 'fsl_esai_set_dai_sysclk'
 sound/soc/fsl/fsl_esai.c:265: warning: Excess function parameter 'Parameters' 
description in 'fsl_esai_set_dai_sysclk'
 sound/soc/fsl/fsl_esai.c:364: warning: Function parameter or member 'dai' not 
described in 'fsl_esai_set_bclk'
 sound/soc/fsl/fsl_esai.c:364: warning: Function parameter or member 'tx' not 
described in 'fsl_esai_set_bclk'
 sound/soc/fsl/fsl_esai.c:364: warning: Function parameter or member 'freq' not 
described in 'fsl_esai_set_bclk'

Cc: Timur Tabi 
Cc: Nicolin Chen 
Cc: Xiubo Li 
Cc: Fabio Estevam 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Lee Jones 
---
 sound/soc/fsl/fsl_esai.c | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index cbcb70d6f8c83..bb3c405df623c 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -22,7 +22,7 @@
SNDRV_PCM_FMTBIT_S24_LE)
 
 /**
- * fsl_esai_soc_data: soc specific data
+ * struct fsl_esai_soc_data - soc specific data
  *
  * @imx: for imx platform
  * @reset_at_xrun: flags for enable reset operaton
@@ -33,7 +33,7 @@ struct fsl_esai_soc_data {
 };
 
 /**
- * fsl_esai: ESAI private data
+ * struct fsl_esai - ESAI private data
  *
  * @dma_params_rx: DMA parameters for receive channel
  * @dma_params_tx: DMA parameters for transmit channel
@@ -160,10 +160,11 @@ static irqreturn_t esai_isr(int irq, void *devid)
  * This function is used to calculate the divisors of psr, pm, fp and it is
  * supposed to be called in set_dai_sysclk() and set_bclk().
  *
+ * @dai: SoC DAI
+ * @tx: current setting is for playback or capture
  * @ratio: desired overall ratio for the paticipating dividers
  * @usefp: for HCK setting, there is no need to set fp divider
  * @fp: bypass other dividers by setting fp directly if fp != 0
- * @tx: current setting is for playback or capture
  */
 static int fsl_esai_divisor_cal(struct snd_soc_dai *dai, bool tx, u32 ratio,
bool usefp, u32 fp)
@@ -252,11 +253,11 @@ static int fsl_esai_divisor_cal(struct snd_soc_dai *dai, 
bool tx, u32 ratio,
 /**
  * This function mainly configures the clock frequency of MCLK (HCKT/HCKR)
  *
- * @Parameters:
- * clk_id: The clock source of HCKT/HCKR
+ * @dai: SoC DAI
+ * @clk_id: The clock source of HCKT/HCKR
  *   (Input from outside; output from inside, FSYS or EXTAL)
- * freq: The required clock rate of HCKT/HCKR
- * dir: The clock direction of HCKT/HCKR
+ * @freq: The required clock rate of HCKT/HCKR
+ * @dir: The clock direction of HCKT/HCKR
  *
  * Note: If the direction is input, we do not care about clk_id.
  */
@@ -357,7 +358,7 @@ static int fsl_esai_set_dai_sysclk(struct snd_soc_dai *dai, 
int clk_id,
return 0;
 }
 
-/**
+/*
  * This function configures the related dividers according to the bclk rate
  */
 static int fsl_esai_set_bclk(struct snd_soc_dai *dai, bool tx, u32 freq)
-- 
2.25.1



[PATCH 10/28] ASoC: fsl: fsl_esai: Add descriptions for 'tx_mask' and 'rx_mask' to 'fsl_esai'

2020-07-07 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 sound/soc/fsl/fsl_esai.c:86: warning: Function parameter or member 'tx_mask' 
not described in 'fsl_esai'
 sound/soc/fsl/fsl_esai.c:86: warning: Function parameter or member 'rx_mask' 
not described in 'fsl_esai'

Cc: Timur Tabi 
Cc: Nicolin Chen 
Cc: Xiubo Li 
Cc: Fabio Estevam 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Lee Jones 
---
 sound/soc/fsl/fsl_esai.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index bb3c405df623c..3f67f4a465780 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -49,6 +49,8 @@ struct fsl_esai_soc_data {
  * @fifo_depth: depth of tx/rx FIFO
  * @slot_width: width of each DAI slot
  * @slots: number of slots
+ * @tx_mask: tx register mask
+ * @rx_mask: rx register mask
  * @channels: channel num for tx or rx
  * @hck_rate: clock rate of desired HCKx clock
  * @sck_rate: clock rate of desired SCKx clock
-- 
2.25.1



Re: [PATCH v3 1/2] powerpc/perf/hv-24x7: Add cpu hotplug support

2020-07-07 Thread kajoljain



On 7/6/20 8:43 AM, Michael Ellerman wrote:
> Kajol Jain  writes:
>> Patch here adds cpu hotplug functions to hv_24x7 pmu.
>> A new cpuhp_state "CPUHP_AP_PERF_POWERPC_HV_24x7_ONLINE" enum
>> is added.
>>
>> The online callback function updates the cpumask only if its
>> empty. As the primary intention of adding hotplug support
>> is to designate a CPU to make HCALL to collect the
>> counter data.
>>
>> The offline function test and clear corresponding cpu in a cpumask
>> and update cpumask to any other active cpu.
>>
>> Signed-off-by: Kajol Jain 
>> Reviewed-by: Gautham R. Shenoy 
>> ---
>>  arch/powerpc/perf/hv-24x7.c | 45 +
>>  include/linux/cpuhotplug.h  |  1 +
>>  2 files changed, 46 insertions(+)
>>
>> diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c
>> index db213eb7cb02..ce4739e2b407 100644
>> --- a/arch/powerpc/perf/hv-24x7.c
>> +++ b/arch/powerpc/perf/hv-24x7.c
>> @@ -31,6 +31,8 @@ static int interface_version;
>>  /* Whether we have to aggregate result data for some domains. */
>>  static bool aggregate_result_elements;
>>  
>> +static cpumask_t hv_24x7_cpumask;
>> +
>>  static bool domain_is_valid(unsigned domain)
>>  {
>>  switch (domain) {
>> @@ -1641,6 +1643,44 @@ static struct pmu h_24x7_pmu = {
>>  .capabilities = PERF_PMU_CAP_NO_EXCLUDE,
>>  };
>>  
>> +static int ppc_hv_24x7_cpu_online(unsigned int cpu)
>> +{
>> +/* Make this CPU the designated target for counter collection */
> 
> The comment implies every newly onlined CPU will become the target, but
> actually it's only the first onlined CPU.
> 
> So I think the comment needs updating, or you could just drop the
> comment, I think the code is fairly clear by itself.

Hi Michael,
   Thanks for reviewing the patch. Sure I will update it accordingly.

> 
>> +if (cpumask_empty(&hv_24x7_cpumask))
>> +cpumask_set_cpu(cpu, &hv_24x7_cpumask);
>> +
>> +return 0;
>> +}
>> +
>> +static int ppc_hv_24x7_cpu_offline(unsigned int cpu)
>> +{
>> +int target = -1;
> 
> No need to initialise target, you assign to it unconditionally below.

Ok Will change.

> 
>> +/* Check if exiting cpu is used for collecting 24x7 events */
>> +if (!cpumask_test_and_clear_cpu(cpu, &hv_24x7_cpumask))
>> +return 0;
>> +
>> +/* Find a new cpu to collect 24x7 events */
>> +target = cpumask_last(cpu_active_mask);
> 
> Any reason to use cpumask_last() vs cpumask_first(), or a randomly
> chosen CPU?

Incase we sequentially offline multiple cpus, taking cpumask_first() may add 
some latency in
that scenario.

So, I was trying to test benchmark in power9 lpar with 16 cpu, by off-lining 
cpu 0-14

With cpumask_last: This is what I got.

real0m2.812s
user0m0.002s
sys 0m0.003s

With cpulast_any:
real0m3.690s
user0m0.002s
sys 0m0.062s

That's why I just went with cpumask_last thing. Please Let me know if any 
changes required.

> 
>> +if (target < 0 || target >= nr_cpu_ids)
>> +return -1;
>> +
>> +/* Migrate 24x7 events to the new target */
>> +cpumask_set_cpu(target, &hv_24x7_cpumask);
>> +perf_pmu_migrate_context(&h_24x7_pmu, cpu, target);
>> +
>> +return 0;
>> +}
>> +
>> +static int hv_24x7_cpu_hotplug_init(void)
>> +{
>> +return cpuhp_setup_state(CPUHP_AP_PERF_POWERPC_HV_24x7_ONLINE,
>> +  "perf/powerpc/hv_24x7:online",
>> +  ppc_hv_24x7_cpu_online,
>> +  ppc_hv_24x7_cpu_offline);
>> +}
>> +
>>  static int hv_24x7_init(void)
>>  {
>>  int r;
>> @@ -1685,6 +1725,11 @@ static int hv_24x7_init(void)
>>  if (r)
>>  return r;
>>  
>> +/* init cpuhotplug */
>> +r = hv_24x7_cpu_hotplug_init();
>> +if (r)
>> +pr_err("hv_24x7: CPU hotplug init failed\n");
>> +
> 
> The hotplug initialisation shouldn't fail unless something is badly
> wrong. I think you should just fail initialisation of the entire PMU if
> that happens, which will make the error handling in the next patch much
> simpler.
> 

I will update it.

Thanks,
Kajol Jain
> cheers
> 
>>  r = perf_pmu_register(&h_24x7_pmu, h_24x7_pmu.name, -1);
>>  if (r)
>>  return r;


[PATCH 4/5] cpuidle-pseries : Include extended CEDE states in cpuidle framework

2020-07-07 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" 

This patch exposes those extended CEDE states to the cpuidle framework
which are responsive to external interrupts and do not need an H_PROD.

Since as per the PAPR, all the extended CEDE states are non-responsive
to timers, we indicate this to the cpuidle subsystem via the
CPUIDLE_FLAG_TIMER_STOP flag for all those extende CEDE states which
can wake up on external interrupts.

With the patch, we are able to see the extended CEDE state with
latency hint = 1 exposed via the cpuidle framework.

$ cpupower idle-info
CPUidle driver: pseries_idle
CPUidle governor: menu
analyzing CPU 0:

Number of idle states: 3
Available idle states: snooze CEDE XCEDE1
snooze:
Flags/Description: snooze
Latency: 0
Usage: 33429446
Duration: 27006062
CEDE:
Flags/Description: CEDE
Latency: 1
Usage: 10272
Duration: 110786770
XCEDE1:
Flags/Description: XCEDE1
Latency: 12
Usage: 26445
Duration: 1436433815

Benchmark results:
TLDR: Over all we do not see any additional benefit from having XCEDE1 over
CEDE.

ebizzy :
2 threads bound to a big-core. With this patch, we see a 3.39%
regression compared to with only CEDE0 latency fixup.
x With only CEDE0 latency fixup
* With CEDE0 latency fixup + CEDE1
N   Min   MaxMedian   AvgStddev
x  10   2893813   5834474   5832448 5327281.3 1055941.4
*  10   2907329   5834923   5831398 5146614.6 1193874.8

context_switch2:
With the context_switch2 there are no observable regressions in the
results.

context_switch2 CPU0 CPU1 (Same Big-core, different small-cores).
No difference with and without patch.
x without_patch
* with_patch
N   Min   MaxMedian   AvgStddev
x 500343644348778345444 345584.02 1035.1658
* 500344310347646345776 345877.22 802.19501

context_switch2 CPU0 CPU8 (different big-cores). Minor 0.05% improvement
with patch
x without_patch
* with_patch
N   Min   MaxMedian   AvgStddev
x 500287562288756288162 288134.76 262.24328
* 500287874288960288306 288274.66 187.57034

schbench:
No regressions observed with schbench

Without Patch:
Latency percentiles (usec)
50.0th: 29
75.0th: 40
90.0th: 50
95.0th: 61
*99.0th: 13648
99.5th: 14768
99.9th: 15664
min=0, max=29812

With Patch:
Latency percentiles (usec)
50.0th: 30
75.0th: 40
90.0th: 51
95.0th: 59
*99.0th: 13616
99.5th: 14512
99.9th: 15696
min=0, max=15996

Signed-off-by: Gautham R. Shenoy 
---
 drivers/cpuidle/cpuidle-pseries.c | 50 +++
 1 file changed, 50 insertions(+)

diff --git a/drivers/cpuidle/cpuidle-pseries.c 
b/drivers/cpuidle/cpuidle-pseries.c
index 502f906..6f893cd 100644
--- a/drivers/cpuidle/cpuidle-pseries.c
+++ b/drivers/cpuidle/cpuidle-pseries.c
@@ -362,9 +362,59 @@ static int add_pseries_idle_states(void)
for (i = 0; i < nr_xcede_records; i++) {
u64 latency_tb = xcede_records[i].wakeup_latency_tb_ticks;
u64 latency_us = tb_to_ns(latency_tb) / NSEC_PER_USEC;
+   char name[CPUIDLE_NAME_LEN];
+   unsigned int latency_hint = xcede_records[i].latency_hint;
+   u64 residency_us;
+
+   if (!xcede_records[i].responsive_to_irqs) {
+   pr_info("cpuidle : Skipping XCEDE%d. Not responsive to 
IRQs\n",
+   latency_hint);
+   continue;
+   }
 
if (latency_us < min_latency_us)
min_latency_us = latency_us;
+   snprintf(name, CPUIDLE_NAME_LEN, "XCEDE%d", latency_hint);
+
+   /*
+* As per the section 14.14.1 of PAPR version 2.8.1
+* says that alling H_CEDE with the value of the cede
+* latency specifier set greater than zero allows the
+* processor timer facility to be disabled (so as not
+* to cause gratuitous wake-ups - the use of H_PROD,
+* or other external interrupt is required to wake the
+* processor in this case).
+*
+* So, inform the cpuidle-subsystem that the timer
+* will be stopped for these states.
+*
+* Also, bump up the latency by 10us, since cpuidle
+* would use timer-offload framework which will need
+* to send an IPI to wakeup a CPU whose timer has
+* expired.
+*/
+   if (latency_hint > 0) {
+ 

[PATCH 1/5] cpuidle-pseries: Set the latency-hint before entering CEDE

2020-07-07 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" 

As per the PAPR, each H_CEDE call is associated with a latency-hint to
be passed in the VPA field "cede_latency_hint". The CEDE states that
we were implicitly entering so far is CEDE with latency-hint = 0.

This patch explicitly sets the latency hint corresponding to the CEDE
state that we are currently entering. While at it, we save the
previous hint, to be restored once we wakeup from CEDE. This will be
required in the future when we expose extended-cede states through the
cpuidle framework, where each of them will have a different
cede-latency hint.

Signed-off-by: Gautham R. Shenoy 
---
 drivers/cpuidle/cpuidle-pseries.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/cpuidle/cpuidle-pseries.c 
b/drivers/cpuidle/cpuidle-pseries.c
index 4a37252..39d4bb6 100644
--- a/drivers/cpuidle/cpuidle-pseries.c
+++ b/drivers/cpuidle/cpuidle-pseries.c
@@ -105,19 +105,27 @@ static void check_and_cede_processor(void)
}
 }
 
+#define NR_CEDE_STATES 1  /* CEDE with latency-hint 0 */
+#define NR_DEDICATED_STATES(NR_CEDE_STATES + 1) /* Includes snooze */
+
+u8 cede_latency_hint[NR_DEDICATED_STATES];
 static int dedicated_cede_loop(struct cpuidle_device *dev,
struct cpuidle_driver *drv,
int index)
 {
+   u8 old_latency_hint;
 
pseries_idle_prolog();
get_lppaca()->donate_dedicated_cpu = 1;
+   old_latency_hint = get_lppaca()->cede_latency_hint;
+   get_lppaca()->cede_latency_hint = cede_latency_hint[index];
 
HMT_medium();
check_and_cede_processor();
 
local_irq_disable();
get_lppaca()->donate_dedicated_cpu = 0;
+   get_lppaca()->cede_latency_hint = old_latency_hint;
 
pseries_idle_epilog();
 
@@ -149,7 +157,7 @@ static int shared_cede_loop(struct cpuidle_device *dev,
 /*
  * States for dedicated partition case.
  */
-static struct cpuidle_state dedicated_states[] = {
+static struct cpuidle_state dedicated_states[NR_DEDICATED_STATES] = {
{ /* Snooze */
.name = "snooze",
.desc = "snooze",
-- 
1.9.4



[PATCH 0/5] cpuidle-pseries: Parse extended CEDE information for idle.

2020-07-07 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" 

Hi,

On pseries Dedicated Linux LPARs, apart from the polling snooze idle
state, we currently have the CEDE idle state which cedes the CPU to
the hypervisor with latency-hint = 0.

However, the PowerVM hypervisor supports additional extended CEDE
states, which can be queried through the "ibm,get-systems-parameter"
rtas-call with the CEDE_LATENCY_TOKEN. The hypervisor maps these
extended CEDE states to appropriate platform idle-states in order to
provide energy-savings as well as shifting power to the active
units. On existing pseries LPARs today we have extended CEDE with
latency-hints {1,2} supported.

In Patches 1-3 of this patchset, we add the code to parse the CEDE
latency records provided by the hypervisor. We use this information to
determine the wakeup latency of the regular CEDE (which we have been
so far hardcoding to 10us while experimentally it is much lesser ~
1us), by looking at the wakeup latency provided by the hypervisor for
Extended CEDE states. Since the platform currently advertises Extended
CEDE 1 to have wakeup latency of 2us, we can be sure that the wakeup
latency of the regular CEDE is no more than this.

Patch 4 (currently marked as RFC), expose the extended CEDE states
parsed above to the cpuidle framework, provided that they can wakeup
on an interrupt. On current platforms only Extended CEDE 1 fits the
bill, but this is going to change in future platforms where even
Extended CEDE 2 may be responsive to external interrupts.

Patch 5 (currently marked as RFC), filters out Extended CEDE 1 since
it offers no added advantage over the normal CEDE.

With Patches 1-3, we see an improvement in the single-threaded
performance on ebizzy.

2 ebizzy threads bound to the same big-core. 25% improvement in the
avg records/s (higher the better) with patches 1-3.
x without_patches
* with_patches
N   Min   MaxMedian   AvgStddev
x  10   2491089   5834307   5398375   4244335 1596244.9
*  10   2893813   5834474   5832448 5327281.3 1055941.4

We do not observe any major regression in either the context_switch2
benchmark or the schbench benchmark

context_switch2 across CPU0 CPU1 (Both belong to same big-core, but different
small cores). We observe a minor 0.14% regression in the number of
context-switches (higher is better).
x without_patch
* with_patch
N   Min   MaxMedian   AvgStddev
x 500348872362236354712 354745.69  2711.827
* 500349422361452353942  354215.4 2576.9258

context_switch2 across CPU0 CPU8 (Different big-cores). We observe a 0.37%
improvement in the number of context-switches (higher is better).
x without_patch
* with_patch
N   Min   MaxMedian   AvgStddev
x 500287956294940288896 288977.23 646.59295
* 500288300294646289582 290064.76 1161.9992

schbench:
No major difference could be seen until the 99.9th percentile.

Without-patch
Latency percentiles (usec)
50.0th: 29
75.0th: 39
90.0th: 49
95.0th: 59
*99.0th: 13104
99.5th: 14672
99.9th: 15824
min=0, max=17993

With-patch:
Latency percentiles (usec)
50.0th: 29
75.0th: 40
90.0th: 50
95.0th: 61
*99.0th: 13648
99.5th: 14768
99.9th: 15664
min=0, max=29812



Gautham R. Shenoy (5):
  cpuidle-pseries: Set the latency-hint before entering CEDE
  cpuidle-pseries: Add function to parse extended CEDE records
  cpuidle-pseries : Fixup exit latency for CEDE(0)
  cpuidle-pseries : Include extended CEDE states in cpuidle framework
  cpuidle-pseries: Block Extended CEDE(1) which adds no additional
value.

 drivers/cpuidle/cpuidle-pseries.c | 268 +-
 1 file changed, 266 insertions(+), 2 deletions(-)

-- 
1.9.4



[PATCH 3/5] cpuidle-pseries : Fixup exit latency for CEDE(0)

2020-07-07 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" 

We are currently assuming that CEDE(0) has exit latency 10us, since
there is no way for us to query from the platform.  However, if the
wakeup latency of an Extended CEDE state is smaller than 10us, then we
can be sure that the exit latency of CEDE(0) cannot be more than that.
that.

In this patch, we fix the exit latency of CEDE(0) if we discover an
Extended CEDE state with wakeup latency smaller than 10us. The new
value is 1us lesser than the smallest wakeup latency among the
Extended CEDE states.

Benchmark results:

ebizzy:
2 ebizzy threads bound to the same big-core. 25% improvement in the
avg records/s with patch.
x without_patch
* with_patch
N   Min   MaxMedian   AvgStddev
x  10   2491089   5834307   5398375   4244335 1596244.9
*  10   2893813   5834474   5832448 5327281.3 1055941.4

context_switch2 :
There is no major regression observed with this patch as seen from the
context_switch2 benchmark.

context_switch2 across CPU0 CPU1 (Both belong to same big-core, but different
small cores). We observe a minor 0.14% regression in the number of
context-switches (higher is better).
x without_patch
* with_patch
N   Min   MaxMedian   AvgStddev
x 500348872362236354712 354745.69  2711.827
* 500349422361452353942  354215.4 2576.9258

context_switch2 across CPU0 CPU8 (Different big-cores). We observe a 0.37%
improvement in the number of context-switches (higher is better).
x without_patch
* with_patch
N   Min   MaxMedian   AvgStddev
x 500287956294940288896 288977.23 646.59295
* 500288300294646289582 290064.76 1161.9992

schbench:
No major difference could be seen until the 99.9th percentile.

Without-patch
Latency percentiles (usec)
50.0th: 29
75.0th: 39
90.0th: 49
95.0th: 59
*99.0th: 13104
99.5th: 14672
99.9th: 15824
min=0, max=17993

With-patch:
Latency percentiles (usec)
50.0th: 29
75.0th: 40
90.0th: 50
95.0th: 61
*99.0th: 13648
99.5th: 14768
99.9th: 15664
min=0, max=29812

Signed-off-by: Gautham R. Shenoy 
---
 drivers/cpuidle/cpuidle-pseries.c | 34 --
 1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-pseries.c 
b/drivers/cpuidle/cpuidle-pseries.c
index c13549b..502f906 100644
--- a/drivers/cpuidle/cpuidle-pseries.c
+++ b/drivers/cpuidle/cpuidle-pseries.c
@@ -353,12 +353,42 @@ static int pseries_cpuidle_driver_init(void)
 static int add_pseries_idle_states(void)
 {
int nr_states = 2; /* By default we have snooze, CEDE */
+   int i;
+   u64 min_latency_us = dedicated_states[1].exit_latency; /* CEDE latency 
*/
 
if (parse_cede_parameters())
return nr_states;
 
-   pr_info("cpuidle : Skipping the %d Extended CEDE idle states\n",
-   nr_xcede_records);
+   for (i = 0; i < nr_xcede_records; i++) {
+   u64 latency_tb = xcede_records[i].wakeup_latency_tb_ticks;
+   u64 latency_us = tb_to_ns(latency_tb) / NSEC_PER_USEC;
+
+   if (latency_us < min_latency_us)
+   min_latency_us = latency_us;
+   }
+
+   /*
+* We are currently assuming that CEDE(0) has exit latency
+* 10us, since there is no way for us to query from the
+* platform.
+*
+* However, if the wakeup latency of an Extended CEDE state is
+* smaller than 10us, then we can be sure that CEDE(0)
+* requires no more than that.
+*
+* Perform the fix-up.
+*/
+   if (min_latency_us < dedicated_states[1].exit_latency) {
+   u64 cede0_latency = min_latency_us - 1;
+
+   if (cede0_latency <= 0)
+   cede0_latency = min_latency_us;
+
+   dedicated_states[1].exit_latency = cede0_latency;
+   dedicated_states[1].target_residency = 10 * (cede0_latency);
+   pr_info("cpuidle : Fixed up CEDE exit latency to %llu us\n",
+   cede0_latency);
+   }
 
return nr_states;
 }
-- 
1.9.4



[PATCH 2/5] cpuidle-pseries: Add function to parse extended CEDE records

2020-07-07 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" 

Currently we use CEDE with latency-hint 0 as the only other idle state
on a dedicated LPAR apart from the polling "snooze" state.

The platform might support additional extended CEDE idle states, which
can be discovered through the "ibm,get-system-parameter" rtas-call
made with CEDE_LATENCY_TOKEN.

This patch adds a function to obtain information about the extended
CEDE idle states from the platform and parse the contents to populate
an array of extended CEDE states. These idle states thus discovered
will be added to the cpuidle framework in the next patch.

dmesg on a POWER9 LPAR, demonstrating the output of parsing the
extended CEDE latency parameters.

[5.913180] xcede : xcede_record_size = 10
[5.913183] xcede : Record 0 : hint = 1, latency =0x400 tb-ticks, 
Wake-on-irq = 1
[5.913188] xcede : Record 1 : hint = 2, latency =0x3e8000 tb-ticks, 
Wake-on-irq = 0
[5.913193] cpuidle : Skipping the 2 Extended CEDE idle states

Signed-off-by: Gautham R. Shenoy 
---
 drivers/cpuidle/cpuidle-pseries.c | 129 +-
 1 file changed, 127 insertions(+), 2 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-pseries.c 
b/drivers/cpuidle/cpuidle-pseries.c
index 39d4bb6..c13549b 100644
--- a/drivers/cpuidle/cpuidle-pseries.c
+++ b/drivers/cpuidle/cpuidle-pseries.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 struct cpuidle_driver pseries_idle_driver = {
.name = "pseries_idle",
@@ -105,9 +106,120 @@ static void check_and_cede_processor(void)
}
 }
 
-#define NR_CEDE_STATES 1  /* CEDE with latency-hint 0 */
+struct xcede_latency_records {
+   u8  latency_hint;
+   u64 wakeup_latency_tb_ticks;
+   u8  responsive_to_irqs;
+};
+
+/*
+ * XCEDE : Extended CEDE states discovered through the
+ * "ibm,get-systems-parameter" rtas-call with the token
+ * CEDE_LATENCY_TOKEN
+ */
+#define MAX_XCEDE_STATES   4
+#defineXCEDE_LATENCY_RECORD_SIZE   10
+#define XCEDE_LATENCY_PARAM_MAX_LENGTH (2 + 2 + \
+   (MAX_XCEDE_STATES * 
XCEDE_LATENCY_RECORD_SIZE))
+
+#define CEDE_LATENCY_TOKEN 45
+
+#define NR_CEDE_STATES (MAX_XCEDE_STATES + 1) /* CEDE with 
latency-hint 0 */
 #define NR_DEDICATED_STATES(NR_CEDE_STATES + 1) /* Includes snooze */
 
+struct xcede_latency_records xcede_records[MAX_XCEDE_STATES];
+unsigned int nr_xcede_records;
+char xcede_parameters[XCEDE_LATENCY_PARAM_MAX_LENGTH];
+
+static int parse_cede_parameters(void)
+{
+   int ret = -1, i;
+   u16 payload_length;
+   u8 xcede_record_size;
+   u32 total_xcede_records_size;
+   char *payload;
+
+   memset(xcede_parameters, 0, XCEDE_LATENCY_PARAM_MAX_LENGTH);
+
+   ret = rtas_call(rtas_token("ibm,get-system-parameter"), 3, 1,
+   NULL, CEDE_LATENCY_TOKEN, __pa(xcede_parameters),
+   XCEDE_LATENCY_PARAM_MAX_LENGTH);
+
+   if (ret) {
+   pr_err("xcede: Error parsing CEDE_LATENCY_TOKEN\n");
+   return ret;
+   }
+
+   payload_length = be16_to_cpu(*(__be16 *)(&xcede_parameters[0]));
+   payload = &xcede_parameters[2];
+
+   /*
+* If the platform supports the cede latency settings
+* information system parameter it must provide the following
+* information in the NULL terminated parameter string:
+*
+* a. The first byte is the length “N” of each cede
+*latency setting record minus one (zero indicates a length
+*of 1 byte).
+*
+* b. For each supported cede latency setting a cede latency
+*setting record consisting of the first “N” bytes as per
+*the following table.
+*
+*  -
+*  | Field   | Field  |
+*  | Name| Length |
+*  -
+*  | Cede Latency| 1 Byte |
+*  | Specifier Value ||
+*  -
+*  | Maximum wakeup  ||
+*  | latency in  | 8 Bytes|
+*  | tb-ticks||
+*  -
+*  | Responsive to   ||
+*  | external| 1 Byte |
+*  | interrupts  ||
+*  -
+*
+* This version has cede latency record size = 10.
+*/
+   xcede_record_size = (u8)payload[0] + 1;
+
+   if (xcede_record_size != XCEDE_LATENCY_RECORD_SIZE) {
+   pr_err("xcede : Expected record-size %d. Observed size %d.\n",
+  XCEDE_LATENCY_RECORD_SIZE, xcede_record_size);
+   return -EINVAL;
+   }
+
+   pr_info("xcede : xcede_record_size = %d\n", xcede_record_size);
+
+   /*
+* Since the payload_leng

[PATCH 5/5] cpuidle-pseries: Block Extended CEDE(1) which adds no additional value.

2020-07-07 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" 

The Extended CEDE state with latency-hint = 1 is only different from
normal CEDE (with latency-hint = 0) in that a CPU in Extended CEDE(1)
does not wakeup on timer events. Both CEDE and Extended CEDE(1) map to
the same hardware idle state. Since we already get SMT folding from
the normal CEDE, the Extended CEDE(1) doesn't provide any additional
value. This patch blocks Extended CEDE(1).

Signed-off-by: Gautham R. Shenoy 
---
 drivers/cpuidle/cpuidle-pseries.c | 57 ---
 1 file changed, 54 insertions(+), 3 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-pseries.c 
b/drivers/cpuidle/cpuidle-pseries.c
index 6f893cd..be0b8b2 100644
--- a/drivers/cpuidle/cpuidle-pseries.c
+++ b/drivers/cpuidle/cpuidle-pseries.c
@@ -350,6 +350,43 @@ static int pseries_cpuidle_driver_init(void)
return 0;
 }
 
+#define XCEDE1_HINT1
+#define ERR_NO_VALUE_ADD   (-1)
+#define ERR_NO_EE_WAKEUP   (-2)
+
+/*
+ * Returns 0 if the Extende CEDE state with @hint is not blocked in
+ * cpuidle framework.
+ *
+ * Returns ERR_NO_EE_WAKEUP if the Extended CEDE state is blocked due
+ * to not being responsive to external interrupts.
+ *
+ * Returns ERR_NO_VALUE_ADD if the Extended CEDE state does not provide
+ * added value addition over the normal CEDE.
+ */
+static int cpuidle_xcede_blocked(u8 hint, u64 latency_us, u8 
responsive_to_irqs)
+{
+
+   /*
+* We will only allow extended CEDE states that are responsive
+* to irqs do not require an H_PROD to be woken up.
+*/
+   if (!responsive_to_irqs)
+   return ERR_NO_EE_WAKEUP;
+
+   /*
+* We already obtain SMT folding benefits from CEDE (which is
+* CEDE with hint 0). Furthermore, CEDE is also responsive to
+* timer-events, while XCEDE1 requires an external
+* interrupt/H_PROD to be woken up. Hence, block XCEDE1 since
+* it adds no further value.
+*/
+   if (hint == XCEDE1_HINT)
+   return ERR_NO_VALUE_ADD;
+
+   return 0;
+}
+
 static int add_pseries_idle_states(void)
 {
int nr_states = 2; /* By default we have snooze, CEDE */
@@ -365,15 +402,29 @@ static int add_pseries_idle_states(void)
char name[CPUIDLE_NAME_LEN];
unsigned int latency_hint = xcede_records[i].latency_hint;
u64 residency_us;
+   int rc;
+
+   if (latency_us < min_latency_us)
+   min_latency_us = latency_us;
+
+   rc = cpuidle_xcede_blocked(latency_hint, latency_us,
+  xcede_records[i].responsive_to_irqs);
 
-   if (!xcede_records[i].responsive_to_irqs) {
+   if (rc) {
+   switch (rc) {
+   case ERR_NO_VALUE_ADD:
+   pr_info("cpuidle : Skipping XCEDE%d. No 
additional value-add\n",
+   latency_hint);
+   break;
+   case ERR_NO_EE_WAKEUP:
pr_info("cpuidle : Skipping XCEDE%d. Not responsive to 
IRQs\n",
latency_hint);
+   break;
+   }
+
continue;
}
 
-   if (latency_us < min_latency_us)
-   min_latency_us = latency_us;
snprintf(name, CPUIDLE_NAME_LEN, "XCEDE%d", latency_hint);
 
/*
-- 
1.9.4



Re: [PATCH v5 23/26] powerpc/book3s64/kuap: Move UAMOR setup to key init function

2020-07-07 Thread Aneesh Kumar K.V
Michael Ellerman  writes:

> "Aneesh Kumar K.V"  writes:
>  
.

>> @@ -232,8 +246,9 @@ void __init setup_kuap(bool disabled)
>>  cur_cpu_spec->mmu_features |= MMU_FTR_KUAP;
>>  }
>>  
>> -/* Make sure userspace can't change the AMR */
>> -mtspr(SPRN_UAMOR, 0);
>
> Why not just leave it there. It's extra insurance and it's good
> documentation.

We can't se the value to 0, because with hash kuap it is derived
from what other keys are used for. Are you suggesting to keep it as

if (radix_enabled())
mtspr(SPRN_UAMOR, 0);

That would confuse w.r.t what happens with hash.

I can add a comment there explaining details? 

>
>> +/*
>> + * Set the default kernel AMR values on all cpus.
>> + */
>>  mtspr(SPRN_AMR, AMR_KUAP_BLOCKED);
>>  isync();
>>  }
>> @@ -278,11 +293,6 @@ static inline u64 read_uamor(void)
>>  return mfspr(SPRN_UAMOR);
>>  }
>>  
>> -static inline void write_uamor(u64 value)
>> -{
>> -mtspr(SPRN_UAMOR, value);
>> -}
>> -
>>  static bool is_pkey_enabled(int pkey)
>>  {
>>  u64 uamor = read_uamor();
>> @@ -353,7 +363,6 @@ void thread_pkey_regs_save(struct thread_struct *thread)
>>   */
>>  thread->amr = read_amr();
>>  thread->iamr = read_iamr();
>> -thread->uamor = read_uamor();
>>  }
>>  
>>  void thread_pkey_regs_restore(struct thread_struct *new_thread,
>> @@ -366,8 +375,6 @@ void thread_pkey_regs_restore(struct thread_struct 
>> *new_thread,
>>  write_amr(new_thread->amr);
>>  if (old_thread->iamr != new_thread->iamr)
>>  write_iamr(new_thread->iamr);
>> -if (old_thread->uamor != new_thread->uamor)
>> -write_uamor(new_thread->uamor);
>>  }
>>  
>>  void thread_pkey_regs_init(struct thread_struct *thread)
>> @@ -377,11 +384,9 @@ void thread_pkey_regs_init(struct thread_struct *thread)
>>  
>>  thread->amr   = default_amr;
>>  thread->iamr  = default_iamr;
>> -thread->uamor = default_uamor;
>>  
>>  write_amr(default_amr);
>>  write_iamr(default_iamr);
>> -write_uamor(default_uamor);
>>  }
>>  
>>  int execute_only_pkey(struct mm_struct *mm)
>
> cheers

-aneesh


Re: [PATCH] powerpc: select ARCH_HAS_MEMBARRIER_SYNC_CORE

2020-07-07 Thread Mathieu Desnoyers
- On Jul 7, 2020, at 1:50 AM, Nicholas Piggin npig...@gmail.com wrote:

> Excerpts from Christophe Leroy's message of July 6, 2020 7:53 pm:
>> 
>> 
>> Le 06/07/2020 à 04:18, Nicholas Piggin a écrit :
>>> diff --git a/arch/powerpc/include/asm/exception-64s.h
>>> b/arch/powerpc/include/asm/exception-64s.h
>>> index 47bd4ea0837d..b88cb3a989b6 100644
>>> --- a/arch/powerpc/include/asm/exception-64s.h
>>> +++ b/arch/powerpc/include/asm/exception-64s.h
>>> @@ -68,6 +68,10 @@
>>>*
>>>* The nop instructions allow us to insert one or more instructions to 
>>> flush the
>>>* L1-D cache when returning to userspace or a guest.
>>> + *
>>> + * powerpc relies on return from interrupt/syscall being context 
>>> synchronising
>>> + * (which hrfid, rfid, and rfscv are) to support 
>>> ARCH_HAS_MEMBARRIER_SYNC_CORE
>>> + * without additional additional synchronisation instructions.
>> 
>> This file is dedicated to BOOK3S/64. What about other ones ?
>> 
>> On 32 bits, this is also valid as 'rfi' is also context synchronising,
>> but then why just add some comment in exception-64s.h and only there ?
> 
> Yeah you're right, I basically wanted to keep a note there just in case,
> because it's possible we would get a less synchronising return (maybe
> unlikely with meltdown) or even return from a kernel interrupt using a
> something faster (e.g., bctar if we don't use tar register in the kernel
> anywhere).
> 
> So I wonder where to add the note, entry_32.S and 64e.h as well?
> 

For 64-bit powerpc, I would be tempted to either place the comment in the header
implementing the RFI_TO_USER and RFI_TO_USER_OR_KERNEL macros or the .S files
using them, e.g. either:

arch/powerpc/include/asm/exception-64e.h
arch/powerpc/include/asm/exception-64s.h

or

arch/powerpc/kernel/exceptions-64s.S
arch/powerpc/kernel/entry_64.S

And for 32-bit powerpc, AFAIU

arch/powerpc/kernel/entry_32.S

uses SYNC + RFI to return to user-space. RFI is defined in

arch/powerpc/include/asm/ppc_asm.h

So a comment either near the RFI define and its uses should work.

> I should actually change the comment for 64-bit because soft masked
> interrupt replay is an interesting case. I thought it was okay (because
> the IPI would cause a hard interrupt which does do the rfi) but that
> should at least be written.

Yes.

> The context synchronisation happens before
> the Linux IPI function is called, but for the purpose of membarrier I
> think that is okay (the membarrier just needs to have caused a memory
> barrier + context synchronistaion by the time it has done).

Can you point me to the code implementing this logic ?

Thanks,

Mathieu

> 
> Thanks,
> Nick

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com


Re: [PATCH 0/5] cpuidle-pseries: Parse extended CEDE information for idle.

2020-07-07 Thread Gautham R Shenoy
Hi,

On Tue, Jul 07, 2020 at 04:41:34PM +0530, Gautham R. Shenoy wrote:
> From: "Gautham R. Shenoy" 
> 
> Hi,
> 
> 
> 
> 
> Gautham R. Shenoy (5):
>   cpuidle-pseries: Set the latency-hint before entering CEDE
>   cpuidle-pseries: Add function to parse extended CEDE records
>   cpuidle-pseries : Fixup exit latency for CEDE(0)
>   cpuidle-pseries : Include extended CEDE states in cpuidle framework
>   cpuidle-pseries: Block Extended CEDE(1) which adds no additional
> value.

Forgot to mention that these patches are on top of Nathan's series to
remove extended CEDE offline and bogus topology update code :
https://lore.kernel.org/linuxppc-dev/20200612051238.1007764-1-nath...@linux.ibm.com/

> 
>  drivers/cpuidle/cpuidle-pseries.c | 268 
> +-
>  1 file changed, 266 insertions(+), 2 deletions(-)
> 
> -- 
> 1.9.4
> 


[PATCH] ASoC: fsl: mpc8610_hpcd: Add missing of_node_put()

2020-07-07 Thread Yi Wang
From: Liao Pingfang 

After finishing using device node got from of_find_compatible_node(),
of_node_put() needs to be called.

Signed-off-by: Liao Pingfang 
---
 sound/soc/fsl/mpc8610_hpcd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_hpcd.c
index f7bd900..b3090fe 100644
--- a/sound/soc/fsl/mpc8610_hpcd.c
+++ b/sound/soc/fsl/mpc8610_hpcd.c
@@ -426,9 +426,11 @@ static int __init mpc8610_hpcd_init(void)
guts_np = of_find_compatible_node(NULL, NULL, "fsl,mpc8610-guts");
if (of_address_to_resource(guts_np, 0, &res)) {
pr_err("mpc8610-hpcd: missing/invalid global utilities node\n");
+   of_node_put(guts_np);
return -EINVAL;
}
guts_phys = res.start;
+   of_node_put(guts_np);
 
return platform_driver_register(&mpc8610_hpcd_driver);
 }
-- 
2.9.5



Re: [PATCH] powerpc: select ARCH_HAS_MEMBARRIER_SYNC_CORE

2020-07-07 Thread Christophe Leroy




Le 07/07/2020 à 13:25, Mathieu Desnoyers a écrit :

- On Jul 7, 2020, at 1:50 AM, Nicholas Piggin npig...@gmail.com wrote:


Excerpts from Christophe Leroy's message of July 6, 2020 7:53 pm:



Le 06/07/2020 à 04:18, Nicholas Piggin a écrit :

diff --git a/arch/powerpc/include/asm/exception-64s.h
b/arch/powerpc/include/asm/exception-64s.h
index 47bd4ea0837d..b88cb3a989b6 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -68,6 +68,10 @@
*
* The nop instructions allow us to insert one or more instructions to flush 
the
* L1-D cache when returning to userspace or a guest.
+ *
+ * powerpc relies on return from interrupt/syscall being context synchronising
+ * (which hrfid, rfid, and rfscv are) to support ARCH_HAS_MEMBARRIER_SYNC_CORE
+ * without additional additional synchronisation instructions.


This file is dedicated to BOOK3S/64. What about other ones ?

On 32 bits, this is also valid as 'rfi' is also context synchronising,
but then why just add some comment in exception-64s.h and only there ?


Yeah you're right, I basically wanted to keep a note there just in case,
because it's possible we would get a less synchronising return (maybe
unlikely with meltdown) or even return from a kernel interrupt using a
something faster (e.g., bctar if we don't use tar register in the kernel
anywhere).

So I wonder where to add the note, entry_32.S and 64e.h as well?



For 64-bit powerpc, I would be tempted to either place the comment in the header
implementing the RFI_TO_USER and RFI_TO_USER_OR_KERNEL macros or the .S files
using them, e.g. either:

arch/powerpc/include/asm/exception-64e.h
arch/powerpc/include/asm/exception-64s.h

or

arch/powerpc/kernel/exceptions-64s.S
arch/powerpc/kernel/entry_64.S

And for 32-bit powerpc, AFAIU

arch/powerpc/kernel/entry_32.S

uses SYNC + RFI to return to user-space. RFI is defined in

arch/powerpc/include/asm/ppc_asm.h

So a comment either near the RFI define and its uses should work.




For 32-bit, RFI is likely to go away the day 40x goes away, so I 
wouldn't put it there.

Places like head_8xx.S use rfi not RFI.

And the SYNC is about to go when we decide to retire 601 SYNC FIX.

So it would be probably better to put it somewhere in entry_32.S

Christophe


[Bug 208197] OF: /pci@f2000000/mac-io@17/gpio@50/...: could not find phandle

2020-07-07 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=208197

--- Comment #4 from Erhard F. (erhar...@mailbox.org) ---
Created attachment 290157
  --> https://bugzilla.kernel.org/attachment.cgi?id=290157&action=edit
dmesg (5.8-rc4 + WARN_ON patch, PowerMac G4 DP)

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

[Bug 208197] OF: /pci@f2000000/mac-io@17/gpio@50/...: could not find phandle

2020-07-07 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=208197

--- Comment #5 from Erhard F. (erhar...@mailbox.org) ---
(In reply to Michael Ellerman from comment #3)
> Try this?
See new dmesg.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

[Bug 208197] OF: /pci@f2000000/mac-io@17/gpio@50/...: could not find phandle

2020-07-07 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=208197

--- Comment #6 from Erhard F. (erhar...@mailbox.org) ---
Also I took some time to revert individual commits from the bisect.log:

388bcc6ecc609fca1b4920de7dc3806c98ec535e drivers: base: Fix NULL pointer
exception in __platform_driver_probe() if a driver developer is foolish
48ebea5026d692c5ab0a7d303f0fe1f8ba046e0f firmware_loader: move
fw_fallback_config to a private kernel symbol namespace
c78c31b374a68be79cb4a03ef5b6c187f034e903 Revert "Revert "driver core: Set
fw_devlink to "permissive" behavior by default""
c8be6af9ef16cf44d690fc227a0d2dd7a526ef05 Merge v5.7-rc5 into driver-core-next
eb7fbc9fb1185a7f89adeb2de724c2c96ff608e9 driver core: Add missing '\n' in log
messages
42926ac3cd50937346c23c0005817264af4357a7 driver core: Move code to the right
part of the file
baf1d9c182935e88aab08701b0a0b22871117fe0 driver/base/soc: Use kobj_to_dev() API
5f5377eaddfc24e5d7562e588d0ff84f9264d7c1 driver core: Look for waiting
consumers only for a fwnode's primary device
96fa72ffb2155dba9ba8c5d282a1ff19ed32f177 Merge 5.7-rc3 into driver-core-next
716a7a25969003d82ab738179c3f1068a120ed11 driver core: fw_devlink: Add support
for batching fwnode parsing
fbc35b45f9f6a971341b9462c6e94c257e779fb5 Add documentation on meaning of
-EPROBE_DEFER
45bb08de65b418959313593f527c619e102c2d57 driver core: platform: remove
redundant assignment to variable ret
93d2e4322aa74c1ad1e8c2160608eb9a960d69ff of: platform: Batch fwnode parsing
when adding all top level devices
69b07ee33eb12a505d55e3e716fc7452496b9041 debugfs: Use the correct style for
SPDX License Identifier
fefcfc968723caf93318613a08e1f3ad07a6154f driver core: Remove check in
driver_deferred_probe_force_trigger()
0f605db5bdd42edfbfcac36acaf8f72cfe9ce774 kernfs: Change kernfs_node lockdep
name to "kn->active"
c82c83c330654c5639960ebc3dabbae53c43f79e driver core: platform: Fix spelling
errors in platform.c
114dbb4fa7c4053a51964d112e2851e818e085c6 drivers property: When no children in
primary, try secondary
55623260bb33e2ab849af76edf2253bc04cb241f test_firmware: remove unnecessary
test_fw_mutex in test_dev_config_show_xxx
2cd38fd15e4ebcfe917a443734820269f8b5ba2b driver core: Remove unnecessary
is_fwnode_dev variable in device_add()
ab7c1e163b525316a870a494dd4ea196e7a6c455 firmware: Drop unused pages field from
struct firmware
f7d8f3f092d001f8d91552d2697643e727694942 Merge 5.7-rc7 into driver-core-next


Reverting Merge 5.7-rc7 into driver-core-next via:
git revert f7d8f3f092d001f8d91552d2697643e727694942 -m2

while leaving the other commits still in made the "could not find phandle"
disappear. I guess the relevant commit is somewhere in this merge.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

[PATCH 2/2] powerpc/signal_32: Simplify loop in PPC64 save_general_regs()

2020-07-07 Thread Christophe Leroy
save_general_regs() which does special handling when i == PT_SOFTE.

Rewrite it to minimise the specific part, especially the __put_user()
and associated error handling is the same so make it common.

Signed-off-by: Christophe Leroy 
---
 arch/powerpc/kernel/signal_32.c | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index 0fd59fbc6d49..aae31fa5e411 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -103,19 +103,14 @@ static inline int save_general_regs(struct pt_regs *regs,
 {
elf_greg_t64 *gregs = (elf_greg_t64 *)regs;
int i;
-   /* Force usr to alway see softe as 1 (interrupts enabled) */
-   elf_greg_t64 softe = 0x1;
 
WARN_ON(!FULL_REGS(regs));
 
for (i = 0; i <= PT_RESULT; i ++) {
-   if ( i == PT_SOFTE) {
-   if(__put_user((unsigned int)softe, &frame->mc_gregs[i]))
-   return -EFAULT;
-   else
-   continue;
-   }
-   if (__put_user((unsigned int)gregs[i], &frame->mc_gregs[i]))
+   /* Force usr to alway see softe as 1 (interrupts enabled) */
+   int val = (i == PT_SOFTE) ? 1 : gregs[i];
+
+   if (__put_user(val, &frame->mc_gregs[i]))
return -EFAULT;
}
return 0;
-- 
2.25.0



[PATCH 1/2] powerpc/signal_32: Remove !FULL_REGS() special handling in PPC64 save_general_regs()

2020-07-07 Thread Christophe Leroy
Since commit ("1bd79336a426 powerpc: Fix various
syscall/signal/swapcontext bugs"), getting save_general_regs() called
without FULL_REGS() is very unlikely and generates a warning.

The 32-bit version of save_general_regs() doesn't take care of it
at all and copies all registers anyway since that commit.

Moreover, commit 965dd3ad3076 ("powerpc/64/syscall: Remove
non-volatile GPR save optimisation") is another reason why it would
never happen.

So the same with 64-bit, don't worry about FULL_REGS() and copy
all registers all the time.

Signed-off-by: Christophe Leroy 
---
 arch/powerpc/kernel/signal_32.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index 1415c16ab628..0fd59fbc6d49 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -109,8 +109,6 @@ static inline int save_general_regs(struct pt_regs *regs,
WARN_ON(!FULL_REGS(regs));
 
for (i = 0; i <= PT_RESULT; i ++) {
-   if (i == 14 && !FULL_REGS(regs))
-   i = 32;
if ( i == PT_SOFTE) {
if(__put_user((unsigned int)softe, &frame->mc_gregs[i]))
return -EFAULT;
-- 
2.25.0



Re: [PATCH v2] powerpc/uaccess: Use flexible addressing with __put_user()/__get_user()

2020-07-07 Thread Christophe Leroy




Le 30/06/2020 à 03:19, Michael Ellerman a écrit :

Michael Ellerman  writes:

Christophe Leroy  writes:

Hi Michael,

I see this patch is marked as "defered" in patchwork, but I can't see
any related discussion. Is it normal ?


Because it uses the "m<>" constraint which didn't work on GCC 4.6.

https://github.com/linuxppc/issues/issues/297

So we should be able to pick it up for v5.9 hopefully.


It seems to break the build with the kernel.org 4.9.4 compiler and
corenet64_smp_defconfig:


Most likely a GCC bug ?

It seems the problem vanishes with patch 
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/173de3b659fa3a5f126a0eb170522cccd909950f.1594125164.git.christophe.le...@csgroup.eu/ 



Christophe


kernel since 5.6 do not boot anymore on Apple PowerBook

2020-07-07 Thread Giuseppe Sacco
Hello,
I am testing linux on a quite old hardware, an Apple PowerBook G4
"Titanium IV". I used to run Debian on this machine, so I upgraded the
old operating system to the latest software and found that new kernels
do not boot.
I rebuilt natively (on the powerbook) a few kernels and found that
5.4.50 still works fine, while 5.6.19 and 5.7.7 stop after printing:

pmac32_cpufreq: registering PowerMac CPU frequency driver
pmac32_cpufreq: Low: 667 MHz, High: 867 Mhz, Boot: 667 MHz

no more output is printed. I waited 5 minutes and then powered off the
machine using the power button. Rebooting with old kernel works.

So, I am looking for help. How may I better investigate the problem?
How may I crossbuild the kernel on a faster machine (amd64) in order to
try git-bisect without waiting ages?

Thank you,
Giuseppe



Re: kernel since 5.6 do not boot anymore on Apple PowerBook

2020-07-07 Thread Christophe Leroy

Hi,

Le 07/07/2020 à 14:58, Giuseppe Sacco a écrit :

Hello,
I am testing linux on a quite old hardware, an Apple PowerBook G4
"Titanium IV". I used to run Debian on this machine, so I upgraded the
old operating system to the latest software and found that new kernels
do not boot.
I rebuilt natively (on the powerbook) a few kernels and found that
5.4.50 still works fine, while 5.6.19 and 5.7.7 stop after printing:

pmac32_cpufreq: registering PowerMac CPU frequency driver
pmac32_cpufreq: Low: 667 MHz, High: 867 Mhz, Boot: 667 MHz

no more output is printed. I waited 5 minutes and then powered off the
machine using the power button. Rebooting with old kernel works.

So, I am looking for help. How may I better investigate the problem?
How may I crossbuild the kernel on a faster machine (amd64) in order to
try git-bisect without waiting ages?



To crossbuild, use cross tools at 
https://mirrors.edge.kernel.org/pub/tools/crosstool/


Can you tell which defconfig you use or provide your .config

Christophe


Re: kernel since 5.6 do not boot anymore on Apple PowerBook

2020-07-07 Thread Giuseppe Sacco
Hello Cristophe,

Il giorno mar, 07/07/2020 alle 15.35 +0200, Christophe Leroy ha
scritto:
> Hi,
> Le 07/07/2020 à 14:58, Giuseppe Sacco a écrit :
[...]
> > So, I am looking for help. How may I better investigate the
> > problem?
> > How may I crossbuild the kernel on a faster machine (amd64) in
> > order to
> > try git-bisect without waiting ages?
> 
> To crossbuild, use cross tools at 
> https://mirrors.edge.kernel.org/pub/tools/crosstool/

thank you, I'll have a look at it.

> Can you tell which defconfig you use or provide your .config

You may get the standard one from debian or a reduced one that I made
on purpose. The latter is here:
https://eppesuigoccas.homedns.org/~giuseppe/config-5.4.50.gz (boot)
https://eppesuigoccas.homedns.org/~giuseppe/config-5.6.19.gz (no boot)

Bye,
Giuseppe



[PATCH v2] powerpc/numa: Restrict possible nodes based on platform

2020-07-07 Thread Srikar Dronamraju
As per PAPR, there are 2 device tree property
ibm,max-associativity-domains (which defines the maximum number of
domains that the firmware i.e PowerVM can support) and
ibm,current-associativity-domains (which defines the maximum number of
domains that the platform can support). Value of
ibm,max-associativity-domains property is always greater than or equal
to ibm,current-associativity-domains property.

Powerpc currently uses ibm,max-associativity-domains  property while
setting the possible number of nodes. This is currently set at 32.
However the possible number of nodes for a platform may be significantly
less. Hence set the possible number of nodes based on
ibm,current-associativity-domains property.

$ lsprop /proc/device-tree/rtas/ibm,*associ*-domains
/proc/device-tree/rtas/ibm,current-associativity-domains
 0005 0001 0002 0002 0002 0010
/proc/device-tree/rtas/ibm,max-associativity-domains
 0005 0001 0008 0020 0020 0100

$ cat /sys/devices/system/node/possible ##Before patch
0-31

$ cat /sys/devices/system/node/possible ##After patch
0-1

Note the maximum nodes this platform can support is only 2 but the
possible nodes is set to 32.

This is important because lot of kernel and user space code allocate
structures for all possible nodes leading to a lot of memory that is
allocated but not used.

I ran a simple experiment to create and destroy 100 memory cgroups on
boot on a 8 node machine (Power8 Alpine).

Before patch
free -k at boot
  totalusedfree  shared  buff/cache   available
Mem:  523498176 4106816   518820608   22272  570752   516606720
Swap:   4194240   0 4194240

free -k after creating 100 memory cgroups
  totalusedfree  shared  buff/cache   available
Mem:  523498176 4628416   518246464   22336  623296   516058688
Swap:   4194240   0 4194240

free -k after destroying 100 memory cgroups
  totalusedfree  shared  buff/cache   available
Mem:  523498176 4697408   518173760   22400  627008   515987904
Swap:   4194240   0 4194240

After patch
free -k at boot
  totalusedfree  shared  buff/cache   available
Mem:  523498176 3969472   518933888   22272  594816   516731776
Swap:   4194240   0 4194240

free -k after creating 100 memory cgroups
  totalusedfree  shared  buff/cache   available
Mem:  523498176 4181888   518676096   22208  640192   516496448
Swap:   4194240   0 4194240

free -k after destroying 100 memory cgroups
  totalusedfree  shared  buff/cache   available
Mem:  523498176 4232320   518619904   22272  645952   516443264
Swap:   4194240   0 4194240

Observations:
Fixed kernel takes 137344 kb (4106816-3969472) less to boot.
Fixed kernel takes 309184 kb (4628416-4181888-137344) less to create 100 memcgs.

Cc: Nathan Lynch 
Cc: Michael Ellerman 
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Anton Blanchard 
Cc: Bharata B Rao 
Cc: Tyrel Datwyler 
Signed-off-by: Srikar Dronamraju 
---
v1: 
https://lore.kernel.org/linuxppc-dev/20200706064002.14848-1-sri...@linux.vnet.ibm.com/t/#u
Changelog v1->v2:
Fallback to ibm,max-associativity-domains if ibm,current-associativity
is not available. Suggested by Tyrel Datwyler.

 arch/powerpc/mm/numa.c | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 9fcf2d195830..fc7b0505bdd8 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -896,10 +896,19 @@ static void __init find_possible_nodes(void)
if (!rtas)
return;
 
-   if (of_property_read_u32_index(rtas,
-   "ibm,max-associativity-domains",
+   if (of_property_read_u32_index(rtas, 
"ibm,current-associativity-domains",
+   min_common_depth, &numnodes)) {
+   /*
+* ibm,current-associativity-domains is a fairly recent
+* property. If it doesn't exist, then fallback on
+* ibm,max-associativity-domains. Current denotes what the
+* platform can support compared to max which denotes what the
+* Hypervisor can support.
+*/
+   if (of_property_read_u32_index(rtas, 
"ibm,max-associativity-domains",
min_common_depth, &numnodes))
-   goto out;
+   goto out;
+   }
 
for (i = 0; i < numnodes; i++) {
if (!node_possible(i))
-- 
2.18.2



Re: [PATCH] ASoC: fsl: mpc8610_hpcd: Add missing of_node_put()

2020-07-07 Thread Mark Brown
On Tue, 7 Jul 2020 19:47:47 +0800, Yi Wang wrote:
> After finishing using device node got from of_find_compatible_node(),
> of_node_put() needs to be called.

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: fsl: mpc8610_hpcd: Add missing of_node_put()
  commit: a5911ac5790acaf98c929b826b3f7b4a438f9759

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


Re: [PATCH] MAINTAINERS: Add Shengjiu to reviewer list of sound/soc/fsl

2020-07-07 Thread Mark Brown
On Thu, 2 Jul 2020 12:31:02 -0700, Nicolin Chen wrote:
> Add Shengjiu who's actively working on the latest fsl/nxp audio drivers.

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] MAINTAINERS: Add Shengjiu to reviewer list of sound/soc/fsl
  commit: 503ed52225ed3d369c8e0dedf13556a7bc1e5c2b

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


Re: [PATCH v2] MAINTAINERS: Add Shengjiu to reviewer list of sound/soc/fsl

2020-07-07 Thread Mark Brown
On Mon, 6 Jul 2020 21:58:29 -0700, Nicolin Chen wrote:
> Add Shengjiu who's actively working on the latest fsl/nxp audio drivers.

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] MAINTAINERS: Add Shengjiu to reviewer list of sound/soc/fsl
  commit: 503ed52225ed3d369c8e0dedf13556a7bc1e5c2b

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


[PATCH v2 04/28] ASoC: fsl: fsl_asrc: Demote obvious misuse of kerneldoc to standard comment blocks

2020-07-07 Thread Lee Jones
No attempt has been made to document any of the demoted functions here.

Fixes the following W=1 kernel build warning(s):

 sound/soc/fsl/fsl_asrc.c:44: warning: cannot understand function prototype: 
'unsigned char input_clk_map_imx35[ASRC_CLK_MAP_LEN] = '
 sound/soc/fsl/fsl_asrc.c:78: warning: cannot understand function prototype: 
'unsigned char clk_map_imx8qm[2][ASRC_CLK_MAP_LEN] = '
 sound/soc/fsl/fsl_asrc.c:118: warning: Function parameter or member 'inrate' 
not described in 'fsl_asrc_sel_proc'
 sound/soc/fsl/fsl_asrc.c:118: warning: Function parameter or member 'outrate' 
not described in 'fsl_asrc_sel_proc'
 sound/soc/fsl/fsl_asrc.c:118: warning: Function parameter or member 'pre_proc' 
not described in 'fsl_asrc_sel_proc'
 sound/soc/fsl/fsl_asrc.c:118: warning: Function parameter or member 
'post_proc' not described in 'fsl_asrc_sel_proc'
 sound/soc/fsl/fsl_asrc.c:158: warning: Function parameter or member 'channels' 
not described in 'fsl_asrc_request_pair'
 sound/soc/fsl/fsl_asrc.c:158: warning: Function parameter or member 'pair' not 
described in 'fsl_asrc_request_pair'
 sound/soc/fsl/fsl_asrc.c:201: warning: Function parameter or member 'pair' not 
described in 'fsl_asrc_release_pair'
 sound/soc/fsl/fsl_asrc.c:223: warning: Function parameter or member 'pair' not 
described in 'fsl_asrc_set_watermarks'
 sound/soc/fsl/fsl_asrc.c:223: warning: Function parameter or member 'in' not 
described in 'fsl_asrc_set_watermarks'
 sound/soc/fsl/fsl_asrc.c:223: warning: Function parameter or member 'out' not 
described in 'fsl_asrc_set_watermarks'
 sound/soc/fsl/fsl_asrc.c:242: warning: Function parameter or member 'pair' not 
described in 'fsl_asrc_cal_asrck_divisor'
 sound/soc/fsl/fsl_asrc.c:242: warning: Function parameter or member 'div' not 
described in 'fsl_asrc_cal_asrck_divisor'
 sound/soc/fsl/fsl_asrc.c:259: warning: Function parameter or member 'pair' not 
described in 'fsl_asrc_set_ideal_ratio'
 sound/soc/fsl/fsl_asrc.c:259: warning: Function parameter or member 'inrate' 
not described in 'fsl_asrc_set_ideal_ratio'
 sound/soc/fsl/fsl_asrc.c:259: warning: Function parameter or member 'outrate' 
not described in 'fsl_asrc_set_ideal_ratio'
 sound/soc/fsl/fsl_asrc.c:310: warning: Function parameter or member 'pair' not 
described in 'fsl_asrc_config_pair'
 sound/soc/fsl/fsl_asrc.c:310: warning: Function parameter or member 
'use_ideal_rate' not described in 'fsl_asrc_config_pair'
 sound/soc/fsl/fsl_asrc.c:516: warning: Function parameter or member 'pair' not 
described in 'fsl_asrc_start_pair'
 sound/soc/fsl/fsl_asrc.c:545: warning: Function parameter or member 'pair' not 
described in 'fsl_asrc_stop_pair'
 sound/soc/fsl/fsl_asrc.c:559: warning: Function parameter or member 'pair' not 
described in 'fsl_asrc_get_dma_channel'
 sound/soc/fsl/fsl_asrc.c:559: warning: Function parameter or member 'dir' not 
described in 'fsl_asrc_get_dma_channel'
 sound/soc/fsl/fsl_asrc.c:902: warning: Function parameter or member 'asrc' not 
described in 'fsl_asrc_init'
 sound/soc/fsl/fsl_asrc.c:936: warning: Function parameter or member 'irq' not 
described in 'fsl_asrc_isr'
 sound/soc/fsl/fsl_asrc.c:936: warning: Function parameter or member 'dev_id' 
not described in 'fsl_asrc_isr'

Cc: Timur Tabi 
Cc: Nicolin Chen 
Cc: Xiubo Li 
Cc: Fabio Estevam 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Lee Jones 
---
 sound/soc/fsl/fsl_asrc.c | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
index 462ce9f9ab488..209bf80dc3670 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -37,7 +37,7 @@ static struct snd_pcm_hw_constraint_list 
fsl_asrc_rate_constraints = {
.list = supported_asrc_rate,
 };
 
-/**
+/*
  * The following tables map the relationship between asrc_inclk/asrc_outclk in
  * fsl_asrc.h and the registers of ASRCSR
  */
@@ -68,7 +68,7 @@ static unsigned char output_clk_map_imx53[ASRC_CLK_MAP_LEN] = 
{
0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 
0x7, 0x7,
 };
 
-/**
+/*
  * i.MX8QM/i.MX8QXP uses the same map for input and output.
  * clk_map_imx8qm[0] is for i.MX8QM asrc0
  * clk_map_imx8qm[1] is for i.MX8QM asrc1
@@ -101,7 +101,7 @@ static unsigned char clk_map_imx8qxp[2][ASRC_CLK_MAP_LEN] = 
{
},
 };
 
-/**
+/*
  * Select the pre-processing and post-processing options
  * Make sure to exclude following unsupported cases before
  * calling this function:
@@ -147,7 +147,7 @@ static void fsl_asrc_sel_proc(int inrate, int outrate,
*post_proc = 1;
 }
 
-/**
+/*
  * Request ASRC pair
  *
  * It assigns pair by the order of A->C->B because allocation of pair B,
@@ -192,7 +192,7 @@ static int fsl_asrc_request_pair(int channels, struct 
fsl_asrc_pair *pair)
return ret;
 }
 
-/**
+/*
  * Release ASRC pair
  *
  * It clears the resource from asrc and releases the occupied channels.
@@ -216,7 +216,7 @@ static void fsl_asrc_rel

[PATCH v2 03/28] ASoC: fsl: fsl-asoc-card: Use correct format when providing struct documentation

2020-07-07 Thread Lee Jones
Struct kerneldoc headers need to be prefixed with 'struct $NAME', else
the checker gets confused.

Fixes the following W=1 kernel build warning(s):

 sound/soc/fsl/fsl-asoc-card.c:43: warning: cannot understand function 
prototype: 'struct codec_priv '
 sound/soc/fsl/fsl-asoc-card.c:60: warning: cannot understand function 
prototype: 'struct cpu_priv '
 sound/soc/fsl/fsl-asoc-card.c:83: warning: cannot understand function 
prototype: 'struct fsl_asoc_card_priv '
 sound/soc/fsl/fsl-asoc-card.c:104: warning: cannot understand function 
prototype: 'const struct snd_soc_dapm_route audio_map[] = '

Also the size of the struct does not belong in the description:

 sound/soc/fsl/fsl-asoc-card.c:65: warning: Function parameter or member 
'sysclk_freq' not described in 'cpu_priv'
 sound/soc/fsl/fsl-asoc-card.c:65: warning: Function parameter or member 
'sysclk_dir' not described in 'cpu_priv'
 sound/soc/fsl/fsl-asoc-card.c:65: warning: Function parameter or member 
'sysclk_id' not described in 'cpu_priv'
 sound/soc/fsl/fsl-asoc-card.c:95: warning: Function parameter or member 
'dai_link' not described in 'fsl_asoc_card_priv'

Cc: Timur Tabi 
Cc: Nicolin Chen 
Cc: Xiubo Li 
Cc: Fabio Estevam 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Lee Jones 
---
 sound/soc/fsl/fsl-asoc-card.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 57ea1b072326b..3b1fd8c9316d8 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -33,7 +33,7 @@
 #define DAI_FMT_BASE (SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF)
 
 /**
- * CODEC private data
+ * struct codec_priv - CODEC private data
  *
  * @mclk_freq: Clock rate of MCLK
  * @mclk_id: MCLK (or main clock) id for set_sysclk()
@@ -48,11 +48,11 @@ struct codec_priv {
 };
 
 /**
- * CPU private data
+ * struct cpu_priv - CPU private data
  *
- * @sysclk_freq[2]: SYSCLK rates for set_sysclk()
- * @sysclk_dir[2]: SYSCLK directions for set_sysclk()
- * @sysclk_id[2]: SYSCLK ids for set_sysclk()
+ * @sysclk_freq: SYSCLK rates for set_sysclk()
+ * @sysclk_dir: SYSCLK directions for set_sysclk()
+ * @sysclk_id: SYSCLK ids for set_sysclk()
  * @slot_width: Slot width of each frame
  *
  * Note: [1] for tx and [0] for rx
@@ -65,9 +65,9 @@ struct cpu_priv {
 };
 
 /**
- * Freescale Generic ASOC card private data
+ * struct fsl_asoc_card_priv - Freescale Generic ASOC card private data
  *
- * @dai_link[3]: DAI link structure including normal one and DPCM link
+ * @dai_link: DAI link structure including normal one and DPCM link
  * @pdev: platform device pointer
  * @codec_priv: CODEC private data
  * @cpu_priv: CPU private data
@@ -94,7 +94,7 @@ struct fsl_asoc_card_priv {
char name[32];
 };
 
-/**
+/*
  * This dapm route map exsits for DPCM link only.
  * The other routes shall go through Device Tree.
  *
-- 
2.25.1



[PATCH v2 05/28] ASoC: fsl: fsl_ssi: Demote obvious misuse of kerneldoc to standard comment blocks

2020-07-07 Thread Lee Jones
No attempt has been made to document any of the demoted functions here.

Fixes the following W=1 kernel build warning(s):

 sound/soc/fsl/fsl_ssi.c:380: warning: Function parameter or member 'irq' not 
described in 'fsl_ssi_isr'
 sound/soc/fsl/fsl_ssi.c:380: warning: Function parameter or member 'dev_id' 
not described in 'fsl_ssi_isr'
 sound/soc/fsl/fsl_ssi.c:406: warning: Function parameter or member 'ssi' not 
described in 'fsl_ssi_config_enable'
 sound/soc/fsl/fsl_ssi.c:406: warning: Function parameter or member 'tx' not 
described in 'fsl_ssi_config_enable'
 sound/soc/fsl/fsl_ssi.c:506: warning: Function parameter or member 'ssi' not 
described in 'fsl_ssi_config_disable'
 sound/soc/fsl/fsl_ssi.c:506: warning: Function parameter or member 'tx' not 
described in 'fsl_ssi_config_disable'
 sound/soc/fsl/fsl_ssi.c:583: warning: Function parameter or member 'ssi' not 
described in 'fsl_ssi_setup_regvals'
 sound/soc/fsl/fsl_ssi.c:675: warning: Function parameter or member 'substream' 
not described in 'fsl_ssi_set_bclk'
 sound/soc/fsl/fsl_ssi.c:675: warning: Function parameter or member 'dai' not 
described in 'fsl_ssi_set_bclk'
 sound/soc/fsl/fsl_ssi.c:675: warning: Function parameter or member 'hw_params' 
not described in 'fsl_ssi_set_bclk'
 sound/soc/fsl/fsl_ssi.c:798: warning: Function parameter or member 'substream' 
not described in 'fsl_ssi_hw_params'
 sound/soc/fsl/fsl_ssi.c:798: warning: Function parameter or member 'hw_params' 
not described in 'fsl_ssi_hw_params'
 sound/soc/fsl/fsl_ssi.c:798: warning: Function parameter or member 'dai' not 
described in 'fsl_ssi_hw_params'
 sound/soc/fsl/fsl_ssi.c:1003: warning: Function parameter or member 'dai' not 
described in 'fsl_ssi_set_dai_fmt'
 sound/soc/fsl/fsl_ssi.c:1003: warning: Function parameter or member 'fmt' not 
described in 'fsl_ssi_set_dai_fmt'
 sound/soc/fsl/fsl_ssi.c:1018: warning: Function parameter or member 'dai' not 
described in 'fsl_ssi_set_dai_tdm_slot'
 sound/soc/fsl/fsl_ssi.c:1018: warning: Function parameter or member 'tx_mask' 
not described in 'fsl_ssi_set_dai_tdm_slot'
 sound/soc/fsl/fsl_ssi.c:1018: warning: Function parameter or member 'rx_mask' 
not described in 'fsl_ssi_set_dai_tdm_slot'
 sound/soc/fsl/fsl_ssi.c:1018: warning: Function parameter or member 'slots' 
not described in 'fsl_ssi_set_dai_tdm_slot'
 sound/soc/fsl/fsl_ssi.c:1018: warning: Function parameter or member 
'slot_width' not described in 'fsl_ssi_set_dai_tdm_slot'
 sound/soc/fsl/fsl_ssi.c:1065: warning: Function parameter or member 
'substream' not described in 'fsl_ssi_trigger'
 sound/soc/fsl/fsl_ssi.c:1065: warning: Function parameter or member 'cmd' not 
described in 'fsl_ssi_trigger'
 sound/soc/fsl/fsl_ssi.c:1065: warning: Function parameter or member 'dai' not 
described in 'fsl_ssi_trigger'
 sound/soc/fsl/fsl_ssi.c:1245: warning: Function parameter or member 'ssi' not 
described in 'fsl_ssi_hw_init'
 sound/soc/fsl/fsl_ssi.c:1274: warning: Function parameter or member 'ssi' not 
described in 'fsl_ssi_hw_clean'
 sound/soc/fsl/fsl_ssi.c:1292: warning: Function parameter or member 's' not 
described in 'make_lowercase'

Also use correct formatting when documenting structs:

 sound/soc/fsl/fsl_ssi.c:258: warning: cannot understand function prototype: 
'struct fsl_ssi '

Cc: Timur Tabi 
Cc: Nicolin Chen 
Cc: Xiubo Li 
Cc: Fabio Estevam 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Lee Jones 
---
 sound/soc/fsl/fsl_ssi.c | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 1a2fa7f181423..5717d664cde1e 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -203,7 +203,7 @@ struct fsl_ssi_soc_data {
 };
 
 /**
- * fsl_ssi: per-SSI private data
+ * struct fsl_ssi - per-SSI private data
  *
  * @regs: Pointer to the regmap registers
  * @irq: IRQ of this SSI
@@ -373,7 +373,7 @@ static bool fsl_ssi_is_i2s_cbm_cfs(struct fsl_ssi *ssi)
SND_SOC_DAIFMT_CBM_CFS;
 }
 
-/**
+/*
  * Interrupt handler to gather states
  */
 static irqreturn_t fsl_ssi_isr(int irq, void *dev_id)
@@ -394,7 +394,7 @@ static irqreturn_t fsl_ssi_isr(int irq, void *dev_id)
return IRQ_HANDLED;
 }
 
-/**
+/*
  * Set SCR, SIER, STCR and SRCR registers with cached values in regvals
  *
  * Notes:
@@ -474,7 +474,7 @@ static void fsl_ssi_config_enable(struct fsl_ssi *ssi, bool 
tx)
ssi->streams |= BIT(dir);
 }
 
-/**
+/*
  * Exclude bits that are used by the opposite stream
  *
  * When both streams are active, disabling some bits for the current stream
@@ -494,7 +494,7 @@ static void fsl_ssi_config_enable(struct fsl_ssi *ssi, bool 
tx)
 #define ssi_excl_shared_bits(vals, avals, aactive) \
((vals) & _ssi_xor_shared_bits(vals, avals, aactive))
 
-/**
+/*
  * Unset SCR, SIER, STCR and SRCR registers with cached values in regvals
  *
  * Notes:
@@ -576,7 +576,7 @@ static void fsl_ssi_tx_ac97_saccst_setup(struct fsl_ssi 
*ssi)
}
 }
 
-/**

[PATCH v2 06/28] ASoC: fsl: fsl_ssi_dbg: Demote obvious misuse of kerneldoc to standard comment blocks

2020-07-07 Thread Lee Jones
No attempt has been made to document either of the demoted functions here.

Fixes the following W=1 kernel build warning(s):

 sound/soc/fsl/fsl_ssi_dbg.c:90: warning: Function parameter or member 'flag' 
not described in 'SIER_SHOW'
 sound/soc/fsl/fsl_ssi_dbg.c:90: warning: Function parameter or member 'name' 
not described in 'SIER_SHOW'
 sound/soc/fsl/fsl_ssi_dbg.c:99: warning: Function parameter or member 's' not 
described in 'fsl_ssi_stats_show'
 sound/soc/fsl/fsl_ssi_dbg.c:99: warning: Function parameter or member 'unused' 
not described in 'fsl_ssi_stats_show'

Cc: Timur Tabi 
Cc: Nicolin Chen 
Cc: Xiubo Li 
Cc: Fabio Estevam 
Cc: Markus Pargmann 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Lee Jones 
---
 sound/soc/fsl/fsl_ssi_dbg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/fsl/fsl_ssi_dbg.c b/sound/soc/fsl/fsl_ssi_dbg.c
index 2a20ee23dc52d..2c46c55f0a882 100644
--- a/sound/soc/fsl/fsl_ssi_dbg.c
+++ b/sound/soc/fsl/fsl_ssi_dbg.c
@@ -78,7 +78,7 @@ void fsl_ssi_dbg_isr(struct fsl_ssi_dbg *dbg, u32 sisr)
dbg->stats.tfe0++;
 }
 
-/**
+/*
  * Show the statistics of a flag only if its interrupt is enabled
  *
  * Compilers will optimize it to a no-op if the interrupt is disabled
@@ -90,7 +90,7 @@ void fsl_ssi_dbg_isr(struct fsl_ssi_dbg *dbg, u32 sisr)
} while (0)
 
 
-/**
+/*
  * Display the statistics for the current SSI device
  *
  * To avoid confusion, only show those counts that are enabled
-- 
2.25.1



[PATCH v2 07/28] ASoC: fsl: fsl_spdif: Use correct formatting when denoting struct documentation

2020-07-07 Thread Lee Jones
Kerneldoc expects struct documentation to start with "struct $NAME".

Fixes the following W=1 kernel build warning(s):

 sound/soc/fsl/fsl_spdif.c:104: warning: cannot understand function prototype: 
'struct fsl_spdif_priv '

Cc: Timur Tabi 
Cc: Nicolin Chen 
Cc: Xiubo Li 
Cc: Fabio Estevam 
Cc: Vladimir Barinov 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Lee Jones 
---
 sound/soc/fsl/fsl_spdif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c
index 5b2689ae63d4d..7aa3bdec5b6b5 100644
--- a/sound/soc/fsl/fsl_spdif.c
+++ b/sound/soc/fsl/fsl_spdif.c
@@ -81,7 +81,7 @@ struct spdif_mixer_control {
 };
 
 /**
- * fsl_spdif_priv: Freescale SPDIF private data
+ * struct fsl_spdif_priv - Freescale SPDIF private data
  *
  * @fsl_spdif_control: SPDIF control data
  * @cpu_dai_drv: cpu dai driver
-- 
2.25.1



[PATCH v2 08/28] ASoC: fsl: fsl_spdif: Update 'struct fsl_spdif_priv's descriptions

2020-07-07 Thread Lee Jones
Two descriptions for 'soc' and 'regcache_srpc' were missing.  Add them.

Fixes the following W=1 kernel build warning(s):

 sound/soc/fsl/fsl_spdif.c:125: warning: Function parameter or member 'soc' not 
described in 'fsl_spdif_priv'
 sound/soc/fsl/fsl_spdif.c:125: warning: Function parameter or member 
'regcache_srpc' not described in 'fsl_spdif_priv'

Cc: Timur Tabi 
Cc: Nicolin Chen 
Cc: Xiubo Li 
Cc: Fabio Estevam 
Cc: Vladimir Barinov 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Lee Jones 
---
 sound/soc/fsl/fsl_spdif.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c
index 7aa3bdec5b6b5..f0b2375a9246f 100644
--- a/sound/soc/fsl/fsl_spdif.c
+++ b/sound/soc/fsl/fsl_spdif.c
@@ -83,6 +83,7 @@ struct spdif_mixer_control {
 /**
  * struct fsl_spdif_priv - Freescale SPDIF private data
  *
+ * @soc: SoC specific data
  * @fsl_spdif_control: SPDIF control data
  * @cpu_dai_drv: cpu dai driver
  * @pdev: platform device pointer
@@ -100,6 +101,7 @@ struct spdif_mixer_control {
  * @spbaclk: SPBA clock (optional, depending on SoC design)
  * @dma_params_tx: DMA parameters for transmit channel
  * @dma_params_rx: DMA parameters for receive channel
+ * @regcache_srpc: regcache for SRPC
  */
 struct fsl_spdif_priv {
const struct fsl_spdif_soc_data *soc;
@@ -120,7 +122,6 @@ struct fsl_spdif_priv {
struct clk *spbaclk;
struct snd_dmaengine_dai_dma_data dma_params_tx;
struct snd_dmaengine_dai_dma_data dma_params_rx;
-   /* regcache for SRPC */
u32 regcache_srpc;
 };
 
-- 
2.25.1



[PATCH v2 09/28] ASoC: fsl: fsl_esai: Fix a bunch of kerneldoc issues

2020-07-07 Thread Lee Jones
Struct headers require a 'struct $NAME' title, all function parameters
require a description and need to be in the format '@.*:', else the
checker gets confused.  Also demote one kerneldoc header where no effort
was made to document any of the function's params.

Fixes the following W=1 kernel build warning(s):

 sound/soc/fsl/fsl_esai.c:30: warning: cannot understand function prototype: 
'struct fsl_esai_soc_data '
 sound/soc/fsl/fsl_esai.c:61: warning: cannot understand function prototype: 
'struct fsl_esai '
 sound/soc/fsl/fsl_esai.c:170: warning: Function parameter or member 'dai' not 
described in 'fsl_esai_divisor_cal'
 sound/soc/fsl/fsl_esai.c:265: warning: Function parameter or member 'dai' not 
described in 'fsl_esai_set_dai_sysclk'
 sound/soc/fsl/fsl_esai.c:265: warning: Function parameter or member 'clk_id' 
not described in 'fsl_esai_set_dai_sysclk'
 sound/soc/fsl/fsl_esai.c:265: warning: Function parameter or member 'freq' not 
described in 'fsl_esai_set_dai_sysclk'
 sound/soc/fsl/fsl_esai.c:265: warning: Function parameter or member 'dir' not 
described in 'fsl_esai_set_dai_sysclk'
 sound/soc/fsl/fsl_esai.c:265: warning: Excess function parameter 'Parameters' 
description in 'fsl_esai_set_dai_sysclk'
 sound/soc/fsl/fsl_esai.c:364: warning: Function parameter or member 'dai' not 
described in 'fsl_esai_set_bclk'
 sound/soc/fsl/fsl_esai.c:364: warning: Function parameter or member 'tx' not 
described in 'fsl_esai_set_bclk'
 sound/soc/fsl/fsl_esai.c:364: warning: Function parameter or member 'freq' not 
described in 'fsl_esai_set_bclk'

Cc: Timur Tabi 
Cc: Nicolin Chen 
Cc: Xiubo Li 
Cc: Fabio Estevam 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Lee Jones 
---
 sound/soc/fsl/fsl_esai.c | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index cbcb70d6f8c83..bb3c405df623c 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -22,7 +22,7 @@
SNDRV_PCM_FMTBIT_S24_LE)
 
 /**
- * fsl_esai_soc_data: soc specific data
+ * struct fsl_esai_soc_data - soc specific data
  *
  * @imx: for imx platform
  * @reset_at_xrun: flags for enable reset operaton
@@ -33,7 +33,7 @@ struct fsl_esai_soc_data {
 };
 
 /**
- * fsl_esai: ESAI private data
+ * struct fsl_esai - ESAI private data
  *
  * @dma_params_rx: DMA parameters for receive channel
  * @dma_params_tx: DMA parameters for transmit channel
@@ -160,10 +160,11 @@ static irqreturn_t esai_isr(int irq, void *devid)
  * This function is used to calculate the divisors of psr, pm, fp and it is
  * supposed to be called in set_dai_sysclk() and set_bclk().
  *
+ * @dai: SoC DAI
+ * @tx: current setting is for playback or capture
  * @ratio: desired overall ratio for the paticipating dividers
  * @usefp: for HCK setting, there is no need to set fp divider
  * @fp: bypass other dividers by setting fp directly if fp != 0
- * @tx: current setting is for playback or capture
  */
 static int fsl_esai_divisor_cal(struct snd_soc_dai *dai, bool tx, u32 ratio,
bool usefp, u32 fp)
@@ -252,11 +253,11 @@ static int fsl_esai_divisor_cal(struct snd_soc_dai *dai, 
bool tx, u32 ratio,
 /**
  * This function mainly configures the clock frequency of MCLK (HCKT/HCKR)
  *
- * @Parameters:
- * clk_id: The clock source of HCKT/HCKR
+ * @dai: SoC DAI
+ * @clk_id: The clock source of HCKT/HCKR
  *   (Input from outside; output from inside, FSYS or EXTAL)
- * freq: The required clock rate of HCKT/HCKR
- * dir: The clock direction of HCKT/HCKR
+ * @freq: The required clock rate of HCKT/HCKR
+ * @dir: The clock direction of HCKT/HCKR
  *
  * Note: If the direction is input, we do not care about clk_id.
  */
@@ -357,7 +358,7 @@ static int fsl_esai_set_dai_sysclk(struct snd_soc_dai *dai, 
int clk_id,
return 0;
 }
 
-/**
+/*
  * This function configures the related dividers according to the bclk rate
  */
 static int fsl_esai_set_bclk(struct snd_soc_dai *dai, bool tx, u32 freq)
-- 
2.25.1



[PATCH v2 10/28] ASoC: fsl: fsl_esai: Add descriptions for 'tx_mask' and 'rx_mask' to 'fsl_esai'

2020-07-07 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 sound/soc/fsl/fsl_esai.c:86: warning: Function parameter or member 'tx_mask' 
not described in 'fsl_esai'
 sound/soc/fsl/fsl_esai.c:86: warning: Function parameter or member 'rx_mask' 
not described in 'fsl_esai'

Cc: Timur Tabi 
Cc: Nicolin Chen 
Cc: Xiubo Li 
Cc: Fabio Estevam 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Lee Jones 
---
 sound/soc/fsl/fsl_esai.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index bb3c405df623c..3f67f4a465780 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -49,6 +49,8 @@ struct fsl_esai_soc_data {
  * @fifo_depth: depth of tx/rx FIFO
  * @slot_width: width of each DAI slot
  * @slots: number of slots
+ * @tx_mask: tx register mask
+ * @rx_mask: rx register mask
  * @channels: channel num for tx or rx
  * @hck_rate: clock rate of desired HCKx clock
  * @sck_rate: clock rate of desired SCKx clock
-- 
2.25.1



Re: [PATCH 1/4] dma-mapping: move the remaining DMA API calls out of line

2020-07-07 Thread Christoph Hellwig
On Tue, Jul 07, 2020 at 10:43:10AM +1000, Alexey Kardashevskiy wrote:
> Any luck there? I'd really like to cross this off my todo list :) Thanks,

We had another incident with new net code poking into dma internals
blocking this series.  That is now sorted out, so the series is back
on track.


Re: kernel since 5.6 do not boot anymore on Apple PowerBook

2020-07-07 Thread Christophe Leroy




Le 07/07/2020 à 16:03, Giuseppe Sacco a écrit :

Hello Cristophe,

Il giorno mar, 07/07/2020 alle 15.35 +0200, Christophe Leroy ha
scritto:

Hi,
Le 07/07/2020 à 14:58, Giuseppe Sacco a écrit :

[...]

So, I am looking for help. How may I better investigate the
problem?
How may I crossbuild the kernel on a faster machine (amd64) in
order to
try git-bisect without waiting ages?


To crossbuild, use cross tools at
https://mirrors.edge.kernel.org/pub/tools/crosstool/


thank you, I'll have a look at it.


Can you tell which defconfig you use or provide your .config


You may get the standard one from debian or a reduced one that I made
on purpose. The latter is here:
https://eppesuigoccas.homedns.org/~giuseppe/config-5.4.50.gz (boot)
https://eppesuigoccas.homedns.org/~giuseppe/config-5.6.19.gz (no boot)



Thanks

Can you provide the complete output when it works, so that I can see 
what is after the place it stops when it fails.


And can you try without CONFIG_VMAP_STACK on 5.6.19

Christophe


[PATCH 0/2] Selftest for cpuidle latency measurement

2020-07-07 Thread Pratik Rajesh Sampat
The patch series introduces a mechanism to measure wakeup latency for
IPI and timer based interrupts
The motivation behind this series is to find significant deviations
behind advertised latency and resisdency values

To achieve this, we introduce a kernel module and expose its control
knobs through the debugfs interface that the selftests can engage with.

The kernel module provides the following interfaces within
/sys/kernel/debug/latency_test/ for,
1. IPI test:
  ipi_cpu_dest   # Destination CPU for the IPI
  ipi_cpu_src# Origin of the IPI
  ipi_latency_ns # Measured latency time in ns
2. Timeout test:
  timeout_cpu_src # CPU on which the timer to be queued
  timeout_expected_ns # Timer duration
  timeout_diff_ns # Difference of actual duration vs expected timer
To include the module, check option and include as module
kernel hacking -> Cpuidle latency selftests

The selftest inserts the module, disables all the idle states and
enables them one by one testing:
1. Keeping source CPU constant, iterates through all the CPUS measuring
   IPI latency for baseline (CPU is busy with "yes" workload) and the
   when the CPU is at rest
2. Iterating through all the CPUs, sending expected timer durations to
   be equivalent to the residency of the the deepest idle state
   enabled and extracting the difference in time between the time of
   wakeup and the expected timer duration

Usage
-
Can be used in conjuction to the rest of the selftests.
Default Output location in: tools/testing/cpuidle/cpuidle.log

To run this test specifically:
$ make -C tools/testing/selftests TARGETS="cpuidle" run_tests

There are a few optinal arguments too that the script can take
[-h ]
[-m ]
[-o ]

Sample output snippet
-
--IPI Latency Test---
---Enabling state: 0---
SRC_CPU   DEST_CPU Base_IPI_Latency(ns) IPI_Latency(ns)
00  328291
01 1500   1071
02 1070   1062
03 1557   1668
. . . .
Expected IPI latency(ns): 1000
Baseline Average IPI latency(ns): 1113
Observed Average IPI latency(ns): 1023
--Timeout Latency Test--
---Enabling state: 0---
Wakeup_src Baseline_delay(ns)  Delay(ns)
03134   2128
12275   2107
2   2198
32421   2325
. . . .
Expected timeout(ns): 200
Baseline Average timeout diff(ns): 2513
Observed Average timeout diff(ns): 2189

Pratik Rajesh Sampat (2):
  cpuidle: Trace IPI based and timer based wakeup latency from idle
states
  selftest/cpuidle: Add support for cpuidle latency measurement

 drivers/cpuidle/Makefile   |   1 +
 drivers/cpuidle/test-cpuidle_latency.c | 150 +
 lib/Kconfig.debug  |  10 +
 tools/testing/selftests/Makefile   |   1 +
 tools/testing/selftests/cpuidle/Makefile   |   6 +
 tools/testing/selftests/cpuidle/cpuidle.sh | 240 +
 tools/testing/selftests/cpuidle/settings   |   1 +
 7 files changed, 409 insertions(+)
 create mode 100644 drivers/cpuidle/test-cpuidle_latency.c
 create mode 100644 tools/testing/selftests/cpuidle/Makefile
 create mode 100755 tools/testing/selftests/cpuidle/cpuidle.sh
 create mode 100644 tools/testing/selftests/cpuidle/settings

-- 
2.25.4



[PATCH 1/2] cpuidle: Trace IPI based and timer based wakeup latency from idle states

2020-07-07 Thread Pratik Rajesh Sampat
Fire directed smp_call_function_single IPIs from a specified source
CPU to the specified target CPU to reduce the noise we have to wade
through in the trace log.
The module is based on the idea written by Srivatsa Bhat and maintained
by Vaidyanathan Srinivasan internally.

Queue HR timer and measure jitter. Wakeup latency measurement for idle
states using hrtimer.  Echo a value in ns to timer_test_function and
watch trace. A HRtimer will be queued and when it fires the expected
wakeup vs actual wakeup is computes and delay printed in ns.

Implemented as a module which utilizes debugfs so that it can be
integrated with selftests.

To include the module, check option and include as module
kernel hacking -> Cpuidle latency selftests

[srivatsa.b...@linux.vnet.ibm.com: Initial implementation in
 cpidle/sysfs]

[sva...@linux.vnet.ibm.com: wakeup latency measurements using hrtimer
 and fix some of the time calculation]

[e...@linux.vnet.ibm.com: Fix some whitespace and tab errors and
 increase the resolution of IPI wakeup]

Signed-off-by: Pratik Rajesh Sampat 
---
 drivers/cpuidle/Makefile   |   1 +
 drivers/cpuidle/test-cpuidle_latency.c | 150 +
 lib/Kconfig.debug  |  10 ++
 3 files changed, 161 insertions(+)
 create mode 100644 drivers/cpuidle/test-cpuidle_latency.c

diff --git a/drivers/cpuidle/Makefile b/drivers/cpuidle/Makefile
index f07800cbb43f..2ae05968078c 100644
--- a/drivers/cpuidle/Makefile
+++ b/drivers/cpuidle/Makefile
@@ -8,6 +8,7 @@ obj-$(CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED) += coupled.o
 obj-$(CONFIG_DT_IDLE_STATES) += dt_idle_states.o
 obj-$(CONFIG_ARCH_HAS_CPU_RELAX) += poll_state.o
 obj-$(CONFIG_HALTPOLL_CPUIDLE)   += cpuidle-haltpoll.o
+obj-$(CONFIG_IDLE_LATENCY_SELFTEST)  += test-cpuidle_latency.o
 
 
##
 # ARM SoC drivers
diff --git a/drivers/cpuidle/test-cpuidle_latency.c 
b/drivers/cpuidle/test-cpuidle_latency.c
new file mode 100644
index ..61574665e972
--- /dev/null
+++ b/drivers/cpuidle/test-cpuidle_latency.c
@@ -0,0 +1,150 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Module-based API test facility for cpuidle latency using IPIs and timers
+ */
+
+#include 
+#include 
+#include 
+
+/* IPI based wakeup latencies */
+struct latency {
+   unsigned int src_cpu;
+   unsigned int dest_cpu;
+   ktime_t time_start;
+   ktime_t time_end;
+   u64 latency_ns;
+} ipi_wakeup;
+
+static void measure_latency(void *info)
+{
+   struct latency *v;
+   ktime_t time_diff;
+
+   v = (struct latency *)info;
+   v->time_end = ktime_get();
+   time_diff = ktime_sub(v->time_end, v->time_start);
+   v->latency_ns = ktime_to_ns(time_diff);
+}
+
+void run_smp_call_function_test(unsigned int cpu)
+{
+   ipi_wakeup.src_cpu = smp_processor_id();
+   ipi_wakeup.dest_cpu = cpu;
+   ipi_wakeup.time_start = ktime_get();
+   smp_call_function_single(cpu, measure_latency, &ipi_wakeup, 1);
+}
+
+/* Timer based wakeup latencies */
+struct timer_data {
+   unsigned int src_cpu;
+   u64 timeout;
+   ktime_t time_start;
+   ktime_t time_end;
+   struct hrtimer timer;
+   u64 timeout_diff_ns;
+} timer_wakeup;
+
+static enum hrtimer_restart timer_called(struct hrtimer *hrtimer)
+{
+   struct timer_data *w;
+   ktime_t time_diff;
+
+   w = container_of(hrtimer, struct timer_data, timer);
+   w->time_end = ktime_get();
+
+   time_diff = ktime_sub(w->time_end, w->time_start);
+   time_diff = ktime_sub(time_diff, ns_to_ktime(w->timeout));
+   w->timeout_diff_ns = ktime_to_ns(time_diff);
+   return HRTIMER_NORESTART;
+}
+
+static void run_timer_test(unsigned int ns)
+{
+   hrtimer_init(&timer_wakeup.timer, CLOCK_MONOTONIC,
+HRTIMER_MODE_REL);
+   timer_wakeup.timer.function = timer_called;
+   timer_wakeup.time_start = ktime_get();
+   timer_wakeup.src_cpu = smp_processor_id();
+   timer_wakeup.timeout = ns;
+
+   hrtimer_start(&timer_wakeup.timer, ns_to_ktime(ns),
+ HRTIMER_MODE_REL_PINNED);
+}
+
+static struct dentry *dir;
+
+static int cpu_read_op(void *data, u64 *value)
+{
+   *value = ipi_wakeup.dest_cpu;
+   return 0;
+}
+
+static int cpu_write_op(void *data, u64 value)
+{
+   run_smp_call_function_test(value);
+   return 0;
+}
+DEFINE_SIMPLE_ATTRIBUTE(ipi_ops, cpu_read_op, cpu_write_op, "%llu\n");
+
+static int timeout_read_op(void *data, u64 *value)
+{
+   *value = timer_wakeup.timeout;
+   return 0;
+}
+
+static int timeout_write_op(void *data, u64 value)
+{
+   run_timer_test(value);
+   return 0;
+}
+DEFINE_SIMPLE_ATTRIBUTE(timeout_ops, timeout_read_op, timeout_write_op, 
"%llu\n");
+
+static int __init latency_init(void)
+{
+   struct dentry *temp;
+
+   dir = debugfs_create_dir("latency_test", 0);
+   if (!dir) {

[PATCH 2/2] selftest/cpuidle: Add support for cpuidle latency measurement

2020-07-07 Thread Pratik Rajesh Sampat
This patch adds support to trace IPI based and timer based wakeup
latency from idle states

Latches onto the test-cpuidle_latency kernel module using the debugfs
interface to send IPIs or schedule a timer based event, which in-turn
populates the debugfs with the latency measurements.

Currently for the IPI and timer tests; first disable all idle states
and then test for latency measurements incrementally enabling each state

Signed-off-by: Pratik Rajesh Sampat 
---
 tools/testing/selftests/Makefile   |   1 +
 tools/testing/selftests/cpuidle/Makefile   |   6 +
 tools/testing/selftests/cpuidle/cpuidle.sh | 240 +
 tools/testing/selftests/cpuidle/settings   |   1 +
 4 files changed, 248 insertions(+)
 create mode 100644 tools/testing/selftests/cpuidle/Makefile
 create mode 100755 tools/testing/selftests/cpuidle/cpuidle.sh
 create mode 100644 tools/testing/selftests/cpuidle/settings

diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 1195bd85af38..ab6cf51f3518 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -7,6 +7,7 @@ TARGETS += capabilities
 TARGETS += cgroup
 TARGETS += clone3
 TARGETS += cpufreq
+TARGETS += cpuidle
 TARGETS += cpu-hotplug
 TARGETS += drivers/dma-buf
 TARGETS += efivarfs
diff --git a/tools/testing/selftests/cpuidle/Makefile 
b/tools/testing/selftests/cpuidle/Makefile
new file mode 100644
index ..72fd5d2e974d
--- /dev/null
+++ b/tools/testing/selftests/cpuidle/Makefile
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0
+all:
+
+TEST_PROGS := cpuidle.sh
+
+include ../lib.mk
diff --git a/tools/testing/selftests/cpuidle/cpuidle.sh 
b/tools/testing/selftests/cpuidle/cpuidle.sh
new file mode 100755
index ..11666fe47c34
--- /dev/null
+++ b/tools/testing/selftests/cpuidle/cpuidle.sh
@@ -0,0 +1,240 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+LOG=cpuidle.log
+MODULE=/lib/modules/$(uname -r)/kernel/drivers/cpuidle/test-cpuidle_latency.ko
+
+helpme()
+{
+   printf "Usage: $0 [-h] [-todg args]
+   [-h ]
+   [-m ]
+   [-o ]
+   \n"
+   exit 2
+}
+
+parse_arguments()
+{
+   while getopts ht:m:o: arg
+   do
+   case $arg in
+   h) # --help
+   helpme
+   ;;
+   m) # --mod-file
+   MODULE=$OPTARG
+   ;;
+   o) # output log files
+   LOG=$OPTARG
+   ;;
+   \?)
+   helpme
+   ;;
+   esac
+   done
+}
+
+ins_mod()
+{
+   if [ ! -f "$MODULE" ]; then
+   printf "$MODULE module does not exist. Exitting\n"
+   exit 2
+   fi
+   printf "Inserting $MODULE module\n\n"
+   insmod $MODULE
+   if [ $? != 0 ]; then
+   printf "Insmod $MODULE failed\n"
+   exit 2
+   fi
+}
+
+compute_average()
+{
+   arr=("$@")
+   sum=0
+   size=${#arr[@]}
+   for i in "${arr[@]}"
+   do
+   sum=$((sum + i))
+   done
+   avg=$((sum/size))
+}
+
+# Disable all stop states
+disable_idle()
+{
+   for ((cpu=0; cpu 
/sys/devices/system/cpu/cpu$cpu/cpuidle/state$state/disable
+   done
+   done
+}
+
+# Enable the idle state supplied
+# $1: State to enable
+enable_state()
+{
+   for ((cpu=0; cpu /sys/devices/system/cpu/cpu$cpu/cpuidle/state$1/disable
+   done
+}
+
+# Extract latency in microseconds and convert to nanoseconds
+extract_latency()
+{
+   for ((state=0; state /dev/null &
+   yes_pid=$!
+fi
+taskset 0x1 echo $dest_cpu > 
/sys/kernel/debug/latency_test/ipi_cpu_dest
+ipi_latency=$(cat /sys/kernel/debug/latency_test/ipi_latency_ns)
+src_cpu=$(cat /sys/kernel/debug/latency_test/ipi_cpu_src)
+if [ "$1" = "baseline" ]; then
+   kill $yes_pid
+   wait $yes_pid 2>/dev/null
+fi
+}
+
+# Incrementally Enable idle states one by one and compute the latency
+run_ipi_tests()
+{
+extract_latency
+disable_idle
+declare -a avg_arr
+declare -a baseline_avg_array
+
+echo -e "--IPI Latency Test---" >> $LOG
+for ((state=0; state> $LOG
+   enable_state $state
+   printf "%s %10s %12s %12s\n" "SRC_CPU" "DEST_CPU" 
"Base_IPI_Latency(ns)" "IPI_Latency(ns)" >> $LOG
+   unset avg_arr
+   unset baseline_avg_arr
+   for ((cpu=0; cpu> $LOG
+   avg_arr+=($ipi_latency)
+   baseline_avg_arr+=($baseline_ipi_latency)
+   done
+   compute_average "${avg_arr[@]}"
+   local 

Re: kernel since 5.6 do not boot anymore on Apple PowerBook

2020-07-07 Thread Giuseppe Sacco
Il giorno mar, 07/07/2020 alle 16.52 +0200, Christophe Leroy ha
scritto:
> 
> Le 07/07/2020 à 16:03, Giuseppe Sacco a écrit :
> > Hello Cristophe,
> > 
> > > Can you tell which defconfig you use or provide your .config
> > 
> > You may get the standard one from debian or a reduced one that I
> > made on purpose. The latter is here:
> > https://eppesuigoccas.homedns.org/~giuseppe/config-5.4.50.gz
> >  (boot)
> > https://eppesuigoccas.homedns.org/~giuseppe/config-5.6.19.gz
> >  (no boot)
> 
> Thanks
> 
> Can you provide the complete output when it works, so that I can see 
> what is after the place it stops when it fails.

Here it is:
https://eppesuigoccas.homedns.org/~giuseppe/dmesg-5.4.40-minimo.gz

> And can you try without CONFIG_VMAP_STACK on 5.6.19

Sure, I'll let you know.

Thank you,
Giuseppe



Re: [PATCH 2/2] selftest/cpuidle: Add support for cpuidle latency measurement

2020-07-07 Thread Shuah Khan

On 7/7/20 9:29 AM, Pratik Rajesh Sampat wrote:

This patch adds support to trace IPI based and timer based wakeup
latency from idle states

Latches onto the test-cpuidle_latency kernel module using the debugfs
interface to send IPIs or schedule a timer based event, which in-turn
populates the debugfs with the latency measurements.

Currently for the IPI and timer tests; first disable all idle states
and then test for latency measurements incrementally enabling each state

Signed-off-by: Pratik Rajesh Sampat 
---
  tools/testing/selftests/Makefile   |   1 +
  tools/testing/selftests/cpuidle/Makefile   |   6 +
  tools/testing/selftests/cpuidle/cpuidle.sh | 240 +
  tools/testing/selftests/cpuidle/settings   |   1 +
  4 files changed, 248 insertions(+)
  create mode 100644 tools/testing/selftests/cpuidle/Makefile
  create mode 100755 tools/testing/selftests/cpuidle/cpuidle.sh
  create mode 100644 tools/testing/selftests/cpuidle/settings

diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 1195bd85af38..ab6cf51f3518 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -7,6 +7,7 @@ TARGETS += capabilities
  TARGETS += cgroup
  TARGETS += clone3
  TARGETS += cpufreq
+TARGETS += cpuidle
  TARGETS += cpu-hotplug
  TARGETS += drivers/dma-buf
  TARGETS += efivarfs
diff --git a/tools/testing/selftests/cpuidle/Makefile 
b/tools/testing/selftests/cpuidle/Makefile
new file mode 100644
index ..72fd5d2e974d
--- /dev/null
+++ b/tools/testing/selftests/cpuidle/Makefile
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0
+all:
+
+TEST_PROGS := cpuidle.sh
+
+include ../lib.mk
diff --git a/tools/testing/selftests/cpuidle/cpuidle.sh 
b/tools/testing/selftests/cpuidle/cpuidle.sh
new file mode 100755
index ..11666fe47c34
--- /dev/null
+++ b/tools/testing/selftests/cpuidle/cpuidle.sh
@@ -0,0 +1,240 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+LOG=cpuidle.log
+MODULE=/lib/modules/$(uname -r)/kernel/drivers/cpuidle/test-cpuidle_latency.ko
+
+helpme()
+{
+   printf "Usage: $0 [-h] [-todg args]
+   [-h ]
+   [-m ]
+   [-o ]
+   \n"
+   exit 2
+}
+
+parse_arguments()
+{
+   while getopts ht:m:o: arg
+   do
+   case $arg in
+   h) # --help
+   helpme
+   ;;
+   m) # --mod-file
+   MODULE=$OPTARG
+   ;;
+   o) # output log files
+   LOG=$OPTARG
+   ;;
+   \?)
+   helpme
+   ;;
+   esac
+   done
+}
+
+ins_mod()
+{
+   if [ ! -f "$MODULE" ]; then
+   printf "$MODULE module does not exist. Exitting\n"
+   exit 2


Please use ksft_skip code to indicate the test is being skipped.


+   fi
+   printf "Inserting $MODULE module\n\n"
+   insmod $MODULE
+   if [ $? != 0 ]; then
+   printf "Insmod $MODULE failed\n"
+   exit 2


This is fine since you expect to be able to load the module.


+   fi
+}
+
+compute_average()
+{
+   arr=("$@")
+   sum=0
+   size=${#arr[@]}
+   for i in "${arr[@]}"
+   do
+   sum=$((sum + i))
+   done
+   avg=$((sum/size))
+}
+
+# Disable all stop states
+disable_idle()
+{
+   for ((cpu=0; cpu 
/sys/devices/system/cpu/cpu$cpu/cpuidle/state$state/disable
+   done
+   done
+}
+
+# Enable the idle state supplied
+# $1: State to enable
+enable_state()
+{
+   for ((cpu=0; cpu /sys/devices/system/cpu/cpu$cpu/cpuidle/state$1/disable
+   done
+}
+
+# Extract latency in microseconds and convert to nanoseconds
+extract_latency()
+{
+   for ((state=0; state /dev/null &
+   yes_pid=$!
+fi
+taskset 0x1 echo $dest_cpu > 
/sys/kernel/debug/latency_test/ipi_cpu_dest
+ipi_latency=$(cat /sys/kernel/debug/latency_test/ipi_latency_ns)
+src_cpu=$(cat /sys/kernel/debug/latency_test/ipi_cpu_src)
+if [ "$1" = "baseline" ]; then
+   kill $yes_pid
+   wait $yes_pid 2>/dev/null
+fi
+}
+
+# Incrementally Enable idle states one by one and compute the latency
+run_ipi_tests()
+{
+extract_latency
+disable_idle
+declare -a avg_arr
+declare -a baseline_avg_array
+
+echo -e "--IPI Latency Test---" >> $LOG
+for ((state=0; state> $LOG
+   enable_state $state
+   printf "%s %10s %12s %12s\n" "SRC_CPU" "DEST_CPU" 
"Base_IPI_Latency(ns)" "IPI_Latency(ns)" >> $LOG
+   unset avg_arr
+   unset baseline_avg_arr
+   for ((cpu=0; cpu> $LOG
+   avg_arr+=($ipi_l

Re: [PATCH 2/2] selftest/cpuidle: Add support for cpuidle latency measurement

2020-07-07 Thread Pratik Sampat

[..snip..]

+
+ins_mod()
+{
+    if [ ! -f "$MODULE" ]; then
+    printf "$MODULE module does not exist. Exitting\n"
+    exit 2


Please use ksft_skip code to indicate the test is being skipped.


Sure thing I'll use ksft_skip exit code instead.

+    fi
+    printf "Inserting $MODULE module\n\n"
+    insmod $MODULE
+    if [ $? != 0 ]; then
+    printf "Insmod $MODULE failed\n"
+    exit 2


This is fine since you expect to be able to load the module.


Thanks for the review.
Pratik

[..snip..]




thanks,
-- Shuah




Re: Using Firefox hangs system

2020-07-07 Thread Paul Menzel

Dear Nicholas,


Am 07.07.20 um 09:03 schrieb Nicholas Piggin:

Excerpts from Paul Menzel's message of July 6, 2020 3:20 pm:



Am 06.07.20 um 02:41 schrieb Nicholas Piggin:

Excerpts from Paul Menzel's message of July 5, 2020 8:30 pm:



Am 05.07.20 um 11:22 schrieb Paul Menzel:

[  572.253008] Oops: Exception in kernel mode, sig: 5 [#1]
[  572.253198] LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA PowerNV
[  572.253232] Modules linked in: tcp_diag inet_diag unix_diag xt_CHECKSUM 
xt_MASQUERADE xt_conntrack ipt_REJECT nf_reject_ipv4 xt_tcpudp ip6table_mangle 
ip6table_nat iptable_mangle iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 
nf_defrag_ipv4 nf_tables nfnetlink ip6table_filter ip6_tables iptable_filter 
bridge stp llc overlay xfs kvm_hv kvm binfmt_misc joydev uas usb_storage 
vmx_crypto bnx2x crct10dif_vpmsum ofpart cmdlinepart powernv_flash mtd mdio 
ibmpowernv at24 ipmi_powernv ipmi_devintf ipmi_msghandler opal_prd powernv_rng 
sch_fq_codel parport_pc ppdev lp nfsd parport auth_rpcgss nfs_acl lockd grace 
sunrpc ip_tables x_tables autofs4 btrfs blake2b_generic libcrc32c xor 
zstd_compress raid6_pq input_leds mac_hid hid_generic ast drm_vram_helper 
drm_ttm_helper i2c_algo_bit ttm drm_kms_helper syscopyarea sysfillrect 
sysimgblt fb_sys_fops drm ahci drm_panel_orientation_quirks libahci usbhid hid 
crc32c_vpmsum uio_pdrv_genirq uio
[  572.253639] CPU: 4 PID: 6728 Comm: Web Content Not tainted 5.8.0-rc3+ #1
[  572.253659] NIP:  c000ff5c LR: c001a8f8 CTR: c01d5f00
[  572.253835] REGS: c07f31f0f420 TRAP: 1500   Not tainted  (5.8.0-rc3+)
[  572.253854] MSR:  9290b033   CR: 
28c48482  XER: 2000
[  572.253888] CFAR: c000fecc IRQMASK: 1
[  572.253888] GPR00: c001b228 c07f31f0f6b0 c1f9a900 
c07f351544d0
[  572.253888] GPR04:  c07f31f0fe90 c07f351544f0 
c07f32e522b0
[  572.253888] GPR08:  2000 90009033 
c07fbcd85800
[  572.253888] GPR12: 8800 c07fb680 0005 
0004
[  572.253888] GPR16: c07f35153800 c07f35154130 0005 
0001
[  572.253888] GPR20: 0024 c07f32e51e68 c07f35154028 
007fd8da
[  572.253888] GPR24: 007fd8da c07f351544d0 c07e9a4024d0 
c1665f18
[  572.253888] GPR28: c07f351544d0 c07f35153800 9290f033 
c07f35153800
[  572.254079] NIP [c000ff5c] save_fpu+0xa8/0x2ac
[  572.254098] LR [c001a8f8] __giveup_fpu+0x28/0x80
[  572.254114] Call Trace:
[  572.254128] [c07f31f0f6b0] [c07f35153980] 0xc07f35153980 
(unreliable)
[  572.254156] [c07f31f0f6e0] [c001b228] giveup_all+0x128/0x150
[  572.254327] [c07f31f0f710] [c001c124] __switch_to+0x104/0x490
[  572.254352] [c07f31f0f770] [c10d2e34] __schedule+0x2e4/0xa10
[  572.254374] [c07f31f0f840] [c10d35d4] schedule+0x74/0x140
[  572.254397] [c07f31f0f870] [c10d9478] 
schedule_timeout+0x358/0x5d0
[  572.254424] [c07f31f0f980] [c10d5638] 
wait_for_completion+0xc8/0x210
[  572.254451] [c07f31f0fa00] [c0608ed4] do_coredump+0x3a4/0xd60
[  572.254625] [c07f31f0fba0] [c018d1cc] get_signal+0x1dc/0xd00
[  572.254648] [c07f31f0fcc0] [c001f088] 
do_notify_resume+0x158/0x450
[  572.254672] [c07f31f0fda0] [c0037d04] 
interrupt_exit_user_prepare+0x1c4/0x230
[  572.254699] [c07f31f0fe20] [c000f2b4] interrupt_return+0x14/0x1c0
[  572.254720] Instruction dump:
[  572.254882] dae60170 db060180 db260190 db4601a0 db6601b0 db8601c0 dba601d0 
dbc601e0
[  572.254912] dbe601f0 48000204 3880 f250 <7c062798> f250 38800010 
f0210a50
[  572.254946] ---[ end trace ba4452ee5c77d58e ]---


Please find all the messages attached.


"Oops: Exception in kernel mode, sig: 5 [#1]"

Unfortunately it's a very poor error message. I think it is a 0x1500
exception triggering in the kernel FP register saving. Do you have the
CONFIG_PPC_DENORMALISATION config option set?


Yes, as it’s set in the Ubuntu Linux kernel configuration, I have it set
too.

  $ grep DENORMALI /boot/config-*
  /boot/config-4.15.0-23-generic:CONFIG_PPC_DENORMALISATION=y
  /boot/config-5.4.0-40-generic:CONFIG_PPC_DENORMALISATION=y
  /boot/config-5.7.0-rc5+:CONFIG_PPC_DENORMALISATION=y
  /boot/config-5.8.0-rc3+:CONFIG_PPC_DENORMALISATION=y


Ah thanks I was able to reproduce with a little denorm test case.

The denorm interrupt handler got broken by some careless person.

This patch should hopefully fix it for you?


Yes, it does. Thank you.


---
  arch/powerpc/kernel/exceptions-64s.S | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/exceptions-64s.S 
b/arch/powerpc/kernel/exceptions-64s.S
index fa080694e581..0fc8bad878b2 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -2551,7 +

[PATCH 02/20] Documentation: block: eliminate duplicated word

2020-07-07 Thread Randy Dunlap
Change the doubled word "the" to "to the".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: Jens Axboe 
Cc: linux-bl...@vger.kernel.org
---
 Documentation/block/pr.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200701.orig/Documentation/block/pr.rst
+++ linux-next-20200701/Documentation/block/pr.rst
@@ -9,7 +9,7 @@ access to block devices to specific init
 setup.
 
 This document gives a general overview of the support ioctl commands.
-For a more detailed reference please refer the the SCSI Primary
+For a more detailed reference please refer to the SCSI Primary
 Commands standard, specifically the section on Reservations and the
 "PERSISTENT RESERVE IN" and "PERSISTENT RESERVE OUT" commands.
 


[PATCH 00/20] Documentation: eliminate duplicated words

2020-07-07 Thread Randy Dunlap
Drop doubled words in various parts of Documentation/.


Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: linux...@vger.kernel.org
Cc: Mike Rapoport 
Cc: Jens Axboe 
Cc: linux-bl...@vger.kernel.org
Cc: Jason Wessel 
Cc: Daniel Thompson 
Cc: Douglas Anderson 
Cc: kgdb-bugrep...@lists.sourceforge.net
Cc: Wu Hao 
Cc: linux-f...@vger.kernel.org
Cc: James (Qian) Wang 
Cc: Liviu Dudau 
Cc: Mihail Atanassov 
Cc: Mali DP Maintainers 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-de...@lists.freedesktop.org
Cc: Srinivas Pandruvada 
Cc: Jiri Kosina 
Cc: linux-in...@vger.kernel.org
Cc: Wolfram Sang 
Cc: linux-...@vger.kernel.org
Cc: Masahiro Yamada 
Cc: Michal Marek 
Cc: linux-kbu...@vger.kernel.org
Cc: Jacek Anaszewski 
Cc: Pavel Machek 
Cc: Dan Murphy 
Cc: linux-l...@vger.kernel.org
Cc: Dan Williams 
Cc: Paul Cercueil 
Cc: Thomas Bogendoerfer 
Cc: linux-m...@vger.kernel.org
Cc: Derek Kiernan 
Cc: Dragan Cvetic 
Cc: Michael Ellerman 
Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Tony Krowiak 
Cc: Pierre Morel 
Cc: Halil Pasic 
Cc: linux-s...@vger.kernel.org
Cc: Matthew Wilcox 
Cc: Hannes Reinecke 
Cc: linux-s...@vger.kernel.org
Cc: "James E.J. Bottomley" 
Cc: "Martin K. Petersen" 
Cc: James Bottomley 
Cc: Jarkko Sakkinen 
Cc: Mimi Zohar 
Cc: linux-integr...@vger.kernel.org
Cc: keyri...@vger.kernel.org
Cc: Paolo Bonzini 
Cc: k...@vger.kernel.org
Cc: Andrew Morton 


 Documentation/admin-guide/mm/numaperf.rst |2 +-
 Documentation/block/pr.rst|2 +-
 Documentation/core-api/printk-basics.rst  |2 +-
 Documentation/dev-tools/kgdb.rst  |2 +-
 Documentation/fpga/dfl.rst|2 +-
 Documentation/gpu/drm-uapi.rst|2 +-
 Documentation/gpu/komeda-kms.rst  |2 +-
 Documentation/hid/intel-ish-hid.rst   |2 +-
 Documentation/i2c/upgrading-clients.rst   |2 +-
 Documentation/kbuild/kconfig-language.rst |2 +-
 Documentation/leds/ledtrig-transient.rst  |2 +-
 Documentation/maintainer/maintainer-entry-profile.rst |2 +-
 Documentation/mips/ingenic-tcu.rst|2 +-
 Documentation/misc-devices/xilinx_sdfec.rst   |2 +-
 Documentation/powerpc/vas-api.rst |2 +-
 Documentation/s390/vfio-ap.rst|2 +-
 Documentation/scsi/advansys.rst   |2 +-
 Documentation/security/keys/trusted-encrypted.rst |2 +-
 Documentation/virt/kvm/api.rst|2 +-
 Documentation/vm/memory-model.rst |2 +-
 20 files changed, 20 insertions(+), 20 deletions(-)


[PATCH 01/20] Documentation: numaperf: eliminate duplicated word

2020-07-07 Thread Randy Dunlap
Drop the duplicated word "not".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: linux...@vger.kernel.org
Cc: Mike Rapoport 
---
 Documentation/admin-guide/mm/numaperf.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-5.8-rc3.orig/Documentation/admin-guide/mm/numaperf.rst
+++ linux-5.8-rc3/Documentation/admin-guide/mm/numaperf.rst
@@ -129,7 +129,7 @@ will create the following directory::
 
/sys/devices/system/node/nodeX/memory_side_cache/
 
-If that directory is not present, the system either does not not provide
+If that directory is not present, the system either does not provide
 a memory-side cache, or that information is not accessible to the kernel.
 
 The attributes for each level of cache is provided under its cache


[PATCH 04/20] Documentation: kgdb: eliminate duplicated word

2020-07-07 Thread Randy Dunlap
Drop the doubled word "driver".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: Jason Wessel 
Cc: Daniel Thompson 
Cc: Douglas Anderson 
Cc: kgdb-bugrep...@lists.sourceforge.net
---
 Documentation/dev-tools/kgdb.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200701.orig/Documentation/dev-tools/kgdb.rst
+++ linux-next-20200701/Documentation/dev-tools/kgdb.rst
@@ -872,7 +872,7 @@ The kgdboc driver contains logic to conf
 attached keyboard. The keyboard infrastructure is only compiled into the
 kernel when ``CONFIG_KDB_KEYBOARD=y`` is set in the kernel configuration.
 
-The core polled keyboard driver driver for PS/2 type keyboards is in
+The core polled keyboard driver for PS/2 type keyboards is in
 ``drivers/char/kdb_keyboard.c``. This driver is hooked into the debug core
 when kgdboc populates the callback in the array called
 :c:type:`kdb_poll_funcs[]`. The :c:func:`kdb_get_kbd_char` is the top-level


[PATCH 05/20] Documentation: fpga: eliminate duplicated word

2020-07-07 Thread Randy Dunlap
Drop the doubled word "this".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: Wu Hao 
Cc: linux-f...@vger.kernel.org
---
 Documentation/fpga/dfl.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200701.orig/Documentation/fpga/dfl.rst
+++ linux-next-20200701/Documentation/fpga/dfl.rst
@@ -8,7 +8,7 @@ Authors:
 - Xiao Guangrong 
 - Wu Hao 
 
-The Device Feature List (DFL) FPGA framework (and drivers according to this
+The Device Feature List (DFL) FPGA framework (and drivers according to
 this framework) hides the very details of low layer hardwares and provides
 unified interfaces to userspace. Applications could use these interfaces to
 configure, enumerate, open and access FPGA accelerators on platforms which


[PATCH 06/20] Documentation: gpu/komeda-kms: eliminate duplicated word

2020-07-07 Thread Randy Dunlap
Drop the doubled word "and".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: James (Qian) Wang 
Cc: Liviu Dudau 
Cc: Mihail Atanassov 
Cc: Mali DP Maintainers 
---
 Documentation/gpu/komeda-kms.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200701.orig/Documentation/gpu/komeda-kms.rst
+++ linux-next-20200701/Documentation/gpu/komeda-kms.rst
@@ -41,7 +41,7 @@ Compositor blends multiple layers or pix
 frame. its output frame can be fed into post image processor for showing it on
 the monitor or fed into wb_layer and written to memory at the same time.
 user can also insert a scaler between compositor and wb_layer to down scale
-the display frame first and and then write to memory.
+the display frame first and then write to memory.
 
 Writeback Layer (wb_layer)
 --


[PATCH 03/20] Documentation: printk-basics: eliminate duplicated word

2020-07-07 Thread Randy Dunlap
Drop the doubled word "the".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
---
 Documentation/core-api/printk-basics.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200701.orig/Documentation/core-api/printk-basics.rst
+++ linux-next-20200701/Documentation/core-api/printk-basics.rst
@@ -69,7 +69,7 @@ You can check the current *console_logle
 The result shows the *current*, *default*, *minimum* and *boot-time-default* 
log
 levels.
 
-To change the current console_loglevel simply write the the desired level to
+To change the current console_loglevel simply write the desired level to
 ``/proc/sys/kernel/printk``. For example, to print all messages to the 
console::
 
   # echo 8 > /proc/sys/kernel/printk


[PATCH 07/20] Documentation: gpu/drm-uapi: eliminate duplicated word

2020-07-07 Thread Randy Dunlap
Drop the doubled word "when".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-de...@lists.freedesktop.org
---
 Documentation/gpu/drm-uapi.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200701.orig/Documentation/gpu/drm-uapi.rst
+++ linux-next-20200701/Documentation/gpu/drm-uapi.rst
@@ -195,7 +195,7 @@ ENOSPC:
 EPERM/EACCES:
 Returned for an operation that is valid, but needs more privileges.
 E.g. root-only or much more common, DRM master-only operations return
-this when when called by unpriviledged clients. There's no clear
+this when called by unpriviledged clients. There's no clear
 difference between EACCES and EPERM.
 
 ENODEV:


[PATCH 09/20] Documentation: i2c: eliminate duplicated word

2020-07-07 Thread Randy Dunlap
Drop doubled word "new".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: Wolfram Sang 
Cc: linux-...@vger.kernel.org
---
 Documentation/i2c/upgrading-clients.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200701.orig/Documentation/i2c/upgrading-clients.rst
+++ linux-next-20200701/Documentation/i2c/upgrading-clients.rst
@@ -8,7 +8,7 @@ Introduction
 
 
 This guide outlines how to alter existing Linux 2.6 client drivers from
-the old to the new new binding methods.
+the old to the new binding methods.
 
 
 Example old-style driver


[PATCH 08/20] Documentation: hid/intel-ish-hid: eliminate duplicated word

2020-07-07 Thread Randy Dunlap
Drop the doubled word "the".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: Srinivas Pandruvada 
Cc: Jiri Kosina 
Cc: linux-in...@vger.kernel.org
---
 Documentation/hid/intel-ish-hid.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200701.orig/Documentation/hid/intel-ish-hid.rst
+++ linux-next-20200701/Documentation/hid/intel-ish-hid.rst
@@ -235,7 +235,7 @@ There can be multiple sensor clients and
 
 To ease in implantation and allow independent driver handle each client
 this transport layer takes advantage of Linux Bus driver model. Each
-client is registered as device on the the transport bus (ishtp bus).
+client is registered as device on the transport bus (ishtp bus).
 
 Enumeration sequence of messages:
 


[PATCH 10/20] Documentation: kbuild/kconfig-language: eliminate duplicated word

2020-07-07 Thread Randy Dunlap
Drop the doubled word "the".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: Masahiro Yamada 
Cc: Michal Marek 
Cc: linux-kbu...@vger.kernel.org
---
 Documentation/kbuild/kconfig-language.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200701.orig/Documentation/kbuild/kconfig-language.rst
+++ linux-next-20200701/Documentation/kbuild/kconfig-language.rst
@@ -681,7 +681,7 @@ translate Kconfig logic into boolean for
 find dead code / features (always inactive), 114 dead features were found in
 Linux using this methodology [1]_ (Section 8: Threats to validity).
 
-Confirming this could prove useful as Kconfig stands as one of the the leading
+Confirming this could prove useful as Kconfig stands as one of the leading
 industrial variability modeling languages [1]_ [2]_. Its study would help
 evaluate practical uses of such languages, their use was only theoretical
 and real world requirements were not well understood. As it stands though


[PATCH 11/20] Documentation: leds/ledtrig-transient: eliminate duplicated word

2020-07-07 Thread Randy Dunlap
Drop the doubled word "for".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: Jacek Anaszewski 
Cc: Pavel Machek 
Cc: Dan Murphy 
Cc: linux-l...@vger.kernel.org
---
 Documentation/leds/ledtrig-transient.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200701.orig/Documentation/leds/ledtrig-transient.rst
+++ linux-next-20200701/Documentation/leds/ledtrig-transient.rst
@@ -157,7 +157,7 @@ repeat the following step as needed::
echo 1 > activate - start timer = duration to run once
echo none > trigger
 
-This trigger is intended to be used for for the following example use cases:
+This trigger is intended to be used for the following example use cases:
 
  - Control of vibrate (phones, tablets etc.) hardware by user space app.
  - Use of LED by user space app as activity indicator.


[PATCH 12/20] Documentation: maintainer-entry-profile: eliminate duplicated word

2020-07-07 Thread Randy Dunlap
Drop the doubled word "have".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: Dan Williams 
---
 Documentation/maintainer/maintainer-entry-profile.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 
linux-next-20200701.orig/Documentation/maintainer/maintainer-entry-profile.rst
+++ linux-next-20200701/Documentation/maintainer/maintainer-entry-profile.rst
@@ -31,7 +31,7 @@ Example questions to consider:
 - What branch should contributors submit against?
 - Links to any other Maintainer Entry Profiles? For example a
   device-driver may point to an entry for its parent subsystem. This makes
-  the contributor aware of obligations a maintainer may have have for
+  the contributor aware of obligations a maintainer may have for
   other maintainers in the submission chain.
 
 


[PATCH 13/20] Documentation: mips/ingenic-tcu: eliminate duplicated word

2020-07-07 Thread Randy Dunlap
Drop the doubled word "to".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: Paul Cercueil 
Cc: Thomas Bogendoerfer 
Cc: linux-m...@vger.kernel.org
---
 Documentation/mips/ingenic-tcu.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200701.orig/Documentation/mips/ingenic-tcu.rst
+++ linux-next-20200701/Documentation/mips/ingenic-tcu.rst
@@ -5,7 +5,7 @@ Ingenic JZ47xx SoCs Timer/Counter Unit h
 ===
 
 The Timer/Counter Unit (TCU) in Ingenic JZ47xx SoCs is a multi-function
-hardware block. It features up to to eight channels, that can be used as
+hardware block. It features up to eight channels, that can be used as
 counters, timers, or PWM.
 
 - JZ4725B, JZ4750, JZ4755 only have six TCU channels. The other SoCs all


[PATCH 14/20] Documentation: misc/xilinx_sdfec: eliminate duplicated word

2020-07-07 Thread Randy Dunlap
Drop the doubled word "the".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: Derek Kiernan 
Cc: Dragan Cvetic 
---
 Documentation/misc-devices/xilinx_sdfec.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200701.orig/Documentation/misc-devices/xilinx_sdfec.rst
+++ linux-next-20200701/Documentation/misc-devices/xilinx_sdfec.rst
@@ -78,7 +78,7 @@ application interfaces:
   - open: Implements restriction that only a single file descriptor can be 
open per SD-FEC instance at any time
   - release: Allows another file descriptor to be open, that is after current 
file descriptor is closed
   - poll: Provides a method to monitor for SD-FEC Error events
-  - unlocked_ioctl: Provides the the following ioctl commands that allows the 
application configure the SD-FEC core:
+  - unlocked_ioctl: Provides the following ioctl commands that allows the 
application configure the SD-FEC core:
 
- :c:macro:`XSDFEC_START_DEV`
- :c:macro:`XSDFEC_STOP_DEV`


[PATCH 15/20] Documentation: powerpc/vas-api: eliminate duplicated word

2020-07-07 Thread Randy Dunlap
Drop the doubled word "the".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: Michael Ellerman 
Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: linuxppc-dev@lists.ozlabs.org
---
 Documentation/powerpc/vas-api.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200701.orig/Documentation/powerpc/vas-api.rst
+++ linux-next-20200701/Documentation/powerpc/vas-api.rst
@@ -43,7 +43,7 @@ engine for this process. Once a connecti
 should use the mmap() system call to map the hardware address of engine's
 request queue into the application's virtual address space.
 
-The application can then submit one or more requests to the the engine by
+The application can then submit one or more requests to the engine by
 using copy/paste instructions and pasting the CRBs to the virtual address
 (aka paste_address) returned by mmap(). User space can close the
 established connection or send window by closing the file descriptior


[PATCH 16/20] Documentation: s390/vfio-ap: eliminate duplicated word

2020-07-07 Thread Randy Dunlap
Drop the doubled word "the".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: Tony Krowiak 
Cc: Pierre Morel 
Cc: Halil Pasic 
Cc: linux-s...@vger.kernel.org
---
 Documentation/s390/vfio-ap.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200701.orig/Documentation/s390/vfio-ap.rst
+++ linux-next-20200701/Documentation/s390/vfio-ap.rst
@@ -361,7 +361,7 @@ matrix device.
 assign_domain / unassign_domain:
   Write-only attributes for assigning/unassigning an AP usage domain 
to/from
   the mediated matrix device. To assign/unassign a domain, the domain
-  number of the the usage domain is echoed to the respective attribute
+  number of the usage domain is echoed to the respective attribute
   file.
 matrix:
   A read-only file for displaying the APQNs derived from the cross product


[PATCH 17/20] Documentation: scsi/advansys: eliminate duplicated word

2020-07-07 Thread Randy Dunlap
Drop the doubled word "be".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: Matthew Wilcox 
Cc: Hannes Reinecke 
Cc: linux-s...@vger.kernel.org
Cc: "James E.J. Bottomley" 
Cc: "Martin K. Petersen" 
---
 Documentation/scsi/advansys.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200701.orig/Documentation/scsi/advansys.rst
+++ linux-next-20200701/Documentation/scsi/advansys.rst
@@ -125,7 +125,7 @@ The following constants can be defined i
c. klogd is started with the appropriate -c parameter
   (e.g. klogd -c 8)
 
-   This will cause printk() messages to be be displayed on the
+   This will cause printk() messages to be displayed on the
current console. Refer to the klogd(8) and syslogd(8) man pages
for details.
 


[PATCH 18/20] Documentation: security/keys: eliminate duplicated word

2020-07-07 Thread Randy Dunlap
Drop the doubled word "in".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: James Bottomley 
Cc: Jarkko Sakkinen 
Cc: Mimi Zohar 
Cc: linux-integr...@vger.kernel.org
Cc: keyri...@vger.kernel.org
---
 Documentation/security/keys/trusted-encrypted.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200701.orig/Documentation/security/keys/trusted-encrypted.rst
+++ linux-next-20200701/Documentation/security/keys/trusted-encrypted.rst
@@ -200,7 +200,7 @@ Load an encrypted key "evm" from saved b
 24717c64 5972dcb82ab2dde83376d82b2e3c09ffc
 
 Other uses for trusted and encrypted keys, such as for disk and file encryption
-are anticipated.  In particular the new format 'ecryptfs' has been defined in
+are anticipated.  In particular the new format 'ecryptfs' has been defined
 in order to use encrypted keys to mount an eCryptfs filesystem.  More details
 about the usage can be found in the file
 ``Documentation/security/keys/ecryptfs.rst``.


[PATCH 19/20] Documentation: virt/kvm/api: eliminate duplicated word

2020-07-07 Thread Randy Dunlap
Drop the duplicated word "struct".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: Paolo Bonzini 
Cc: k...@vger.kernel.org
---
 Documentation/virt/kvm/api.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-5.8-rc3.orig/Documentation/virt/kvm/api.rst
+++ linux-5.8-rc3/Documentation/virt/kvm/api.rst
@@ -3147,7 +3147,7 @@ Possible features:
 :Capability: basic
 :Architectures: arm, arm64
 :Type: vm ioctl
-:Parameters: struct struct kvm_vcpu_init (out)
+:Parameters: struct kvm_vcpu_init (out)
 :Returns: 0 on success; -1 on error
 
 Errors:


Re: [PATCH 12/20] Documentation: maintainer-entry-profile: eliminate duplicated word

2020-07-07 Thread Dan Williams
On Tue, Jul 7, 2020 at 11:07 AM Randy Dunlap  wrote:
>
> Drop the doubled word "have".
>
> Signed-off-by: Randy Dunlap 
> Cc: Jonathan Corbet 
> Cc: linux-...@vger.kernel.org
> Cc: Dan Williams 
> ---
>  Documentation/maintainer/maintainer-entry-profile.rst |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- 
> linux-next-20200701.orig/Documentation/maintainer/maintainer-entry-profile.rst
> +++ linux-next-20200701/Documentation/maintainer/maintainer-entry-profile.rst
> @@ -31,7 +31,7 @@ Example questions to consider:
>  - What branch should contributors submit against?
>  - Links to any other Maintainer Entry Profiles? For example a
>device-driver may point to an entry for its parent subsystem. This makes
> -  the contributor aware of obligations a maintainer may have have for
> +  the contributor aware of obligations a maintainer may have for
>other maintainers in the submission chain.

Acked-by Dan Williams 


Re: [PATCH 04/20] Documentation: kgdb: eliminate duplicated word

2020-07-07 Thread Doug Anderson
Hi,

On Tue, Jul 7, 2020 at 11:05 AM Randy Dunlap  wrote:
>
> Drop the doubled word "driver".
>
> Signed-off-by: Randy Dunlap 
> Cc: Jonathan Corbet 
> Cc: linux-...@vger.kernel.org
> Cc: Jason Wessel 
> Cc: Daniel Thompson 
> Cc: Douglas Anderson 
> Cc: kgdb-bugrep...@lists.sourceforge.net
> ---
>  Documentation/dev-tools/kgdb.rst |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Douglas Anderson 


[PATCH] powerpc/signal64: Don't opencode page prefaulting

2020-07-07 Thread Christophe Leroy
Instead of doing a __get_user() from the first and last location
into a tmp var which won't be used, use fault_in_pages_readable()

Signed-off-by: Christophe Leroy 
---
 arch/powerpc/kernel/signal_64.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index 55e5f76554da..c451c47538e1 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -632,7 +633,6 @@ static long setup_trampoline(unsigned int syscall, unsigned 
int __user *tramp)
 SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx,
struct ucontext __user *, new_ctx, long, ctx_size)
 {
-   unsigned char tmp;
sigset_t set;
unsigned long new_msr = 0;
int ctx_has_vsx_region = 0;
@@ -667,9 +667,8 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, 
old_ctx,
}
if (new_ctx == NULL)
return 0;
-   if (!access_ok(new_ctx, ctx_size)
-   || __get_user(tmp, (u8 __user *) new_ctx)
-   || __get_user(tmp, (u8 __user *) new_ctx + ctx_size - 1))
+   if (!access_ok(new_ctx, ctx_size) ||
+   fault_in_pages_readable((u8 __user *)new_ctx, ctx_size))
return -EFAULT;
 
/*
-- 
2.25.0



Re: [PATCH v2] powerpc/uaccess: Use flexible addressing with __put_user()/__get_user()

2020-07-07 Thread Christophe Leroy




Le 07/07/2020 à 14:44, Christophe Leroy a écrit :



Le 30/06/2020 à 03:19, Michael Ellerman a écrit :

Michael Ellerman  writes:

Christophe Leroy  writes:

Hi Michael,

I see this patch is marked as "defered" in patchwork, but I can't see
any related discussion. Is it normal ?


Because it uses the "m<>" constraint which didn't work on GCC 4.6.

https://github.com/linuxppc/issues/issues/297

So we should be able to pick it up for v5.9 hopefully.


It seems to break the build with the kernel.org 4.9.4 compiler and
corenet64_smp_defconfig:


Most likely a GCC bug ?

It seems the problem vanishes with patch 
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/173de3b659fa3a5f126a0eb170522cccd909950f.1594125164.git.christophe.le...@csgroup.eu/ 



Same kind of issue in signal_64.c now.

The following patch fixes it: 
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/810bd8840ef990a200f58c9dea9abe767ca02a3a.1594146723.git.christophe.le...@csgroup.eu/


Christophe


Re: [PATCH 10/10] dt-bindings: mtd: fsl-upm-nand: Deprecate chip-delay and fsl, upm-wait-flags

2020-07-07 Thread Miquel Raynal
On Wed, 2020-06-03 at 13:49:22 UTC, Boris Brezillon wrote:
> Those properties are no longer parsed by the driver which is being passed
> those information by the core now. Let's deprecate them.
> 
> Signed-off-by: Boris Brezillon 

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git 
nand/next, thanks.

Miquel


Failure to build librseq on ppc

2020-07-07 Thread Mathieu Desnoyers
Hi Boqun,

I'm trying to build librseq at:

https://git.kernel.org/pub/scm/libs/librseq/librseq.git

on powerpc, and I get these errors when building the rseq basic
test mirrored from the kernel selftests code:

/tmp/ccieEWxU.s: Assembler messages:
/tmp/ccieEWxU.s:118: Error: syntax error; found `,', expected `('
/tmp/ccieEWxU.s:118: Error: junk at end of line: `,8'
/tmp/ccieEWxU.s:121: Error: syntax error; found `,', expected `('
/tmp/ccieEWxU.s:121: Error: junk at end of line: `,8'
/tmp/ccieEWxU.s:626: Error: syntax error; found `,', expected `('
/tmp/ccieEWxU.s:626: Error: junk at end of line: `,8'
/tmp/ccieEWxU.s:629: Error: syntax error; found `,', expected `('
/tmp/ccieEWxU.s:629: Error: junk at end of line: `,8'
/tmp/ccieEWxU.s:735: Error: syntax error; found `,', expected `('
/tmp/ccieEWxU.s:735: Error: junk at end of line: `,8'
/tmp/ccieEWxU.s:738: Error: syntax error; found `,', expected `('
/tmp/ccieEWxU.s:738: Error: junk at end of line: `,8'
/tmp/ccieEWxU.s:741: Error: syntax error; found `,', expected `('
/tmp/ccieEWxU.s:741: Error: junk at end of line: `,8'
Makefile:581: recipe for target 'basic_percpu_ops_test.o' failed

I am using this compiler:

gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12)
Target: powerpc-linux-gnu

So far, I got things to build by changing "m" operands to "Q" operands.
Based on 
https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html#Machine-Constraints
it seems that "Q" means "A memory operand addressed by just a base register."
I suspect that lwz and stw don't expect some kind of immediate offset which
can be kept with "m", and "Q" fixes this. Is that the right fix ?

And should we change all operands passed to lwz and stw to a "Q" operand ?

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com


Re: [PATCH 20/20] Documentation: vm/memory-model: eliminate duplicated word

2020-07-07 Thread Mike Rapoport
On Tue, Jul 07, 2020 at 11:04:13AM -0700, Randy Dunlap wrote:
> Drop the doubled word "the".
> 
> Signed-off-by: Randy Dunlap 
> Cc: Jonathan Corbet 
> Cc: linux-...@vger.kernel.org
> Cc: Andrew Morton 
> Cc: linux...@kvack.org

Reviewed-by: Mike Rapoport 

> ---
>  Documentation/vm/memory-model.rst |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- linux-next-20200701.orig/Documentation/vm/memory-model.rst
> +++ linux-next-20200701/Documentation/vm/memory-model.rst
> @@ -159,7 +159,7 @@ frame. Inside a section, the PFN is the
>  The sparse vmemmap uses a virtually mapped memory map to optimize
>  pfn_to_page and page_to_pfn operations. There is a global `struct
>  page *vmemmap` pointer that points to a virtually contiguous array of
> -`struct page` objects. A PFN is an index to that array and the the
> +`struct page` objects. A PFN is an index to that array and the
>  offset of the `struct page` from `vmemmap` is the PFN of that
>  page.
>  

-- 
Sincerely yours,
Mike.


Re: [PATCH v2 1/2] kbuild: introduce ccflags-remove-y and asflags-remove-y

2020-07-07 Thread Anders Roxell
On Tue, 7 Jul 2020 at 11:21, Masahiro Yamada  wrote:
>
> CFLAGS_REMOVE_.o filters out flags when compiling a particular
> object, but there is no convenient way to do that for every object in
> a directory.
>
> Add ccflags-remove-y and asflags-remove-y to make it easily.
>
> Use ccflags-remove-y to clean up some Makefiles.
>
> The add/remove order works as follows:
>
>  [1] KBUILD_CFLAGS specifies compiler flags used globally
>
>  [2] ccflags-y adds compiler flags for all objects in the
>  current Makefile
>
>  [3] ccflags-remove-y removes compiler flags for all objects in the
>  current Makefile (New feature)
>
>  [4] CFLAGS_ adds compiler flags per file.
>
>  [5] CFLAGS_REMOVE_ removes compiler flags per file.
>
> Having [3] before [4] allows us to remove flags from most (but not all)
> objects in the current Makefile.
>
> For example, kernel/trace/Makefile removes $(CC_FLAGS_FTRACE)
> from all objects in the directory, then adds it back to
> trace_selftest_dynamic.o and CFLAGS_trace_kprobe_selftest.o
>
> Please note ccflags-remove-y has no effect to the sub-directories.
> In contrast, the previous notation got rid of compiler flags also from
> all the sub-directories.
>
>   arch/arm/boot/compressed/
>   arch/powerpc/xmon/
>   arch/sh/
>   kernel/trace/
>
> ... have no sub-directories.
>
>   lib/
>
> ... has several sub-directories.
>
> To keep the behavior, I added ccflags-remove-y to all Makefiles
> in subdirectories of lib/, except:
>
>   lib/vdso/Makefile- Kbuild does not descend into this Makefile
>   lib/raid/test/Makefile   - This is not used for the kernel build
>
> I think commit 2464a609ded0 ("ftrace: do not trace library functions")
> excluded too much. In later commit, I will try to remove ccflags-remove-y
> from sub-directory Makefiles.
>
> Suggested-by: Sami Tolvanen 
> Signed-off-by: Masahiro Yamada 
> Acked-by: Steven Rostedt (VMware) 
> Acked-by: Michael Ellerman  (powerpc)

Tested-by: Anders Roxell 

> ---
>
> Changes in v2:
>   - Swap the order of [3] and [4] to keep the current behavior of
> kernel/trace/Makefile.
>   - Add ccflags-remove-y to subdir Makefiles of lib/
>
>  Documentation/kbuild/makefiles.rst | 14 ++
>  arch/arm/boot/compressed/Makefile  |  6 +-
>  arch/powerpc/xmon/Makefile |  3 +--
>  arch/sh/boot/compressed/Makefile   |  5 +
>  kernel/trace/Makefile  |  4 ++--
>  lib/842/Makefile   |  3 +++
>  lib/Makefile   |  5 +
>  lib/crypto/Makefile|  2 ++
>  lib/dim/Makefile   |  2 ++
>  lib/fonts/Makefile |  2 ++
>  lib/kunit/Makefile |  3 +++
>  lib/livepatch/Makefile |  2 ++
>  lib/lz4/Makefile   |  1 +
>  lib/lzo/Makefile   |  2 ++
>  lib/math/Makefile  |  2 ++
>  lib/mpi/Makefile   |  2 ++
>  lib/raid6/Makefile |  3 +++
>  lib/reed_solomon/Makefile  |  2 ++
>  lib/xz/Makefile|  3 +++
>  lib/zlib_deflate/Makefile  |  2 ++
>  lib/zlib_dfltcc/Makefile   |  2 ++
>  lib/zlib_inflate/Makefile  |  2 ++
>  lib/zstd/Makefile  |  1 +
>  scripts/Makefile.lib   | 14 --
>  24 files changed, 64 insertions(+), 23 deletions(-)
>
> diff --git a/Documentation/kbuild/makefiles.rst 
> b/Documentation/kbuild/makefiles.rst
> index 6515ebc12b6f..14d8e7d23c04 100644
> --- a/Documentation/kbuild/makefiles.rst
> +++ b/Documentation/kbuild/makefiles.rst
> @@ -368,6 +368,14 @@ more details, with real examples.
>
> subdir-ccflags-y := -Werror
>
> +ccflags-remove-y, asflags-remove-y
> +   These flags are used to remove particular flags for the compiler,
> +   assembler invocations.
> +
> +   Example::
> +
> +   ccflags-remove-$(CONFIG_MCOUNT) += -pg
> +
>  CFLAGS_$@, AFLAGS_$@
> CFLAGS_$@ and AFLAGS_$@ only apply to commands in current
> kbuild makefile.
> @@ -375,6 +383,9 @@ more details, with real examples.
> $(CFLAGS_$@) specifies per-file options for $(CC).  The $@
> part has a literal value which specifies the file that it is for.
>
> +   CFLAGS_$@ has the higher priority than ccflags-remove-y; CFLAGS_$@
> +   can re-add compiler flags that were removed by ccflags-remove-y.
> +
> Example::
>
> # drivers/scsi/Makefile
> @@ -387,6 +398,9 @@ more details, with real examples.
> $(AFLAGS_$@) is a similar feature for source files in assembly
> languages.
>
> +   AFLAGS_$@ has the higher priority than asflags-remove-y; AFLAGS_$@
> +   can re-add assembler flags that were removed by asflags-remove-y.
> +
> Example::
>
> # arch/arm/kernel/Makefile
> diff --git a/arch/arm/boot/compressed/Makefile 
> b/arch/arm/boot/compressed/Makefile
> index 00602a6fba04..3d5691b23951 100644
> --- a/arch/arm/boot/compressed/

[PATCH v5 16/25] mm/powerpc: Use general page fault accounting

2020-07-07 Thread Peter Xu
Use the general page fault accounting by passing regs into handle_mm_fault().

CC: Michael Ellerman 
CC: Benjamin Herrenschmidt 
CC: Paul Mackerras 
CC: linuxppc-dev@lists.ozlabs.org
Acked-by: Michael Ellerman 
Signed-off-by: Peter Xu 
---
 arch/powerpc/mm/fault.c | 11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 25dee001d8e1..00259e9b452d 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -607,7 +607,7 @@ static int __do_page_fault(struct pt_regs *regs, unsigned 
long address,
 * make sure we exit gracefully rather than endlessly redo
 * the fault.
 */
-   fault = handle_mm_fault(vma, address, flags, NULL);
+   fault = handle_mm_fault(vma, address, flags, regs);
 
major |= fault & VM_FAULT_MAJOR;
 
@@ -633,14 +633,9 @@ static int __do_page_fault(struct pt_regs *regs, unsigned 
long address,
/*
 * Major/minor page fault accounting.
 */
-   if (major) {
-   current->maj_flt++;
-   perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, address);
+   if (major)
cmo_account_page_fault();
-   } else {
-   current->min_flt++;
-   perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, address);
-   }
+
return 0;
 }
 NOKPROBE_SYMBOL(__do_page_fault);
-- 
2.26.2



[PATCH 0/13] PCI: Remove '*val = 0' from pcie_capability_read_*()

2020-07-07 Thread Saheed Olayemi Bolarinwa
From: Bolarinwa Olayemi Saheed 

MERGING:
Only Patch 13/13 depend on all preceeding patchs. All other patches are
independent of one another. Hence, please merge PATCH 13/13 only after
other patches in this series have been merged.

PATCH 6/13:
Make the function set status to "Power On" by default and only set to
Set "Power Off" only if pcie_capability_read_word() is successful and
(slot_ctrl & PCI_EXP_SLTCTL_PCC) == PCI_EXP_SLTCTL_PWR_OFF. 

PATCH 1/13 to 12/13:
Check the return value of pcie_capability_read_*() to ensure success or
confirm failure. While maintaining these functions, this ensures that the
changes in PATCH 13/13 does not introduce any bug. 

PATCH 13/13:
There are several reasons why a PCI capability read may fail whether the
device is present or not. If this happens, pcie_capability_read_*() will
return -EINVAL/PCIBIOS_BAD_REGISTER_NUMBER or PCIBIOS_DEVICE_NOT_FOUND
and *val is set to 0.

This behaviour if further ensured by this code inside
pcie_capability_read_*()

 ret = pci_read_config_dword(dev, pci_pcie_cap(dev) + pos, val);
 /*
  * Reset *val to 0 if pci_read_config_dword() fails, it may
  * have been written as 0x if hardware error happens
  * during pci_read_config_dword().
  */
 if (ret)
 *val = 0;
 return ret;

a) Since all pci_generic_config_read() does is read a register value,
it may return success after reading a ~0 which *may* have been fabricated
by the PCI host bridge due to a read timeout. Hence pci_read_config_*() 
will return success with a fabricated ~0 in *val, indicating a problem.
In this case, the assumed behaviour of  pcie_capability_read_*() will be
wrong. To avoid error slipping through, more checks are necessary.

b) pci_read_config_*() will return PCIBIOS_DEVICE_NOT_FOUND only if 
dev->error_state = pci_channel_io_perm_failure (i.e. 
pci_dev_is_disconnected()) or if pci_generic_config_read() can't find the
device. In both cases *val is initially set to ~0 but as shown in the code
above pcie_capability_read_*() resets it back to 0. Even with this effort,
drivers still have to perform validation checks more so if 0 is a valid
value.

Most drivers only consider the case (b) and in some cases, there is the 
expectation that on timeout *val has a fabricated value of ~0, which *may*
not always be true as explained in (a).

In any case, checks need to be done to validate the value read and maybe
confirm which error has occurred. It is better left to the drivers to do.

Check the return value of pcie_capability_read_dword() to ensure success
and avoid bug as a result of Patch 13/13.
Remove the reset of *val to 0 when pci_read_config_*() fails.


Bolarinwa Olayemi Saheed (13):
  IB/hfi1: Check the return value of pcie_capability_read_*()
  misc: rtsx: Check the return value of pcie_capability_read_*()
  ath9k: Check the return value of pcie_capability_read_*()
  iwlegacy: Check the return value of pcie_capability_read_*()
  PCI: pciehp: Check the return value of pcie_capability_read_*()
  PCI: pciehp: Make "Power On" the default 
  PCI/ACPI: Check the return value of pcie_capability_read_*()
  PCI: pciehp: Check the return value of pcie_capability_read_*()
  PCI: Check the return value of pcie_capability_read_*()
  PCI/PM: Check return value of pcie_capability_read_*()
  PCI/AER: Check the return value of pcie_capability_read_*()
  PCI/ASPM: Check the return value of pcie_capability_read_*()
  PCI: Remove '*val = 0' from pcie_capability_read_*()

 drivers/net/wireless/ath/ath9k/pci.c | 5 +++--
 drivers/net/wireless/intel/iwlegacy/common.c | 4 ++--
 drivers/infiniband/hw/hfi1/aspm.c | 7 ---
 drivers/misc/cardreader/rts5227.c | 5 +++--
 drivers/misc/cardreader/rts5249.c | 5 +++--
 drivers/misc/cardreader/rts5260.c | 5 +++--
 drivers/misc/cardreader/rts5261.c | 5 +++--
 drivers/pci/pcie/aer.c  |  5 +++--
 drivers/pci/pcie/aspm.c | 33 +
 drivers/pci/hotplug/pciehp_hpc.c | 47 
 drivers/pci/pci-acpi.c   | 10 ---
 drivers/pci/probe.c  | 29 
 drivers/pci/access.c | 14 --
 13 files changed, 87 insertions(+), 87 deletions(-)

-- 
2.18.2



[PATCH 13/13] PCI: Remove '*val = 0' from pcie_capability_read_*()

2020-07-07 Thread Saheed Olayemi Bolarinwa
From: Bolarinwa Olayemi Saheed 

There are several reasons why a PCI capability read may fail whether the
device is present or not. If this happens, pcie_capability_read_*() will
return -EINVAL/PCIBIOS_BAD_REGISTER_NUMBER or PCIBIOS_DEVICE_NOT_FOUND
and *val is set to 0.

This behaviour if further ensured by this code inside
pcie_capability_read_*()

 ret = pci_read_config_dword(dev, pci_pcie_cap(dev) + pos, val);
 /*
  * Reset *val to 0 if pci_read_config_dword() fails, it may
  * have been written as 0x if hardware error happens
  * during pci_read_config_dword().
  */
 if (ret)
 *val = 0;
 return ret;

a) Since all pci_generic_config_read() does is read a register value,
it may return success after reading a ~0 which *may* have been fabricated
by the PCI host bridge due to a read timeout. Hence pci_read_config_*() 
will return success with a fabricated ~0 in *val, indicating a problem.
In this case, the assumed behaviour of  pcie_capability_read_*() will be
wrong. To avoid error slipping through, more checks are necessary.

b) pci_read_config_*() will return PCIBIOS_DEVICE_NOT_FOUND only if 
dev->error_state = pci_channel_io_perm_failure (i.e. 
pci_dev_is_disconnected()) or if pci_generic_config_read() can't find the
device. In both cases *val is initially set to ~0 but as shown in the code
above pcie_capability_read_*() resets it back to 0. Even with this effort,
drivers still have to perform validation checks more so if 0 is a valid
value.

Most drivers only consider the case (b) and in some cases, there is the 
expectation that on timeout *val has a fabricated value of ~0, which *may*
not always be true as explained in (a).

In any case, checks need to be done to validate the value read and maybe
confirm which error has occurred. It is better left to the drivers to do.

Remove the reset of *val to 0 when pci_read_config_*() fails.

Suggested-by: Bjorn Helgaas 
Signed-off-by: Bolarinwa Olayemi Saheed 
---
This patch  depends on all of the preceeding patches in this series,
otherwise it will introduce bugs as pointed out in the commit message
of each.
 drivers/pci/access.c | 14 --
 1 file changed, 14 deletions(-)

diff --git a/drivers/pci/access.c b/drivers/pci/access.c
index 79c4a2ef269a..ec95edbb1ac8 100644
--- a/drivers/pci/access.c
+++ b/drivers/pci/access.c
@@ -413,13 +413,6 @@ int pcie_capability_read_word(struct pci_dev *dev, int 
pos, u16 *val)
 
if (pcie_capability_reg_implemented(dev, pos)) {
ret = pci_read_config_word(dev, pci_pcie_cap(dev) + pos, val);
-   /*
-* Reset *val to 0 if pci_read_config_word() fails, it may
-* have been written as 0x if hardware error happens
-* during pci_read_config_word().
-*/
-   if (ret)
-   *val = 0;
return ret;
}
 
@@ -448,13 +441,6 @@ int pcie_capability_read_dword(struct pci_dev *dev, int 
pos, u32 *val)
 
if (pcie_capability_reg_implemented(dev, pos)) {
ret = pci_read_config_dword(dev, pci_pcie_cap(dev) + pos, val);
-   /*
-* Reset *val to 0 if pci_read_config_dword() fails, it may
-* have been written as 0x if hardware error happens
-* during pci_read_config_dword().
-*/
-   if (ret)
-   *val = 0;
return ret;
}
 
-- 
2.18.2



[PATCH 20/20] Documentation: vm/memory-model: eliminate duplicated word

2020-07-07 Thread Randy Dunlap
Drop the doubled word "the".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: Andrew Morton 
Cc: linux...@kvack.org
---
 Documentation/vm/memory-model.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200701.orig/Documentation/vm/memory-model.rst
+++ linux-next-20200701/Documentation/vm/memory-model.rst
@@ -159,7 +159,7 @@ frame. Inside a section, the PFN is the
 The sparse vmemmap uses a virtually mapped memory map to optimize
 pfn_to_page and page_to_pfn operations. There is a global `struct
 page *vmemmap` pointer that points to a virtually contiguous array of
-`struct page` objects. A PFN is an index to that array and the the
+`struct page` objects. A PFN is an index to that array and the
 offset of the `struct page` from `vmemmap` is the PFN of that
 page.
 


Re: FSL P5020/P5040: DPAA Ethernet issue with the latest Git kernel

2020-07-07 Thread Christian Zigotzky

> On 7. Jul 2020, at 17:53, Madalin Bucur (OSS)  
> wrote:
> 
> Was DPAA functional before commit A?
> How about after commit A and before commit B?

The DPAA Ethernet works from  the kernel 5.6-rc4 [1] till the Git kernel from 
the 11 of June [2]. It doesn’t work since the commit “fix bitmap_parse” [3].

[1] https://forum.hyperion-entertainment.com/viewtopic.php?p=49936#p49936
[2] https://forum.hyperion-entertainment.com/viewtopic.php?p=50848#p50848
[3] https://forum.hyperion-entertainment.com/viewtopic.php?p=50980#p50980



Re: [PATCH 13/20] Documentation: mips/ingenic-tcu: eliminate duplicated word

2020-07-07 Thread Paul Cercueil

Hi,

Le mar. 7 juil. 2020 à 11:04, Randy Dunlap  a 
écrit :

Drop the doubled word "to".

Signed-off-by: Randy Dunlap 
Cc: Jonathan Corbet 
Cc: linux-...@vger.kernel.org
Cc: Paul Cercueil 
Cc: Thomas Bogendoerfer 
Cc: linux-m...@vger.kernel.org


Reviewed-by: Paul Cercueil 

Cheers,
-Paul


---
 Documentation/mips/ingenic-tcu.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200701.orig/Documentation/mips/ingenic-tcu.rst
+++ linux-next-20200701/Documentation/mips/ingenic-tcu.rst
@@ -5,7 +5,7 @@ Ingenic JZ47xx SoCs Timer/Counter Unit h
 ===

 The Timer/Counter Unit (TCU) in Ingenic JZ47xx SoCs is a 
multi-function
-hardware block. It features up to to eight channels, that can be 
used as

+hardware block. It features up to eight channels, that can be used as
 counters, timers, or PWM.

 - JZ4725B, JZ4750, JZ4755 only have six TCU channels. The other SoCs 
all





Re: [PATCH] pci: pcie: AER: Fix logging of Correctable errors

2020-07-07 Thread Bjorn Helgaas
On Fri, Jun 19, 2020 at 01:55:11AM +1000, Matt Jolly wrote:
> The AER documentation indicates that correctable (severity=Corrected)
> errors should be output as a warning so that users can filter these
> errors if they choose to; This functionality does not appear to have been 
> implemented.
> 
> This patch modifies the functions aer_print_error and __aer_print_error
> to send correctable errors as a warning (pci_warn), rather than as an error 
> (pci_err). It
> partially addresses several bugs in relation to kernel message buffer
> spam for misbehaving devices - the root cause (possibly device firmware?) 
> isn't
> addressed, but the dmesg output is less alarming for end users, and can
> be filtered separately from uncorrectable errors. This should hopefully
> reduce the need for users to disable AER to suppress corrected errors.
> 
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=201517
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=196183
> 
> Signed-off-by: Matt Jolly 
> ---
>  drivers/pci/pcie/aer.c | 36 ++--
>  1 file changed, 26 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
> index 3acf56683915..131ecc0df2cb 100644
> --- a/drivers/pci/pcie/aer.c
> +++ b/drivers/pci/pcie/aer.c
> @@ -662,12 +662,18 @@ static void __aer_print_error(struct pci_dev *dev,
>   errmsg = i < ARRAY_SIZE(aer_uncorrectable_error_string) 
> ?
>   aer_uncorrectable_error_string[i] : NULL;
>  
> - if (errmsg)
> - pci_err(dev, "   [%2d] %-22s%s\n", i, errmsg,
> - info->first_error == i ? " (First)" : "");
> - else
> + if (errmsg) {
> + if (info->severity == AER_CORRECTABLE) {
> + pci_warn(dev, "   [%2d] %-22s%s\n", i, errmsg,

I think we can use pci_printk() here to reduce the code duplication.

And I think we can also simplify the aer_correctable_error_string/
aer_uncorrectable_error_string stuff above, which would make this even
simpler.

I'll respond to this with my proposal.

> + info->first_error == i ? " (First)" : 
> "");
> + } else {
> + pci_err(dev, "   [%2d] %-22s%s\n", i, errmsg,
> + info->first_error == i ? " (First)" : 
> "");
> + }
> + } else {
>   pci_err(dev, "   [%2d] Unknown Error Bit%s\n",
>   i, info->first_error == i ? " (First)" : "");
> + }
>   }
>   pci_dev_aer_stats_incr(dev, info);
>  }
> @@ -686,13 +692,23 @@ void aer_print_error(struct pci_dev *dev, struct 
> aer_err_info *info)
>   layer = AER_GET_LAYER_ERROR(info->severity, info->status);
>   agent = AER_GET_AGENT(info->severity, info->status);
>  
> - pci_err(dev, "PCIe Bus Error: severity=%s, type=%s, (%s)\n",
> - aer_error_severity_string[info->severity],
> - aer_error_layer[layer], aer_agent_string[agent]);
> + if  (info->severity == AER_CORRECTABLE) {
> + pci_warn(dev, "PCIe Bus Error: severity=%s, type=%s, (%s)\n",
> + aer_error_severity_string[info->severity],
> + aer_error_layer[layer], aer_agent_string[agent]);
>  
> - pci_err(dev, "  device [%04x:%04x] error status/mask=%08x/%08x\n",
> - dev->vendor, dev->device,
> - info->status, info->mask);
> + pci_warn(dev, "  device [%04x:%04x] error 
> status/mask=%08x/%08x\n",
> + dev->vendor, dev->device,
> + info->status, info->mask);
> + } else {
> + pci_err(dev, "PCIe Bus Error: severity=%s, type=%s, (%s)\n",
> + aer_error_severity_string[info->severity],
> + aer_error_layer[layer], aer_agent_string[agent]);
> +
> + pci_err(dev, "  device [%04x:%04x] error 
> status/mask=%08x/%08x\n",
> + dev->vendor, dev->device,
> + info->status, info->mask);
> + }
>  
>   __aer_print_error(dev, info);
>  
> -- 
> 2.26.2
> 


[PATCH 1/2] PCI/AER: Simplify __aer_print_error()

2020-07-07 Thread Bjorn Helgaas
From: Bjorn Helgaas 

aer_correctable_error_string[] and aer_uncorrectable_error_string[] have
descriptions of AER error status bits.  Add NULL entries to these tables so
all entries for bits 0-31 are defined.  Then we don't have to check for
ARRAY_SIZE() when decoding a status word, which simplifies
__aer_print_error().

Signed-off-by: Bjorn Helgaas 
---
 drivers/pci/pcie/aer.c | 48 ++
 1 file changed, 34 insertions(+), 14 deletions(-)

diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
index 3acf56683915..9176c8a968b9 100644
--- a/drivers/pci/pcie/aer.c
+++ b/drivers/pci/pcie/aer.c
@@ -447,7 +447,7 @@ static const char *aer_error_layer[] = {
"Transaction Layer"
 };
 
-static const char *aer_correctable_error_string[AER_MAX_TYPEOF_COR_ERRS] = {
+static const char *aer_correctable_error_string[] = {
"RxErr",/* Bit Position 0   */
NULL,
NULL,
@@ -464,9 +464,25 @@ static const char 
*aer_correctable_error_string[AER_MAX_TYPEOF_COR_ERRS] = {
"NonFatalErr",  /* Bit Position 13  */
"CorrIntErr",   /* Bit Position 14  */
"HeaderOF", /* Bit Position 15  */
+   NULL,   /* Bit Position 16  */
+   NULL,   /* Bit Position 17  */
+   NULL,   /* Bit Position 18  */
+   NULL,   /* Bit Position 19  */
+   NULL,   /* Bit Position 20  */
+   NULL,   /* Bit Position 21  */
+   NULL,   /* Bit Position 22  */
+   NULL,   /* Bit Position 23  */
+   NULL,   /* Bit Position 24  */
+   NULL,   /* Bit Position 25  */
+   NULL,   /* Bit Position 26  */
+   NULL,   /* Bit Position 27  */
+   NULL,   /* Bit Position 28  */
+   NULL,   /* Bit Position 29  */
+   NULL,   /* Bit Position 30  */
+   NULL,   /* Bit Position 31  */
 };
 
-static const char *aer_uncorrectable_error_string[AER_MAX_TYPEOF_UNCOR_ERRS] = 
{
+static const char *aer_uncorrectable_error_string[] = {
"Undefined",/* Bit Position 0   */
NULL,
NULL,
@@ -494,6 +510,11 @@ static const char 
*aer_uncorrectable_error_string[AER_MAX_TYPEOF_UNCOR_ERRS] = {
"AtomicOpBlocked",  /* Bit Position 24  */
"TLPBlockedErr",/* Bit Position 25  */
"PoisonTLPBlocked", /* Bit Position 26  */
+   NULL,   /* Bit Position 27  */
+   NULL,   /* Bit Position 28  */
+   NULL,   /* Bit Position 29  */
+   NULL,   /* Bit Position 30  */
+   NULL,   /* Bit Position 31  */
 };
 
 static const char *aer_agent_string[] = {
@@ -650,24 +671,23 @@ static void __print_tlp_header(struct pci_dev *dev,
 static void __aer_print_error(struct pci_dev *dev,
  struct aer_err_info *info)
 {
+   const char **strings;
unsigned long status = info->status & ~info->mask;
-   const char *errmsg = NULL;
+   const char *errmsg;
int i;
 
+   if (info->severity == AER_CORRECTABLE)
+   strings = aer_correctable_error_string;
+   else
+   strings = aer_uncorrectable_error_string;
+
for_each_set_bit(i, &status, 32) {
-   if (info->severity == AER_CORRECTABLE)
-   errmsg = i < ARRAY_SIZE(aer_correctable_error_string) ?
-   aer_correctable_error_string[i] : NULL;
-   else
-   errmsg = i < ARRAY_SIZE(aer_uncorrectable_error_string) 
?
-   aer_uncorrectable_error_string[i] : NULL;
+   errmsg = strings[i];
+   if (!errmsg)
+   errmsg = "Unknown Error Bit";
 
-   if (errmsg)
-   pci_err(dev, "   [%2d] %-22s%s\n", i, errmsg,
+   pci_err(dev, "   [%2d] %-22s%s\n", i, errmsg,
info->first_error == i ? " (First)" : "");
-   else
-   pci_err(dev, "   [%2d] Unknown Error Bit%s\n",
-   i, info->first_error == i ? " (First)" : "");
}
pci_dev_aer_stats_incr(dev, info);
 }
-- 
2.25.1



[PATCH 2/2] PCI/AER: Log correctable errors as warning, not error

2020-07-07 Thread Bjorn Helgaas
From: Matt Jolly 

PCIe correctable errors are recovered by hardware with no need for software
intervention (PCIe r5.0, sec 6.2.2.1).

Reduce the log level of correctable errors from KERN_ERR to KERN_WARNING.

The bug reports below are for correctable error logging.  This doesn't fix
the cause of those reports, but it may make the messages less alarming.

[bhelgaas: commit log, use pci_printk() to avoid code duplication]
Link: https://bugzilla.kernel.org/show_bug.cgi?id=201517
Link: https://bugzilla.kernel.org/show_bug.cgi?id=196183
Link: https://lore.kernel.org/r/20200618155511.16009-1-Kangie@footclan.ninja
Signed-off-by: Matt Jolly 
Signed-off-by: Bjorn Helgaas 
---
 drivers/pci/pcie/aer.c | 25 +++--
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
index 9176c8a968b9..ca886bf91fd9 100644
--- a/drivers/pci/pcie/aer.c
+++ b/drivers/pci/pcie/aer.c
@@ -673,20 +673,23 @@ static void __aer_print_error(struct pci_dev *dev,
 {
const char **strings;
unsigned long status = info->status & ~info->mask;
-   const char *errmsg;
+   const char *level, *errmsg;
int i;
 
-   if (info->severity == AER_CORRECTABLE)
+   if (info->severity == AER_CORRECTABLE) {
strings = aer_correctable_error_string;
-   else
+   level = KERN_WARNING;
+   } else {
strings = aer_uncorrectable_error_string;
+   level = KERN_ERR;
+   }
 
for_each_set_bit(i, &status, 32) {
errmsg = strings[i];
if (!errmsg)
errmsg = "Unknown Error Bit";
 
-   pci_err(dev, "   [%2d] %-22s%s\n", i, errmsg,
+   pci_printk(level, dev, "   [%2d] %-22s%s\n", i, errmsg,
info->first_error == i ? " (First)" : "");
}
pci_dev_aer_stats_incr(dev, info);
@@ -696,6 +699,7 @@ void aer_print_error(struct pci_dev *dev, struct 
aer_err_info *info)
 {
int layer, agent;
int id = ((dev->bus->number << 8) | dev->devfn);
+   const char *level;
 
if (!info->status) {
pci_err(dev, "PCIe Bus Error: severity=%s, type=Inaccessible, 
(Unregistered Agent ID)\n",
@@ -706,13 +710,14 @@ void aer_print_error(struct pci_dev *dev, struct 
aer_err_info *info)
layer = AER_GET_LAYER_ERROR(info->severity, info->status);
agent = AER_GET_AGENT(info->severity, info->status);
 
-   pci_err(dev, "PCIe Bus Error: severity=%s, type=%s, (%s)\n",
-   aer_error_severity_string[info->severity],
-   aer_error_layer[layer], aer_agent_string[agent]);
+   level = (info->severity == AER_CORRECTABLE) ? KERN_WARNING : KERN_ERR;
+
+   pci_printk(level, dev, "PCIe Bus Error: severity=%s, type=%s, (%s)\n",
+  aer_error_severity_string[info->severity],
+  aer_error_layer[layer], aer_agent_string[agent]);
 
-   pci_err(dev, "  device [%04x:%04x] error status/mask=%08x/%08x\n",
-   dev->vendor, dev->device,
-   info->status, info->mask);
+   pci_printk(level, dev, "  device [%04x:%04x] error 
status/mask=%08x/%08x\n",
+  dev->vendor, dev->device, info->status, info->mask);
 
__aer_print_error(dev, info);
 
-- 
2.25.1



Re: Failure to build librseq on ppc

2020-07-07 Thread Segher Boessenkool
Hi!

On Tue, Jul 07, 2020 at 03:17:10PM -0400, Mathieu Desnoyers wrote:
> I'm trying to build librseq at:
> 
> https://git.kernel.org/pub/scm/libs/librseq/librseq.git
> 
> on powerpc, and I get these errors when building the rseq basic
> test mirrored from the kernel selftests code:
> 
> /tmp/ccieEWxU.s: Assembler messages:
> /tmp/ccieEWxU.s:118: Error: syntax error; found `,', expected `('
> /tmp/ccieEWxU.s:118: Error: junk at end of line: `,8'
> /tmp/ccieEWxU.s:121: Error: syntax error; found `,', expected `('
> /tmp/ccieEWxU.s:121: Error: junk at end of line: `,8'
> /tmp/ccieEWxU.s:626: Error: syntax error; found `,', expected `('
> /tmp/ccieEWxU.s:626: Error: junk at end of line: `,8'
> /tmp/ccieEWxU.s:629: Error: syntax error; found `,', expected `('
> /tmp/ccieEWxU.s:629: Error: junk at end of line: `,8'
> /tmp/ccieEWxU.s:735: Error: syntax error; found `,', expected `('
> /tmp/ccieEWxU.s:735: Error: junk at end of line: `,8'
> /tmp/ccieEWxU.s:738: Error: syntax error; found `,', expected `('
> /tmp/ccieEWxU.s:738: Error: junk at end of line: `,8'
> /tmp/ccieEWxU.s:741: Error: syntax error; found `,', expected `('
> /tmp/ccieEWxU.s:741: Error: junk at end of line: `,8'
> Makefile:581: recipe for target 'basic_percpu_ops_test.o' failed

You'll have to show the actual failing machine code, and with enough
context that we can relate this to the source code.

-save-temps helps, or use -S instead of -c, etc.

> I am using this compiler:
> 
> gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12)
> Target: powerpc-linux-gnu
> 
> So far, I got things to build by changing "m" operands to "Q" operands.
> Based on 
> https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html#Machine-Constraints
> it seems that "Q" means "A memory operand addressed by just a base register."

Yup.

> I suspect that lwz and stw don't expect some kind of immediate offset which
> can be kept with "m", and "Q" fixes this. Is that the right fix ?
> 
> And should we change all operands passed to lwz and stw to a "Q" operand ?

No, lwz and stw exactly *do* take an immediate offset.

It sounds like the compiler passed memory addressed by indexed
addressing, instead.  Which is fine for "m", and also fine for those
insns... well, you need lwzx and stwx.

So perhaps you have code like

  int *p;
  int x;
  ...
  asm ("lwz %0,%1" : "=r"(x) : "m"(*p));

where that last line should actually read

  asm ("lwz%X1 %0,%1" : "=r"(x) : "m"(*p));

?


Segher


Re: [PATCH v2 10/10] powerpc/perf: Add extended regs support for power10 platform

2020-07-07 Thread Athira Rajeev



> On 02-Jul-2020, at 3:10 PM, kernel test robot  wrote:
> 
> Hi Athira,
> 
> Thank you for the patch! Yet something to improve:
> 
> [auto build test ERROR on powerpc/next]
> [also build test ERROR on tip/perf/core v5.8-rc3 next-20200702]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use  as documented in
> https://git-scm.com/docs/git-format-patch]
> 
> url:
> https://github.com/0day-ci/linux/commits/Athira-Rajeev/powerpc-perf-Add-support-for-power10-PMU-Hardware/20200701-181147
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
> config: powerpc-pmac32_defconfig (attached as .config)
> compiler: powerpc-linux-gcc (GCC) 9.3.0
> 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
># save the attached .config to linux build tree
>COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 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 >>):
> 
>   {standard input}: Assembler messages:
>>> {standard input}:84: Error: unsupported relocation against SPRN_SIER2
>>> {standard input}:91: Error: unsupported relocation against SPRN_SIER3
>>> {standard input}:119: Error: unsupported relocation against SPRN_MMCR3

These regs are not valid for ppc32 platform. Will fix this by including usage 
of these regs under conditional check for
“CONFIG_PPC64” in next version

Thanks
Athira Rajeev
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org
> <.config.gz>



Re: [PATCH v2 2/4] powerpc/mm/radix: Free PUD table when freeing pagetable

2020-07-07 Thread Michael Ellerman
"Aneesh Kumar K.V"  writes:
> From: Bharata B Rao 
>
> remove_pagetable() isn't freeing PUD table. This causes memory
> leak during memory unplug. Fix this.

Fixes: ??

cheers

> Signed-off-by: Bharata B Rao 
> Signed-off-by: Aneesh Kumar K.V 
> ---
>  arch/powerpc/mm/book3s64/radix_pgtable.c | 16 
>  1 file changed, 16 insertions(+)
>
> diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c 
> b/arch/powerpc/mm/book3s64/radix_pgtable.c
> index 80be96d3018f..af57604f295f 100644
> --- a/arch/powerpc/mm/book3s64/radix_pgtable.c
> +++ b/arch/powerpc/mm/book3s64/radix_pgtable.c
> @@ -708,6 +708,21 @@ static void free_pmd_table(pmd_t *pmd_start, pud_t *pud)
>   pud_clear(pud);
>  }
>  
> +static void free_pud_table(pud_t *pud_start, p4d_t *p4d)
> +{
> + pud_t *pud;
> + int i;
> +
> + for (i = 0; i < PTRS_PER_PUD; i++) {
> + pud = pud_start + i;
> + if (!pud_none(*pud))
> + return;
> + }
> +
> + pud_free(&init_mm, pud_start);
> + p4d_clear(p4d);
> +}
> +
>  struct change_mapping_params {
>   pte_t *pte;
>   unsigned long start;
> @@ -882,6 +897,7 @@ static void __meminit remove_pagetable(unsigned long 
> start, unsigned long end)
>  
>   pud_base = (pud_t *)p4d_page_vaddr(*p4d);
>   remove_pud_table(pud_base, addr, next);
> + free_pud_table(pud_base, p4d);
>   }
>  
>   spin_unlock(&init_mm.page_table_lock);
> -- 
> 2.26.2


Re: [PATCH v2 04/10] powerpc/perf: Add power10_feat to dt_cpu_ftrs

2020-07-07 Thread Athira Rajeev



> On 07-Jul-2020, at 11:52 AM, Michael Neuling  wrote:
> 
> On Wed, 2020-07-01 at 05:20 -0400, Athira Rajeev wrote:
>> From: Madhavan Srinivasan 
>> 
>> Add power10 feature function to dt_cpu_ftrs.c along
>> with a power10 specific init() to initialize pmu sprs.
> 
> Can you say why you're doing this?
> 
> Can you add some text about what you're doing to the BHRB in this patch?

Sure, I will include these information for commit message in the next version

Thanks
Athira 

> 
> Mikey
> 
>> 
>> Signed-off-by: Madhavan Srinivasan 
>> ---
>> arch/powerpc/include/asm/reg.h|  3 +++
>> arch/powerpc/kernel/cpu_setup_power.S |  7 +++
>> arch/powerpc/kernel/dt_cpu_ftrs.c | 26 ++
>> 3 files changed, 36 insertions(+)
>> 
>> diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
>> index 21a1b2d..900ada1 100644
>> --- a/arch/powerpc/include/asm/reg.h
>> +++ b/arch/powerpc/include/asm/reg.h
>> @@ -1068,6 +1068,9 @@
>> #define MMCR0_PMC2_LOADMISSTIME  0x5
>> #endif
>> 
>> +/* BHRB disable bit for PowerISA v3.10 */
>> +#define MMCRA_BHRB_DISABLE  0x0020
>> +
>> /*
>>  * SPRG usage:
>>  *
>> diff --git a/arch/powerpc/kernel/cpu_setup_power.S
>> b/arch/powerpc/kernel/cpu_setup_power.S
>> index efdcfa7..e8b3370c 100644
>> --- a/arch/powerpc/kernel/cpu_setup_power.S
>> +++ b/arch/powerpc/kernel/cpu_setup_power.S
>> @@ -233,3 +233,10 @@ __init_PMU_ISA207:
>>  li  r5,0
>>  mtspr   SPRN_MMCRS,r5
>>  blr
>> +
>> +__init_PMU_ISA31:
>> +li  r5,0
>> +mtspr   SPRN_MMCR3,r5
>> +LOAD_REG_IMMEDIATE(r5, MMCRA_BHRB_DISABLE)
>> +mtspr   SPRN_MMCRA,r5
>> +blr
>> diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c
>> b/arch/powerpc/kernel/dt_cpu_ftrs.c
>> index a0edeb3..14a513f 100644
>> --- a/arch/powerpc/kernel/dt_cpu_ftrs.c
>> +++ b/arch/powerpc/kernel/dt_cpu_ftrs.c
>> @@ -449,6 +449,31 @@ static int __init feat_enable_pmu_power9(struct
>> dt_cpu_feature *f)
>>  return 1;
>> }
>> 
>> +static void init_pmu_power10(void)
>> +{
>> +init_pmu_power9();
>> +
>> +mtspr(SPRN_MMCR3, 0);
>> +mtspr(SPRN_MMCRA, MMCRA_BHRB_DISABLE);
>> +}
>> +
>> +static int __init feat_enable_pmu_power10(struct dt_cpu_feature *f)
>> +{
>> +hfscr_pmu_enable();
>> +
>> +init_pmu_power10();
>> +init_pmu_registers = init_pmu_power10;
>> +
>> +cur_cpu_spec->cpu_features |= CPU_FTR_MMCRA;
>> +cur_cpu_spec->cpu_user_features |= PPC_FEATURE_PSERIES_PERFMON_COMPAT;
>> +
>> +cur_cpu_spec->num_pmcs  = 6;
>> +cur_cpu_spec->pmc_type  = PPC_PMC_IBM;
>> +cur_cpu_spec->oprofile_cpu_type = "ppc64/power10";
>> +
>> +return 1;
>> +}
>> +
>> static int __init feat_enable_tm(struct dt_cpu_feature *f)
>> {
>> #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
>> @@ -638,6 +663,7 @@ struct dt_cpu_feature_match {
>>  {"pc-relative-addressing", feat_enable, 0},
>>  {"machine-check-power9", feat_enable_mce_power9, 0},
>>  {"performance-monitor-power9", feat_enable_pmu_power9, 0},
>> +{"performance-monitor-power10", feat_enable_pmu_power10, 0},
>>  {"event-based-branch-v3", feat_enable, 0},
>>  {"random-number-generator", feat_enable, 0},
>>  {"system-call-vectored", feat_disable, 0},
> 



  1   2   >