RE: [PATCH v3 1/4] scsi: ufs: Add checks before setting clk-gating states

2020-07-19 Thread Avri Altman
> 
> 
> Clock gating features can be turned on/off selectively which means its
> state information is only important if it is enabled. This change makes
> sure that we only look at state of clk-gating if it is enabled.
> 
> Signed-off-by: Can Guo 
Reviewed-by: Avri Altman 


[GIT PULL] dma-mapping fixes for 5.8

2020-07-19 Thread Christoph Hellwig
The following changes since commit 0dc589da873b58b70f4caf4b070fb0cf70fdd1dc:

  Merge tag 'iommu-fixes-v5.8-rc5' of 
git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu (2020-07-13 12:34:05 
-0700)

are available in the Git repository at:

  git://git.infradead.org/users/hch/dma-mapping.git tags/dma-mapping-5.8-6

for you to fetch changes up to d9765e41d8e9ea2251bf73735a2895c8bad546fc:

  dma-pool: do not allocate pool memory from CMA (2020-07-14 15:46:32 +0200)


dma-mapping fixes for 5.8:

 - ensure we always have fully addressable memory in the dma coherent
   pool (Nicolas Saenz Julienne)


Nicolas Saenz Julienne (5):
  dma-direct: provide function to check physical memory area validity
  dma-pool: get rid of dma_in_atomic_pool()
  dma-pool: introduce dma_guess_pool()
  dma-pool: make sure atomic pool suits device
  dma-pool: do not allocate pool memory from CMA

 include/linux/dma-direct.h |  1 +
 kernel/dma/direct.c|  2 +-
 kernel/dma/pool.c  | 91 --
 3 files changed, 58 insertions(+), 36 deletions(-)


WARNING in do_syscall_64

2020-07-19 Thread syzbot
Hello,

syzbot found the following issue on:

HEAD commit:e9919e11 Merge branch 'for-linus' of git://git.kernel.org/..
git tree:   upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=11dca4cf10
kernel config:  https://syzkaller.appspot.com/x/.config?x=e944500a36bc4d55
dashboard link: https://syzkaller.appspot.com/bug?extid=29454675f5fe94137999
compiler:   clang version 10.0.0 (https://github.com/llvm/llvm-project/ 
c2443155a0fb245c8f17f2c1c72b6ea391e86e81)

Unfortunately, I don't have any reproducer for this issue yet.

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

[ cut here ]
DEBUG_LOCKS_WARN_ON(!irqs_disabled())
WARNING: CPU: 0 PID: 7015 at kernel/locking/lockdep.c:3745 
lockdep_hardirqs_off+0x8f/0xa0 kernel/locking/lockdep.c:3745
Kernel panic - not syncing: panic_on_warn set ...
CPU: 0 PID: 7015 Comm: syz-executor.2 Not tainted 5.8.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 
01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1f0/0x31e lib/dump_stack.c:118
 panic+0x264/0x7a0 kernel/panic.c:231
 __warn+0x227/0x250 kernel/panic.c:600
 report_bug+0x1b1/0x2e0 lib/bug.c:198
 handle_bug+0x42/0x80 arch/x86/kernel/traps.c:235
 exc_invalid_op+0x16/0x40 arch/x86/kernel/traps.c:255
 asm_exc_invalid_op+0x12/0x20 arch/x86/include/asm/idtentry.h:542
RIP: 0010:lockdep_hardirqs_off+0x8f/0xa0 kernel/locking/lockdep.c:3745
Code: 41 5e c3 e8 c3 07 00 00 85 c0 74 f3 83 3d ac e1 6f 01 00 75 ea 48 c7 c7 
26 0a 07 89 48 c7 c6 46 9a 08 89 31 c0 e8 e1 c3 28 f9 <0f> 0b eb d1 0f 1f 00 66 
2e 0f 1f 84 00 00 00 00 00 55 41 57 41 56
RSP: 0018:c90004957f20 EFLAGS: 00010246
RAX: 516cfadac3d71d00 RBX: 8880611fe500 RCX: 8880611fe500
RDX:  RSI:  RDI: 0282
RBP:  R08: 817a2fd0 R09: fbfff129cee5
R10: fbfff129cee5 R11:  R12: 
R13:  R14: 88400078 R15: c90004957f58
 enter_from_user_mode arch/x86/entry/common.c:100 [inline]
 do_syscall_64+0x18/0xe0 arch/x86/entry/common.c:374
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45f9ea
Code: Bad RIP value.
RSP: 002b:7ffd3fa384e8 EFLAGS: 0246 ORIG_RAX: 00e4
RAX: ffda RBX: 0002d52f RCX: 0045f9ea
RDX:  RSI: 7ffd3fa384f0 RDI: 0001
RBP: 00c9 R08: 0001 R09: 02ca9940
R10:  R11: 0246 R12: 0009
R13: 7ffd3fa38550 R14: 0002d505 R15: 7ffd3fa38560
Kernel Offset: disabled
Rebooting in 86400 seconds..


---
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.


Re: [PATCH] m68k: Replace HTTP links with HTTPS ones

2020-07-19 Thread Finn Thain
On Sat, 18 Jul 2020, Alexander A. Klimov wrote:

> *Sigh* ... yes, doing everything one nice day is better that doing just 
> something right now.

I wasn't saying "do everything possible or else do nothing". I was trying 
to point to the larger problem. The http links in the kernel source hardly 
seem to matter when nothing I read on HTTPS links is trustworthy.

> But doing just something right now is better that doing nothing at all.
> 

HTTPS is not new. MITM attack is as old as the Byzantian hills. Your 
rationale for doing "something right now" is apparently that you trust the 
people who maintain "kernel developers" browsers but mistrust the people 
who maintain some network links and switches. That's fine and you should 
set your policy accordingly. But you should not be surprised if others 
have different threat models -- especially when you fail to offer an 
actual case where this patch might have helped.


Re: [PATCH] i2c: iproc: fix race between client unreg and isr

2020-07-19 Thread Rayagonda Kokatanur
On Sun, Jul 19, 2020 at 5:10 AM Dhananjay Phadke
 wrote:
>
> When i2c client unregisters, synchronize irq before setting
> iproc_i2c->slave to NULL.
>
> Unable to handle kernel NULL pointer dereference at virtual address 
> 0318
>
> [  371.020421] pc : bcm_iproc_i2c_isr+0x530/0x11f0
> [  371.025098] lr : __handle_irq_event_percpu+0x6c/0x170
> [  371.030309] sp : 800010003e40
> [  371.033727] x29: 800010003e40 x28: 0060
> [  371.039206] x27: 800010ca9de0 x26: 800010f895df
> [  371.044686] x25: 800010f1 x24: 0008f7ff3600
> [  371.050165] x23: 0003 x22: 0160
> [  371.055645] x21: 800010f1 x20: 0160
> [  371.061124] x19: 0008f726f080 x18: 
> [  371.066603] x17:  x16: 
> [  371.072082] x15:  x14: 
> [  371.077561] x13:  x12: 0001
> [  371.083040] x11:  x10: 0040
> [  371.088519] x9 : 800010f317c8 x8 : 800010f317c0
> [  371.093999] x7 : 0008f805b3b0 x6 : 
> [  371.099478] x5 : 0008f7ff36a4 x4 : 8008ee43d000
> [  371.104957] x3 :  x2 : 8000107d64c0
> [  371.110436] x1 : c0af x0 : 
>
> [  371.115916] Call trace:
> [  371.118439]  bcm_iproc_i2c_isr+0x530/0x11f0
> [  371.122754]  __handle_irq_event_percpu+0x6c/0x170
> [  371.127606]  handle_irq_event_percpu+0x34/0x88
> [  371.132189]  handle_irq_event+0x40/0x120
> [  371.136234]  handle_fasteoi_irq+0xcc/0x1a0
> [  371.140459]  generic_handle_irq+0x24/0x38
> [  371.144594]  __handle_domain_irq+0x60/0xb8
> [  371.148820]  gic_handle_irq+0xc0/0x158
> [  371.152687]  el1_irq+0xb8/0x140
> [  371.155927]  arch_cpu_idle+0x10/0x18
> [  371.159615]  do_idle+0x204/0x290
> [  371.162943]  cpu_startup_entry+0x24/0x60
> [  371.166990]  rest_init+0xb0/0xbc
> [  371.170322]  arch_call_rest_init+0xc/0x14
> [  371.174458]  start_kernel+0x404/0x430
>
> Fixes: c245d94ed106 ("i2c: iproc: Add multi byte read-write support for slave 
> mode")
> Signed-off-by: Dhananjay Phadke 
> ---
>  drivers/i2c/busses/i2c-bcm-iproc.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c 
> b/drivers/i2c/busses/i2c-bcm-iproc.c
> index b58224b7b..37d2a79e7 100644
> --- a/drivers/i2c/busses/i2c-bcm-iproc.c
> +++ b/drivers/i2c/busses/i2c-bcm-iproc.c
> @@ -1074,14 +1074,15 @@ static int bcm_iproc_i2c_unreg_slave(struct 
> i2c_client *slave)
> if (!iproc_i2c->slave)
> return -EINVAL;
>
> -   iproc_i2c->slave = NULL;
> -
> /* disable all slave interrupts */
> tmp = iproc_i2c_rd_reg(iproc_i2c, IE_OFFSET);
> tmp &= ~(IE_S_ALL_INTERRUPT_MASK <<
> IE_S_ALL_INTERRUPT_SHIFT);
> iproc_i2c_wr_reg(iproc_i2c, IE_OFFSET, tmp);
>
> +   synchronize_irq(iproc_i2c->irq);
> +   iproc_i2c->slave = NULL;
> +
> /* Erase the slave address programmed */
> tmp = iproc_i2c_rd_reg(iproc_i2c, S_CFG_SMBUS_ADDR_OFFSET);
> tmp &= ~BIT(S_CFG_EN_NIC_SMB_ADDR3_SHIFT);

Looks good to me. Thank you for the patch.
Reviewed-by: Rayagonda Kokatanur 

Regards,
Rayagonda


[PATCH] habanalabs: use no flags on MMU cache invalidation

2020-07-19 Thread Tomer Tayar
gaudi_mmu_invalidate_cache() doesn't use the flags parameter, and thus
it can be set to 0 when the function is called in the gaudi only files.

Signed-off-by: Tomer Tayar 
---
 drivers/misc/habanalabs/gaudi/gaudi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c 
b/drivers/misc/habanalabs/gaudi/gaudi.c
index 86cfaf73ad74..4a1a52608fc0 100644
--- a/drivers/misc/habanalabs/gaudi/gaudi.c
+++ b/drivers/misc/habanalabs/gaudi/gaudi.c
@@ -2646,8 +2646,7 @@ static int gaudi_mmu_init(struct hl_device *hdev)
WREG32(mmSTLB_CACHE_INV_BASE_39_8, MMU_CACHE_MNG_ADDR >> 8);
WREG32(mmSTLB_CACHE_INV_BASE_49_40, MMU_CACHE_MNG_ADDR >> 40);
 
-   hdev->asic_funcs->mmu_invalidate_cache(hdev, true,
-   VM_TYPE_USERPTR | VM_TYPE_PHYS_PACK);
+   hdev->asic_funcs->mmu_invalidate_cache(hdev, true, 0);
 
WREG32(mmMMU_UP_MMU_ENABLE, 1);
WREG32(mmMMU_UP_SPI_MASK, 0xF);
-- 
2.17.1



[PATCH net-next v1] net: phy: at803x: add mdix configuration support for AR9331 and AR8035

2020-07-19 Thread Oleksij Rempel
This patch add MDIX configuration ability for AR9331 and AR8035. Theoretically
it should work on other Atheros PHYs, but I was able to test only this
two.

Since I have no certified reference HW able to detect or configure MDIX, this
functionality was confirmed by oscilloscope.

Signed-off-by: Oleksij Rempel 
---
 drivers/net/phy/at803x.c | 78 
 1 file changed, 78 insertions(+)

diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index 96c61aa75bd7..101651b2de54 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -21,6 +21,17 @@
 #include 
 #include 
 
+#define AT803X_SPECIFIC_FUNCTION_CONTROL   0x10
+#define AT803X_SFC_ASSERT_CRS  BIT(11)
+#define AT803X_SFC_FORCE_LINK  BIT(10)
+#define AT803X_SFC_MDI_CROSSOVER_MODE_MGENMASK(6, 5)
+#define AT803X_SFC_AUTOMATIC_CROSSOVER 0x3
+#define AT803X_SFC_MANUAL_MDIX 0x1
+#define AT803X_SFC_MANUAL_MDI  0x0
+#define AT803X_SFC_SQE_TESTBIT(2)
+#define AT803X_SFC_POLARITY_REVERSAL   BIT(1)
+#define AT803X_SFC_DISABLE_JABBER  BIT(0)
+
 #define AT803X_SPECIFIC_STATUS 0x11
 #define AT803X_SS_SPEED_MASK   (3 << 14)
 #define AT803X_SS_SPEED_1000   (2 << 14)
@@ -703,6 +714,12 @@ static int at803x_read_status(struct phy_device *phydev)
return ss;
 
if (ss & AT803X_SS_SPEED_DUPLEX_RESOLVED) {
+   int sfc;
+
+   sfc = phy_read(phydev, AT803X_SPECIFIC_FUNCTION_CONTROL);
+   if (sfc < 0)
+   return sfc;
+
switch (ss & AT803X_SS_SPEED_MASK) {
case AT803X_SS_SPEED_10:
phydev->speed = SPEED_10;
@@ -718,10 +735,23 @@ static int at803x_read_status(struct phy_device *phydev)
phydev->duplex = DUPLEX_FULL;
else
phydev->duplex = DUPLEX_HALF;
+
if (ss & AT803X_SS_MDIX)
phydev->mdix = ETH_TP_MDI_X;
else
phydev->mdix = ETH_TP_MDI;
+
+   switch (FIELD_GET(AT803X_SFC_MDI_CROSSOVER_MODE_M, sfc)) {
+   case AT803X_SFC_MANUAL_MDI:
+   phydev->mdix_ctrl = ETH_TP_MDI;
+   break;
+   case AT803X_SFC_MANUAL_MDIX:
+   phydev->mdix_ctrl = ETH_TP_MDI_X;
+   break;
+   case AT803X_SFC_AUTOMATIC_CROSSOVER:
+   phydev->mdix_ctrl = ETH_TP_MDI_AUTO;
+   break;
+   }
}
 
if (phydev->autoneg == AUTONEG_ENABLE && phydev->autoneg_complete)
@@ -730,6 +760,50 @@ static int at803x_read_status(struct phy_device *phydev)
return 0;
 }
 
+static int at803x_config_mdix(struct phy_device *phydev, u8 ctrl)
+{
+   u16 val;
+
+   switch (ctrl) {
+   case ETH_TP_MDI:
+   val = AT803X_SFC_MANUAL_MDI;
+   break;
+   case ETH_TP_MDI_X:
+   val = AT803X_SFC_MANUAL_MDIX;
+   break;
+   case ETH_TP_MDI_AUTO:
+   val = AT803X_SFC_AUTOMATIC_CROSSOVER;
+   break;
+   default:
+   return 0;
+   }
+
+   return phy_modify_changed(phydev, AT803X_SPECIFIC_FUNCTION_CONTROL,
+ AT803X_SFC_MDI_CROSSOVER_MODE_M,
+ FIELD_PREP(AT803X_SFC_MDI_CROSSOVER_MODE_M, val));
+}
+
+static int at803x_config_aneg(struct phy_device *phydev)
+{
+   int ret;
+
+   ret = at803x_config_mdix(phydev, phydev->mdix_ctrl);
+   if (ret < 0)
+   return ret;
+
+   /* Changes of the midx bits are disruptive to the normal operation;
+* therefore any changes to these registers must be followed by a
+* software reset to take effect.
+*/
+   if (ret == 1) {
+   ret = genphy_soft_reset(phydev);
+   if (ret < 0)
+   return ret;
+   }
+
+   return genphy_config_aneg(phydev);
+}
+
 static int at803x_get_downshift(struct phy_device *phydev, u8 *d)
 {
int val;
@@ -979,6 +1053,7 @@ static struct phy_driver at803x_driver[] = {
.flags  = PHY_POLL_CABLE_TEST,
.probe  = at803x_probe,
.remove = at803x_remove,
+   .config_aneg= at803x_config_aneg,
.config_init= at803x_config_init,
.soft_reset = genphy_soft_reset,
.set_wol= at803x_set_wol,
@@ -1061,6 +1136,9 @@ static struct phy_driver at803x_driver[] = {
.config_intr= &at803x_config_intr,
.cable_test_start   = at803x_cable_test_start,
.cable_test_get_status  = at803x_cable_test_get_status,
+   .read_status= at803x_read_status,
+   .s

Re: [PATCH] habanalabs: use no flags on MMU cache invalidation

2020-07-19 Thread Oded Gabbay
On Sun, Jul 19, 2020 at 11:00 AM Tomer Tayar  wrote:
>
> gaudi_mmu_invalidate_cache() doesn't use the flags parameter, and thus
> it can be set to 0 when the function is called in the gaudi only files.
>
> Signed-off-by: Tomer Tayar 
> ---
>  drivers/misc/habanalabs/gaudi/gaudi.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c 
> b/drivers/misc/habanalabs/gaudi/gaudi.c
> index 86cfaf73ad74..4a1a52608fc0 100644
> --- a/drivers/misc/habanalabs/gaudi/gaudi.c
> +++ b/drivers/misc/habanalabs/gaudi/gaudi.c
> @@ -2646,8 +2646,7 @@ static int gaudi_mmu_init(struct hl_device *hdev)
> WREG32(mmSTLB_CACHE_INV_BASE_39_8, MMU_CACHE_MNG_ADDR >> 8);
> WREG32(mmSTLB_CACHE_INV_BASE_49_40, MMU_CACHE_MNG_ADDR >> 40);
>
> -   hdev->asic_funcs->mmu_invalidate_cache(hdev, true,
> -   VM_TYPE_USERPTR | VM_TYPE_PHYS_PACK);
> +   hdev->asic_funcs->mmu_invalidate_cache(hdev, true, 0);
>
> WREG32(mmMMU_UP_MMU_ENABLE, 1);
> WREG32(mmMMU_UP_SPI_MASK, 0xF);
> --
> 2.17.1
>

This patch is:
Reviewed-by: Oded Gabbay 


Re: [v2 1/4] coccinelle: api: extend memdup_user transformation with GFP_USER

2020-07-19 Thread Markus Elfring
>> you do indeed need to put - in front of the second and third lines as well.
>
> Thanks, Markus, Julia. I will send v3.

How do you think about to discuss any remaining open issues already
on the current software development version for your transformation approach?

Regards,
Markus


Re: [PATCH] m68k: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov




Am 19.07.20 um 09:51 schrieb Finn Thain:

On Sat, 18 Jul 2020, Alexander A. Klimov wrote:


*Sigh* ... yes, doing everything one nice day is better that doing just
something right now.


I wasn't saying "do everything possible or else do nothing". I was trying
to point to the larger problem. The http links in the kernel source hardly
seem to matter when nothing I read on HTTPS links is trustworthy.


But doing just something right now is better that doing nothing at all.



HTTPS is not new. MITM attack is as old as the Byzantian hills. Your
rationale for doing "something right now" is apparently that you trust the
people who maintain "kernel developers" browsers but mistrust the people
who maintain some network links and switches. That's fine and you should
set your policy accordingly. But you should not be surprised if others
have different threat models -- especially when you fail to offer an
actual case where this patch might have helped.


Really, I'm not interested in debates on principles here.

Just tell me either of these:

* You'll apply these changes of mine as-is
* You won't apply these changes of mine at all
* I shall undo particular changes (which ones?) and/or change the commit 
message (how?) before you apply the others


Thx.


RE: [PATCH v3 4/4] scsi: ufs: Fix up and simplify error recovery mechanism

2020-07-19 Thread Avri Altman
Hi,
 
> 
> Current UFS error recovery mechanism has two major problems, and neither
> of
> them is rare.
> 
> - Error recovery can be invoked from multiple paths, including hibern8
>   enter/exit, some vendor vops, ufshcd_eh_host_reset_handler(), resume and
>   eh_work scheduled from IRQ context. Ultimately, these paths are trying to
>   invoke ufshcd_reset_and_restore(), in either sync or async manner. Since
>   there is no proper protection or synchronization, concurrency of these
>   paths most likely leads UFS device and host to bad states.
> 
> - Error recovery cannot work well or recover hba runtime PM errors if
>   ufshcd_suspend/resume has failed due to UFS errors, e.g. SSU cmd error.
>   When this happens, error handler may fail doing full reset and restore
>   because error handler always assumes that powers, IRQs and clocks are
>   ready after pm_runtime_get_sync returns, but actually they are not if
>   ufshcd_reusme fails [1]. Besides, if ufschd_suspend/resume fails due to
>   UFS error, runtime PM framework saves the error to power.runtime_error.
>   After that, hba dev runtime suspend/resume would not be invoked anymore
>   unless runtime_error is cleared [2].
> 
> To fix the concurrency problem, this change queues eh_work on a single
> threaded workqueue and remove link recovery from hibern8 enter/exit path.
> Meanwhile, flushing eh_work in eh_host_reset_handler instead of calling
> ufshcd_reset_and_restore.
> 
> In case of ufshcd_suspend/resume fails due to UFS errors, for scenario [1],
> error handler cannot assume anything of pm_runtime_get_sync, meaning
> error
> handler should explicitly turn ON powers, IRQs and clocks. To get the hba
> runtime PM work again as regard for scenario [2], error handler can clear
> the runtime_error by calling pm_runtime_set_active() if reset and restore
> succeeds. Meanwhile, if pm_runtime_set_active() returns no error, which
> means runtime_error is cleared, we also need to explicitly resume those
> scsi devices under hba in case any of them has failed to be resumed due to
> hba runtime resume error.
> 
> Signed-off-by: Can Guo 
May I suggest the following re-arrangement, to make this large patch more 
readable.
I am not sure that indeed such division is feasible as you are attending 
several concurrencies in the same change.
The idea is to solve stuff incrementally, so in your last patch everything 
falls into place.

1. Introduce link broken state - Add here all changes concerning the new state: 
ufshcd_is_link_broken, ufshcd_set_link_broken, etc.  For now, In 
ufshcd_uic_pwr_ctrl just call schedule_work(&hba->eh_work).

2. Introduce eh-scheduled states - Put here the relevant code of the new 
UFSHCD_STATE_EH_SCHEDULED_FATAL and UFSHCD_STATE_EH_SCHEDULED_NON_FATAL and 
introduce the new ufshcd_schedule_eh_work

3. Do not print host states / stats while printing regs - put here the changes 
you made to ufshcd_print_host_regs and ufshcd_print_host_state.

4. Changes in ufshcd_eh_in_progress /  ufshcd_set_eh_in_progress - can this 
re-arranged as an atomic patch?

5. Changes you made to avoid concurrency between eh_work and link recovery

6. Changes you made to fix a racing problem between eh_work and 
ufshcd_suspend/resume

Thanks,
Avri

> ---
>  drivers/scsi/ufs/ufs-sysfs.c |   1 +
>  drivers/scsi/ufs/ufshcd.c| 454 
> ++-
>  drivers/scsi/ufs/ufshcd.h|  15 ++
>  3 files changed, 290 insertions(+), 180 deletions(-)
> 
> diff --git a/drivers/scsi/ufs/ufs-sysfs.c b/drivers/scsi/ufs/ufs-sysfs.c
> index 2d71d23..02d379f00 100644
> --- a/drivers/scsi/ufs/ufs-sysfs.c
> +++ b/drivers/scsi/ufs/ufs-sysfs.c
> @@ -16,6 +16,7 @@ static const char *ufschd_uic_link_state_to_string(
> case UIC_LINK_OFF_STATE:return "OFF";
> case UIC_LINK_ACTIVE_STATE: return "ACTIVE";
> case UIC_LINK_HIBERN8_STATE:return "HIBERN8";
> +   case UIC_LINK_BROKEN_STATE: return "BROKEN";
> default:return "UNKNOWN";
> }
>  }
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 4a34f2a..cb32430 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -15,6 +15,8 @@
>  #include 
>  #include 
>  #include 
> +#include 
> +#include 
>  #include "ufshcd.h"
>  #include "ufs_quirks.h"
>  #include "unipro.h"
> @@ -125,7 +127,8 @@ enum {
> UFSHCD_STATE_RESET,
> UFSHCD_STATE_ERROR,
> UFSHCD_STATE_OPERATIONAL,
> -   UFSHCD_STATE_EH_SCHEDULED,
> +   UFSHCD_STATE_EH_SCHEDULED_FATAL,
> +   UFSHCD_STATE_EH_SCHEDULED_NON_FATAL,
>  };
> 
>  /* UFSHCD error handling flags */
> @@ -228,6 +231,11 @@ static int ufshcd_scale_clks(struct ufs_hba *hba, bool
> scale_up);
>  static irqreturn_t ufshcd_intr(int irq, void *__hba);
>  static int ufshcd_change_power_mode(struct ufs_hba *hba,
>  struct ufs_pa_layer_attr *pwr_mode);
> +static void ufshcd_schedule_eh_work(struct ufs_hb

[PATCH for v5.9] ARM: OMAP2+: PRM: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 arch/arm/mach-omap2/prm-regbits-33xx.h | 2 +-
 arch/arm/mach-omap2/prm33xx.c  | 2 +-
 arch/arm/mach-omap2/prm33xx.h  | 2 +-
 arch/arm/mach-omap2/prm54xx.h  | 2 +-
 arch/arm/mach-omap2/prm7xx.h   | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/prm-regbits-33xx.h 
b/arch/arm/mach-omap2/prm-regbits-33xx.h
index 84feecee4fe6..7dfdff09ddeb 100644
--- a/arch/arm/mach-omap2/prm-regbits-33xx.h
+++ b/arch/arm/mach-omap2/prm-regbits-33xx.h
@@ -1,7 +1,7 @@
 /*
  * AM33XX PRM_XXX register bits
  *
- * Copyright (C) 2011-2012 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2011-2012 Texas Instruments Incorporated - https://www.ti.com/
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
diff --git a/arch/arm/mach-omap2/prm33xx.c b/arch/arm/mach-omap2/prm33xx.c
index d5141669c28d..9144cc0479af 100644
--- a/arch/arm/mach-omap2/prm33xx.c
+++ b/arch/arm/mach-omap2/prm33xx.c
@@ -1,7 +1,7 @@
 /*
  * AM33XX PRM functions
  *
- * Copyright (C) 2011-2012 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2011-2012 Texas Instruments Incorporated - https://www.ti.com/
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
diff --git a/arch/arm/mach-omap2/prm33xx.h b/arch/arm/mach-omap2/prm33xx.h
index 66302c6aba61..d0b7404565f1 100644
--- a/arch/arm/mach-omap2/prm33xx.h
+++ b/arch/arm/mach-omap2/prm33xx.h
@@ -1,7 +1,7 @@
 /*
  * AM33XX PRM instance offset macros
  *
- * Copyright (C) 2011-2012 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2011-2012 Texas Instruments Incorporated - https://www.ti.com/
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
diff --git a/arch/arm/mach-omap2/prm54xx.h b/arch/arm/mach-omap2/prm54xx.h
index ee0f1cc92e3a..7329d6fcd78b 100644
--- a/arch/arm/mach-omap2/prm54xx.h
+++ b/arch/arm/mach-omap2/prm54xx.h
@@ -2,7 +2,7 @@
 /*
  * OMAP54xx PRM instance offset macros
  *
- * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com
+ * Copyright (C) 2013 Texas Instruments Incorporated - https://www.ti.com
  *
  * Paul Walmsley (p...@pwsan.com)
  * Rajendra Nayak (rna...@ti.com)
diff --git a/arch/arm/mach-omap2/prm7xx.h b/arch/arm/mach-omap2/prm7xx.h
index cf99307d1b1f..e5aee0409eae 100644
--- a/arch/arm/mach-omap2/prm7xx.h
+++ b/arch/arm/mach-omap2/prm7xx.h
@@ -2,7 +2,7 @@
 /*
  * DRA7xx PRM instance offset macros
  *
- * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com
+ * Copyright (C) 2013 Texas Instruments Incorporated - https://www.ti.com
  *
  * Generated by code originally written by:
  * Paul Walmsley (p...@pwsan.com)
-- 
2.27.0



Turritopsis Dohrnii Teo En Ming’s Marketable Infocomm Technology (ICT) Skillset (Nov 2017 to 19 Jul 2020)

2020-07-19 Thread Turritopsis Dohrnii Teo En Ming
Subject: Turritopsis Dohrnii Teo En Ming’s Marketable Infocomm 
Technology (ICT) Skillset (Nov 2017 to 19 Jul 2020)


Mr. Turritopsis Dohrnii Teo En Ming is an IT Consultant in Singapore.

This list is prepared on 19th Jul 2020 Sunday 4.45 PM Singapore Time.

This list is NOT exhaustive and could be incomplete. More ICT skills 
will be added in the future.


Section A: Turritopsis Dohrnii Teo En Ming's Infocomm Technology (ICT) 
Skillset (15 Jun 2020 to 19 Jul 2020)



1. Configuring Cisco ASA 5506-X Firepower firewall SSL VPN with 90-day 
free Let's Encrypt SSL certificates, LDAP/Active Directory primary 
authentication, Duo 2FA secondary authentication, and NAT Exemption 
(allow SSL VPN client to access remote LAN behind ASA firewall).


2. Upgrading firmware of Cisco ASA 5506-X Firepower firewall.

3. Upgrading ASDM of Cisco ASA 5506-X Firepower firewall.

4. Installing Dynamic DNS (DDNS) update client on client computer behind 
Cisco ASA firewall.


5. Installing Cisco Anyconnect VPN client.

6. Making modifications in Fortigate firewalls.

7. Configuring FortiClient VPN.

8. Allowing IP address and MAC address in Squid advanced filtering proxy 
in IPCOP Linux firewall.


9. Creating Group Policy Object (GPO) in Active Directory Domain 
Controller to block Microsoft Office macros.


10. Changing ownership of files and folders in Ubuntu Linux server.

11. Activating and renewing license for Eset File Security and Eset 
Endpoint Antivirus.


12. Troubleshooting Microsoft Outlook issues.

13. Troubleshooting Remote Desktop Connection issues.

14. Troubleshooting Teamviewer issues.

15. Troubleshoot document scanning issues.

16. Troubleshoot Microsoft Office issues.

17. Troubleshoot computer performance issues.

18. Troubleshoot VPN connectivity issues, e.g. FortiClient VPN.

19. Use sfc /scannow to scan for and repair Windows system file 
corruption.


20. Use dism /online /cleanup-image /restoreheath to repair Windows 
image.


21. Troubleshooting IMAP and POP3 issues.

22. Troubleshoot display issues.

23. Grant user domain administrator rights to install software and 
drivers.


24. Using Outlook to archive emails.

25. Releasing email from quarantine in Sophos UTM9 firewall.

26. Troubleshoot sending and receiving emails on smartphones.

27. Renew and install IdenTrust TrustID email software certificate.

28. Troubleshoot network printer issues.

29. Troubleshoot printing issues.

30. Block email addresses in Office 365 spam filter block list.

31. Troubleshoot IIS web server issues.

32. Map network drives on macOS using smb://IP address/Shares/.

33. Scanning for and removing malware.

34. Troubleshoot print to PDF issues.

35. Checking Windows Event Viewer logs.

36. Scanning for bad sectors.

37. Setting up brand new laptops and joining domain.

38. Troubleshoot computer hardware issues.

39. Add email account on iPad.

40. Troubleshoot File Server issues.

41. Adding new user and also resetting password in Active Directory.

42. Map network drives in Windows.

43. Installing printer driver.

44. Performing System Restore.

45. Resetting Windows.

46. Running gpupdate /force.

47. Running psexec to execute commands remotely on Windows machines.

48. Unlocking user account in Active Directory Domain Controller.

49. Troubleshoot Apache web server issues.

50. Checking Server Message Block (SMB) versions in Windows Server using 
PowerShell commands.


51. Troubleshooting software firewalls like Symantec Endpoint Protection 
and Eset File Security.


52. Installing Microsoft Office.

53. Configuring Outlook email client.

54. Installing Skype.

55. Installing Microsoft Teams.

56. Installing Zoom meeting software.

57. Changing system locale in Windows.

58. Troubleshoot Microsoft SQL Server issues.

59. Making IP address reservation in DHCP server scope in Windows Server 
2016.


60. Analyzing email headers.

61. Block spammer IP address in GFI MailEssentials.

62. Troubleshooting Sender Policy Framework (SPF) issues.

63. Unjoining and rejoining domain.

64. Backing up data, deleting user profile and creating new user profile 
(need to signin to domain) on Windows.


65. Troubleshooting Citrix Workspace issues. Just need to reset password 
in one specific case.


66. Troubleshoot SMTP (outgoing mail server) issues.

67. Reset password in Office 365 Admin.

68. Troubleshoot file sharing permissions.

69. Configure user access to folders in File Server.

70. Configuring default apps in Windows.

71. Blacklist IP address in SmarterMail Enterprise.

72. Troubleshoot Microsoft Teams meeting icon missing.

Section B: Turritopsis Dohrnii Teo En Ming’s Infocomm Technology (ICT) 
Skillset (Feb 2019 to Jun 2019)

==

1. Got SSL VPN to work on Watchguard Firebox T30 Firewall.

2. Installed 90-day free L

[PATCH for v5.9] ARM: OMAP2+: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 arch/arm/mach-omap2/clockdomains33xx_data.c | 2 +-
 arch/arm/mach-omap2/clockdomains81xx_data.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/clockdomains33xx_data.c 
b/arch/arm/mach-omap2/clockdomains33xx_data.c
index 32c90fd9eba2..b4d5144df445 100644
--- a/arch/arm/mach-omap2/clockdomains33xx_data.c
+++ b/arch/arm/mach-omap2/clockdomains33xx_data.c
@@ -1,7 +1,7 @@
 /*
  * AM33XX Clock Domain data.
  *
- * Copyright (C) 2011-2012 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2011-2012 Texas Instruments Incorporated - https://www.ti.com/
  * Vaibhav Hiremath 
  *
  * This program is free software; you can redistribute it and/or
diff --git a/arch/arm/mach-omap2/clockdomains81xx_data.c 
b/arch/arm/mach-omap2/clockdomains81xx_data.c
index 65fbd136b20c..127dc7ace71f 100644
--- a/arch/arm/mach-omap2/clockdomains81xx_data.c
+++ b/arch/arm/mach-omap2/clockdomains81xx_data.c
@@ -1,7 +1,7 @@
 /*
  * TI81XX Clock Domain data.
  *
- * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ * Copyright (C) 2010 Texas Instruments, Inc. - https://www.ti.com/
  * Copyright (C) 2013 SKTB SKiT, http://www.skitlab.ru/
  *
  * This program is free software; you can redistribute it and/or
-- 
2.27.0



[PATCH for v5.9] ARM: OMAP2+: hwmod: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 arch/arm/mach-omap2/omap_hwmod_33xx_data.c | 2 +-
 arch/arm/mach-omap2/omap_hwmod_54xx_data.c | 2 +-
 arch/arm/mach-omap2/omap_hwmod_7xx_data.c  | 2 +-
 arch/arm/mach-omap2/omap_hwmod_81xx_data.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
index 3cf9c4c90b18..ff99b8898215 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
@@ -1,7 +1,7 @@
 /*
  * omap_hwmod_33xx_data.c: Hardware modules present on the AM33XX chips
  *
- * Copyright (C) {2012} Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) {2012} Texas Instruments Incorporated - https://www.ti.com/
  *
  * This file is automatically generated from the AM33XX hardware databases.
  * This program is free software; you can redistribute it and/or
diff --git a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
index 4cb194ac7a7e..1de4c156c8c8 100644
--- a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
@@ -2,7 +2,7 @@
 /*
  * Hardware modules present on the OMAP54xx chips
  *
- * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com
+ * Copyright (C) 2013 Texas Instruments Incorporated - https://www.ti.com
  *
  * Paul Walmsley
  * Benoit Cousson
diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
index 07b7458deae4..5c503daad6dc 100644
--- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
@@ -2,7 +2,7 @@
 /*
  * Hardware modules present on the DRA7xx chips
  *
- * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com
+ * Copyright (C) 2013 Texas Instruments Incorporated - https://www.ti.com
  *
  * Paul Walmsley
  * Benoit Cousson
diff --git a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
index 50fb699b163f..450ab990c66a 100644
--- a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
@@ -1,7 +1,7 @@
 /*
  * DM81xx hwmod data.
  *
- * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ * Copyright (C) 2010 Texas Instruments, Inc. - https://www.ti.com/
  * Copyright (C) 2013 SKTB SKiT, http://www.skitlab.ru/
  *
  * This program is free software; you can redistribute it and/or
-- 
2.27.0



Re: [PATCH 1/2] f2fs: add sysfs symbolic link to kobject with volume name

2020-07-19 Thread kernel test robot
Hi Daeho,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on f2fs/dev-test]
[also build test WARNING on linux/master linus/master v5.8-rc5 next-20200717]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:
https://github.com/0day-ci/linux/commits/Daeho-Jeong/f2fs-add-sysfs-symbolic-link-to-kobject-with-volume-name/20200719-134628
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git 
dev-test
config: s390-randconfig-s032-20200719 (attached as .config)
compiler: s390-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.2-49-g707c5017-dirty
# 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=s390 

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


sparse warnings: (new ones prefixed by >>)

>> fs/f2fs/sysfs.c:915:36: sparse: sparse: incorrect type in argument 1 
>> (different base types) @@ expected unsigned short const [usertype] *pwcs 
>> @@ got restricted __le16 * @@
>> fs/f2fs/sysfs.c:915:36: sparse: expected unsigned short const [usertype] 
>> *pwcs
>> fs/f2fs/sysfs.c:915:36: sparse: got restricted __le16 *

vim +915 fs/f2fs/sysfs.c

   909  
   910  static int f2fs_load_syslink(struct f2fs_sb_info *sbi)
   911  {
   912  int idx, count, ret;
   913  
   914  down_read(&sbi->sb_lock);
 > 915  count = utf16s_to_utf8s(sbi->raw_super->volume_name,
   916  ARRAY_SIZE(sbi->raw_super->volume_name),
   917  UTF16_LITTLE_ENDIAN, sbi->syslink_name,
   918  MAX_VOLUME_NAME);
   919  up_read(&sbi->sb_lock);
   920  
   921  if (!count)
   922  return -ENOENT;
   923  
   924  for (idx = 0; idx < MAX_DUP_NUM; idx++) {
   925  snprintf(sbi->syslink_name + count, MAX_DUP_NAME, 
"_%d", idx);
   926  ret = sysfs_create_link(&f2fs_kset.kobj, &sbi->s_kobj,
   927  sbi->syslink_name);
   928  if (ret != -EEXIST)
   929  break;
   930  }
   931  
   932  if (ret)
   933  memset(sbi->syslink_name, 0, MAX_SYSLINK_NAME);
   934  
   935  return ret;
   936  }
   937  

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


.config.gz
Description: application/gzip


Re: [PATCH v16 18/22] mm/lru: replace pgdat lru_lock with lruvec lock

2020-07-19 Thread Alex Shi



在 2020/7/18 下午10:15, Alex Shi 写道:
>>>
>>>  struct wb_domain *mem_cgroup_wb_domain(struct bdi_writeback *wb);
>>> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
>>> index 14c668b7e793..36c1680efd90 100644
>>> --- a/include/linux/mmzone.h
>>> +++ b/include/linux/mmzone.h
>>> @@ -261,6 +261,8 @@ struct lruvec {
>>> atomic_long_t   nonresident_age;
>>> /* Refaults at the time of last reclaim cycle */
>>> unsigned long   refaults;
>>> +   /* per lruvec lru_lock for memcg */
>>> +   spinlock_t  lru_lock;
>>> /* Various lruvec state flags (enum lruvec_flags) */
>>> unsigned long   flags;
>> Any reason for placing this here instead of at the end of the
>> structure? From what I can tell it looks like lruvec is already 128B
>> long so placing the lock on the end would put it into the next
>> cacheline which may provide some performance benefit since it is
>> likely to be bounced quite a bit.
> Rong Chen(Cced) once reported a performance regression when the lock at
> the end of struct, and move here could remove it.
> Although I can't not reproduce. But I trust his report.
> 
Oops, Rong's report is on another member which is different with current
struct. 

Compare to move to tail, how about to move it to head of struct, which is
close to lru list? Did you have some data of the place change?

Thanks
Alex

 
> ...
> 
>>>  putback:
>>> -   spin_unlock_irq(&zone->zone_pgdat->lru_lock);
>>> pagevec_add(&pvec_putback, pvec->pages[i]);
>>> pvec->pages[i] = NULL;
>>> }
>>> -   /* tempary disable irq, will remove later */
>>> -   local_irq_disable();
>>> __mod_zone_page_state(zone, NR_MLOCK, delta_munlocked);
>>> -   local_irq_enable();
>>> +   if (lruvec)
>>> +   unlock_page_lruvec_irq(lruvec);
>> So I am not a fan of this change. You went to all the trouble of
>> reducing the lock scope just to bring it back out here again. In
>> addition it implies there is a path where you might try to update the
>> page state without disabling interrupts.
> Right. but any idea to avoid this except a extra local_irq_disable?
> 

The following changes would resolve the problem. Is this ok?
@@ -324,7 +322,8 @@ static void __munlock_pagevec(struct pagevec *pvec, struct 
zone *zone)
pagevec_add(&pvec_putback, pvec->pages[i]);
pvec->pages[i] = NULL;
}
-   __mod_zone_page_state(zone, NR_MLOCK, delta_munlocked);
+   if (delta_munlocked)
+   __mod_zone_page_state(zone, NR_MLOCK, delta_munlocked);
if (lruvec)
unlock_page_lruvec_irq(lruvec);


[GIT PULL] USB driver fixes for 5.8-rc6

2020-07-19 Thread Greg KH
The following changes since commit 9ebcfadb0610322ac537dd7aa5d9cbc2b2894c68:

  Linux 5.8-rc3 (2020-06-28 15:00:24 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git tags/usb-5.8-rc6

for you to fetch changes up to c7300cdf8f683ae00cf74616b5fd14ffac327979:

  Merge tag 'usb-serial-5.8-rc6' of 
https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus 
(2020-07-16 17:30:59 +0200)


USB fixes for 5.8-rc6

Here are a few small USB fixes, and one thunderbolt fix, for 5.8-rc6.

Nothing huge in here, just the normal collection of gadget, dwc2/3,
serial, and other minor USB driver fixes and id additions.  Full details
are in the shortlog.

All of these have been in linux-next for a while with no reported
issues.

Signed-off-by: Greg Kroah-Hartman 


AceLan Kao (1):
  USB: serial: option: add Quectel EG95 LTE modem

Evgeny Novikov (1):
  usb: gadget: udc: gr_udc: fix memleak on error handling path in 
gr_ep_init()

Greg Kroah-Hartman (4):
  Merge tag 'thunderbolt-fix-for-v5.8-rc4' of 
git://git.kernel.org/.../westeri/thunderbolt into usb-linus
  Merge tag 'usb-serial-5.8-rc5' of 
https://git.kernel.org/.../johan/usb-serial into usb-linus
  Merge tag 'fixes-for-v5.8-rc3' of git://git.kernel.org/.../balbi/usb into 
usb-linus
  Merge tag 'usb-serial-5.8-rc6' of 
https://git.kernel.org/.../johan/usb-serial into usb-linus

Heikki Krogerus (2):
  usb: dwc3: pci: add support for the Intel Tiger Lake PCH -H variant
  usb: dwc3: pci: add support for the Intel Jasper Lake

Igor Moura (1):
  USB: serial: ch341: add new Product ID for CH340

James Hilliard (1):
  USB: serial: cypress_m8: enable Simply Automated UPB PIM

Johan Hovold (1):
  USB: serial: iuu_phoenix: fix memory corruption

Jörgen Storvist (1):
  USB: serial: option: add GosunCn GM500 series

Michał Mirosław (2):
  usb: gadget: udc: atmel: remove outdated comment in usba_ep_disable()
  usb: gadget: udc: atmel: fix uninitialized read in debug printk

Mika Westerberg (1):
  thunderbolt: Fix path indices used in USB3 tunnel discovery

Minas Harutyunyan (1):
  usb: dwc2: Fix shutdown callback in platform

Peter Chen (3):
  usb: chipidea: core: add wakeup support for extcon
  usb: cdns3: ep0: fix some endian issues
  usb: cdns3: trace: fix some endian issues

Randy Dunlap (1):
  usb: gadget: fix langid kernel-doc warning in usbstring.c

Tom Rix (1):
  USB: c67x00: fix use after free in c67x00_giveback_urb

Zhang Qiang (1):
  usb: gadget: function: fix missing spinlock in f_uac1_legacy

 drivers/thunderbolt/tunnel.c| 12 ++--
 drivers/usb/c67x00/c67x00-sched.c   |  2 +-
 drivers/usb/cdns3/ep0.c | 30 ++---
 drivers/usb/cdns3/trace.h   |  6 +++---
 drivers/usb/chipidea/core.c | 24 +++
 drivers/usb/dwc2/platform.c |  3 ++-
 drivers/usb/dwc3/dwc3-pci.c |  8 
 drivers/usb/gadget/function/f_uac1_legacy.c |  2 ++
 drivers/usb/gadget/udc/atmel_usba_udc.c | 10 ++
 drivers/usb/gadget/udc/gr_udc.c |  7 +--
 drivers/usb/gadget/usbstring.c  |  2 +-
 drivers/usb/serial/ch341.c  |  1 +
 drivers/usb/serial/cypress_m8.c |  2 ++
 drivers/usb/serial/cypress_m8.h |  3 +++
 drivers/usb/serial/iuu_phoenix.c|  8 +---
 drivers/usb/serial/option.c |  6 ++
 16 files changed, 86 insertions(+), 40 deletions(-)


[PATCH for v5.9] ARM: OMAP2+: pm33xx-core: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 arch/arm/mach-omap2/pm33xx-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/pm33xx-core.c 
b/arch/arm/mach-omap2/pm33xx-core.c
index 58236c7dc83e..c1df220f4937 100644
--- a/arch/arm/mach-omap2/pm33xx-core.c
+++ b/arch/arm/mach-omap2/pm33xx-core.c
@@ -2,7 +2,7 @@
 /*
  * AM33XX Arch Power Management Routines
  *
- * Copyright (C) 2016-2018 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2016-2018 Texas Instruments Incorporated - https://www.ti.com/
  * Dave Gerlach
  */
 
-- 
2.27.0



Re: [PATCH] staging: rtl8192e: Fixed the space and indentation coding styles

2020-07-19 Thread Greg KH
On Fri, Jul 17, 2020 at 08:34:51PM +0530, Darshan D V wrote:
> rtllib_crypt_ccmp.c: Fixed the error - space required before the
> open parenthesis '(' on line #281.
> 
> rtllib_crypt_ccmp.c: Fixed the warning - suspect code indent for
> conditional statements on line #338
> 
> Signed-off-by: Darshan D V 
> ---
>  drivers/staging/rtl8192e/rtllib_crypt_ccmp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c 
> b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
> index 0cbf4a1a326b..b60e2a109ce4 100644
> --- a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
> +++ b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
> @@ -278,7 +278,7 @@ static int rtllib_ccmp_decrypt(struct sk_buff *skb, int 
> hdr_len, void *priv)
>   int aad_len, ret;
>  
>   req = aead_request_alloc(key->tfm, GFP_ATOMIC);
> - if(!req)
> + if (!req)
>   return -ENOMEM;
>  
>   aad_len = ccmp_init_iv_and_aad(hdr, pn, iv, aad);
> @@ -337,7 +337,7 @@ static int rtllib_ccmp_set_key(void *key, int len, u8 
> *seq, void *priv)
>   }
>   if (crypto_aead_setauthsize(data->tfm, CCMP_MIC_LEN) ||
>   crypto_aead_setkey(data->tfm, data->key, CCMP_TK_LEN))
> - return -1;
> + return -1;
>   } else if (len == 0) {
>   data->key_set = 0;
>   } else {
> -- 
> 2.17.1


Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- Your patch did many different things all at once, making it difficult
  to review.  All Linux kernel patches need to only do one thing at a
  time.  If you need to do multiple things (such as clean up all coding
  style issues in a file/driver), do it in a sequence of patches, each
  one doing only one thing.  This will make it easier to review the
  patches to ensure that they are correct, and to help alleviate any
  merge issues that larger patches can cause.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot


Re: [PATCH] staging: wlan-ng: properly check endpoint types

2020-07-19 Thread Greg KH
On Sat, Jul 18, 2020 at 08:58:36AM -0700, Rustam Kovhaev wrote:
> As syzkaller detected, wlan-ng driver submits bulk urb without checking
> that the endpoint type is actually bulk, add usb_urb_ep_type_check()
> 
> Reported-and-tested-by: syzbot+c2a1fa67c02faa0de...@syzkaller.appspotmail.com
> Link: https://syzkaller.appspot.com/bug?extid=c2a1fa67c02faa0de723
> Signed-off-by: Rustam Kovhaev 
> ---
>  drivers/staging/wlan-ng/hfa384x_usb.c | 14 ++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c 
> b/drivers/staging/wlan-ng/hfa384x_usb.c
> index fa1bf8b069fd..7cde60ea68a2 100644
> --- a/drivers/staging/wlan-ng/hfa384x_usb.c
> +++ b/drivers/staging/wlan-ng/hfa384x_usb.c
> @@ -339,6 +339,12 @@ static int submit_rx_urb(struct hfa384x *hw, gfp_t 
> memflags)
>  
>   hw->rx_urb_skb = skb;
>  
> + result = usb_urb_ep_type_check(&hw->rx_urb);
> + if (result) {
> +netdev_warn(hw->wlandev->netdev, "invalid rx endpoint");
> +goto cleanup;
> + }

In looking at this again, can you just make these checks in the probe
function, and abort binding the driver to the device at that point in
time?  This feels really late in the init sequence.

The real problem here is in the hfa384x_create() function, where it
blindly takes the 1 and 2 endpoints and assumes that those are the
"correct type".  How about checking the types there, and if they are
incorrect, returning an error from that function and have the caller
return the error as well.

That should keep anything else in the driver from being initialized and
set up, and stop bad devices from being bound to the driver at a much
earlier point in time.

Note, just checking for the valid type/direction of those endpoints
should be sufficient.

thanks,

greg k-h


Re: [PATCH 2/4] staging: rtl8188eu: include: fixed multiple parentheses coding style issues

2020-07-19 Thread Greg Kroah-Hartman
On Sat, Jul 18, 2020 at 05:16:26AM -0400, B K Karthik wrote:
> fixed multiple parentheses coding style issues reported by checkpatch.
> 
> Signed-off-by: B K Karthik 
> ---
>  drivers/staging/rtl8188eu/include/ieee80211.h |  4 +--
>  .../staging/rtl8188eu/include/osdep_service.h |  4 +--
>  drivers/staging/rtl8188eu/include/wifi.h  | 34 +--
>  3 files changed, 21 insertions(+), 21 deletions(-)

You can never add warnings to the build, like this patch did.  Always
test-build your patches at the very least...

greg k-h


[PATCH for v5.9] ARM: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 arch/arm/Kconfig | 4 ++--
 arch/arm/mach-sa1100/Kconfig | 2 +-
 arch/arm/mm/proc-xscale.S| 2 +-
 arch/arm/tools/mach-types| 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 2ac74904a3ce..ce71c15fbc0e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -127,7 +127,7 @@ config ARM
  handhelds such as the Compaq IPAQ.  ARM-based PCs are no longer
  manufactured, but legacy ARM-based PC hardware remains popular in
  Europe.  There is an ARM Linux project with a web page at
- .
+ .
 
 config ARM_HAS_SG_CHAIN
bool
@@ -1199,7 +1199,7 @@ config SMP
 
  See also ,
   and the 
SMP-HOWTO available at
- .
+ .
 
  If you don't know what to do here, say N.
 
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig
index 66e79fa9ba2b..f17f0460046b 100644
--- a/arch/arm/mach-sa1100/Kconfig
+++ b/arch/arm/mach-sa1100/Kconfig
@@ -159,7 +159,7 @@ config SA1100_SIMPAD
  FLASH. The SL4 version got 64 MB RAM and 32 MB FLASH and a
  PCMCIA-Slot. The version for the Germany Telecom (DTAG) is the same
  like CL4 in additional it has a PCMCIA-Slot. For more information
- visit  or .
+ visit  or .
 
 config SA1100_SSP
tristate "Generic PIO SSP"
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index d82590aa71c0..a5e048ab6f7c 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -425,7 +425,7 @@ ENDPROC(xscale_dma_unmap_area)
  *
  * See erratum #25 of "Intel 80200 Processor Specification Update",
  * revision January 22, 2003, available at:
- * http://www.intel.com/design/iio/specupdt/273415.htm
+ * https://www.intel.com/design/iio/specupdt/273415.htm
  */
 .macro a0_alias basename
.globl xscale_80200_A0_A1_\basename
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index 9e74c7ff6b04..e79be40e38cd 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -4,7 +4,7 @@
 #
 # Up to date versions of this file can be obtained from:
 #
-#   http://www.arm.linux.org.uk/developer/machines/download.php
+#   https://www.arm.linux.org.uk/developer/machines/download.php
 #
 # Please do not send patches to this file; it is automatically generated!
 # To add an entry into this database, please see Documentation/arm/arm.rst,
-- 
2.27.0



Re: [PATCH 2/4] staging: rtl8188eu: include: fixed multiple parentheses coding style issues

2020-07-19 Thread B K Karthik
On Sun, Jul 19, 2020 at 5:26 AM Greg Kroah-Hartman
 wrote:
>
> On Sat, Jul 18, 2020 at 05:16:26AM -0400, B K Karthik wrote:
> > fixed multiple parentheses coding style issues reported by checkpatch.
> >
> > Signed-off-by: B K Karthik 
> > ---
> >  drivers/staging/rtl8188eu/include/ieee80211.h |  4 +--
> >  .../staging/rtl8188eu/include/osdep_service.h |  4 +--
> >  drivers/staging/rtl8188eu/include/wifi.h  | 34 +--
> >  3 files changed, 21 insertions(+), 21 deletions(-)
>
> You can never add warnings to the build, like this patch did.  Always
> test-build your patches at the very least...

understood, I will definitely do that.
but these warnings are (mostly) [-Wunused-value] and [-Wformat].
that should not have (?) occurred due to the usage of parentheses.

anyways, I will try to fix these up and send a v2.
sorry if i wasted your time

karthik


[PATCH] drm/ingenic: Silence uninitialized-variable warning

2020-07-19 Thread Paul Cercueil
Silence compiler warning about used but uninitialized 'ipu_state'
variable. In practice, the variable would never be used when
uninitialized, but the compiler cannot know that 'priv->ipu_plane' will
always be NULL if CONFIG_INGENIC_IPU is disabled.

Silence the warning by initializing the value to NULL.

Signed-off-by: Paul Cercueil 
---
 drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c 
b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
index b6d946fbeaf5..ada990a7f911 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
@@ -198,7 +198,7 @@ static int ingenic_drm_crtc_atomic_check(struct drm_crtc 
*crtc,
 struct drm_crtc_state *state)
 {
struct ingenic_drm *priv = drm_crtc_get_priv(crtc);
-   struct drm_plane_state *f1_state, *f0_state, *ipu_state;
+   struct drm_plane_state *f1_state, *f0_state, *ipu_state = NULL;
long rate;
 
if (!drm_atomic_crtc_needs_modeset(state))
@@ -229,7 +229,7 @@ static int ingenic_drm_crtc_atomic_check(struct drm_crtc 
*crtc,
 
/* If all the planes are disabled, we won't get a VBLANK IRQ */
priv->no_vblank = !f1_state->fb && !f0_state->fb &&
- !(priv->ipu_plane && ipu_state->fb);
+ !(ipu_state && ipu_state->fb);
}
 
return 0;
-- 
2.27.0



[PATCH for v5.9] ARM: SAMSUNG: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 arch/arm/boot/dts/exynos5410-pinctrl.dtsi | 2 +-
 arch/arm/mach-s3c24xx/Kconfig | 2 +-
 arch/arm/mach-s3c24xx/mach-h1940.c| 2 +-
 arch/arm/mach-s3c24xx/mach-mini2440.c | 2 +-
 arch/arm/mach-s3c24xx/mach-n30.c  | 2 +-
 arch/arm/mach-s3c24xx/mach-rx3715.c   | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5410-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos5410-pinctrl.dtsi
index 369a8a7f2105..e5d0a2a4f648 100644
--- a/arch/arm/boot/dts/exynos5410-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos5410-pinctrl.dtsi
@@ -3,7 +3,7 @@
  * Exynos5410 SoC pin-mux and pin-config device tree source
  *
  * Copyright (c) 2013 Hardkernel Co., Ltd.
- *  http://www.hardkernel.com
+ *  https://www.hardkernel.com
  */
 
 #include 
diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig
index c5c06d98b147..7673dde9671a 100644
--- a/arch/arm/mach-s3c24xx/Kconfig
+++ b/arch/arm/mach-s3c24xx/Kconfig
@@ -267,7 +267,7 @@ config MACH_TCT_HAMMER
select S3C_DEV_USB_HOST
help
  Say Y here if you are using the TinCanTools Hammer Board
- 
+ 
 
 config MACH_VR1000
bool "Thorcom VR1000"
diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c 
b/arch/arm/mach-s3c24xx/mach-h1940.c
index e1c372e5447b..f4710052843a 100644
--- a/arch/arm/mach-s3c24xx/mach-h1940.c
+++ b/arch/arm/mach-s3c24xx/mach-h1940.c
@@ -3,7 +3,7 @@
 // Copyright (c) 2003-2005 Simtec Electronics
 //   Ben Dooks 
 //
-// http://www.handhelds.org/projects/h1940.html
+// https://www.handhelds.org/projects/h1940.html
 
 #include 
 #include 
diff --git a/arch/arm/mach-s3c24xx/mach-mini2440.c 
b/arch/arm/mach-s3c24xx/mach-mini2440.c
index 9035f868fb34..113b69ba4921 100644
--- a/arch/arm/mach-s3c24xx/mach-mini2440.c
+++ b/arch/arm/mach-s3c24xx/mach-mini2440.c
@@ -6,7 +6,7 @@
 //  Weibing  and
 //  Michel Pollet 
 //
-// For product information, visit http://code.google.com/p/mini2440/
+// For product information, visit https://code.google.com/p/mini2440/
 
 #include 
 #include 
diff --git a/arch/arm/mach-s3c24xx/mach-n30.c b/arch/arm/mach-s3c24xx/mach-n30.c
index d856f23939af..9ebde6dc6169 100644
--- a/arch/arm/mach-s3c24xx/mach-n30.c
+++ b/arch/arm/mach-s3c24xx/mach-n30.c
@@ -9,7 +9,7 @@
 // Copyright (c) 2005-2008 Christer Weinigel 
 //
 // There is a wiki with more information about the n30 port at
-// http://handhelds.org/moin/moin.cgi/AcerN30Documentation .
+// https://handhelds.org/moin/moin.cgi/AcerN30Documentation .
 
 #include 
 #include 
diff --git a/arch/arm/mach-s3c24xx/mach-rx3715.c 
b/arch/arm/mach-s3c24xx/mach-rx3715.c
index 529c6faf862f..995f1ff34a1b 100644
--- a/arch/arm/mach-s3c24xx/mach-rx3715.c
+++ b/arch/arm/mach-s3c24xx/mach-rx3715.c
@@ -3,7 +3,7 @@
 // Copyright (c) 2003-2004 Simtec Electronics
 // Ben Dooks 
 //
-// http://www.handhelds.org/projects/rx3715.html
+// https://www.handhelds.org/projects/rx3715.html
 
 #include 
 #include 
-- 
2.27.0



[PATCH for v5.9] ARM: STM32: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 arch/arm/mach-stm32/Makefile.boot | 2 +-
 crypto/testmgr.h  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-stm32/Makefile.boot 
b/arch/arm/mach-stm32/Makefile.boot
index cec195d4fcba..5dde7328a7a9 100644
--- a/arch/arm/mach-stm32/Makefile.boot
+++ b/arch/arm/mach-stm32/Makefile.boot
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
 # Empty file waiting for deletion once Makefile.boot isn't needed any more.
 # Patch waits for application at
-# http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=7889/1 .
+# https://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=7889/1 .
diff --git a/crypto/testmgr.h b/crypto/testmgr.h
index d29983908c38..cdcf0d2fe40d 100644
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
@@ -16231,7 +16231,7 @@ static const struct cipher_testvec 
aes_lrw_tv_template[] = {
  "\xe9\x5d\x48\x92\x54\x63\x4e\xb8",
.len= 48,
}, {
-/* http://www.mail-archive.com/stds-p1619@listserv.ieee.org/msg00173.html */
+/* https://www.mail-archive.com/stds-p1619@listserv.ieee.org/msg00173.html */
.key= "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
  "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
  "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
@@ -21096,7 +21096,7 @@ static const struct aead_testvec aegis128_tv_template[] 
= {
 
 /*
  * All key wrapping test vectors taken from
- * http://csrc.nist.gov/groups/STM/cavp/documents/mac/kwtestvectors.zip
+ * https://csrc.nist.gov/groups/STM/cavp/documents/mac/kwtestvectors.zip
  *
  * Note: as documented in keywrap.c, the ivout for encryption is the first
  * semiblock of the ciphertext from the test vector. For decryption, iv is
@@ -22825,7 +22825,7 @@ static const struct cipher_testvec xeta_tv_template[] = 
{
  * FCrypt test vectors
  */
 static const struct cipher_testvec fcrypt_pcbc_tv_template[] = {
-   { /* 
http://www.openafs.org/pipermail/openafs-devel/2000-December/005320.html */
+   { /* 
https://www.openafs.org/pipermail/openafs-devel/2000-December/005320.html */
.key= "\x00\x00\x00\x00\x00\x00\x00\x00",
.klen   = 8,
.iv = "\x00\x00\x00\x00\x00\x00\x00\x00",
-- 
2.27.0



Re: [PATCH 01/32] iov_iter: Add ITER_MAPPING

2020-07-19 Thread David Howells
Al Viro  wrote:

> My main problem here is that your iterate_mapping() assumes that STEP is
> safe under rcu_read_lock(), with no visible mentioning of that fact.

Yeah, that's probably the biggest objection to this.

> Note, BTW, that iov_iter_for_each_range() quietly calls user-supplied
> callback in such context.

And calls kmap(), but should probably use kmap_atomic().  git grep doesn't
show any users of this, so can it be removed?

> Incidentally, do you ever have different steps for bvec and mapping?

Yes:

csum_and_copy_from_iter_full()
iov_iter_npages()
iov_iter_get_pages()
iov_iter_get_pages_alloc()

But I've tried to use the internal representation struct for bvec where I can
rather than inventing a new one.

David



[PATCH for v5.9] ARM: dts: efm32: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 arch/arm/boot/dts/efm32gg-dk3750.dts | 2 +-
 arch/arm/boot/dts/efm32gg.dtsi   | 2 +-
 arch/arm/mach-efm32/Makefile.boot| 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/efm32gg-dk3750.dts 
b/arch/arm/boot/dts/efm32gg-dk3750.dts
index adfa559a488b..f310a8191ce5 100644
--- a/arch/arm/boot/dts/efm32gg-dk3750.dts
+++ b/arch/arm/boot/dts/efm32gg-dk3750.dts
@@ -3,7 +3,7 @@
  * Device tree for EFM32GG-DK3750 development board.
  *
  * Documentation available from
- * 
http://www.silabs.com/Support%20Documents/TechnicalDocs/efm32gg-dk3750-ug.pdf
+ * 
https://www.silabs.com/Support%20Documents/TechnicalDocs/efm32gg-dk3750-ug.pdf
  */
 
 /dts-v1/;
diff --git a/arch/arm/boot/dts/efm32gg.dtsi b/arch/arm/boot/dts/efm32gg.dtsi
index 8a58e49144cc..633c7b0809ed 100644
--- a/arch/arm/boot/dts/efm32gg.dtsi
+++ b/arch/arm/boot/dts/efm32gg.dtsi
@@ -3,7 +3,7 @@
  * Device tree for Energy Micro EFM32 Giant Gecko SoC.
  *
  * Documentation available from
- * http://www.silabs.com/Support%20Documents/TechnicalDocs/EFM32GG-RM.pdf
+ * https://www.silabs.com/Support%20Documents/TechnicalDocs/EFM32GG-RM.pdf
  */
 
 #include "armv7-m.dtsi"
diff --git a/arch/arm/mach-efm32/Makefile.boot 
b/arch/arm/mach-efm32/Makefile.boot
index cec195d4fcba..5dde7328a7a9 100644
--- a/arch/arm/mach-efm32/Makefile.boot
+++ b/arch/arm/mach-efm32/Makefile.boot
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
 # Empty file waiting for deletion once Makefile.boot isn't needed any more.
 # Patch waits for application at
-# http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=7889/1 .
+# https://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=7889/1 .
-- 
2.27.0



[PATCH v6 2/7] pid: use checkpoint_restore_ns_capable() for set_tid

2020-07-19 Thread Adrian Reber
Use the newly introduced capability CAP_CHECKPOINT_RESTORE to allow
using clone3() with set_tid set.

Signed-off-by: Adrian Reber 
Signed-off-by: Nicolas Viennot 
Acked-by: Christian Brauner 
Reviewed-by: Serge Hallyn 
---
 kernel/pid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/pid.c b/kernel/pid.c
index de9d29c41d77..a9cbab0194d9 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -199,7 +199,7 @@ struct pid *alloc_pid(struct pid_namespace *ns, pid_t 
*set_tid,
if (tid != 1 && !tmp->child_reaper)
goto out_free;
retval = -EPERM;
-   if (!ns_capable(tmp->user_ns, CAP_SYS_ADMIN))
+   if (!checkpoint_restore_ns_capable(tmp->user_ns))
goto out_free;
set_tid_size--;
}
-- 
2.26.2



[PATCH v6 0/7] capabilities: Introduce CAP_CHECKPOINT_RESTORE

2020-07-19 Thread Adrian Reber
This is v6 of the 'Introduce CAP_CHECKPOINT_RESTORE' patchset. The
changes to v5 are:

 * split patch dealing with /proc/self/exe into two patches:
   * first patch to enable changing it with CAP_CHECKPOINT_RESTORE
 and detailed history in the commit message
   * second patch changes -EINVAL to -EPERM
 * use kselftest_harness.h infrastructure for test
 * replace if (!capable(CAP_SYS_ADMIN) || !capable(CAP_CHECKPOINT_RESTORE))
   with if (!checkpoint_restore_ns_capable(&init_user_ns))

Adrian Reber (5):
  capabilities: Introduce CAP_CHECKPOINT_RESTORE
  pid: use checkpoint_restore_ns_capable() for set_tid
  pid_namespace: use checkpoint_restore_ns_capable() for ns_last_pid
  proc: allow access in init userns for map_files with
CAP_CHECKPOINT_RESTORE
  selftests: add clone3() CAP_CHECKPOINT_RESTORE test

Nicolas Viennot (2):
  prctl: Allow local CAP_CHECKPOINT_RESTORE to change /proc/self/exe
  prctl: exe link permission error changed from -EINVAL to -EPERM

 fs/proc/base.c|   8 +-
 include/linux/capability.h|   6 +
 include/uapi/linux/capability.h   |   9 +-
 kernel/pid.c  |   2 +-
 kernel/pid_namespace.c|   2 +-
 kernel/sys.c  |  13 +-
 security/selinux/include/classmap.h   |   5 +-
 tools/testing/selftests/clone3/.gitignore |   1 +
 tools/testing/selftests/clone3/Makefile   |   4 +-
 .../clone3/clone3_cap_checkpoint_restore.c| 177 ++
 10 files changed, 212 insertions(+), 15 deletions(-)
 create mode 100644 
tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c

base-commit: d31958b30ea3b7b6e522d6bf449427748ad45822
-- 
2.26.2



[PATCH v6 1/7] capabilities: Introduce CAP_CHECKPOINT_RESTORE

2020-07-19 Thread Adrian Reber
This patch introduces CAP_CHECKPOINT_RESTORE, a new capability facilitating
checkpoint/restore for non-root users.

Over the last years, The CRIU (Checkpoint/Restore In Userspace) team has
been asked numerous times if it is possible to checkpoint/restore a
process as non-root. The answer usually was: 'almost'.

The main blocker to restore a process as non-root was to control the PID
of the restored process. This feature available via the clone3 system
call, or via /proc/sys/kernel/ns_last_pid is unfortunately guarded by
CAP_SYS_ADMIN.

In the past two years, requests for non-root checkpoint/restore have
increased due to the following use cases:
* Checkpoint/Restore in an HPC environment in combination with a
  resource manager distributing jobs where users are always running as
  non-root. There is a desire to provide a way to checkpoint and
  restore long running jobs.
* Container migration as non-root
* We have been in contact with JVM developers who are integrating
  CRIU into a Java VM to decrease the startup time. These
  checkpoint/restore applications are not meant to be running with
  CAP_SYS_ADMIN.

We have seen the following workarounds:
* Use a setuid wrapper around CRIU:
  See 
https://github.com/FredHutch/slurm-examples/blob/master/checkpointer/lib/checkpointer/checkpointer-suid.c
* Use a setuid helper that writes to ns_last_pid.
  Unfortunately, this helper delegation technique is impossible to use
  with clone3, and is thus prone to races.
  See https://github.com/twosigma/set_ns_last_pid
* Cycle through PIDs with fork() until the desired PID is reached:
  This has been demonstrated to work with cycling rates of 100,000 PIDs/s
  See https://github.com/twosigma/set_ns_last_pid
* Patch out the CAP_SYS_ADMIN check from the kernel
* Run the desired application in a new user and PID namespace to provide
  a local CAP_SYS_ADMIN for controlling PIDs. This technique has limited
  use in typical container environments (e.g., Kubernetes) as /proc is
  typically protected with read-only layers (e.g., /proc/sys) for
  hardening purposes. Read-only layers prevent additional /proc mounts
  (due to proc's SB_I_USERNS_VISIBLE property), making the use of new
  PID namespaces limited as certain applications need access to /proc
  matching their PID namespace.

The introduced capability allows to:
* Control PIDs when the current user is CAP_CHECKPOINT_RESTORE capable
  for the corresponding PID namespace via ns_last_pid/clone3.
* Open files in /proc/pid/map_files when the current user is
  CAP_CHECKPOINT_RESTORE capable in the root namespace, useful for
  recovering files that are unreachable via the file system such as
  deleted files, or memfd files.

See corresponding selftest for an example with clone3().

Signed-off-by: Adrian Reber 
Signed-off-by: Nicolas Viennot 
Acked-by: Christian Brauner 
Reviewed-by: Serge Hallyn 
---
 include/linux/capability.h  | 6 ++
 include/uapi/linux/capability.h | 9 -
 security/selinux/include/classmap.h | 5 +++--
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/include/linux/capability.h b/include/linux/capability.h
index b4345b38a6be..1e7fe311cabe 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -261,6 +261,12 @@ static inline bool bpf_capable(void)
return capable(CAP_BPF) || capable(CAP_SYS_ADMIN);
 }
 
+static inline bool checkpoint_restore_ns_capable(struct user_namespace *ns)
+{
+   return ns_capable(ns, CAP_CHECKPOINT_RESTORE) ||
+   ns_capable(ns, CAP_SYS_ADMIN);
+}
+
 /* audit system wants to get cap info from files as well */
 extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct 
cpu_vfs_cap_data *cpu_caps);
 
diff --git a/include/uapi/linux/capability.h b/include/uapi/linux/capability.h
index 48ff0757ae5e..395dd0df8d08 100644
--- a/include/uapi/linux/capability.h
+++ b/include/uapi/linux/capability.h
@@ -408,7 +408,14 @@ struct vfs_ns_cap_data {
  */
 #define CAP_BPF39
 
-#define CAP_LAST_CAP CAP_BPF
+
+/* Allow checkpoint/restore related operations */
+/* Allow PID selection during clone3() */
+/* Allow writing to ns_last_pid */
+
+#define CAP_CHECKPOINT_RESTORE 40
+
+#define CAP_LAST_CAP CAP_CHECKPOINT_RESTORE
 
 #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
 
diff --git a/security/selinux/include/classmap.h 
b/security/selinux/include/classmap.h
index e54d62d529f1..ba2e01a6955c 100644
--- a/security/selinux/include/classmap.h
+++ b/security/selinux/include/classmap.h
@@ -27,9 +27,10 @@
"audit_control", "setfcap"
 
 #define COMMON_CAP2_PERMS  "mac_override", "mac_admin", "syslog", \
-   "wake_alarm", "block_suspend", "audit_read", "perfmon", "bpf"
+   "wake_alarm", "block_suspend", "audit_read", "perfmon", "bpf", \
+   "checkpoint_restore"
 
-#if CAP_LAST_CAP > CAP_BPF
+#if CAP_LAST_CAP > CAP_CHECKPOINT_RESTORE
 #error New capability defined, please update COMM

Nice to meet you!

2020-07-19 Thread Monica Render
Please do you speak english?


[PATCH v6 4/7] proc: allow access in init userns for map_files with CAP_CHECKPOINT_RESTORE

2020-07-19 Thread Adrian Reber
Opening files in /proc/pid/map_files when the current user is
CAP_CHECKPOINT_RESTORE capable in the root namespace is useful for
checkpointing and restoring to recover files that are unreachable via
the file system such as deleted files, or memfd files.

Signed-off-by: Adrian Reber 
Signed-off-by: Nicolas Viennot 
Reviewed-by: Cyrill Gorcunov 
---
 fs/proc/base.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 65893686d1f1..b824a8c89011 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2194,16 +2194,16 @@ struct map_files_info {
 };
 
 /*
- * Only allow CAP_SYS_ADMIN to follow the links, due to concerns about how the
- * symlinks may be used to bypass permissions on ancestor directories in the
- * path to the file in question.
+ * Only allow CAP_SYS_ADMIN and CAP_CHECKPOINT_RESTORE to follow the links, due
+ * to concerns about how the symlinks may be used to bypass permissions on
+ * ancestor directories in the path to the file in question.
  */
 static const char *
 proc_map_files_get_link(struct dentry *dentry,
struct inode *inode,
struct delayed_call *done)
 {
-   if (!capable(CAP_SYS_ADMIN))
+   if (!checkpoint_restore_ns_capable(&init_user_ns))
return ERR_PTR(-EPERM);
 
return proc_pid_get_link(dentry, inode, done);
-- 
2.26.2



[PATCH v6 6/7] prctl: exe link permission error changed from -EINVAL to -EPERM

2020-07-19 Thread Adrian Reber
From: Nicolas Viennot 

This brings consistency with the rest of the prctl() syscall where
-EPERM is returned when failing a capability check.

Signed-off-by: Nicolas Viennot 
Signed-off-by: Adrian Reber 
---
 kernel/sys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sys.c b/kernel/sys.c
index a3f4ef0bbda3..ca11af9d815d 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -2015,7 +2015,7 @@ static int prctl_set_mm_map(int opt, const void __user 
*addr, unsigned long data
 * This may have implications in the tomoyo subsystem.
 */
if (!checkpoint_restore_ns_capable(current_user_ns()))
-   return -EINVAL;
+   return -EPERM;
 
error = prctl_set_mm_exe_file(mm, prctl_map.exe_fd);
if (error)
-- 
2.26.2



[PATCH v6 5/7] prctl: Allow local CAP_CHECKPOINT_RESTORE to change /proc/self/exe

2020-07-19 Thread Adrian Reber
From: Nicolas Viennot 

Originally, only a local CAP_SYS_ADMIN could change the exe link,
making it difficult for doing checkpoint/restore without CAP_SYS_ADMIN.
This commit adds CAP_CHECKPOINT_RESTORE in addition to CAP_SYS_ADMIN
for permitting changing the exe link.

The following describes the history of the /proc/self/exe permission
checks as it may be difficult to understand what decisions lead to this
point.

* [1] May 2012: This commit introduces the ability of changing
  /proc/self/exe if the user is CAP_SYS_RESOURCE capable.
  In the related discussion [2], no clear thread model is presented for
  what could happen if the /proc/self/exe changes multiple times, or why
  would the admin be at the mercy of userspace.

* [3] Oct 2014: This commit introduces a new API to change
  /proc/self/exe. The permission no longer checks for CAP_SYS_RESOURCE,
  but instead checks if the current user is root (uid=0) in its local
  namespace. In the related discussion [4] it is said that "Controlling
  exe_fd without privileges may turn out to be dangerous. At least
  things like tomoyo examine it for making policy decisions (see
  tomoyo_manager())."

* [5] Dec 2016: This commit removes the restriction to change
  /proc/self/exe at most once. The related discussion [6] informs that
  the audit subsystem relies on the exe symlink, presumably
  audit_log_d_path_exe() in kernel/audit.c.

* [7] May 2017: This commit changed the check from uid==0 to local
  CAP_SYS_ADMIN. No discussion.

* [8] July 2020: A PoC to spoof any program's /proc/self/exe via ptrace
  is demonstrated

Overall, the concrete points that were made to retain capability checks
around changing the exe symlink is that tomoyo_manager() and
audit_log_d_path_exe() uses the exe_file path.

Christian Brauner said that relying on /proc//exe being immutable (or
guarded by caps) in a sake of security is a bit misleading. It can only
be used as a hint without any guarantees of what code is being executed
once execve() returns to userspace. Christian suggested that in the
future, we could call audit_log() or similar to inform the admin of all
exe link changes, instead of attempting to provide security guarantees
via permission checks. However, this proposed change requires the
understanding of the security implications in the tomoyo/audit subsystems.

[1] b32dfe377102 ("c/r: prctl: add ability to set new mm_struct::exe_file")
[2] https://lore.kernel.org/patchwork/patch/292515/
[3] f606b77f1a9e ("prctl: PR_SET_MM -- introduce PR_SET_MM_MAP operation")
[4] https://lore.kernel.org/patchwork/patch/479359/
[5] 3fb4afd9a504 ("prctl: remove one-shot limitation for changing exe link")
[6] https://lore.kernel.org/patchwork/patch/697304/
[7] 4d28df6152aa ("prctl: Allow local CAP_SYS_ADMIN changing exe_file")
[8] https://github.com/nviennot/run_as_exe

Signed-off-by: Nicolas Viennot 
Signed-off-by: Adrian Reber 
---
 kernel/sys.c | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/kernel/sys.c b/kernel/sys.c
index 00a96746e28a..a3f4ef0bbda3 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -2007,11 +2007,14 @@ static int prctl_set_mm_map(int opt, const void __user 
*addr, unsigned long data
 
if (prctl_map.exe_fd != (u32)-1) {
/*
-* Make sure the caller has the rights to
-* change /proc/pid/exe link: only local sys admin should
-* be allowed to.
+* Check if the current user is checkpoint/restore capable.
+* At the time of this writing, it checks for CAP_SYS_ADMIN
+* or CAP_CHECKPOINT_RESTORE.
+* Note that a user with access to ptrace can masquerade an
+* arbitrary program as any executable, even setuid ones.
+* This may have implications in the tomoyo subsystem.
 */
-   if (!ns_capable(current_user_ns(), CAP_SYS_ADMIN))
+   if (!checkpoint_restore_ns_capable(current_user_ns()))
return -EINVAL;
 
error = prctl_set_mm_exe_file(mm, prctl_map.exe_fd);
-- 
2.26.2



[PATCH v6 7/7] selftests: add clone3() CAP_CHECKPOINT_RESTORE test

2020-07-19 Thread Adrian Reber
This adds a test that changes its UID, uses capabilities to
get CAP_CHECKPOINT_RESTORE and uses clone3() with set_tid to
create a process with a given PID as non-root.

Signed-off-by: Adrian Reber 
---
 tools/testing/selftests/clone3/.gitignore |   1 +
 tools/testing/selftests/clone3/Makefile   |   4 +-
 .../clone3/clone3_cap_checkpoint_restore.c| 177 ++
 3 files changed, 181 insertions(+), 1 deletion(-)
 create mode 100644 
tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c

diff --git a/tools/testing/selftests/clone3/.gitignore 
b/tools/testing/selftests/clone3/.gitignore
index a81085742d40..83c0f6246055 100644
--- a/tools/testing/selftests/clone3/.gitignore
+++ b/tools/testing/selftests/clone3/.gitignore
@@ -2,3 +2,4 @@
 clone3
 clone3_clear_sighand
 clone3_set_tid
+clone3_cap_checkpoint_restore
diff --git a/tools/testing/selftests/clone3/Makefile 
b/tools/testing/selftests/clone3/Makefile
index cf976c732906..ef7564cb7abe 100644
--- a/tools/testing/selftests/clone3/Makefile
+++ b/tools/testing/selftests/clone3/Makefile
@@ -1,6 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0
 CFLAGS += -g -I../../../../usr/include/
+LDLIBS += -lcap
 
-TEST_GEN_PROGS := clone3 clone3_clear_sighand clone3_set_tid
+TEST_GEN_PROGS := clone3 clone3_clear_sighand clone3_set_tid \
+   clone3_cap_checkpoint_restore
 
 include ../lib.mk
diff --git a/tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c 
b/tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c
new file mode 100644
index ..c0d83511cd28
--- /dev/null
+++ b/tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c
@@ -0,0 +1,177 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/*
+ * Based on Christian Brauner's clone3() example.
+ * These tests are assuming to be running in the host's
+ * PID namespace.
+ */
+
+/* capabilities related code based on selftests/bpf/test_verifier.c */
+
+#define _GNU_SOURCE
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "../kselftest_harness.h"
+#include "clone3_selftests.h"
+
+#ifndef MAX_PID_NS_LEVEL
+#define MAX_PID_NS_LEVEL 32
+#endif
+
+static void child_exit(int ret)
+{
+   fflush(stdout);
+   fflush(stderr);
+   _exit(ret);
+}
+
+static int call_clone3_set_tid(pid_t *set_tid, size_t set_tid_size)
+{
+   int status;
+   pid_t pid = -1;
+
+   struct clone_args args = {
+   .exit_signal = SIGCHLD,
+   .set_tid = ptr_to_u64(set_tid),
+   .set_tid_size = set_tid_size,
+   };
+
+   pid = sys_clone3(&args, sizeof(struct clone_args));
+   if (pid < 0) {
+   ksft_print_msg("%s - Failed to create new process\n", 
strerror(errno));
+   return -errno;
+   }
+
+   if (pid == 0) {
+   int ret;
+   char tmp = 0;
+
+   ksft_print_msg
+   ("I am the child, my PID is %d (expected %d)\n", getpid(), 
set_tid[0]);
+
+   if (set_tid[0] != getpid())
+   child_exit(EXIT_FAILURE);
+   child_exit(EXIT_SUCCESS);
+   }
+
+   ksft_print_msg("I am the parent (%d). My child's pid is %d\n", 
getpid(), pid);
+
+   if (waitpid(pid, &status, 0) < 0) {
+   ksft_print_msg("Child returned %s\n", strerror(errno));
+   return -errno;
+   }
+
+   if (!WIFEXITED(status))
+   return -1;
+
+   return WEXITSTATUS(status);
+}
+
+static int test_clone3_set_tid(pid_t *set_tid, size_t set_tid_size)
+{
+   int ret;
+
+   ksft_print_msg("[%d] Trying clone3() with CLONE_SET_TID to %d\n", 
getpid(), set_tid[0]);
+   ret = call_clone3_set_tid(set_tid, set_tid_size);
+   ksft_print_msg("[%d] clone3() with CLONE_SET_TID %d says:%d\n", 
getpid(), set_tid[0], ret);
+   return ret;
+}
+
+struct libcap {
+   struct __user_cap_header_struct hdr;
+   struct __user_cap_data_struct data[2];
+};
+
+static int set_capability(void)
+{
+   cap_value_t cap_values[] = { CAP_SETUID, CAP_SETGID };
+   struct libcap *cap;
+   int ret = -1;
+   cap_t caps;
+
+   caps = cap_get_proc();
+   if (!caps) {
+   perror("cap_get_proc");
+   return -1;
+   }
+
+   /* Drop all capabilities */
+   if (cap_clear(caps)) {
+   perror("cap_clear");
+   goto out;
+   }
+
+   cap_set_flag(caps, CAP_EFFECTIVE, 2, cap_values, CAP_SET);
+   cap_set_flag(caps, CAP_PERMITTED, 2, cap_values, CAP_SET);
+
+   cap = (struct libcap *) caps;
+
+   /* 40 -> CAP_CHECKPOINT_RESTORE */
+   cap->data[1].effective |= 1 << (40 - 32);
+   cap->data[1].permitted |= 1 << (40 - 32);
+
+   if (cap_set_proc(caps)) {
+   perror("cap_set_proc");
+   goto out;
+   }
+   ret = 0;
+out:
+   if (cap_free(caps))
+   perror

[PATCH v6 3/7] pid_namespace: use checkpoint_restore_ns_capable() for ns_last_pid

2020-07-19 Thread Adrian Reber
Use the newly introduced capability CAP_CHECKPOINT_RESTORE to allow
writing to ns_last_pid.

Signed-off-by: Adrian Reber 
Signed-off-by: Nicolas Viennot 
Acked-by: Christian Brauner 
Reviewed-by: Serge Hallyn 
---
 kernel/pid_namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
index 0e5ac162c3a8..ac135bd600eb 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -269,7 +269,7 @@ static int pid_ns_ctl_handler(struct ctl_table *table, int 
write,
struct ctl_table tmp = *table;
int ret, next;
 
-   if (write && !ns_capable(pid_ns->user_ns, CAP_SYS_ADMIN))
+   if (write && !checkpoint_restore_ns_capable(pid_ns->user_ns))
return -EPERM;
 
/*
-- 
2.26.2



Re: [PATCH -next] net: ena: use NULL instead of zero

2020-07-19 Thread Shay Agroskin



Joe Perches  writes:


On Sat, 2020-07-18 at 19:56 +0800, Wang Hai wrote:

Fix sparse build warning:

drivers/net/ethernet/amazon/ena/ena_netdev.c:2193:34: warning:
 Using plain integer as NULL pointer


Better to remove the initialization altogether and
move the declaration into the loop.

diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c 
b/drivers/net/ethernet/amazon/ena/ena_netdev.c

[]
@@ -2190,7 +2190,7 @@ static void ena_del_napi_in_range(struct 
ena_adapter *adapter,
 static void ena_init_napi_in_range(struct ena_adapter 
 *adapter,

   int first_index, int count)
 {
-   struct ena_napi *napi = {0};
+   struct ena_napi *napi = NULL;
int i;
 
 	for (i = first_index; i < first_index + count; i++) {


---
 drivers/net/ethernet/amazon/ena/ena_netdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c 
b/drivers/net/ethernet/amazon/ena/ena_netdev.c

index 91be3ffa1c5c..470d8f38b824 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -2190,11 +2190,10 @@ static void ena_del_napi_in_range(struct 
ena_adapter *adapter,

 static void ena_init_napi_in_range(struct ena_adapter *adapter,
   int first_index, int count)
 {
-   struct ena_napi *napi = {0};
int i;
 
 	for (i = first_index; i < first_index + count; i++) {

-   napi = &adapter->ena_napi[i];
+   struct ena_napi *napi = &adapter->ena_napi[i];
 
 		netif_napi_add(adapter->netdev,

   &adapter->ena_napi[i].napi,


We prefer the second variant as it improves code readability imo.
Thank you both for the time you invested in it (:

Acked-by: Shay Agroskin 



Re: power-off delay/hang due to commit 6d25be57 (mainline)

2020-07-19 Thread Stephen Berman
On Tue, 14 Jul 2020 16:11:35 +0200 Sebastian Andrzej Siewior 
 wrote:

> On 2020-07-14 15:54:57 [+0200], Rafael J. Wysocki wrote:
>> On Tue, Jul 14, 2020 at 3:44 PM Sebastian Andrzej Siewior
>>  wrote:>
>> > On 2020-06-24 23:49:52 [+0200], Stephen Berman wrote:
>> >
>> > Let me summarize the thread here:
>> >
>> > On Stephen's system, ACPI informs the thermal zone driver to poll the
>> > temperature every second and the driver does so.
>> > The driver queries the temperature by invoking acpi_evaluate_integer()
>> > which invokes (at some point) acpi_ev_queue_notify_request().
>>
>> Well, I don't quite see how acpi_ev_queue_notify_request() can be
>> invoked from the acpi_evaluate_integer() code path.
>>
>> Do you have a call trace showing that?
>
> So the trace in
>  https://lore.kernel.org/linux-acpi/87o8pjh1i0@gmx.net/
>
> shows the pattern and we nailed it down that it comes from
> thermal_get_temp(). I assumed acpi_ex_opcode_2A_0T_0R() since the other
> candidate was acpi_ev_asynch_execute_gpe_method().
>
> Stephen, the patch attached adds a WARN_ON() statement which will
> produce a stack trace (4 or so). Could please run 'dmesg' after a while
> and send it back. There should be a
> "WARNING in drivers/acpi/acpica/evmisc.c"
>
> statement or something along the lines.

I've now rebuilt 5.6.4 with the new patch; sorry for the delay.  Output
of dmesg attached.

Steve Berman



dmesg-5.6.4.gz
Description: Binary data


[PATCH for v5.9] ARM: dts: mxs: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 arch/arm/boot/dts/imx23-pinfunc.h | 4 ++--
 arch/arm/boot/dts/imx28-pinfunc.h | 4 ++--
 arch/arm/boot/dts/imx53-tx53-x13x.dts | 4 ++--
 arch/arm/boot/dts/mxs-pinfunc.h   | 4 ++--
 include/video/imx-ipu-v3.h| 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/boot/dts/imx23-pinfunc.h 
b/arch/arm/boot/dts/imx23-pinfunc.h
index 5c0f32ca3a93..f9d7eb6679de 100644
--- a/arch/arm/boot/dts/imx23-pinfunc.h
+++ b/arch/arm/boot/dts/imx23-pinfunc.h
@@ -7,8 +7,8 @@
  * License. You may obtain a copy of the GNU General Public License
  * Version 2 at the following locations:
  *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
+ * https://www.opensource.org/licenses/gpl-license.html
+ * https://www.gnu.org/copyleft/gpl.html
  */
 
 #ifndef __DT_BINDINGS_MX23_PINCTRL_H__
diff --git a/arch/arm/boot/dts/imx28-pinfunc.h 
b/arch/arm/boot/dts/imx28-pinfunc.h
index e11f69ba0fe4..ffd5412b70ae 100644
--- a/arch/arm/boot/dts/imx28-pinfunc.h
+++ b/arch/arm/boot/dts/imx28-pinfunc.h
@@ -7,8 +7,8 @@
  * License. You may obtain a copy of the GNU General Public License
  * Version 2 at the following locations:
  *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
+ * https://www.opensource.org/licenses/gpl-license.html
+ * https://www.gnu.org/copyleft/gpl.html
  */
 
 #ifndef __DT_BINDINGS_MX28_PINCTRL_H__
diff --git a/arch/arm/boot/dts/imx53-tx53-x13x.dts 
b/arch/arm/boot/dts/imx53-tx53-x13x.dts
index 6cdf2082c742..a34d98cf6ed4 100644
--- a/arch/arm/boot/dts/imx53-tx53-x13x.dts
+++ b/arch/arm/boot/dts/imx53-tx53-x13x.dts
@@ -41,8 +41,8 @@
  * License. You may obtain a copy of the GNU General Public License
  * Version 2 at the following locations:
  *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
+ * https://www.opensource.org/licenses/gpl-license.html
+ * https://www.gnu.org/copyleft/gpl.html
  */
 
 /dts-v1/;
diff --git a/arch/arm/boot/dts/mxs-pinfunc.h b/arch/arm/boot/dts/mxs-pinfunc.h
index c6da987b20cb..6766292eee30 100644
--- a/arch/arm/boot/dts/mxs-pinfunc.h
+++ b/arch/arm/boot/dts/mxs-pinfunc.h
@@ -7,8 +7,8 @@
  * License. You may obtain a copy of the GNU General Public License
  * Version 2 at the following locations:
  *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
+ * https://www.opensource.org/licenses/gpl-license.html
+ * https://www.gnu.org/copyleft/gpl.html
  */
 
 #ifndef __DT_BINDINGS_MXS_PINCTRL_H__
diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h
index 06b0b57e996c..749490e3c66e 100644
--- a/include/video/imx-ipu-v3.h
+++ b/include/video/imx-ipu-v3.h
@@ -5,8 +5,8 @@
  * Public License.  You may obtain a copy of the GNU Lesser General
  * Public License Version 2.1 or later at the following locations:
  *
- * http://www.opensource.org/licenses/lgpl-license.html
- * http://www.gnu.org/copyleft/lgpl.html
+ * https://www.opensource.org/licenses/lgpl-license.html
+ * https://www.gnu.org/copyleft/lgpl.html
  */
 
 #ifndef __DRM_IPU_H__
-- 
2.27.0



Re: [PATCH v3 4/4] scsi: ufs: Fix up and simplify error recovery mechanism

2020-07-19 Thread Can Guo

Hi Avri,

On 2020-07-19 16:41, Avri Altman wrote:

Hi,



Current UFS error recovery mechanism has two major problems, and 
neither

of
them is rare.

- Error recovery can be invoked from multiple paths, including hibern8
  enter/exit, some vendor vops, ufshcd_eh_host_reset_handler(), resume 
and
  eh_work scheduled from IRQ context. Ultimately, these paths are 
trying to
  invoke ufshcd_reset_and_restore(), in either sync or async manner. 
Since
  there is no proper protection or synchronization, concurrency of 
these

  paths most likely leads UFS device and host to bad states.

- Error recovery cannot work well or recover hba runtime PM errors if
  ufshcd_suspend/resume has failed due to UFS errors, e.g. SSU cmd 
error.
  When this happens, error handler may fail doing full reset and 
restore
  because error handler always assumes that powers, IRQs and clocks 
are
  ready after pm_runtime_get_sync returns, but actually they are not 
if
  ufshcd_reusme fails [1]. Besides, if ufschd_suspend/resume fails due 
to
  UFS error, runtime PM framework saves the error to 
power.runtime_error.
  After that, hba dev runtime suspend/resume would not be invoked 
anymore

  unless runtime_error is cleared [2].

To fix the concurrency problem, this change queues eh_work on a single
threaded workqueue and remove link recovery from hibern8 enter/exit 
path.
Meanwhile, flushing eh_work in eh_host_reset_handler instead of 
calling

ufshcd_reset_and_restore.

In case of ufshcd_suspend/resume fails due to UFS errors, for scenario 
[1],

error handler cannot assume anything of pm_runtime_get_sync, meaning
error
handler should explicitly turn ON powers, IRQs and clocks. To get the 
hba
runtime PM work again as regard for scenario [2], error handler can 
clear
the runtime_error by calling pm_runtime_set_active() if reset and 
restore
succeeds. Meanwhile, if pm_runtime_set_active() returns no error, 
which
means runtime_error is cleared, we also need to explicitly resume 
those
scsi devices under hba in case any of them has failed to be resumed 
due to

hba runtime resume error.

Signed-off-by: Can Guo 

May I suggest the following re-arrangement, to make this large patch
more readable.
I am not sure that indeed such division is feasible as you are
attending several concurrencies in the same change.
The idea is to solve stuff incrementally, so in your last patch
everything falls into place.

1. Introduce link broken state - Add here all changes concerning the
new state: ufshcd_is_link_broken, ufshcd_set_link_broken, etc.  For
now, In ufshcd_uic_pwr_ctrl just call schedule_work(&hba->eh_work).

2. Introduce eh-scheduled states - Put here the relevant code of the
new UFSHCD_STATE_EH_SCHEDULED_FATAL and
UFSHCD_STATE_EH_SCHEDULED_NON_FATAL and introduce the new
ufshcd_schedule_eh_work

3. Do not print host states / stats while printing regs - put here the
changes you made to ufshcd_print_host_regs and
ufshcd_print_host_state.

4. Changes in ufshcd_eh_in_progress /  ufshcd_set_eh_in_progress - can
this re-arranged as an atomic patch?

5. Changes you made to avoid concurrency between eh_work and link 
recovery


6. Changes you made to fix a racing problem between eh_work and
ufshcd_suspend/resume

Thanks,
Avri



Thanks for the suggestions. You are really reading it thoroughly, thanks 
for
that again. It may look that I am trying to fix a lot (or as many as 
possible)
problems in one change, but actually I am just putting things/codes in 
their
right places during the development of this change. The main purpose of 
this
change is to make sure that eh_work is the only context running during 
error
recovery, the other code changes are just trying to guarantee it is 
happening
as expected, so I developed and tested this change as a whole. Anyways, 
I will
try to split them again to make them easier to read (I tried last time 
but

found it was hard to) and come back with next version.

Thanks,

Can Guo.


---
 drivers/scsi/ufs/ufs-sysfs.c |   1 +
 drivers/scsi/ufs/ufshcd.c| 454 
++-

 drivers/scsi/ufs/ufshcd.h|  15 ++
 3 files changed, 290 insertions(+), 180 deletions(-)

diff --git a/drivers/scsi/ufs/ufs-sysfs.c 
b/drivers/scsi/ufs/ufs-sysfs.c

index 2d71d23..02d379f00 100644
--- a/drivers/scsi/ufs/ufs-sysfs.c
+++ b/drivers/scsi/ufs/ufs-sysfs.c
@@ -16,6 +16,7 @@ static const char *ufschd_uic_link_state_to_string(
case UIC_LINK_OFF_STATE:return "OFF";
case UIC_LINK_ACTIVE_STATE: return "ACTIVE";
case UIC_LINK_HIBERN8_STATE:return "HIBERN8";
+   case UIC_LINK_BROKEN_STATE: return "BROKEN";
default:return "UNKNOWN";
}
 }
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 4a34f2a..cb32430 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -15,6 +15,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include "ufshcd.h"
 #include "ufs_quirks.h"
 #includ

Re: [patch V3 01/13] entry: Provide generic syscall entry functionality

2020-07-19 Thread Thomas Gleixner
Andy Lutomirski  writes:
> On Sat, Jul 18, 2020 at 7:16 AM Thomas Gleixner  wrote:
>> Andy Lutomirski  writes:
>> > FWIW, TIF_USER_RETURN_NOTIFY is a bit of an odd duck: it's an
>> > entry/exit word *and* a context switch word.  The latter is because
>> > it's logically a per-cpu flag, not a per-task flag, and the context
>> > switch code moves it around so it's always set on the running task.
>>
>> Gah, I missed the context switch thing of that. That stuff is hideous.
>
> It's also delightful because anything that screws up that dance (such
> as failure to do the exit-to-usermode path exactly right) likely
> results in an insta-root-hole.  If we fail to run user return
> notifiers, we can run user code with incorrect syscall MSRs, etc.

Looking at it deeper, having that thing in the loop is a pointless
exercise. This really wants to be done _after_ the loop.

Thanks,

tglx


[PATCH for v5.9] ARM: mach-davinci: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 arch/arm/boot/dts/da850-evm.dts | 2 +-
 arch/arm/mach-davinci/Kconfig   | 4 ++--
 arch/arm/mach-davinci/board-da850-evm.c | 2 +-
 arch/arm/mach-davinci/board-mityomapl138.c  | 2 +-
 arch/arm/mach-davinci/board-neuros-osd2.c   | 2 +-
 arch/arm/mach-davinci/board-omapl138-hawk.c | 2 +-
 arch/arm/mach-davinci/cpuidle.c | 2 +-
 arch/arm/mach-davinci/cpuidle.h | 2 +-
 arch/arm/mach-davinci/da850.c   | 2 +-
 arch/arm/mach-davinci/da8xx-dt.c| 2 +-
 arch/arm/mach-davinci/include/mach/pm.h | 2 +-
 arch/arm/mach-davinci/pm.c  | 2 +-
 arch/arm/mach-davinci/sleep.S   | 2 +-
 13 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index f2e7609e5346..87c517d65f62 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -2,7 +2,7 @@
 /*
  * Device Tree for DA850 EVM board
  *
- * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2012 Texas Instruments Incorporated - https://www.ti.com/
  */
 /dts-v1/;
 #include "da850.dtsi"
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index d028d38a44bf..5b0125f1265c 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -201,7 +201,7 @@ config MACH_MITYOMAPL138
help
  Say Y here to select the Critical Link MityDSP-L138/MityARM-1808
  System on Module.  Information on this SoM may be found at
- http://www.mitydsp.com
+ https://www.mitydsp.com
 
 config MACH_OMAPL138_HAWKBOARD
bool "TI AM1808 / OMAPL-138 Hawkboard platform"
@@ -209,7 +209,7 @@ config MACH_OMAPL138_HAWKBOARD
help
  Say Y here to select the TI AM1808 / OMAPL-138 Hawkboard platform .
  Information of this board may be found at
- http://www.hawkboard.org/
+ https://www.hawkboard.org/
 
 config DAVINCI_MUX
bool "DAVINCI multiplexing support"
diff --git a/arch/arm/mach-davinci/board-da850-evm.c 
b/arch/arm/mach-davinci/board-da850-evm.c
index 5b3549f1236c..6751292e5f8f 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -1,7 +1,7 @@
 /*
  * TI DA850/OMAP-L138 EVM board
  *
- * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2009 Texas Instruments Incorporated - https://www.ti.com/
  *
  * Derived from: arch/arm/mach-davinci/board-da830-evm.c
  * Original Copyrights follow:
diff --git a/arch/arm/mach-davinci/board-mityomapl138.c 
b/arch/arm/mach-davinci/board-mityomapl138.c
index dfce421c0579..3382b93d9a2a 100644
--- a/arch/arm/mach-davinci/board-mityomapl138.c
+++ b/arch/arm/mach-davinci/board-mityomapl138.c
@@ -1,7 +1,7 @@
 /*
  * Critical Link MityOMAP-L138 SoM
  *
- * Copyright (C) 2010 Critical Link LLC - http://www.criticallink.com
+ * Copyright (C) 2010 Critical Link LLC - https://www.criticallink.com
  *
  * This file is licensed under the terms of the GNU General Public License
  * version 2. This program is licensed "as is" without any warranty of
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c 
b/arch/arm/mach-davinci/board-neuros-osd2.c
index ce99f782811a..6cf46bbc7e1d 100644
--- a/arch/arm/mach-davinci/board-neuros-osd2.c
+++ b/arch/arm/mach-davinci/board-neuros-osd2.c
@@ -214,7 +214,7 @@ static __init void davinci_ntosd2_init(void)
 * Mux the pins to be GPIOs, VLYNQEN is already done at startup.
 * The AEAWx are five new AEAW pins that can be muxed by separately.
 * They are a bitmask for GPIO management. According TI

Re: [PATCH] drm/ingenic: Silence uninitialized-variable warning

2020-07-19 Thread Sam Ravnborg
Hi Paul.

On Sun, Jul 19, 2020 at 11:38:34AM +0200, Paul Cercueil wrote:
> Silence compiler warning about used but uninitialized 'ipu_state'
> variable. In practice, the variable would never be used when
> uninitialized, but the compiler cannot know that 'priv->ipu_plane' will
> always be NULL if CONFIG_INGENIC_IPU is disabled.
> 
> Silence the warning by initializing the value to NULL.
> 
> Signed-off-by: Paul Cercueil 
Patch looks good. Had to dig into the code to understand the
change to the no_vblank flag.
So:
Reviewed-by: Sam Ravnborg 

I expect you to commit the patch.

Looking at the code I noticed that the return value of
drm_atomic_get_plane_state() is not checked.
Can you try to look into this.

Sam

> ---
>  drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c 
> b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> index b6d946fbeaf5..ada990a7f911 100644
> --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> @@ -198,7 +198,7 @@ static int ingenic_drm_crtc_atomic_check(struct drm_crtc 
> *crtc,
>struct drm_crtc_state *state)
>  {
>   struct ingenic_drm *priv = drm_crtc_get_priv(crtc);
> - struct drm_plane_state *f1_state, *f0_state, *ipu_state;
> + struct drm_plane_state *f1_state, *f0_state, *ipu_state = NULL;
>   long rate;
>  
>   if (!drm_atomic_crtc_needs_modeset(state))
> @@ -229,7 +229,7 @@ static int ingenic_drm_crtc_atomic_check(struct drm_crtc 
> *crtc,
>  
>   /* If all the planes are disabled, we won't get a VBLANK IRQ */
>   priv->no_vblank = !f1_state->fb && !f0_state->fb &&
> -   !(priv->ipu_plane && ipu_state->fb);
> +   !(ipu_state && ipu_state->fb);
>   }
>  
>   return 0;
> -- 
> 2.27.0


[PATCH for v5.9] OMAP2+: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 arch/arm/mach-omap2/am33xx.h  | 2 +-
 arch/arm/mach-omap2/board-generic.c   | 2 +-
 arch/arm/mach-omap2/cm-regbits-33xx.h | 2 +-
 arch/arm/mach-omap2/cm-regbits-54xx.h | 2 +-
 arch/arm/mach-omap2/cm-regbits-7xx.h  | 2 +-
 arch/arm/mach-omap2/cm1_54xx.h| 2 +-
 arch/arm/mach-omap2/cm1_7xx.h | 2 +-
 arch/arm/mach-omap2/cm2_54xx.h| 2 +-
 arch/arm/mach-omap2/cm2_7xx.h | 2 +-
 arch/arm/mach-omap2/cm33xx.c  | 2 +-
 arch/arm/mach-omap2/cm33xx.h  | 2 +-
 arch/arm/mach-omap2/cm81xx.h  | 2 +-
 arch/arm/mach-omap2/display.c | 2 +-
 arch/arm/mach-omap2/dma.c | 2 +-
 arch/arm/mach-omap2/l3_2xxx.h | 2 +-
 arch/arm/mach-omap2/l3_3xxx.h | 2 +-
 arch/arm/mach-omap2/l4_2xxx.h | 2 +-
 arch/arm/mach-omap2/omap-iommu.c  | 2 +-
 arch/arm/mach-omap2/omap_opp_data.h   | 2 +-
 arch/arm/mach-omap2/omap_phy_internal.c   | 2 +-
 arch/arm/mach-omap2/opp3xxx_data.c| 2 +-
 arch/arm/mach-omap2/opp4xxx_data.c| 2 +-
 arch/arm/mach-omap2/powerdomains33xx_data.c   | 2 +-
 arch/arm/mach-omap2/prcm43xx.h| 2 +-
 arch/arm/mach-omap2/prcm_mpu54xx.h| 2 +-
 arch/arm/mach-omap2/prcm_mpu7xx.h | 2 +-
 arch/arm/mach-omap2/scrm54xx.h| 2 +-
 arch/arm/mach-omap2/sleep33xx.S   | 2 +-
 arch/arm/mach-omap2/sleep43xx.S   | 2 +-
 arch/arm/mach-omap2/ti81xx.h  | 2 +-
 arch/arm/mach-omap2/voltagedomains54xx_data.c | 2 +-
 31 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/arch/arm/mach-omap2/am33xx.h b/arch/arm/mach-omap2/am33xx.h
index 5eef093e6738..bf2b5f87e404 100644
--- a/arch/arm/mach-omap2/am33xx.h
+++ b/arch/arm/mach-omap2/am33xx.h
@@ -1,7 +1,7 @@
 /*
  * This file contains the address info for various AM33XX modules.
  *
- * Copyright (C) 2011 Texas Instruments, Inc. - http://www.ti.com/
+ * Copyright (C) 2011 Texas Instruments, Inc. - https://www.ti.com/
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
diff --git a/arch/arm/mach-omap2/board-generic.c 
b/arch/arm/mach-omap2/board-generic.c
index 334923d7652d..7290f033fd2d 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -3,7 +3,7 @@
  * Copyright (C) 2005 Nokia Corporation
  * Author: Paul Mundt 
  *
- * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com/
  *
  * Modified from the original mach-omap/omap2/board-generic.c did by Paul
  * to support the OMAP2+ device tree boards with an unique board file.
diff --git a/arch/arm/mach-omap2/cm-regbits-33xx.h 
b/arch/arm/mach-omap2/cm-regbits-33xx.h
index c0823fd6d5e0..e7ae2bb515e3 100644
--- a/arch/arm/mach-omap2/cm-regbits-33xx.h
+++ b/arch/arm/mach-omap2/cm-regbits-33xx.h
@@ -4,7 +4,7 @@
  * This file is automatically generated from the AM33XX hardware databases.
  * Vaibhav Hiremath 
  *
- * Copyright (C) 2011-2012 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2011-2012 Texas Instruments Incorporated - https://www.ti.com/
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
diff --git a/arch/arm/mach-omap2/cm-regbits-54xx.h 
b/arch/arm/mach-omap2/cm-regbits-54xx.h
index 44663b575bf4..fc886883866f 100644
--- a/arch/arm/mach-omap2/cm-regbits-54xx.h
+++ b/

Re: [PATCH] x86/idt: Make sure idt_table takes a whole page

2020-07-19 Thread Thomas Gleixner
Arvind Sankar  writes:
> To repeat the commit message, the problem is not misaligned
> bss..page_aligned objects, but symbols in _other_ bss sections, which
> can get allocated in the last page of bss..page_aligned, because its end
> isn't page-aligned (maybe it should be?)

That's the real and underlying problem.

> Given that this IDT's page is actually going to be mapped with different
> page protections, it seems like allocating the full page isn't
> unreasonable.

Wrong. The expectation of bss page aligned is that each object in that
section starts at a page boundary independent of its size.

Having the regular .bss objects which have no alignment requirements
start inside the bss aligned section if the last object there does not
have page size or a multiple of page size, is just hideous.

The right fix is trivial. See below.

Thanks,

tglx

 arch/x86/kernel/vmlinux.lds.S |1 +
 include/asm-generic/vmlinux.lds.h |1 +
 2 files changed, 2 insertions(+)

--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -358,6 +358,7 @@ SECTIONS
.bss : AT(ADDR(.bss) - LOAD_OFFSET) {
__bss_start = .;
*(.bss..page_aligned)
+   . = ALIGN(PAGE_SIZE);
*(BSS_MAIN)
BSS_DECRYPTED
. = ALIGN(PAGE_SIZE);
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -738,6 +738,7 @@
.bss : AT(ADDR(.bss) - LOAD_OFFSET) {   \
BSS_FIRST_SECTIONS  \
*(.bss..page_aligned)   \
+   . = ALIGN(PAGE_SIZE);   \
*(.dynbss)  \
*(BSS_MAIN) \
*(COMMON)   \


[PATCH for v5.9] ath5k: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 drivers/net/wireless/ath/ath5k/ath5k.h| 2 +-
 drivers/net/wireless/ath/ath5k/rfbuffer.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h 
b/drivers/net/wireless/ath/ath5k/ath5k.h
index 979800c6f57f..234ea939d316 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -410,7 +410,7 @@ enum ath5k_radio {
  * This article claims Super G sticks to bonding of channels 5 and 6 for
  * USA:
  *
- * http://www.pcworld.com/article/id,113428-page,1/article.html
+ * https://www.pcworld.com/article/id,113428-page,1/article.html
  *
  * The channel bonding seems to be driver specific though.
  *
diff --git a/drivers/net/wireless/ath/ath5k/rfbuffer.h 
b/drivers/net/wireless/ath/ath5k/rfbuffer.h
index aed34d9954c0..151935c4827f 100644
--- a/drivers/net/wireless/ath/ath5k/rfbuffer.h
+++ b/drivers/net/wireless/ath/ath5k/rfbuffer.h
@@ -42,7 +42,7 @@
  * Also check out reg.h and U.S. Patent 669 B1 (about buffer
  * registers and control registers):
  *
- * http://www.google.com/patents?id=qNUREBAJ
+ * https://www.google.com/patents?id=qNUREBAJ
  */
 
 
-- 
2.27.0



[PATCH for v5.9] ath9k: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 drivers/net/wireless/ath/ath9k/ani.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/ani.c 
b/drivers/net/wireless/ath/ath9k/ani.c
index 5214dd7a3936..41d192709e8e 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -74,7 +74,7 @@ static const struct ani_ofdm_level_entry ofdm_level_table[] = 
{
  * Regardless of alignment in time, the antenna signals add constructively 
after
  * FFT and improve your reception. For more information:
  *
- * http://en.wikipedia.org/wiki/Maximal-ratio_combining
+ * https://en.wikipedia.org/wiki/Maximal-ratio_combining
  */
 
 struct ani_cck_level_entry {
-- 
2.27.0



[PATCH] rculist: Silence unused-value warning.

2020-07-19 Thread Suraj Upadhyay
The macro __list_check_srcu is used as a statement inside a for loop.

__list_check_srcu becomes "true" when CONFIG_PROVE_RCU_LIST is not defined.
This results in compiler warning about an unused value ("true").

Silence the compiler warning about the unused value "true"
by replacing it with an empty expression.

Signed-off-by: Suraj Upadhyay 
---
 include/linux/rculist.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index de9385b9158e..8b8e0584c473 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -73,7 +73,7 @@ static inline void INIT_LIST_HEAD_RCU(struct list_head *list)
 #define __list_check_rcu(dummy, cond, extra...)
\
({ check_arg_count_one(extra); })
 
-#define __list_check_srcu(cond) true
+#define __list_check_srcu(cond) ({})
 #endif
 
 /*
-- 
2.17.1



signature.asc
Description: PGP signature


[PATCH 2/2] staging: rtl8192e: Fixed a coding style warning

2020-07-19 Thread Darshan D V
rtllib_crypt_ccmp.c: Fixed the warning - suspect code indent for
conditional statements on line #338

Signed-off-by: Darshan D V 
---
 drivers/staging/rtl8192e/rtllib_crypt_ccmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c 
b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
index b2af802b9451..b60e2a109ce4 100644
--- a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
+++ b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
@@ -337,7 +337,7 @@ static int rtllib_ccmp_set_key(void *key, int len, u8 *seq, 
void *priv)
}
if (crypto_aead_setauthsize(data->tfm, CCMP_MIC_LEN) ||
crypto_aead_setkey(data->tfm, data->key, CCMP_TK_LEN))
-   return -1;
+   return -1;
} else if (len == 0) {
data->key_set = 0;
} else {
-- 
2.17.1



[PATCH 1/2] staging: rtl8192e: Fixed a coding style error

2020-07-19 Thread Darshan D V
rtllib_crypt_ccmp.c: Fixed the error - space required before the
open parenthesis '(' on line #281.

Signed-off-by: Darshan D V 
---
 drivers/staging/rtl8192e/rtllib_crypt_ccmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c 
b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
index 0cbf4a1a326b..b2af802b9451 100644
--- a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
+++ b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
@@ -278,7 +278,7 @@ static int rtllib_ccmp_decrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
int aad_len, ret;
 
req = aead_request_alloc(key->tfm, GFP_ATOMIC);
-   if(!req)
+   if (!req)
return -ENOMEM;
 
aad_len = ccmp_init_iv_and_aad(hdr, pn, iv, aad);
-- 
2.17.1



[PATCH for v5.9] b43: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 drivers/net/wireless/broadcom/b43/main.c  |  14 +-
 .../net/wireless/broadcom/b43/phy_common.c|   2 +-
 drivers/net/wireless/broadcom/b43/phy_g.c |  12 +-
 drivers/net/wireless/broadcom/b43/phy_ht.c|   2 +-
 drivers/net/wireless/broadcom/b43/phy_lp.c|   2 +-
 drivers/net/wireless/broadcom/b43/phy_n.c | 150 +-
 .../net/wireless/broadcom/b43/radio_2056.c|   2 +-
 .../net/wireless/broadcom/b43/tables_nphy.c   |   4 +-
 drivers/net/wireless/intersil/orinoco/Kconfig |   4 +-
 9 files changed, 96 insertions(+), 96 deletions(-)

diff --git a/drivers/net/wireless/broadcom/b43/main.c 
b/drivers/net/wireless/broadcom/b43/main.c
index 3ad94dad2d89..6efbc9ed7fe7 100644
--- a/drivers/net/wireless/broadcom/b43/main.c
+++ b/drivers/net/wireless/broadcom/b43/main.c
@@ -734,7 +734,7 @@ static void b43_short_slot_timing_disable(struct b43_wldev 
*dev)
 }
 
 /* DummyTransmission function, as documented on
- * http://bcm-v4.sipsolutions.net/802.11/DummyTransmission
+ * https://bcm-v4.sipsolutions.net/802.11/DummyTransmission
  */
 void b43_dummy_transmission(struct b43_wldev *dev, bool ofdm, bool pa_on)
 {
@@ -1198,7 +1198,7 @@ void b43_power_saving_ctl_bits(struct b43_wldev *dev, 
unsigned int ps_flags)
}
 }
 
-/* http://bcm-v4.sipsolutions.net/802.11/PHY/BmacCorePllReset */
+/* https://bcm-v4.sipsolutions.net/802.11/PHY/BmacCorePllReset */
 void b43_wireless_core_phy_pll_reset(struct b43_wldev *dev)
 {
struct bcma_drv_cc *bcma_cc __maybe_unused;
@@ -2290,7 +2290,7 @@ int b43_do_request_fw(struct b43_request_fw_context *ctx,
return -EPROTO;
 }
 
-/* http://bcm-v4.sipsolutions.net/802.11/Init/Firmware */
+/* https://bcm-v4.sipsolutions.net/802.11/Init/Firmware */
 static int b43_try_request_fw(struct b43_request_fw_context *ctx)
 {
struct b43_wldev *dev = ctx->dev;
@@ -2843,7 +2843,7 @@ static int b43_upload_initvals_band(struct b43_wldev *dev)
 }
 
 /* Initialize the GPIOs
- * http://bcm-specs.sipsolutions.net/GPIO
+ * https://bcm-specs.sipsolutions.net/GPIO
  */
 
 #ifdef CONFIG_B43_SSB
@@ -2971,7 +2971,7 @@ void b43_mac_enable(struct b43_wldev *dev)
}
 }
 
-/* http://bcm-specs.sipsolutions.net/SuspendMAC */
+/* https://bcm-specs.sipsolutions.net/SuspendMAC */
 void b43_mac_suspend(struct b43_wldev *dev)
 {
int i;
@@ -3004,7 +3004,7 @@ void b43_mac_suspend(struct b43_wldev *dev)
dev->mac_suspended++;
 }
 
-/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/MacPhyClkSet */
+/* https://bcm-v4.sipsolutions.net/802.11/PHY/N/MacPhyClkSet */
 void b43_mac_phy_clock_set(struct b43_wldev *dev, bool on)
 {
u32 tmp;
@@ -3231,7 +3231,7 @@ static void b43_chip_exit(struct b43_wldev *dev)
 }
 
 /* Initialize the chip
- * http://bcm-specs.sipsolutions.net/ChipInit
+ * https://bcm-specs.sipsolutions.net/ChipInit
  */
 static int b43_chip_init(struct b43_wldev *dev)
 {
diff --git a/drivers/net/wireless/broadcom/b43/phy_common.c 
b/drivers/net/wireless/broadcom/b43/phy_common.c
index 923d4cb9fc30..1de4de094d61 100644
--- a/drivers/net/wireless/broadcom/b43/phy_common.c
+++ b/drivers/net/wireless/broadcom/b43/phy_common.c
@@ -559,7 +559,7 @@ bool b43_is_40mhz(struct b43_wldev *dev)
return dev->phy.chandef->width == NL80211_CHAN_WIDTH_40;
 }
 
-/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/BmacPhyClkFgc */
+/* https://bcm-v4.sipsolutions.net/802.11/PHY/N/BmacPhyClkFgc */
 void b43_phy_force_clock(struct b43_wldev *dev, bool force)
 {
u32 tmp;
diff --git a/drivers/net/wireless/broadcom/b43/phy_g.c 
b/drivers/net/wireless/broadcom/b43/phy_g.c
index 1e022ec733a3..d5a1a5c58236 100644
--- a/drivers/net/wireless/broadcom/b43/phy_g.c
+++ b/drivers/net

Re: [PATCH v3 01/12] ima: Have the LSM free its audit rule

2020-07-19 Thread Mimi Zohar
On Fri, 2020-07-17 at 14:24 -0500, Tyler Hicks wrote:
> On 2020-07-17 15:20:22, Nayna wrote:
> > 
> > On 7/9/20 2:19 AM, Tyler Hicks wrote:
> > > Ask the LSM to free its audit rule rather than directly calling kfree().
> > 
> > Is it to be called audit rule or filter rule ?  Likewise in subject line.
> gt
> The security hooks call this "audit rule" but Mimi explained the
> reasoning for IMA referring to this as an "audit filter" here:
> 
>  https://lore.kernel.org/lkml/1593466203.5085.62.ca...@linux.ibm.com/
> 
> I would be fine with her renaming/rewording this patch, accordingly, in
> next-integrity-testing.

Both here and "ima: AppArmor satisfies the audit rule requirements",
the subject is AppArmor/LSM, which do refer to the rules as "audit"
rules.  In the "ima: Rename internal audit rule functions" case, the
rule rename is internal to IMA.  Here it makes sense to replace
"audit" with "filter".  Tyler, I've gone ahead and made the change.

Mimi



Re: [PATCH 2/4] staging: rtl8188eu: include: fixed multiple parentheses coding style issues

2020-07-19 Thread Greg Kroah-Hartman
On Sun, Jul 19, 2020 at 05:35:04AM -0400, B K Karthik wrote:
> On Sun, Jul 19, 2020 at 5:26 AM Greg Kroah-Hartman
>  wrote:
> >
> > On Sat, Jul 18, 2020 at 05:16:26AM -0400, B K Karthik wrote:
> > > fixed multiple parentheses coding style issues reported by checkpatch.
> > >
> > > Signed-off-by: B K Karthik 
> > > ---
> > >  drivers/staging/rtl8188eu/include/ieee80211.h |  4 +--
> > >  .../staging/rtl8188eu/include/osdep_service.h |  4 +--
> > >  drivers/staging/rtl8188eu/include/wifi.h  | 34 +--
> > >  3 files changed, 21 insertions(+), 21 deletions(-)
> >
> > You can never add warnings to the build, like this patch did.  Always
> > test-build your patches at the very least...
> 
> understood, I will definitely do that.
> but these warnings are (mostly) [-Wunused-value] and [-Wformat].
> that should not have (?) occurred due to the usage of parentheses.

They are not there _before_ your patch, and only show up _after_ your
patch, so perhaps your patch is wrong?  :)

thanks,

greg k-h


Re: [PATCH 1/2] staging: rtl8192e: Fixed a coding style error

2020-07-19 Thread Greg KH
On Sun, Jul 19, 2020 at 04:25:56PM +0530, Darshan D V wrote:
> rtllib_crypt_ccmp.c: Fixed the error - space required before the
> open parenthesis '(' on line #281.

What does this mean for a changelog text?

And why is it indented?

Did you read the section in the submitting patches document about how to
write a changelog text?  Perhaps you might want to re-read that :)

> Signed-off-by: Darshan D V 

Is this how you sign legal documents?  If so, great, but I have to ask.

thanks,

greg k-h


Re: [PATCH 2/2] staging: rtl8192e: Fixed a coding style warning

2020-07-19 Thread Greg KH
On Sun, Jul 19, 2020 at 04:25:57PM +0530, Darshan D V wrote:
> rtllib_crypt_ccmp.c: Fixed the warning - suspect code indent for
> conditional statements on line #338

You can't send two patches that do two different things, yet have the
same exact subject: line :(



[tip: x86/urgent] x86/boot: Don't add the EFI stub to targets

2020-07-19 Thread tip-bot2 for Arvind Sankar
The following commit has been merged into the x86/urgent branch of tip:

Commit-ID: da05b143a308bd6a7a01f9732678ae63fc70
Gitweb:
https://git.kernel.org/tip/da05b143a308bd6a7a01f9732678ae63fc70
Author:Arvind Sankar 
AuthorDate:Tue, 14 Jul 2020 23:26:31 -04:00
Committer: Thomas Gleixner 
CommitterDate: Sun, 19 Jul 2020 13:07:11 +02:00

x86/boot: Don't add the EFI stub to targets

vmlinux-objs-y is added to targets, which currently means that the EFI
stub gets added to the targets as well. It shouldn't be added since it
is built elsewhere.

This confuses Makefile.build which interprets the EFI stub as a target
$(obj)/$(objtree)/drivers/firmware/efi/libstub/lib.a
and will create drivers/firmware/efi/libstub/ underneath
arch/x86/boot/compressed, to hold this supposed target, if building
out-of-tree. [0]

Fix this by pulling the stub out of vmlinux-objs-y into efi-obj-y.

[0] See scripts/Makefile.build near the end:
# Create directories for object files if they do not exist

Signed-off-by: Arvind Sankar 
Signed-off-by: Thomas Gleixner 
Reviewed-by: Masahiro Yamada 
Acked-by: Ard Biesheuvel 
Link: https://lkml.kernel.org/r/20200715032631.1562882-1-nived...@alum.mit.edu

---
 arch/x86/boot/compressed/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/boot/compressed/Makefile 
b/arch/x86/boot/compressed/Makefile
index 7619742..5a828fd 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -90,8 +90,8 @@ endif
 
 vmlinux-objs-$(CONFIG_ACPI) += $(obj)/acpi.o
 
-vmlinux-objs-$(CONFIG_EFI_STUB) += 
$(objtree)/drivers/firmware/efi/libstub/lib.a
 vmlinux-objs-$(CONFIG_EFI_MIXED) += $(obj)/efi_thunk_$(BITS).o
+efi-obj-$(CONFIG_EFI_STUB) = $(objtree)/drivers/firmware/efi/libstub/lib.a
 
 # The compressed kernel is built with -fPIC/-fPIE so that a boot loader
 # can place it anywhere in memory and it will still run. However, since
@@ -115,7 +115,7 @@ endef
 quiet_cmd_check-and-link-vmlinux = LD  $@
   cmd_check-and-link-vmlinux = $(cmd_check_data_rel); $(cmd_ld)
 
-$(obj)/vmlinux: $(vmlinux-objs-y) FORCE
+$(obj)/vmlinux: $(vmlinux-objs-y) $(efi-obj-y) FORCE
$(call if_changed,check-and-link-vmlinux)
 
 OBJCOPYFLAGS_vmlinux.bin :=  -R .comment -S


[tip: x86/urgent] x86/entry: Actually disable stack protector

2020-07-19 Thread tip-bot2 for Kees Cook
The following commit has been merged into the x86/urgent branch of tip:

Commit-ID: 58ac3154b83938515129c20aa76d456a4c9202a8
Gitweb:
https://git.kernel.org/tip/58ac3154b83938515129c20aa76d456a4c9202a8
Author:Kees Cook 
AuthorDate:Fri, 26 Jun 2020 13:34:25 -07:00
Committer: Thomas Gleixner 
CommitterDate: Sun, 19 Jul 2020 13:07:10 +02:00

x86/entry: Actually disable stack protector

Some builds of GCC enable stack protector by default. Simply removing
the arguments is not sufficient to disable stack protector, as the stack
protector for those GCC builds must be explicitly disabled. Remove the
argument removals and add -fno-stack-protector. Additionally include
missed x32 argument updates, and adjust whitespace for readability.

Fixes: 20355e5f73a7 ("x86/entry: Exclude low level entry code from sanitizing")
Signed-off-by: Kees Cook 
Signed-off-by: Thomas Gleixner 
Link: https://lkml.kernel.org/r/202006261333.585319CA6B@keescook

---
 arch/x86/entry/Makefile | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/arch/x86/entry/Makefile b/arch/x86/entry/Makefile
index b7a5790..08bf95d 100644
--- a/arch/x86/entry/Makefile
+++ b/arch/x86/entry/Makefile
@@ -7,12 +7,20 @@ KASAN_SANITIZE := n
 UBSAN_SANITIZE := n
 KCOV_INSTRUMENT := n
 
-CFLAGS_REMOVE_common.o = $(CC_FLAGS_FTRACE) -fstack-protector 
-fstack-protector-strong
-CFLAGS_REMOVE_syscall_32.o = $(CC_FLAGS_FTRACE) -fstack-protector 
-fstack-protector-strong
-CFLAGS_REMOVE_syscall_64.o = $(CC_FLAGS_FTRACE) -fstack-protector 
-fstack-protector-strong
+CFLAGS_REMOVE_common.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_syscall_64.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_syscall_32.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_syscall_x32.o= $(CC_FLAGS_FTRACE)
+
+CFLAGS_common.o+= -fno-stack-protector
+CFLAGS_syscall_64.o+= -fno-stack-protector
+CFLAGS_syscall_32.o+= -fno-stack-protector
+CFLAGS_syscall_x32.o   += -fno-stack-protector
 
 CFLAGS_syscall_64.o+= $(call cc-option,-Wno-override-init,)
 CFLAGS_syscall_32.o+= $(call cc-option,-Wno-override-init,)
+CFLAGS_syscall_x32.o   += $(call cc-option,-Wno-override-init,)
+
 obj-y  := entry_$(BITS).o thunk_$(BITS).o 
syscall_$(BITS).o
 obj-y  += common.o
 


Re: [PATCH] drm/ingenic: Silence uninitialized-variable warning

2020-07-19 Thread Paul Cercueil

Hi Sam,

Le dim. 19 juil. 2020 à 12:23, Sam Ravnborg  a 
écrit :

Hi Paul.

On Sun, Jul 19, 2020 at 11:38:34AM +0200, Paul Cercueil wrote:

 Silence compiler warning about used but uninitialized 'ipu_state'
 variable. In practice, the variable would never be used when
 uninitialized, but the compiler cannot know that 'priv->ipu_plane' 
will

 always be NULL if CONFIG_INGENIC_IPU is disabled.

 Silence the warning by initializing the value to NULL.

 Signed-off-by: Paul Cercueil 

Patch looks good. Had to dig into the code to understand the
change to the no_vblank flag.
So:
Reviewed-by: Sam Ravnborg 

I expect you to commit the patch.


Pushed, thanks.


Looking at the code I noticed that the return value of
drm_atomic_get_plane_state() is not checked.
Can you try to look into this.


Right. I'll fix it.

-Paul


Sam


 ---
  drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c 
b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c

 index b6d946fbeaf5..ada990a7f911 100644
 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
 +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
 @@ -198,7 +198,7 @@ static int ingenic_drm_crtc_atomic_check(struct 
drm_crtc *crtc,

 struct drm_crtc_state *state)
  {
struct ingenic_drm *priv = drm_crtc_get_priv(crtc);
 -  struct drm_plane_state *f1_state, *f0_state, *ipu_state;
 +  struct drm_plane_state *f1_state, *f0_state, *ipu_state = NULL;
long rate;

if (!drm_atomic_crtc_needs_modeset(state))
 @@ -229,7 +229,7 @@ static int ingenic_drm_crtc_atomic_check(struct 
drm_crtc *crtc,


/* If all the planes are disabled, we won't get a VBLANK IRQ */
priv->no_vblank = !f1_state->fb && !f0_state->fb &&
 -!(priv->ipu_plane && ipu_state->fb);
 +!(ipu_state && ipu_state->fb);
}

return 0;
 --
 2.27.0





[PATCH for v5.9] b43legacy: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 drivers/net/wireless/broadcom/b43legacy/main.c  | 8 
 drivers/net/wireless/broadcom/b43legacy/phy.c   | 8 
 drivers/net/wireless/broadcom/b43legacy/radio.c | 8 
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/broadcom/b43legacy/main.c 
b/drivers/net/wireless/broadcom/b43legacy/main.c
index 5208a39fd6f7..177a5d85915f 100644
--- a/drivers/net/wireless/broadcom/b43legacy/main.c
+++ b/drivers/net/wireless/broadcom/b43legacy/main.c
@@ -591,7 +591,7 @@ static void b43legacy_synchronize_irq(struct 
b43legacy_wldev *dev)
 }
 
 /* DummyTransmission function, as documented on
- * http://bcm-specs.sipsolutions.net/DummyTransmission
+ * https://bcm-specs.sipsolutions.net/DummyTransmission
  */
 void b43legacy_dummy_transmission(struct b43legacy_wldev *dev)
 {
@@ -1870,7 +1870,7 @@ static int b43legacy_upload_initvals(struct 
b43legacy_wldev *dev)
 }
 
 /* Initialize the GPIOs
- * http://bcm-specs.sipsolutions.net/GPIO
+ * https://bcm-specs.sipsolutions.net/GPIO
  */
 static int b43legacy_gpio_init(struct b43legacy_wldev *dev)
 {
@@ -1960,7 +1960,7 @@ void b43legacy_mac_enable(struct b43legacy_wldev *dev)
}
 }
 
-/* http://bcm-specs.sipsolutions.net/SuspendMAC */
+/* https://bcm-specs.sipsolutions.net/SuspendMAC */
 void b43legacy_mac_suspend(struct b43legacy_wldev *dev)
 {
int i;
@@ -2141,7 +2141,7 @@ static void b43legacy_chip_exit(struct b43legacy_wldev 
*dev)
 }
 
 /* Initialize the chip
- * http://bcm-specs.sipsolutions.net/ChipInit
+ * https://bcm-specs.sipsolutions.net/ChipInit
  */
 static int b43legacy_chip_init(struct b43legacy_wldev *dev)
 {
diff --git a/drivers/net/wireless/broadcom/b43legacy/phy.c 
b/drivers/net/wireless/broadcom/b43legacy/phy.c
index a659259bc51a..05404fbd1e70 100644
--- a/drivers/net/wireless/broadcom/b43legacy/phy.c
+++ b/drivers/net/wireless/broadcom/b43legacy/phy.c
@@ -129,7 +129,7 @@ void b43legacy_phy_calibrate(struct b43legacy_wldev *dev)
 }
 
 /* initialize B PHY power control
- * as described in http://bcm-specs.sipsolutions.net/InitPowerControl
+ * as described in https://bcm-specs.sipsolutions.net/InitPowerControl
  */
 static void b43legacy_phy_init_pctl(struct b43legacy_wldev *dev)
 {
@@ -1461,7 +1461,7 @@ void b43legacy_phy_set_baseband_attenuation(struct 
b43legacy_wldev *dev,
b43legacy_phy_write(dev, 0x0060, value);
 }
 
-/* http://bcm-specs.sipsolutions.net/LocalOscillator/Measure */
+/* https://bcm-specs.sipsolutions.net/LocalOscillator/Measure */
 void b43legacy_phy_lo_g_measure(struct b43legacy_wldev *dev)
 {
static const u8 pairorder[10] = { 3, 1, 5, 7, 9, 2, 0, 4, 6, 8 };
@@ -1721,7 +1721,7 @@ void b43legacy_phy_lo_mark_all_unused(struct 
b43legacy_wldev *dev)
}
 }
 
-/* http://bcm-specs.sipsolutions.net/EstimatePowerOut
+/* https://bcm-specs.sipsolutions.net/EstimatePowerOut
  * This function converts a TSSI value to dBm in Q5.2
  */
 static s8 b43legacy_phy_estimate_power_out(struct b43legacy_wldev *dev, s8 
tssi)
@@ -1747,7 +1747,7 @@ static s8 b43legacy_phy_estimate_power_out(struct 
b43legacy_wldev *dev, s8 tssi)
return dbm;
 }
 
-/* http://bcm-specs.sipsolutions.net/RecalculateTransmissionPower */
+/* https://bcm-specs.sipsolutions.net/RecalculateTransmissionPower */
 void b43legacy_phy_xmitpower(struct b43legacy_wldev *dev)
 {
struct b43legacy_phy *phy = &dev->phy;
diff --git a/drivers/net/wireless/broadcom/b43legacy/radio.c 
b/drivers/net/wireless/broadcom/b43legacy/radio.c
index da40d1ca8723..06891b4f837b 100644
--- a/drivers/net/wireless/broadcom/b43legacy/radio.c
+++ b/drivers/net/wireless/broadcom/b43legacy/radio.c
@@ -313,14 +313,14 @@ u8 b43legacy_radio_aci

Re: [PATCH 0/2] task_put batching

2020-07-19 Thread Pavel Begunkov
On 18/07/2020 17:37, Jens Axboe wrote:
> On 7/18/20 2:32 AM, Pavel Begunkov wrote:
>> For my a bit exaggerated test case perf continues to show high CPU
>> cosumption by io_dismantle(), and so calling it io_iopoll_complete().
>> Even though the patch doesn't yield throughput increase for my setup,
>> probably because the effect is hidden behind polling, but it definitely
>> improves relative percentage. And the difference should only grow with
>> increasing number of CPUs. Another reason to have this is that atomics
>> may affect other parallel tasks (e.g. which doesn't use io_uring)
>>
>> before:
>> io_iopoll_complete: 5.29%
>> io_dismantle_req:   2.16%
>>
>> after:
>> io_iopoll_complete: 3.39%
>> io_dismantle_req:   0.465%
> 
> Still not seeing a win here, but it's clean and it _should_ work. For

Well, if this thing is useful, it'd be hard to quantify, because active
polling would hide it. I think, it'd need to apply a lot of isolated
pressure on cache synchronisation (e.g. spam with barriers), or try to
create and measure an atomic heavy task pinned to another core. Don't
worth the effort IMHO.
`
Just out of curiosity, let me ask how do you test it?
- is it a VM?
- how many cores and threads do you use?
- how many io_uring instances you have? Per thread?
- Is it all goes to a single NVMe SSD?

> some reason I end up getting the offset in task ref put growing the
> fput_many(). Which doesn't (on the surface) make a lot of sense, but
> may just mean that we have some weird side effects.

I'll take a look whether I can reproduce.

-- 
Pavel Begunkov


Re: INFO: rcu detected stall in iterate_cleanup_work (2)

2020-07-19 Thread syzbot
syzbot has bisected this issue to:

commit 5a781ccbd19e4664babcbe4b4ead7aa2b9283d22
Author: Vinicius Costa Gomes 
Date:   Sat Sep 29 00:59:43 2018 +

tc: Add support for configuring the taprio scheduler

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=141ed08710
start commit:   cd77006e Merge tag 'hyperv-fixes-signed' of git://git.kern..
git tree:   upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=121ed08710
kernel config:  https://syzkaller.appspot.com/x/.config?x=7be693511b29b338
dashboard link: https://syzkaller.appspot.com/bug?extid=cc8495ea4052b9b79b72
syz repro:  https://syzkaller.appspot.com/x/repro.syz?x=12e567e510
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=126ffccd10

Reported-by: syzbot+cc8495ea4052b9b79...@syzkaller.appspotmail.com
Fixes: 5a781ccbd19e ("tc: Add support for configuring the taprio scheduler")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection


[PATCH for v5.9] media: omap: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 drivers/media/platform/omap3isp/isp.c | 2 +-
 drivers/staging/media/omap4iss/iss.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/omap3isp/isp.c 
b/drivers/media/platform/omap3isp/isp.c
index b91e472ee764..74fa67082e09 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -142,7 +142,7 @@ static struct isp_reg isp_reg_list[] = {
  * readback the same register, in this case the revision register.
  *
  * See this link for reference:
- *   http://www.mail-archive.com/linux-omap@vger.kernel.org/msg08149.html
+ *   https://www.mail-archive.com/linux-omap@vger.kernel.org/msg08149.html
  */
 void omap3isp_flush(struct isp_device *isp)
 {
diff --git a/drivers/staging/media/omap4iss/iss.c 
b/drivers/staging/media/omap4iss/iss.c
index 6fb60b58447a..e06ea7ea1e50 100644
--- a/drivers/staging/media/omap4iss/iss.c
+++ b/drivers/staging/media/omap4iss/iss.c
@@ -55,7 +55,7 @@ static void iss_print_status(struct iss_device *iss)
  * readback the same register, in this case the revision register.
  *
  * See this link for reference:
- *   http://www.mail-archive.com/linux-omap@vger.kernel.org/msg08149.html
+ *   https://www.mail-archive.com/linux-omap@vger.kernel.org/msg08149.html
  */
 static void omap4iss_flush(struct iss_device *iss)
 {
-- 
2.27.0



Re: [PATCH v16 13/22] mm/lru: introduce TestClearPageLRU

2020-07-19 Thread Alex Shi



在 2020/7/19 下午12:45, Alex Shi 写道:
>>>
 It might make it more readable to pull in the later patch that
 modifies isolate_lru_pages that has it using TestClearPageLRU.
>>> As to this change, It has to do in this patch, since any TestClearPageLRU 
>>> may
>>> cause lru bit miss in the lru list, so the precondication check has to
>>> removed here.
>> So I think some of my cognitive dissonance is from the fact that you
>> really are doing two different things here. You aren't really
>> implementing the full TestClearPageLRU until patch 15. So this patch
>> is doing part of 2a and 2b, and then patch 15 is following up and
>> completing the 2a cases. I still think it might make more sense to
>> pull out the pieces related to 2b and move them into a patch before
>> this with documentation explaining that there should be no competition
>> for the LRU flag because the page has transitioned to a reference
>> count of zero. Then take the remaining bits and combine them with
>> patch 15 since the description for the two is pretty similar.
>>


As to the patch split suggest, actually, Hugh and I talked about a few weeks 
ago when he give me these changes. We both thought keep these changes in this
patch looks better at that time.
If it make you confuse, don't know a changed commit log make it better?

Thanks
Alex

mm/lru: introduce TestClearPageLRU

Currently lru_lock still guards both lru list and page's lru bit, that's
ok. but if we want to use specific lruvec lock on the page, we need to
pin down the page's lruvec/memcg during locking. Just taking lruvec
lock first may be undermined by the page's memcg charge/migration. To
fix this problem, we could take out the page's lru bit clear and use
it as pin down action to block the memcg changes. That's the reason
for new atomic func TestClearPageLRU. So now isolating a page need both
actions: TestClearPageLRU and hold the lru_lock.

This patch combines PageLRU check and ClearPageLRU into a macro func
TestClearPageLRU. This function will be used as page isolation
precondition to prevent other isolations some where else.
Then there are may non PageLRU page on lru list, need to remove BUG
checking accordingly.

There 2 rules for lru bit:
1, the lru bit still indicate if a page on lru list, just
in some temporary moment(isolating), the page may have no lru bit when
it's on lru list.  but the page still must be on lru list when the
lru bit is set.
2, have to remove lru bit before delete it from lru list.

Hugh Dickins pointed that when a page is in freeing path and no one is
possible to take it, non atomic lru bit clearing is better, like in
__page_cache_release and release_pages.
ANd no need get_page() before lru bit clear in isolate_lru_page,
since it '(1) Must be called with an elevated refcount on the page'.

As Andrew Morton mentioned this change would dirty cacheline for page
isn't on LRU. But the lost would be acceptable with Rong Chen
 report:
https://lkml.org/lkml/2020/3/4/173

Suggested-by: Johannes Weiner 
Signed-off-by: Alex Shi 
Cc: Hugh Dickins 
Cc: Johannes Weiner 
Cc: Michal Hocko 
Cc: Vladimir Davydov 
Cc: Andrew Morton 
Cc: linux-kernel@vger.kernel.org
Cc: cgro...@vger.kernel.org
Cc: linux...@kvack.org




[PATCH for v5.9] net: ieee802154: adf7242: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 drivers/net/ieee802154/adf7242.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ieee802154/adf7242.c b/drivers/net/ieee802154/adf7242.c
index 5a37514e4234..60a016a6806a 100644
--- a/drivers/net/ieee802154/adf7242.c
+++ b/drivers/net/ieee802154/adf7242.c
@@ -4,7 +4,7 @@
  *
  * Copyright 2009-2017 Analog Devices Inc.
  *
- * http://www.analog.com/ADF7242
+ * https://www.analog.com/ADF7242
  */
 
 #include 
-- 
2.27.0



Re: [PATCH] media: atomisp: fix mask and shift operation on ISPSSPM0

2020-07-19 Thread Mauro Carvalho Chehab
Em Thu, 16 Jul 2020 15:51:38 +0100
Colin King  escreveu:

> From: Colin Ian King 
> 
> Currently the check on bits 25:24 on ISPSSPM0 is always 0 because
> the mask and shift operations are incorrect. Fix this by shifting
> by MRFLD_ISPSSPM0_ISPSSS_OFFSET (24 bits right) and then masking
> with RFLD_ISPSSPM0_ISPSSC_MASK (0x03) to get the appropriate 2 bits
> to check.
> 
> Addresses-Coverity: ("Operands don't affect result")
> Fixes: 0f441fd70b1e ("media: atomisp: simplify the power down/up code")
> Signed-off-by: Colin Ian King 

Thanks!

With this patch, we can revert this one too (patch enclosed):

d0213061a501 ("media: atomisp: fix mask and shift operation on 
ISPSSPM0")

I tested it already: the IUNIT power on/off code is working properly
after both patches.

Thanks,
Mauro

-
[PATCH] Revert "media: atomisp: keep the ISP powered on when setting it"

changeset d0213061a501 ("media: atomisp: fix mask and shift operation on 
ISPSSPM0")
solved the existing issue with the IUNIT power on code.

So, the driver can now use the right code again.

This reverts commit 95d1f398c4dc3f55e9007c89452ccc16301205fc.

Signed-off-by: Mauro Carvalho Chehab 

diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c 
b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
index e31195816b2d..a000a1e316f7 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
@@ -766,17 +766,13 @@ static int atomisp_mrfld_power(struct atomisp_device 
*isp, bool enable)
 /* Workaround for pmu_nc_set_power_state not ready in MRFLD */
 int atomisp_mrfld_power_down(struct atomisp_device *isp)
 {
-   return 0;
-// FIXME: at least with ISP2401, the code below causes the driver to break
-// return atomisp_mrfld_power(isp, false);
+   return atomisp_mrfld_power(isp, false);
 }
 
 /* Workaround for pmu_nc_set_power_state not ready in MRFLD */
 int atomisp_mrfld_power_up(struct atomisp_device *isp)
 {
-   return 0;
-// FIXME: at least with ISP2401, the code below causes the driver to break
-// return atomisp_mrfld_power(isp, true);
+   return atomisp_mrfld_power(isp, true);
 }
 
 int atomisp_runtime_suspend(struct device *dev)




[PATCH for v5.9] net: sched: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 net/sched/Kconfig   | 2 +-
 net/sched/sch_qfq.c | 2 +-
 net/sched/sch_sfb.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/sched/Kconfig b/net/sched/Kconfig
index 84badf00647e..e0509b4c39e4 100644
--- a/net/sched/Kconfig
+++ b/net/sched/Kconfig
@@ -223,7 +223,7 @@ config NET_SCH_DSMARK
  Say Y if you want to schedule packets according to the
  Differentiated Services architecture proposed in RFC 2475.
  Technical information on this method, with pointers to associated
- RFCs, is available at .
+ RFCs, is available at .
 
  To compile this code as a module, choose M here: the
  module will be called sch_dsmark.
diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c
index 0b05ac7c848e..191143c35de6 100644
--- a/net/sched/sch_qfq.c
+++ b/net/sched/sch_qfq.c
@@ -24,7 +24,7 @@
 
 [1] Paolo Valente,
 "Reducing the Execution Time of Fair-Queueing Schedulers."
-http://algo.ing.unimo.it/people/paolo/agg-sched/agg-sched.pdf
+https://algo.ing.unimo.it/people/paolo/agg-sched/agg-sched.pdf
 
 Sources for QFQ:
 
diff --git a/net/sched/sch_sfb.c b/net/sched/sch_sfb.c
index 4074c50ac3d7..f8fa648988bd 100644
--- a/net/sched/sch_sfb.c
+++ b/net/sched/sch_sfb.c
@@ -9,7 +9,7 @@
  * A New Class of Active Queue Management Algorithms.
  * U. Michigan CSE-TR-387-99, April 1999.
  *
- * http://www.thefengs.com/wuchang/blue/CSE-TR-387-99.pdf
+ * https://www.thefengs.com/wuchang/blue/CSE-TR-387-99.pdf
  */
 
 #include 
-- 
2.27.0



[PATCH v8 2/2] clocksource: Ingenic: Add support for the Ingenic X1000 OST.

2020-07-19 Thread Zhou Yanjie
X1000 and SoCs after X1000 (such as X1500 and X1830) had a separate
OST, it no longer belongs to TCU. This driver will register both a
clocksource and a sched_clock to the system.

Tested-by: 周正 (Zhou Zheng) 
Co-developed-by: 漆鹏振 (Qi Pengzhen) 
Signed-off-by: 漆鹏振 (Qi Pengzhen) 
Signed-off-by: 周琰杰 (Zhou Yanjie) 
Reviewed-by: Paul Cercueil 
---

Notes:
v1->v2:
Fix compile warnings.
Reported-by: kernel test robot 

v2->v3:
No change.

v3->v4:
1.Rename "ost" to "sysost"
1.Remove unrelated changes.
2.Remove ost_clock_parent enum.
3.Remove ost->percpu_timer_channel/ost->global_timer_channel.
4.Set up independent .recalc_rate/.set_rate for percpu/global timer.
5.No longer call functions in variable declarations.

v4->v5:
Use "of_io_request_and_map()" instead "of_iomap()".
Suggested-by: Paul Cercueil 

v5->v6:
No change.

v6->v7:
Suggested-by: Daniel Lezcano 
Remove "default MACH_INGENIC" and make options silent.

v7->v8:
Suggested-by: Paul Cercueil 
Revert the changes made in v7, remove the "default MACH_INGENIC"
in SYSOST, and modify the bool description in OST to make it
consistent with the style of TCU and SYSOST.

 drivers/clocksource/Kconfig  |  12 +-
 drivers/clocksource/Makefile |   1 +
 drivers/clocksource/ingenic-sysost.c | 539 +++
 3 files changed, 551 insertions(+), 1 deletion(-)
 create mode 100644 drivers/clocksource/ingenic-sysost.c

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 91418381fcd4..7d227915cb8f 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -696,8 +696,18 @@ config INGENIC_TIMER
help
  Support for the timer/counter unit of the Ingenic JZ SoCs.
 
+config INGENIC_SYSOST
+   bool "Clocksource/timer using the SYSOST in Ingenic X SoCs"
+   depends on MIPS || COMPILE_TEST
+   depends on COMMON_CLK
+   select MFD_SYSCON
+   select TIMER_OF
+   select IRQ_DOMAIN
+   help
+ Support for the SYSOST of the Ingenic X Series SoCs.
+
 config INGENIC_OST
-   bool "Clocksource for Ingenic OS Timer"
+   bool "Clocksource using the OST in Ingenic JZ SoCs"
depends on MIPS || COMPILE_TEST
depends on COMMON_CLK
select MFD_SYSCON
diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile
index bdda1a2e4097..3994e221e262 100644
--- a/drivers/clocksource/Makefile
+++ b/drivers/clocksource/Makefile
@@ -82,6 +82,7 @@ obj-$(CONFIG_H8300_TMR8)  += h8300_timer8.o
 obj-$(CONFIG_H8300_TMR16)  += h8300_timer16.o
 obj-$(CONFIG_H8300_TPU)+= h8300_tpu.o
 obj-$(CONFIG_INGENIC_OST)  += ingenic-ost.o
+obj-$(CONFIG_INGENIC_SYSOST)   += ingenic-sysost.o
 obj-$(CONFIG_INGENIC_TIMER)+= ingenic-timer.o
 obj-$(CONFIG_CLKSRC_ST_LPC)+= clksrc_st_lpc.o
 obj-$(CONFIG_X86_NUMACHIP) += numachip.o
diff --git a/drivers/clocksource/ingenic-sysost.c 
b/drivers/clocksource/ingenic-sysost.c
new file mode 100644
index ..e77d58449005
--- /dev/null
+++ b/drivers/clocksource/ingenic-sysost.c
@@ -0,0 +1,539 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Ingenic XBurst SoCs SYSOST clocks driver
+ * Copyright (c) 2020 周琰杰 (Zhou Yanjie) 
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+/* OST register offsets */
+#define OST_REG_OSTCCR 0x00
+#define OST_REG_OSTCR  0x08
+#define OST_REG_OSTFR  0x0c
+#define OST_REG_OSTMR  0x10
+#define OST_REG_OST1DFR0x14
+#define OST_REG_OST1CNT0x18
+#define OST_REG_OST2CNTL   0x20
+#define OST_REG_OSTCNT2HBUF0x24
+#define OST_REG_OSTESR 0x34
+#define OST_REG_OSTECR 0x38
+
+/* bits within the OSTCCR register */
+#define OSTCCR_PRESCALE1_MASK  0x3
+#define OSTCCR_PRESCALE2_MASK  0xc
+#define OSTCCR_PRESCALE1_LSB   0
+#define OSTCCR_PRESCALE2_LSB   2
+
+/* bits within the OSTCR register */
+#define OSTCR_OST1CLR  BIT(0)
+#define OSTCR_OST2CLR  BIT(1)
+
+/* bits within the OSTFR register */
+#define OSTFR_FFLAGBIT(0)
+
+/* bits within the OSTMR register */
+#define OSTMR_FMASKBIT(0)
+
+/* bits within the OSTESR register */
+#define OSTESR_OST1ENS BIT(0)
+#define OSTESR_OST2ENS BIT(1)
+
+/* bits within the OSTECR register */
+#define OSTECR_OST1ENC BIT(0)
+#define OSTECR_OST2ENC BIT(1)
+
+struct ingenic_soc_info {
+   unsigned int num_channels;
+};
+
+struct ingenic_ost_clk_info {
+   struct clk_init_data init_data;
+   u8 ostccr_reg;
+};
+
+struct ingenic_ost_

[PATCH] staging: rtl8188eu: add spaces around operators in header files

2020-07-19 Thread Michael Straube
Add spaces around operators in the header files to improve readability
and clear checkpatch issues.

Signed-off-by: Michael Straube 
---
 .../rtl8188eu/include/hal8188e_rate_adaptive.h   |  4 ++--
 drivers/staging/rtl8188eu/include/odm_types.h|  6 +++---
 drivers/staging/rtl8188eu/include/rtl8188e_hal.h | 12 ++--
 drivers/staging/rtl8188eu/include/rtw_efuse.h|  2 +-
 drivers/staging/rtl8188eu/include/rtw_pwrctrl.h  |  2 +-
 drivers/staging/rtl8188eu/include/rtw_recv.h |  2 +-
 drivers/staging/rtl8188eu/include/rtw_security.h | 10 +-
 drivers/staging/rtl8188eu/include/rtw_xmit.h | 12 ++--
 drivers/staging/rtl8188eu/include/wifi.h |  2 +-
 drivers/staging/rtl8188eu/include/wlan_bssdef.h  |  2 +-
 10 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/hal8188e_rate_adaptive.h 
b/drivers/staging/rtl8188eu/include/hal8188e_rate_adaptive.h
index 79c0d2f9961e..646647feae85 100644
--- a/drivers/staging/rtl8188eu/include/hal8188e_rate_adaptive.h
+++ b/drivers/staging/rtl8188eu/include/hal8188e_rate_adaptive.h
@@ -28,9 +28,9 @@
 #define GET_TX_RPT2_DESC_PKT_LEN_88E(__pRxStatusDesc)  \
LE_BITS_TO_4BYTE(__pRxStatusDesc, 0, 9)
 #define GET_TX_RPT2_DESC_MACID_VALID_1_88E(__pRxStatusDesc)\
-   LE_BITS_TO_4BYTE(__pRxStatusDesc+16, 0, 32)
+   LE_BITS_TO_4BYTE(__pRxStatusDesc + 16, 0, 32)
 #define GET_TX_RPT2_DESC_MACID_VALID_2_88E(__pRxStatusDesc)\
-   LE_BITS_TO_4BYTE(__pRxStatusDesc+20, 0, 32)
+   LE_BITS_TO_4BYTE(__pRxStatusDesc + 20, 0, 32)
 
 #define GET_TX_REPORT_TYPE1_RERTY_0(__pAddr)   \
LE_BITS_TO_4BYTE(__pAddr, 0, 16)
diff --git a/drivers/staging/rtl8188eu/include/odm_types.h 
b/drivers/staging/rtl8188eu/include/odm_types.h
index 7255f7afff7a..2b207f09b56b 100644
--- a/drivers/staging/rtl8188eu/include/odm_types.h
+++ b/drivers/staging/rtl8188eu/include/odm_types.h
@@ -15,10 +15,10 @@ enum HAL_STATUS {
 };
 
 #define SET_TX_DESC_ANTSEL_A_88E(__pTxDesc, __Value)   \
-   SET_BITS_TO_LE_4BYTE(__pTxDesc+8, 24, 1, __Value)
+   SET_BITS_TO_LE_4BYTE(__pTxDesc + 8, 24, 1, __Value)
 #define SET_TX_DESC_ANTSEL_B_88E(__pTxDesc, __Value)   \
-   SET_BITS_TO_LE_4BYTE(__pTxDesc+8, 25, 1, __Value)
+   SET_BITS_TO_LE_4BYTE(__pTxDesc + 8, 25, 1, __Value)
 #define SET_TX_DESC_ANTSEL_C_88E(__pTxDesc, __Value)   \
-   SET_BITS_TO_LE_4BYTE(__pTxDesc+28, 29, 1, __Value)
+   SET_BITS_TO_LE_4BYTE(__pTxDesc + 28, 29, 1, __Value)
 
 #endif /*  __ODM_TYPES_H__ */
diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h 
b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
index b1e73503a2c2..6035c12ec578 100644
--- a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
+++ b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
@@ -45,7 +45,7 @@
 #define Rtl8188E_NIC_LPS_LEAVE_FLOWrtl8188E_leave_lps_flow
 
 #define DRVINFO_SZ 4 /*  unit is 8bytes */
-#define PageNum_128(_Len)  (u32)(((_Len)>>7) + ((_Len) & 0x7F ? 1 : 0))
+#define PageNum_128(_Len)  (u32)(((_Len) >> 7) + ((_Len) & 0x7F ? 1 : 0))
 
 /*  download firmware related data structure */
 #define FW_8188E_SIZE  0x4000 /* 16384,16k */
@@ -54,11 +54,11 @@
 
 #define MAX_PAGE_SIZE  4096/*  @ page : 4k bytes */
 
-#define IS_FW_HEADER_EXIST(_pFwHdr)\
-   ((le16_to_cpu(_pFwHdr->signature)&0xFFF0) == 0x92C0 ||  \
-   (le16_to_cpu(_pFwHdr->signature)&0xFFF0) == 0x88C0 ||   \
-   (le16_to_cpu(_pFwHdr->signature)&0xFFF0) == 0x2300 ||   \
-   (le16_to_cpu(_pFwHdr->signature)&0xFFF0) == 0x88E0)
+#define IS_FW_HEADER_EXIST(_pFwHdr) \
+   ((le16_to_cpu(_pFwHdr->signature) & 0xFFF0) == 0x92C0 || \
+   (le16_to_cpu(_pFwHdr->signature) & 0xFFF0) == 0x88C0 ||  \
+   (le16_to_cpu(_pFwHdr->signature) & 0xFFF0) == 0x2300 ||  \
+   (le16_to_cpu(_pFwHdr->signature) & 0xFFF0) == 0x88E0)
 
 #define DRIVER_EARLY_INT_TIME  0x05
 #define BCN_DMA_ATIME_INT_TIME 0x02
diff --git a/drivers/staging/rtl8188eu/include/rtw_efuse.h 
b/drivers/staging/rtl8188eu/include/rtw_efuse.h
index 7a9c8ff0daa9..5926fc9b5e6b 100644
--- a/drivers/staging/rtl8188eu/include/rtw_efuse.h
+++ b/drivers/staging/rtl8188eu/include/rtw_efuse.h
@@ -44,7 +44,7 @@
 /* The following is for BT Efuse definition */
 #defineEFUSE_BT_MAX_MAP_LEN1024
 #defineEFUSE_MAX_BANK  4
-#defineEFUSE_MAX_BT_BANK   (EFUSE_MAX_BANK-1)
+#defineEFUSE_MAX_BT_BANK   (EFUSE_MAX_BANK - 1)
 /*--Define Parameters---*/
 #defineEFUSE_MAX_WORD_UNIT 4
 
diff --git a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h 
b/drivers/staging/rtl8188eu/include/rt

Re: [PATCH] cpufreq: intel_pstate: Implement passive mode with HWP enabled

2020-07-19 Thread Rafael J. Wysocki
Hi Doug,

On Fri, Jul 17, 2020 at 3:37 PM Doug Smythies  wrote:
>
> Hi Rafael,
>
> Thank you for your reply.
>
> On 2020.07.16 05:08 Rafael J. Wysocki wrote:
> > On Wed, Jul 15, 2020 at 10:39 PM Doug Smythies  wrote:
> >> On 2020.07.14 11:16 Rafael J. Wysocki wrote:
> >> >
> >> > From: Rafael J. Wysocki 
> >> ...
> >> > Since the passive mode hasn't worked with HWP at all, and it is not 
> >> > going to
> >> > the default for HWP systems anyway, I don't see any drawbacks related to 
> >> > making
> >> > this change, so I would consider this as 5.9 material unless there are 
> >> > any
> >> > serious objections.
> >>
> >> Good point.
>
> Actually, for those users that default to passive mode upon boot,
> this would mean they would find themselves using this.
> Also, it isn't obvious, from the typical "what driver and what governor"
> inquiry.

So the change in behavior is that after this patch
intel_pstate=passive doesn't imply no_hwp any more.

That's a very minor difference though and I'm not aware of any adverse
effects it can cause on HWP systems anyway.

The "what governor" is straightforward in the passive mode: that's
whatever cpufreq governor has been selected.

The driver is "intel_cpufreq" which means that the processor is
requested to run at a frequency selected by the governor or higher,
unless in the turbo range.  This works similarly in both the HWP and
non-HWP cases, except that in the HWP case it is possible to adjust
the EPP (through the additional sysfs knob) and the base frequency is
exported (the latter two things can be used to distinguish between the
two cases just fine IMO).

> >> Some of the tests I do involve labour intensive post processing of data.
> >> I want to automate some of that work, and it will take time.
> >> We might be into the 5.9-rc series before I have detailed feedback.
> >>
> >> However, so far:
> >>
> >> Inverse impulse response test [1]:
> >>
> >> High level test, i5-9600K, HWP-passive (this patch), ondemand:
> >> 3101 tests. 0 failures. (GOOD)
> >>
> >> From [1], re-stated:
> >> > . High level: i5-9600K: 2453 tests, 60 failures, 2.45% fail rate. 
> >> > (HWP-active - powersave)
> >> > . Verify acpi-cpufreq/ondemand works fine: i5-9600K: 8975 tests. 0 
> >> > failures.
> >>
> >> My version of that cool Alexander named pipe test [2] serialized workflow:
> >>
> >> HWP-passive (this patch), performance: PASS.
> >>
> >> From [2], re-stated, and also re-tested.
> >> HWP-disabled passive - performance: FAIL.
> >
> > But I'm not quite sure how this is related to this patch?
>
> It isn't. The point being that it is different.

It is different, but kind of in a positive way IMO.

> But yes, that failure is because of our other discussion [3].

OK

> >
> > This test would still fail without the patch if the kernel was started
> > with intel_pstate=passive in the kernel command line, wouldn't it.
>
> Yes.

OK

Thanks!


Add support for the OST in Ingenic X1000.

2020-07-19 Thread Zhou Yanjie
v7->v8:
Revert the changes made in v7, remove the "default MACH_INGENIC"
in SYSOST, and modify the bool description in OST to make it
consistent with the style of TCU and SYSOST.

周琰杰 (Zhou Yanjie) (2):
  dt-bindings: timer: Add Ingenic X1000 OST bindings.
  clocksource: Ingenic: Add support for the Ingenic X1000 OST.

 .../devicetree/bindings/timer/ingenic,sysost.yaml  |  63 +++
 drivers/clocksource/Kconfig|  12 +-
 drivers/clocksource/Makefile   |   1 +
 drivers/clocksource/ingenic-sysost.c   | 539 +
 include/dt-bindings/clock/ingenic,sysost.h |  12 +
 5 files changed, 626 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/timer/ingenic,sysost.yaml
 create mode 100644 drivers/clocksource/ingenic-sysost.c
 create mode 100644 include/dt-bindings/clock/ingenic,sysost.h

-- 
2.11.0



[PATCH v8 1/2] dt-bindings: timer: Add Ingenic X1000 OST bindings.

2020-07-19 Thread Zhou Yanjie
Add the OST bindings for the X1 SoC from Ingenic.

Tested-by: 周正 (Zhou Zheng) 
Signed-off-by: 周琰杰 (Zhou Yanjie) 
Reviewed-by: Paul Cercueil 
Reviewed-by: Rob Herring 
---

Notes:
v1->v2:
No change.

v2->v3:
Fix wrong parameters in "clocks".

v3->v4:
1.Rename "ingenic,ost.yaml" to "ingenic,sysost.yaml".
2.Rename "ingenic,ost.h" to "ingenic,sysost.h".
3.Modify the description in "ingenic,sysost.yaml".

v4->v5:
No change.

v5->v6:
1.Drop "oneOf" and the blank line.
2.Add "additionalProperties: false".

v6->v7:
No change.

v7->v8:
No change.

 .../devicetree/bindings/timer/ingenic,sysost.yaml  | 63 ++
 include/dt-bindings/clock/ingenic,sysost.h | 12 +
 2 files changed, 75 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/timer/ingenic,sysost.yaml
 create mode 100644 include/dt-bindings/clock/ingenic,sysost.h

diff --git a/Documentation/devicetree/bindings/timer/ingenic,sysost.yaml 
b/Documentation/devicetree/bindings/timer/ingenic,sysost.yaml
new file mode 100644
index ..1dae2e538725
--- /dev/null
+++ b/Documentation/devicetree/bindings/timer/ingenic,sysost.yaml
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/timer/ingenic,sysost.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Bindings for SYSOST in Ingenic XBurst family SoCs
+
+maintainers:
+  - 周琰杰 (Zhou Yanjie) 
+
+description:
+  The SYSOST in an Ingenic SoC provides one 64bit timer for clocksource
+  and one or more 32bit timers for clockevent.
+
+properties:
+  "#size-cells":
+const: 1
+
+  compatible:
+enum:
+  - ingenic,x1000-ost
+  - ingenic,x2000-ost
+
+  reg:
+maxItems: 1
+
+  clocks:
+maxItems: 1
+
+  clock-names:
+const: ost
+
+  interrupts:
+maxItems: 1
+
+required:
+  - "#clock-cells"
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+#include 
+
+ost: timer@1200 {
+   compatible = "ingenic,x1000-ost";
+   reg = <0x1200 0x3c>;
+
+   #clock-cells = <1>;
+
+   clocks = <&cgu X1000_CLK_OST>;
+   clock-names = "ost";
+
+   interrupt-parent = <&cpuintc>;
+   interrupts = <3>;
+   };
+...
diff --git a/include/dt-bindings/clock/ingenic,sysost.h 
b/include/dt-bindings/clock/ingenic,sysost.h
new file mode 100644
index ..9ac88e90babf
--- /dev/null
+++ b/include/dt-bindings/clock/ingenic,sysost.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * This header provides clock numbers for the ingenic,tcu DT binding.
+ */
+
+#ifndef __DT_BINDINGS_CLOCK_INGENIC_OST_H__
+#define __DT_BINDINGS_CLOCK_INGENIC_OST_H__
+
+#define OST_CLK_PERCPU_TIMER   0
+#define OST_CLK_GLOBAL_TIMER   1
+
+#endif /* __DT_BINDINGS_CLOCK_INGENIC_OST_H__ */
-- 
2.11.0



[PATCH for v5.9] netfilter: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 include/uapi/linux/netfilter/xt_connmark.h | 2 +-
 net/decnet/netfilter/dn_rtmsg.c| 2 +-
 net/netfilter/Kconfig  | 2 +-
 net/netfilter/nfnetlink_acct.c | 2 +-
 net/netfilter/nft_set_pipapo.c | 4 ++--
 net/netfilter/xt_connmark.c| 2 +-
 net/netfilter/xt_nfacct.c  | 2 +-
 net/netfilter/xt_time.c| 2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/uapi/linux/netfilter/xt_connmark.h 
b/include/uapi/linux/netfilter/xt_connmark.h
index 1aa5c955ee1e..f01c19b83a2b 100644
--- a/include/uapi/linux/netfilter/xt_connmark.h
+++ b/include/uapi/linux/netfilter/xt_connmark.h
@@ -4,7 +4,7 @@
 
 #include 
 
-/* Copyright (C) 2002,2004 MARA Systems AB 
+/* Copyright (C) 2002,2004 MARA Systems AB 
  * by Henrik Nordstrom 
  *
  * This program is free software; you can redistribute it and/or modify
diff --git a/net/decnet/netfilter/dn_rtmsg.c b/net/decnet/netfilter/dn_rtmsg.c
index dc705769acc9..26a9193df783 100644
--- a/net/decnet/netfilter/dn_rtmsg.c
+++ b/net/decnet/netfilter/dn_rtmsg.c
@@ -6,7 +6,7 @@
  *
  *  DECnet Routing Message Grabulator
  *
- *  (C) 2000 ChyGwyn Limited  -  http://www.chygwyn.com/
+ *  (C) 2000 ChyGwyn Limited  -  https://www.chygwyn.com/
  *
  * Author:  Steven Whitehouse 
  */
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
index 0ffe2b8723c4..25313c29d799 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -447,7 +447,7 @@ config NF_TABLES
  replace the existing {ip,ip6,arp,eb}_tables infrastructure. It
  provides a pseudo-state machine with an extensible instruction-set
  (also known as expressions) that the userspace 'nft' utility
- (http://www.netfilter.org/projects/nftables) uses to build the
+ (https://www.netfilter.org/projects/nftables) uses to build the
  rule-set. It also comes with the generic set infrastructure that
  allows you to construct mappings between matchings and actions
  for performance lookups.
diff --git a/net/netfilter/nfnetlink_acct.c b/net/netfilter/nfnetlink_acct.c
index 5827117f2635..5bfec829c12f 100644
--- a/net/netfilter/nfnetlink_acct.c
+++ b/net/netfilter/nfnetlink_acct.c
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * (C) 2011 Pablo Neira Ayuso 
- * (C) 2011 Intra2net AG 
+ * (C) 2011 Intra2net AG 
  */
 #include 
 #include 
diff --git a/net/netfilter/nft_set_pipapo.c b/net/netfilter/nft_set_pipapo.c
index 8c04388296b0..78070aa65f62 100644
--- a/net/netfilter/nft_set_pipapo.c
+++ b/net/netfilter/nft_set_pipapo.c
@@ -312,7 +312,7 @@
  *  Jay Ligatti, Josh Kuhn, and Chris Gage.
  *  Proceedings of the IEEE International Conference on Computer
  *  Communication Networks (ICCCN), August 2010.
- *  http://www.cse.usf.edu/~ligatti/papers/grouper-conf.pdf
+ *  https://www.cse.usf.edu/~ligatti/papers/grouper-conf.pdf
  *
  * [Rottenstreich 2010]
  *  Worst-Case TCAM Rule Expansion
@@ -325,7 +325,7 @@
  *  Kirill Kogan, Sergey Nikolenko, Ori Rottenstreich, William Culhane,
  *  and Patrick Eugster.
  *  Proceedings of the 2014 ACM conference on SIGCOMM, August 2014.
- *  
http://www.sigcomm.org/sites/default/files/ccr/papers/2014/August/2619239-2626294.pdf
+ *  
https://www.sigcomm.org/sites/default/files/ccr/papers/2014/August/2619239-2626294.pdf
  */
 
 #include 
diff --git a/net/netfilter/xt_connmark.c b/net/netfilter/xt_connmark.c
index eec2f3a88d73..e5ebc0

[PATCH for v5.9] netfilter: xtables: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 net/netfilter/xt_CONNSECMARK.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/xt_CONNSECMARK.c b/net/netfilter/xt_CONNSECMARK.c
index a5c8b653476a..76acecf3e757 100644
--- a/net/netfilter/xt_CONNSECMARK.c
+++ b/net/netfilter/xt_CONNSECMARK.c
@@ -6,7 +6,7 @@
  * with the SECMARK target and state match.
  *
  * Based somewhat on CONNMARK:
- *   Copyright (C) 2002,2004 MARA Systems AB 
+ *   Copyright (C) 2002,2004 MARA Systems AB 
  *by Henrik Nordstrom 
  *
  * (C) 2006,2008 Red Hat, Inc., James Morris 
-- 
2.27.0



[PATCH 1/2] staging: rtl8192e: add space before open parenthesis

2020-07-19 Thread Darshan D V
rtllib_crypt_ccmp.c: 

Fix the coding style error by adding a space before
open parenthesis '(' in a conditional statement.

Signed-off-by: Darshan D V 
---
 drivers/staging/rtl8192e/rtllib_crypt_ccmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c 
b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
index 0cbf4a1a326b..b2af802b9451 100644
--- a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
+++ b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
@@ -278,7 +278,7 @@ static int rtllib_ccmp_decrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
int aad_len, ret;
 
req = aead_request_alloc(key->tfm, GFP_ATOMIC);
-   if(!req)
+   if (!req)
return -ENOMEM;
 
aad_len = ccmp_init_iv_and_aad(hdr, pn, iv, aad);
-- 
2.17.1



Re: [PATCH v2] smp: Fix a potential usage of stale nr_cpus

2020-07-19 Thread Thomas Gleixner
Muchun Song  writes:

> When the cmdline of "nr_cpus" is not valid, the @nr_cpu_ids is assigned
> a stale value. The nr_cpus is only valid when get_option() return 1. So
> check the return value to prevent this.
>
> Signed-off-by: Muchun Song 
> ---
> changelog in v2:
>  1) Rework the commit log.
>  2) Rework the return value check.

I asked:

>> So why fixing it just half and why returning '0' aka success if the
>> parameter is bogus?

And this still returns 0 if the parameter is bogus or malformatted

Thanks,

tglx


[PATCH 2/2] staging: rtl8192e: add proper code indent

2020-07-19 Thread Darshan D V
rtllib_crypt_ccmp.c:

As the code indent for a conditional statement is
not according to the preferred coding style for
the linux kernel, add code indent as necessary
after a conditional statement.

Signed-off-by: Darshan D V 
---
 drivers/staging/rtl8192e/rtllib_crypt_ccmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c 
b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
index b2af802b9451..b60e2a109ce4 100644
--- a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
+++ b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
@@ -337,7 +337,7 @@ static int rtllib_ccmp_set_key(void *key, int len, u8 *seq, 
void *priv)
}
if (crypto_aead_setauthsize(data->tfm, CCMP_MIC_LEN) ||
crypto_aead_setkey(data->tfm, data->key, CCMP_TK_LEN))
-   return -1;
+   return -1;
} else if (len == 0) {
data->key_set = 0;
} else {
-- 
2.17.1



[PATCH for v5.9] prism54: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 drivers/net/wireless/intersil/prism54/isl_oid.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intersil/prism54/isl_oid.h 
b/drivers/net/wireless/intersil/prism54/isl_oid.h
index 1afc2ccf94ca..b889bb73a485 100644
--- a/drivers/net/wireless/intersil/prism54/isl_oid.h
+++ b/drivers/net/wireless/intersil/prism54/isl_oid.h
@@ -143,7 +143,7 @@ enum dot11_priv_t {
  * together with a CSMA contention. Without this all frames are
  * sent with a CSMA contention.
  * Bibliography:
- * 
http://www.hpl.hp.com/personal/Jean_Tourrilhes/Papers/Packet.Frame.Grouping.html
+ * 
https://www.hpl.hp.com/personal/Jean_Tourrilhes/Papers/Packet.Frame.Grouping.html
  */
 enum dot11_maxframeburst_t {
/* Values for DOT11_OID_MAXFRAMEBURST */
-- 
2.27.0



Re: [PATCH v1 1/1] drm/bridge: nwl-dsi: Drop DRM_BRIDGE_ATTACH_NO_CONNECTOR check.

2020-07-19 Thread Sam Ravnborg
Hi Guido.

On Sat, Jul 18, 2020 at 08:26:37PM +0200, Guido Günther wrote:
> We don't create a connector but let panel_bridge handle that so there's
> no point in rejecting DRM_BRIDGE_ATTACH_NO_CONNECTOR.
> 
> Signed-off-by: Guido Günther 
Looks good and correct.
Reviewed-by: Sam Ravnborg 

If there is no other feedback I will apply within a few days.
Ping me if I forget it.

Sam

> ---
>  drivers/gpu/drm/bridge/nwl-dsi.c | 5 -
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c 
> b/drivers/gpu/drm/bridge/nwl-dsi.c
> index 77a79af70914..ce94f797d090 100644
> --- a/drivers/gpu/drm/bridge/nwl-dsi.c
> +++ b/drivers/gpu/drm/bridge/nwl-dsi.c
> @@ -918,11 +918,6 @@ static int nwl_dsi_bridge_attach(struct drm_bridge 
> *bridge,
>   struct drm_panel *panel;
>   int ret;
>  
> - if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
> - DRM_ERROR("Fix bridge driver to make connector optional!");
> - return -EINVAL;
> - }
> -
>   ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 1, 0, &panel,
> &panel_bridge);
>   if (ret)
> -- 
> 2.26.2
> 
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH for v5.9] sch_cake: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 net/sched/sch_cake.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
index ebaeec1e5c82..2f6c0daa2337 100644
--- a/net/sched/sch_cake.c
+++ b/net/sched/sch_cake.c
@@ -363,7 +363,7 @@ static const u8 bulk_order[] = {1, 0, 2, 3};
 #define REC_INV_SQRT_CACHE (16)
 static u32 cobalt_rec_inv_sqrt_cache[REC_INV_SQRT_CACHE] = {0};
 
-/* http://en.wikipedia.org/wiki/Methods_of_computing_square_roots
+/* https://en.wikipedia.org/wiki/Methods_of_computing_square_roots
  * new_invsqrt = (invsqrt / 2) * (3 - count * invsqrt^2)
  *
  * Here, invsqrt is a fixed point number (< 1.0), 32bit mantissa, aka Q0.32
-- 
2.27.0



Re: [PATCH 2/2] kvm: mmu: page_track: Fix RCU list API usage

2020-07-19 Thread Naresh Kamboju
On Sat, 18 Jul 2020 at 05:43, Paul E. McKenney  wrote:
>
> On Sat, Jul 18, 2020 at 12:35:12AM +0530, Naresh Kamboju wrote:
> > Hi Paul,
> >
> > > I am not seeing this here.
> >
> > Do you notice any warnings while building linux next master
> > for x86_64 architecture ?
>
> Idiot here was failing to enable building of KVM.  With that, I do see
> the error.  The patch resolves it for me.  Does it help for you?

yes.
The below patch applied on top of linux -next 20200717 tag
and build pass.

>
> Thanx, Paul
>
> 
>
> diff --git a/include/linux/rculist.h b/include/linux/rculist.h
> index de9385b..f8633d3 100644
> --- a/include/linux/rculist.h
> +++ b/include/linux/rculist.h
> @@ -73,7 +73,7 @@ static inline void INIT_LIST_HEAD_RCU(struct list_head 
> *list)
>  #define __list_check_rcu(dummy, cond, extra...)  
>   \
> ({ check_arg_count_one(extra); })
>
> -#define __list_check_srcu(cond) true
> +#define __list_check_srcu(cond) ({ })
>  #endif
>
>  /*

- Naresh


[PATCH] x86/perf: Fix a typo

2020-07-19 Thread Hu Haowen
The word "Zhoaxin" is incorrect and the right one is "Zhaoxin".

Signed-off-by: Hu Haowen 
---
 arch/x86/events/zhaoxin/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/events/zhaoxin/core.c b/arch/x86/events/zhaoxin/core.c
index 898fa1ae9ceb..e68827e604ad 100644
--- a/arch/x86/events/zhaoxin/core.c
+++ b/arch/x86/events/zhaoxin/core.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Zhoaxin PMU; like Intel Architectural PerfMon-v2
+ * Zhaoxin PMU; like Intel Architectural PerfMon-v2
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-- 
2.25.1




[PATCH for v5.9] staging: Replace HTTP links with HTTPS ones

2020-07-19 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 drivers/staging/clocking-wizard/dt-binding.txt | 2 +-
 drivers/staging/gs_fpgaboot/README | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/clocking-wizard/dt-binding.txt 
b/drivers/staging/clocking-wizard/dt-binding.txt
index 723271e93316..efb67ff9f76c 100644
--- a/drivers/staging/clocking-wizard/dt-binding.txt
+++ b/drivers/staging/clocking-wizard/dt-binding.txt
@@ -5,7 +5,7 @@ found in the product guide[2].
 
 [1] Documentation/devicetree/bindings/clock/clock-bindings.txt
 [2] Clocking Wizard Product Guide
-http://www.xilinx.com/support/documentation/ip_documentation/clk_wiz/v5_1/pg065-clk-wiz.pdf
+https://www.xilinx.com/support/documentation/ip_documentation/clk_wiz/v5_1/pg065-clk-wiz.pdf
 
 Required properties:
  - compatible: Must be 'xlnx,clocking-wizard'
diff --git a/drivers/staging/gs_fpgaboot/README 
b/drivers/staging/gs_fpgaboot/README
index 8d793c1769b0..b85a76849fc4 100644
--- a/drivers/staging/gs_fpgaboot/README
+++ b/drivers/staging/gs_fpgaboot/README
@@ -65,6 +65,6 @@ TABLE OF CONTENTS.
 6. REFERENCE
 
1. Xilinx APP NOTE XAPP583:
- 
http://www.xilinx.com/support/documentation/application_notes/xapp583-fpga-configuration.pdf
+ 
https://www.xilinx.com/support/documentation/application_notes/xapp583-fpga-configuration.pdf
2. bitstream file info:
  http://home.earthlink.net/~davesullins/software/bitinfo.html
-- 
2.27.0



[GIT PULL] perf/urgent improvements and fixes

2020-07-19 Thread Arnaldo Carvalho de Melo
Hi Linus,

Please consider pulling,

Best regards,

- Arnaldo

The following changes since commit 8882572675c1bb1cc544f4e229a11661f1fc52e4:

  Merge tag 'drm-fixes-2020-07-17-1' of git://anongit.freedesktop.org/drm/drm 
into master (2020-07-16 21:39:51 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git 
tags/perf-tools-fixes-2020-07-19

for you to fetch changes up to 25d4e7f513d4f8afcf81cb6f00edf1248b0ff8fc:

  tools arch kvm: Sync kvm headers with the kernel sources (2020-07-17 09:39:16 
-0300)


Third batch of perf tooling fixes for 5.8:

- Update hashmap.h from libbpf and kvm.h from x86's kernel UAPI,
  silencing build warnings.

- Set opt->set in libsubcmd's OPT_CALLBACK_SET(). Fixes
  'perf record --switch-output-event event-name' usage.

Signed-off-by: Arnaldo Carvalho de Melo 

Arnaldo Carvalho de Melo (2):
  perf tools: Sync hashmap.h with libbpf's
  tools arch kvm: Sync kvm headers with the kernel sources

Ravi Bangoria (1):
  libsubcmd: Fix OPT_CALLBACK_SET()

 tools/arch/x86/include/uapi/asm/kvm.h |  5 +++--
 tools/lib/subcmd/parse-options.c  |  3 +++
 tools/perf/util/hashmap.h | 12 
 3 files changed, 14 insertions(+), 6 deletions(-)

-- 
2.26.2


[GIT pull] irq/urgent for v5.8-rc6

2020-07-19 Thread Thomas Gleixner
Linus,

please pull the latest irq/urgent branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
irq-urgent-2020-07-19

up to:  baedb87d1b53: genirq/affinity: Handle affinity setting on inactive 
interrupts correctly

Two fixes for the interrupt subsystem:

 - Make the handling of the firmware node consistent and do not free the
   node after the domain has been created successfully. The core code
   stores a pointer to it which can lead to a use after free or double
   free.

   This used to "work" because the pointer was not stored when the initial
   code was written, but at some point later it was required to store
   it. Of course nobody noticed that the existing users break that way.

 - Handle affinity setting on inactive interrupts correctly when
   hierarchical irq domains are enabled. When interrupts are inactive with
   the modern hierarchical irqdomain design, the interrupt chips are not
   necessarily in a state where affinity changes can be handled. The legacy
   irq chip design allowed this because interrupts are immediately fully
   initialized at allocation time. X86 has a hacky workaround for this, but
   other implementations do not. This cased malfunction on GIC-V3. Instead
   of playing whack a mole to find all affected drivers, change the core
   code to store the requested affinity setting and then establish it when
   the interrupt is allocated, which makes the X86 hack go away.

Thanks,

tglx

-->
Thomas Gleixner (2):
  irqdomain/treewide: Keep firmware node unconditionally allocated
  genirq/affinity: Handle affinity setting on inactive interrupts correctly


 arch/mips/pci/pci-xtalk-bridge.c|  5 +++--
 arch/x86/kernel/apic/io_apic.c  | 10 +-
 arch/x86/kernel/apic/msi.c  | 18 --
 arch/x86/kernel/apic/vector.c   | 23 +--
 arch/x86/platform/uv/uv_irq.c   |  3 ++-
 drivers/iommu/amd/iommu.c   |  5 +++--
 drivers/iommu/hyperv-iommu.c|  5 -
 drivers/iommu/intel/irq_remapping.c |  2 +-
 drivers/mfd/ioc3.c  |  5 +++--
 drivers/pci/controller/vmd.c|  5 +++--
 kernel/irq/manage.c | 37 +++--
 11 files changed, 76 insertions(+), 42 deletions(-)

diff --git a/arch/mips/pci/pci-xtalk-bridge.c b/arch/mips/pci/pci-xtalk-bridge.c
index 3b2552fb7735..5958217861b8 100644
--- a/arch/mips/pci/pci-xtalk-bridge.c
+++ b/arch/mips/pci/pci-xtalk-bridge.c
@@ -627,9 +627,10 @@ static int bridge_probe(struct platform_device *pdev)
return -ENOMEM;
domain = irq_domain_create_hierarchy(parent, 0, 8, fn,
 &bridge_domain_ops, NULL);
-   irq_domain_free_fwnode(fn);
-   if (!domain)
+   if (!domain) {
+   irq_domain_free_fwnode(fn);
return -ENOMEM;
+   }
 
pci_set_flags(PCI_PROBE_ONLY);
 
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index ce61e3e7d399..81ffcfbfaef2 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2316,12 +2316,12 @@ static int mp_irqdomain_create(int ioapic)
ip->irqdomain = irq_domain_create_linear(fn, hwirqs, cfg->ops,
 (void *)(long)ioapic);
 
-   /* Release fw handle if it was allocated above */
-   if (!cfg->dev)
-   irq_domain_free_fwnode(fn);
-
-   if (!ip->irqdomain)
+   if (!ip->irqdomain) {
+   /* Release fw handle if it was allocated above */
+   if (!cfg->dev)
+   irq_domain_free_fwnode(fn);
return -ENOMEM;
+   }
 
ip->irqdomain->parent = parent;
 
diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/apic/msi.c
index 5cbaca58af95..c2b2911feeef 100644
--- a/arch/x86/kernel/apic/msi.c
+++ b/arch/x86/kernel/apic/msi.c
@@ -263,12 +263,13 @@ void __init arch_init_msi_domain(struct irq_domain 
*parent)
msi_default_domain =
pci_msi_create_irq_domain(fn, &pci_msi_domain_info,
  parent);
-   irq_domain_free_fwnode(fn);
}
-   if (!msi_default_domain)
+   if (!msi_default_domain) {
+   irq_domain_free_fwnode(fn);
pr_warn("failed to initialize irqdomain for MSI/MSI-x.\n");
-   else
+   } else {
msi_default_domain->flags |= IRQ_DOMAIN_MSI_NOMASK_QUIRK;
+   }
 }
 
 #ifdef CONFIG_IRQ_REMAP
@@ -301,7 +302,8 @@ struct irq_domain *arch_create_remap_msi_irq_domain(struct 
irq_domain *parent,
if (!fn)
return NULL;
d = pci_msi_create_irq_domain(fn, &pci_msi_ir_domain_info, parent);
-   irq_domain_free_fwnode(fn);
+   if (!d)
+   irq_domain_free_fwnode(fn);
return d;
 }
 #endif
@@ -364,7 +366,8 @@ static struct irq_domain *dmar_ge

[GIT pull] timers/urgent for v5.8-rc6

2020-07-19 Thread Thomas Gleixner
Linus,

please pull the latest timers/urgent branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
timers-urgent-2020-07-19

up to:  e2a71bdea816: timer: Fix wheel index calculation on last level

Two fixes for the timer wheel:

 - A timer which is already expired at enqueue time can set the
   base->next_expiry value backwards. As a consequence base->clk can be set
   back as well. This can lead to timers expiring early. Add a sanity check
   to prevent this.

 - When a timer is queued with an expiry time beyond the wheel capacity
   then it should be queued in the bucket of the last wheel level which is
   expiring last. The code adjusts expiry time to the maximum wheel
   capacity, which is only correct when the wheel clock is 0. Aside of that
   the check whether the delta is larger than wheel capacity does not check
   the delta, it checks the expiry value itself. As a result timers can
   expire at random.

   Fix this by checking the right variable and adjust expiry time so it
   becomes base->clock plus capacity which places it into the outmost
   bucket in the last wheel level.

Thanks,

tglx

-->
Frederic Weisbecker (2):
  timer: Prevent base->clk from moving backward
  timer: Fix wheel index calculation on last level


 kernel/time/timer.c | 21 -
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index 398e6eadb861..df1ff803acc4 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -521,8 +521,8 @@ static int calc_wheel_index(unsigned long expires, unsigned 
long clk)
 * Force expire obscene large timeouts to expire at the
 * capacity limit of the wheel.
 */
-   if (expires >= WHEEL_TIMEOUT_CUTOFF)
-   expires = WHEEL_TIMEOUT_MAX;
+   if (delta >= WHEEL_TIMEOUT_CUTOFF)
+   expires = clk + WHEEL_TIMEOUT_MAX;
 
idx = calc_index(expires, LVL_DEPTH - 1);
}
@@ -584,7 +584,15 @@ trigger_dyntick_cpu(struct timer_base *base, struct 
timer_list *timer)
 * Set the next expiry time and kick the CPU so it can reevaluate the
 * wheel:
 */
-   base->next_expiry = timer->expires;
+   if (time_before(timer->expires, base->clk)) {
+   /*
+* Prevent from forward_timer_base() moving the base->clk
+* backward
+*/
+   base->next_expiry = base->clk;
+   } else {
+   base->next_expiry = timer->expires;
+   }
wake_up_nohz_cpu(base->cpu);
 }
 
@@ -896,10 +904,13 @@ static inline void forward_timer_base(struct timer_base 
*base)
 * If the next expiry value is > jiffies, then we fast forward to
 * jiffies otherwise we forward to the next expiry value.
 */
-   if (time_after(base->next_expiry, jnow))
+   if (time_after(base->next_expiry, jnow)) {
base->clk = jnow;
-   else
+   } else {
+   if (WARN_ON_ONCE(time_before(base->next_expiry, base->clk)))
+   return;
base->clk = base->next_expiry;
+   }
 #endif
 }
 



[GIT pull] x86/urgent for v5.8-rc6

2020-07-19 Thread Thomas Gleixner
Linus,

please pull the latest x86/urgent branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
x86-urgent-2020-07-19

up to:  da05b143a308: x86/boot: Don't add the EFI stub to targets

A pile of fixes for x86:

 - Fix the I/O bitmap invalidation on XEN PV, which was overlooked in the
   recent ioperm/iopl rework. This caused the TSS and XEN's I/O bitmap to
   get out of sync.

 - Use the proper vectors for HYPERV.

 - Make disabling of stack protector for the entry code work with GCC
   builds which enable stack protector by default. Removing the option is
   not sufficient, it needs an explicit -fno-stack-protector to shut it
   off.

 - Mark check_user_regs() noinstr as it is called from noinstr code. The
   missing annotation causes it to be placed in the text section which
   makes it instrumentable.

 - Add the missing interrupt disable in exc_alignment_check()
 
 - Fixup a XEN_PV build dependency in the 32bit entry code

 - A few fixes to make the Clang integrated assembler happy

 - Move EFI stub build to the right place for out of tree builds

 - Make prepare_exit_to_usermode() static. It's not longer called from ASM
   code.
Thanks,

tglx

-->
Andy Lutomirski (1):
  x86/ioperm: Fix io bitmap invalidation on Xen PV

Arnd Bergmann (1):
  x86: math-emu: Fix up 'cmp' insn for clang ias

Arvind Sankar (1):
  x86/boot: Don't add the EFI stub to targets

Ingo Molnar (1):
  x86/entry/32: Fix XEN_PV build dependency

Jian Cai (1):
  x86/entry: Add compatibility with IAS

Kees Cook (1):
  x86/entry: Actually disable stack protector

Sedat Dilek (1):
  x86/entry: Fix vectors to IDTENTRY_SYSVEC for CONFIG_HYPERV

Thomas Gleixner (3):
  x86/traps: Disable interrupts in exc_aligment_check()
  x86/entry: Mark check_user_regs() noinstr
  x86/entry/common: Make prepare_exit_to_usermode() static


 arch/x86/boot/compressed/Makefile |  4 ++--
 arch/x86/entry/Makefile   | 14 +++---
 arch/x86/entry/common.c   |  4 ++--
 arch/x86/include/asm/idtentry.h   | 22 ++
 arch/x86/include/asm/io_bitmap.h  | 16 
 arch/x86/include/asm/paravirt.h   |  5 +
 arch/x86/include/asm/paravirt_types.h |  1 +
 arch/x86/kernel/paravirt.c|  3 ++-
 arch/x86/kernel/process.c | 18 ++
 arch/x86/kernel/traps.c   |  2 ++
 arch/x86/math-emu/wm_sqrt.S   |  2 +-
 arch/x86/xen/enlighten_pv.c   | 12 
 12 files changed, 66 insertions(+), 37 deletions(-)

diff --git a/arch/x86/boot/compressed/Makefile 
b/arch/x86/boot/compressed/Makefile
index 7619742f91c9..5a828fde7a42 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -90,8 +90,8 @@ endif
 
 vmlinux-objs-$(CONFIG_ACPI) += $(obj)/acpi.o
 
-vmlinux-objs-$(CONFIG_EFI_STUB) += 
$(objtree)/drivers/firmware/efi/libstub/lib.a
 vmlinux-objs-$(CONFIG_EFI_MIXED) += $(obj)/efi_thunk_$(BITS).o
+efi-obj-$(CONFIG_EFI_STUB) = $(objtree)/drivers/firmware/efi/libstub/lib.a
 
 # The compressed kernel is built with -fPIC/-fPIE so that a boot loader
 # can place it anywhere in memory and it will still run. However, since
@@ -115,7 +115,7 @@ endef
 quiet_cmd_check-and-link-vmlinux = LD  $@
   cmd_check-and-link-vmlinux = $(cmd_check_data_rel); $(cmd_ld)
 
-$(obj)/vmlinux: $(vmlinux-objs-y) FORCE
+$(obj)/vmlinux: $(vmlinux-objs-y) $(efi-obj-y) FORCE
$(call if_changed,check-and-link-vmlinux)
 
 OBJCOPYFLAGS_vmlinux.bin :=  -R .comment -S
diff --git a/arch/x86/entry/Makefile b/arch/x86/entry/Makefile
index b7a5790d8d63..08bf95dbc911 100644
--- a/arch/x86/entry/Makefile
+++ b/arch/x86/entry/Makefile
@@ -7,12 +7,20 @@ KASAN_SANITIZE := n
 UBSAN_SANITIZE := n
 KCOV_INSTRUMENT := n
 
-CFLAGS_REMOVE_common.o = $(CC_FLAGS_FTRACE) -fstack-protector 
-fstack-protector-strong
-CFLAGS_REMOVE_syscall_32.o = $(CC_FLAGS_FTRACE) -fstack-protector 
-fstack-protector-strong
-CFLAGS_REMOVE_syscall_64.o = $(CC_FLAGS_FTRACE) -fstack-protector 
-fstack-protector-strong
+CFLAGS_REMOVE_common.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_syscall_64.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_syscall_32.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_syscall_x32.o= $(CC_FLAGS_FTRACE)
+
+CFLAGS_common.o+= -fno-stack-protector
+CFLAGS_syscall_64.o+= -fno-stack-protector
+CFLAGS_syscall_32.o+= -fno-stack-protector
+CFLAGS_syscall_x32.o   += -fno-stack-protector
 
 CFLAGS_syscall_64.o+= $(call cc-option,-Wno-override-init,)
 CFLAGS_syscall_32.o+= $(call cc-option,-Wno-override-init,)
+CFLAGS_syscall_x32.o   += $(call cc-option,-Wno-override-init,)
+
 obj-y  := entry_$(BITS).o thunk_$(BITS).o 
syscall_$(BITS).o
 obj-y  += common.o
 
diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
index e83b3f14897c..f0928

[GIT pull] sched/urgent for v5.8-rc6

2020-07-19 Thread Thomas Gleixner
Linus,

please pull the latest sched/urgent branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
sched-urgent-2020-07-19

up to:  01cfcde9c26d: sched/fair: handle case of task_h_load() returning 0

A set of scheduler fixes:

 - Plug a load average accounting race which was introduced with a recent
   optimization casing load average to show bogus numbers.

 - Fix the rseq CPU id initialization for new tasks. sched_fork() does not
   update the rseq CPU id so the id is the stale id of the parent task,
   which can cause user space data corruption.

 - Handle a 0 return value of task_h_load() correctly in the load balancer,
   which does not decrease imbalance and therefore pulls until the maximum
   number of loops is reached, which might be all tasks just created by a
   fork bomb.

Thanks,

tglx

-->
Mathieu Desnoyers (1):
  sched: Fix unreliable rseq cpu_id for new tasks

Peter Zijlstra (1):
  sched: Fix loadavg accounting race

Vincent Guittot (1):
  sched/fair: handle case of task_h_load() returning 0


 include/linux/sched.h |  4 ---
 kernel/sched/core.c   | 69 +++
 kernel/sched/fair.c   | 15 +--
 3 files changed, 66 insertions(+), 22 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 692e327d7455..683372943093 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -114,10 +114,6 @@ struct task_group;
 
 #define task_is_stopped_or_traced(task)((task->state & (__TASK_STOPPED 
| __TASK_TRACED)) != 0)
 
-#define task_contributes_to_load(task) ((task->state & TASK_UNINTERRUPTIBLE) 
!= 0 && \
-(task->flags & PF_FROZEN) == 0 && \
-(task->state & TASK_NOLOAD) == 0)
-
 #ifdef CONFIG_DEBUG_ATOMIC_SLEEP
 
 /*
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index ca5db40392d4..e15543cb8481 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1311,9 +1311,6 @@ static inline void dequeue_task(struct rq *rq, struct 
task_struct *p, int flags)
 
 void activate_task(struct rq *rq, struct task_struct *p, int flags)
 {
-   if (task_contributes_to_load(p))
-   rq->nr_uninterruptible--;
-
enqueue_task(rq, p, flags);
 
p->on_rq = TASK_ON_RQ_QUEUED;
@@ -1323,9 +1320,6 @@ void deactivate_task(struct rq *rq, struct task_struct 
*p, int flags)
 {
p->on_rq = (flags & DEQUEUE_SLEEP) ? 0 : TASK_ON_RQ_MIGRATING;
 
-   if (task_contributes_to_load(p))
-   rq->nr_uninterruptible++;
-
dequeue_task(rq, p, flags);
 }
 
@@ -2236,10 +2230,10 @@ ttwu_do_activate(struct rq *rq, struct task_struct *p, 
int wake_flags,
 
lockdep_assert_held(&rq->lock);
 
-#ifdef CONFIG_SMP
if (p->sched_contributes_to_load)
rq->nr_uninterruptible--;
 
+#ifdef CONFIG_SMP
if (wake_flags & WF_MIGRATED)
en_flags |= ENQUEUE_MIGRATED;
 #endif
@@ -2583,7 +2577,7 @@ try_to_wake_up(struct task_struct *p, unsigned int state, 
int wake_flags)
 * A similar smb_rmb() lives in try_invoke_on_locked_down_task().
 */
smp_rmb();
-   if (p->on_rq && ttwu_remote(p, wake_flags))
+   if (READ_ONCE(p->on_rq) && ttwu_remote(p, wake_flags))
goto unlock;
 
if (p->in_iowait) {
@@ -2592,9 +2586,6 @@ try_to_wake_up(struct task_struct *p, unsigned int state, 
int wake_flags)
}
 
 #ifdef CONFIG_SMP
-   p->sched_contributes_to_load = !!task_contributes_to_load(p);
-   p->state = TASK_WAKING;
-
/*
 * Ensure we load p->on_cpu _after_ p->on_rq, otherwise it would be
 * possible to, falsely, observe p->on_cpu == 0.
@@ -2613,8 +2604,20 @@ try_to_wake_up(struct task_struct *p, unsigned int 
state, int wake_flags)
 *
 * Pairs with the LOCK+smp_mb__after_spinlock() on rq->lock in
 * __schedule().  See the comment for smp_mb__after_spinlock().
+*
+* Form a control-dep-acquire with p->on_rq == 0 above, to ensure
+* schedule()'s deactivate_task() has 'happened' and p will no longer
+* care about it's own p->state. See the comment in __schedule().
 */
-   smp_rmb();
+   smp_acquire__after_ctrl_dep();
+
+   /*
+* We're doing the wakeup (@success == 1), they did a dequeue (p->on_rq
+* == 0), which means we need to do an enqueue, change p->state to
+* TASK_WAKING such that we can unlock p->pi_lock before doing the
+* enqueue, such as ttwu_queue_wakelist().
+*/
+   p->state = TASK_WAKING;
 
/*
 * If the owning (remote) CPU is still in the middle of schedule() with
@@ -2962,6 +2965,7 @@ int sched_fork(unsigned long clone_flags, struct 
task_struct *p)
 * Silence PROVE_RCU.
 */
raw_spin_lock_irqsave(&p->pi_lock, flags);
+   rseq_migrate(p);
/*
 * We're setting the 

[PATCH v2] pinctrl: core: print gpio in pins debugfs file

2020-07-19 Thread Drew Fustini
If there is a gpio range mapping for the pin, then print out the gpio
number for the pin in the debugfs 'pins' file.

Here is an example output on the BeagleBone Black from:
/sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single/pins

pin 103 (PIN103) GPIO-113 44e1099c 0027 pinctrl-single
pin 104 (PIN104) GPIO-114 44e109a0 002c pinctrl-single
pin 105 (PIN105) GPIO-115 44e109a4 0027 pinctrl-single
pin 106 (PIN106) GPIO-116 44e109a8 0027 pinctrl-single
pin 107 (PIN107) GPIO-117 44e109ac 0027 pinctrl-single
pin 108 (PIN108) GPIO-19 44e109b0 0027 pinctrl-single
pin 109 (PIN109) GPIO-20 44e109b4 0027 pinctrl-single
pin 110 (PIN110) NA 44e109b8 0030 pinctrl-single
pin 111 (PIN111) NA 44e109bc 0028 pinctrl-single
pin 112 (PIN112) NA 44e109c0 0030 pinctrl-single
pin 113 (PIN113) NA 44e109c4 0028 pinctrl-single
pin 114 (PIN114) NA 44e109c8 0028 pinctrl-single

Suggested-by: Andy Shevchenko 
Suggested-by: Tony Lindgren 
Signed-off-by: Drew Fustini 
---
 drivers/pinctrl/core.c | 14 ++
 1 file changed, 14 insertions(+)

v2 changes:
- print 'NA' if pin does not have a GPIO number
- change gpio_num from unsigned to unsigned int per checkpatch

diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 821242bb4b16..8478025926a2 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -1601,6 +1601,8 @@ static int pinctrl_pins_show(struct seq_file *s, void 
*what)
struct pinctrl_dev *pctldev = s->private;
const struct pinctrl_ops *ops = pctldev->desc->pctlops;
unsigned i, pin;
+   struct pinctrl_gpio_range *range;
+   unsigned int gpio_num;
 
seq_printf(s, "registered pins: %d\n", pctldev->desc->npins);
 
@@ -1618,6 +1620,18 @@ static int pinctrl_pins_show(struct seq_file *s, void 
*what)
 
seq_printf(s, "pin %d (%s) ", pin, desc->name);
 
+   gpio_num = 0;
+   list_for_each_entry(range, &pctldev->gpio_ranges, node) {
+   if ((pin >= range->pin_base) &&
+   (pin < (range->pin_base + range->npins)))
+   gpio_num = range->base + (pin - 
range->pin_base);
+   }
+
+   if (gpio_num > 0)
+   seq_printf(s, "GPIO-%u ", gpio_num);
+   else
+   seq_puts(s, "NA ");
+
/* Driver-specific info per pin */
if (ops->pin_dbg_show)
ops->pin_dbg_show(pctldev, s, pin);
-- 
2.25.1



Re: [PATCH v2] pinctrl: core: print gpio in pins debugfs file

2020-07-19 Thread Drew Fustini
On Sun, Jul 19, 2020 at 03:22:01PM +0200, Drew Fustini wrote:
> If there is a gpio range mapping for the pin, then print out the gpio
> number for the pin in the debugfs 'pins' file.
> 
> Here is an example output on the BeagleBone Black from:
> /sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single/pins
> 
> pin 103 (PIN103) GPIO-113 44e1099c 0027 pinctrl-single
> pin 104 (PIN104) GPIO-114 44e109a0 002c pinctrl-single
> pin 105 (PIN105) GPIO-115 44e109a4 0027 pinctrl-single
> pin 106 (PIN106) GPIO-116 44e109a8 0027 pinctrl-single
> pin 107 (PIN107) GPIO-117 44e109ac 0027 pinctrl-single
> pin 108 (PIN108) GPIO-19 44e109b0 0027 pinctrl-single
> pin 109 (PIN109) GPIO-20 44e109b4 0027 pinctrl-single
> pin 110 (PIN110) NA 44e109b8 0030 pinctrl-single
> pin 111 (PIN111) NA 44e109bc 0028 pinctrl-single
> pin 112 (PIN112) NA 44e109c0 0030 pinctrl-single
> pin 113 (PIN113) NA 44e109c4 0028 pinctrl-single
> pin 114 (PIN114) NA 44e109c8 0028 pinctrl-single
> 
> Suggested-by: Andy Shevchenko 
> Suggested-by: Tony Lindgren 
> Signed-off-by: Drew Fustini 
> ---
>  drivers/pinctrl/core.c | 14 ++
>  1 file changed, 14 insertions(+)
> 
> v2 changes:
> - print 'NA' if pin does not have a GPIO number
> - change gpio_num from unsigned to unsigned int per checkpatch
> 
> diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
> index 821242bb4b16..8478025926a2 100644
> --- a/drivers/pinctrl/core.c
> +++ b/drivers/pinctrl/core.c
> @@ -1601,6 +1601,8 @@ static int pinctrl_pins_show(struct seq_file *s, void 
> *what)
>   struct pinctrl_dev *pctldev = s->private;
>   const struct pinctrl_ops *ops = pctldev->desc->pctlops;
>   unsigned i, pin;
> + struct pinctrl_gpio_range *range;
> + unsigned int gpio_num;
>  
>   seq_printf(s, "registered pins: %d\n", pctldev->desc->npins);
>  
> @@ -1618,6 +1620,18 @@ static int pinctrl_pins_show(struct seq_file *s, void 
> *what)
>  
>   seq_printf(s, "pin %d (%s) ", pin, desc->name);
>  
> + gpio_num = 0;
> + list_for_each_entry(range, &pctldev->gpio_ranges, node) {
> + if ((pin >= range->pin_base) &&
> + (pin < (range->pin_base + range->npins)))
> + gpio_num = range->base + (pin - 
> range->pin_base);
> + }
> +
> + if (gpio_num > 0)
> + seq_printf(s, "GPIO-%u ", gpio_num);
> + else
> + seq_puts(s, "NA ");
> +
>   /* Driver-specific info per pin */
>   if (ops->pin_dbg_show)
>   ops->pin_dbg_show(pctldev, s, pin);
> -- 
> 2.25.1
> 

Linus - would it better if I printed the gpio chip and line number
instead of the GPIO number?

If so, any advice on how to best convert the gpio number to the gpio
descriptor inside pinctrl_pins_show()?

Thanks,
Drew


Re: [PATCHv4 2/4] watchdog: add support for adjusting last known HW keepalive time

2020-07-19 Thread Guenter Roeck
On 7/17/20 6:29 AM, Tero Kristo wrote:
> Certain watchdogs require the watchdog only to be pinged within a
> specific time window, pinging too early or too late cause the watchdog
> to fire. In cases where this sort of watchdog has been started before
> kernel comes up, we must adjust the watchdog keepalive window to match
> the actually running timer, so add a new driver API for this purpose.
> 
> Signed-off-by: Tero Kristo 

Reviewed-by: Guenter Roeck 

> ---
>  .../watchdog/watchdog-kernel-api.rst  | 12 
>  drivers/watchdog/watchdog_dev.c   | 30 +++
>  include/linux/watchdog.h  |  2 ++
>  3 files changed, 44 insertions(+)
> 
> diff --git a/Documentation/watchdog/watchdog-kernel-api.rst 
> b/Documentation/watchdog/watchdog-kernel-api.rst
> index 068a55ee0d4a..baf44e986b07 100644
> --- a/Documentation/watchdog/watchdog-kernel-api.rst
> +++ b/Documentation/watchdog/watchdog-kernel-api.rst
> @@ -336,3 +336,15 @@ an action is taken by a preconfigured pretimeout 
> governor preassigned to
>  the watchdog device. If watchdog pretimeout governor framework is not
>  enabled, watchdog_notify_pretimeout() prints a notification message to
>  the kernel log buffer.
> +
> +To set the last known HW keepalive time for a watchdog, the following 
> function
> +should be used::
> +
> +  int watchdog_set_last_hw_keepalive(struct watchdog_device *wdd,
> + unsigned int last_ping_ms)
> +
> +This function must be called immediately after watchdog registration. It
> +sets the last known hardware heartbeat to have happened last_ping_ms before
> +current time. Calling this is only needed if the watchdog is already running
> +when probe is called, and the watchdog can only be pinged after the
> +min_hw_heartbeat_ms time has passed from the last ping.
> diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c
> index bc1cfa288553..e74a0c6811b5 100644
> --- a/drivers/watchdog/watchdog_dev.c
> +++ b/drivers/watchdog/watchdog_dev.c
> @@ -1138,6 +1138,36 @@ void watchdog_dev_unregister(struct watchdog_device 
> *wdd)
>   watchdog_cdev_unregister(wdd);
>  }
>  
> +/*
> + *   watchdog_set_last_hw_keepalive: set last HW keepalive time for watchdog
> + *   @wdd: watchdog device
> + *   @last_ping_ms: time since last HW heartbeat
> + *
> + *   Adjusts the last known HW keepalive time for a watchdog timer.
> + *   This is needed if the watchdog is already running when the probe
> + *   function is called, and it can't be pinged immediately. This
> + *   function must be called immediately after watchdog registration,
> + *   and min_hw_heartbeat_ms must be set for this to be useful.
> + */
> +int watchdog_set_last_hw_keepalive(struct watchdog_device *wdd,
> +unsigned int last_ping_ms)
> +{
> + struct watchdog_core_data *wd_data;
> + ktime_t now;
> +
> + if (!wdd)
> + return -EINVAL;
> +
> + wd_data = wdd->wd_data;
> +
> + now = ktime_get();
> +
> + wd_data->last_hw_keepalive = ktime_sub(now, ms_to_ktime(last_ping_ms));
> +
> + return __watchdog_ping(wdd);
> +}
> +EXPORT_SYMBOL_GPL(watchdog_set_last_hw_keepalive);
> +
>  /*
>   *   watchdog_dev_init: init dev part of watchdog core
>   *
> diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
> index 1464ce6ffa31..9b19e6bb68b5 100644
> --- a/include/linux/watchdog.h
> +++ b/include/linux/watchdog.h
> @@ -210,6 +210,8 @@ extern int watchdog_init_timeout(struct watchdog_device 
> *wdd,
>  extern int watchdog_register_device(struct watchdog_device *);
>  extern void watchdog_unregister_device(struct watchdog_device *);
>  
> +int watchdog_set_last_hw_keepalive(struct watchdog_device *, unsigned int);
> +
>  /* devres register variant */
>  int devm_watchdog_register_device(struct device *dev, struct watchdog_device 
> *);
>  
> 



Re: [PATCHv4 3/4] watchdog: rti-wdt: attach to running watchdog during probe

2020-07-19 Thread Guenter Roeck
On 7/17/20 6:29 AM, Tero Kristo wrote:
> If the RTI watchdog is running already during probe, the driver must
> configure itself to match the HW. Window size and timeout is probed from
> hardware, and the last keepalive ping is adjusted to match it also.
> 
> Signed-off-by: Tero Kristo 

Reviewed-by: Guenter Roeck 

> ---
>  drivers/watchdog/rti_wdt.c | 112 +
>  1 file changed, 102 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/watchdog/rti_wdt.c b/drivers/watchdog/rti_wdt.c
> index d456dd72d99a..7cbdc178ffe8 100644
> --- a/drivers/watchdog/rti_wdt.c
> +++ b/drivers/watchdog/rti_wdt.c
> @@ -35,7 +35,11 @@
>  
>  #define RTIWWDRX_NMI 0xa
>  
> -#define RTIWWDSIZE_50P   0x50
> +#define RTIWWDSIZE_50P   0x50
> +#define RTIWWDSIZE_25P   0x500
> +#define RTIWWDSIZE_12P5  0x5000
> +#define RTIWWDSIZE_6P25  0x5
> +#define RTIWWDSIZE_3P125 0x50
>  
>  #define WDENABLE_KEY 0xa98559da
>  
> @@ -48,7 +52,7 @@
>  
>  #define DWDSTBIT(1)
>  
> -static int heartbeat;
> +static int heartbeat = DEFAULT_HEARTBEAT;
>  
>  /*
>   * struct to hold data for each WDT device
> @@ -79,11 +83,9 @@ static int rti_wdt_start(struct watchdog_device *wdd)
>* be petted during the open window; not too early or not too late.
>* The HW configuration options only allow for the open window size
>* to be 50% or less than that; we obviouly want to configure the open
> -  * window as large as possible so we select the 50% option. To avoid
> -  * any glitches, we accommodate 5% safety margin also, so we setup
> -  * the min_hw_hearbeat at 55% of the timeout period.
> +  * window as large as possible so we select the 50% option.
>*/
> - wdd->min_hw_heartbeat_ms = 11 * wdd->timeout * 1000 / 20;
> + wdd->min_hw_heartbeat_ms = 500 * wdd->timeout;
>  
>   /* Generate NMI when wdt expires */
>   writel_relaxed(RTIWWDRX_NMI, wdt->base + RTIWWDRXCTRL);
> @@ -110,7 +112,48 @@ static int rti_wdt_ping(struct watchdog_device *wdd)
>   return 0;
>  }
>  
> -static unsigned int rti_wdt_get_timeleft(struct watchdog_device *wdd)
> +static int rti_wdt_setup_hw_hb(struct watchdog_device *wdd, u32 wsize)
> +{
> + /*
> +  * RTI only supports a windowed mode, where the watchdog can only
> +  * be petted during the open window; not too early or not too late.
> +  * The HW configuration options only allow for the open window size
> +  * to be 50% or less than that.
> +  */
> + switch (wsize) {
> + case RTIWWDSIZE_50P:
> + /* 50% open window => 50% min heartbeat */
> + wdd->min_hw_heartbeat_ms = 500 * heartbeat;
> + break;
> +
> + case RTIWWDSIZE_25P:
> + /* 25% open window => 75% min heartbeat */
> + wdd->min_hw_heartbeat_ms = 750 * heartbeat;
> + break;
> +
> + case RTIWWDSIZE_12P5:
> + /* 12.5% open window => 87.5% min heartbeat */
> + wdd->min_hw_heartbeat_ms = 875 * heartbeat;
> + break;
> +
> + case RTIWWDSIZE_6P25:
> + /* 6.5% open window => 93.5% min heartbeat */
> + wdd->min_hw_heartbeat_ms = 935 * heartbeat;
> + break;
> +
> + case RTIWWDSIZE_3P125:
> + /* 3.125% open window => 96.9% min heartbeat */
> + wdd->min_hw_heartbeat_ms = 969 * heartbeat;
> + break;
> +
> + default:
> + return -EINVAL;
> + }
> +
> + return 0;
> +}
> +
> +static unsigned int rti_wdt_get_timeleft_ms(struct watchdog_device *wdd)
>  {
>   u64 timer_counter;
>   u32 val;
> @@ -123,11 +166,18 @@ static unsigned int rti_wdt_get_timeleft(struct 
> watchdog_device *wdd)
>  
>   timer_counter = readl_relaxed(wdt->base + RTIDWDCNTR);
>  
> + timer_counter *= 1000;
> +
>   do_div(timer_counter, wdt->freq);
>  
>   return timer_counter;
>  }
>  
> +static unsigned int rti_wdt_get_timeleft(struct watchdog_device *wdd)
> +{
> + return rti_wdt_get_timeleft_ms(wdd) / 1000;
> +}
> +
>  static const struct watchdog_info rti_wdt_info = {
>   .options = WDIOF_KEEPALIVEPING,
>   .identity = "K3 RTI Watchdog",
> @@ -148,6 +198,7 @@ static int rti_wdt_probe(struct platform_device *pdev)
>   struct watchdog_device *wdd;
>   struct rti_wdt_device *wdt;
>   struct clk *clk;
> + u32 last_ping = 0;
>  
>   wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL);
>   if (!wdt)
> @@ -169,6 +220,14 @@ static int rti_wdt_probe(struct platform_device *pdev)
>   return -EINVAL;
>   }
>  
> + /*
> +  * If watchdog is running at 32k clock, it is not accurate.
> +  * Adjust frequency down in this case so that we don't pet
> +  * the watchdog too often.
> +  */
> + if (wdt->freq < 32768)
> + wdt->freq = wdt->freq * 9 / 10;
> +
>   pm_runtime_enable(dev);
>   ret = 

Re: [PATCH 16/20] dt-bindings: watchdog: renesas,wdt: Document r8a774e1 support

2020-07-19 Thread Guenter Roeck
On Wed, Jul 15, 2020 at 12:09:06PM +0100, Lad Prabhakar wrote:
> RZ/G2H (a.k.a. R8A774E1) watchdog implementation is compatible
> with R-Car Gen3, therefore add the relevant documentation.
> 
> Signed-off-by: Lad Prabhakar 
> Reviewed-by: Geert Uytterhoeven 

Reviewed-by: Guenter Roeck 

> ---
>  Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml 
> b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> index 572f4c912fef..6933005b52bd 100644
> --- a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> +++ b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> @@ -41,6 +41,7 @@ properties:
>- renesas,r8a774a1-wdt # RZ/G2M
>- renesas,r8a774b1-wdt # RZ/G2N
>- renesas,r8a774c0-wdt # RZ/G2E
> +  - renesas,r8a774e1-wdt # RZ/G2H
>- renesas,r8a7795-wdt  # R-Car H3
>- renesas,r8a7796-wdt  # R-Car M3-W
>- renesas,r8a77961-wdt # R-Car M3-W+


Re: [PATCH] userfaultfd: avoid the duplicated release for userfaultfd_ctx

2020-07-19 Thread Xu, Yanfei

ping Al Viro

Could you please help to review this patch? Thanks a lot.

Yanfei

On 7/15/20 12:12 AM, yanfei...@windriver.com wrote:

From: Yanfei Xu 

when get_unused_fd_flags gets failure, userfaultfd_ctx_cachep will
be freed by userfaultfd_fops's release function which is the
userfaultfd_release. So we could return directly after fput().

userfaultfd_release()->userfaultfd_ctx_put(ctx)

Fixes: d08ac70b1e0d (Wire UFFD up to SELinux)
Reported-by: syzbot+75867c44841cb6373...@syzkaller.appspotmail.com
Signed-off-by: Yanfei Xu 
---
  fs/userfaultfd.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
index 3a4d6ac5a81a..e98317c15530 100644
--- a/fs/userfaultfd.c
+++ b/fs/userfaultfd.c
@@ -2049,7 +2049,7 @@ SYSCALL_DEFINE1(userfaultfd, int, flags)
fd = get_unused_fd_flags(O_RDONLY | O_CLOEXEC);
if (fd < 0) {
fput(file);
-   goto out;
+   return fd;
}
  
  	ctx->owner = file_inode(file);




Re: [PATCH] watchdog: Replace HTTP links with HTTPS ones

2020-07-19 Thread Guenter Roeck
On Mon, Jul 13, 2020 at 10:58:21PM +0200, Alexander A. Klimov wrote:
> Rationale:
> Reduces attack surface on kernel devs opening the links for MITM
> as HTTPS traffic is much harder to manipulate.
> 
> Deterministic algorithm:
> For each file:
>   If not .svg:
> For each line:
>   If doesn't contain `\bxmlns\b`:
> For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
> If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
> If both the HTTP and HTTPS versions
> return 200 OK and serve the same content:
>   Replace HTTP with HTTPS.
> 
> Signed-off-by: Alexander A. Klimov 

Reviewed-by: Guenter Roeck 

> ---
>  Continuing my work started at 93431e0607e5.
>  See also: git log --oneline '--author=Alexander A. Klimov 
> ' v5.7..master
>  (Actually letting a shell for loop submit all this stuff for me.)
> 
>  If there are any URLs to be removed completely or at least not just 
> HTTPSified:
>  Just clearly say so and I'll *undo my change*.
>  See also: https://lkml.org/lkml/2020/6/27/64
> 
>  If there are any valid, but yet not changed URLs:
>  See: https://lkml.org/lkml/2020/6/26/837
> 
>  If you apply the patch, please let me know.
> 
>  Sorry again to all maintainers who complained about subject lines.
>  Now I realized that you want an actually perfect prefixes,
>  not just subsystem ones.
>  I tried my best...
>  And yes, *I could* (at least half-)automate it.
>  Impossible is nothing! :)
> 
> 
>  Documentation/devicetree/bindings/watchdog/davinci-wdt.txt | 4 ++--
>  drivers/watchdog/Kconfig   | 2 +-
>  drivers/watchdog/dw_wdt.c  | 2 +-
>  drivers/watchdog/nv_tco.c  | 2 +-
>  drivers/watchdog/nv_tco.h  | 2 +-
>  drivers/watchdog/sp5100_tco.c  | 2 +-
>  6 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/davinci-wdt.txt 
> b/Documentation/devicetree/bindings/watchdog/davinci-wdt.txt
> index e60b9a13bdcb..aa10b8ec36e2 100644
> --- a/Documentation/devicetree/bindings/watchdog/davinci-wdt.txt
> +++ b/Documentation/devicetree/bindings/watchdog/davinci-wdt.txt
> @@ -11,8 +11,8 @@ Optional properties:
>  See clock-bindings.txt
>  
>  Documentation:
> -Davinci DM646x - http://www.ti.com/lit/ug/spruer5b/spruer5b.pdf
> -Keystone - http://www.ti.com/lit/ug/sprugv5a/sprugv5a.pdf
> +Davinci DM646x - https://www.ti.com/lit/ug/spruer5b/spruer5b.pdf
> +Keystone - https://www.ti.com/lit/ug/sprugv5a/sprugv5a.pdf
>  
>  Examples:
>  
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 4f4687c46d38..ab7aad5a1e69 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -1027,7 +1027,7 @@ config ADVANTECH_WDT
> If you are configuring a Linux kernel for the Advantech single-board
> computer, say `Y' here to support its built-in watchdog timer
> feature. More information can be found at
> -   
> +   
>  
>  config ALIM1535_WDT
>   tristate "ALi M1535 PMU Watchdog Timer"
> diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
> index fba21de2bbad..57bbc1434341 100644
> --- a/drivers/watchdog/dw_wdt.c
> +++ b/drivers/watchdog/dw_wdt.c
> @@ -1,7 +1,7 @@
>  // SPDX-License-Identifier: GPL-2.0-or-later
>  /*
>   * Copyright 2010-2011 Picochip Ltd., Jamie Iles
> - * http://www.picochip.com
> + * https://www.picochip.com
>   *
>   * This file implements a driver for the Synopsys DesignWare watchdog device
>   * in the many subsystems. The watchdog has 16 different timeout periods
> diff --git a/drivers/watchdog/nv_tco.c b/drivers/watchdog/nv_tco.c
> index d7a560e348d5..179fb9aa3cf4 100644
> --- a/drivers/watchdog/nv_tco.c
> +++ b/drivers/watchdog/nv_tco.c
> @@ -7,7 +7,7 @@
>   *   Based off i8xx_tco.c:
>   *   (c) Copyright 2000 kernel concepts , All Rights
>   *   Reserved.
> - *   http://www.kernelconcepts.de
> + *   https://www.kernelconcepts.de
>   *
>   *   TCO timer driver for NV chipsets
>   *   based on softdog.c by Alan Cox 
> diff --git a/drivers/watchdog/nv_tco.h b/drivers/watchdog/nv_tco.h
> index d325e528010f..c65f82588386 100644
> --- a/drivers/watchdog/nv_tco.h
> +++ b/drivers/watchdog/nv_tco.h
> @@ -9,7 +9,7 @@
>   *
>   *   (c) Copyright 2000 kernel concepts , All Rights
>   *   Reserved.
> - *   http://www.kernelconcepts.de
> + *   https://www.kernelconcepts.de
>   *
>   *   Neither kernel concepts nor Nils Faerber admit liability nor provide
>   *   warranty for any of this software. This material is provided
> diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c
> index 93bd302ae7c5..85e9664318c9 100644
> --- a/drivers/watchdog/sp5100_tco.c
> +++ b/driver

Re: [PATCH] watchdog: pcwd_usb: remove needless check before usb_free_coherent()

2020-07-19 Thread Guenter Roeck
On Mon, Jul 13, 2020 at 05:53:48AM +, Xu Wang wrote:
> usb_free_coherent() is safe with NULL usb_pcwd->intr_buffer and 
> this check is not required.
> 
> Signed-off-by: Xu Wang 

Reviewed-by: Guenter Roeck 

> ---
>  drivers/watchdog/pcwd_usb.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c
> index 2f44af1831d0..6726301ac02e 100644
> --- a/drivers/watchdog/pcwd_usb.c
> +++ b/drivers/watchdog/pcwd_usb.c
> @@ -585,9 +585,8 @@ static struct notifier_block usb_pcwd_notifier = {
>  static inline void usb_pcwd_delete(struct usb_pcwd_private *usb_pcwd)
>  {
>   usb_free_urb(usb_pcwd->intr_urb);
> - if (usb_pcwd->intr_buffer != NULL)
> - usb_free_coherent(usb_pcwd->udev, usb_pcwd->intr_size,
> -   usb_pcwd->intr_buffer, usb_pcwd->intr_dma);
> + usb_free_coherent(usb_pcwd->udev, usb_pcwd->intr_size,
> +   usb_pcwd->intr_buffer, usb_pcwd->intr_dma);
>   kfree(usb_pcwd);
>  }
>  


[PATCH 0/3] arm64: dts: meson: add support for ODROID-N2+

2020-07-19 Thread Christian Hewitt
This series splits the existing meson-g12b-odroid-n2.dts into a common
dtsi and dts, and then adds new bindings and dts for the ODROID-N2+
which uses an Amlogic S922X rev.C chip that Hardkernel supports with
overclock to 2.4GHz on the big cluster and 2.0GHz on the little cluster.

The series has a soft-dependency on proposed changes to N2 audio [0]
from Jerome Brunet so will need a v2 rebase once they are applied
(basic tests for this series on N2 and N2+ are with them applied).

[0] https://patchwork.kernel.org/project/linux-amlogic/list/?series=311099

Christian Hewitt (3):
  arm64: dts: meson: convert ODROID-N2 to dtsi
  dt-bindings: arm: amlogic: add support for the ODROID-N2+
  arm64: dts: meson: add support for the ODROID-N2+

 .../devicetree/bindings/arm/amlogic.yaml  |   1 +
 arch/arm64/boot/dts/amlogic/Makefile  |   1 +
 .../dts/amlogic/meson-g12b-odroid-n2-plus.dts |  53 ++
 .../boot/dts/amlogic/meson-g12b-odroid-n2.dts | 493 +
 .../dts/amlogic/meson-g12b-odroid-n2.dtsi | 500 ++
 5 files changed, 556 insertions(+), 492 deletions(-)
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2-plus.dts
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi

-- 
2.17.1



[PATCH 1/3] arm64: dts: meson: convert ODROID-N2 to dtsi

2020-07-19 Thread Christian Hewitt
Convert the current ODROID-N2 dts into a common dtsi in preparation
for adding ODROID-N2+ support.

Signed-off-by: Christian Hewitt 
---
 .../boot/dts/amlogic/meson-g12b-odroid-n2.dts | 493 +
 .../dts/amlogic/meson-g12b-odroid-n2.dtsi | 500 ++
 2 files changed, 501 insertions(+), 492 deletions(-)
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts 
b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts
index 169ea283d4ee..5fd51a87ae9b 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts
@@ -6,500 +6,9 @@
 
 /dts-v1/;
 
-#include "meson-g12b-s922x.dtsi"
-#include 
-#include 
-#include 
+#include "meson-g12b-odroid-n2.dtsi"
 
 / {
compatible = "hardkernel,odroid-n2", "amlogic,s922x", "amlogic,g12b";
model = "Hardkernel ODROID-N2";
-
-   aliases {
-   serial0 = &uart_AO;
-   ethernet0 = ðmac;
-   };
-
-   chosen {
-   stdout-path = "serial0:115200n8";
-   };
-
-   memory@0 {
-   device_type = "memory";
-   reg = <0x0 0x0 0x0 0x4000>;
-   };
-
-   emmc_pwrseq: emmc-pwrseq {
-   compatible = "mmc-pwrseq-emmc";
-   reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
-   };
-
-   leds {
-   compatible = "gpio-leds";
-
-   blue {
-   label = "n2:blue";
-   gpios = <&gpio_ao GPIOAO_11 GPIO_ACTIVE_HIGH>;
-   linux,default-trigger = "heartbeat";
-   };
-   };
-
-   tflash_vdd: regulator-tflash_vdd {
-   compatible = "regulator-fixed";
-
-   regulator-name = "TFLASH_VDD";
-   regulator-min-microvolt = <330>;
-   regulator-max-microvolt = <330>;
-
-   gpio = <&gpio_ao GPIOAO_8 GPIO_ACTIVE_HIGH>;
-   enable-active-high;
-   regulator-always-on;
-   };
-
-   tf_io: gpio-regulator-tf_io {
-   compatible = "regulator-gpio";
-
-   regulator-name = "TF_IO";
-   regulator-min-microvolt = <180>;
-   regulator-max-microvolt = <330>;
-
-   gpios = <&gpio_ao GPIOAO_9 GPIO_ACTIVE_HIGH>;
-   gpios-states = <0>;
-
-   states = <330 0>,
-<180 1>;
-   };
-
-   flash_1v8: regulator-flash_1v8 {
-   compatible = "regulator-fixed";
-   regulator-name = "FLASH_1V8";
-   regulator-min-microvolt = <180>;
-   regulator-max-microvolt = <180>;
-   vin-supply = <&vcc_3v3>;
-   regulator-always-on;
-   };
-
-   main_12v: regulator-main_12v {
-   compatible = "regulator-fixed";
-   regulator-name = "12V";
-   regulator-min-microvolt = <1200>;
-   regulator-max-microvolt = <1200>;
-   regulator-always-on;
-   };
-
-   vcc_5v: regulator-vcc_5v {
-   compatible = "regulator-fixed";
-   regulator-name = "5V";
-   regulator-min-microvolt = <500>;
-   regulator-max-microvolt = <500>;
-   regulator-always-on;
-   vin-supply = <&main_12v>;
-   };
-
-   vcc_1v8: regulator-vcc_1v8 {
-   compatible = "regulator-fixed";
-   regulator-name = "VCC_1V8";
-   regulator-min-microvolt = <180>;
-   regulator-max-microvolt = <180>;
-   vin-supply = <&vcc_3v3>;
-   regulator-always-on;
-   };
-
-   vcc_3v3: regulator-vcc_3v3 {
-   compatible = "regulator-fixed";
-   regulator-name = "VCC_3V3";
-   regulator-min-microvolt = <330>;
-   regulator-max-microvolt = <330>;
-   vin-supply = <&vddao_3v3>;
-   regulator-always-on;
-   /* FIXME: actually controlled by VDDCPU_B_EN */
-   };
-
-   vddcpu_a: regulator-vddcpu-a {
-   /*
-* MP8756GD Regulator.
-*/
-   compatible = "pwm-regulator";
-
-   regulator-name = "VDDCPU_A";
-   regulator-min-microvolt = <721000>;
-   regulator-max-microvolt = <1022000>;
-
-   vin-supply = <&main_12v>;
-
-   pwms = <&pwm_ab 0 1250 0>;
-   pwm-dutycycle-range = <100 0>;
-
-   regulator-boot-on;
-   regulator-always-on;
-   };
-
-   vddcpu_b: regulator-vddcpu-b {
-   /*
-* Silergy SY8120B1ABC Regulator.
-*/
-   compatible = "pwm-regulator";
-
-   regulator-name = "VDDCPU_B";
-   regulator-min-microvolt = <721000>;
-

[PATCH 2/3] dt-bindings: arm: amlogic: add support for the ODROID-N2+

2020-07-19 Thread Christian Hewitt
HardKernel ODROID-N2+ uses a revised Amlogic S922X v2 chip that supports
higher cpu clock speeds than the original ODROID-N2.

Signed-off-by: Christian Hewitt 
---
 Documentation/devicetree/bindings/arm/amlogic.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml 
b/Documentation/devicetree/bindings/arm/amlogic.yaml
index 378229fa8310..595bb1d089f7 100644
--- a/Documentation/devicetree/bindings/arm/amlogic.yaml
+++ b/Documentation/devicetree/bindings/arm/amlogic.yaml
@@ -152,6 +152,7 @@ properties:
   - azw,gtking
   - azw,gtking-pro
   - hardkernel,odroid-n2
+  - hardkernel,odroid-n2-plus
   - khadas,vim3
   - ugoos,am6
   - const: amlogic,s922x
-- 
2.17.1



  1   2   3   4   5   6   >