[rcu:dev.2020.11.06a] BUILD REGRESSION 5cec02881428f10c4a1632c3aebb666b12888958

2020-11-09 Thread kernel test robot
tree/branch: 
https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git  
dev.2020.11.06a
branch HEAD: 5cec02881428f10c4a1632c3aebb666b12888958  docs: Remove redundant 
"``" from Requirements.rst

Error/Warning reports:

https://lore.kernel.org/lkml/202011100859.gavtzgej-...@intel.com

Error/Warning in current branch:

rdtgroup.c:(.text+0xad8a): undefined reference to `cpulist_parse'

Error/Warning ids grouped by kconfigs:

gcc_recent_errors
`-- x86_64-randconfig-m001-20201109
`-- rdtgroup.c:(.text):undefined-reference-to-cpulist_parse

elapsed time: 722m

configs tested: 99
configs skipped: 2

gcc tested configs:
arm defconfig
arm64allyesconfig
arm64   defconfig
arm  allyesconfig
arm  allmodconfig
sh  urquell_defconfig
mips  malta_kvm_defconfig
powerpcgamecube_defconfig
mips  maltaaprp_defconfig
xtensa  nommu_kc705_defconfig
powerpc  tqm8xx_defconfig
sh espt_defconfig
arcnsim_700_defconfig
i386defconfig
powerpc mpc8315_rdb_defconfig
powerpc   maple_defconfig
sh   alldefconfig
shecovec24-romimage_defconfig
m68k amcore_defconfig
powerpc  katmai_defconfig
sh   sh7770_generic_defconfig
arm   omap2plus_defconfig
riscvalldefconfig
armrealview_defconfig
xtensa  audio_kc705_defconfig
xtensa  defconfig
sh  rsk7203_defconfig
arm   cns3420vb_defconfig
arm   omap1_defconfig
c6xevmc6472_defconfig
arm  ixp4xx_defconfig
ia64defconfig
ia64 allmodconfig
ia64 allyesconfig
m68k allmodconfig
m68kdefconfig
m68k allyesconfig
nios2   defconfig
arc  allyesconfig
nds32 allnoconfig
c6x  allyesconfig
nds32   defconfig
nios2allyesconfig
cskydefconfig
alpha   defconfig
alphaallyesconfig
xtensa   allyesconfig
h8300allyesconfig
arc defconfig
sh   allmodconfig
parisc  defconfig
s390 allyesconfig
parisc   allyesconfig
s390defconfig
i386 allyesconfig
sparcallyesconfig
sparc   defconfig
mips allyesconfig
mips allmodconfig
powerpc  allyesconfig
powerpc  allmodconfig
powerpc   allnoconfig
x86_64   randconfig-a003-20201110
x86_64   randconfig-a005-20201110
x86_64   randconfig-a004-20201110
x86_64   randconfig-a002-20201110
x86_64   randconfig-a006-20201110
x86_64   randconfig-a001-20201110
i386 randconfig-a004-20201109
i386 randconfig-a006-20201109
i386 randconfig-a005-20201109
i386 randconfig-a001-20201109
i386 randconfig-a003-20201109
i386 randconfig-a002-20201109
i386 randconfig-a012-20201110
i386 randconfig-a014-20201110
i386 randconfig-a016-20201110
i386 randconfig-a011-20201110
i386 randconfig-a015-20201110
i386 randconfig-a013-20201110
riscvnommu_k210_defconfig
riscvallyesconfig
riscvnommu_virt_defconfig
riscv allnoconfig
riscv   defconfig
riscv  rv32_defconfig
riscvallmodconfig
x86_64   rhel
x86_64   allyesconfig
x86_64rhel-7.6-kselftests
x86_64  defconfig
x86_64   rhel-8.3
x86_64  kexec

clang tested configs:
x86_64   randconfig-a015-20201

RE: [PATCH v2] scsi: ufshcd: fix missing destroy_workqueue()

2020-11-09 Thread Avri Altman
> 
> 
> Add the missing destroy_workqueue() before return from
> ufshcd_init in the error handling case as well as in
> ufshcd_remove.
> 
> Fixes: 4db7a2360597 ("scsi: ufs: Fix concurrency of error handler and other
> error recovery paths")
> Suggested-by: Avri Altman 
> Signed-off-by: Qinglang Miao 
Reviewed-by: Avri Altman 

> ---
>  v2: consider missing destroy_workqueue ufshcd_remove either.
> 
>  drivers/scsi/ufs/ufshcd.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index b8f573a02713..adbdda4f556b 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -8906,6 +8906,7 @@ void ufshcd_remove(struct ufs_hba *hba)
> blk_mq_free_tag_set(>tmf_tag_set);
> blk_cleanup_queue(hba->cmd_queue);
> scsi_remove_host(hba->host);
> +   destroy_workqueue(hba->eh_wq);
> /* disable interrupts */
> ufshcd_disable_intr(hba, hba->intr_mask);
> ufshcd_hba_stop(hba);
> @@ -9206,6 +9207,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem
> *mmio_base, unsigned int irq)
>  exit_gating:
> ufshcd_exit_clk_scaling(hba);
> ufshcd_exit_clk_gating(hba);
> +   destroy_workqueue(hba->eh_wq);
>  out_disable:
> hba->is_irq_enabled = false;
> ufshcd_hba_exit(hba);
> --
> 2.23.0



Re: binder: add transaction latency tracer

2020-11-09 Thread Greg Kroah-Hartman
On Tue, Nov 10, 2020 at 08:52:09AM +0100, Greg Kroah-Hartman wrote:
> On Tue, Nov 10, 2020 at 03:33:00PM +0800, Frankie Chang wrote:
> > On Mon, 2020-11-09 at 18:46 +0100, Greg Kroah-Hartman wrote:
> > > On Fri, Oct 30, 2020 at 12:08:54AM +0800, Frankie Chang wrote:
> > > > Change from v11:
> > > >   - rebase.
> > > 
> > > This whole patch set is sent with DOS line-ends, which makes git really
> > > unhappy when it tries to apply it, as rightfully, it doesn't know how to
> > > convert things.
> > > 
> > Hmm.., actually I can use 'git apply' PATCH v11 from the message
> > directly.
> 
> Ok, let me see if I can figure this out on my end, let me try using `b4`
> on this to see if that helps...

Nope, there's still some merge conflicts here.  b4 fixed the line-end
issues, but can you please rebase on top of my char-misc-next branch in
the char.git tree on git.kernel.org and resend?  I think some changes by
others are conflicting with this patchset somehow.

thanks,

greg k-h


Re: binder: add transaction latency tracer

2020-11-09 Thread Greg Kroah-Hartman
On Tue, Nov 10, 2020 at 03:33:00PM +0800, Frankie Chang wrote:
> On Mon, 2020-11-09 at 18:46 +0100, Greg Kroah-Hartman wrote:
> > On Fri, Oct 30, 2020 at 12:08:54AM +0800, Frankie Chang wrote:
> > > Change from v11:
> > >   - rebase.
> > 
> > This whole patch set is sent with DOS line-ends, which makes git really
> > unhappy when it tries to apply it, as rightfully, it doesn't know how to
> > convert things.
> > 
> Hmm.., actually I can use 'git apply' PATCH v11 from the message
> directly.

Ok, let me see if I can figure this out on my end, let me try using `b4`
on this to see if that helps...


Re: linux-next: Tree for Nov 5

2020-11-09 Thread Anders Roxell
On Thu, 5 Nov 2020 at 07:06, Stephen Rothwell  wrote:
>
> Hi all,
>
> Changes since 20201104:

When building an arm64 allmodconfig and booting up that in qemu I see

[10011.092394][   T28] task:kworker/0:2 state:D stack:26896 pid:
1840 ppid: 2 flags:0x0428
[10022.368093][   T28] Workqueue: events toggle_allocation_gate
[10024.827549][   T28] Call trace:
[10027.152494][   T28]  __switch_to+0x1cc/0x1e0
[10031.378073][   T28]  __schedule+0x730/0x800
[10032.164468][   T28]  schedule+0xd8/0x160
[10033.886807][   T28]  toggle_allocation_gate+0x16c/0x220
[10038.477987][   T28]  process_one_work+0x5c0/0x980
[10039.900075][   T28]  worker_thread+0x428/0x720
[10042.782911][   T28]  kthread+0x23c/0x260
[10043.171725][   T28]  ret_from_fork+0x10/0x18
[10046.227741][   T28] INFO: lockdep is turned off.
[10047.732220][   T28] Kernel panic - not syncing: hung_task: blocked tasks
[10047.741785][   T28] CPU: 0 PID: 28 Comm: khungtaskd Tainted: G
  W 5.10.0-rc2-next-20201105-6-g7af110e4d8ed #1
[10047.755348][   T28] Hardware name: linux,dummy-virt (DT)
[10047.763476][   T28] Call trace:
[10047.769802][   T28]  dump_backtrace+0x0/0x420
[10047.777104][   T28]  show_stack+0x38/0xa0
[10047.784177][   T28]  dump_stack+0x1d4/0x278
[10047.791362][   T28]  panic+0x304/0x5d8
[10047.798202][   T28]  check_hung_uninterruptible_tasks+0x5e4/0x640
[10047.807056][   T28]  watchdog+0x138/0x160
[10047.814140][   T28]  kthread+0x23c/0x260
[10047.821130][   T28]  ret_from_fork+0x10/0x18
[10047.829181][   T28] Kernel Offset: disabled
[10047.836274][   T28] CPU features: 0x0240002,20002004
[10047.844070][   T28] Memory Limit: none
[10047.853599][   T28] ---[ end Kernel panic - not syncing: hung_task:
blocked tasks ]---

if I build with KFENCE=n it boots up eventually, here's my .config file [2].

Any idea what may happen?

it happens on next-20201109 also, but it takes longer until we get the
"Call trace:".

Cheers,
Anders
[1] http://ix.io/2Ddv
[2] https://people.linaro.org/~anders.roxell/allmodconfig-next-20201105.config


[PATCH] mfd: kempld-core: Check for DMI definition before ACPI

2020-11-09 Thread Michael Brunner
Change the detection order to priorize DMI table entries over available
ACPI entries.

This makes it more easy for product developers to patch product specific
handling into the driver.
Furthermore it allows to simplify the implementation a bit and
especially to remove the need to force synchronous probing.

Based on the following commit introduced with v5.10-rc1:
commit e8299c7313af ("mfd: Add ACPI support to Kontron PLD driver")

Signed-off-by: Michael Brunner 
---
 drivers/mfd/kempld-core.c | 23 ++-
 1 file changed, 2 insertions(+), 21 deletions(-)

diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c
index 2c9295953c11..aa7f386646a1 100644
--- a/drivers/mfd/kempld-core.c
+++ b/drivers/mfd/kempld-core.c
@@ -125,7 +125,6 @@ static const struct kempld_platform_data 
kempld_platform_data_generic = {
 };
 
 static struct platform_device *kempld_pdev;
-static bool kempld_acpi_mode;
 
 static int kempld_create_platform_device(const struct dmi_system_id *id)
 {
@@ -501,8 +500,6 @@ static int kempld_probe(struct platform_device *pdev)
ret = kempld_get_acpi_data(pdev);
if (ret)
return ret;
-
-   kempld_acpi_mode = true;
} else if (kempld_pdev != pdev) {
/*
 * The platform device we are probing is not the one we
@@ -565,7 +562,6 @@ static struct platform_driver kempld_driver = {
.driver = {
.name   = "kempld",
.acpi_match_table = ACPI_PTR(kempld_acpi_table),
-   .probe_type = PROBE_FORCE_SYNCHRONOUS,
},
.probe  = kempld_probe,
.remove = kempld_remove,
@@ -884,7 +880,6 @@ MODULE_DEVICE_TABLE(dmi, kempld_dmi_table);
 static int __init kempld_init(void)
 {
const struct dmi_system_id *id;
-   int ret;
 
if (force_device_id[0]) {
for (id = kempld_dmi_table;
@@ -894,24 +889,10 @@ static int __init kempld_init(void)
break;
if (id->matches[0].slot == DMI_NONE)
return -ENODEV;
-   }
-
-   ret = platform_driver_register(_driver);
-   if (ret)
-   return ret;
-
-   /*
-* With synchronous probing the device should already be probed now.
-* If no device id is forced and also no ACPI definition for the
-* device was found, scan DMI table as fallback.
-*
-* If drivers_autoprobing is disabled and the device is found here,
-* only that device can be bound manually later.
-*/
-   if (!kempld_pdev && !kempld_acpi_mode)
+   } else
dmi_check_system(kempld_dmi_table);
 
-   return 0;
+   return platform_driver_register(_driver);
 }
 
 static void __exit kempld_exit(void)
-- 
2.25.1



WARNING in put_i2c_dev

2020-11-09 Thread syzbot
Hello,

syzbot found the following issue on:

HEAD commit:521b619a Merge tag 'linux-kselftest-kunit-fixes-5.10-rc3' ..
git tree:   upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=10760a3450
kernel config:  https://syzkaller.appspot.com/x/.config?x=61033507391c77ff
dashboard link: https://syzkaller.appspot.com/bug?extid=0a05df8ed151f2ed3a05
compiler:   gcc (GCC) 10.1.0-syz 20200507
syz repro:  https://syzkaller.appspot.com/x/repro.syz?x=1672e7a850
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=15f6b4b250

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+0a05df8ed151f2ed3...@syzkaller.appspotmail.com

pvrusb2: Attached sub-driver cx25840
pvrusb2: ***WARNING*** pvrusb2 device hardware appears to be jammed and I can't 
clear it.
pvrusb2: You might need to power cycle the pvrusb2 device in order to recover.
[ cut here ]
sysfs group 'power' not found for kobject 'i2c-1'
WARNING: CPU: 1 PID: 4041 at fs/sysfs/group.c:279 
sysfs_remove_group+0x126/0x170 fs/sysfs/group.c:279
Modules linked in:
CPU: 1 PID: 4041 Comm: pvrusb2-context Not tainted 5.10.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 
01/01/2011
RIP: 0010:sysfs_remove_group+0x126/0x170 fs/sysfs/group.c:279
Code: 48 89 d9 49 8b 14 24 48 b8 00 00 00 00 00 fc ff df 48 c1 e9 03 80 3c 01 
00 75 37 48 8b 33 48 c7 c7 60 72 5b 89 e8 81 52 c4 06 <0f> 0b eb 98 e8 11 7e ca 
ff e9 01 ff ff ff 48 89 df e8 04 7e ca ff
RSP: 0018:c9000367fa38 EFLAGS: 00010286
RAX:  RBX: 89b53740 RCX: 
RDX: 88801d0d8000 RSI: 8158d055 RDI: f520006cff39
RBP:  R08: 0001 R09: 8880b9f309e7
R10:  R11:  R12: 888143e19018
R13: 89b53ce0 R14: 888143e1e000 R15: 8c2c7d20
FS:  () GS:8880b9f0() knlGS:
CS:  0010 DS:  ES:  CR0: 80050033
CR2: 7fc516e9a020 CR3: 20556000 CR4: 001506e0
DR0:  DR1:  DR2: 
DR3:  DR6: fffe0ff0 DR7: 0400
Call Trace:
 dpm_sysfs_remove+0x97/0xb0 drivers/base/power/sysfs.c:837
 device_del+0x20c/0xec0 drivers/base/core.c:3092
 cdev_device_del+0x19/0x100 fs/char_dev.c:573
 put_i2c_dev+0x160/0x1b0 drivers/i2c/i2c-dev.c:93
 i2cdev_detach_adapter.part.0+0x10f/0x1a0 drivers/i2c/i2c-dev.c:689
 i2cdev_detach_adapter drivers/i2c/i2c-dev.c:647 [inline]
 i2cdev_notifier_call+0xad/0xc0 drivers/i2c/i2c-dev.c:704
 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83
 blocking_notifier_call_chain kernel/notifier.c:337 [inline]
 blocking_notifier_call_chain+0x67/0x90 kernel/notifier.c:325
 device_del+0x1ff/0xec0 drivers/base/core.c:3089
 device_unregister+0x22/0xc0 drivers/base/core.c:3148
 i2c_del_adapter+0x4d6/0x680 drivers/i2c/i2c-core-base.c:1690
 pvr2_i2c_core_done+0x69/0xc0 drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c:652
 pvr2_hdw_destroy+0x179/0x3b0 drivers/media/usb/pvrusb2/pvrusb2-hdw.c:2679
 pvr2_context_destroy+0x84/0x230 drivers/media/usb/pvrusb2/pvrusb2-context.c:70
 pvr2_context_check drivers/media/usb/pvrusb2/pvrusb2-context.c:137 [inline]
 pvr2_context_thread_func+0x641/0x850 
drivers/media/usb/pvrusb2/pvrusb2-context.c:158
 kthread+0x3af/0x4a0 kernel/kthread.c:292
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkal...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches


Re: [PATCH v1] ARM: vfp: Use long jump to fix THUMB2 kernel compilation error

2020-11-09 Thread Ard Biesheuvel
On Tue, 10 Nov 2020 at 08:44, Dmitry Osipenko  wrote:
>
> 09.11.2020 10:25, Ard Biesheuvel пишет:
> ...
> >>> So the options are
> >>>
> >>> a) merge my patch that adds 2 bytes of opcode to the Thumb2 build
> >>> b) merge Dmitry's patch that adds an unconditional literal load to all 
> >>> builds
> >>> c) remove kernel mode handling from vfp_support_entry() [my other patch]
> >>> d) move sections around so that vfp_kmode_exception is guaranteed to
> >>> be in range.
> >>> e) do nothing
> ...
> >> The performance argument is questionable to me, to be honest. In
> >> practice the performance difference should be absolutely negligible for
> >> either of the proposed options, it should stay in a noise even if
> >> somebody thoroughly counting cycles, IMO.
> >>
> >> I'm still thinking that the best option will be to apply a).
> >>
> >
> > Can we take that as an acked-by?
>
> Are you asking me for the ack?

Yes.

> I think this is a more appropriate
> question to Russel. I'm not arm/ maintainer, but could give r-b and t-b.
>

R-b and acked-by are basically the same thing.

> If you're going to follow approach that I'm suggesting with a) + d),
> then could you please resend the two patches in a single series? The
> first one-line patch-fix should contain the fixes tag.

Ok


Re: [PATCH v1] ARM: vfp: Use long jump to fix THUMB2 kernel compilation error

2020-11-09 Thread Dmitry Osipenko
09.11.2020 10:25, Ard Biesheuvel пишет:
...
>>> So the options are
>>>
>>> a) merge my patch that adds 2 bytes of opcode to the Thumb2 build
>>> b) merge Dmitry's patch that adds an unconditional literal load to all 
>>> builds
>>> c) remove kernel mode handling from vfp_support_entry() [my other patch]
>>> d) move sections around so that vfp_kmode_exception is guaranteed to
>>> be in range.
>>> e) do nothing
...
>> The performance argument is questionable to me, to be honest. In
>> practice the performance difference should be absolutely negligible for
>> either of the proposed options, it should stay in a noise even if
>> somebody thoroughly counting cycles, IMO.
>>
>> I'm still thinking that the best option will be to apply a).
>>
> 
> Can we take that as an acked-by?

Are you asking me for the ack? I think this is a more appropriate
question to Russel. I'm not arm/ maintainer, but could give r-b and t-b.

If you're going to follow approach that I'm suggesting with a) + d),
then could you please resend the two patches in a single series? The
first one-line patch-fix should contain the fixes tag.


Re: [PATCH 4.19 00/71] 4.19.156-rc1 review

2020-11-09 Thread Naresh Kamboju
On Mon, 9 Nov 2020 at 18:40, Greg Kroah-Hartman
 wrote:
>
> This is the start of the stable review cycle for the 4.19.156 release.
> There are 71 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Wed, 11 Nov 2020 12:50:04 +.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> 
> https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.156-rc1.gz
> or in the git tree and branch at:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git 
> linux-4.19.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h

Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.

Tested-by: Linux Kernel Functional Testing 

NOTE:
The following kernel warning noticed while cpu hotplug on arm64 db410c device.
I did not bisect this problem yet.
WARNING: CPU: 2 at kernel/workqueue.c:4762 workqueue_online_cpu
https://lore.kernel.org/linux-pm/CA+G9fYu+KK=hm1amq78gccgqtwsrczya6whyr68ozzbzp7u...@mail.gmail.com/T/#u

Summary


kernel: 4.19.156-rc1
git repo: 
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-4.19.y
git commit: 4d10cdd4ac507ec787b8f4a1770b0c44350ff5cf
git describe: v4.19.155-72-g4d10cdd4ac50
Test details: 
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-4.19.y/build/v4.19.155-72-g4d10cdd4ac50

No regressions (compared to build v4.19.155)

No fixes (compared to build v4.19.155)

Ran 35947 total tests in the following environments and test suites.

Environments
--
- dragonboard-410c - arm64
- hi6220-hikey - arm64
- i386
- juno-r2 - arm64
- juno-r2-compat
- juno-r2-kasan
- nxp-ls2088
- qemu-arm64-kasan
- qemu-x86_64-kasan
- qemu_arm
- qemu_arm64
- qemu_arm64-compat
- qemu_i386
- qemu_x86_64
- qemu_x86_64-compat
- x15 - arm
- x86_64
- x86-kasan

Test Suites
---
* build
* install-android-platform-tools-r2600
* kselftest
* linux-log-parser
* ltp-containers-tests
* ltp-ipc-tests
* ltp-nptl-tests
* ltp-pty-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* network-basic-tests
* perf
* libhugetlbfs
* ltp-cap_bounds-tests
* ltp-commands-tests
* ltp-controllers-tests
* ltp-cpuhotplug-tests
* ltp-crypto-tests
* ltp-cve-tests
* ltp-dio-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-math-tests
* ltp-mm-tests
* ltp-open-posix-tests
* ltp-sched-tests
* v4l2-compliance
* kvm-unit-tests
* ltp-tracing-tests
* kselftest-vsyscall-mode-native
* kselftest-vsyscall-mode-none


--
Linaro LKFT
https://lkft.linaro.org


WARNING: CPU: 2 at kernel/workqueue.c:4762 workqueue_online_cpu

2020-11-09 Thread Naresh Kamboju
While running CPU hotplug testing on arm64 db410c device the following
kernel warning
noticed on linux stable-rc 4.19 branch. I did not bisect this problem yet.

Kernel Warning log:
--
[  290.463053] CPU1: shutdown
[  290.463107] psci: CPU1 killed (polled 0 ms)
[  290.527026] CPU2: shutdown
[  290.527072] psci: CPU2 killed (polled 0 ms)
[  290.579064] CPU3: shutdown
[  290.579098] psci: CPU3 killed (polled 0 ms)
[  290.612295] Detected VIPT I-cache on CPU1
[  290.612361] CPU1: Booted secondary processor 0x01 [0x410fd030]
[  290.684091] Detected VIPT I-cache on CPU2
[  290.684158] CPU2: Booted secondary processor 0x02 [0x410fd030]
[  290.684464] WARNING: CPU: 2 PID: 20 at
/usr/src/kernel/kernel/workqueue.c:4762
workqueue_online_cpu+0x18c/0x428
[  290.697731] Modules linked in: sch_ingress algif_hash test_bpf
snd_soc_hdmi_codec crc32_ce adv7511 cec rfkill msm
snd_soc_msm8916_analog snd_soc_lpass_apq8016 mdt_loader
snd_soc_lpass_cpu snd_soc_msm8916_digital snd_soc_apq8016_sbc
drm_kms_helper snd_soc_lpass_platform drm drm_panel_orientation_quirks
fuse [last unloaded: test_bpf]
[  290.714992] CPU: 2 PID: 20 Comm: cpuhp/2 Tainted: G  D
 4.19.156-rc1 #1
[  290.737221] Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT)
[  290.745033] pstate: 4005 (nZcv daif -PAN -UAO)
[  290.751718] pc : workqueue_online_cpu+0x18c/0x428
[  290.756316] lr : workqueue_online_cpu+0x140/0x428
[  290.761086] sp : 0a90bc90
[  290.765774] x29: 0a90bc90 x28: 0989bfc8
[  290.769074] x27: 80003ac81a00 x26: 09914a00
[  290.774456] x25: 0989c068 x24: 0a90bd24
[  290.779752] x23: 0002 x22: 80003fe7a4d0
[  290.785047] x21: 09914000 x20: 0989bf68
[  290.790341] x19: 80003fe7a1c0 x18: 
[  290.795636] x17:  x16: 
[  290.800932] x15: 0987fa48 x14: 0a69c530
[  290.806227] x13: 0040 x12: 0228
[  290.811522] x11:  x10: 0987fa48
[  290.816816] x9 : 09914000 x8 : 0987fa48
[  290.822112] x7 : 0812d338 x6 : 
[  290.827407] x5 :  x4 : 80003c59ad00
[  290.832702] x3 : 0988 x2 : 8b427f82388e4a00
[  290.837997] x1 :  x0 : ffea
[  290.843293] Call trace:
[  290.848588]  workqueue_online_cpu+0x18c/0x428
[  290.850762]  cpuhp_invoke_callback+0xe8/0xd18
[  290.855274]  cpuhp_thread_fun+0x1a8/0x250
[  290.859613]  smpboot_thread_fn+0x1c4/0x2d0
[  290.863606]  kthread+0x150/0x168
[  290.867600]  ret_from_fork+0x10/0x1c
[  290.870983] irq event stamp: 158
[  290.874546] hardirqs last  enabled at (157): []
_raw_spin_unlock_irqrestore+0x74/0xb0
[  290.877765] hardirqs last disabled at (158): []
__schedule+0xc0/0xbc0
[  290.886878] softirqs last  enabled at (0): []
copy_process.isra.5.part.6+0x490/0x1b20
[  290.894861] softirqs last disabled at (0): [<>]
  (null)
[  290.904233] ---[ end trace 7a9cb6558129244f ]---

steps to reproduce:
--
Total number of CPU[0-3]
offline each CPU 1, 2 and 3
online each CPU 1, 2 and 3

  echo 0 > /sys/devices/system/cpu/cpu1/online
  echo 0 > /sys/devices/system/cpu/cpu2/online
  echo 0 > /sys/devices/system/cpu/cpu3/online
  echo 1 > /sys/devices/system/cpu/cpu1/online
  echo 1 > /sys/devices/system/cpu/cpu2/online
  echo 1 > /sys/devices/system/cpu/cpu3/online

Reported-by: Naresh Kamboju 

metadata:
  git branch: linux-4.19.y
  git repo: 
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
  git describe: v4.19.155-72-g4d10cdd4ac50
  kernel-config:
http://snapshots.linaro.org/openembedded/lkft/lkft/sumo/dragonboard-410c/lkft/linux-stable-rc-4.19/666/config

ref:
https://lkft.validation.linaro.org/scheduler/job/1927553#L3876
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-4.19.y/build/v4.19.155-72-g4d10cdd4ac50/testrun/3416766/suite/linux-log-parser/test/check-kernel-warning-1925672/log

-- 
Linaro LKFT
https://lkft.linaro.org


[PATCH v2] firmware: arm_scmi: fix missing destroy_workqueue()

2020-11-09 Thread Qinglang Miao
destroy_workqueue seems necessary before return from
scmi_notification_init in the error handling case when
fails to do devm_kcalloc(). Fix this by simply moving
devm_kcalloc to the front.

Fixes: bd31b249692e ("firmware: arm_scmi: Add notification dispatch and 
delivery")
Suggested-by: Cristian Marussi 
Signed-off-by: Qinglang Miao 
---
 v2: fix this problem by simply moving codes.

 drivers/firmware/arm_scmi/notify.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/firmware/arm_scmi/notify.c 
b/drivers/firmware/arm_scmi/notify.c
index 2754f9d01636..fdb2cc95dfde 100644
--- a/drivers/firmware/arm_scmi/notify.c
+++ b/drivers/firmware/arm_scmi/notify.c
@@ -1468,17 +1468,17 @@ int scmi_notification_init(struct scmi_handle *handle)
ni->gid = gid;
ni->handle = handle;
 
+   ni->registered_protocols = devm_kcalloc(handle->dev, SCMI_MAX_PROTO,
+   sizeof(char *), GFP_KERNEL);
+   if (!ni->registered_protocols)
+   goto err;
+
ni->notify_wq = alloc_workqueue("scmi_notify",
WQ_UNBOUND | WQ_FREEZABLE | WQ_SYSFS,
0);
if (!ni->notify_wq)
goto err;
 
-   ni->registered_protocols = devm_kcalloc(handle->dev, SCMI_MAX_PROTO,
-   sizeof(char *), GFP_KERNEL);
-   if (!ni->registered_protocols)
-   goto err;
-
mutex_init(>pending_mtx);
hash_init(ni->pending_events_handlers);
 
-- 
2.23.0



[PATCH v2] scsi: ufshcd: fix missing destroy_workqueue()

2020-11-09 Thread Qinglang Miao
Add the missing destroy_workqueue() before return from
ufshcd_init in the error handling case as well as in
ufshcd_remove.

Fixes: 4db7a2360597 ("scsi: ufs: Fix concurrency of error handler and other 
error recovery paths")
Suggested-by: Avri Altman 
Signed-off-by: Qinglang Miao 
---
 v2: consider missing destroy_workqueue ufshcd_remove either.

 drivers/scsi/ufs/ufshcd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index b8f573a02713..adbdda4f556b 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -8906,6 +8906,7 @@ void ufshcd_remove(struct ufs_hba *hba)
blk_mq_free_tag_set(>tmf_tag_set);
blk_cleanup_queue(hba->cmd_queue);
scsi_remove_host(hba->host);
+   destroy_workqueue(hba->eh_wq);
/* disable interrupts */
ufshcd_disable_intr(hba, hba->intr_mask);
ufshcd_hba_stop(hba);
@@ -9206,6 +9207,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem 
*mmio_base, unsigned int irq)
 exit_gating:
ufshcd_exit_clk_scaling(hba);
ufshcd_exit_clk_gating(hba);
+   destroy_workqueue(hba->eh_wq);
 out_disable:
hba->is_irq_enabled = false;
ufshcd_hba_exit(hba);
-- 
2.23.0



[PATCH net/next] net: ipconfig: Avoid spurious blank lines in boot log

2020-11-09 Thread Thierry Reding
From: Thierry Reding 

When dumping the name and NTP servers advertised by DHCP, a blank line
is emitted if either of the lists is empty. This can lead to confusing
issues such as the blank line getting flagged as warning. This happens
because the blank line is the result of pr_cont("\n") and that may see
its level corrupted by some other driver concurrently writing to the
console.

Fix this by making sure that the terminating newline is only emitted
if at least one entry in the lists was printed before.

Reported-by: Jon Hunter 
Signed-off-by: Thierry Reding 
---
 net/ipv4/ipconfig.c | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 561f15b5a944..3cd13e1bc6a7 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -1441,7 +1441,7 @@ static int __init ip_auto_config(void)
int retries = CONF_OPEN_RETRIES;
 #endif
int err;
-   unsigned int i;
+   unsigned int i, count;
 
/* Initialise all name servers and NTP servers to NONE (but only if the
 * "ip=" or "nfsaddrs=" kernel command line parameters weren't decoded,
@@ -1575,7 +1575,7 @@ static int __init ip_auto_config(void)
if (ic_dev_mtu)
pr_cont(", mtu=%d", ic_dev_mtu);
/* Name servers (if any): */
-   for (i = 0; i < CONF_NAMESERVERS_MAX; i++) {
+   for (i = 0, count = 0; i < CONF_NAMESERVERS_MAX; i++) {
if (ic_nameservers[i] != NONE) {
if (i == 0)
pr_info(" nameserver%u=%pI4",
@@ -1583,12 +1583,14 @@ static int __init ip_auto_config(void)
else
pr_cont(", nameserver%u=%pI4",
i, _nameservers[i]);
+
+   count++;
}
-   if (i + 1 == CONF_NAMESERVERS_MAX)
+   if ((i + 1 == CONF_NAMESERVERS_MAX) && count > 0)
pr_cont("\n");
}
/* NTP servers (if any): */
-   for (i = 0; i < CONF_NTP_SERVERS_MAX; i++) {
+   for (i = 0, count = 0; i < CONF_NTP_SERVERS_MAX; i++) {
if (ic_ntp_servers[i] != NONE) {
if (i == 0)
pr_info(" ntpserver%u=%pI4",
@@ -1596,8 +1598,10 @@ static int __init ip_auto_config(void)
else
pr_cont(", ntpserver%u=%pI4",
i, _ntp_servers[i]);
+
+   count++;
}
-   if (i + 1 == CONF_NTP_SERVERS_MAX)
+   if ((i + 1 == CONF_NTP_SERVERS_MAX) && count > 0)
pr_cont("\n");
}
 #endif /* !SILENT */
-- 
2.29.2



Re: [PATCH v2] Make iwmmxt.S support Clang's integrated assembler

2020-11-09 Thread Ard Biesheuvel
On Tue, 10 Nov 2020 at 02:55, Nick Desaulniers  wrote:
>
> On Sat, Nov 7, 2020 at 12:29 AM Ard Biesheuvel  wrote:
> >
> > On Sat, 7 Nov 2020 at 01:11, Jian Cai  wrote:
> > >
> > > This patch replaces 6 IWMMXT instructions Clang's integrated assembler
> > > does not support in iwmmxt.S using macros, while making sure GNU
> > > assembler still emit the same instructions. This should be easier than
> > > providing full IWMMXT support in Clang.
> > >
> > > "Intel Wireless MMX Technology - Developer Guide - August, 2002" should
> > > be referenced for the encoding schemes of these extensions.
> > >
> > > Link: https://github.com/ClangBuiltLinux/linux/issues/975
> > >
> > > Suggested-by: Nick Desaulniers 
> > > Suggested-by: Ard Biesheuvel 
> > > Signed-off-by: Jian Cai 
> >
> > Please make sure you test this carefully on BE32, as the instruction
> > byte order used by .inst is LE IIRC
>
> Unless that was a recent-ish change in GAS, it looks like I get the
> same disassembly/encodings before/after this patch for
> CONFIG_BIG_ENDIAN with GNU as.
>
> $ ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make CC=clang -j71 defconfig
> $ ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make CC=clang -j71 menuconfig
> 
> $ grep BIG_ENDIAN .config
> CONFIG_CPU_BIG_ENDIAN=y
> CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
> $ ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make CC=clang -j71
> arch/arm/kernel/iwmmxt.o
> $ arm-linux-gnueabi-objdump -dr arch/arm/kernel/iwmmxt.o > gas_before.txt
> $ b4 am 
> https://lore.kernel.org/lkml/20201107001056.225807-1-jian...@google.com/
> -o - | git am
> $ ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make CC=clang -j71
> arch/arm/kernel/iwmmxt.o
> $ arm-linux-gnueabi-objdump -dr arch/arm/kernel/iwmmxt.o > gas_after.txt
> $ diff -u gas_before.txt gas_after.txt
> $ echo $?
> 0
>
> (Orthogonal, it looks like llvm-objdump has issues decoding
> elf32-bigarm that we'll need to fix.)
>
> Either way the patch LGTM for IWMMXT, thanks Jian for the patch and
> Ard for the suggestions.
>
> Reviewed-by: Nick Desaulniers 
> Tested-by: Nick Desaulniers 


BE32 != BE8

Please use, e.g., ixp4xx_defconfig with IWMMXT and BE enabled. It
seems like .inst does the right thing here, i.e., the assembler knows
that it should emit BE for BE32 and LE for BE8, but it needs to be
confirmed.


Re: [PATCH net v5] net: Update window_clamp if SOCK_RCVBUF is set

2020-11-09 Thread Eric Dumazet
On Tue, Nov 10, 2020 at 1:16 AM Mao Wenan  wrote:
>
> When net.ipv4.tcp_syncookies=1 and syn flood is happened,
> cookie_v4_check or cookie_v6_check tries to redo what
> tcp_v4_send_synack or tcp_v6_send_synack did,
> rsk_window_clamp will be changed if SOCK_RCVBUF is set,
> which will make rcv_wscale is different, the client
> still operates with initial window scale and can overshot
> granted window, the client use the initial scale but local
> server use new scale to advertise window value, and session
> work abnormally.
>
> Fixes: e88c64f0a425 ("tcp: allow effective reduction of TCP's rcv-buffer via 
> setsockopt")
> Signed-off-by: Mao Wenan 

Signed-off-by: Eric Dumazet 

Thanks !


Re: binder: add transaction latency tracer

2020-11-09 Thread Frankie Chang
On Mon, 2020-11-09 at 18:46 +0100, Greg Kroah-Hartman wrote:
> On Fri, Oct 30, 2020 at 12:08:54AM +0800, Frankie Chang wrote:
> > Change from v11:
> >   - rebase.
> 
> This whole patch set is sent with DOS line-ends, which makes git really
> unhappy when it tries to apply it, as rightfully, it doesn't know how to
> convert things.
> 
Hmm.., actually I can use 'git apply' PATCH v11 from the message
directly.

> Please resend this patch series as a plain-text patch series.  Perhaps
> using git send-email?  Something is converting these patches to an odd
> encoding which makes them not able to be applied.
> 
And I sent the patch set using git send-email. Hence, I am not sure what
happened when the patch set sent to others.

> Try sending them to yourself first, and seeing if you can apply them
> from the messages directly, and if so, then resend them.
> 
But I will still verify locally and resend again.

thanks

Frankie Chang



[PATCH] kunit: kunit_tool: Correctly parse diagnostic messages

2020-11-09 Thread David Gow
Currently, kunit_tool expects all diagnostic lines in test results to
contain ": " somewhere, as both the subtest header and the crash report
do. Fix this to accept any line starting with (minus indent) "# " as
being a valid diagnostic line.

This matches what the TAP spec[1] and the draft KTAP spec[2] are
expecting.

[1]: http://testanything.org/tap-specification.html
[2]: 
https://lore.kernel.org/linux-kselftest/cy4pr13mb1175b804e31e502221bc8163fd...@cy4pr13mb1175.namprd13.prod.outlook.com/T/

Signed-off-by: David Gow 
---
 tools/testing/kunit/kunit_parser.py | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/testing/kunit/kunit_parser.py 
b/tools/testing/kunit/kunit_parser.py
index 84a1af2581f5..dab4cfa05b74 100644
--- a/tools/testing/kunit/kunit_parser.py
+++ b/tools/testing/kunit/kunit_parser.py
@@ -134,8 +134,8 @@ def parse_ok_not_ok_test_case(lines: List[str], test_case: 
TestCase) -> bool:
else:
return False
 
-SUBTEST_DIAGNOSTIC = re.compile(r'^[\s]+# .*?: (.*)$')
-DIAGNOSTIC_CRASH_MESSAGE = 'kunit test case crashed!'
+SUBTEST_DIAGNOSTIC = re.compile(r'^[\s]+# (.*)$')
+DIAGNOSTIC_CRASH_MESSAGE = re.compile(r'^[\s]+# .*?: kunit test case 
crashed!$')
 
 def parse_diagnostic(lines: List[str], test_case: TestCase) -> bool:
save_non_diagnositic(lines, test_case)
@@ -145,7 +145,8 @@ def parse_diagnostic(lines: List[str], test_case: TestCase) 
-> bool:
match = SUBTEST_DIAGNOSTIC.match(line)
if match:
test_case.log.append(lines.pop(0))
-   if match.group(1) == DIAGNOSTIC_CRASH_MESSAGE:
+   crash_match = DIAGNOSTIC_CRASH_MESSAGE.match(line)
+   if crash_match:
test_case.status = TestStatus.TEST_CRASHED
return True
else:
-- 
2.29.2.222.g5d2a92d10f8-goog



[PATCH v2 2/3] clk: sifive: Use common name for prci configuration

2020-11-09 Thread Zong Li
Use generic name CLK_SIFIVE_PRCI instead of CLK_SIFIVE_FU540_PRCI. This
patch is prepared for fu740 support.

Signed-off-by: Zong Li 
Reviewed-by: Palmer Dabbelt 
Acked-by: Palmer Dabbelt 
---
 arch/riscv/Kconfig.socs | 2 +-
 drivers/clk/sifive/Kconfig  | 6 +++---
 drivers/clk/sifive/Makefile | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs
index 8a55f6156661..3284d5c291be 100644
--- a/arch/riscv/Kconfig.socs
+++ b/arch/riscv/Kconfig.socs
@@ -5,7 +5,7 @@ config SOC_SIFIVE
select SERIAL_SIFIVE if TTY
select SERIAL_SIFIVE_CONSOLE if TTY
select CLK_SIFIVE
-   select CLK_SIFIVE_FU540_PRCI
+   select CLK_SIFIVE_PRCI
select SIFIVE_PLIC
help
  This enables support for SiFive SoC platform hardware.
diff --git a/drivers/clk/sifive/Kconfig b/drivers/clk/sifive/Kconfig
index f3b4eb9cb0f5..ab48cf7e0105 100644
--- a/drivers/clk/sifive/Kconfig
+++ b/drivers/clk/sifive/Kconfig
@@ -8,12 +8,12 @@ menuconfig CLK_SIFIVE
 
 if CLK_SIFIVE
 
-config CLK_SIFIVE_FU540_PRCI
-   bool "PRCI driver for SiFive FU540 SoCs"
+config CLK_SIFIVE_PRCI
+   bool "PRCI driver for SiFive SoCs"
select CLK_ANALOGBITS_WRPLL_CLN28HPC
help
  Supports the Power Reset Clock interface (PRCI) IP block found in
- FU540 SoCs.  If this kernel is meant to run on a SiFive FU540 SoC,
+ FU540 SoCs. If this kernel is meant to run on a SiFive FU540 SoC,
  enable this driver.
 
 endif
diff --git a/drivers/clk/sifive/Makefile b/drivers/clk/sifive/Makefile
index 627effe2ece1..fe3e2cb4c4d8 100644
--- a/drivers/clk/sifive/Makefile
+++ b/drivers/clk/sifive/Makefile
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
 obj-y += sifive-prci.o
 
-obj-$(CONFIG_CLK_SIFIVE_FU540_PRCI)+= fu540-prci.o
+obj-$(CONFIG_CLK_SIFIVE_PRCI)  += fu540-prci.o
-- 
2.29.2



[PATCH v2 3/3] clk: sifive: Add a driver for the SiFive FU740 PRCI IP block

2020-11-09 Thread Zong Li
Add driver code for the SiFive FU740 PRCI IP block. This IP block
handles reset and clock control for the SiFive FU740 device and
implements SoC-level clock tree controls and dividers.

This driver contains bug fixes and contributions from
Henry Styles  and Erik Danie .

Signed-off-by: Zong Li 
Cc: Henry Styles 
Cc: Erik Danie 
---
 drivers/clk/sifive/Kconfig|   4 +-
 drivers/clk/sifive/Makefile   |   1 +
 drivers/clk/sifive/fu740-prci.c   | 122 ++
 drivers/clk/sifive/fu740-prci.h   |  21 +++
 drivers/clk/sifive/sifive-prci.c  | 120 +
 drivers/clk/sifive/sifive-prci.h  |  88 +
 include/dt-bindings/clock/sifive-fu740-prci.h |  23 
 7 files changed, 377 insertions(+), 2 deletions(-)
 create mode 100644 drivers/clk/sifive/fu740-prci.c
 create mode 100644 drivers/clk/sifive/fu740-prci.h
 create mode 100644 include/dt-bindings/clock/sifive-fu740-prci.h

diff --git a/drivers/clk/sifive/Kconfig b/drivers/clk/sifive/Kconfig
index ab48cf7e0105..1c14eb20c066 100644
--- a/drivers/clk/sifive/Kconfig
+++ b/drivers/clk/sifive/Kconfig
@@ -13,7 +13,7 @@ config CLK_SIFIVE_PRCI
select CLK_ANALOGBITS_WRPLL_CLN28HPC
help
  Supports the Power Reset Clock interface (PRCI) IP block found in
- FU540 SoCs. If this kernel is meant to run on a SiFive FU540 SoC,
- enable this driver.
+ FU540/FU740 SoCs. If this kernel is meant to run on a SiFive FU540/
+ FU740 SoCs, enable this driver.
 
 endif
diff --git a/drivers/clk/sifive/Makefile b/drivers/clk/sifive/Makefile
index fe3e2cb4c4d8..2c05798e4ba4 100644
--- a/drivers/clk/sifive/Makefile
+++ b/drivers/clk/sifive/Makefile
@@ -2,3 +2,4 @@
 obj-y += sifive-prci.o
 
 obj-$(CONFIG_CLK_SIFIVE_PRCI)  += fu540-prci.o
+obj-$(CONFIG_CLK_SIFIVE_PRCI)  += fu740-prci.o
diff --git a/drivers/clk/sifive/fu740-prci.c b/drivers/clk/sifive/fu740-prci.c
new file mode 100644
index ..3b87e273c3eb
--- /dev/null
+++ b/drivers/clk/sifive/fu740-prci.c
@@ -0,0 +1,122 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2018-2019 SiFive, Inc.
+ * Wesley Terpstra
+ * Paul Walmsley
+ * Zong Li
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include "sifive-prci.h"
+
+/* PRCI integration data for each WRPLL instance */
+
+static struct __prci_wrpll_data __prci_corepll_data = {
+   .cfg0_offs = PRCI_COREPLLCFG0_OFFSET,
+   .enable_bypass = sifive_prci_coreclksel_use_hfclk,
+   .disable_bypass = sifive_prci_coreclksel_use_final_corepll,
+};
+
+static struct __prci_wrpll_data __prci_ddrpll_data = {
+   .cfg0_offs = PRCI_DDRPLLCFG0_OFFSET,
+};
+
+static struct __prci_wrpll_data __prci_gemgxlpll_data = {
+   .cfg0_offs = PRCI_GEMGXLPLLCFG0_OFFSET,
+};
+
+static struct __prci_wrpll_data __prci_dvfscorepll_data = {
+   .cfg0_offs = PRCI_DVFSCOREPLLCFG0_OFFSET,
+   .enable_bypass = sifive_prci_corepllsel_use_corepll,
+   .disable_bypass = sifive_prci_corepllsel_use_dvfscorepll,
+};
+
+static struct __prci_wrpll_data __prci_hfpclkpll_data = {
+   .cfg0_offs = PRCI_HFPCLKPLLCFG0_OFFSET,
+   .enable_bypass = sifive_prci_hfpclkpllsel_use_hfclk,
+   .disable_bypass = sifive_prci_hfpclkpllsel_use_hfpclkpll,
+};
+
+static struct __prci_wrpll_data __prci_cltxpll_data = {
+   .cfg0_offs = PRCI_CLTXPLLCFG0_OFFSET,
+};
+
+/* Linux clock framework integration */
+
+static const struct clk_ops sifive_fu740_prci_wrpll_clk_ops = {
+   .set_rate = sifive_prci_wrpll_set_rate,
+   .round_rate = sifive_prci_wrpll_round_rate,
+   .recalc_rate = sifive_prci_wrpll_recalc_rate,
+};
+
+static const struct clk_ops sifive_fu740_prci_wrpll_ro_clk_ops = {
+   .recalc_rate = sifive_prci_wrpll_recalc_rate,
+};
+
+static const struct clk_ops sifive_fu740_prci_tlclksel_clk_ops = {
+   .recalc_rate = sifive_prci_tlclksel_recalc_rate,
+};
+
+static const struct clk_ops sifive_fu740_prci_hfpclkplldiv_clk_ops = {
+   .recalc_rate = sifive_prci_hfpclkplldiv_recalc_rate,
+};
+
+/* List of clock controls provided by the PRCI */
+struct __prci_clock __prci_init_clocks_fu740[] = {
+   [PRCI_CLK_COREPLL] = {
+   .name = "corepll",
+   .parent_name = "hfclk",
+   .ops = _fu740_prci_wrpll_clk_ops,
+   .pwd = &__prci_corepll_data,
+   },
+   [PRCI_CLK_DDRPLL] = {
+   .name = "ddrpll",
+   .parent_name = "hfclk",
+   .ops = _fu740_prci_wrpll_ro_clk_ops,
+   .pwd 

[PATCH v2 0/3] clk: add driver for the SiFive FU740

2020-11-09 Thread Zong Li
Add a driver for the SiFive FU740 PRCI IP block, which handles more
clocks than FU540. These patches also refactor the original
implementation by spliting the dependent-code of fu540 and fu740
respectively.

Changed in v2:
 - Remove the macro definition for __prci_clock_array.
 - Indicate the functional changes in commit message.
 - Using option -M and -C to create patches.
 - Rebase code to kernel v5.10-rc3

Zong Li (3):
  clk: sifive: Extract prci core to common base
  clk: sifive: Use common name for prci configuration
  clk: sifive: Add a driver for the SiFive FU740 PRCI IP block

 arch/riscv/Kconfig.socs   |   2 +-
 drivers/clk/sifive/Kconfig|   8 +-
 drivers/clk/sifive/Makefile   |   5 +-
 drivers/clk/sifive/fu540-prci.c   | 586 +-
 drivers/clk/sifive/fu540-prci.h   |  21 +
 drivers/clk/sifive/fu740-prci.c   | 122 
 drivers/clk/sifive/fu740-prci.h   |  21 +
 .../sifive/{fu540-prci.c => sifive-prci.c}| 499 ++-
 drivers/clk/sifive/sifive-prci.h  | 289 +
 include/dt-bindings/clock/sifive-fu740-prci.h |  23 +
 10 files changed, 703 insertions(+), 873 deletions(-)
 create mode 100644 drivers/clk/sifive/fu540-prci.h
 create mode 100644 drivers/clk/sifive/fu740-prci.c
 create mode 100644 drivers/clk/sifive/fu740-prci.h
 copy drivers/clk/sifive/{fu540-prci.c => sifive-prci.c} (45%)
 create mode 100644 drivers/clk/sifive/sifive-prci.h
 create mode 100644 include/dt-bindings/clock/sifive-fu740-prci.h

-- 
2.29.2



[PATCH v2 1/3] clk: sifive: Extract prci core to common base

2020-11-09 Thread Zong Li
Extract common core of prci driver to an independent file, it could
allow other chips to reuse it. Separate SoCs-dependent code 'fu540'
from prci core, then we can easily add 'fu740' later.

Almost these changes are code movement. The different is adding the
private data for each SoC use, so it needs to get match data in probe
callback function, then use the data for initialization.

Signed-off-by: Zong Li 
---
 drivers/clk/sifive/Makefile   |   2 +
 drivers/clk/sifive/fu540-prci.c   | 586 +-
 drivers/clk/sifive/fu540-prci.h   |  21 +
 .../sifive/{fu540-prci.c => sifive-prci.c}| 381 +++-
 drivers/clk/sifive/sifive-prci.h  | 201 ++
 5 files changed, 323 insertions(+), 868 deletions(-)
 create mode 100644 drivers/clk/sifive/fu540-prci.h
 copy drivers/clk/sifive/{fu540-prci.c => sifive-prci.c} (45%)
 create mode 100644 drivers/clk/sifive/sifive-prci.h

diff --git a/drivers/clk/sifive/Makefile b/drivers/clk/sifive/Makefile
index 0797f14fef6b..627effe2ece1 100644
--- a/drivers/clk/sifive/Makefile
+++ b/drivers/clk/sifive/Makefile
@@ -1,2 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
+obj-y += sifive-prci.o
+
 obj-$(CONFIG_CLK_SIFIVE_FU540_PRCI)+= fu540-prci.o
diff --git a/drivers/clk/sifive/fu540-prci.c b/drivers/clk/sifive/fu540-prci.c
index a8901f90a61a..840b97bfff85 100644
--- a/drivers/clk/sifive/fu540-prci.c
+++ b/drivers/clk/sifive/fu540-prci.c
@@ -3,6 +3,7 @@
  * Copyright (C) 2018-2019 SiFive, Inc.
  * Wesley Terpstra
  * Paul Walmsley
+ * Zong Li
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -13,475 +14,48 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * The FU540 PRCI implements clock and reset control for the SiFive
- * FU540-C000 chip.  This driver assumes that it has sole control
- * over all PRCI resources.
- *
- * This driver is based on the PRCI driver written by Wesley Terpstra:
- * 
https://github.com/riscv/riscv-linux/commit/999529edf517ed75b56659d456d221b2ee56bb60
- *
  * References:
  * - SiFive FU540-C000 manual v1p0, Chapter 7 "Clocking and Reset"
  */
 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
 #include 
-#include 
-#include 
-#include 
-#include 
-
-/*
- * EXPECTED_CLK_PARENT_COUNT: how many parent clocks this driver expects:
- * hfclk and rtcclk
- */
-#define EXPECTED_CLK_PARENT_COUNT  2
-
-/*
- * Register offsets and bitmasks
- */
-
-/* COREPLLCFG0 */
-#define PRCI_COREPLLCFG0_OFFSET0x4
-# define PRCI_COREPLLCFG0_DIVR_SHIFT   0
-# define PRCI_COREPLLCFG0_DIVR_MASK(0x3f << 
PRCI_COREPLLCFG0_DIVR_SHIFT)
-# define PRCI_COREPLLCFG0_DIVF_SHIFT   6
-# define PRCI_COREPLLCFG0_DIVF_MASK(0x1ff << 
PRCI_COREPLLCFG0_DIVF_SHIFT)
-# define PRCI_COREPLLCFG0_DIVQ_SHIFT   15
-# define PRCI_COREPLLCFG0_DIVQ_MASK(0x7 << 
PRCI_COREPLLCFG0_DIVQ_SHIFT)
-# define PRCI_COREPLLCFG0_RANGE_SHIFT  18
-# define PRCI_COREPLLCFG0_RANGE_MASK   (0x7 << 
PRCI_COREPLLCFG0_RANGE_SHIFT)
-# define PRCI_COREPLLCFG0_BYPASS_SHIFT 24
-# define PRCI_COREPLLCFG0_BYPASS_MASK  (0x1 << 
PRCI_COREPLLCFG0_BYPASS_SHIFT)
-# define PRCI_COREPLLCFG0_FSE_SHIFT25
-# define PRCI_COREPLLCFG0_FSE_MASK (0x1 << 
PRCI_COREPLLCFG0_FSE_SHIFT)
-# define PRCI_COREPLLCFG0_LOCK_SHIFT   31
-# define PRCI_COREPLLCFG0_LOCK_MASK(0x1 << 
PRCI_COREPLLCFG0_LOCK_SHIFT)
-
-/* DDRPLLCFG0 */
-#define PRCI_DDRPLLCFG0_OFFSET 0xc
-# define PRCI_DDRPLLCFG0_DIVR_SHIFT0
-# define PRCI_DDRPLLCFG0_DIVR_MASK (0x3f << 
PRCI_DDRPLLCFG0_DIVR_SHIFT)
-# define PRCI_DDRPLLCFG0_DIVF_SHIFT6
-# define PRCI_DDRPLLCFG0_DIVF_MASK (0x1ff << 
PRCI_DDRPLLCFG0_DIVF_SHIFT)
-# define PRCI_DDRPLLCFG0_DIVQ_SHIFT15
-# define PRCI_DDRPLLCFG0_DIVQ_MASK (0x7 << 
PRCI_DDRPLLCFG0_DIVQ_SHIFT)
-# define PRCI_DDRPLLCFG0_RANGE_SHIFT   18
-# define PRCI_DDRPLLCFG0_RANGE_MASK(0x7 << 
PRCI_DDRPLLCFG0_RANGE_SHIFT)
-# define PRCI_DDRPLLCFG0_BYPASS_SHIFT  24
-# define PRCI_DDRPLLCFG0_BYPASS_MASK   (0x1 << 
PRCI_DDRPLLCFG0_BYPASS_SHIFT)
-# define PRCI_DDRPLLCFG0_FSE_SHIFT 25
-# define PRCI_DDRPLLCFG0_FSE_MASK  (0x1 << 
PRCI_DDRPLLCFG0_FSE_SHIFT)
-# define PRCI_DDRPLLCFG0_LOCK_SHIFT31
-# define PRCI_DDRPLLCFG0_LOCK_MASK (0x1 << 
PRCI_DDRPLLCFG0_LOCK_SHIFT)
+#include "sifive-prci.h"
 
-/* DDRPLLCFG1 */
-#define PRCI_DDRPLLCFG1_OFFSET 0x10
-# define PRCI_DDRPLLCFG1_CKE_SHIFT 24
-# define PRCI_DDRPLLCFG1_CKE_MASK  (0x1 << 
PRCI_DDRPLLCFG1_CKE_SHIFT)
+/* PRCI integration data for each WRPLL instance */
 
-/* GEMGXLPLLCFG0 */

Duplicated ABI entries - Was: Re: [PATCH v2 20/39] docs: ABI: testing: make the files compatible with ReST output

2020-11-09 Thread Mauro Carvalho Chehab
Hi Jonathan,

Em Sun, 8 Nov 2020 16:56:21 +
Jonathan Cameron  escreveu:

> > PS.: the IIO subsystem is the one that currently has more duplicated
> > ABI entries:  
> > $ ./scripts/get_abi.pl validate 2>&1|grep iio
> > Warning: /sys/bus/iio/devices/iio:deviceX/in_accel_x_calibbias is defined 2 
> > times:  Documentation/ABI/testing/sysfs-bus-iio-icm42600:0  
> > Documentation/ABI/testing/sysfs-bus-iio:394
> > Warning: /sys/bus/iio/devices/iio:deviceX/in_accel_y_calibbias is defined 2 
> > times:  Documentation/ABI/testing/sysfs-bus-iio-icm42600:1  
> > Documentation/ABI/testing/sysfs-bus-iio:395
> > Warning: /sys/bus/iio/devices/iio:deviceX/in_accel_z_calibbias is defined 2 
> > times:  Documentation/ABI/testing/sysfs-bus-iio-icm42600:2  
> > Documentation/ABI/testing/sysfs-bus-iio:396
> > Warning: /sys/bus/iio/devices/iio:deviceX/in_anglvel_x_calibbias is defined 
> > 2 times:  Documentation/ABI/testing/sysfs-bus-iio-icm42600:3  
> > Documentation/ABI/testing/sysfs-bus-iio:397
> > Warning: /sys/bus/iio/devices/iio:deviceX/in_anglvel_y_calibbias is defined 
> > 2 times:  Documentation/ABI/testing/sysfs-bus-iio-icm42600:4  
> > Documentation/ABI/testing/sysfs-bus-iio:398
> > Warning: /sys/bus/iio/devices/iio:deviceX/in_anglvel_z_calibbias is defined 
> > 2 times:  Documentation/ABI/testing/sysfs-bus-iio-icm42600:5  
> > Documentation/ABI/testing/sysfs-bus-iio:399
> > Warning: /sys/bus/iio/devices/iio:deviceX/in_count0_preset is defined 2 
> > times:  Documentation/ABI/testing/sysfs-bus-iio-timer-stm32:100  
> > Documentation/ABI/testing/sysfs-bus-iio-lptimer-stm32:0
> > Warning: /sys/bus/iio/devices/iio:deviceX/in_count0_quadrature_mode is 
> > defined 2 times:  Documentation/ABI/testing/sysfs-bus-iio-timer-stm32:117  
> > Documentation/ABI/testing/sysfs-bus-iio-lptimer-stm32:14
> > Warning: 
> > /sys/bus/iio/devices/iio:deviceX/in_count_quadrature_mode_available is 
> > defined 3 times:  
> > Documentation/ABI/testing/sysfs-bus-iio-counter-104-quad-8:2  
> > Documentation/ABI/testing/sysfs-bus-iio-timer-stm32:111  
> > Documentation/ABI/testing/sysfs-bus-iio-lptimer-stm32:8
> > Warning: /sys/bus/iio/devices/iio:deviceX/out_altvoltageY_frequency is 
> > defined 2 times:  
> > Documentation/ABI/testing/sysfs-bus-iio-frequency-adf4371:0  
> > Documentation/ABI/testing/sysfs-bus-iio:599
> > Warning: /sys/bus/iio/devices/iio:deviceX/out_altvoltageY_powerdown is 
> > defined 2 times:  
> > Documentation/ABI/testing/sysfs-bus-iio-frequency-adf4371:36  
> > Documentation/ABI/testing/sysfs-bus-iio:588
> > Warning: /sys/bus/iio/devices/iio:deviceX/out_currentY_raw is defined 2 
> > times:  Documentation/ABI/testing/sysfs-bus-iio-light-lm3533-als:43  
> > Documentation/ABI/testing/sysfs-bus-iio-health-afe440x:38
> > Warning: /sys/bus/iio/devices/iio:deviceX/out_current_heater_raw is defined 
> > 2 times:  Documentation/ABI/testing/sysfs-bus-iio-humidity-hdc2010:0  
> > Documentation/ABI/testing/sysfs-bus-iio-humidity-hdc100x:0
> > Warning: /sys/bus/iio/devices/iio:deviceX/out_current_heater_raw_available 
> > is defined 2 times:  
> > Documentation/ABI/testing/sysfs-bus-iio-humidity-hdc2010:1  
> > Documentation/ABI/testing/sysfs-bus-iio-humidity-hdc100x:1
> > Warning: /sys/bus/iio/devices/iio:deviceX/sensor_sensitivity is defined 2 
> > times:  Documentation/ABI/testing/sysfs-bus-iio-distance-srf08:0  
> > Documentation/ABI/testing/sysfs-bus-iio-proximity-as3935:8
> > Warning: /sys/bus/iio/devices/triggerX/sampling_frequency is defined 2 
> > times:  Documentation/ABI/testing/sysfs-bus-iio-timer-stm32:92  
> > Documentation/ABI/testing/sysfs-bus-iio:45  

> 
> That was intentional.  Often these provide more information on the
> ABI for a particular device than is present in the base ABI doc.

FYI, right now, there are 20 duplicated entries, being 16 of them
from IIO, on those files:

$ ./scripts/get_abi.pl validate 2>&1|perl -ne 'if 
(m,(Documentation/\S+)\:,g) { print "$1\n" }'|sort|uniq
Documentation/ABI/stable/sysfs-driver-w1_ds28e04
Documentation/ABI/testing/sysfs-bus-iio-counter-104-quad-8
Documentation/ABI/testing/sysfs-bus-iio-distance-srf08
Documentation/ABI/testing/sysfs-bus-iio-frequency-adf4371
Documentation/ABI/testing/sysfs-bus-iio-humidity-hdc2010
Documentation/ABI/testing/sysfs-bus-iio-icm42600
Documentation/ABI/testing/sysfs-bus-iio-light-lm3533-als
Documentation/ABI/testing/sysfs-bus-iio-timer-stm32
Documentation/ABI/testing/sysfs-class-backlight-adp8860
Documentation/ABI/testing/sysfs-class-led-trigger-pattern
Documentation/ABI/testing/sysfs-kernel-iommu_groups

> 
> A bit like when we have additional description for dt binding properties
> for a particular device, even though they are standard properties.
> 
> Often a standard property allows for more values than the specific
> one for a particular device.  There can also be obscuring coupling
> between sysfs attributes due to hardware restrictions 

[PATCH] ARM: dts: aspeed: minipack: Fixup I2C tree

2020-11-09 Thread rentao . bupt
From: Tao Ren 

Create all the i2c switches in device tree and use aliases to assign
child channels with consistent bus numbers.

Besides, "i2c-mux-idle-disconnect" is set for all the i2c switches to
avoid potential conflicts when multiple devices (beind the switches) use
the same device address.

Signed-off-by: Tao Ren 
---
 .../boot/dts/aspeed-bmc-facebook-minipack.dts | 888 ++
 1 file changed, 888 insertions(+)

diff --git a/arch/arm/boot/dts/aspeed-bmc-facebook-minipack.dts 
b/arch/arm/boot/dts/aspeed-bmc-facebook-minipack.dts
index c34741dbd268..9eb23e874f19 100644
--- a/arch/arm/boot/dts/aspeed-bmc-facebook-minipack.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-facebook-minipack.dts
@@ -70,6 +70,162 @@
i2c45 = 
i2c46 = 
i2c47 = 
+
+   /*
+* I2C Switch 24-0071 (channel #0 of 8-0070): 8 channels for
+* connecting to left PDB (Power Distribution Board).
+*/
+   i2c48 = 
+   i2c49 = 
+   i2c50 = 
+   i2c51 = 
+   i2c52 = 
+   i2c53 = 
+   i2c54 = 
+   i2c55 = 
+
+   /*
+* I2C Switch 25-0072 (channel #1 of 8-0070): 8 channels for
+* connecting to right PDB (Power Distribution Board).
+*/
+   i2c56 = 
+   i2c57 = 
+   i2c58 = 
+   i2c59 = 
+   i2c60 = 
+   i2c61 = 
+   i2c62 = 
+   i2c63 = 
+
+   /*
+* I2C Switch 26-0076 (channel #2 of 8-0070): 8 channels for
+* connecting to top FCM (Fan Control Module).
+*/
+   i2c64 = 
+   i2c65 = 
+   i2c66 = 
+   i2c67 = 
+   i2c68 = 
+   i2c69 = 
+   i2c70 = 
+   i2c71 = 
+
+   /*
+* I2C Switch 27-0076 (channel #3 of 8-0070): 8 channels for
+* connecting to bottom FCM (Fan Control Module).
+*/
+   i2c72 = 
+   i2c73 = 
+   i2c74 = 
+   i2c75 = 
+   i2c76 = 
+   i2c77 = 
+   i2c78 = 
+   i2c79 = 
+
+   /*
+* I2C Switch 40-0073 (channel #0 of 11-0070): connecting
+* to PIM (Port Interface Module) #1 (1-based).
+*/
+   i2c80 = 
+   i2c81 = 
+   i2c82 = 
+   i2c83 = 
+   i2c84 = 
+   i2c85 = 
+   i2c86 = 
+   i2c87 = 
+
+   /*
+* I2C Switch 41-0073 (channel #1 of 11-0070): connecting
+* to PIM (Port Interface Module) #2 (1-based).
+*/
+   i2c88 = 
+   i2c89 = 
+   i2c90 = 
+   i2c91 = 
+   i2c92 = 
+   i2c93 = 
+   i2c94 = 
+   i2c95 = 
+
+   /*
+* I2C Switch 42-0073 (channel #2 of 11-0070): connecting
+* to PIM (Port Interface Module) #3 (1-based).
+*/
+   i2c96 = 
+   i2c97 = 
+   i2c98 = 
+   i2c99 = 
+   i2c100 = 
+   i2c101 = 
+   i2c102 = 
+   i2c103 = 
+
+   /*
+* I2C Switch 43-0073 (channel #3 of 11-0070): connecting
+* to PIM (Port Interface Module) #4 (1-based).
+*/
+   i2c104 = 
+   i2c105 = 
+   i2c106 = 
+   i2c107 = 
+   i2c108 = 
+   i2c109 = 
+   i2c110 = 
+   i2c111 = 
+
+   /*
+* I2C Switch 44-0073 (channel #4 of 11-0070): connecting
+* to PIM (Port Interface Module) #5 (1-based).
+*/
+   i2c112 = 
+   i2c113 = 
+   i2c114 = 
+   i2c115 = 
+   i2c116 = 
+   i2c117 = 
+   i2c118 = 
+   i2c119 = 
+
+   /*
+* I2C Switch 45-0073 (channel #5 of 11-0070): connecting
+* to PIM (Port Interface Module) #6 (1-based).
+*/
+   i2c120 = 
+   i2c121 = 
+   i2c122 = 
+   i2c123 = 
+   i2c124 = 
+   i2c125 = 
+   i2c126 = 
+   i2c127 = 
+
+   /*
+* I2C Switch 46-0073 (channel #6 of 11-0070): connecting
+* to PIM (Port Interface Module) #7 (1-based).
+*/
+   i2c128 = 
+   i2c129 = 
+   i2c130 = 
+   i2c131 = 
+   i2c132 = 
+   i2c133 = 
+   

[tip:auto-latest] BUILD SUCCESS 904d67c2f61adcd28726693245e094a273184b95

2020-11-09 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git  
auto-latest
branch HEAD: 904d67c2f61adcd28726693245e094a273184b95  Merge branch 'linus'

elapsed time: 1610m

configs tested: 105
configs skipped: 2

The following configs have been built successfully.
More configs may be tested in the coming days.

gcc tested configs:
arm defconfig
arm64allyesconfig
arm64   defconfig
arm  allyesconfig
arm  allmodconfig
powerpc   maple_defconfig
sh   alldefconfig
shecovec24-romimage_defconfig
m68k amcore_defconfig
powerpc  katmai_defconfig
sh   sh7770_generic_defconfig
sh  rsk7203_defconfig
arm   cns3420vb_defconfig
arm   omap1_defconfig
c6xevmc6472_defconfig
arm  ixp4xx_defconfig
ia64 allyesconfig
xtensaxip_kc705_defconfig
shtitan_defconfig
powerpc sbc8548_defconfig
powerpc taishan_defconfig
arm  collie_defconfig
sh  urquell_defconfig
powerpc sequoia_defconfig
powerpc tqm8548_defconfig
shhp6xx_defconfig
ia64 allmodconfig
ia64defconfig
m68k allmodconfig
m68kdefconfig
m68k allyesconfig
nios2   defconfig
arc  allyesconfig
nds32 allnoconfig
c6x  allyesconfig
nds32   defconfig
nios2allyesconfig
cskydefconfig
alpha   defconfig
alphaallyesconfig
xtensa   allyesconfig
h8300allyesconfig
arc defconfig
sh   allmodconfig
parisc  defconfig
s390 allyesconfig
parisc   allyesconfig
s390defconfig
i386 allyesconfig
sparcallyesconfig
sparc   defconfig
i386defconfig
mips allyesconfig
mips allmodconfig
powerpc  allyesconfig
powerpc  allmodconfig
powerpc   allnoconfig
x86_64   randconfig-a003-20201110
x86_64   randconfig-a005-20201110
x86_64   randconfig-a004-20201110
x86_64   randconfig-a002-20201110
x86_64   randconfig-a006-20201110
x86_64   randconfig-a001-20201110
i386 randconfig-a006-20201110
i386 randconfig-a005-20201110
i386 randconfig-a002-20201110
i386 randconfig-a001-20201110
i386 randconfig-a003-20201110
i386 randconfig-a004-20201110
i386 randconfig-a004-20201109
i386 randconfig-a006-20201109
i386 randconfig-a005-20201109
i386 randconfig-a001-20201109
i386 randconfig-a003-20201109
i386 randconfig-a002-20201109
i386 randconfig-a012-20201110
i386 randconfig-a014-20201110
i386 randconfig-a016-20201110
i386 randconfig-a011-20201110
i386 randconfig-a015-20201110
i386 randconfig-a013-20201110
i386 randconfig-a014-20201109
i386 randconfig-a015-20201109
i386 randconfig-a013-20201109
i386 randconfig-a016-20201109
i386 randconfig-a011-20201109
riscvnommu_k210_defconfig
riscvallyesconfig
riscvnommu_virt_defconfig
riscv allnoconfig
riscv   defconfig
riscv  rv32_defconfig
riscvallmodconfig
x86_64   rhel
x86_64   allyesconfig
x86_64rhel-7.6-kselftests
x86_64  defconfig
x86_64   rhel-8.3
x86_64  kexec

clang tested configs:
x86_64   randconfig-a015-20201110
x86_64

Re: [PATCH v3 01/10] Add auxiliary bus support

2020-11-09 Thread Oded Gabbay
On Fri, Nov 06, 2020 at 07:35:37PM +, Mark Brown wrote:
> On Thu, Nov 05, 2020 at 08:37:14PM +, Parav Pandit wrote:
> 
> > > > This example describes the mlx5 PCI subfunction use case.
> > > > I didn't follow your question about 'explicit example'.
> > > > What part is missing to identify it as explicit example?
> 
> > > Specifically listing "mlx5" so if someone reading this document thinks to
> > > themselves "hey mlx5 sounds like my use case" they can go grep for that.
> 
> > Ah, I see.
> > "mlx5" is not listed explicitly, because it is not included in this 
> > patchset.
> > In various previous discussions in this thread, mlx5 subfunction use case 
> > is described that justifies the existence of the bus.
> > I will be happy to update this documentation once mlx5 subfunction will be 
> > part of kernel so that grep actually shows valid output.
> > (waiting to post them as it uses auxiliary bus :-)).
> 
> For ease of review if there's a new version it might be as well to just
> reference it anyway, hopefully the mlx5 code will be merged fairly
> quickly once the bus itself is merged.  It's probably easier all round
> than adding the reference later, it seems more likely that mlx5 will get
> merged than that it'll fall by the wayside.

Another use-case for this patch-set is going to be the habanalabs driver.
The GAUDI ASIC is a PCI H/W accelerator for deep-learning which also exposes 
network ports.We are going to use this auxiliary-bus feature to separate our 
monolithic driver into several parts that will reside in different subsystems 
and communicate between them through the bus.

Thanks,
Oded


Re: [PATCH 15/20] drm/radeon/r600d: Move 'rc600_*' prototypes into shared header

2020-11-09 Thread Lee Jones
On Mon, 09 Nov 2020, Alex Deucher wrote:

> On Mon, Nov 9, 2020 at 4:19 PM Lee Jones  wrote:
> >
> > Fixes the following W=1 kernel build warning(s):
> >
> >  drivers/gpu/drm/radeon/r600_hdmi.c:177:6: warning: no previous prototype 
> > for ‘r600_hdmi_update_acr’ [-Wmissing-prototypes]
> >  177 | void r600_hdmi_update_acr(struct drm_encoder *encoder, long offset,
> >  | ^~~~
> >  drivers/gpu/drm/radeon/r600_hdmi.c:217:6: warning: no previous prototype 
> > for ‘r600_set_avi_packet’ [-Wmissing-prototypes]
> >  217 | void r600_set_avi_packet(struct radeon_device *rdev, u32 offset,
> >  | ^~~
> >  drivers/gpu/drm/radeon/r600_hdmi.c:314:6: warning: no previous prototype 
> > for ‘r600_hdmi_audio_set_dto’ [-Wmissing-prototypes]
> >  314 | void r600_hdmi_audio_set_dto(struct radeon_device *rdev,
> >  | ^~~
> >  drivers/gpu/drm/radeon/r600_hdmi.c:340:6: warning: no previous prototype 
> > for ‘r600_set_vbi_packet’ [-Wmissing-prototypes]
> >  340 | void r600_set_vbi_packet(struct drm_encoder *encoder, u32 offset)
> >  | ^~~
> >  drivers/gpu/drm/radeon/r600_hdmi.c:351:6: warning: no previous prototype 
> > for ‘r600_set_audio_packet’ [-Wmissing-prototypes]
> >  351 | void r600_set_audio_packet(struct drm_encoder *encoder, u32 offset)
> >  | ^
> >  drivers/gpu/drm/radeon/r600_hdmi.c:393:6: warning: no previous prototype 
> > for ‘r600_set_mute’ [-Wmissing-prototypes]
> >  393 | void r600_set_mute(struct drm_encoder *encoder, u32 offset, bool 
> > mute)
> >  | ^
> >  drivers/gpu/drm/radeon/r600_hdmi.c:469:6: warning: no previous prototype 
> > for ‘r600_hdmi_enable’ [-Wmissing-prototypes]
> >  469 | void r600_hdmi_enable(struct drm_encoder *encoder, bool enable)
> >  | ^~~~
> >
> > Cc: Alex Deucher 
> > Cc: "Christian König" 
> > Cc: David Airlie 
> > Cc: Daniel Vetter 
> > Cc: amd-...@lists.freedesktop.org
> > Cc: dri-de...@lists.freedesktop.org
> > Signed-off-by: Lee Jones 
> > ---
> >  drivers/gpu/drm/radeon/r600d.h| 14 ++
> >  drivers/gpu/drm/radeon/radeon_audio.c | 11 +--
> >  2 files changed, 15 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/radeon/r600d.h b/drivers/gpu/drm/radeon/r600d.h
> > index 2e00a5287bd2d..db4bcc8bee4e5 100644
> > --- a/drivers/gpu/drm/radeon/r600d.h
> > +++ b/drivers/gpu/drm/radeon/r600d.h
> > @@ -27,6 +27,20 @@
> >  #ifndef R600D_H
> >  #define R600D_H
> >
> > +struct radeon_crtc;
> > +struct radeon_hdmi_acr;
> > +
> > +void r600_set_audio_packet(struct drm_encoder *encoder, u32 offset);
> > +void r600_set_mute(struct drm_encoder *encoder, u32 offset, bool mute);
> > +void r600_hdmi_audio_set_dto(struct radeon_device *rdev,
> > +   struct radeon_crtc *crtc, unsigned int clock);
> > +void r600_set_avi_packet(struct radeon_device *rdev, u32 offset,
> > +   unsigned char *buffer, size_t size);
> > +void r600_hdmi_update_acr(struct drm_encoder *encoder, long offset,
> > +   const struct radeon_hdmi_acr *acr);
> > +void r600_set_vbi_packet(struct drm_encoder *encoder, u32 offset);
> > +void r600_hdmi_enable(struct drm_encoder *encoder, bool enable);
> > +
> 
> the *d.h headers are supposed to just be hardware definitions.  I'd
> prefer to keep driver stuff out of them.

That's fine (I did wonder if that were the case).

I need an answer from you and Sam whether I can create new headers.

For me, it is the right thing to do.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog


[PATCH] ARM: dts: aspeed: wedge400: Fix FMC flash0 layout

2020-11-09 Thread rentao . bupt
From: Tao Ren 

Update "data0" partition's size from 8MB to 4MB to fix "partition data0
extends beyond the end of device" warning at bootup time.

Signed-off-by: Tao Ren 
---
 arch/arm/boot/dts/aspeed-bmc-facebook-wedge400.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/aspeed-bmc-facebook-wedge400.dts 
b/arch/arm/boot/dts/aspeed-bmc-facebook-wedge400.dts
index ad1fcad3676c..63a3dd548f30 100644
--- a/arch/arm/boot/dts/aspeed-bmc-facebook-wedge400.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-facebook-wedge400.dts
@@ -124,8 +124,8 @@
 * "data0" partition (4MB) is reserved for persistent
 * data store.
 */
-   data0@380 {
-   reg = <0x7c0 0x80>;
+   data0@7c0 {
+   reg = <0x7c0 0x40>;
label = "data0";
};
 
-- 
2.17.1



Re: [PATCH v6 1/2] kunit: Support for Parameterized Testing

2020-11-09 Thread David Gow
On Mon, Nov 9, 2020 at 2:49 PM Arpitha Raghunandan <98.a...@gmail.com> wrote:
>
> On 07/11/20 3:36 pm, Marco Elver wrote:
> > On Sat, 7 Nov 2020 at 05:58, David Gow  wrote:
> >> On Sat, Nov 7, 2020 at 3:22 AM Arpitha Raghunandan <98.a...@gmail.com> 
> >> wrote:
> >>>
> >>> Implementation of support for parameterized testing in KUnit.
> >>> This approach requires the creation of a test case using the
> >>> KUNIT_CASE_PARAM macro that accepts a generator function as input.
> >>> This generator function should return the next parameter given the
> >>> previous parameter in parameterized tests. It also provides
> >>> a macro to generate common-case generators.
> >>>
> >>> Signed-off-by: Arpitha Raghunandan <98.a...@gmail.com>
> >>> Co-developed-by: Marco Elver 
> >>> Signed-off-by: Marco Elver 
> >>> ---
> >>
> >> This looks good to me! A couple of minor thoughts about the output
> >> format below, but I'm quite happy to have this as-is regardless.
> >>
> >> Reviewed-by: David Gow 
> >>
> >> Cheers,
> >> -- David
> >>
> >>> Changes v5->v6:
> >>> - Fix alignment to maintain consistency
> >>> Changes v4->v5:
> >>> - Update kernel-doc comments.
> >>> - Use const void* for generator return and prev value types.
> >>> - Add kernel-doc comment for KUNIT_ARRAY_PARAM.
> >>> - Rework parameterized test case execution strategy: each parameter is 
> >>> executed
> >>>   as if it was its own test case, with its own test initialization and 
> >>> cleanup
> >>>   (init and exit are called, etc.). However, we cannot add new test cases 
> >>> per TAP
> >>>   protocol once we have already started execution. Instead, log the 
> >>> result of
> >>>   each parameter run as a diagnostic comment.
> >>> Changes v3->v4:
> >>> - Rename kunit variables
> >>> - Rename generator function helper macro
> >>> - Add documentation for generator approach
> >>> - Display test case name in case of failure along with param index
> >>> Changes v2->v3:
> >>> - Modifictaion of generator macro and method
> >>> Changes v1->v2:
> >>> - Use of a generator method to access test case parameters
> >>>
> >>>  include/kunit/test.h | 36 ++
> >>>  lib/kunit/test.c | 46 +++-
> >>>  2 files changed, 69 insertions(+), 13 deletions(-)
> >>>
> >>> diff --git a/include/kunit/test.h b/include/kunit/test.h
> >>> index db1b0ae666c4..16616d3974f9 100644
> >>> --- a/include/kunit/test.h
> >>> +++ b/include/kunit/test.h
> >>> @@ -107,6 +107,7 @@ struct kunit;
> > [...]
> >>> -   kunit_suite_for_each_test_case(suite, test_case)
> >>> -   kunit_run_case_catch_errors(suite, test_case);
> >>> +   kunit_suite_for_each_test_case(suite, test_case) {
> >>> +   struct kunit test = { .param_value = NULL, .param_index = 
> >>> 0 };
> >>> +   bool test_success = true;
> >>> +
> >>> +   if (test_case->generate_params)
> >>> +   test.param_value = 
> >>> test_case->generate_params(NULL);
> >>> +
> >>> +   do {
> >>> +   kunit_run_case_catch_errors(suite, test_case, 
> >>> );
> >>> +   test_success &= test_case->success;
> >>> +
> >>> +   if (test_case->generate_params) {
> >>> +   kunit_log(KERN_INFO, ,
> >>> + KUNIT_SUBTEST_INDENT
> >>> + "# %s: param-%d %s",
> >>
> >> Would it make sense to have this imitate the TAP format a bit more?
> >> So, have "# [ok|not ok] - [name]" as the format? [name] could be
> >> something like "[test_case->name]:param-[index]" or similar.
> >> If we keep it commented out and don't indent it further, it won't
> >> formally be a nested test (though if we wanted to support those later,
> >> it'd be easy to add), but I think it would be nicer to be consistent
> >> here.
> >
> > The previous attempt [1] at something similar failed because it seems
> > we'd need to teach kunit-tool new tricks [2], too.
> > [1] https://lkml.kernel.org/r/20201105195503.ga2399...@elver.google.com
> > [2] https://lkml.kernel.org/r/20201106123433.ga3563...@elver.google.com
> >
> > So if we go with a different format, we might need a patch before this
> > one to make kunit-tool compatible with that type of diagnostic.
> >
> > Currently I think we have the following proposals for a format:
> >
> > 1. The current "# [test_case->name]: param-[index] [ok|not ok]" --
> > this works well, because no changes to kunit-tool are required, and it
> > also picks up the diagnostic context for the case and displays that on
> > test failure.
> >
> > 2. Your proposed "# [ok|not ok] - [test_case->name]:param-[index]".
> > As-is, this needs a patch for kunit-tool as well. I just checked, and
> > if we change it to "# [ok|not ok] - [test_case->name]: param-[index]"
> > (note the space after ':') it works without changing kunit-tool. ;-)
> >
> > 3. Something like "# [ok|not 

Re: [PATCH 00/20] [Set 3] Rid W=1 warnings from GPU

2020-11-09 Thread Lee Jones
On Mon, 09 Nov 2020, Alex Deucher wrote:

> On Mon, Nov 9, 2020 at 4:19 PM Lee Jones  wrote:
> >
> > This set is part of a larger effort attempting to clean-up W=1
> > kernel builds, which are currently overwhelmingly riddled with
> > niggly little warnings.
> >
> > This set takes the running (decreasing) total from 5000 before
> > [Set 1] down to 2300.
> >
> > Lee Jones (20):
> >   drm/radeon/radeon_ttm: Place declaration of 'rdev' in same clause as
> > its use
> >   drm/radeon: Move radeon_ttm{init,fini} to shared location
> >   drm/radeon/radeon_fence: Demote some non-conformant kernel-doc headers
> > and fix another
> >   drm/radeon: Move 'radeon_add_legacy_encoder' prototype to shared
> > header
> >   drm/radeon: Move 'radeon_add_legacy_encoder's prototype to shared
> > location
> >   drm/radeon/radeon_connectors: Strip out set but unused variable 'ret'
> >   drm/radeon/radeon_display: Remove unused variable 'mod'
> >   drm/radeon/radeon_i2c: Remove pointless function header
> >   drm/radeon/radeon_irq_kms: Demote non-conformant kernel-doc fix
> > another
> >   drm/radeon/radeon_ring: Add missing function parameters 'rdev' and
> > 'data'
> >   drm/radeon/r600: Strip out set but unused 'tmp' variables
> >   drm/radeon/radeon_cs: Fix a bunch of doc-rot issues
> >   drm/radeon/evergreen: Move 'rv770_set_clk_bypass_mode' prototype to
> > shared location
> >   drm/radeon: Move 'radeon_pm_acpi_event_handler' prototype into shared
> > header
> >   drm/radeon/r600d: Move 'rc600_*' prototypes into shared header
> >   drm/radeon/radeon_audio: Move 'dce3_2_*' prototypes to shared location
> >   drm/radeon/evergreend: Move 'evergreen_*' and 'sumo_*' prototypes out
> > to shared location
> >   drm/radeon/radeon_display: Fix function doc formatting and missing
> > param issues
> >   drm/radeon/r600: Fix a misnamed parameter description and a formatting
> > issue
> >   drm/radeon/cik: Fix a bunch of function parameter descriptions
> >
> >  drivers/gpu/drm/radeon/cik.c   | 10 +++
> >  drivers/gpu/drm/radeon/evergreen.c |  1 -
> >  drivers/gpu/drm/radeon/ni.c| 16 --
> >  drivers/gpu/drm/radeon/r600.c  | 11 +++
> >  drivers/gpu/drm/radeon/r600d.h | 14 +
> >  drivers/gpu/drm/radeon/radeon.h| 34 ++
> >  drivers/gpu/drm/radeon/radeon_acpi.c   |  2 --
> >  drivers/gpu/drm/radeon/radeon_atombios.c   |  5 
> >  drivers/gpu/drm/radeon/radeon_audio.c  | 23 +--
> >  drivers/gpu/drm/radeon/radeon_audio.h  | 12 
> >  drivers/gpu/drm/radeon/radeon_combios.c|  5 
> >  drivers/gpu/drm/radeon/radeon_connectors.c |  4 +--
> >  drivers/gpu/drm/radeon/radeon_cs.c | 12 
> >  drivers/gpu/drm/radeon/radeon_display.c| 17 +--
> >  drivers/gpu/drm/radeon/radeon_encoders.c   |  3 --
> >  drivers/gpu/drm/radeon/radeon_fence.c  |  6 ++--
> >  drivers/gpu/drm/radeon/radeon_i2c.c|  4 ---
> >  drivers/gpu/drm/radeon/radeon_irq_kms.c|  6 ++--
> >  drivers/gpu/drm/radeon/radeon_object.c |  2 --
> >  drivers/gpu/drm/radeon/radeon_ring.c   |  3 ++
> >  drivers/gpu/drm/radeon/radeon_ttm.c|  8 ++---
> >  drivers/gpu/drm/radeon/si.c|  6 
> >  22 files changed, 96 insertions(+), 108 deletions(-)
> 
> Instead of just dumping everything in radeon.h, I think it would be
> cleaner to add new headers that match the .c files that define them.
> E.g., add evergreen.h and put all the stuff from evergreen.c in there.
> Add rv770.h and add all the stuff defined in rv770.c, etc.

This was my original solution, but Sam pushed back.

Please can you decide amongst yourselves what is the best way forward?

I will abide by whatever you decide.

> > Cc: Alex Deucher 
> > Cc: amd-...@lists.freedesktop.org
> > Cc: "Christian König" 
> > Cc: Daniel Vetter 
> > Cc: David Airlie 
> > Cc: dri-de...@lists.freedesktop.org
> > Cc: Jerome Glisse 
> > Cc: linaro-mm-...@lists.linaro.org
> > Cc: linux-me...@vger.kernel.org
> > Cc: report to 
> > Cc: Slava Grigorev 
> > Cc: Sumit Semwal 
> >
> > ___
> > dri-devel mailing list
> > dri-de...@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog


[PATCH v2] iommu/vt-d: avoid unnecessory panic if iommu init fail in tboot system

2020-11-09 Thread Zhenzhong Duan
"intel_iommu=off" command line is used to disable iommu but iommu is force
enabled in a tboot system for security reason.

However for better performance on high speed network device, a new option
"intel_iommu=tboot_noforce" is introduced to disable the force on.

By default kernel should panic if iommu init fail in tboot for security
reason, but it's unnecessory if we use "intel_iommu=tboot_noforce,off".

Fix the code setting force_on and move intel_iommu_tboot_noforce
from tboot code to intel iommu code.

Fixes: 7304e8f28bb2 ("iommu/vt-d: Correctly disable Intel IOMMU force on")
Signed-off-by: Zhenzhong Duan 
---
v2: move ckeck of intel_iommu_tboot_noforce into iommu code per Baolu.

 arch/x86/kernel/tboot.c | 3 ---
 drivers/iommu/intel/iommu.c | 5 +++--
 include/linux/intel-iommu.h | 1 -
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
index 992fb14..420be87 100644
--- a/arch/x86/kernel/tboot.c
+++ b/arch/x86/kernel/tboot.c
@@ -514,9 +514,6 @@ int tboot_force_iommu(void)
if (!tboot_enabled())
return 0;
 
-   if (intel_iommu_tboot_noforce)
-   return 1;
-
if (no_iommu || swiotlb || dmar_disabled)
pr_warn("Forcing Intel-IOMMU to enabled\n");
 
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index 1b1ca63..4d9b298 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -179,7 +179,7 @@ static inline unsigned long virt_to_dma_pfn(void *p)
  * (used when kernel is launched w/ TXT)
  */
 static int force_on = 0;
-int intel_iommu_tboot_noforce;
+static int intel_iommu_tboot_noforce;
 static int no_platform_optin;
 
 #define ROOT_ENTRY_NR (VTD_PAGE_SIZE/sizeof(struct root_entry))
@@ -4885,7 +4885,8 @@ int __init intel_iommu_init(void)
 * Intel IOMMU is required for a TXT/tboot launch or platform
 * opt in, so enforce that.
 */
-   force_on = tboot_force_iommu() || platform_optin_force_iommu();
+   force_on = (!intel_iommu_tboot_noforce && tboot_force_iommu()) ||
+   platform_optin_force_iommu();
 
if (iommu_init_mempool()) {
if (force_on)
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index fbf5b3e..d956987 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -798,7 +798,6 @@ struct context_entry *iommu_context_addr(struct intel_iommu 
*iommu, u8 bus,
 extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu);
 extern int dmar_disabled;
 extern int intel_iommu_enabled;
-extern int intel_iommu_tboot_noforce;
 extern int intel_iommu_gfx_mapped;
 #else
 static inline int iommu_calculate_agaw(struct intel_iommu *iommu)
-- 
1.8.3.1



[PATCH net-next] MAINTAINERS: Add entry for Hirschmann Hellcreek Switch Driver

2020-11-09 Thread Kurt Kanzenbach
Add myself to cover the Hirschmann Hellcreek TSN Ethernet Switch Driver.

Suggested-by: Andrew Lunn 
Signed-off-by: Kurt Kanzenbach 
---
 MAINTAINERS | 9 +
 1 file changed, 9 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 2a0fde12b650..7fe936fc7e76 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7897,6 +7897,15 @@ F:   include/linux/hippidevice.h
 F: include/uapi/linux/if_hippi.h
 F: net/802/hippi.c
 
+HIRSCHMANN HELLCREEK ETHERNET SWITCH DRIVER
+M: Kurt Kanzenbach 
+L: net...@vger.kernel.org
+S: Maintained
+F: Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml
+F: drivers/net/dsa/hirschmann/*
+F: include/linux/platform_data/hirschmann-hellcreek.h
+F: net/dsa/tag_hellcreek.c
+
 HISILICON DMA DRIVER
 M: Zhou Wang 
 L: dmaeng...@vger.kernel.org
-- 
2.20.1



RE: [RFC PATCH v3.1 03/27] mmc: core: UHS-II support, skip set_chip_select()

2020-11-09 Thread Bough Chen
> -Original Message-
> From: AKASHI Takahiro [mailto:takahiro.aka...@linaro.org]
> Sent: 2020年11月6日 10:27
> To: ulf.hans...@linaro.org; adrian.hun...@intel.com
> Cc: linux-...@vger.kernel.org; linux-kernel@vger.kernel.org;
> ben.chu...@genesyslogic.com.tw; greg...@genesyslogic.com.tw; AKASHI
> Takahiro 
> Subject: [RFC PATCH v3.1 03/27] mmc: core: UHS-II support, skip
> set_chip_select()
> 
> mmc_set_chip_select() should be called only in UHS-II mode, and not for UHS-II
> mode.

Typo, only in UHS-I mode.

Regards
Haibo Chen
> 
> Signed-off-by: Ben Chuang 
> Signed-off-by: AKASHI Takahiro 
> ---
>  drivers/mmc/core/core.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index
> 5541ed956c4d..4e12bd98fc08 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -898,8 +898,10 @@ static inline void mmc_set_ios(struct mmc_host
> *host)
>   */
>  void mmc_set_chip_select(struct mmc_host *host, int mode)  {
> - host->ios.chip_select = mode;
> - mmc_set_ios(host);
> + if (!(host->flags & MMC_UHS2_INITIALIZED)) {
> + host->ios.chip_select = mode;
> + mmc_set_ios(host);
> + }
>  }
> 
>  /*
> --
> 2.28.0



arch/sh/mm/cache-sh2.c:65:15: sparse: sparse: incorrect type in argument 1 (different base types)

2020-11-09 Thread kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   407ab579637ced6dc32cfb2295afb7259cca4b22
commit: e5fc436f06eef54ef512ea55a9db8eb9f2e76959 sparse: use static inline for 
__chk_{user,io}_ptr()
date:   2 months ago
config: sh-randconfig-s032-20201109 (attached as .config)
compiler: sh4-linux-gcc (GCC) 9.3.0
reproduce:
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-76-gf680124b-dirty
# 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e5fc436f06eef54ef512ea55a9db8eb9f2e76959
git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout e5fc436f06eef54ef512ea55a9db8eb9f2e76959
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 
CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=sh 

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


"sparse warnings: (new ones prefixed by >>)"
   arch/sh/mm/cache-sh2.c:30:47: sparse: sparse: incorrect type in argument 1 
(different base types) @@ expected void const volatile [noderef] __iomem 
*ptr @@ got unsigned long @@
   arch/sh/mm/cache-sh2.c:30:47: sparse: expected void const volatile 
[noderef] __iomem *ptr
   arch/sh/mm/cache-sh2.c:30:47: sparse: got unsigned long
   arch/sh/mm/cache-sh2.c:33:33: sparse: sparse: incorrect type in argument 1 
(different base types) @@ expected void const volatile [noderef] __iomem 
*ptr @@ got unsigned long @@
   arch/sh/mm/cache-sh2.c:33:33: sparse: expected void const volatile 
[noderef] __iomem *ptr
   arch/sh/mm/cache-sh2.c:33:33: sparse: got unsigned long
   arch/sh/mm/cache-sh2.c:49:17: sparse: sparse: incorrect type in argument 1 
(different base types) @@ expected void const volatile [noderef] __iomem 
*ptr @@ got unsigned long @@
   arch/sh/mm/cache-sh2.c:49:17: sparse: expected void const volatile 
[noderef] __iomem *ptr
   arch/sh/mm/cache-sh2.c:49:17: sparse: got unsigned long
>> arch/sh/mm/cache-sh2.c:65:15: sparse: sparse: incorrect type in argument 1 
>> (different base types) @@ expected void const volatile [noderef] __iomem 
>> *ptr @@ got unsigned int @@
   arch/sh/mm/cache-sh2.c:65:15: sparse: expected void const volatile 
[noderef] __iomem *ptr
   arch/sh/mm/cache-sh2.c:65:15: sparse: got unsigned int
   arch/sh/mm/cache-sh2.c:67:9: sparse: sparse: incorrect type in argument 1 
(different base types) @@ expected void const volatile [noderef] __iomem 
*ptr @@ got unsigned int @@
   arch/sh/mm/cache-sh2.c:67:9: sparse: expected void const volatile 
[noderef] __iomem *ptr
   arch/sh/mm/cache-sh2.c:67:9: sparse: got unsigned int
--
   drivers/firewire/core-cdev.c:1088:21: sparse: sparse: incorrect type in 
initializer (different address spaces) @@ expected unsigned int const 
*__gu_addr @@ got unsigned int [noderef] __user * @@
   drivers/firewire/core-cdev.c:1088:21: sparse: expected unsigned int 
const *__gu_addr
   drivers/firewire/core-cdev.c:1088:21: sparse: got unsigned int [noderef] 
__user *
>> drivers/firewire/core-cdev.c:1088:21: sparse: sparse: incorrect type in 
>> argument 1 (different address spaces) @@ expected void const volatile 
>> [noderef] __user *ptr @@ got unsigned int const *__gu_addr @@
>> drivers/firewire/core-cdev.c:1088:21: sparse: expected void const 
>> volatile [noderef] __user *ptr
   drivers/firewire/core-cdev.c:1088:21: sparse: got unsigned int const 
*__gu_addr
--
   drivers/md/md.c:7693:21: sparse: sparse: incorrect type in initializer 
(different address spaces) @@ expected int const *__gu_addr @@ got int 
[noderef] __user * @@
   drivers/md/md.c:7693:21: sparse: expected int const *__gu_addr
   drivers/md/md.c:7693:21: sparse: got int [noderef] __user *
>> drivers/md/md.c:7693:21: sparse: sparse: incorrect type in argument 1 
>> (different address spaces) @@ expected void const volatile [noderef] 
>> __user *ptr @@ got int const *__gu_addr @@
>> drivers/md/md.c:7693:21: sparse: expected void const volatile [noderef] 
>> __user *ptr
   drivers/md/md.c:7693:21: sparse: got int const *__gu_addr
--
>> drivers/spi/spi-lp8841-rtc.c:112:17: sparse: sparse: incorrect type in 
>> argument 1 (different address spaces) @@ expected void const volatile 
>> [noderef] __iomem *ptr @@ got void *iomem @@
>> drivers/spi/spi-lp8841-rtc.c:112:17: sparse: expected void const 
>> volatile [noderef] __iomem *ptr
   drivers/spi/spi-lp8841-rtc.c:112:17: sparse: got

Re: [External] Re: [PATCH v3 05/21] mm/hugetlb: Introduce pgtable allocation/freeing helpers

2020-11-09 Thread Muchun Song
On Tue, Nov 10, 2020 at 2:33 PM Oscar Salvador  wrote:
>
> On Tue, Nov 10, 2020 at 02:08:46PM +0800, Muchun Song wrote:
> > The check should be added here.
> >
> >if (!pgtable)
> >return NULL;
> >
> > Just like my previous v2 patch does. In this case, we can drop those
> > checks. What do you think?
>
> It is too early for me, so bear with me.
>
> page_huge_pte will only return NULL in case we did not get to preallocate
> any pgtable right?

The page_huge_pte only returns NULL when we did consume the
page tables. Not each HugeTLB page need to split the vmemmap
page tables. We preallocate page tables for each HugeTLB page,
if we do not need to split PMD. We should free the preallocated
page tables.

Maybe you can see the comments of the other thread.

  [PATCH v3 09/21] mm/hugetlb: Free the vmemmap pages associated with
each hugetlb page

Thanks.

>
> What I was talimg about is that
> >
> > > page_huge_pte(page) = list_first_entry_or_null(>lru,
> > >struct page, lru);
>
> here we will get the either a pgtable entry or NULL in case we already 
> consumed
> all entries from the list.
> If that is the case, we can return NULL and let the caller known that we
> are done.
>
> Am I missing anything?


>
>
> --
> Oscar Salvador
> SUSE L3



--
Yours,
Muchun


Re: [PATCH 0/4] Add KRYO2XX Errata / mitigations data

2020-11-09 Thread Sai Prakash Ranjan

On 2020-11-05 15:03, Will Deacon wrote:

Hi Konrad,

[+Jeffrey]

On Thu, Nov 05, 2020 at 12:22:09AM +0100, Konrad Dybcio wrote:

This series adds Spectre mitigations and errata data for
Qualcomm KRYO2XX Gold (big) and Silver (LITTLE) series of
CPU cores, used for example in MSM8998 and SDM660-series SoCs.

Konrad Dybcio (4):
  arm64: Add MIDR value for KRYO2XX gold/silver CPU cores
  arm64: kpti: Add KRYO2XX gold/silver CPU cores to kpti safelist
  arm64: proton-pack: Add KRYO2XX silver CPUs to spectre-v2 safe-list
  arm64: cpu_errata: Apply Erratum 845719 to KRYO2XX Silver


This mostly looks fine to me, but I've added Jeffrey to check the MIDRs
because he's my go-to person for the Qualcomm numbering scheme.

Jeffrey -- please can you check these patches [1], especially the last 
patch

which has some cryptic revision number in there too?


Jeffrey can confirm this, but the MIDR is right and the cryptic revision
maps to cortex r0p4.

Thanks,
Sai

--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a 
member

of Code Aurora Forum, hosted by The Linux Foundation


Re: [kbuild] drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c:1300 create_engine_group() error: we previously assumed 'mirrored_eng_grp' could be null (see line 1256)

2020-11-09 Thread Herbert Xu
On Mon, Nov 09, 2020 at 03:29:19PM +0300, Dan Carpenter wrote:
>
> Possibly the "eng_grp->mirror.is_ena" means this is a false positive.
> Too hard to tell without more context.

Yes I think this is a false positive for this reason as is_ena is
set to true by setup_eng_grp_mirroring.

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


Re: [PATCH] ASoC: pcm512x: Add support for data formats RJ and LJ

2020-11-09 Thread Peter Ujfalusi



On 09/11/2020 23.21, Kirill Marinushkin wrote:
> Currently, pcm512x driver supports only I2S data format.
> This commit adds RJ and LJ as well.
> 
> I don't expect regression WRT existing sound cards, because:
> 
> * default value in corresponding register of pcm512x codec is 0 ==  I2S
> * existing in-tree sound cards with pcm512x codec are configured for I2S
> * i don't see how existing off-tree sound cards with pcm512x codec could be
>   configured differently - it would not work
> * tested explicitly, that there is no regression with Raspberry Pi +
>   sound card `sound/soc/bcm/hifiberry_dacplus.c`
> 
> Signed-off-by: Kirill Marinushkin 
> Cc: Mark Brown 
> Cc: Takashi Iwai 
> Cc: Liam Girdwood 
> Cc: Matthias Reichl 
> Cc: Kuninori Morimoto 
> Cc: Peter Ujfalusi 
> Cc: alsa-de...@alsa-project.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  sound/soc/codecs/pcm512x.c | 24 
>  1 file changed, 24 insertions(+)
> 
> diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c
> index 8153d3d01654..c6e975fb4a43 100644
> --- a/sound/soc/codecs/pcm512x.c
> +++ b/sound/soc/codecs/pcm512x.c
> @@ -1167,6 +1167,7 @@ static int pcm512x_hw_params(struct snd_pcm_substream 
> *substream,
>   struct snd_soc_component *component = dai->component;
>   struct pcm512x_priv *pcm512x = snd_soc_component_get_drvdata(component);
>   int alen;
> + int afmt;
>   int gpio;
>   int clock_output;
>   int master_mode;
> @@ -1195,6 +1196,22 @@ static int pcm512x_hw_params(struct snd_pcm_substream 
> *substream,
>   return -EINVAL;
>   }
>  
> + switch (pcm512x->fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
> + case SND_SOC_DAIFMT_I2S:
> + afmt = PCM512x_AFMT_I2S;
> + break;
> + case SND_SOC_DAIFMT_RIGHT_J:
> + afmt = PCM512x_AFMT_RTJ;
> + break;
> + case SND_SOC_DAIFMT_LEFT_J:
> + afmt = PCM512x_AFMT_LTJ;
> + break;
> + default:
> + dev_err(component->dev, "unsupported DAI format: 0x%x\n",
> + pcm512x->fmt);
> + return -EINVAL;
> + }
> +

The bus format and

>   switch (pcm512x->fmt & SND_SOC_DAIFMT_MASTER_MASK) {

>   case SND_SOC_DAIFMT_CBS_CFS:
>   ret = regmap_update_bits(pcm512x->regmap,

the clock generation role should be set in pcm512x_set_fmt(), in that
way you can deny specific setups earlier.

I would also add DSP_A and DSP_B modes at the same time, DSP_A would
need a write of 1 to register 41 (PCM512x_I2S_2, offset = 1), other
formats should set the offset to 0.

> @@ -1236,6 +1253,13 @@ static int pcm512x_hw_params(struct snd_pcm_substream 
> *substream,
>   return ret;
>   }
>  
> + ret = regmap_update_bits(pcm512x->regmap, PCM512x_I2S_1,
> +  PCM512x_AFMT, afmt);
> + if (ret != 0) {
> + dev_err(component->dev, "Failed to set data format: %d\n", ret);
> + return ret;
> + }
> +
>   if (pcm512x->pll_out) {
>   ret = regmap_write(pcm512x->regmap, PCM512x_FLEX_A, 0x11);
>   if (ret != 0) {
> 

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


[PATCH] MAINTAINERS: Add myself as arm sunxi soc maintainer

2020-11-09 Thread Frank Lee
From: Yangtao Li 

Add myself to sunxi maintainer so the mail can cc me.

Signed-off-by: Yangtao Li 
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 94ac10a153c7..0ddaf9641546 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1545,6 +1545,7 @@ F:drivers/clk/sunxi/
 
 ARM/Allwinner sunXi SoC support
 M: Maxime Ripard 
+M:  Yangtao Li 
 M: Chen-Yu Tsai 
 L: linux-arm-ker...@lists.infradead.org (moderated for non-subscribers)
 S: Maintained
-- 
2.28.0



linux-next: build warnings after merge of the rcu tree

2020-11-09 Thread Stephen Rothwell
Hi all,

After merging the rcu tree, today's linux-next build (htmldocs)
produced these warnings:

Documentation/RCU/Design/Requirements/Requirements.rst:119: WARNING: Malformed 
table.

+---+
| **Quick Quiz**:   |
+---+
| Wait a minute! You said that updaters can make useful forward |
| progress concurrently with readers, but pre-existing readers will |
| block synchronize_rcu()!!!|
| Just who are you trying to fool???|
+---+
| **Answer**:   |
+---+
| First, if updaters do not wish to be blocked by readers, they can use |
| call_rcu() or kfree_rcu(), which will be discussed later. |
| Second, even when using synchronize_rcu(), the other update-side  |
| code does run concurrently with readers, whether pre-existing or not. |
+---+
Documentation/RCU/Design/Requirements/Requirements.rst:178: WARNING: Malformed 
table.

+---+
| **Quick Quiz**:   |
+---+
| Why is the synchronize_rcu() on line 28 needed?   |
+---+
| **Answer**:   |
+---+
| Without that extra grace period, memory reordering could result in|
| do_something_dlm() executing do_something() concurrently with |
| the last bits of recovery().  |
+---+
Documentation/RCU/Design/Requirements/Requirements.rst:289: WARNING: Malformed 
table.

+---+
| **Quick Quiz**:   |
+---+
| But rcu_assign_pointer() does nothing to prevent the two  |
| assignments to ``p->a`` and ``p->b`` from being reordered. Can't that |
| also cause problems?  |
+---+
| **Answer**:   |
+---+
| No, it cannot. The readers cannot see either of these two fields  |
| until the assignment to ``gp``, by which time both fields are fully   |
| initialized. So reordering the assignments to ``p->a`` and ``p->b``   |
| cannot possibly cause any problems.   |
+---+
Documentation/RCU/Design/Requirements/Requirements.rst:430: WARNING: Malformed 
table.

+---+
| **Quick Quiz**:   |
+---+
| Without the rcu_dereference() or the rcu_access_pointer(),|
| what destructive optimizations might the compiler make use of?|
+---+
| **Answer**:   |
+---+
| Let's start with what happens to do_something_gp() if it fails to |
| use rcu_dereference(). It could reuse a value formerly fetched|
| from this same pointer. It could also fetch the pointer from ``gp``   |
| in a byte-at-a-time manner, resulting in *load tearing*, in turn  |
| resulting a bytewise mash-up of two distinct pointer values. It might |
| even use value-speculation optimizations, where it makes a wrong  |
| guess, but by the time it gets around to checking the value, an   |
| update has changed the pointer to match the wrong guess. Too bad  |
| about any dereferences that returned pre-initialization garbage in|
| the meantime! |
| For remove_gp_synchronous(), as long as all modifications to  |
| ``gp`` are carried out while holding ``gp_lock``, the above   |
| optimizations are harmless. However, ``sparse`` will complain if you  |
| define ``gp`` with ``__rcu`` and then access it without using either  |
| 

Re: [PATCH 1/2] cpufreq: dt: Don't (ab)use dev_pm_opp_get_opp_table() to create OPP table

2020-11-09 Thread Viresh Kumar
On 10-11-20, 07:57, Marek Szyprowski wrote:
> Hi Viresh,
> 
> On 10.11.2020 07:00, Viresh Kumar wrote:
> > On 09-11-20, 13:42, Marek Szyprowski wrote:
> >> This patch landed in linux next-20201109 as commit e8f7703f8fe5
> >> ("cpufreq: dt: Don't (ab)use dev_pm_opp_get_opp_table() to create OPP
> >> table"). Sadly it causes regression on some Samsung Exynos based boards:
> >>
> >> 8<--- cut here ---
> >> Unable to handle kernel paging request at virtual address ff37
> >> pgd = (ptrval)
> >> [ff37] *pgd=4841, *pte=, *ppte=
> >> Internal error: Oops: 27 [#1] PREEMPT SMP ARM
> >> Modules linked in:
> >> usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> >> CPU: 3 PID: 1 Comm: swapper/0 Not tainted 5.10.0-rc1-7-ge8f7703f8fe5
> >> #1908
> >> Hardware name: Samsung Exynos (Flattened Device Tree)
> >> PC is at dev_pm_opp_put_regulators+0x8/0xf0
> >> LR is at dt_cpufreq_probe+0x19c/0x3fc
> > Does this fix it for you ?
> 
> Yes, thanks!
> 
> Reported-by: Marek Szyprowski 
> 
> Tested-by: Marek Szyprowski 

Thanks. I have fixed the original patch itself and pushed for linux-next.

-- 
viresh


[PATCH] Replace a set of atomic_add()

2020-11-09 Thread Yejune Deng
a set of atomic_inc() looks more readable

Signed-off-by: Yejune Deng 
---
 drivers/net/wireless/st/cw1200/bh.c  | 10 +-
 drivers/net/wireless/st/cw1200/wsm.c |  8 
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/st/cw1200/bh.c 
b/drivers/net/wireless/st/cw1200/bh.c
index 02efe84..c364a39 100644
--- a/drivers/net/wireless/st/cw1200/bh.c
+++ b/drivers/net/wireless/st/cw1200/bh.c
@@ -85,7 +85,7 @@ int cw1200_register_bh(struct cw1200_common *priv)
 
 void cw1200_unregister_bh(struct cw1200_common *priv)
 {
-   atomic_add(1, >bh_term);
+   atomic_inc(>bh_term);
wake_up(>bh_wq);
 
flush_workqueue(priv->bh_workqueue);
@@ -107,7 +107,7 @@ void cw1200_irq_handler(struct cw1200_common *priv)
if (/* WARN_ON */(priv->bh_error))
return;
 
-   if (atomic_add_return(1, >bh_rx) == 1)
+   if (atomic_inc_return(>bh_rx) == 1)
wake_up(>bh_wq);
 }
 EXPORT_SYMBOL_GPL(cw1200_irq_handler);
@@ -120,7 +120,7 @@ void cw1200_bh_wakeup(struct cw1200_common *priv)
return;
}
 
-   if (atomic_add_return(1, >bh_tx) == 1)
+   if (atomic_inc_return(>bh_tx) == 1)
wake_up(>bh_wq);
 }
 
@@ -382,7 +382,7 @@ static int cw1200_bh_tx_helper(struct cw1200_common *priv,
BUG_ON(tx_len < sizeof(*wsm));
BUG_ON(__le16_to_cpu(wsm->len) != tx_len);
 
-   atomic_add(1, >bh_tx);
+   atomic_inc(>bh_tx);
 
tx_len = priv->hwbus_ops->align_size(
priv->hwbus_priv, tx_len);
@@ -537,7 +537,7 @@ static int cw1200_bh(void *arg)
pr_debug("[BH] Device resume.\n");
atomic_set(>bh_suspend, CW1200_BH_RESUMED);
wake_up(>bh_evt_wq);
-   atomic_add(1, >bh_rx);
+   atomic_inc(>bh_rx);
goto done;
}
 
diff --git a/drivers/net/wireless/st/cw1200/wsm.c 
b/drivers/net/wireless/st/cw1200/wsm.c
index d9b6147..99624dd 100644
--- a/drivers/net/wireless/st/cw1200/wsm.c
+++ b/drivers/net/wireless/st/cw1200/wsm.c
@@ -1139,7 +1139,7 @@ static int wsm_cmd_send(struct cw1200_common *priv,
pr_err("Outstanding outgoing frames:  %d\n", 
priv->hw_bufs_used);
 
/* Kill BH thread to report the error to the top layer. 
*/
-   atomic_add(1, >bh_term);
+   atomic_inc(>bh_term);
wake_up(>bh_wq);
ret = -ETIMEDOUT;
}
@@ -1160,7 +1160,7 @@ static int wsm_cmd_send(struct cw1200_common *priv,
 void wsm_lock_tx(struct cw1200_common *priv)
 {
wsm_cmd_lock(priv);
-   if (atomic_add_return(1, >tx_lock) == 1) {
+   if (atomic_inc_return(>tx_lock) == 1) {
if (wsm_flush_tx(priv))
pr_debug("[WSM] TX is locked.\n");
}
@@ -1169,7 +1169,7 @@ void wsm_lock_tx(struct cw1200_common *priv)
 
 void wsm_lock_tx_async(struct cw1200_common *priv)
 {
-   if (atomic_add_return(1, >tx_lock) == 1)
+   if (atomic_inc_return(>tx_lock) == 1)
pr_debug("[WSM] TX is locked (async).\n");
 }
 
@@ -1223,7 +1223,7 @@ bool wsm_flush_tx(struct cw1200_common *priv)
 void wsm_unlock_tx(struct cw1200_common *priv)
 {
int tx_lock;
-   tx_lock = atomic_sub_return(1, >tx_lock);
+   tx_lock = atomic_dec_return(>tx_lock);
BUG_ON(tx_lock < 0);
 
if (tx_lock == 0) {
-- 
1.9.1



Re: [PATCH 1/2] cpufreq: dt: Don't (ab)use dev_pm_opp_get_opp_table() to create OPP table

2020-11-09 Thread Marek Szyprowski
Hi Viresh,

On 10.11.2020 07:00, Viresh Kumar wrote:
> On 09-11-20, 13:42, Marek Szyprowski wrote:
>> This patch landed in linux next-20201109 as commit e8f7703f8fe5
>> ("cpufreq: dt: Don't (ab)use dev_pm_opp_get_opp_table() to create OPP
>> table"). Sadly it causes regression on some Samsung Exynos based boards:
>>
>> 8<--- cut here ---
>> Unable to handle kernel paging request at virtual address ff37
>> pgd = (ptrval)
>> [ff37] *pgd=4841, *pte=, *ppte=
>> Internal error: Oops: 27 [#1] PREEMPT SMP ARM
>> Modules linked in:
>> usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
>> CPU: 3 PID: 1 Comm: swapper/0 Not tainted 5.10.0-rc1-7-ge8f7703f8fe5
>> #1908
>> Hardware name: Samsung Exynos (Flattened Device Tree)
>> PC is at dev_pm_opp_put_regulators+0x8/0xf0
>> LR is at dt_cpufreq_probe+0x19c/0x3fc
> Does this fix it for you ?

Yes, thanks!

Reported-by: Marek Szyprowski 

Tested-by: Marek Szyprowski 

> diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
> index 66b3db5efb53..5aa3d4e3140d 100644
> --- a/drivers/cpufreq/cpufreq-dt.c
> +++ b/drivers/cpufreq/cpufreq-dt.c
> @@ -228,7 +228,7 @@ static int dt_cpufreq_early_init(struct device *dev, int 
> cpu)
>  if (ret != -EPROBE_DEFER)
>  dev_err(cpu_dev, "failed to set regulators: 
> %d\n",
>  ret);
> -   goto out;
> +   goto free_cpumask;
>  }
>  }
>   
> @@ -293,6 +293,7 @@ static int dt_cpufreq_early_init(struct device *dev, int 
> cpu)
>  dev_pm_opp_of_cpumask_remove_table(priv->cpus);
>  if (priv->opp_table)
>  dev_pm_opp_put_regulators(priv->opp_table);
> +free_cpumask:
>  free_cpumask_var(priv->cpus);
>  return ret;
>   }
>
>
Best regards
-- 
Marek Szyprowski, PhD
Samsung R Institute Poland



Re: [PATCH v22 06/23] LSM: Use lsmblob in security_secid_to_secctx

2020-11-09 Thread James Morris
On Wed, 4 Nov 2020, Casey Schaufler wrote:

> Change security_secid_to_secctx() to take a lsmblob as input
> instead of a u32 secid. It will then call the LSM hooks
> using the lsmblob element allocated for that module. The
> callers have been updated as well. This allows for the
> possibility that more than one module may be called upon
> to translate a secid to a string, as can occur in the
> audit code.
> 
> Signed-off-by: Casey Schaufler 
> Cc: net...@vger.kernel.org
> Cc: linux-au...@redhat.com

Ditto with this, + audit. Also, you should put primary maintainers on the 
To: line or they may miss the email.

-- 
James Morris




linux-next: build warnings after merge of the arm64 tree

2020-11-09 Thread Stephen Rothwell
Hi all,

After merging the arm64 tree, today's linux-next build (htmldocs)
produced these warnings:

Documentation/arm64/memory.rst:35: WARNING: Literal block ends without a blank 
line; unexpected unindent.
Documentation/arm64/memory.rst:53: WARNING: Literal block ends without a blank 
line; unexpected unindent.

Introduced by commit

  f4693c2716b3 ("arm64: mm: extend linear region for 52-bit VA configurations")

-- 
Cheers,
Stephen Rothwell


pgpuctls5UKOd.pgp
Description: OpenPGP digital signature


Re: [PATCH v22 05/23] LSM: Use lsmblob in security_secctx_to_secid

2020-11-09 Thread James Morris
On Wed, 4 Nov 2020, Casey Schaufler wrote:

> Change the security_secctx_to_secid interface to use a lsmblob
> structure in place of the single u32 secid in support of
> module stacking. Change its callers to do the same.
> 
> The security module hook is unchanged, still passing back a secid.
> The infrastructure passes the correct entry from the lsmblob.
> 
> Signed-off-by: Casey Schaufler 
> Cc: net...@vger.kernel.org

You probably need to include Netfilter maintainers specifically for this 
(added them + the Netfilter list).

This also needs signoffs from LSM owners.

-- 
James Morris




[RESEND PATCH 18/19] arm64: allwinner: a100: Add MMC related nodes

2020-11-09 Thread Frank Lee
From: Yangtao Li 

The A100 has 3 MMC controllers, one of them being especially targeted to
eMMC. Let's add nodes on dts.

Signed-off-by: Yangtao Li 
---
 .../arm64/boot/dts/allwinner/sun50i-a100.dtsi | 71 +++
 1 file changed, 71 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi 
b/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
index c731bb9727c2..4adfc7d4854a 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
@@ -169,12 +169,83 @@ pio: pinctrl@300b000 {
interrupt-controller;
#interrupt-cells = <3>;
 
+   mmc0_pins: mmc0-pins {
+   pins = "PF0", "PF1", "PF2", "PF3",
+  "PF4", "PF5";
+   function = "mmc0";
+   drive-strength = <30>;
+   bias-pull-up;
+   };
+
+   /omit-if-no-ref/
+   mmc1_pins: mmc1-pins {
+   pins = "PG0", "PG1", "PG2", "PG3",
+  "PG4", "PG5";
+   function = "mmc1";
+   drive-strength = <30>;
+   bias-pull-up;
+   };
+
+   mmc2_pins: mmc2-pins {
+   pins = "PC0", "PC1", "PC5", "PC6",
+  "PC8", "PC9", "PC10", "PC11",
+  "PC13", "PC14", "PC15", "PC16";
+   function = "mmc2";
+   drive-strength = <30>;
+   bias-pull-up;
+   };
+
uart0_pb_pins: uart0-pb-pins {
pins = "PB9", "PB10";
function = "uart0";
};
};
 
+   mmc0: mmc@402 {
+   compatible = "allwinner,sun50i-a100-mmc";
+   reg = <0x0402 0x1000>;
+   clocks = < CLK_BUS_MMC0>, < CLK_MMC0>;
+   clock-names = "ahb", "mmc";
+   resets = < RST_BUS_MMC0>;
+   reset-names = "ahb";
+   interrupts = ;
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins>;
+   status = "disabled";
+   #address-cells = <1>;
+   #size-cells = <0>;
+   };
+
+   mmc1: mmc@4021000 {
+   compatible = "allwinner,sun50i-a100-mmc";
+   reg = <0x04021000 0x1000>;
+   clocks = < CLK_BUS_MMC1>, < CLK_MMC1>;
+   clock-names = "ahb", "mmc";
+   resets = < RST_BUS_MMC1>;
+   reset-names = "ahb";
+   interrupts = ;
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins>;
+   status = "disabled";
+   #address-cells = <1>;
+   #size-cells = <0>;
+   };
+
+   mmc2: mmc@4022000 {
+   compatible = "allwinner,sun50i-a100-emmc";
+   reg = <0x04022000 0x1000>;
+   clocks = < CLK_BUS_MMC2>, < CLK_MMC2>;
+   clock-names = "ahb", "mmc";
+   resets = < RST_BUS_MMC2>;
+   reset-names = "ahb";
+   interrupts = ;
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins>;
+   status = "disabled";
+   #address-cells = <1>;
+   #size-cells = <0>;
+   };
+
uart0: serial@500 {
compatible = "snps,dw-apb-uart";
reg = <0x0500 0x400>;
-- 
2.28.0



[RESEND PATCH 19/19] arm64: dts: allwinner: a100: perf1: Add eMMC and MMC node

2020-11-09 Thread Frank Lee
From: Yangtao Li 

A100 perf1 hava MicroSD slot and on-board eMMC module, add support for them.

Signed-off-by: Yangtao Li 
---
 .../allwinner/sun50i-a100-allwinner-perf1.dts| 16 
 1 file changed, 16 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a100-allwinner-perf1.dts 
b/arch/arm64/boot/dts/allwinner/sun50i-a100-allwinner-perf1.dts
index ef205c9b8ff4..d102c50ff7c1 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a100-allwinner-perf1.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a100-allwinner-perf1.dts
@@ -39,6 +39,22 @@  {
status = "okay";
 };
 
+ {
+   vmmc-supply = <_dcdc1>;
+   cd-gpios = < 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
+   bus-width = <4>;
+   status = "okay";
+};
+
+ {
+   vmmc-supply = <_dcdc1>;
+   vqmmc-supply = <_aldo1>;
+   cap-mmc-hw-reset;
+   non-removable;
+   bus-width = <8>;
+   status = "okay";
+};
+
  {
status = "okay";
 };
-- 
2.28.0



Re: [PATCH v23 00/12] Landlock LSM

2020-11-09 Thread James Morris
On Tue, 3 Nov 2020, Mickaël Salaün wrote:

> Hi,
> 
> Can you please consider to merge this into the tree?
> 

I've added this to my tree:
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git 
landlock_lsm

and merged into next-testing (which is pulled into linux-next).


Please make any further changes against the branch in my tree.


-- 
James Morris



[PATCH] venus: guard load_scale

2020-11-09 Thread Fritz Koenig
load_scale can only be safely called after
the encoder has been initialized.

Signed-off-by: Fritz Koenig 
---
 drivers/media/platform/qcom/venus/pm_helpers.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/platform/qcom/venus/pm_helpers.h 
b/drivers/media/platform/qcom/venus/pm_helpers.h
index aa2f6afa23544..32e27db1fa740 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.h
+++ b/drivers/media/platform/qcom/venus/pm_helpers.h
@@ -35,6 +35,10 @@ static inline int venus_pm_load_scale(struct venus_inst 
*inst)
if (!core->pm_ops || !core->pm_ops->load_scale)
return 0;
 
+   if (inst->session_type == VIDC_SESSION_TYPE_ENC &&
+   inst->enc_state == VENUS_ENC_STATE_INIT)
+   return 0;
+
return core->pm_ops->load_scale(inst);
 }
 
-- 
2.29.2.299.gdc1121823c-goog



[RESEND PATCH 17/19] mmc: sunxi: add support for A100 mmc controller

2020-11-09 Thread Frank Lee
From: Yangtao Li 

This patch adds support for A100 MMC controller, which use word address
for internal dma.

Signed-off-by: Yangtao Li 
---
 drivers/mmc/host/sunxi-mmc.c | 28 +---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index fc62773602ec..1518b64112b7 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -244,6 +244,7 @@ struct sunxi_idma_des {
 
 struct sunxi_mmc_cfg {
u32 idma_des_size_bits;
+   u32 idma_des_shift;
const struct sunxi_mmc_clk_delay *clk_delays;
 
/* does the IP block support autocalibration? */
@@ -343,7 +344,7 @@ static int sunxi_mmc_init_host(struct sunxi_mmc_host *host)
/* Enable CEATA support */
mmc_writel(host, REG_FUNS, SDXC_CEATA_ON);
/* Set DMA descriptor list base address */
-   mmc_writel(host, REG_DLBA, host->sg_dma);
+   mmc_writel(host, REG_DLBA, host->sg_dma >> host->cfg->idma_des_shift);
 
rval = mmc_readl(host, REG_GCTRL);
rval |= SDXC_INTERRUPT_ENABLE_BIT;
@@ -373,8 +374,10 @@ static void sunxi_mmc_init_idma_des(struct sunxi_mmc_host 
*host,
 
next_desc += sizeof(struct sunxi_idma_des);
pdes[i].buf_addr_ptr1 =
-   cpu_to_le32(sg_dma_address(>sg[i]));
-   pdes[i].buf_addr_ptr2 = cpu_to_le32((u32)next_desc);
+   cpu_to_le32(sg_dma_address(>sg[i]) >>
+   host->cfg->idma_des_shift);
+   pdes[i].buf_addr_ptr2 = cpu_to_le32((u32)next_desc >>
+   host->cfg->idma_des_shift);
}
 
pdes[0].config |= cpu_to_le32(SDXC_IDMAC_DES0_FD);
@@ -1178,6 +1181,23 @@ static const struct sunxi_mmc_cfg sun50i_a64_emmc_cfg = {
.needs_new_timings = true,
 };
 
+static const struct sunxi_mmc_cfg sun50i_a100_cfg = {
+   .idma_des_size_bits = 16,
+   .idma_des_shift = 2,
+   .clk_delays = NULL,
+   .can_calibrate = true,
+   .mask_data0 = true,
+   .needs_new_timings = true,
+};
+
+static const struct sunxi_mmc_cfg sun50i_a100_emmc_cfg = {
+   .idma_des_size_bits = 13,
+   .idma_des_shift = 2,
+   .clk_delays = NULL,
+   .can_calibrate = true,
+   .needs_new_timings = true,
+};
+
 static const struct of_device_id sunxi_mmc_of_match[] = {
{ .compatible = "allwinner,sun4i-a10-mmc", .data = _a10_cfg },
{ .compatible = "allwinner,sun5i-a13-mmc", .data = _a13_cfg },
@@ -1186,6 +1206,8 @@ static const struct of_device_id sunxi_mmc_of_match[] = {
{ .compatible = "allwinner,sun9i-a80-mmc", .data = _a80_cfg },
{ .compatible = "allwinner,sun50i-a64-mmc", .data = _a64_cfg },
{ .compatible = "allwinner,sun50i-a64-emmc", .data = 
_a64_emmc_cfg },
+   { .compatible = "allwinner,sun50i-a100-mmc", .data = _a100_cfg },
+   { .compatible = "allwinner,sun50i-a100-emmc", .data = 
_a100_emmc_cfg },
{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, sunxi_mmc_of_match);
-- 
2.28.0



[RESEND PATCH 16/19] dt-bindings: mmc: sunxi: Add A100 compatibles

2020-11-09 Thread Frank Lee
From: Yangtao Li 

Add binding for A100's mmc and emmc controller.

Signed-off-by: Yangtao Li 
---
 .../devicetree/bindings/mmc/allwinner,sun4i-a10-mmc.yaml| 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/allwinner,sun4i-a10-mmc.yaml 
b/Documentation/devicetree/bindings/mmc/allwinner,sun4i-a10-mmc.yaml
index e82c9a07b6fb..41821f14ecaa 100644
--- a/Documentation/devicetree/bindings/mmc/allwinner,sun4i-a10-mmc.yaml
+++ b/Documentation/devicetree/bindings/mmc/allwinner,sun4i-a10-mmc.yaml
@@ -26,6 +26,8 @@ properties:
   - const: allwinner,sun9i-a80-mmc
   - const: allwinner,sun50i-a64-emmc
   - const: allwinner,sun50i-a64-mmc
+  - const: allwinner,sun50i-a100-emmc
+  - const: allwinner,sun50i-a100-mmc
   - items:
   - const: allwinner,sun8i-a83t-mmc
   - const: allwinner,sun7i-a20-mmc
-- 
2.28.0



Re: [PATCH AUTOSEL 4.19 18/21] kprobes: Tell lockdep about kprobe nesting

2020-11-09 Thread Masami Hiramatsu
Hi,

On Mon,  9 Nov 2020 22:55:38 -0500
Sasha Levin  wrote:

> From: "Steven Rostedt (VMware)" 
> 
> [ Upstream commit 645f224e7ba2f4200bf163153d384ceb0de5462e ]
> 
> Since the kprobe handlers have protection that prohibits other handlers from
> executing in other contexts (like if an NMI comes in while processing a
> kprobe, and executes the same kprobe, it will get fail with a "busy"
> return). Lockdep is unaware of this protection. Use lockdep's nesting api to
> differentiate between locks taken in INT3 context and other context to
> suppress the false warnings.
> 
> Link: 
> https://lore.kernel.org/r/20201102160234.fa0ae70915ad9e2b21c08...@kernel.org
> 

This fixes a lockdep false positive warning comes from commit e03b4a084ea6
("kprobes: Remove NMI context check"). Does anyone report that happen on the
stable kernel?

If not, you do not need this patch for stable kernels.

Thank you,


> Cc: Peter Zijlstra 
> Acked-by: Masami Hiramatsu 
> Signed-off-by: Steven Rostedt (VMware) 
> Signed-off-by: Sasha Levin 
> ---
>  kernel/kprobes.c | 25 +
>  1 file changed, 21 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> index 2161f519d4812..2ce9053de6ae4 100644
> --- a/kernel/kprobes.c
> +++ b/kernel/kprobes.c
> @@ -1204,7 +1204,13 @@ __acquires(hlist_lock)
>  
>   *head = _inst_table[hash];
>   hlist_lock = kretprobe_table_lock_ptr(hash);
> - raw_spin_lock_irqsave(hlist_lock, *flags);
> + /*
> +  * Nested is a workaround that will soon not be needed.
> +  * There's other protections that make sure the same lock
> +  * is not taken on the same CPU that lockdep is unaware of.
> +  * Differentiate when it is taken in NMI context.
> +  */
> + raw_spin_lock_irqsave_nested(hlist_lock, *flags, !!in_nmi());
>  }
>  NOKPROBE_SYMBOL(kretprobe_hash_lock);
>  
> @@ -1213,7 +1219,13 @@ static void kretprobe_table_lock(unsigned long hash,
>  __acquires(hlist_lock)
>  {
>   raw_spinlock_t *hlist_lock = kretprobe_table_lock_ptr(hash);
> - raw_spin_lock_irqsave(hlist_lock, *flags);
> + /*
> +  * Nested is a workaround that will soon not be needed.
> +  * There's other protections that make sure the same lock
> +  * is not taken on the same CPU that lockdep is unaware of.
> +  * Differentiate when it is taken in NMI context.
> +  */
> + raw_spin_lock_irqsave_nested(hlist_lock, *flags, !!in_nmi());
>  }
>  NOKPROBE_SYMBOL(kretprobe_table_lock);
>  
> @@ -1884,7 +1896,12 @@ static int pre_handler_kretprobe(struct kprobe *p, 
> struct pt_regs *regs)
>  
>   /* TODO: consider to only swap the RA after the last pre_handler fired 
> */
>   hash = hash_ptr(current, KPROBE_HASH_BITS);
> - raw_spin_lock_irqsave(>lock, flags);
> + /*
> +  * Nested is a workaround that will soon not be needed.
> +  * There's other protections that make sure the same lock
> +  * is not taken on the same CPU that lockdep is unaware of.
> +  */
> + raw_spin_lock_irqsave_nested(>lock, flags, 1);
>   if (!hlist_empty(>free_instances)) {
>   ri = hlist_entry(rp->free_instances.first,
>   struct kretprobe_instance, hlist);
> @@ -1895,7 +1912,7 @@ static int pre_handler_kretprobe(struct kprobe *p, 
> struct pt_regs *regs)
>   ri->task = current;
>  
>   if (rp->entry_handler && rp->entry_handler(ri, regs)) {
> - raw_spin_lock_irqsave(>lock, flags);
> + raw_spin_lock_irqsave_nested(>lock, flags, 1);
>   hlist_add_head(>hlist, >free_instances);
>   raw_spin_unlock_irqrestore(>lock, flags);
>   return 0;
> -- 
> 2.27.0
> 


-- 
Masami Hiramatsu 


[RESEND PATCH 15/19] arm64: allwinner: A100: enable EHCI, OHCI and USB PHY nodes in Perf1

2020-11-09 Thread Frank Lee
From: Yangtao Li 

Add USB support on A100 perf1 board, which include two USB2.0 port.

Signed-off-by: Yangtao Li 
---
 .../allwinner/sun50i-a100-allwinner-perf1.dts | 38 +++
 1 file changed, 38 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a100-allwinner-perf1.dts 
b/arch/arm64/boot/dts/allwinner/sun50i-a100-allwinner-perf1.dts
index d34c2bb1079f..ef205c9b8ff4 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a100-allwinner-perf1.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a100-allwinner-perf1.dts
@@ -7,6 +7,8 @@
 
 #include "sun50i-a100.dtsi"
 
+#include 
+
 /{
model = "Allwinner A100 Perf1";
compatible = "allwinner,a100-perf1", "allwinner,sun50i-a100";
@@ -18,6 +20,35 @@ aliases {
chosen {
stdout-path = "serial0:115200n8";
};
+
+   reg_usb1_vbus: usb1-vbus {
+   compatible = "regulator-fixed";
+   regulator-name = "usb1-vbus";
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <500>;
+   gpio = < 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
+   enable-active-high;
+   };
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+_otg {
+   status = "okay";
 };
 
  {
@@ -178,3 +209,10 @@  {
pinctrl-0 = <_pb_pins>;
status = "okay";
 };
+
+ {
+   usb0_id_det-gpios = < 7 8 GPIO_ACTIVE_HIGH>; /* PH8 */
+   usb0_vbus-supply = <_drivevbus>;
+   usb1_vbus-supply = <_usb1_vbus>;
+   status = "okay";
+};
-- 
2.28.0



[RESEND PATCH 14/19] arm64: dts: allwinner: a100: add usb related nodes

2020-11-09 Thread Frank Lee
From: Yangtao Li 

Allwinner A64 have two HCI USB controllers, a OTG controller and a USB
PHY device, let's add nodes on dts.

Signed-off-by: Yangtao Li 
---
 .../arm64/boot/dts/allwinner/sun50i-a100.dtsi | 91 +++
 1 file changed, 91 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi 
b/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
index 6aa3337ce0e9..c731bb9727c2 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
@@ -290,6 +290,97 @@ ths: thermal-sensor@5070400 {
#thermal-sensor-cells = <1>;
};
 
+   usbphy: phy@5100400 {
+   #phy-cells = <1>;
+   compatible = "allwinner,sun50i-a100-usb-phy";
+   reg = <0x05100400 0x14>,
+ <0x05101800 0x4>,
+ <0x05200800 0x4>;
+   reg-names = "phy_ctrl",
+   "pmu0",
+   "pmu1";
+   clocks = < CLK_USB_PHY0>,
+< CLK_USB_PHY1>;
+   clock-names = "usb0_phy",
+ "usb1_phy";
+   resets = < RST_USB_PHY0>,
+< RST_USB_PHY1>;
+   reset-names = "usb0_reset",
+ "usb1_reset";
+   status = "disabled";
+   };
+
+   ehci0: usb@5101000 {
+   compatible = "allwinner,sun50i-a100-ehci",
+"generic-ehci";
+   reg = <0x05101000 0x100>;
+   interrupts = ;
+   clocks = < CLK_BUS_OHCI0>,
+< CLK_BUS_EHCI0>,
+< CLK_USB_OHCI0>;
+   resets = < RST_BUS_OHCI0>,
+< RST_BUS_EHCI0>;
+   phys = < 0>;
+   phy-names = "usb";
+   status = "disabled";
+   };
+
+   ohci0: usb@5101400 {
+   compatible = "allwinner,sun50i-a100-ohci",
+"generic-ohci";
+   reg = <0x05101400 0x100>;
+   interrupts = ;
+   clocks = < CLK_BUS_OHCI0>,
+< CLK_USB_OHCI0>;
+   resets = < RST_BUS_OHCI0>;
+   phys = < 0>;
+   phy-names = "usb";
+   status = "disabled";
+   };
+
+   usb_otg: usb@510 {
+   compatible = "allwinner,sun50i-a100-musb",
+"allwinner,sun8i-h3-musb";
+   reg = <0x0510 0x0400>;
+   clocks = < CLK_BUS_OTG>;
+   resets = < RST_BUS_OTG>;
+   interrupts = ;
+   interrupt-names = "mc";
+   phys = < 0>;
+   phy-names = "usb";
+   extcon = < 0>;
+   dr_mode = "otg";
+   status = "disabled";
+   };
+
+   ehci1: usb@520 {
+   compatible = "allwinner,sun50i-a100-ehci",
+"generic-ehci";
+   reg = <0x0520 0x100>;
+   interrupts = ;
+   clocks = < CLK_BUS_OHCI1>,
+< CLK_BUS_EHCI1>,
+< CLK_USB_OHCI1>;
+   resets = < RST_BUS_OHCI1>,
+< RST_BUS_EHCI1>;
+   phys = < 1>;
+   phy-names = "usb";
+   status = "disabled";
+   };
+
+   ohci1: usb@5200400 {
+   compatible = "allwinner,sun50i-a100-ohci",
+"generic-ohci";
+   reg = <0x05200400 0x100>;
+   interrupts = ;
+   clocks = < CLK_BUS_OHCI1>,
+< CLK_USB_OHCI1>;
+   resets = < RST_BUS_OHCI1>;
+   phys = < 1>;
+   phy-names = "usb";
+   status = "disabled";
+   };
+
r_ccu: clock@701 {
compatible = "allwinner,sun50i-a100-r-ccu";
reg = <0x0701 0x300>;
-- 
2.28.0



linux-next: Tree for Nov 10

2020-11-09 Thread Stephen Rothwell
Hi all,

Changes since 20201109:

The drivers-memory tree still had its build failure.

The drm-misc tree gained a build failure for which I disabled a driver.

Non-merge commits (relative to Linus' tree): 3992
 4383 files changed, 417149 insertions(+), 70805 deletions(-)



I have created today's linux-next tree at
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
(patches at http://www.kernel.org/pub/linux/kernel/next/ ).  If you
are tracking the linux-next tree using git, you should not use "git pull"
to do so as that will try to merge the new linux-next release with the
old one.  You should use "git fetch" and checkout or reset to the new
master.

You can see which trees have been included by looking in the Next/Trees
file in the source.  There are also quilt-import.log and merge.log
files in the Next directory.  Between each merge, the tree was built
with a ppc64_defconfig for powerpc, an allmodconfig for x86_64, a
multi_v7_defconfig for arm and a native build of tools/perf. After
the final fixups (if any), I do an x86_64 modules_install followed by
builds for x86_64 allnoconfig, powerpc allnoconfig (32 and 64 bit),
ppc44x_defconfig, allyesconfig and pseries_le_defconfig and i386, sparc
and sparc64 defconfig and htmldocs. And finally, a simple boot test
of the powerpc pseries_le_defconfig kernel in qemu (with and without
kvm enabled).

Below is a summary of the state of the merge.

I am currently merging 326 trees (counting Linus' and 85 trees of bug
fix patches pending for the current merge release).

Stats about the size of the tree over time can be seen at
http://neuling.org/linux-next-size.html .

Status of my local build tests will be at
http://kisskb.ellerman.id.au/linux-next .  If maintainers want to give
advice about cross compilers/configs that work, we are always open to add
more builds.

Thanks to Randy Dunlap for doing many randconfig builds.  And to Paul
Gortmaker for triage and bug fixes.

-- 
Cheers,
Stephen Rothwell

$ git checkout master
$ git reset --hard stable
Merging origin/master (407ab579637c Merge tag 'for-linus' of 
git://git.kernel.org/pub/scm/virt/kvm/kvm)
Merging fixes/fixes (9123e3a74ec7 Linux 5.9-rc1)
Merging kbuild-current/fixes (d1889589a4f5 builddeb: Fix rootless build in 
setuid/setgid directory)
Merging arc-current/for-curr (3b57533b460c ARC: [plat-hsdk] Remap CCMs super 
early in asm boot trampoline)
Merging arm-current/fixes (9fa2e7af3d53 ARM: 9019/1: kprobes: Avoid 
fortify_panic() when copying optprobe template)
Merging arm64-fixes/for-next/fixes (108aa503657e arm64: kexec_file: try more 
regions if loading segments fails)
Merging arm-soc-fixes/arm/fixes (3d696f42c7f4 soc: ti: ti_sci_pm_domains: check 
for proper args count in xlate)
Merging drivers-memory-fixes/fixes (3650b228f83a Linux 5.10-rc1)
Merging m68k-current/for-linus (50c5feeea0af ide/macide: Convert Mac IDE driver 
to platform driver)
Merging powerpc-fixes/fixes (01776f070ffc powerpc/32s: Use relocation offset 
when setting early hash table)
Merging s390-fixes/fixes (ce9dfafe29be s390: fix system call exit path)
Merging sparc/master (0a95a6d1a4cd sparc: use for_each_child_of_node() macro)
Merging fscrypt-current/for-stable (92cfcd030e4b fscrypt: remove reachable WARN 
in fscrypt_setup_iv_ino_lblk_32_key())
Merging net/master (4e0396c59559 net: marvell: prestera: fix compilation with 
CONFIG_BRIDGE=m)
Merging bpf/master (abbaa433de07 bpf: Fix passing zero to PTR_ERR() in 
bpf_btf_printf_prepare)
Merging ipsec/master (4e0396c59559 net: marvell: prestera: fix compilation with 
CONFIG_BRIDGE=m)
Merging netfilter/master (fea07a487c6d net: openvswitch: silence suspicious RCU 
usage warning)
Merging ipvs/master (fea07a487c6d net: openvswitch: silence suspicious RCU 
usage warning)
Merging wireless-drivers/master (d85b4b2bf2d4 MAINTAINERS: update maintainers 
list for Cypress)
Merging mac80211/master (2aaf09a0e784 r8169: work around short packet hw bug on 
RTL8125)
Merging rdma-fixes/for-rc (21fcdeec09ff RDMA/srpt: Fix typo in 
srpt_unregister_mad_agent docstring)
Merging sound-current/for-linus (446b8185f0c3 ALSA: hda/realtek - Add supported 
for Lenovo ThinkPad Headset Button)
Merging sound-asoc-fixes/for-linus (9ade6faf77a6 Merge remote-tracking branch 
'asoc/for-5.10' into asoc-linus)
Merging regmap-fixes/for-linus (780f88b04704 Merge remote-tracking branch 
'regmap/for-5.10' into regmap-linus)
Merging regulator-fixes/for-linus (cf1ad559a20d regulator: defer probe when 
trying to get voltage from unresolved supply)
Merging spi-fixes/for-linus (62dce4e3f648 Merge remote-tracking branch 
'spi/for-5.10' into spi-linus)
Merging pci-current/for-linus (832ea234277a PCI: mvebu: Fix duplicate resource 
requests)
Merging driver-core.current/driver-core-linus (f8394f232b1e Linux 5.10-rc3)
Merging tty.current/tty-linus (f8394f232b1e Linux 5.10-rc3)
Merging usb.current/usb-linus (f8394f232b1e Linux 5

Re: [External] Re: [PATCH v3 09/21] mm/hugetlb: Free the vmemmap pages associated with each hugetlb page

2020-11-09 Thread Muchun Song
On Tue, Nov 10, 2020 at 2:51 AM Oscar Salvador  wrote:
>
> On Sun, Nov 08, 2020 at 10:11:01PM +0800, Muchun Song wrote:
> > +static inline int freed_vmemmap_hpage(struct page *page)
> > +{
> > + return atomic_read(>_mapcount) + 1;
> > +}
> > +
> > +static inline int freed_vmemmap_hpage_inc(struct page *page)
> > +{
> > + return atomic_inc_return_relaxed(>_mapcount) + 1;
> > +}
> > +
> > +static inline int freed_vmemmap_hpage_dec(struct page *page)
> > +{
> > + return atomic_dec_return_relaxed(>_mapcount) + 1;
> > +}
>
> Are these relaxed any different that the normal ones on x86_64?
> I got confused following the macros.

A PTE table can contain 64 HugeTLB(2MB) page's struct page structures.
So I use the freed_vmemmap_hpage to indicate how many HugeTLB pages
that it's vmemmap pages are already freed to buddy.

Once vmemmap pages of a HugeTLB page are freed, we call the
freed_vmemmap_hpage_inc, when freeing a HugeTLB to the buddy,
we should call freed_vmemmap_hpage_dec.

If the freed_vmemmap_hpage hit zero when free HugeTLB, we try to merge
the PTE table to PMD(now only support gigantic pages). This can refer to

  [PATCH v3 19/21] mm/hugetlb: Merge pte to huge pmd only for gigantic

Thanks.

>
> > +static void __free_huge_page_pte_vmemmap(struct page *reuse, pte_t *ptep,
> > +  unsigned long start,
> > +  unsigned int nr_free,
> > +  struct list_head *free_pages)
> > +{
> > + /* Make the tail pages are mapped read-only. */
> > + pgprot_t pgprot = PAGE_KERNEL_RO;
> > + pte_t entry = mk_pte(reuse, pgprot);
> > + unsigned long addr;
> > + unsigned long end = start + (nr_free << PAGE_SHIFT);
>
> See below.
>
> > +static void __free_huge_page_pmd_vmemmap(struct hstate *h, pmd_t *pmd,
> > +  unsigned long addr,
> > +  struct list_head *free_pages)
> > +{
> > + unsigned long next;
> > + unsigned long start = addr + RESERVE_VMEMMAP_NR * PAGE_SIZE;
> > + unsigned long end = addr + vmemmap_pages_size_per_hpage(h);
> > + struct page *reuse = NULL;
> > +
> > + addr = start;
> > + do {
> > + unsigned int nr_pages;
> > + pte_t *ptep;
> > +
> > + ptep = pte_offset_kernel(pmd, addr);
> > + if (!reuse)
> > + reuse = pte_page(ptep[-1]);
>
> Can we define a proper name for that instead of -1?
>
> e.g: TAIL_PAGE_REUSE or something like that.

OK, will do.

>
> > +
> > + next = vmemmap_hpage_addr_end(addr, end);
> > + nr_pages = (next - addr) >> PAGE_SHIFT;
> > + __free_huge_page_pte_vmemmap(reuse, ptep, addr, nr_pages,
> > +  free_pages);
>
> Why not passing next instead of nr_pages? I think it makes more sense.
> As a bonus we can kill the variable.

Good catch. We can pass next instead of nr_pages. Thanks.


>
> > +static void split_vmemmap_huge_page(struct hstate *h, struct page *head,
> > + pmd_t *pmd)
> > +{
> > + pgtable_t pgtable;
> > + unsigned long start = (unsigned long)head & VMEMMAP_HPAGE_MASK;
> > + unsigned long addr = start;
> > + unsigned int nr = pgtable_pages_to_prealloc_per_hpage(h);
> > +
> > + while (nr-- && (pgtable = vmemmap_pgtable_withdraw(head))) {
>
> The same with previous patches, I would scrap "nr" and its use.
>
> > + VM_BUG_ON(freed_vmemmap_hpage(pgtable));
>
> I guess here we want to check whether we already call free_huge_page_vmemmap
> on this range?
> For this to have happened, the locking should have failed, right?

Only the first HugeTLB page should split the PMD to PTE. The other 63
HugeTLB pages
do not need to split. Here I want to make sure we are the first.

>
> > +static void free_huge_page_vmemmap(struct hstate *h, struct page *head)
> > +{
> > + pmd_t *pmd;
> > + spinlock_t *ptl;
> > + LIST_HEAD(free_pages);
> > +
> > + if (!free_vmemmap_pages_per_hpage(h))
> > + return;
> > +
> > + pmd = vmemmap_to_pmd(head);
> > + ptl = vmemmap_pmd_lock(pmd);
> > + if (vmemmap_pmd_huge(pmd)) {
> > + VM_BUG_ON(!pgtable_pages_to_prealloc_per_hpage(h));
>
> I think that checking for free_vmemmap_pages_per_hpage is enough.
> In the end, pgtable_pages_to_prealloc_per_hpage uses 
> free_vmemmap_pages_per_hpage.

The free_vmemmap_pages_per_hpage is not enough. See the comments above.

Thanks.

>
>
> --
> Oscar Salvador
> SUSE L3



--
Yours,
Muchun


[RESEND PATCH 13/19] phy: sun4i-usb: add support for A100 USB PHY

2020-11-09 Thread Frank Lee
From: Yangtao Li 

Add support for a100's usb phy, which with 2 PHYs.

Signed-off-by: Yangtao Li 
---
 drivers/phy/allwinner/phy-sun4i-usb.c | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c 
b/drivers/phy/allwinner/phy-sun4i-usb.c
index a6900495baa5..1a0e403131e7 100644
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
@@ -107,6 +107,7 @@ enum sun4i_usb_phy_type {
sun8i_r40_phy,
sun8i_v3s_phy,
sun50i_a64_phy,
+   sun50i_a100_phy,
sun50i_h6_phy,
 };
 
@@ -289,7 +290,13 @@ static int sun4i_usb_phy_init(struct phy *_phy)
}
 
if (data->cfg->type == sun8i_a83t_phy ||
+   data->cfg->type == sun50i_a100_phy ||
data->cfg->type == sun50i_h6_phy) {
+   if (phy->pmu && data->cfg->enable_pmu_unk1) {
+   val = readl(phy->pmu + REG_PMU_UNK1);
+   writel(val & ~BIT(3), phy->pmu + REG_PMU_UNK1);
+   }
+
if (phy->index == 0) {
val = readl(data->base + data->cfg->phyctl_offset);
val |= PHY_CTL_VBUSVLDEXT;
@@ -339,6 +346,7 @@ static int sun4i_usb_phy_exit(struct phy *_phy)
 
if (phy->index == 0) {
if (data->cfg->type == sun8i_a83t_phy ||
+   data->cfg->type == sun50i_a100_phy ||
data->cfg->type == sun50i_h6_phy) {
void __iomem *phyctl = data->base +
data->cfg->phyctl_offset;
@@ -960,6 +968,16 @@ static const struct sun4i_usb_phy_cfg sun50i_a64_cfg = {
.phy0_dual_route = true,
 };
 
+static const struct sun4i_usb_phy_cfg sun50i_a100_cfg = {
+   .num_phys = 2,
+   .type = sun50i_a100_phy,
+   .disc_thresh = 3,
+   .phyctl_offset = REG_PHYCTL_A33,
+   .dedicated_clocks = true,
+   .enable_pmu_unk1 = true,
+   .phy0_dual_route = true,
+};
+
 static const struct sun4i_usb_phy_cfg sun50i_h6_cfg = {
.num_phys = 4,
.type = sun50i_h6_phy,
@@ -983,6 +1001,7 @@ static const struct of_device_id sun4i_usb_phy_of_match[] 
= {
{ .compatible = "allwinner,sun8i-v3s-usb-phy", .data = _v3s_cfg },
{ .compatible = "allwinner,sun50i-a64-usb-phy",
  .data = _a64_cfg},
+   { .compatible = "allwinner,sun50i-a100-usb-phy", .data = 
_a100_cfg },
{ .compatible = "allwinner,sun50i-h6-usb-phy", .data = _h6_cfg },
{ },
 };
-- 
2.28.0



[RESEND PATCH 12/19] dt-bindings: Add bindings for USB phy on Allwinner A100

2020-11-09 Thread Frank Lee
From: Yangtao Li 

Add a device tree binding for the A100's USB PHY.

Signed-off-by: Yangtao Li 
---
 .../phy/allwinner,sun50i-a100-usb-phy.yaml| 105 ++
 1 file changed, 105 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/phy/allwinner,sun50i-a100-usb-phy.yaml

diff --git 
a/Documentation/devicetree/bindings/phy/allwinner,sun50i-a100-usb-phy.yaml 
b/Documentation/devicetree/bindings/phy/allwinner,sun50i-a100-usb-phy.yaml
new file mode 100644
index ..cc9bbebe2bd7
--- /dev/null
+++ b/Documentation/devicetree/bindings/phy/allwinner,sun50i-a100-usb-phy.yaml
@@ -0,0 +1,105 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/phy/allwinner,sun50i-a100-usb-phy.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Allwinner A100 USB PHY Device Tree Bindings
+
+maintainers:
+  - Yangtao Li 
+
+properties:
+  "#phy-cells":
+const: 1
+
+  compatible:
+const: allwinner,sun50i-a100-usb-phy
+
+  reg:
+items:
+  - description: PHY Control registers
+  - description: PHY PMU0 registers
+  - description: PHY PMU1 registers
+
+  reg-names:
+items:
+  - const: phy_ctrl
+  - const: pmu0
+  - const: pmu1
+
+  clocks:
+items:
+  - description: USB OTG PHY bus clock
+  - description: USB Host 0 PHY bus clock
+
+  clock-names:
+items:
+  - const: usb0_phy
+  - const: usb1_phy
+
+  resets:
+items:
+  - description: USB OTG reset
+  - description: USB Host 1 Controller reset
+
+  reset-names:
+items:
+  - const: usb0_reset
+  - const: usb1_reset
+
+  usb0_id_det-gpios:
+description: GPIO to the USB OTG ID pin
+
+  usb0_vbus_det-gpios:
+description: GPIO to the USB OTG VBUS detect pin
+
+  usb0_vbus_power-supply:
+description: Power supply to detect the USB OTG VBUS
+
+  usb0_vbus-supply:
+description: Regulator controlling USB OTG VBUS
+
+  usb1_vbus-supply:
+description: Regulator controlling USB1 Host controller
+
+required:
+  - "#phy-cells"
+  - compatible
+  - clocks
+  - clock-names
+  - reg
+  - reg-names
+  - resets
+  - reset-names
+
+additionalProperties: false
+
+examples:
+  - |
+#include 
+#include 
+#include 
+
+phy@5100400 {
+#phy-cells = <1>;
+compatible = "allwinner,sun50i-a100-usb-phy";
+reg = <0x05100400 0x14>,
+  <0x05101800 0x4>,
+  <0x05200800 0x4>;
+reg-names = "phy_ctrl",
+"pmu0",
+"pmu1";
+clocks = < CLK_USB_PHY0>,
+ < CLK_USB_PHY1>;
+clock-names = "usb0_phy",
+  "usb1_phy";
+resets = < RST_USB_PHY0>,
+ < RST_USB_PHY1>;
+reset-names = "usb0_reset",
+  "usb1_reset";
+usb0_id_det-gpios = < 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
+usb0_vbus_power-supply = <_power_supply>;
+usb0_vbus-supply = <_drivevbus>;
+usb1_vbus-supply = <_usb1_vbus>;
+};
-- 
2.28.0



[RESEND PATCH 11/19] arm64: dts: allwinner: a100: add watchdog node

2020-11-09 Thread Frank Lee
From: Yangtao Li 

Declare A100's watchdog in the device-tree.

Signed-off-by: Yangtao Li 
---
 arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi 
b/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
index 01ff53b5a7a8..6aa3337ce0e9 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
@@ -144,6 +144,14 @@ ths_calibration: calib@14 {
};
};
 
+   watchdog@30090a0 {
+   compatible = "allwinner,sun50i-a100-wdt",
+"allwinner,sun6i-a31-wdt";
+   reg = <0x030090a0 0x20>;
+   interrupts = ;
+   clocks = <>;
+   };
+
pio: pinctrl@300b000 {
compatible = "allwinner,sun50i-a100-pinctrl";
reg = <0x0300b000 0x400>;
-- 
2.28.0



[RESEND PATCH 10/19] dt-bindings: watchdog: sun4i: Add A100 compatible

2020-11-09 Thread Frank Lee
From: Yangtao Li 

Add a binding for A100's watchdog controller.

Signed-off-by: Yangtao Li 
---
 .../devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml  | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml 
b/Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml
index e8f226376108..5ac607de8be4 100644
--- a/Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml
@@ -21,6 +21,9 @@ properties:
   - items:
   - const: allwinner,sun50i-a64-wdt
   - const: allwinner,sun6i-a31-wdt
+  - items:
+  - const: allwinner,sun50i-a100-wdt
+  - const: allwinner,sun6i-a31-wdt
   - items:
   - const: allwinner,sun50i-h6-wdt
   - const: allwinner,sun6i-a31-wdt
-- 
2.28.0



Re: [PATCH v2 0/3] xfrm/compat: syzbot-found fixes

2020-11-09 Thread Steffen Klassert
On Mon, Nov 02, 2020 at 04:14:44PM +, Dmitry Safonov wrote:
> v2: Added "Fixes" tags to the patches.
> 
> WARN_ON() for XFRMA_UNSPEC translation which likely no-one except
> syzkaller uses; properly zerofy tail-padding for 64-bit attribute;
> don't use __GFP_ZERO as the memory is initialized during translation.
> 
> Cc: Steffen Klassert 
> Cc: "David S. Miller" 
> Cc: Jakub Kicinski 
> Cc: Herbert Xu 
> Cc: Hillf Danton 
> Cc: net...@vger.kernel.org
> 
> Thanks,
>  Dmitry
> 
> Dmitry Safonov (3):
>   xfrm/compat: Translate by copying XFRMA_UNSPEC attribute
>   xfrm/compat: memset(0) 64-bit padding at right place
>   xfrm/compat: Don't allocate memory with __GFP_ZERO

Series applied, thanks a lot Dmitry!


[RESEND PATCH 09/19] phy: allwinner: Convert to devm_platform_ioremap_* API

2020-11-09 Thread Frank Lee
From: Yangtao Li 

Use the devm_platform_ioremap_resource_byname() and
devm_platform_ioremap_resource helper to simplify the code.

Signed-off-by: Yangtao Li 
---
 drivers/phy/allwinner/phy-sun4i-usb.c   | 9 +++--
 drivers/phy/allwinner/phy-sun50i-usb3.c | 4 +---
 drivers/phy/allwinner/phy-sun6i-mipi-dphy.c | 4 +---
 drivers/phy/allwinner/phy-sun9i-usb.c   | 4 +---
 4 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c 
b/drivers/phy/allwinner/phy-sun4i-usb.c
index 0f1888b55dbd..a6900495baa5 100644
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
@@ -686,7 +686,6 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
struct device *dev = >dev;
struct device_node *np = dev->of_node;
struct phy_provider *phy_provider;
-   struct resource *res;
int i, ret;
 
data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
@@ -700,8 +699,7 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
if (!data->cfg)
return -EINVAL;
 
-   res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy_ctrl");
-   data->base = devm_ioremap_resource(dev, res);
+   data->base = devm_platform_ioremap_resource_byname(pdev, "phy_ctrl");
if (IS_ERR(data->base))
return PTR_ERR(data->base);
 
@@ -796,9 +794,8 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
 
if (i || data->cfg->phy0_dual_route) { /* No pmu for musb */
snprintf(name, sizeof(name), "pmu%d", i);
-   res = platform_get_resource_byname(pdev,
-   IORESOURCE_MEM, name);
-   phy->pmu = devm_ioremap_resource(dev, res);
+   phy->pmu = devm_platform_ioremap_resource_byname(pdev,
+name);
if (IS_ERR(phy->pmu))
return PTR_ERR(phy->pmu);
}
diff --git a/drivers/phy/allwinner/phy-sun50i-usb3.c 
b/drivers/phy/allwinner/phy-sun50i-usb3.c
index b1c04f71a31d..84055b720016 100644
--- a/drivers/phy/allwinner/phy-sun50i-usb3.c
+++ b/drivers/phy/allwinner/phy-sun50i-usb3.c
@@ -134,7 +134,6 @@ static int sun50i_usb3_phy_probe(struct platform_device 
*pdev)
struct sun50i_usb3_phy *phy;
struct device *dev = >dev;
struct phy_provider *phy_provider;
-   struct resource *res;
 
phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL);
if (!phy)
@@ -153,8 +152,7 @@ static int sun50i_usb3_phy_probe(struct platform_device 
*pdev)
return PTR_ERR(phy->reset);
}
 
-   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   phy->regs = devm_ioremap_resource(dev, res);
+   phy->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(phy->regs))
return PTR_ERR(phy->regs);
 
diff --git a/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c 
b/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c
index 1fa761ba6cbb..f0bc87d654d4 100644
--- a/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c
+++ b/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c
@@ -253,15 +253,13 @@ static int sun6i_dphy_probe(struct platform_device *pdev)
 {
struct phy_provider *phy_provider;
struct sun6i_dphy *dphy;
-   struct resource *res;
void __iomem *regs;
 
dphy = devm_kzalloc(>dev, sizeof(*dphy), GFP_KERNEL);
if (!dphy)
return -ENOMEM;
 
-   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   regs = devm_ioremap_resource(>dev, res);
+   regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(regs)) {
dev_err(>dev, "Couldn't map the DPHY encoder 
registers\n");
return PTR_ERR(regs);
diff --git a/drivers/phy/allwinner/phy-sun9i-usb.c 
b/drivers/phy/allwinner/phy-sun9i-usb.c
index fc6784dd7fa0..2f9e60c188b8 100644
--- a/drivers/phy/allwinner/phy-sun9i-usb.c
+++ b/drivers/phy/allwinner/phy-sun9i-usb.c
@@ -117,7 +117,6 @@ static int sun9i_usb_phy_probe(struct platform_device *pdev)
struct device *dev = >dev;
struct device_node *np = dev->of_node;
struct phy_provider *phy_provider;
-   struct resource *res;
 
phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL);
if (!phy)
@@ -156,8 +155,7 @@ static int sun9i_usb_phy_probe(struct platform_device *pdev)
}
}
 
-   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   phy->pmu = devm_ioremap_resource(dev, res);
+   phy->pmu = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(phy->pmu))
return PTR_ERR(phy->pmu);
 
-- 
2.28.0



[PATCH RESEND 2/2] perf test: Update branch sample parttern for cs-etm

2020-11-09 Thread Leo Yan
Since the commit 943b69ac1884 ("perf parse-events: Set exclude_guest=1
for user-space counting"), 'exclude_guest=1' is set for user-space
counting; and the branch sample's modifier has been altered, the sample
event name has been changed from "branches:u:" to "branches:uH:", which
gives out info for "user-space and host counting".

But the cs-etm testing's regular expression cannot match the updated
branch sample event and leads to test failure.

This patch updates the branch sample parttern by using a more flexible
expression '.*' to match branch sample's modifiers, so that allows the
testing to work as expected.

Fixes: 943b69ac1884 ("perf parse-events: Set exclude_guest=1 for user-space 
counting")
Signed-off-by: Leo Yan 
---
 tools/perf/tests/shell/test_arm_coresight.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/shell/test_arm_coresight.sh 
b/tools/perf/tests/shell/test_arm_coresight.sh
index 59d847d4981d..18fde2f179cd 100755
--- a/tools/perf/tests/shell/test_arm_coresight.sh
+++ b/tools/perf/tests/shell/test_arm_coresight.sh
@@ -44,7 +44,7 @@ perf_script_branch_samples() {
#   touch  6512  1 branches:u:  b22082e0 
strcmp+0xa0 (/lib/aarch64-linux-gnu/ld-2.27.so)
#   touch  6512  1 branches:u:  b2208320 
strcmp+0xe0 (/lib/aarch64-linux-gnu/ld-2.27.so)
perf script -F,-time -i ${perfdata} | \
-   egrep " +$1 +[0-9]+ .* +branches:([u|k]:)? +"
+   egrep " +$1 +[0-9]+ .* +branches:(.*:)? +"
 }
 
 perf_report_branch_samples() {
-- 
2.17.1



[PATCH RESEND 1/2] perf test: Fix a typo in cs-etm testing

2020-11-09 Thread Leo Yan
Fix a typo: s/devce_name/device_name.

Fixes: fe0aed19b266 ("perf test: Introduce script for Arm CoreSight testing")
Signed-off-by: Leo Yan 
---

Resend patches for adding "Fixes" tags.

 tools/perf/tests/shell/test_arm_coresight.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/shell/test_arm_coresight.sh 
b/tools/perf/tests/shell/test_arm_coresight.sh
index 8d84fdbed6a6..59d847d4981d 100755
--- a/tools/perf/tests/shell/test_arm_coresight.sh
+++ b/tools/perf/tests/shell/test_arm_coresight.sh
@@ -105,7 +105,7 @@ arm_cs_iterate_devices() {
# `> device_name = 'tmc_etf0'
device_name=$(basename $path)
 
-   if is_device_sink $path $devce_name; then
+   if is_device_sink $path $device_name; then
 
record_touch_file $device_name $2 &&
perf_script_branch_samples touch &&
-- 
2.17.1



Re: [External] Re: [PATCH v3 05/21] mm/hugetlb: Introduce pgtable allocation/freeing helpers

2020-11-09 Thread Oscar Salvador
On Tue, Nov 10, 2020 at 02:08:46PM +0800, Muchun Song wrote:
> The check should be added here.
> 
>if (!pgtable)
>return NULL;
> 
> Just like my previous v2 patch does. In this case, we can drop those
> checks. What do you think?

It is too early for me, so bear with me.

page_huge_pte will only return NULL in case we did not get to preallocate
any pgtable right?

What I was talimg about is that 
> 
> > page_huge_pte(page) = list_first_entry_or_null(>lru,
> >struct page, lru);

here we will get the either a pgtable entry or NULL in case we already consumed
all entries from the list.
If that is the case, we can return NULL and let the caller known that we
are done.

Am I missing anything?


-- 
Oscar Salvador
SUSE L3


[RESEND PATCH 08/19] phy: sun4i-usb: remove enable_pmu_unk1 from sun50i_h6_cfg

2020-11-09 Thread Frank Lee
From: Yangtao Li 

For the current code, enable_pmu_unk1 only works in non-a83t and non-h6
types. So let's delete it from the sun50i_h6_cfg.

Signed-off-by: Yangtao Li 
---
 drivers/phy/allwinner/phy-sun4i-usb.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c 
b/drivers/phy/allwinner/phy-sun4i-usb.c
index 651d5e2a25ce..0f1888b55dbd 100644
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
@@ -969,7 +969,6 @@ static const struct sun4i_usb_phy_cfg sun50i_h6_cfg = {
.disc_thresh = 3,
.phyctl_offset = REG_PHYCTL_A33,
.dedicated_clocks = true,
-   .enable_pmu_unk1 = true,
.phy0_dual_route = true,
.missing_phys = BIT(1) | BIT(2),
 };
-- 
2.28.0



Re: [PATCH] x86/mce: Check for hypervisor before enabling additional error logging

2020-11-09 Thread Borislav Petkov
On Mon, Nov 09, 2020 at 03:24:02PM -0800, Luck, Tony wrote:
> Booting as a guest under KVM results in error messages about
> unchecked MSR access:
> 
> [6.814328][T0] unchecked MSR access error: RDMSR from 0x17f at rIP: 
> 0x84483f16 (mce_intel_feature_init+0x156/0x270)
> 
> because KVM doesn't provide emulation for random model specific registers.
> 
> Check for X86_FEATURE_HYPERVISOR and skip trying to enable the mode (a
> guest shouldn't be concerned with corrected errors anyway).
> 
> Reported-by: Qian Cai 
> Fixes: 68299a42f842 ("x86/mce: Enable additional error logging on certain 
> Intel CPUs")
> Signed-off-by: Tony Luck 
> ---
>  arch/x86/kernel/cpu/mce/intel.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/x86/kernel/cpu/mce/intel.c b/arch/x86/kernel/cpu/mce/intel.c
> index b47883e364b4..7f7d863400b7 100644
> --- a/arch/x86/kernel/cpu/mce/intel.c
> +++ b/arch/x86/kernel/cpu/mce/intel.c
> @@ -517,6 +517,9 @@ static void intel_imc_init(struct cpuinfo_x86 *c)
>  {
>   u64 error_control;
>  
> + if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
> + return;
> +

Frankly, I'm tired of wagging the dog because the tail can't. If
qemu/kvm can't emulate a CPU model fully then it should ignore those
unknown MSR accesses by default, i.e., that "ignore_msrs" functionality
should be on by default I'd say...

We certainly can't be sprinkling this check everytime the kernel tries
to do something as basic as read an MSR.

-- 
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette


Re: [PATCH 1/2] MIPS: Ingenic: Add missing nodes for Ingenic SoCs and boards.

2020-11-09 Thread Zhou Yanjie

Hi Paul,

On 2020/11/10 上午7:37, Paul Cercueil wrote:



Le sam. 7 nov. 2020 à 19:52, 周琰杰 (Zhou Yanjie) 
 a écrit :

1.Add OTG/OTG PHY/RNG nodes for JZ4780, CGU/OTG nodes for CI20.
2.Add OTG/OTG PHY/RNG/OST nodes for X1000, SSI/CGU/OST/OTG/SC16IS752
  nodes for CU1000-Neo.
3.Add OTG/OTG PHY/DTRNG/OST nodes for X1830, SSI/CGU/OST/OTG/SC16IS752
  nodes for CU1830-Neo.

Tested-by: 周正 (Zhou Zheng) 
Signed-off-by: 周琰杰 (Zhou Yanjie) 
---
 arch/mips/boot/dts/ingenic/ci20.dts   | 16 +
 arch/mips/boot/dts/ingenic/cu1000-neo.dts | 60 
+++
 arch/mips/boot/dts/ingenic/cu1830-neo.dts | 60 
+++

 arch/mips/boot/dts/ingenic/jz4780.dtsi    | 41 +++--
 arch/mips/boot/dts/ingenic/x1000.dtsi | 52 
++-
 arch/mips/boot/dts/ingenic/x1830.dtsi | 54 
+++-

 6 files changed, 267 insertions(+), 16 deletions(-)

diff --git a/arch/mips/boot/dts/ingenic/ci20.dts 
b/arch/mips/boot/dts/ingenic/ci20.dts

index 75f5bfbf2c37..b31054a41754 100644
--- a/arch/mips/boot/dts/ingenic/ci20.dts
+++ b/arch/mips/boot/dts/ingenic/ci20.dts
@@ -93,6 +93,15 @@
 clock-frequency = <4800>;
 };

+ {
+    /*
+ * Use the 32.768 kHz oscillator as the parent of the RTC for a 
higher

+ * precision.
+ */
+    assigned-clocks = < JZ4780_CLK_RTC>;
+    assigned-clock-parents = < JZ4780_CLK_RTCLK>;
+};
+
  {
 status = "okay";

@@ -396,6 +405,13 @@
 status = "okay";
 };

+ {
+    status = "okay";
+
+    assigned-clocks = < JZ4780_CLK_OTGPHY>;
+    assigned-clock-rates = <4800>;
+};
+
  {
 pins_uart0: uart0 {
 function = "uart0";
diff --git a/arch/mips/boot/dts/ingenic/cu1000-neo.dts 
b/arch/mips/boot/dts/ingenic/cu1000-neo.dts

index 22a1066d637b..44d47d12db12 100644
--- a/arch/mips/boot/dts/ingenic/cu1000-neo.dts
+++ b/arch/mips/boot/dts/ingenic/cu1000-neo.dts
@@ -3,7 +3,7 @@

 #include "x1000.dtsi"
 #include 
-#include 
+#include 
 #include 

 / {
@@ -31,6 +31,18 @@
 };
 };

+    ssi: spi-gpio {
+    compatible = "spi-gpio";
+    #address-cells = <1>;
+    #size-cells = <0>;
+    num-chipselects = <1>;
+
+    mosi-gpios = < 2 GPIO_ACTIVE_HIGH>;
+    miso-gpios = < 3 GPIO_ACTIVE_HIGH>;
+    sck-gpios = < 0 GPIO_ACTIVE_HIGH>;
+    cs-gpios = < 1 GPIO_ACTIVE_HIGH>;
+    };
+
 wlan_pwrseq: msc1-pwrseq {
 compatible = "mmc-pwrseq-simple";

@@ -43,13 +55,19 @@
 clock-frequency = <2400>;
 };

- {
+ {
+    /*
+ * Use the 32.768 kHz oscillator as the parent of the RTC for a 
higher

+ * precision.
+ */
+    assigned-clocks = < X1000_CLK_RTC>;
+    assigned-clock-parents = < X1000_CLK_RTCLK>;
+};
+
+ {
 /* 1500 kHz for the system timer and clocksource */
-    assigned-clocks = < TCU_CLK_TIMER0>, < TCU_CLK_TIMER2>;
+    assigned-clocks = < OST_CLK_PERCPU_TIMER>, < 
OST_CLK_GLOBAL_TIMER>;

 assigned-clock-rates = <150>, <150>;
-
-    /* Use channel #0 for the system timer channel #2 for the 
clocksource */

-    ingenic,pwm-channels-mask = <0xfa>;
 };

  {
@@ -59,6 +77,32 @@
 pinctrl-0 = <_uart2>;
 };

+ {
+    status = "okay";
+
+    spi-max-frequency = <5000>;
+
+    sc16is752: expander@0 {
+    compatible = "nxp,sc16is752";
+    reg = <0>; /* CE0 */
+    spi-max-frequency = <400>;
+
+    clocks = <_sc16is752>;
+
+    interrupt-parent = <>;
+    interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
+
+    gpio-controller;
+    #gpio-cells = <2>;
+
+    exclk_sc16is752: sc16is752 {
+    compatible = "fixed-clock";
+    #clock-cells = <0>;
+    clock-frequency = <4800>;
+    };
+    };
+};
+
  {
 status = "okay";

@@ -135,6 +179,10 @@
 };
 };

+ {
+    status = "okay";
+};
+
  {
 pins_uart2: uart2 {
 function = "uart2";
diff --git a/arch/mips/boot/dts/ingenic/cu1830-neo.dts 
b/arch/mips/boot/dts/ingenic/cu1830-neo.dts

index 640f96c00d63..7a56e344e429 100644
--- a/arch/mips/boot/dts/ingenic/cu1830-neo.dts
+++ b/arch/mips/boot/dts/ingenic/cu1830-neo.dts
@@ -3,7 +3,7 @@

 #include "x1830.dtsi"
 #include 
-#include 
+#include 
 #include 

 / {
@@ -31,6 +31,18 @@
 };
 };

+    ssi0: spi-gpio {
+    compatible = "spi-gpio";
+    #address-cells = <1>;
+    #size-cells = <0>;
+    num-chipselects = <1>;
+
+    mosi-gpios = < 12 GPIO_ACTIVE_HIGH>;
+    miso-gpios = < 11 GPIO_ACTIVE_HIGH>;
+    sck-gpios = < 15 GPIO_ACTIVE_HIGH>;
+    cs-gpios = < 16 GPIO_ACTIVE_HIGH>;
+    };
+
 wlan_pwrseq: msc1-pwrseq {
 compatible = "mmc-pwrseq-simple";

@@ -43,13 +55,19 @@
 clock-frequency = <2400>;
 };

- {
+ {
+    /*
+ * Use the 32.768 kHz oscillator as the parent of the RTC for a 
higher

+ * precision.
+ */
+    assigned-clocks = < X1830_CLK_RTC>;
+    assigned-clock-parents = < X1830_CLK_RTCLK>;
+};
+
+ {
 /* 1500 kHz for the system timer and clocksource 

Re: [PATCH v3 19/35] x86/io_apic: Cleanup trigger/polarity helpers

2020-11-09 Thread Qian Cai
On Sat, 2020-10-24 at 22:35 +0100, David Woodhouse wrote:
> From: Thomas Gleixner 
> 
> 'trigger' and 'polarity' are used throughout the I/O-APIC code for handling
> the trigger type (edge/level) and the active low/high configuration. While
> there are defines for initializing these variables and struct members, they
> are not used consequently and the meaning of 'trigger' and 'polarity' is
> opaque and confusing at best.
> 
> Rename them to 'is_level' and 'active_low' and make them boolean in various
> structs so it's entirely clear what the meaning is.
> 
> Signed-off-by: Thomas Gleixner 
> Signed-off-by: David Woodhouse 
> ---
>  arch/x86/include/asm/hw_irq.h   |   6 +-
>  arch/x86/kernel/apic/io_apic.c  | 244 +---
>  arch/x86/pci/intel_mid_pci.c|   8 +-
>  drivers/iommu/amd/iommu.c   |  10 +-
>  drivers/iommu/intel/irq_remapping.c |   9 +-
>  5 files changed, 130 insertions(+), 147 deletions(-)

Reverting the rest of patchset up to this commit on next-20201109 fixed an
endless soft-lockups issue booting an AMD server below. I noticed that the
failed boots always has this IOMMU IO_PAGE_FAULT before those soft-lockups:

[ 3404.093354][T1] AMD-Vi: Interrupt remapping enabled
[ 3404.098593][T1] AMD-Vi: Virtual APIC enabled
[ 3404.107783][  T340] pci :00:14.0: AMD-Vi: Event logged [IO_PAGE_FAULT 
domain=0x address=0xfffdf8020200 flags=0x0008]
[ 3404.120644][T1] AMD-Vi: Lazy IO/TLB flushing enabled
[ 3404.126011][T1] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[ 3404.133173][T1] software IO TLB: mapped [mem 
0x68dcf000-0x6cdcf000] (64MB)

.config (if ever matters):
https://cailca.coding.net/public/linux/mm/git/files/master/x86.config

good boot dmesg (with the commits reverted):
http://people.redhat.com/qcai/dmesg.txt

== system info ==
Dell Poweredge R6415
AMD EPYC 7401P 24-Core Processor
24576 MB memory, 239 GB disk space

[  OK  ] Started Flush Journal to Persistent Storage.
[  OK  ] Started udev Kernel Device Manager.
[  OK  ] Started udev Coldplug all Devices.
[  OK  ] Started Monitoring of LVM2 mirrors,…sing dmeventd or progress polling.
[  OK  ] Reached target Local File Systems (Pre).
 Mounting /boot...
[  OK  ] Created slice system-lvm2\x2dpvscan.slice.
[ 3740.376500][ T1058] XFS (sda1): Mounting V5 Filesystem
[ 3740.438474][ T1058] XFS (sda1): Ending clean mount
[ 3765.159433][C0] watchdog: BUG: soft lockup - CPU#0 stuck for 22s! 
[systemd:1]
[ 3765.166929][C0] Modules linked in: acpi_cpufreq(+) ip_tables x_tables 
sd_mod ahci libahci tg3 bnxt_en megaraid_sas libata firmware_class libphy 
dm_mirror dm_region_hash dm_log dm_mod
[ 3765.183576][C0] irq event stamp: 26230104
[ 3765.187954][C0] hardirqs last  enabled at (26230103): 
[] asm_common_interrupt+0x1e/0x40
[ 3765.197873][C0] hardirqs last disabled at (26230104): 
[] sysvec_apic_timer_interrupt+0xa/0xa0
[ 3765.208303][C0] softirqs last  enabled at (26202664): 
[] __do_softirq+0x61b/0x95d
[ 3765.217699][C0] softirqs last disabled at (26202591): 
[] asm_call_irq_on_stack+0x12/0x20
[ 3765.227702][C0] CPU: 0 PID: 1 Comm: systemd Not tainted 
5.10.0-rc2-next-20201109+ #2
[ 3765.235793][C0] Hardware name: Dell Inc. PowerEdge R6415/07YXFK, BIOS 
1.9.3 06/25/2019
[ 3765.244065][C0] RIP: 0010:lock_acquire+0x1f4/0x820
lock_acquire at kernel/locking/lockdep.c:5404
[ 3765.249211][C0] Code: ff ff ff 48 83 c4 20 65 0f c1 05 a7 ba 9e 7e 83 f8 
01 4c 8b 54 24 08 0f 85 60 04 00 00 41 52 9d 48 b8 00 00 00 00 00 fc ff df <48> 
01 c3 c7 03 00 00 00 00 c7 43 08 00 00 00 00 48 8b0
[ 3765.268657][C0] RSP: 0018:c906f9f8 EFLAGS: 0246
[ 3765.274587][C0] RAX: dc00 RBX: 1920df42 RCX: 
1920df28
[ 3765.282420][C0] RDX: 111020645769 RSI:  RDI: 
0001
[ 3765.290256][C0] RBP: 0001 R08: fbfff164cb10 R09: 
fbfff164cb10
[ 3765.298090][C0] R10: 0246 R11: fbfff164cb0f R12: 
88812be555b0
[ 3765.305922][C0] R13:  R14:  R15: 

[ 3765.313750][C0] FS:  7f12bb8c59c0() GS:8881b700() 
knlGS:
[ 3765.322537][C0] CS:  0010 DS:  ES:  CR0: 80050033
[ 3765.328985][C0] CR2: 7f0c2d828fd0 CR3: 00011868a000 CR4: 
003506f0
[ 3765.336820][C0] Call Trace:
[ 3765.339979][C0]  ? rcu_read_unlock+0x40/0x40
[ 3765.344609][C0]  __d_move+0x2a2/0x16f0
__seqprop_spinlock_assert at include/linux/seqlock.h:277
(inlined by) __d_move at fs/dcache.c:2861
[ 3765.348711][C0]  ? d_move+0x47/0x70
[ 3765.352560][C0]  ? _raw_spin_unlock+0x1a/0x30
[ 3765.357275][C0]  d_move+0x47/0x70
write_seqcount_t_end at include/linux/seqlock.h:560
(inlined by) write_sequnlock at include/linux/seqlock.h:901
(inlined by) d_move at 

[RESEND PATCH 07/19] arm64: dts: allwinner: A100: Add PMU mode

2020-11-09 Thread Frank Lee
From: Yangtao Li 

Add the Performance Monitoring Unit (PMU) device tree node to the A100
.dtsi, which tells DT users which interrupts are triggered by PMU overflow
events on each core.

Signed-off-by: Yangtao Li 
---
 arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi 
b/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
index c34ed8045363..01ff53b5a7a8 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
@@ -25,21 +25,21 @@ cpu0: cpu@0 {
enable-method = "psci";
};
 
-   cpu@1 {
+   cpu1: cpu@1 {
compatible = "arm,cortex-a53";
device_type = "cpu";
reg = <0x1>;
enable-method = "psci";
};
 
-   cpu@2 {
+   cpu2: cpu@2 {
compatible = "arm,cortex-a53";
device_type = "cpu";
reg = <0x2>;
enable-method = "psci";
};
 
-   cpu@3 {
+   cpu3: cpu@3 {
compatible = "arm,cortex-a53";
device_type = "cpu";
reg = <0x3>;
@@ -47,6 +47,15 @@ cpu@3 {
};
};
 
+   pmu {
+   compatible = "arm,cortex-a53-pmu";
+   interrupts = ,
+,
+,
+;
+   interrupt-affinity = <>, <>, <>, <>;
+   };
+
psci {
compatible = "arm,psci-1.0";
method = "smc";
-- 
2.28.0



Re: [PATCH AUTOSEL 5.9 53/55] seq_file: add seq_read_iter

2020-11-09 Thread Greg Kroah-Hartman
On Mon, Nov 09, 2020 at 10:53:16PM -0500, Sasha Levin wrote:
> From: Christoph Hellwig 
> 
> [ Upstream commit d4d50710a8b46082224376ef119a4dbb75b25c56 ]
> 
> iov_iter based variant for reading a seq_file.  seq_read is
> reimplemented on top of the iter variant.
> 
> Signed-off-by: Christoph Hellwig 
> Tested-by: Greg Kroah-Hartman 
> Signed-off-by: Linus Torvalds 
> Signed-off-by: Sasha Levin 
> ---
>  fs/seq_file.c| 45 
>  include/linux/seq_file.h |  1 +
>  2 files changed, 33 insertions(+), 13 deletions(-)

This is not needed for anything older than 5.10, please drop.

thanks,

greg k-h


[RESEND PATCH 06/19] arm64: allwinner: a100: Add device node for DMA controller

2020-11-09 Thread Frank Lee
From: Yangtao Li 

The A100 SoC has a DMA controller that supports 8 DMA channels
to and from various peripherals.

Add a device node for it.

Signed-off-by: Yangtao Li 
---
 arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi | 12 
 1 file changed, 12 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi 
b/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
index cc321c04f121..c34ed8045363 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
@@ -101,6 +101,18 @@ ccu: clock@3001000 {
#reset-cells = <1>;
};
 
+   dma: dma-controller@3002000 {
+   compatible = "allwinner,sun50i-a100-dma";
+   reg = <0x03002000 0x1000>;
+   interrupts = ;
+   clocks = < CLK_BUS_DMA>, < CLK_MBUS_DMA>;
+   clock-names = "bus", "mbus";
+   dma-channels = <8>;
+   dma-requests = <51>;
+   resets = < RST_BUS_DMA>;
+   #dma-cells = <1>;
+   };
+
gic: interrupt-controller@3021000 {
compatible = "arm,gic-400";
reg = <0x03021000 0x1000>, <0x03022000 0x2000>,
-- 
2.28.0



Re: [f2fs-dev] [PATCH] f2fs: compress: support chksum

2020-11-09 Thread Chao Yu

On 2020/11/10 12:23, Jaegeuk Kim wrote:

On 11/10, Chao Yu wrote:

On 2020/11/10 1:06, Jaegeuk Kim wrote:

On 11/09, Chao Yu wrote:

On 2020/11/7 5:12, Jaegeuk Kim wrote:

On 11/03, Chao Yu wrote:

On 2020/11/3 10:02, Chao Yu wrote:

On 2020/11/3 0:31, Jaegeuk Kim wrote:

On 11/02, Chao Yu wrote:

This patch supports to store chksum value with compressed
data, and verify the integrality of compressed data while
reading the data.

The feature can be enabled through specifying mount option
'compress_chksum'.

Signed-off-by: Chao Yu 
---
  Documentation/filesystems/f2fs.rst |  1 +
  fs/f2fs/compress.c | 20 
  fs/f2fs/f2fs.h | 13 -
  fs/f2fs/inode.c|  3 +++
  fs/f2fs/super.c|  9 +
  include/linux/f2fs_fs.h|  2 +-
  6 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/Documentation/filesystems/f2fs.rst 
b/Documentation/filesystems/f2fs.rst
index b8ee761c9922..985ae7d35066 100644
--- a/Documentation/filesystems/f2fs.rst
+++ b/Documentation/filesystems/f2fs.rst
@@ -260,6 +260,7 @@ compress_extension=%sSupport adding specified 
extension, so that f2fs can enab
 For other files, we can still enable compression via 
ioctl.
 Note that, there is one reserved special extension 
'*', it
 can be set to enable compression for all files.
+compress_chksum Support verifying chksum of raw data in 
compressed cluster.
  inlinecryptWhen possible, encrypt/decrypt the contents of 
encrypted
 files using the blk-crypto framework rather than
 filesystem-layer encryption. This allows the use of
diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
index 14262e0f1cd6..a4e0d2c745b6 100644
--- a/fs/f2fs/compress.c
+++ b/fs/f2fs/compress.c
@@ -602,6 +602,7 @@ static int f2fs_compress_pages(struct compress_ctx *cc)
f2fs_cops[fi->i_compress_algorithm];
unsigned int max_len, new_nr_cpages;
struct page **new_cpages;
+   u32 chksum = 0;
int i, ret;
trace_f2fs_compress_pages_start(cc->inode, cc->cluster_idx,
@@ -655,6 +656,11 @@ static int f2fs_compress_pages(struct compress_ctx *cc)
cc->cbuf->clen = cpu_to_le32(cc->clen);
+   if (fi->i_compress_flag & 1 << COMPRESS_CHKSUM)
+   chksum = f2fs_crc32(F2FS_I_SB(cc->inode),
+   cc->cbuf->cdata, cc->clen);
+   cc->cbuf->chksum = cpu_to_le32(chksum);
+
for (i = 0; i < COMPRESS_DATA_RESERVED_SIZE; i++)
cc->cbuf->reserved[i] = cpu_to_le32(0);
@@ -721,6 +727,7 @@ void f2fs_decompress_pages(struct bio *bio, struct page 
*page, bool verity)
(struct decompress_io_ctx *)page_private(page);
struct f2fs_sb_info *sbi = F2FS_I_SB(dic->inode);
struct f2fs_inode_info *fi= F2FS_I(dic->inode);
+   struct f2fs_sb_info *sbi = F2FS_I_SB(dic->inode);
const struct f2fs_compress_ops *cops =
f2fs_cops[fi->i_compress_algorithm];
int ret;
@@ -790,6 +797,19 @@ void f2fs_decompress_pages(struct bio *bio, struct page 
*page, bool verity)
ret = cops->decompress_pages(dic);
+   if (!ret && fi->i_compress_flag & 1 << COMPRESS_CHKSUM) {
+   u32 provided = le32_to_cpu(dic->cbuf->chksum);
+   u32 calculated = f2fs_crc32(sbi, dic->cbuf->cdata, dic->clen);
+
+   if (provided != calculated) {
+   printk_ratelimited(
+   "%sF2FS-fs (%s): checksum invalid, nid = %lu, %x vs 
%x",
+   KERN_INFO, sbi->sb->s_id, dic->inode->i_ino,
+   provided, calculated);
+   ret = -EFSCORRUPTED;


Do we need to change fsck.f2fs to recover this?


However, we don't know which one is correct, compressed data or chksum value?
if compressed data was corrupted, repairing chksum value doesn't help.

Or how about adding chksum values for both raw data and compressed data.

#define COMPRESS_DATA_RESERVED_SIZE 3
struct compress_data {
__le32 clen;/* compressed data size */
+   __le32 raw_chksum;  /* raw data chksum */
+   __le32 compress_chksum; /* compressed data chksum */
__le32 reserved[COMPRESS_DATA_RESERVED_SIZE];   /* reserved */
u8 cdata[]; /* compressed data */
};

raw_chksum  compress_chksum
match   match   -> data is verified, pass
not match   match   -> repair raw_chksum
matcth  not match   -> repair compress_chksum


I think only compress_chksum would be enough. BTW, can we give WARN_ON and
marking a FSCK flag without returning 

[RESEND PATCH 05/19] dmaengine: sun6i: Add support for A100 DMA

2020-11-09 Thread Frank Lee
From: Yangtao Li 

The dma of a100 is similar to h6, with some minor changes to
support greater addressing capabilities.

Add support for it.

Signed-off-by: Yangtao Li 
---
 drivers/dma/sun6i-dma.c | 25 +
 1 file changed, 25 insertions(+)

diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c
index f5f9c86c50bc..5cadd4d2b824 100644
--- a/drivers/dma/sun6i-dma.c
+++ b/drivers/dma/sun6i-dma.c
@@ -1173,6 +1173,30 @@ static struct sun6i_dma_config sun50i_a64_dma_cfg = {
 BIT(DMA_SLAVE_BUSWIDTH_8_BYTES),
 };
 
+/*
+ * TODO: Add support for more than 4g physical addressing.
+ *
+ * The A100 binding uses the number of dma channels from the
+ * device tree node.
+ */
+static struct sun6i_dma_config sun50i_a100_dma_cfg = {
+   .clock_autogate_enable = sun6i_enable_clock_autogate_h3,
+   .set_burst_length = sun6i_set_burst_length_h3,
+   .set_drq  = sun6i_set_drq_h6,
+   .set_mode = sun6i_set_mode_h6,
+   .src_burst_lengths = BIT(1) | BIT(4) | BIT(8) | BIT(16),
+   .dst_burst_lengths = BIT(1) | BIT(4) | BIT(8) | BIT(16),
+   .src_addr_widths   = BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) |
+BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) |
+BIT(DMA_SLAVE_BUSWIDTH_4_BYTES) |
+BIT(DMA_SLAVE_BUSWIDTH_8_BYTES),
+   .dst_addr_widths   = BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) |
+BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) |
+BIT(DMA_SLAVE_BUSWIDTH_4_BYTES) |
+BIT(DMA_SLAVE_BUSWIDTH_8_BYTES),
+   .has_mbus_clk = true,
+};
+
 /*
  * The H6 binding uses the number of dma channels from the
  * device tree node.
@@ -1225,6 +1249,7 @@ static const struct of_device_id sun6i_dma_match[] = {
{ .compatible = "allwinner,sun8i-h3-dma", .data = _h3_dma_cfg },
{ .compatible = "allwinner,sun8i-v3s-dma", .data = _v3s_dma_cfg },
{ .compatible = "allwinner,sun50i-a64-dma", .data = _a64_dma_cfg 
},
+   { .compatible = "allwinner,sun50i-a100-dma", .data = 
_a100_dma_cfg },
{ .compatible = "allwinner,sun50i-h6-dma", .data = _h6_dma_cfg },
{ /* sentinel */ }
 };
-- 
2.28.0



Re: [PATCH 1/8] epoll: check for events when removing a timed out thread from the wait queue

2020-11-09 Thread Davidlohr Bueso

On Fri, 06 Nov 2020, Soheil Hassas Yeganeh wrote:


From: Soheil Hassas Yeganeh 

After abc610e01c66 ("fs/epoll: avoid barrier after an epoll_wait(2)
timeout"), we break out of the ep_poll loop upon timeout, without checking
whether there is any new events available.  Prior to that patch-series we
always called ep_events_available() after exiting the loop.

This can cause races and missed wakeups.  For example, consider the
following scenario reported by Guantao Liu:

Suppose we have an eventfd added using EPOLLET to an epollfd.

Thread 1: Sleeps for just below 5ms and then writes to an eventfd.
Thread 2: Calls epoll_wait with a timeout of 5 ms. If it sees an
 event of the eventfd, it will write back on that fd.
Thread 3: Calls epoll_wait with a negative timeout.

Prior to abc610e01c66, it is guaranteed that Thread 3 will wake up either
by Thread 1 or Thread 2.  After abc610e01c66, Thread 3 can be blocked
indefinitely if Thread 2 sees a timeout right before the write to the
eventfd by Thread 1.  Thread 2 will be woken up from
schedule_hrtimeout_range and, with evail 0, it will not call
ep_send_events().

To fix this issue:
1) Simplify the timed_out case as suggested by Linus.
2) while holding the lock, recheck whether the thread was woken up
  after its time out has reached.

Note that (2) is different from Linus' original suggestion: It do not
set "eavail = ep_events_available(ep)" to avoid unnecessary contention
(when there are too many timed-out threads and a small number of events),
as well as races mentioned in the discussion thread.

This is the first patch in the series so that the backport to stable
releases is straightforward.

Link: 
https://lkml.kernel.org/r/CAHk-=wizk=oxuyqpbo8ms41w2pag1kniuv5wdd5qwl-gq1k...@mail.gmail.com
Fixes: abc610e01c66 ("fs/epoll: avoid barrier after an epoll_wait(2) timeout")
Tested-by: Guantao Liu 
Suggested-by: Linus Torvalds 
Signed-off-by: Soheil Hassas Yeganeh 
Reported-by: Guantao Liu 
Reviewed-by: Eric Dumazet 
Reviewed-by: Willem de Bruijn 
Reviewed-by: Khazhismel Kumykov 


Thanks for providing the fix and a testcase.

Reviewed-by: Davidlohr Bueso 


[RESEND PATCH 04/19] dt-bindings: dma: allwinner,sun50i-a64-dma: Add A100 compatible

2020-11-09 Thread Frank Lee
From: Yangtao Li 

Add a binding for A100's dma controller.

Signed-off-by: Yangtao Li 
---
 .../devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml| 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml 
b/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
index 372679dbd216..b6e1ebfaf366 100644
--- a/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
+++ b/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
@@ -21,6 +21,7 @@ properties:
   compatible:
 oneOf:
   - const: allwinner,sun50i-a64-dma
+  - const: allwinner,sun50i-a100-dma
   - const: allwinner,sun50i-h6-dma
   - items:
   - const: allwinner,sun8i-r40-dma
@@ -56,7 +57,9 @@ required:
 if:
   properties:
 compatible:
-  const: allwinner,sun50i-h6-dma
+  enum:
+- allwinner,sun50i-a100-dma
+- allwinner,sun50i-h6-dma
 
 then:
   properties:
-- 
2.28.0



Re:Re: [PATCH] sched/rt, powerpc: Prepare for PREEMPT_RT

2020-11-09 Thread 王擎
>Quoting Wang Qing :
>
>> Add PREEMPT_RT output to die().
>>
>> Signed-off-by: Wang Qing 
>> ---
>>  arch/powerpc/kernel/traps.c | 10 +-
>>  1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
>> index 5006dcb..6dfe567
>> --- a/arch/powerpc/kernel/traps.c
>> +++ b/arch/powerpc/kernel/traps.c
>> @@ -258,6 +258,14 @@ static char *get_mmu_str(void)
>>  return "";
>>  }
>>
>> +#ifdef CONFIG_PREEMPT
>> +#define S_PREEMPT " PREEMPT"
>> +#elif defined(CONFIG_PREEMPT_RT)
>> +#define S_PREEMPT " PREEMPT_RT"
>> +#else
>> +#define S_PREEMPT ""
>> +#endif
>
>I don't like too much that forest of #ifdefs. IS_ENABLED() is prefered  
>whenever possible.
>
>> +
>>  static int __die(const char *str, struct pt_regs *regs, long err)
>>  {
>>  printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);
>> @@ -265,7 +273,7 @@ static int __die(const char *str, struct pt_regs  
>> *regs, long err)
>>  printk("%s PAGE_SIZE=%luK%s%s%s%s%s%s %s\n",
>> IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN) ? "LE" : "BE",
>> PAGE_SIZE / 1024, get_mmu_str(),
>> -   IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "",
>> +   S_PREEMPT,
>> IS_ENABLED(CONFIG_SMP) ? " SMP" : "",
>> IS_ENABLED(CONFIG_SMP) ? (" NR_CPUS=" __stringify(NR_CPUS)) : "",
>> debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "",
>> --
>> 2.7.4
>
>I'd prefer to remain in line with the existing and use IS_ENABLED()  
>instead of #ifdefs, see below:
>
>diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
>index 5006dcbe1d9f..dec7b81c72a4 100644
>--- a/arch/powerpc/kernel/traps.c
>+++ b/arch/powerpc/kernel/traps.c
>@@ -262,10 +262,11 @@ static int __die(const char *str, struct pt_regs  
>*regs, long err)
>  {
>   printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);
>
>-  printk("%s PAGE_SIZE=%luK%s%s%s%s%s%s %s\n",
>+  printk("%s PAGE_SIZE=%luK%s%s%s%s%s%s%s %s\n",
>  IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN) ? "LE" : "BE",
>  PAGE_SIZE / 1024, get_mmu_str(),
>  IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "",
>+ IS_ENABLED(CONFIG_PREEMPT_RT) ? " PREEMPT_RT" : "",
>  IS_ENABLED(CONFIG_SMP) ? " SMP" : "",
>  IS_ENABLED(CONFIG_SMP) ? (" NR_CPUS=" __stringify(NR_CPUS)) : "",
>  debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "",
>---
>Christophe

Yeah, I agree with it.

Wang Qing




[RESEND PATCH 03/19] pinctrl: sunxi: Always call chained_irq_{enter, exit} in sunxi_pinctrl_irq_handler

2020-11-09 Thread Frank Lee
From: Yangtao Li 

It is found on many allwinner soc that there is a low probability that
the interrupt status cannot be read in sunxi_pinctrl_irq_handler. This
will cause the interrupt status of a gpio bank to always be active on
gic, preventing gic from responding to other spi interrupts correctly.

So we should call the chained_irq_* each time enter sunxi_pinctrl_irq_handler().

Cc: sta...@vger.kernel.org
Signed-off-by: Yangtao Li 
---
 drivers/pinctrl/sunxi/pinctrl-sunxi.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c 
b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
index 9d8b59dafa4b..dc8d39ae045b 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
@@ -1141,20 +1141,22 @@ static void sunxi_pinctrl_irq_handler(struct irq_desc 
*desc)
 
WARN_ON(bank == pctl->desc->irq_banks);
 
+   chained_irq_enter(chip, desc);
+
reg = sunxi_irq_status_reg_from_bank(pctl->desc, bank);
val = readl(pctl->membase + reg);
 
if (val) {
int irqoffset;
 
-   chained_irq_enter(chip, desc);
for_each_set_bit(irqoffset, , IRQ_PER_BANK) {
int pin_irq = irq_find_mapping(pctl->domain,
   bank * IRQ_PER_BANK + 
irqoffset);
generic_handle_irq(pin_irq);
}
-   chained_irq_exit(chip, desc);
}
+
+   chained_irq_exit(chip, desc);
 }
 
 static int sunxi_pinctrl_add_function(struct sunxi_pinctrl *pctl,
-- 
2.28.0



[RESEND PATCH 02/19] pinctrl: sunxi: Mark the irq bank not found in sunxi_pinctrl_irq_handler() with WARN_ON

2020-11-09 Thread Frank Lee
From: Yangtao Li 

The interrupt descriptor cannot be found in the interrupt processing
function, and this situation cannot happen when the system is running
normally. It doesn't seem right to return directly to the status of not
handling gic. In this case, it must be a bug, let's mark it with
WARN_ON.

Signed-off-by: Yangtao Li 
---
 drivers/pinctrl/sunxi/pinctrl-sunxi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c 
b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
index 8e792f8e2dc9..9d8b59dafa4b 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
@@ -1139,8 +1139,7 @@ static void sunxi_pinctrl_irq_handler(struct irq_desc 
*desc)
if (irq == pctl->irq[bank])
break;
 
-   if (bank == pctl->desc->irq_banks)
-   return;
+   WARN_ON(bank == pctl->desc->irq_banks);
 
reg = sunxi_irq_status_reg_from_bank(pctl->desc, bank);
val = readl(pctl->membase + reg);
-- 
2.28.0



[PATCH 1/2] perf test: Fix a typo in cs-etm testing

2020-11-09 Thread Leo Yan
Fix a typo: s/devce_name/device_name.

Signed-off-by: Leo Yan 
---
 tools/perf/tests/shell/test_arm_coresight.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/shell/test_arm_coresight.sh 
b/tools/perf/tests/shell/test_arm_coresight.sh
index 8d84fdbed6a6..59d847d4981d 100755
--- a/tools/perf/tests/shell/test_arm_coresight.sh
+++ b/tools/perf/tests/shell/test_arm_coresight.sh
@@ -105,7 +105,7 @@ arm_cs_iterate_devices() {
# `> device_name = 'tmc_etf0'
device_name=$(basename $path)
 
-   if is_device_sink $path $devce_name; then
+   if is_device_sink $path $device_name; then
 
record_touch_file $device_name $2 &&
perf_script_branch_samples touch &&
-- 
2.17.1



[PATCH 2/2] perf test: Update branch sample parttern for cs-etm

2020-11-09 Thread Leo Yan
Since the commit 943b69ac1884 ("perf parse-events: Set exclude_guest=1
for user-space counting"), 'exclude_guest=1' is set for user-space
counting; and the branch sample's modifier has been altered, the sample
event name has been changed from "branches:u:" to "branches:uH:", which
gives out info for "user-space and host counting".

But the cs-etm testing's regular expression cannot match the updated
branch sample event and leads to test failure.

This patch updates the branch sample parttern by using a more flexible
expression '.*' to match branch sample's modifiers, so that allows the
testing to work as expected.

Signed-off-by: Leo Yan 
---
 tools/perf/tests/shell/test_arm_coresight.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/shell/test_arm_coresight.sh 
b/tools/perf/tests/shell/test_arm_coresight.sh
index 59d847d4981d..18fde2f179cd 100755
--- a/tools/perf/tests/shell/test_arm_coresight.sh
+++ b/tools/perf/tests/shell/test_arm_coresight.sh
@@ -44,7 +44,7 @@ perf_script_branch_samples() {
#   touch  6512  1 branches:u:  b22082e0 
strcmp+0xa0 (/lib/aarch64-linux-gnu/ld-2.27.so)
#   touch  6512  1 branches:u:  b2208320 
strcmp+0xe0 (/lib/aarch64-linux-gnu/ld-2.27.so)
perf script -F,-time -i ${perfdata} | \
-   egrep " +$1 +[0-9]+ .* +branches:([u|k]:)? +"
+   egrep " +$1 +[0-9]+ .* +branches:(.*:)? +"
 }
 
 perf_report_branch_samples() {
-- 
2.17.1



[RESEND PATCH 01/19] pinctrl: sunxi: fix irq bank map for the Allwinner A100 pin controller

2020-11-09 Thread Frank Lee
From: Yangtao Li 

A100's pin starts with PB, so it should start with 1.

Fixes: 473436e7647d6 ("pinctrl: sunxi: add support for the Allwinner A100 pin 
controller")
Signed-off-by: Yangtao Li 
---
 drivers/pinctrl/sunxi/pinctrl-sun50i-a100.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/sunxi/pinctrl-sun50i-a100.c 
b/drivers/pinctrl/sunxi/pinctrl-sun50i-a100.c
index 19cfd1e76ee2..e69f6da40dc0 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sun50i-a100.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sun50i-a100.c
@@ -677,7 +677,7 @@ static const struct sunxi_desc_pin a100_pins[] = {
  SUNXI_FUNCTION_IRQ_BANK(0x6, 6, 19)),
 };
 
-static const unsigned int a100_irq_bank_map[] = { 0, 1, 2, 3, 4, 5, 6};
+static const unsigned int a100_irq_bank_map[] = { 1, 2, 3, 4, 5, 6, 7};
 
 static const struct sunxi_pinctrl_desc a100_pinctrl_data = {
.pins = a100_pins,
-- 
2.28.0



Re: [PATCH v5 0/4] HWpoison: further fixes and cleanups

2020-11-09 Thread Oscar Salvador
On Tue, Oct 13, 2020 at 04:44:43PM +0200, Oscar Salvador wrote:
> This patchset includes some more fixes and a cleanup.
> 
> Patch#2 and patch#3 are both fixes for taking a HWpoison page off a buddy
> freelist, since having them there has proved to be bad (see [1] and
> pathch#2's commit log).
> Patch#3 does the same for hugetlb pages.
> 
> [1] https://lkml.org/lkml/2020/9/22/565

Hi Andrew, I think this slipped through the cracks.
(Probably because I did not CC you, my bad)

Could you please consider taking this series? It has been already acked
by Naoya.

Thanks


-- 
Oscar Salvador
SUSE L3


[RESEND PATCH 00/19] Second step support for A100

2020-11-09 Thread Frank Lee
Let's add watchdog, arm-pmu, dma, usb, mmc. support for allwinner
a100 soc.

Yangtao Li (19):
  pinctrl: sunxi: fix irq bank map for the Allwinner A100 pin controller
  pinctrl: sunxi: Mark the irq bank not found in
sunxi_pinctrl_irq_handler() with WARN_ON
  pinctrl: sunxi: Always call chained_irq_{enter, exit} in
sunxi_pinctrl_irq_handler
  dt-bindings: dma: allwinner,sun50i-a64-dma: Add A100 compatible
  dmaengine: sun6i: Add support for A100 DMA
  arm64: allwinner: a100: Add device node for DMA controller
  arm64: dts: allwinner: A100: Add PMU mode
  phy: sun4i-usb: remove enable_pmu_unk1 from sun50i_h6_cfg
  phy: allwinner: Convert to devm_platform_ioremap_* API
  dt-bindings: watchdog: sun4i: Add A100 compatible
  arm64: dts: allwinner: a100: add watchdog node
  dt-bindings: Add bindings for USB phy on Allwinner A100
  phy: sun4i-usb: add support for A100 USB PHY
  arm64: dts: allwinner: a100: add usb related nodes
  arm64: allwinner: A100: enable EHCI, OHCI and USB PHY nodes in Perf1
  dt-bindings: mmc: sunxi: Add A100 compatibles
  mmc: sunxi: add support for A100 mmc controller
  arm64: allwinner: a100: Add MMC related nodes
  arm64: dts: allwinner: a100: perf1: Add eMMC and MMC node

 .../dma/allwinner,sun50i-a64-dma.yaml |   5 +-
 .../bindings/mmc/allwinner,sun4i-a10-mmc.yaml |   2 +
 .../phy/allwinner,sun50i-a100-usb-phy.yaml| 105 ++
 .../watchdog/allwinner,sun4i-a10-wdt.yaml |   3 +
 .../allwinner/sun50i-a100-allwinner-perf1.dts |  54 +
 .../arm64/boot/dts/allwinner/sun50i-a100.dtsi | 197 +-
 drivers/dma/sun6i-dma.c   |  25 +++
 drivers/mmc/host/sunxi-mmc.c  |  28 ++-
 drivers/phy/allwinner/phy-sun4i-usb.c |  29 ++-
 drivers/phy/allwinner/phy-sun50i-usb3.c   |   4 +-
 drivers/phy/allwinner/phy-sun6i-mipi-dphy.c   |   4 +-
 drivers/phy/allwinner/phy-sun9i-usb.c |   4 +-
 drivers/pinctrl/sunxi/pinctrl-sun50i-a100.c   |   2 +-
 drivers/pinctrl/sunxi/pinctrl-sunxi.c |   9 +-
 14 files changed, 443 insertions(+), 28 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/phy/allwinner,sun50i-a100-usb-phy.yaml

-- 
2.28.0



[PATCH] ALSA: usb-audio : Add support for the Pioneer DJ DDJ-RR controller.

2020-11-09 Thread Daniel
---
 sound/usb/quirks-table.h | 56 +++-
 1 file changed, 55 insertions(+), 1 deletion(-)

diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index 3c1697f6b60c..a39233cb4d72 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -3530,7 +3530,61 @@ AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"),
}
}
 },
-
+{
+   /*
+* PIONEER DJ DDJ-RR
+ * PCM is 6 channels out & 4 channels in @ 44.1 fixed
+*/
+   USB_DEVICE_VENDOR_SPEC(0x2b73, 0x000d),
+   .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
+   .ifnum = QUIRK_ANY_INTERFACE,
+   .type = QUIRK_COMPOSITE,
+   .data = (const struct snd_usb_audio_quirk[]) {
+   {
+   .ifnum = 0,
+   .type = QUIRK_AUDIO_FIXED_ENDPOINT,
+   .data = &(const struct audioformat) {
+   .formats = SNDRV_PCM_FMTBIT_S24_3LE,
+   .channels = 6, //Master, Headphones & 
Booth
+   .iface = 0,
+   .altsetting = 1,
+   .altset_idx = 1,
+   .endpoint = 0x01,
+   .ep_attr = USB_ENDPOINT_XFER_ISOC|
+  USB_ENDPOINT_SYNC_ASYNC,
+   .rates = SNDRV_PCM_RATE_44100,
+   .rate_min = 44100,
+   .rate_max = 44100,
+   .nr_rates = 1,
+   .rate_table = (unsigned int[]) { 44100 }
+   }
+   },
+   {
+   .ifnum = 0,
+   .type = QUIRK_AUDIO_FIXED_ENDPOINT,
+   .data = &(const struct audioformat) {
+   .formats = SNDRV_PCM_FMTBIT_S24_3LE,
+   .channels = 4, //2x RCA inputs (CH1 & 
CH2)
+   .iface = 0,
+   .altsetting = 1,
+   .altset_idx = 1,
+   .endpoint = 0x82,
+   .ep_attr = USB_ENDPOINT_XFER_ISOC|
+USB_ENDPOINT_SYNC_ASYNC|
+USB_ENDPOINT_USAGE_IMPLICIT_FB,
+   .rates = SNDRV_PCM_RATE_44100,
+   .rate_min = 44100,
+   .rate_max = 44100,
+   .nr_rates = 1,
+   .rate_table = (unsigned int[]) { 44100 }
+   }
+   },
+   {
+   .ifnum = -1
+   }
+   }
+   }
+},
 {
/*
 * Pioneer DJ DJM-900NXS2
-- 
2.29.2



[PATCH v2 2/2] platform/chrome: cros_ec_typec: Set partner num_altmodes

2020-11-09 Thread Prashant Malani
Set the number of altmodes available for a registered partner using the
Type C connector class framework routine.

Cc: Heikki Krogerus 
Signed-off-by: Prashant Malani 
---

Changes in v2:
- Patch introduced for the first time in v2.

 drivers/platform/chrome/cros_ec_typec.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/platform/chrome/cros_ec_typec.c 
b/drivers/platform/chrome/cros_ec_typec.c
index ce031a10eb1b..743a28426f98 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -621,6 +621,7 @@ static int cros_typec_register_altmodes(struct 
cros_typec_data *typec, int port_
struct cros_typec_altmode_node *node;
struct typec_altmode_desc desc;
struct typec_altmode *amode;
+   int num_altmodes = 0;
int ret = 0;
int i, j;
 
@@ -647,9 +648,16 @@ static int cros_typec_register_altmodes(struct 
cros_typec_data *typec, int port_
 
node->amode = amode;
list_add_tail(>list, >partner_mode_list);
+   num_altmodes++;
}
}
 
+   ret = typec_partner_set_num_altmodes(port->partner, num_altmodes);
+   if (ret < 0) {
+   dev_err(typec->dev, "Unable to set partner num_altmodes for 
port: %d\n", port_num);
+   goto err_cleanup;
+   }
+
return 0;
 
 err_cleanup:
-- 
2.29.2.222.g5d2a92d10f8-goog



[PATCH v2 1/2] usb: typec: Add number of altmodes partner attr

2020-11-09 Thread Prashant Malani
Add a user-visible attribute for the number of alternate modes available
in a partner. This allows userspace to determine whether there are any
remaining alternate modes left to be registered by the kernel driver. It
can begin executing any policy state machine after all available
alternate modes have been registered with the connector class framework.

This value is set to "-1" initially, signifying that a valid number of
alternate modes haven't been set for the partner.

Also add a sysfs file which exposes this attribute. The file remains
hidden as long as the attribute value is -1.

Cc: Benson Leung 
Cc: Heikki Krogerus 
Signed-off-by: Prashant Malani 
---

Changes in v2:
- Added ABI/testing documentation entry for added sysfs file.
- Changed name of the sysfs file to "number_of_alternate_modes" based on
  review comments.
- Added is_visible() logic suggested by Heikki in the comments of v1.
- Updated commit message.

v1:
https://lore.kernel.org/lkml/20200701003149.3101219-1-pmal...@chromium.org/

 Documentation/ABI/testing/sysfs-class-typec |  8 +++
 drivers/usb/typec/class.c   | 66 -
 include/linux/usb/typec.h   |  1 +
 3 files changed, 74 insertions(+), 1 deletion(-)

diff --git a/Documentation/ABI/testing/sysfs-class-typec 
b/Documentation/ABI/testing/sysfs-class-typec
index b834671522d6..73ac7b461ae5 100644
--- a/Documentation/ABI/testing/sysfs-class-typec
+++ b/Documentation/ABI/testing/sysfs-class-typec
@@ -134,6 +134,14 @@ Description:
Shows if the partner supports USB Power Delivery communication:
Valid values: yes, no
 
+What:  /sys/class/typec/-partner/number_of_alternate_modes
+Date:  November 2020
+Contact:   Prashant Malani 
+Description:
+   Shows the number of alternate modes which are advertised by the 
partner
+   during Power Delivery discovery. This file remains hidden until 
a value
+   greater than or equal to 0 is set by Type C port driver.
+
 What:  /sys/class/typec/-partner>/identity/
 Date:  April 2017
 Contact:   Heikki Krogerus 
diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
index 35eec707cb51..c7412ddbd311 100644
--- a/drivers/usb/typec/class.c
+++ b/drivers/usb/typec/class.c
@@ -33,6 +33,7 @@ struct typec_partner {
struct usb_pd_identity  *identity;
enum typec_accessoryaccessory;
struct ida  mode_ids;
+   int num_altmodes;
 };
 
 struct typec_port {
@@ -532,12 +533,43 @@ static ssize_t supports_usb_power_delivery_show(struct 
device *dev,
 }
 static DEVICE_ATTR_RO(supports_usb_power_delivery);
 
+static ssize_t number_of_alternate_modes_show(struct device *dev, struct 
device_attribute *attr,
+ char *buf)
+{
+   struct typec_partner *p = to_typec_partner(dev);
+
+   return sysfs_emit(buf, "%d\n", p->num_altmodes);
+}
+static DEVICE_ATTR_RO(number_of_alternate_modes);
+
 static struct attribute *typec_partner_attrs[] = {
_attr_accessory_mode.attr,
_attr_supports_usb_power_delivery.attr,
+   _attr_number_of_alternate_modes.attr,
+   NULL
+};
+
+static umode_t typec_partner_attr_is_visible(struct kobject *kobj, struct 
attribute *attr, int n)
+{
+   struct typec_partner *partner = to_typec_partner(kobj_to_dev(kobj));
+
+   if (attr == _attr_number_of_alternate_modes.attr) {
+   if (partner->num_altmodes < 0)
+   return 0;
+   }
+
+   return attr->mode;
+}
+
+static struct attribute_group typec_partner_group = {
+   .is_visible = typec_partner_attr_is_visible,
+   .attrs = typec_partner_attrs
+};
+
+static const struct attribute_group *typec_partner_groups[] = {
+   _partner_group,
NULL
 };
-ATTRIBUTE_GROUPS(typec_partner);
 
 static void typec_partner_release(struct device *dev)
 {
@@ -570,6 +602,37 @@ int typec_partner_set_identity(struct typec_partner 
*partner)
 }
 EXPORT_SYMBOL_GPL(typec_partner_set_identity);
 
+/**
+ * typec_partner_set_num_altmodes - Set the number of available partner 
altmodes
+ * @partner: The partner to be updated.
+ * @num_alt_modes: The number of altmodes we want to specify as available.
+ *
+ * This routine is used to report the number of alternate modes supported by 
the
+ * partner. This value is *not* enforced in alternate mode registration 
routines.
+ *
+ * @partner.num_altmodes is set to -1 on partner registration, denoting that
+ * a valid value has not been set for it yet.
+ *
+ * Returns 0 on success or negative error number on failure.
+ */
+int typec_partner_set_num_altmodes(struct typec_partner *partner, int 
num_altmodes)
+{
+   int ret;
+
+   if (num_altmodes < 0)
+   return -EINVAL;
+
+   partner->num_altmodes = num_altmodes;
+   ret = sysfs_update_group(>dev.kobj, _partner_group);
+   

Re: [PATCH] sched/rt, powerpc: Prepare for PREEMPT_RT

2020-11-09 Thread Christophe Leroy



Quoting Wang Qing :


Add PREEMPT_RT output to die().

Signed-off-by: Wang Qing 
---
 arch/powerpc/kernel/traps.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 5006dcb..6dfe567
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -258,6 +258,14 @@ static char *get_mmu_str(void)
return "";
 }

+#ifdef CONFIG_PREEMPT
+#define S_PREEMPT " PREEMPT"
+#elif defined(CONFIG_PREEMPT_RT)
+#define S_PREEMPT " PREEMPT_RT"
+#else
+#define S_PREEMPT ""
+#endif


I don't like too much that forest of #ifdefs. IS_ENABLED() is prefered  
whenever possible.



+
 static int __die(const char *str, struct pt_regs *regs, long err)
 {
printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);
@@ -265,7 +273,7 @@ static int __die(const char *str, struct pt_regs  
*regs, long err)

printk("%s PAGE_SIZE=%luK%s%s%s%s%s%s %s\n",
   IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN) ? "LE" : "BE",
   PAGE_SIZE / 1024, get_mmu_str(),
-  IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "",
+  S_PREEMPT,
   IS_ENABLED(CONFIG_SMP) ? " SMP" : "",
   IS_ENABLED(CONFIG_SMP) ? (" NR_CPUS=" __stringify(NR_CPUS)) : "",
   debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "",
--
2.7.4


I'd prefer to remain in line with the existing and use IS_ENABLED()  
instead of #ifdefs, see below:


diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 5006dcbe1d9f..dec7b81c72a4 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -262,10 +262,11 @@ static int __die(const char *str, struct pt_regs  
*regs, long err)

 {
printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);

-   printk("%s PAGE_SIZE=%luK%s%s%s%s%s%s %s\n",
+   printk("%s PAGE_SIZE=%luK%s%s%s%s%s%s%s %s\n",
   IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN) ? "LE" : "BE",
   PAGE_SIZE / 1024, get_mmu_str(),
   IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "",
+  IS_ENABLED(CONFIG_PREEMPT_RT) ? " PREEMPT_RT" : "",
   IS_ENABLED(CONFIG_SMP) ? " SMP" : "",
   IS_ENABLED(CONFIG_SMP) ? (" NR_CPUS=" __stringify(NR_CPUS)) : "",
   debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "",
---
Christophe


Re: [tip: x86/apic] x86/io_apic: Cleanup trigger/polarity helpers

2020-11-09 Thread Borislav Petkov
On Mon, Nov 09, 2020 at 05:15:03PM -0600, Tom Lendacky wrote:
> [  105.325371] hpet: Lost 9601 RTC interrupts
> [  105.485766] hpet: Lost 9600 RTC interrupts
> [  105.639182] hpet: Lost 9601 RTC interrupts
> [  105.792155] hpet: Lost 9601 RTC interrupts
> [  105.947076] hpet: Lost 9601 RTC interrupts
> [  106.100876] hpet: Lost 9600 RTC interrupts
> [  106.253444] hpet: Lost 9601 RTC interrupts
> [  106.406722] hpet: Lost 9601 RTC interrupts
> 
> preventing the system from booting. I bisected it to this commit.

I bisected it to the exact same thing too, on an AMD laptop, after seeing what
you're seeing.

Thx.

-- 
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette


Re: [External] Re: [PATCH v3 05/21] mm/hugetlb: Introduce pgtable allocation/freeing helpers

2020-11-09 Thread Muchun Song
On Tue, Nov 10, 2020 at 1:42 PM Oscar Salvador  wrote:
>
> On Tue, Nov 10, 2020 at 11:49:27AM +0800, Muchun Song wrote:
> > On Tue, Nov 10, 2020 at 1:21 AM Oscar Salvador  wrote:
> > >
> > > On Sun, Nov 08, 2020 at 10:10:57PM +0800, Muchun Song wrote:
> > > > +static inline unsigned int pgtable_pages_to_prealloc_per_hpage(struct 
> > > > hstate *h)
> > > > +{
> > > > + unsigned long vmemmap_size = vmemmap_pages_size_per_hpage(h);
> > > > +
> > > > + /*
> > > > +  * No need pre-allocate page tabels when there is no vmemmap pages
> > > > +  * to free.
> > >  s /tabels/tables/
> >
> > Thanks.
> >
> > >
> > > > +static int vmemmap_pgtable_prealloc(struct hstate *h, struct page 
> > > > *page)
> > > > +{
> > > > + int i;
> > > > + pgtable_t pgtable;
> > > > + unsigned int nr = pgtable_pages_to_prealloc_per_hpage(h);
> > > > +
> > > > + if (!nr)
> > > > + return 0;
> > > > +
> > > > + vmemmap_pgtable_init(page);
> > > > +
> > > > + for (i = 0; i < nr; i++) {
> > > > + pte_t *pte_p;
> > > > +
> > > > + pte_p = pte_alloc_one_kernel(_mm);
> > > > + if (!pte_p)
> > > > + goto out;
> > > > + vmemmap_pgtable_deposit(page, virt_to_page(pte_p));
> > > > + }
> > > > +
> > > > + return 0;
> > > > +out:
> > > > + while (i-- && (pgtable = vmemmap_pgtable_withdraw(page)))
> > > > + pte_free_kernel(_mm, page_to_virt(pgtable));
> > >
> > > would not be enough to:
> > >
> > > while (pgtable = vmemmap_pgtable_withdrag(page))
> > > pte_free_kernel(_mm, page_to_virt(pgtable));
> >
> > The vmemmap_pgtable_withdraw can not return NULL. So we can not
> > drop the "i--".
>
> Yeah, you are right, I managed to confuse myself.
> But why not make it return null, something like:
>
> static pgtable_t vmemmap_pgtable_withdraw(struct page *page)
> {
> pgtable_t pgtable;
>
> /* FIFO */
> pgtable = page_huge_pte(page);

The check should be added here.

   if (!pgtable)
   return NULL;

Just like my previous v2 patch does. In this case, we can drop those
checks. What do you think?

> page_huge_pte(page) = list_first_entry_or_null(>lru,
>struct page, lru);
> if (page_huge_pte(page))
> list_del(>lru);
>
> return page_huge_pte(page) ? pgtable : NULL;
> }
>
> What do you think?
>
>
> --
> Oscar Salvador
> SUSE L3



-- 
Yours,
Muchun


Re: [PATCH] powerpc/mm: Fix comparing pointer to 0 warning

2020-11-09 Thread Christophe Leroy




Le 10/11/2020 à 03:56, xiakaixu1...@gmail.com a écrit :

From: Kaixu Xia 

Fixes coccicheck warning:

./arch/powerpc/mm/pgtable_32.c:87:11-12: WARNING comparing pointer to 0

Avoid pointer type value compared to 0.

Reported-by: Tosk Robot 
Signed-off-by: Kaixu Xia 


Reviewed-by: Christophe Leroy 


---
  arch/powerpc/mm/pgtable_32.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index 079159e97bca..888b9713a316 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -84,7 +84,7 @@ int __ref map_kernel_page(unsigned long va, phys_addr_t pa, 
pgprot_t prot)
pg = pte_alloc_kernel(pd, va);
else
pg = early_pte_alloc_kernel(pd, va);
-   if (pg != 0) {
+   if (pg) {
err = 0;
/* The PTE should never be already set nor present in the
 * hash table



RE: [v9 1/2] i2c: imx: support slave mode for imx I2C driver

2020-11-09 Thread Biwen Li
Hi Oleksij, Wolfram,

Any comments?

Regards,
Biwen Li

> From: Biwen Li 
> 
> The patch supports slave mode for imx I2C driver
> 
> Signed-off-by: Biwen Li 
> ---
> Change in v9:
>   - remove #ifdef after select I2C_SLAVE by default
> 
> Change in v8:
>   - fix build issue
> 
> Change in v7:
>   - support auto switch mode between master and slave
>   - enable interrupt when idle in slave mode
>   - remove #ifdef
> 
> Change in v6:
>   - delete robust logs and comments
>   - not read status register again in master isr.
> 
> Change in v5:
>   - fix a bug that cannot determine in what mode(master mode or
> slave mode)
> 
> Change in v4:
>   - add MACRO CONFIG_I2C_SLAVE to fix compilation issue
> 
> Change in v3:
>   - support layerscape and i.mx platform
> 
> Change in v2:
>   - remove MACRO CONFIG_I2C_SLAVE
> 
>  drivers/i2c/busses/i2c-imx.c | 213
> ---
>  1 file changed, 199 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index
> c98529c76348..098e2c8a0fc7 100644
> --- a/drivers/i2c/busses/i2c-imx.c
> +++ b/drivers/i2c/busses/i2c-imx.c
> @@ -17,6 +17,7 @@
>   *   Copyright (C) 2008 Darius Augulis 
>   *
>   *   Copyright 2013 Freescale Semiconductor, Inc.
> + *   Copyright 2020 NXP
>   *
>   */
> 
> @@ -72,6 +73,7 @@
>  #define IMX_I2C_I2CR 0x02/* i2c control */
>  #define IMX_I2C_I2SR 0x03/* i2c status */
>  #define IMX_I2C_I2DR 0x04/* i2c transfer data */
> +#define IMX_I2C_IBIC 0x05/* i2c transfer data */
> 
>  #define IMX_I2C_REGSHIFT 2
>  #define VF610_I2C_REGSHIFT   0
> @@ -91,6 +93,7 @@
>  #define I2CR_MSTA0x20
>  #define I2CR_IIEN0x40
>  #define I2CR_IEN 0x80
> +#define IBIC_BIIE0x80 // Bus idle interrupt enable
> 
>  /* register bits different operating codes definition:
>   * 1) I2SR: Interrupt flags clear operation differ between SoCs:
> @@ -201,6 +204,7 @@ struct imx_i2c_struct {
>   struct pinctrl_state *pinctrl_pins_gpio;
> 
>   struct imx_i2c_dma  *dma;
> + struct i2c_client   *slave;
>  };
> 
>  static const struct imx_i2c_hwdata imx1_i2c_hwdata = { @@ -277,6 +281,14
> @@ static inline unsigned char imx_i2c_read_reg(struct imx_i2c_struct
> *i2c_imx,
>   return readb(i2c_imx->base + (reg << i2c_imx->hwdata->regshift));  }
> 
> +/* Set up i2c controller register and i2c status register to default
> +value. */ static void i2c_imx_reset_regs(struct imx_i2c_struct
> +*i2c_imx) {
> + imx_i2c_write_reg(i2c_imx->hwdata->i2cr_ien_opcode ^ I2CR_IEN,
> + i2c_imx, IMX_I2C_I2CR);
> + imx_i2c_write_reg(i2c_imx->hwdata->i2sr_clr_opcode, i2c_imx,
> +IMX_I2C_I2SR); }
> +
>  /* Functions for DMA support */
>  static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
>   dma_addr_t phy_addr)
> @@ -614,20 +626,188 @@ static void i2c_imx_stop(struct imx_i2c_struct
> *i2c_imx, bool atomic)
>   imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);  }
> 
> +/*
> + * Enable bus idle interrupts
> + * Note: IBIC register will be cleared after disabled i2c module.
> + */
> +static void i2c_imx_enable_bus_idle(struct imx_i2c_struct *i2c_imx) {
> + unsigned int temp;
> +
> + temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_IBIC);
> + temp |= IBIC_BIIE;
> + imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_IBIC); }
> +
> +static void i2c_imx_clr_if_bit(unsigned int status, struct
> +imx_i2c_struct *i2c_imx) {
> + status &= ~I2SR_IIF;
> + status |= (i2c_imx->hwdata->i2sr_clr_opcode & I2SR_IIF);
> + imx_i2c_write_reg(status, i2c_imx, IMX_I2C_I2SR); }
> +
> +/* Clear arbitration lost bit */
> +static void i2c_imx_clr_al_bit(unsigned int status, struct
> +imx_i2c_struct *i2c_imx) {
> + status &= ~I2SR_IAL;
> + status |= (i2c_imx->hwdata->i2sr_clr_opcode & I2SR_IAL);
> + imx_i2c_write_reg(status, i2c_imx, IMX_I2C_I2SR); }
> +
> +static irqreturn_t i2c_imx_slave_isr(struct imx_i2c_struct *i2c_imx,
> +  unsigned int status, unsigned int ctl) {
> + u8 value;
> +
> + if (status & I2SR_IAL) { /* Arbitration lost */
> + i2c_imx_clr_al_bit(status | I2SR_IIF, i2c_imx);
> + } else if (status & I2SR_IAAS) { /* Addressed as a slave */
> + if (status & I2SR_SRW) { /* Master wants to read from us*/
> + dev_dbg(_imx->adapter.dev, "read requested");
> + i2c_slave_event(i2c_imx->slave, 
> I2C_SLAVE_READ_REQUESTED,
> );
> +
> + /* Slave transmit */
> + ctl |= I2CR_MTX;
> + imx_i2c_write_reg(ctl, i2c_imx, IMX_I2C_I2CR);
> +
> + /* Send data */
> + imx_i2c_write_reg(value, i2c_imx, IMX_I2C_I2DR);
> + } else { /* Master wants to write to us */
> + dev_dbg(_imx->adapter.dev, "write requested");
> +  

Re: [f2fs-dev] [PATCH] f2fs: avoid race condition for shinker count

2020-11-09 Thread Chao Yu

On 2020/11/10 12:19, Jaegeuk Kim wrote:

On 11/10, Chao Yu wrote:

On 2020/11/10 1:00, Jaegeuk Kim wrote:

Light reported sometimes shinker gets nat_cnt < dirty_nat_cnt resulting in


I didn't get the problem clearly, did you mean __count_nat_entries() will
give the wrong shrink count due to race condition? should there be a lock
while reading these two variables?


wrong do_shinker work. Basically the two counts should not happen like that.

So, I suspect this race condtion where:
- f2fs_try_to_free_nats__flush_nat_entry_set
   nat_cnt=2, dirty_nat_cnt=2
 __clear_nat_cache_dirty
  spin_lock(nat_list_lock)
  list_move()
  spin_unlock(nat_list_lock)
   spin_lock(nat_list_lock)
   list_del()
   spin_unlock(nat_list_lock)
   nat_cnt=1, dirty_nat_cnt=2
 nat_cnt=1, dirty_nat_cnt=1


nm_i->nat_cnt and nm_i->dirty_nat_cnt were protected by
nm_i->nat_tree_lock, I didn't see why expanding nat_list_lock range
will help... since there are still places nat_list_lock() didn't
cover these two reference counts.


Yeah, I missed nat_tree_lock, and indeed it should cover this. So, the problem
is Light reported subtle case of nat_cnt < dirty_nat_cnt in shrink_count.
We may need to use nat_tree_lock in shrink_count?


change like this?

__count_nat_entries()

down_read(_i->nat_tree_lock);
count = NM_I(sbi)->nat_cnt - NM_I(sbi)->dirty_nat_cnt;
up_read(_i->nat_tree_lock);

Thanks,





Thanks,



Reported-by: Light Hsieh 
Signed-off-by: Jaegeuk Kim 
---
   fs/f2fs/node.c | 3 +--
   1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 42394de6c7eb..e8ec65e40f06 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -269,11 +269,10 @@ static void __clear_nat_cache_dirty(struct f2fs_nm_info 
*nm_i,
   {
spin_lock(_i->nat_list_lock);
list_move_tail(>list, _i->nat_entries);
-   spin_unlock(_i->nat_list_lock);
-
set_nat_flag(ne, IS_DIRTY, false);
set->entry_cnt--;
nm_i->dirty_nat_cnt--;
+   spin_unlock(_i->nat_list_lock);
   }
   static unsigned int __gang_lookup_nat_set(struct f2fs_nm_info *nm_i,


.



RE: [PATCH net-next] net: emaclite: Add error handling for of_address_ and phy read functions

2020-11-09 Thread Radhey Shyam Pandey
> -Original Message-
> From: Jakub Kicinski 
> Sent: Sunday, November 8, 2020 1:05 AM
> To: Radhey Shyam Pandey 
> Cc: da...@davemloft.net; Michal Simek ;
> net...@vger.kernel.org; linux-arm-ker...@lists.infradead.org; linux-
> ker...@vger.kernel.org; git ; Shravya Kumbham
> 
> Subject: Re: [PATCH net-next] net: emaclite: Add error handling for
> of_address_ and phy read functions
> 
> On Tue, 3 Nov 2020 19:01:05 +0530 Radhey Shyam Pandey wrote:
> > From: Shravya Kumbham 
> >
> > Add ret variable, conditions to check the return value and it's error
> > path for of_address_to_resource() and phy_read() functions.
> >
> > Addresses-Coverity: Event check_return value.
> > Signed-off-by: Shravya Kumbham 
> > Signed-off-by: Radhey Shyam Pandey 
> 
> Any reason not to apply this to net as a fix?
Yes, it can be applied to net as a fix. 
> 
> > diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> > b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> > index 0c26f5b..fc5ccd1 100644
> > --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> > +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> > @@ -820,7 +820,7 @@ static int xemaclite_mdio_write(struct mii_bus
> > *bus, int phy_id, int reg,  static int xemaclite_mdio_setup(struct
> > net_local *lp, struct device *dev)  {
> > struct mii_bus *bus;
> > -   int rc;
> > +   int rc, ret;
> > struct resource res;
> > struct device_node *np = of_get_parent(lp->phy_node);
> > struct device_node *npp;
> > @@ -834,7 +834,13 @@ static int xemaclite_mdio_setup(struct net_local
> *lp, struct device *dev)
> > }
> > npp = of_get_parent(np);
> >
> > -   of_address_to_resource(npp, 0, );
> > +   ret = of_address_to_resource(npp, 0, );
> > +   if (ret) {
> > +   dev_err(dev, "%s resource error!\n",
> > +   dev->of_node->full_name);
> > +   of_node_put(lp->phy_node);
> 
> I'm always confused by the of_* refcounting. Why do you need to put
> phy_node here, and nowhere else in this function?

Initially, we added of_node_put(phy_node) thinking about this 
particular coverity change. But agree it has to be added for
all error path i.e better place would be in xemaclite_of_probe()
error label.

> 
> > +   return ret;
> > +   }
> 
> > /* Restart auto negotiation */
> > bmcr = phy_read(lp->phy_dev, MII_BMCR);
> > +   if (bmcr < 0) {
> > +   dev_err(>ndev->dev, "phy_read failed\n");
> > +   phy_disconnect(lp->phy_dev);
> > +   lp->phy_dev = NULL;
> > +
> > +   return bmcr;
> > +   }
> > bmcr |= (BMCR_ANENABLE | BMCR_ANRESTART);
> > phy_write(lp->phy_dev, MII_BMCR, bmcr);
> 
> Does it really make much sense to validate the return value of
> phy_read() but not check any errors from phy_write()s?
Error handling was added for phy_read as it was using return value
and reported by coverity. But yes we in a follow-up patch we
can extend error handling for phy_write as well.
 


[PATCH v5.9-v4.19] perf scripting python: Avoid declaring function pointers with a visibility attribute

2020-11-09 Thread Tapas Kundu
From: Arnaldo Carvalho de Melo 

commit d0e7b0c71fbb653de90a7163ef46912a96f0bdaf upstream.

To avoid this:

  util/scripting-engines/trace-event-python.c: In function 
'python_start_script':
  util/scripting-engines/trace-event-python.c:1595:2: error: 'visibility' 
attribute ignored [-Werror=attributes]
   1595 |  PyMODINIT_FUNC (*initfunc)(void);
|  ^~

That started breaking when building with PYTHON=python3 and these gcc
versions (I haven't checked with the clang ones, maybe it breaks there
as well):

  # export PERF_TARBALL=http://192.168.86.5/perf/perf-5.9.0.tar.xz
  # dm  fedora:33 fedora:rawhide
 1   107.80 fedora:33 : Ok   gcc (GCC) 10.2.1 20201005 (Red Hat 
10.2.1-5), clang version 11.0.0 (Fedora 11.0.0-1.fc33)
 292.47 fedora:rawhide: Ok   gcc (GCC) 10.2.1 20201016 (Red Hat 
10.2.1-6), clang version 11.0.0 (Fedora 11.0.0-1.fc34)
  #

Avoid that by ditching that 'initfunc' function pointer with its:

#define Py_EXPORTED_SYMBOL _attribute_ ((visibility ("default")))
#define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject*

And just call PyImport_AppendInittab() at the end of the ifdef python3
block with the functions that were being attributed to that initfunc.

Cc: Adrian Hunter 
Cc: Ian Rogers 
Cc: Jiri Olsa 
Cc: Namhyung Kim 
Signed-off-by: Arnaldo Carvalho de Melo 
Signed-off-by: Tapas Kundu 
---
 tools/perf/util/scripting-engines/trace-event-python.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/scripting-engines/trace-event-python.c 
b/tools/perf/util/scripting-engines/trace-event-python.c
index 93c03b39c..3b02c3f1b 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -1587,7 +1587,6 @@ static void _free_command_line(wchar_t **command_line, 
int num)
 static int python_start_script(const char *script, int argc, const char **argv)
 {
struct tables *tables = _global;
-   PyMODINIT_FUNC (*initfunc)(void);
 #if PY_MAJOR_VERSION < 3
const char **command_line;
 #else
@@ -1602,20 +1601,18 @@ static int python_start_script(const char *script, int 
argc, const char **argv)
FILE *fp;
 
 #if PY_MAJOR_VERSION < 3
-   initfunc = initperf_trace_context;
command_line = malloc((argc + 1) * sizeof(const char *));
command_line[0] = script;
for (i = 1; i < argc + 1; i++)
command_line[i] = argv[i - 1];
+   PyImport_AppendInittab(name, initperf_trace_context);
 #else
-   initfunc = PyInit_perf_trace_context;
command_line = malloc((argc + 1) * sizeof(wchar_t *));
command_line[0] = Py_DecodeLocale(script, NULL);
for (i = 1; i < argc + 1; i++)
command_line[i] = Py_DecodeLocale(argv[i - 1], NULL);
+   PyImport_AppendInittab(name, PyInit_perf_trace_context);
 #endif
-
-   PyImport_AppendInittab(name, initfunc);
Py_Initialize();
 
 #if PY_MAJOR_VERSION < 3
-- 
2.23.0



[PATCH -V3 2/2] autonuma: Migrate on fault among multiple bound nodes

2020-11-09 Thread Huang Ying
Now, AutoNUMA can only optimize the page placement among the NUMA nodes if the
default memory policy is used.  Because the memory policy specified explicitly
should take precedence.  But this seems too strict in some situations.  For
example, on a system with 4 NUMA nodes, if the memory of an application is bound
to the node 0 and 1, AutoNUMA can potentially migrate the pages between the node
0 and 1 to reduce cross-node accessing without breaking the explicit memory
binding policy.

So in this patch, if mbind(.mode=MPOL_BIND, .flags=MPOL_MF_LAZY) is used to bind
the memory of the application to multiple nodes, and in the hint page fault
handler both the faulting page node and the accessing node are in the policy
nodemask, the page will be tried to be migrated to the accessing node to reduce
the cross-node accessing.

[Peter Zijlstra: provided the simplified implementation method.]

Signed-off-by: "Huang, Ying" 
Acked-by: Mel Gorman 
Cc: Andrew Morton 
Cc: Ingo Molnar 
Cc: Rik van Riel 
Cc: Johannes Weiner 
Cc: "Matthew Wilcox (Oracle)" 
Cc: Dave Hansen 
Cc: Andi Kleen 
Cc: Michal Hocko 
Cc: David Rientjes 
---
 mm/mempolicy.c | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 63d91fbd3ce6..40f2ff2607b3 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2490,15 +2490,19 @@ int mpol_misplaced(struct page *page, struct 
vm_area_struct *vma, unsigned long
break;
 
case MPOL_BIND:
-
/*
-* allows binding to multiple nodes.
-* use current page if in policy nodemask,
-* else select nearest allowed node, if any.
-* If no allowed nodes, use current [!misplaced].
+* Allows binding to multiple nodes.  If both current and
+* accessing nodes are in policy nodemask, migrate to
+* accessing node to optimize page placement. Otherwise,
+* use current page if in policy nodemask, else select
+* nearest allowed node, if any.  If no allowed nodes, use
+* current [!misplaced].
 */
-   if (node_isset(curnid, pol->v.nodes))
+   if (node_isset(curnid, pol->v.nodes)) {
+   if (node_isset(thisnid, pol->v.nodes))
+   goto mopron;
goto out;
+   }
z = first_zones_zonelist(
node_zonelist(numa_node_id(), GFP_HIGHUSER),
gfp_zone(GFP_HIGHUSER),
@@ -2512,6 +2516,7 @@ int mpol_misplaced(struct page *page, struct 
vm_area_struct *vma, unsigned long
 
/* Migrate the page towards the node whose CPU is referencing it */
if (pol->flags & MPOL_F_MOPRON) {
+mopron:
polnid = thisnid;
 
if (!should_numa_migrate_memory(current, page, curnid, thiscpu))
-- 
2.28.0



[PATCH -V3 0/2] autonuma: Migrate on fault among multiple bound nodes

2020-11-09 Thread Huang Ying
To make it possible to optimize cross-socket memory accessing with
AutoNUMA even if the memory of the application is bound to multiple
NUMA nodes.

Changes:

v3:

- Rebased on latest upstream (v5.10-rc3)

- Revised the change log.

v2:

- Rebased on latest upstream (v5.10-rc1)

Huang Ying (2):
  mempolicy: Rename MPOL_F_MORON to MPOL_F_MOPRON
  autonuma: Migrate on fault among multiple bound nodes

 include/uapi/linux/mempolicy.h |  2 +-
 kernel/sched/debug.c   |  2 +-
 mm/mempolicy.c | 23 ++-
 3 files changed, 16 insertions(+), 11 deletions(-)

-- 
2.28.0


[PATCH -V3 1/2] mempolicy: Rename MPOL_F_MORON to MPOL_F_MOPRON

2020-11-09 Thread Huang Ying
To follow code-of-conduct better.  Although the patch changes a user
visible flag definition in uapi, the flag isn't used by the user space
at all.  The flag is only used internally by kernel in struct
mempolicy flags field.  It is defined in uapi just to avoid to
conflict with MPOL_MODE_FLAGS.  The flag is upper case with prefix, so
it looks generally OK by itself.  But in the following patch, we will
introduce a label named after the flag, which is lower case and
without prefix, so it's better to rename it.

Signed-off-by: "Huang, Ying" 
Suggested-by: "Matthew Wilcox (Oracle)" 
Acked-by: Rafael Aquini 
Cc: Andrew Morton 
Cc: Ingo Molnar 
Cc: Mel Gorman 
Cc: Rik van Riel 
Cc: Johannes Weiner 
Cc: Dave Hansen 
Cc: Andi Kleen 
Cc: Michal Hocko 
Cc: David Rientjes 
---
 include/uapi/linux/mempolicy.h | 2 +-
 kernel/sched/debug.c   | 2 +-
 mm/mempolicy.c | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/uapi/linux/mempolicy.h b/include/uapi/linux/mempolicy.h
index 3354774af61e..3c3666d017e6 100644
--- a/include/uapi/linux/mempolicy.h
+++ b/include/uapi/linux/mempolicy.h
@@ -60,7 +60,7 @@ enum {
 #define MPOL_F_SHARED  (1 << 0)/* identify shared policies */
 #define MPOL_F_LOCAL   (1 << 1)/* preferred local allocation */
 #define MPOL_F_MOF (1 << 3) /* this policy wants migrate on fault */
-#define MPOL_F_MORON   (1 << 4) /* Migrate On protnone Reference On Node */
+#define MPOL_F_MOPRON  (1 << 4) /* Migrate On Protnone Reference On Node */
 
 
 #endif /* _UAPI_LINUX_MEMPOLICY_H */
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 0655524700d2..8bfb6adb3f31 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -898,7 +898,7 @@ static void sched_show_numa(struct task_struct *p, struct 
seq_file *m)
 
task_lock(p);
pol = p->mempolicy;
-   if (pol && !(pol->flags & MPOL_F_MORON))
+   if (pol && !(pol->flags & MPOL_F_MOPRON))
pol = NULL;
mpol_get(pol);
task_unlock(p);
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 3ca4898f3f24..63d91fbd3ce6 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2511,7 +2511,7 @@ int mpol_misplaced(struct page *page, struct 
vm_area_struct *vma, unsigned long
}
 
/* Migrate the page towards the node whose CPU is referencing it */
-   if (pol->flags & MPOL_F_MORON) {
+   if (pol->flags & MPOL_F_MOPRON) {
polnid = thisnid;
 
if (!should_numa_migrate_memory(current, page, curnid, thiscpu))
@@ -2802,7 +2802,7 @@ void __init numa_policy_init(void)
preferred_node_policy[nid] = (struct mempolicy) {
.refcnt = ATOMIC_INIT(1),
.mode = MPOL_PREFERRED,
-   .flags = MPOL_F_MOF | MPOL_F_MORON,
+   .flags = MPOL_F_MOF | MPOL_F_MOPRON,
.v = { .preferred_node = nid, },
};
}
@@ -3010,7 +3010,7 @@ void mpol_to_str(char *buffer, int maxlen, struct 
mempolicy *pol)
unsigned short mode = MPOL_DEFAULT;
unsigned short flags = 0;
 
-   if (pol && pol != _policy && !(pol->flags & MPOL_F_MORON)) {
+   if (pol && pol != _policy && !(pol->flags & MPOL_F_MOPRON)) {
mode = pol->mode;
flags = pol->flags;
}
-- 
2.28.0



Re: [PATCH 00/19] Second step support for A100

2020-11-09 Thread Frank Lee
It seems that sending too many e-mails at one time will cause some
emails to fail to be sent out. I will try again.

BR / Yangtao


  1   2   3   4   5   6   7   8   9   10   >