[RFC][PATCH 42/42] few more cleanups of link_path_walk() callers

2018-07-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- fs/namei.c | 30 +++--- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index a55da43f169c..f032a30fc8c6 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -2269,10 +2269,8 @@ static int path_looku

答复: 答复: [PATCH v5 1/1] PCI: kirin: Add MSI support

2018-07-10 Thread Songxiaowei (Kirin_DRV)
> -邮件原件- > 发件人: Lorenzo Pieralisi [mailto:lorenzo.pieral...@arm.com] > 发送时间: 2018年7月10日 23:40 > 收件人: Songxiaowei (Kirin_DRV) > 抄送: bhelg...@google.com; robh...@kernel.org; linux-...@vger.kernel.org; > linux-kernel@vger.kernel.org; chenyao (F) > 主题: Re: 答复: [PATCH v5 1/1] PCI: kirin: Add

[RFC][PATCH 38/42] make alloc_file() static

2018-07-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- fs/file_table.c | 3 +-- include/linux/file.h | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/file_table.c b/fs/file_table.c index 9097a6fb5a2f..c5f651fd6830 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -155,7 +155,

[RFC][PATCH 40/42] make path_init() unconditionally paired with terminate_walk()

2018-07-10 Thread Al Viro
From: Al Viro including the failure exits Signed-off-by: Al Viro --- fs/namei.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index ca3f4dec8cda..a9a2a8ac8b9d 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -2125,12 +

[RFC][PATCH 41/42] allow link_path_walk() to take ERR_PTR()

2018-07-10 Thread Al Viro
From: Al Viro There is a check for IS_ERR(name) immediately upstream of each call of link_path_walk(name, nd), with positives treated as if link_path_walk() failed with PTR_ERR(name). Taking that check into link_path_walk() itself simplifies things nicely. Signed-off-by: Al Viro --- fs/namei.

[RFC][PATCH 36/42] new helper: alloc_file_clone()

2018-07-10 Thread Al Viro
From: Al Viro alloc_file_clone(old_file, mode, ops): create a new struct file with ->f_path equal to that of old_file. pipe converted. Signed-off-by: Al Viro --- fs/file_table.c | 11 +++ fs/pipe.c| 4 +--- include/linux/file.h | 2 ++ 3 files changed, 14 insertions

[RFC][PATCH 34/42] anon_inode_getfile(): switch to alloc_file_pseudo()

2018-07-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- fs/anon_inodes.c | 29 ++--- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c index 3168ee4e77f4..7e13edd23db1 100644 --- a/fs/anon_inodes.c +++ b/fs/anon_inodes.c @@ -71,8 +71,6 @

[RFC][PATCH 28/42] new wrapper: alloc_file_pseudo()

2018-07-10 Thread Al Viro
From: Al Viro takes inode, vfsmount, name, mode and file_operations and either returns a new struct file (in which case inode reference we held is consumed) or returns ERR_PTR(), in which case no refcounts are altered. converted aio_private_file() and sock_alloc_file() to it Signed-off-by: Al V

[RFC][PATCH 33/42] hugetlb_file_setup(): switch to alloc_file_pseudo()

2018-07-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- fs/hugetlbfs/inode.c | 55 1 file changed, 17 insertions(+), 38 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index d508c7844681..86ffe04f73d6 100644 --- a/fs/hugetlbfs/inode.c

[RFC][PATCH 39/42] document alloc_file() changes

2018-07-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- Documentation/filesystems/porting | 12 1 file changed, 12 insertions(+) diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting index c68ea9294b5f..77e2d623e115 100644 --- a/Documentation/filesystems/porting +++

[RFC][PATCH 31/42] cxl_getfile(): switch to alloc_file_pseudo()

2018-07-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- drivers/misc/cxl/api.c | 21 - 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c index 6b16946f9b05..e0b9c00aecde 100644 --- a/drivers/misc/cxl/api.c +++ b/drivers/misc/cxl/

[RFC][PATCH 30/42] ... and switch shmem_file_setup() to alloc_file_pseudo()

2018-07-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- mm/shmem.c | 39 --- 1 file changed, 8 insertions(+), 31 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 1146a48926bc..fd21df189f32 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -3896,18 +3896,11 @@ EXPORT_SYMBO

[RFC][PATCH 35/42] create_pipe_files(): switch the first allocation to alloc_file_pseudo()

2018-07-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- fs/pipe.c | 31 ++- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/fs/pipe.c b/fs/pipe.c index 9405e455f5b1..c8c4265bf87b 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -744,53 +744,34 @@ static struct inode * get_p

[RFC][PATCH 37/42] do_shmat(): grab shp->shm_file earlier, switch to alloc_file_clone()

2018-07-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- ipc/shm.c | 39 ++- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/ipc/shm.c b/ipc/shm.c index 051a3e1fb8df..0cebcf74b669 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -1354,14 +1354,13 @@ long do_shmat(in

[RFC][PATCH 32/42] ocxlflash_getfile(): switch to alloc_file_pseudo()

2018-07-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- drivers/scsi/cxlflash/ocxl_hw.c | 23 --- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/drivers/scsi/cxlflash/ocxl_hw.c b/drivers/scsi/cxlflash/ocxl_hw.c index 497a68389461..6d0632174ec6 100644 --- a/drivers/scsi/cxlf

[RFC][PATCH 23/42] get rid of 'opened' in path_openat() and the helpers downstream

2018-07-10 Thread Al Viro
From: Al Viro unused now Signed-off-by: Al Viro --- fs/namei.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index 96daa644e9e3..4ce780a8ebbc 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -3036,8 +3036,7 @@ static int may_o_cr

[RFC][PATCH 29/42] __shmem_file_setup(): reorder allocations

2018-07-10 Thread Al Viro
From: Al Viro grab inode and reserve memory first. Signed-off-by: Al Viro --- mm/shmem.c | 43 --- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 2cab84403055..1146a48926bc 100644 --- a/mm/shmem.c +++ b/mm/s

[RFC][PATCH 22/42] get rid of 'opened' argument of ->atomic_open() - part 3

2018-07-10 Thread Al Viro
From: Al Viro now it can be done... Signed-off-by: Al Viro --- fs/9p/vfs_inode.c | 3 +-- fs/9p/vfs_inode_dotl.c | 3 +-- fs/bad_inode.c | 2 +- fs/ceph/file.c | 3 +-- fs/ceph/super.h| 3 +-- fs/cifs/cifsfs.h | 3 +-- fs/cifs/dir.c | 3 +-- fs/fuse/

[RFC][PATCH 19/42] IMA: don't propagate opened through the entire thing

2018-07-10 Thread Al Viro
From: Al Viro just check ->f_mode in ima_appraise_measurement() Signed-off-by: Al Viro --- fs/namei.c| 3 +-- fs/nfsd/vfs.c | 2 +- include/linux/ima.h | 4 ++-- security/integrity/ima/ima.h | 4 ++-- security/i

[RFC][PATCH 27/42] kill FILE_{CREATED,OPENED}

2018-07-10 Thread Al Viro
From: Al Viro no users left Signed-off-by: Al Viro --- include/linux/fs.h | 4 1 file changed, 4 deletions(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index c25896b30e9f..bd904c496878 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2436,10 +2436,6 @@ extern struc

[RFC][PATCH 26/42] switch atomic_open() and lookup_open() to returning 0 in all success cases

2018-07-10 Thread Al Viro
From: Al Viro caller can tell "opened" from "open it yourself" by looking at ->f_mode. Signed-off-by: Al Viro --- fs/namei.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index 8b1e5cb85f58..ca3f4dec8cda 100644

[RFC][PATCH 24/42] ->atomic_open(): return 0 in all success cases

2018-07-10 Thread Al Viro
From: Al Viro FMODE_OPENED can be used to distingusish "successful open" from the "called finish_no_open(), do it yourself" cases. Since finish_no_open() has been adjusted, no changes in the instances were actually needed. The caller has been adjusted. Signed-off-by: Al Viro --- fs/namei.c |

[RFC][PATCH 08/42] make sure do_dentry_open() won't return positive as an error

2018-07-10 Thread Al Viro
From: Al Viro An ->open() instances really, really should not be doing that. There's a lot of places e.g. around atomic_open() that could be confused by that, so let's catch that early. Signed-off-by: Al Viro --- fs/open.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/open.c b/fs

[RFC][PATCH 20/42] getting rid of 'opened' argument of ->atomic_open() - step 1

2018-07-10 Thread Al Viro
From: Al Viro 'opened' argument of finish_open() is unused. Kill it. Signed-off-by Al Viro --- fs/9p/vfs_inode.c | 2 +- fs/9p/vfs_inode_dotl.c | 2 +- fs/ceph/file.c | 2 +- fs/cifs/dir.c | 2 +- fs/fuse/dir.c | 2 +- fs/gfs2/inode.c| 6 +++--- fs/namei

[RFC][PATCH 25/42] document ->atomic_open() changes

2018-07-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- Documentation/filesystems/Locking | 2 +- Documentation/filesystems/porting | 8 Documentation/filesystems/vfs.txt | 18 ++ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Documentation/filesystems/Locking b/Do

[RFC][PATCH 21/42] getting rid of 'opened' argument of ->atomic_open() - part 2

2018-07-10 Thread Al Viro
From: Al Viro __gfs2_lookup(), gfs2_create_inode(), nfs_finish_open() and fuse_create_open() don't need 'opened' anymore. Get rid of that argument in those. Signed-off-by: Al Viro --- fs/fuse/dir.c | 4 ++-- fs/gfs2/inode.c | 19 +-- fs/nfs/dir.c| 5 ++--- 3 files chan

[RFC][PATCH 15/42] lift fput() on late failures into path_openat()

2018-07-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- fs/namei.c | 28 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index 3d4e20a1c756..5a79bd170410 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -3407,8 +3407,6 @@ static int do_last(struc

[RFC][PATCH 03/42] ocxlflash_getfile(): fix double-iput() on alloc_file() failures

2018-07-10 Thread Al Viro
From: Al Viro Cc: sta...@kernel.org Signed-off-by: Al Viro --- drivers/scsi/cxlflash/ocxl_hw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/cxlflash/ocxl_hw.c b/drivers/scsi/cxlflash/ocxl_hw.c index 0a95b5f25380..497a68389461 100644 --- a/drivers/scsi/cx

[RFC][PATCH 18/42] introduce FMODE_CREATED and switch to it

2018-07-10 Thread Al Viro
From: Al Viro Parallel to FILE_CREATED, goes into ->f_mode instead of *opened. NFS is a bit of a wart here - it doesn't have file at the point where FILE_CREATED used to be set, so we need to propagate it there (for now). IMA is another one (here and everywhere)... Note that this needs do_dentr

[RFC][PATCH 13/42] introduce FMODE_OPENED

2018-07-10 Thread Al Viro
From: Al Viro basically, "is that instance set up enough for regular fput(), or do we want put_filp() for that one". NOTE: the only alloc_file() caller that could be followed by put_filp() is in arch/ia64/kernel/perfmon.c, which is (Kconfig-level) broken. Signed-off-by: Al Viro --- fs/file_ta

[RFC][PATCH 14/42] fold put_filp() into fput()

2018-07-10 Thread Al Viro
From: Al Viro Just check FMODE_OPENED in __fput() and be done with that... Signed-off-by: Al Viro --- fs/file_table.c | 15 +-- fs/namei.c | 4 ++-- fs/open.c| 11 +++ include/linux/file.h | 1 - 4 files changed, 10 insertions(+), 21 deletions(-

[RFC][PATCH 01/42] drm_mode_create_lease_ioctl(): fix open-coded filp_clone_open()

2018-07-10 Thread Al Viro
From: Al Viro Failure of ->open() should *not* be followed by fput(). Fixed by using filp_clone_open(), which gets the cleanups right. Signed-off-by: Al Viro --- drivers/gpu/drm/drm_lease.c | 16 +--- fs/internal.h | 1 - include/linux/fs.h | 1 + 3 files

[RFC][PATCH 17/42] switch all remaining checks for FILE_OPENED to FMODE_OPENED

2018-07-10 Thread Al Viro
From: Al Viro ... and don't bother with setting FILE_OPENED at all. Signed-off-by: Al Viro --- fs/gfs2/inode.c | 2 +- fs/namei.c | 7 ++- fs/open.c | 9 ++--- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index feda55f6705

[RFC][PATCH 09/42] pass creds to get_empty_filp(), make sure dentry_open() passes the right creds

2018-07-10 Thread Al Viro
From: Al Viro ... and rename get_empty_filp() to alloc_empty_file(). dentry_open() gets creds as argument, but the only thing that sees those is security_file_open() - file->f_cred still ends up with current_cred(). For almost all callers it's the same thing, but there are several broken cases.

[RFC][PATCH 12/42] ->file_open(): lose cred argument

2018-07-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- include/linux/lsm_hooks.h | 2 +- security/apparmor/lsm.c| 4 ++-- security/security.c| 2 +- security/selinux/hooks.c | 4 ++-- security/smack/smack_lsm.c | 6 +++--- security/tomoyo/tomoyo.c | 2 +- 6 files changed, 10 insertions(+), 1

[RFC][PATCH 06/42] turn filp_clone_open() into inline wrapper for dentry_open()

2018-07-10 Thread Al Viro
From: Al Viro it's exactly the same thing as dentry_open(&file->f_path, file->f_flags, file->f_cred) ... and rename it to file_clone_open(), while we are at it. 'filp' naming convention is bogus; sure, it's "file pointer", but we generally don't do that kind of Hungarian notation. Some o

[RFC][PATCH 02/42] cxl_getfile(): fix double-iput() on alloc_file() failures

2018-07-10 Thread Al Viro
From: Al Viro Doing iput() after path_put() is wrong. Cc: sta...@kernel.org Signed-off-by: Al Viro --- drivers/misc/cxl/api.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c index 753b1a698fc4..6b16946f9b05 100644 ---

[RFC][PATCH 16/42] now we can fold open_check_o_direct() into do_dentry_open()

2018-07-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- fs/internal.h | 1 - fs/namei.c| 7 +-- fs/open.c | 17 + 3 files changed, 6 insertions(+), 19 deletions(-) diff --git a/fs/internal.h b/fs/internal.h index ab84a29f4874..33a28438570e 100644 --- a/fs/internal.h +++ b/fs/int

[RFC][PATCH 07/42] create_pipe_files(): use fput() if allocation of the second file fails

2018-07-10 Thread Al Viro
From: Al Viro ... just use put_pipe_info() to get the pipe->files down to 1 and let fput()-called pipe_release() do freeing. Signed-off-by: Al Viro --- fs/pipe.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/pipe.c b/fs/pipe.c index bb0840e234f3..9405e455f5b1 10

[RFC][PATCH 11/42] security_file_open(): lose cred argument

2018-07-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- fs/open.c| 2 +- include/linux/security.h | 5 ++--- security/security.c | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/open.c b/fs/open.c index c8fd5126c50e..008a65e82de5 100644 --- a/fs/open.c +++ b/fs/

[RFC][PATCH 04/42] make get_empty_filp() to call file_free_rcu() directly

2018-07-10 Thread Al Viro
From: Al Viro no point in rcu-delays here Signed-off-by: Al Viro --- fs/file_table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/file_table.c b/fs/file_table.c index 7ec0b3e5f05d..1f14b80a4e67 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -123,11 +123,10

[RFC][PATCH 10/42] get rid of cred argument of vfs_open() and do_dentry_open()

2018-07-10 Thread Al Viro
From: Al Viro always equal to ->f_cred Signed-off-by: Al Viro --- fs/internal.h | 2 +- fs/namei.c| 4 ++-- fs/open.c | 15 ++- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/fs/internal.h b/fs/internal.h index 66473bf388e4..ab84a29f4874 100644 --- a/fs/i

[RFC][PATCH 05/42] fold security_file_free() into file_free()

2018-07-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- fs/file_table.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/file_table.c b/fs/file_table.c index 1f14b80a4e67..eee7cf629e52 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -51,6 +51,7 @@ static void file_free_rcu(st

Re: [PATCH 03/14] thermal: ti-soc-thermal: fix comments in omap4-thermal-data.c

2018-07-10 Thread J, KEERTHY
On 5/14/2018 5:12 PM, Bartlomiej Zolnierkiewicz wrote: The comments about ADC code values are incorrect. Fix them. Acked-by: Keerthy Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/thermal/ti-soc-thermal/omap4-thermal-data.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

Re: [PATCH v2 2/2] regulator: uniphier: add regulator driver for UniPhier SoC

2018-07-10 Thread Kunihiko Hayashi
Hi Mark, On Tue, 10 Jul 2018 18:44:51 +0100 wrote: > On Tue, Jul 10, 2018 at 10:27:17AM +0900, Kunihiko Hayashi wrote: > > > +static int uniphier_regulator_enable(struct regulator_dev *rdev) > > +{ > > + struct uniphier_regulator_priv *priv = rdev_get_drvdata(rdev); > > + > > + return regma

Re: [RFC][PATCH 04/42] make get_empty_filp() to call file_free_rcu() directly

2018-07-10 Thread Linus Torvalds
This one looked odd to me. Then I saw 5/42, and it made more sense. I think the explanation is a bit misleading. Technically correct, but not *why* you did it. Linus

Re: [RFC][PATCH 08/42] make sure do_dentry_open() won't return positive as an error

2018-07-10 Thread Linus Torvalds
On Tue, Jul 10, 2018 at 7:23 PM Al Viro wrote: > > > cleanup_all: > + if (unlikely(error > 0)) { > + WARN_ON(1); > + error = -EINVAL; > + } Can we please do this as if (WARN_ON_ONCE(error > 0)) error = -EINVAL; instead? That alr

Re: [RFC][PATCH 08/42] make sure do_dentry_open() won't return positive as an error

2018-07-10 Thread Al Viro
On Tue, Jul 10, 2018 at 07:39:07PM -0700, Linus Torvalds wrote: > On Tue, Jul 10, 2018 at 7:23 PM Al Viro wrote: > > > > > > cleanup_all: > > + if (unlikely(error > 0)) { > > + WARN_ON(1); > > + error = -EINVAL; > > + } > > Can we please do this as > >

[RFC][PATCH 0/11] PIDTYPE_TGID and fewer fork restarts

2018-07-10 Thread Eric W. Biederman
The following patches should be close. I took some patches I haven't taken the time to merge yet that make PIDTYPE_TGID not a hack. Updated the code that deals with signals to handle PIDTYPE_TGID. Pushed the pid type down from the signal senders all of the way down into __send_signal. That wo

Re: [RFC][PATCH 04/42] make get_empty_filp() to call file_free_rcu() directly

2018-07-10 Thread Al Viro
On Tue, Jul 10, 2018 at 07:35:23PM -0700, Linus Torvalds wrote: > This one looked odd to me. > > Then I saw 5/42, and it made more sense. > > I think the explanation is a bit misleading. Technically correct, but > not *why* you did it. Probably should fold these two together, now that reordering

Re: [RFC][PATCH 16/42] now we can fold open_check_o_direct() into do_dentry_open()

2018-07-10 Thread Linus Torvalds
I like the patch, I hate the commit message. It makes sense right now in this sequence, but I'd really like the commit message to say _why_ this sequence led up to this point. Right now I still remember you trying this, and having to revert it because it didn't work before all the fput/put_filp i

Re: [PATCH v4 0/6] Add Actions Semiconductor Owl S900 I2C support

2018-07-10 Thread Manivannan Sadhasivam
On Sun, Jul 01, 2018 at 10:52:59PM +0530, Manivannan Sadhasivam wrote: > This patchset adds I2C controller support for Actions Semiconductor S900 SoC. > This driver has been structured in a way such that there will be only > one controller driver for the whole Owl family series (S500, S700 and > S9

Re: [PATCH v4 9/9] iommu/vt-d: Remove the obsolete per iommu pasid tables

2018-07-10 Thread Peter Xu
On Mon, Jul 09, 2018 at 01:22:58PM +0800, Lu Baolu wrote: > The obsolete per iommu pasid tables are no longer used. Hence, > clean up them. > > Cc: Ashok Raj > Cc: Jacob Pan > Cc: Kevin Tian > Cc: Liu Yi L > Signed-off-by: Lu Baolu > Reviewed-by: Liu Yi L > --- > drivers/iommu/intel-iommu.c

[RFC][PATCH 06/11] pid: Implement PIDTYPE_TGID

2018-07-10 Thread Eric W. Biederman
Everywhere except in the pid array we distinguish between a tasks pid and a tasks tgid (thread group id). Even in the enumeration we want that distinction sometimes so we have added __PIDTYPE_TGID. With leader_pid we almost have an implementation of PIDTYPE_TGID in struct signal_struct. Add PIDT

[RFC][PATCH 09/11] tty_io: Use do_send_sig_info in __do_SACK to forcibly kill tasks

2018-07-10 Thread Eric W. Biederman
send_sig is thread only making it the wrong command for an action directed at a process. force_sig does not set SEND_SIG_FORCED (causing unnecessary work in __send_signal) and jumps through unnecessary hoops to deal with blocked and ignored signals which SIGKILL can neve

[RFC][PATCH 01/11] pids: Initialize leader_pid in init_task

2018-07-10 Thread Eric W. Biederman
This is cheap and no cost so we might as well. Signed-off-by: "Eric W. Biederman" --- init/init_task.c | 1 + 1 file changed, 1 insertion(+) diff --git a/init/init_task.c b/init/init_task.c index 74f60baa2799..7914ffb8dc73 100644 --- a/init/init_task.c +++ b/init/init_task.c @@ -33,6 +33,7 @@ s

[RFC][PATCH 05/11] pids: Move the pgrp and session pid pointers from task_struct to signal_struct

2018-07-10 Thread Eric W. Biederman
To access these fields the code always has to go to group leader so going to signal struct is no loss and is actually a fundamental simplification. This saves a little bit of memory by only allocating the pid pointer array once instead of once for every thread, and even better this removes a few p

[RFC][PATCH 04/11] kvm: Don't open code task_pid in kvm_vcpu_ioctl

2018-07-10 Thread Eric W. Biederman
Signed-off-by: "Eric W. Biederman" --- virt/kvm/kvm_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index ada21f47f22b..4c593acc4510 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -2560,7 +2560,7 @@ static long kv

[RFC][PATCH 03/11] pids: Compute task_tgid using signal->leader_pid

2018-07-10 Thread Eric W. Biederman
The cost is the the same and this removes the need to worry about complications that come from de_thread and group_leader changing. __task_pid_nr_ns has been updated to take advantage of this change. Signed-off-by: "Eric W. Biederman" --- arch/ia64/kernel/asm-offsets.c | 2 +- arch/ia64/

[RFC][PATCH 02/11] pids: Move task_pid_type into sched/signal.h

2018-07-10 Thread Eric W. Biederman
The function is general and inline so there is no need to hide it inside of exit.c Signed-off-by: "Eric W. Biederman" --- include/linux/sched/signal.h | 8 kernel/exit.c| 8 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/linux/sched/signa

[RFC][PATCH 08/11] signal: Use PIDTYPE_TGID to clearly store where file signals will be sent

2018-07-10 Thread Eric W. Biederman
When f_setown is called a pid and a pid type are stored. Replace the use of PIDTYPE_PID with PIDTYPE_TGID as PIDTYPE_TGID goes to the entire thread group. Replace the use of PIDTYPE_MAX with PIDTYPE_PID as PIDTYPE_PID now is only for a thread. Update the users of __f_setown to use PIDTYPE_TGID i

[RFC][PATCH 10/11] signal: Push pid type from signal senders down into __send_signal

2018-07-10 Thread Eric W. Biederman
Use the information we already have to document which signals are sent to a group of processes and which signals are sent to a single process or a single thread. This information will be needed later to ensure signals are atomic with respect to fork (always coming in before or after the system cal

[RFC][PATCH 07/11] signal: Deliver group signals via PIDTYPE_TGID not PIDTYPE_PID

2018-07-10 Thread Eric W. Biederman
Now that we can make the distinction use PIDTYPE_TGID rather than PIDTYPE_PID. There is no immediate effect as they point point at the same task, but this allows using enum pid_type instead of bool group in the signal sending functions. Signed-off-by: "Eric W. Biederman" --- kernel/signal.c

[RFC][PATCH 11/11] signal: Ignore all but multi-process signals that come in during fork.

2018-07-10 Thread Eric W. Biederman
Wen Yang and majiang report that a periodic signal received during fork can cause fork to continually restart preventing an application from making progress. The code was being overly pesimistic. Fork needs to guarantee that a signal sent to multiple processes is logically delivered before the

Re: [RFC][PATCH 01/42] drm_mode_create_lease_ioctl(): fix open-coded filp_clone_open()

2018-07-10 Thread Linus Torvalds
Ok, you didn't seem to have a coverletter email, so I'm just replying to the first one. Apart from the couple of totally trivial things I reacted to, this looks very clean and nice. And now I sat in front of the computer while reading it, so I could follow along better. So apart from the small st

Re: [PATCH 2/3] arm64: dts: qcom: sdm845-mtp: Add RPMh VRM/XOB regulators

2018-07-10 Thread kbuild test robot
Hi Douglas, Thank you for the patch! Yet something to improve: [auto build test ERROR on agross/for-next] [also build test ERROR on next-20180710] [cannot apply to v4.18-rc4] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https

Re: [RFC][PATCH 16/42] now we can fold open_check_o_direct() into do_dentry_open()

2018-07-10 Thread Al Viro
On Tue, Jul 10, 2018 at 07:44:59PM -0700, Linus Torvalds wrote: > I like the patch, I hate the commit message. > > It makes sense right now in this sequence, but I'd really like the > commit message to say _why_ this sequence led up to this point. > > Right now I still remember you trying this, a

[PATCH V2] mmc: core: improve reasonableness of bus width setting for HS400es

2018-07-10 Thread Hongjie Fang
mmc_select_hs400es() calls mmc_select_bus_width() which will continue to set 4bit transfer mode if fail to set 8bit mode. The bus width should not be set to 4bit in HS400es. When fail to set 8bit mode, need return error directly for HS400es. Signed-off-by: Hongjie Fang --- drivers/mmc/core/mmc.

Re: [RFC][PATCH 10/11] signal: Push pid type from signal senders down into __send_signal

2018-07-10 Thread Linus Torvalds
On Tue, 10 Jul 2018, Eric W. Biederman wrote: > > Use the information we already have to document which signals are sent > to a group of processes and which signals are sent to a single process > or a single thread. Ahh. This is much nicer than what I was playing with yesterday, trying to sep

Re: [RFC][PATCH 16/42] now we can fold open_check_o_direct() into do_dentry_open()

2018-07-10 Thread Linus Torvalds
On Tue, Jul 10, 2018 at 7:59 PM Al Viro wrote: > > Umm... Something like [..] Ack. Linus

linux-next: manual merge of the driver-core tree with the iommu tree

2018-07-10 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the driver-core tree got a conflict in: drivers/iommu/ipmmu-vmsa.c between commits: 0b8ac1409641 ("iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code") 3701c123e1c1 ("iommu/ipmmu-vmsa: Hook up r8a779(70|95) DT matching code") 98dbffd39a65 ("iommu/ipmm

Re: [PATCH 04/14] thermal: ti-soc-thermal: cleanup COUNTER feature handling for OMAP5

2018-07-10 Thread J, KEERTHY
On 5/14/2018 5:12 PM, Bartlomiej Zolnierkiewicz wrote: OMAP5 sensors don't claim COUNTER feature support (they use COUNTER_DELAY feature instead) so there is no need to set fields of struct temp_sensor_registers which are only used for COUNTER feature. There should be no functional changes ca

Re: [PATCH v13 2/2] Add oom victim's memcg to the oom context information

2018-07-10 Thread 禹舟键
Hi Michal Sorry , I l forget to update the changlog for the second patch, but the cpuset information is not missing. Do I still need to make the v14 or just update the changelog for v13? Thanks

Re: [PATCH v3 1/3] vt: preserve unicode values corresponding to screen characters

2018-07-10 Thread Nicolas Pitre
I am on vacation away from an actual keyboard until next week. Will look at it then. > Le 10 juill. 2018 à 20:52, Kees Cook a écrit : > >> On Tue, Jun 26, 2018 at 8:56 PM, Nicolas Pitre >> wrote: >> The vt code translates UTF-8 strings into glyph index values and stores >> those glyph values

[PATCH RESEND] KVM: Add coalesced PIO support

2018-07-10 Thread Wanpeng Li
Windows I/O, such as the real-time clock. The address register (port 0x70 in the RTC case) can use coalesced I/O, cutting the number of userspace exits by half when reading or writing the RTC. Guest access rtc like this: write register index to 0x70, then write or read data from 0x71. writing 0x7

linux-next: manual merge of the scsi-mkp tree with Linus' tree

2018-07-10 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the scsi-mkp tree got a conflict in: MAINTAINERS between commit: 54e45716a84a ("scsi: remove NCR_D700 driver") from Linus' tree and commit: 01a21986f8ed ("MAINTAINERS: Add Sam as the maintainer for NCSI") from the scsi-mkp tree. I fixed it up (see b

linux-next: build warning after merge of the scsi-mkp tree

2018-07-10 Thread Stephen Rothwell
Hi all, After merging the scsi-mkp tree, today's linux-next build (x86_64 allmodconfig) produced this warning: In file included from include/linux/spinlock_types.h:18:0, from include/linux/spinlock.h:82, from drivers/scsi/libfc/fc_rport.c:61: drivers/scsi/libfc/f

tools/include/asm-generic/bitsperlong.h:14:2: error: #error Inconsistent word size. Check asm/bitsperlong.h

2018-07-10 Thread kbuild test robot
Hi Alexei, FYI, the error/warning still remains. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 1e09177acae32a61586af26d83ca5ef591cdcaf5 commit: 819dd92b9c0bc7bce9097d8c1f14240f471bb386 bpfilter: switch to CC from HOSTCC date: 5 weeks ago config: alp

Re: [PATCH v11 5/8] i2c: fsi: Add transfer implementation

2018-07-10 Thread Joel Stanley
On 11 July 2018 at 06:59, Eddie James wrote: > > > On 07/10/2018 02:39 PM, Wolfram Sang wrote: >>> >>> Sorry, what do you mean "show up as"? Yes, we could first shift all our >>> addresses in user-space before passing them to the driver, so that the >>> msg->addr field is exactly what the hardware

[PATCH v3 2/2] regulator: uniphier: add regulator driver for UniPhier SoC

2018-07-10 Thread Kunihiko Hayashi
Initial commit to add support for regulators implemented in UniPhier SoCs. This supports USB VBUS only. Signed-off-by: Kunihiko Hayashi --- drivers/regulator/Kconfig | 8 ++ drivers/regulator/Makefile | 1 + drivers/regulator/uniphier-regulator.c | 213 ++

[PATCH v3 0/2] regulator: add new UniPhier regulator support

2018-07-10 Thread Kunihiko Hayashi
This series add new regulator controller support for UniPhier SoCs. Currently this supports USB3 VBUS controller only. This USB3 VBUS belongs to USB3 glue layer. Changes since v2: - replace functions in regulator_ops with helper ones Changes since v1: - dt-bindings: add description of glue layer

[PATCH v3 1/2] dt-bindings: regulator: add DT bindings for UniPhier regulator

2018-07-10 Thread Kunihiko Hayashi
Add DT bindings for regulators implemented in UniPhier SoCs. Signed-off-by: Kunihiko Hayashi --- .../bindings/regulator/uniphier-regulator.txt | 57 ++ 1 file changed, 57 insertions(+) create mode 100644 Documentation/devicetree/bindings/regulator/uniphier-regulator.tx

[PATCH] ARM: dts: imx: Add ZII SCU3 ESB

2018-07-10 Thread Andrey Smirnov
Add support for the Zodiac Inflight Innovations i.MX51-base SCU3 Ethernet Switch Board (ESB) Cc: Fabio Estevam Cc: Nikita Yushchenko Cc: Lucas Stach Cc: cphe...@gmail.com Cc: Shawn Guo Cc: Rob Herring Cc: Mark Rutland Cc: linux-arm-ker...@lists.infradead.org Cc: devicet...@vger.kernel.org Cc

[PATCH v4 0/8] mm: Rework hmm to use devm_memremap_pages and other fixes

2018-07-10 Thread Dan Williams
Changes since v3 [1]: * Collect Logan's reviewed-by on patch 3 * Collect John's and Joe's tested-by on patch 8 * Update the changelog for patch 1 and 7 to better explain the EXPORT_SYMBOL_GPL rationale. * Update the changelog for patch 2 to clarify that it is a cleanup to make the following pat

[PATCH v4 2/8] mm, devm_memremap_pages: Kill mapping "System RAM" support

2018-07-10 Thread Dan Williams
Given the fact that devm_memremap_pages() requires a percpu_ref that is torn down by devm_memremap_pages_release() the current support for mapping RAM is broken. Support for remapping "System RAM" has been broken since the beginning and there is no existing user of this this code path, so just kil

[PATCH v4 3/8] mm, devm_memremap_pages: Fix shutdown handling

2018-07-10 Thread Dan Williams
The last step before devm_memremap_pages() returns success is to allocate a release action, devm_memremap_pages_release(), to tear the entire setup down. However, the result from devm_add_action() is not checked. Checking the error from devm_add_action() is not enough. The api currently relies on

[PATCH v4 4/8] mm, devm_memremap_pages: Add MEMORY_DEVICE_PRIVATE support

2018-07-10 Thread Dan Williams
In preparation for consolidating all ZONE_DEVICE enabling via devm_memremap_pages(), teach it how to handle the constraints of MEMORY_DEVICE_PRIVATE ranges. Cc: Christoph Hellwig Cc: "Jérôme Glisse" Reported-by: Logan Gunthorpe Reviewed-by: Logan Gunthorpe Signed-off-by: Dan Williams --- ker

[PATCH v4 1/8] mm, devm_memremap_pages: Mark devm_memremap_pages() EXPORT_SYMBOL_GPL

2018-07-10 Thread Dan Williams
The devm_memremap_pages() facility is tightly integrated with the kernel's memory hotplug functionality. It injects an altmap argument deep into the architecture specific vmemmap implementation to allow allocating from specific reserved pages, and it has Linux specific assumptions about page struct

[PATCH v4 5/8] mm, hmm: Use devm semantics for hmm_devmem_{add, remove}

2018-07-10 Thread Dan Williams
devm semantics arrange for resources to be torn down when device-driver-probe fails or when device-driver-release completes. Similar to devm_memremap_pages() there is no need to support an explicit remove operation when the users properly adhere to devm semantics. Note that devm_kzalloc() automati

[PATCH v4 7/8] mm, hmm: Mark hmm_devmem_{add, add_resource} EXPORT_SYMBOL_GPL

2018-07-10 Thread Dan Williams
The routines hmm_devmem_add(), and hmm_devmem_add_resource() duplicated devm_memremap_pages() and are now simple now wrappers around the core facility to inject a dev_pagemap instance into the global pgmap_radix and hook page-idle events. The devm_memremap_pages() interface is base infrastructure f

[PATCH v4 6/8] mm, hmm: Replace hmm_devmem_pages_create() with devm_memremap_pages()

2018-07-10 Thread Dan Williams
Commit e8d513483300 "memremap: change devm_memremap_pages interface to use struct dev_pagemap" refactored devm_memremap_pages() to allow a dev_pagemap instance to be supplied. Passing in a dev_pagemap interface simplifies the design of pgmap type drivers in that they can rely on container_of() to l

[PATCH v4 8/8] mm: Fix exports that inadvertently make put_page() EXPORT_SYMBOL_GPL

2018-07-10 Thread Dan Williams
Now that all producers of dev_pagemap instances in the kernel are properly converted to EXPORT_SYMBOL_GPL, fix up implicit consumers that interact with dev_pagemap owners via put_page(). To reiterate, dev_pagemap producers are EXPORT_SYMBOL_GPL because they adopt and modify core memory management i

Re: [PATCH v9 6/7] lib: Add module to simulate atomic sections for testing preemptoff tracers

2018-07-10 Thread Joel Fernandes
On Tue, Jul 10, 2018 at 08:47:07PM -0400, Steven Rostedt wrote: > On Thu, 28 Jun 2018 11:21:48 -0700 > Joel Fernandes wrote: > > > From: "Joel Fernandes (Google)" > > > > In this patch we introduce a test module for simulating a long atomic > > section in the kernel which the preemptoff or irqs

Re: [PATCH v9 7/7] kselftests: Add tests for the preemptoff and irqsoff tracers

2018-07-10 Thread Joel Fernandes
On Tue, Jul 10, 2018 at 08:49:58PM -0400, Steven Rostedt wrote: > On Thu, 28 Jun 2018 11:21:49 -0700 > Joel Fernandes wrote: > > > From: "Joel Fernandes (Google)" > > > > Here we add unit tests for the preemptoff and irqsoff tracer by using a > > kernel module introduced previously to trigger a

[RFC PATCH v2 0/4] sysfs interface to miscellaneous BMC controls and fields

2018-07-10 Thread Andrew Jeffery
Hello, This series is a second stab at exposing hardware controls on Baseboard Management Controllers that are hard to fit into any a coherent abstraction. The patches introduce new devicetree bindings and sysfs attributes, along with a platform driver to expose devicetree nodes of the former as

[RFC PATCH v2 2/4] Documentation: ABI: Add sysfs-devices-platform-field to testing

2018-07-10 Thread Andrew Jeffery
"Fields" expose control of hardware directly to userspace where appropriate. Examples of expected use are single bit switches or other small masks of registers where the range of values is entirely policy driven and the field is not part of a larger, coherent design. These fields can be from read-

[RFC PATCH v2 3/4] misc: Add bmc-misc-ctrl

2018-07-10 Thread Andrew Jeffery
The bmc-misc-ctrl platform driver stitches together the associated devicetree bindings and the sysfs-devices-platform-field ABI to expose fields described in the devicetree to userspace via sysfs. While the userspace interface does not provide an abstraction over the hardware, it does provide some

[RFC PATCH v2 4/4] dts: aspeed-g5: Describe VGA, SIO scratch and DAC mux fields

2018-07-10 Thread Andrew Jeffery
The AST2500 has VGA scratch registers that are read-only, SuperIO scratch registers that are a mix of read-only and read-write, and a graphics DAC mux that must be read or configured in the process of booting e.g. an OpenPOWER system. These capabilities do not really have a place in other drivers,

[RFC PATCH v2 1/4] dt-bindings: misc: Add bindings for misc. BMC control fields

2018-07-10 Thread Andrew Jeffery
Baseboard Management Controllers (BMCs) are embedded SoCs that exist to provide remote management of (primarily) server platforms. BMCs are often tightly coupled to the platform in terms of behaviour and provide many hardware features integral to booting and running the host system. Some of these

RE: [PATCH v1 1/4] dmaengine: imx-sdma: add memcpy interface

2018-07-10 Thread Robin Gong
> Hi Robin, > > On 11-07-18, 00:23, Robin Gong wrote: > > Add MEMCPY support, meanwhile, add SDMA_BD_MAX_CNT instead of > > '0x'. > > latter part should be its own patch. Never mix things Okay, I will split it even for this minor change. > > > +static struct dma_async_tx_descriptor *sdma_pre

<    4   5   6   7   8   9   10   >