Re: [PATCH 02/14] cxl/mem: Map memory device registers

2021-02-02 Thread Christoph Hellwig
Any reason not to merge a bunch of patches? Both this one and the previous one are rather useless on their own, making review harder than necessary. > + * cxl_mem_create() - Create a new cxl_mem. > + * @pdev: The pci device associated with the new cxl_mem. > + * @reg_lo: Lower 32b of the

Re: [PATCH 01/14] cxl/mem: Introduce a driver for CXL-2.0-Type-3 endpoints

2021-02-02 Thread Christoph Hellwig
> +static int cxl_mem_dvsec(struct pci_dev *pdev, int dvsec) > +{ > + int pos; > + > + pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_DVSEC); > + if (!pos) > + return 0; > + > + while (pos) { > + u16 vendor, id; > + > +

Re: [PATCH 01/14] cxl/mem: Introduce a driver for CXL-2.0-Type-3 endpoints

2021-02-02 Thread Christoph Hellwig
On Mon, Feb 01, 2021 at 12:34:11PM -0500, Konrad Rzeszutek Wilk wrote: > > +// SPDX-License-Identifier: GPL-2.0-only > > +/* Copyright(c) 2020 Intel Corporation. All rights reserved. */ > > Can those two comments have the same type? As in either > stay with // or do /*. No. // is only intended

Re: [PATCH 10/13] module: pass struct find_symbol_args to find_symbol

2021-02-02 Thread Christoph Hellwig
On Tue, Feb 02, 2021 at 03:07:51PM +0100, Miroslav Benes wrote: > > preempt_disable(); > > - sym = find_symbol(symbol, , NULL, NULL, true, true); > > - if (sym && strong_try_module_get(owner)) > > - sym = NULL; > > + if (!find_symbol() || !strong_try_module_get(fsa.owner)) { >

Re: module loader dead code removal and cleanups v3

2021-02-02 Thread Christoph Hellwig
On Tue, Feb 02, 2021 at 03:37:04PM +0100, Jessica Yu wrote: > The patchset looks good so far. After Miroslav's comments are > addressed, I'll wait an extra day or two in case there are more > comments before queueing them onto modules-next. I can take the first > two patches as well provided the

[PATCH 07/13] module: mark module_mutex static

2021-02-02 Thread Christoph Hellwig
Except for two lockdep asserts module_mutex is only used in module.c. Remove the two asserts given that the functions they are in are not exported and just called from the module code, and mark module_mutex static. Signed-off-by: Christoph Hellwig --- include/linux/module.h | 2 -- kernel

[PATCH 08/13] module: remove each_symbol_in_section

2021-02-02 Thread Christoph Hellwig
each_symbol_in_section just contains a trivial loop over its arguments. Just open code the loop in the two callers. Signed-off-by: Christoph Hellwig --- kernel/module.c | 29 +++-- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/kernel/module.c b/kernel

[PATCH 12/13] module: remove EXPORT_SYMBOL_GPL_FUTURE

2021-02-02 Thread Christoph Hellwig
As far as I can tell this has never been used at all, and certainly not any time recently. Signed-off-by: Christoph Hellwig --- arch/x86/tools/relocs.c | 4 ++-- include/asm-generic/vmlinux.lds.h | 14 -- include/linux/export.h| 1 - include/linux/module.h

[PATCH 09/13] module: merge each_symbol_section into find_symbol

2021-02-02 Thread Christoph Hellwig
each_symbol_section is only called by find_symbol, so merge the two functions. Signed-off-by: Christoph Hellwig --- kernel/module.c | 148 ++-- 1 file changed, 69 insertions(+), 79 deletions(-) diff --git a/kernel/module.c b/kernel/module.c index

[PATCH 10/13] module: pass struct find_symbol_args to find_symbol

2021-02-02 Thread Christoph Hellwig
Simplify the calling convention by passing the find_symbol_args structure to find_symbol instead of initializing it inside the function. Signed-off-by: Christoph Hellwig --- kernel/module.c | 113 ++-- 1 file changed, 52 insertions(+), 61 deletions

[PATCH 11/13] module: move struct symsearch to module.c

2021-02-02 Thread Christoph Hellwig
struct symsearch is only used inside of module.h, so move the definition out of module.h. Signed-off-by: Christoph Hellwig --- include/linux/module.h | 11 --- kernel/module.c| 11 +++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/linux

[PATCH 13/13] module: remove EXPORT_UNUSED_SYMBOL*

2021-02-02 Thread Christoph Hellwig
EXPORT_UNUSED_SYMBOL* is not actually used anywhere. Remove the unused functionality as we generally just remove unused code anyway. Signed-off-by: Christoph Hellwig --- arch/arm/configs/bcm2835_defconfig | 1 - arch/arm/configs/mxs_defconfig | 1 - arch/mips/configs

[PATCH 04/13] module: use RCU to synchronize find_module

2021-02-02 Thread Christoph Hellwig
Allow for a RCU-sched critical section around find_module, following the lower level find_module_all helper, and switch the two callers outside of module.c to use such a RCU-sched critical section instead of module_mutex. Signed-off-by: Christoph Hellwig Reviewed-by: Petr Mladek Acked

[PATCH 06/13] kallsyms: only build {,module_}kallsyms_on_each_symbol when required

2021-02-02 Thread Christoph Hellwig
kallsyms_on_each_symbol and module_kallsyms_on_each_symbol are only used by the livepatching code, so don't build them if livepatching is not enabled. Signed-off-by: Christoph Hellwig --- include/linux/kallsyms.h | 17 - include/linux/module.h | 16 kernel

[PATCH 05/13] kallsyms: refactor {,module_}kallsyms_on_each_symbol

2021-02-02 Thread Christoph Hellwig
for the livepatch code in that the symbols from vmlinux are not iterated anymore if objname is set, but that actually is the desired behavior in this case. Signed-off-by: Christoph Hellwig Acked-by: Miroslav Benes --- kernel/kallsyms.c | 6 +- kernel/livepatch/core.c | 2 -- kernel

module loader dead code removal and cleanups v3

2021-02-02 Thread Christoph Hellwig
Hi all, this series removes support for long term unused export types and cleans up various loose ends in the module loader. Changes since v2: - clean up klp_find_object_symbol a bit - remove the now unused module_assert_mutex helper Changes since v1: - move struct symsearch to module.c -

[PATCH 03/13] module: unexport find_module and module_mutex

2021-02-02 Thread Christoph Hellwig
find_module is not used by modular code any more, and random driver code has no business calling it to start with. Signed-off-by: Christoph Hellwig Reviewed-by: Miroslav Benes --- kernel/module.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/module.c b/kernel/module.c index

[PATCH 01/13] powerpc/powernv: remove get_cxl_module

2021-02-02 Thread Christoph Hellwig
The static inline get_cxl_module function is entirely unused since commit 8bf6b91a5125a ("Revert "powerpc/powernv: Add support for the cxl kernel api on the real phb"), so remove it. Signed-off-by: Christoph Hellwig Reviewed-by: Andrew Donnellan --- arch/powerpc/platforms/po

[PATCH 02/13] drm: remove drm_fb_helper_modinit

2021-02-02 Thread Christoph Hellwig
check either). Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/drm_crtc_helper_internal.h | 10 - drivers/gpu/drm/drm_fb_helper.c| 21 -- drivers/gpu/drm/drm_kms_helper_common.c| 25 +++--- 3 files changed, 12 insertions(+), 44

[PATCH 7/7] media: uvcvideo: Use dma_alloc_noncontiguos API

2021-02-02 Thread Christoph Hellwig
qty: 299.264 avg 318.080 std 1.615 min 2806.667 max (uS) raw decode speed: 365.470 Mbits/s raw URB handling speed: 295.986 Mbits/s throughput: 13.136 Mbits/s URB decode CPU usage 3.594500 % Signed-off-by: Ricardo Ribalda Signed-off-by: Christoph Hellwig --- drivers/media/usb/uvc/uvc_

[PATCH 6/7] dma-iommu: implement ->alloc_noncontiguous

2021-02-02 Thread Christoph Hellwig
Implement support for allocating a non-contiguous DMA region. Signed-off-by: Christoph Hellwig --- drivers/iommu/dma-iommu.c | 35 +++ 1 file changed, 35 insertions(+) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index 85cb004d7a44c6

[PATCH 4/7] dma-mapping: add a dma_alloc_noncontiguous API

2021-02-02 Thread Christoph Hellwig
of the recently removed and never fully implemented DMA_ATTR_NON_CONSISTENT Signed-off-by: Christoph Hellwig --- Documentation/core-api/dma-api.rst | 74 + include/linux/dma-map-ops.h| 18 + include/linux/dma-mapping.h| 31 + kernel/dma/mapping.c

[PATCH 5/7] dma-iommu: refactor iommu_dma_alloc_remap

2021-02-02 Thread Christoph Hellwig
Split out a new helper that only allocates a sg_table worth of memory without mapping it into contiguous kernel address space. Signed-off-by: Christoph Hellwig --- drivers/iommu/dma-iommu.c | 67 --- 1 file changed, 35 insertions(+), 32 deletions(-) diff

[PATCH 2/7] dma-mapping: add a dma_mmap_pages helper

2021-02-02 Thread Christoph Hellwig
Add a helper to map memory allocated using dma_alloc_pages into a user address space, similar to the dma_alloc_attrs function for coherent allocations. Signed-off-by: Christoph Hellwig --- Documentation/core-api/dma-api.rst | 10 ++ include/linux/dma-mapping.h| 2 ++ kernel/dma

[PATCH 3/7] dma-mapping: refactor dma_{alloc,free}_pages

2021-02-02 Thread Christoph Hellwig
-by: Christoph Hellwig --- kernel/dma/mapping.c | 29 +++-- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c index c1e515496c067b..5e87dac6cc6d9a 100644 --- a/kernel/dma/mapping.c +++ b/kernel/dma/mapping.c @@ -475,11 +475,10

[PATCH 1/7] dma-mapping: remove the {alloc,free}_noncoherent methods

2021-02-02 Thread Christoph Hellwig
later. Signed-off-by: Christoph Hellwig --- Documentation/core-api/dma-api.rst | 64 ++ drivers/iommu/dma-iommu.c | 30 -- include/linux/dma-map-ops.h| 5 --- include/linux/dma-mapping.h| 17 ++-- kernel/dma/mapping.c

add a new dma_alloc_noncontiguous API v2

2021-02-02 Thread Christoph Hellwig
Hi all, this series adds the new noncontiguous DMA allocation API requested by various media driver maintainers. Changes since v1: - document that flush_kernel_vmap_range and invalidate_kernel_vmap_range must be called once an allocation is mapped into KVA - add dma-debug support - remove

Re: [PATCH] nvme-pci: Mark Phison E16 (Corsair MP600) as IGNORE_DEV_SUBNQN

2021-02-02 Thread Christoph Hellwig
Thanks, applied to nvme-5.11.

Re: [PATCH] nvme-pci: add quirk to make Kingston A2000 SSD avoid deepest sleep state

2021-02-02 Thread Christoph Hellwig
Thanks, applied to nvme-5.11.

[GIT PULL] dma-mapping fix for 5.11

2021-02-02 Thread Christoph Hellwig
The following changes since commit 6ee1d745b7c9fd573fba142a2efdad76a9f1cb04: Linux 5.11-rc5 (2021-01-24 16:47:14 -0800) are available in the Git repository at: git://git.infradead.org/users/hch/dma-mapping.git tags/dma-mapping-5.11-1 for you to fetch changes up to

Re: [PATCH 1/1] dma-buf: heaps: Map system heap pages as managed by linux vm

2021-02-02 Thread Christoph Hellwig
On Tue, Feb 02, 2021 at 12:44:44AM -0800, Suren Baghdasaryan wrote: > On Mon, Feb 1, 2021 at 11:03 PM Christoph Hellwig wrote: > > > > IMHO the > > > > BUG_ON(vma->vm_flags & VM_PFNMAP); > > > > in vm_insert_page should just become a WARN_ON_O

Re: [PATCH 1/1] arm64: hibernate: add __force attribute to gfp_t casting

2021-02-02 Thread Christoph Hellwig
On Mon, Feb 01, 2021 at 10:03:06AM -0500, Pavel Tatashin wrote: > Two new warnings are reported by sparse: > > "sparse warnings: (new ones prefixed by >>)" > >> arch/arm64/kernel/hibernate.c:181:39: sparse: sparse: cast to >restricted gfp_t > >> arch/arm64/kernel/hibernate.c:202:44: sparse:

Re: [PATCH v2] ext4: Enable code path when DX_DEBUG is set

2021-02-02 Thread Christoph Hellwig
On Mon, Feb 01, 2021 at 12:13:52PM -0500, Theodore Ts'o wrote: > However, if there *is* a bug, having an early detection that the > representation invariant of the data structure has been violated can > be useful in root causing a bug. This would probably be clearer if > the code was pulled out

Re: [PATCH v6] modules: introduce the MODULE_SCMVERSION config

2021-02-01 Thread Christoph Hellwig
Just to deposit my opposition again: I don't think this hack for your out of tree builds has any place in the kernel tree.

Re: [PATCH 1/1] dma-buf: heaps: Map system heap pages as managed by linux vm

2021-02-01 Thread Christoph Hellwig
IMHO the BUG_ON(vma->vm_flags & VM_PFNMAP); in vm_insert_page should just become a WARN_ON_ONCE with an error return, and then we just need to gradually fix up the callers that trigger it instead of coming up with workarounds like this.

Re: linux-next: build failure after merge of the block tree

2021-02-01 Thread Christoph Hellwig
Both fixups look good to me, thanks.

Re: [PATCH 6/6] media: uvcvideo: Use dma_alloc_noncontiguos API

2021-02-01 Thread Christoph Hellwig
On Thu, Jan 28, 2021 at 06:00:57PM +0100, Ricardo Ribalda wrote: > > Given that we vmap the addresses this also needs > > flush_kernel_vmap_range / invalidate_kernel_vmap_range calls for > > VIVT architectures. > > We only read from the device to the cpu. Then can we run only >

Re: [PATCH 05/13] kallsyms: refactor {,module_}kallsyms_on_each_symbol

2021-02-01 Thread Christoph Hellwig
-- >From 18af41e88d088cfb8680d1669fcae2bc2ede5328 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 20 Jan 2021 16:23:16 +0100 Subject: kallsyms: refactor {,module_}kallsyms_on_each_symbol Require an explicit call to module_kallsyms_on_each_symbol to look for symbols in modules

Re: [PATCH v2] ext4: Enable code path when DX_DEBUG is set

2021-02-01 Thread Christoph Hellwig
DX_DEBUG is completely dead code, so either kill it off or make it an actual CONFIG_* symbol through Kconfig if it seems useful.

Re: [PATCH 05/13] kallsyms: refactor {,module_}kallsyms_on_each_symbol

2021-02-01 Thread Christoph Hellwig
On Fri, Jan 29, 2021 at 10:43:36AM +0100, Petr Mladek wrote: > > --- a/kernel/livepatch/core.c > > +++ b/kernel/livepatch/core.c > > @@ -164,12 +164,8 @@ static int klp_find_object_symbol(const char *objname, > > const char *name, > > .pos = sympos, > > }; > > > > -

Re: [PATCH 04/13] module: use RCU to synchronize find_module

2021-02-01 Thread Christoph Hellwig
On Fri, Jan 29, 2021 at 04:29:02PM +0100, Miroslav Benes wrote: > > > > - mutex_lock(_mutex); > > + rcu_read_lock_sched(); > > /* > > * We do not want to block removal of patched modules and therefore > > * we do not take a reference here. The patches are removed by > > @@

Re: [PATCH 09/11] x86/fault: Rename no_context() to kernelmode_fixup_or_oops()

2021-02-01 Thread Christoph Hellwig
On Sun, Jan 31, 2021 at 09:24:40AM -0800, Andy Lutomirski wrote: > + kernelmode_fixup_or_oops(regs, error_code, address, pkey, > si_code); > if (!user_mode(regs)) { > - no_context(regs, error_code, address, SIGBUS, BUS_ADRERR); > +

Re: [PATCH 06/11] x86/fault: Improve kernel-executing-user-memory handling

2021-02-01 Thread Christoph Hellwig
On Sun, Jan 31, 2021 at 09:24:37AM -0800, Andy Lutomirski wrote: > #if defined(CONFIG_X86_64) && defined(CONFIG_CPU_SUP_AMD) > + if (likely(boot_cpu_data.x86_vendor != X86_VENDOR_AMD > +|| boot_cpu_data.x86 != 0xf)) Same nitpick as for the other patch. Maybe we wan a little

Re: [PATCH 01/11] x86/fault: Fix AMD erratum #91 errata fixup for user code

2021-02-01 Thread Christoph Hellwig
On Sun, Jan 31, 2021 at 09:24:32AM -0800, Andy Lutomirski wrote: > While we're at it, disable the workaround on all CPUs except AMD Family > 0xF. By my reading of the Revision Guide for AMD Athlon™ 64 and AMD > Opteron™ Processors, only family 0xF is affected. I think it would be better to have

Re: [PATCH] x86: Remove unnecessary kmap() from sgx_ioc_enclave_init()

2021-02-01 Thread Christoph Hellwig
On Fri, Jan 29, 2021 at 09:37:30AM -0800, Sean Christopherson wrote: > On Thu, Jan 28, 2021, ira.we...@intel.com wrote: > > From: Ira Weiny > > > > There is no reason to alloc a page and kmap it to store this temporary > > data from the user. > > Actually, there is, it's just poorly

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

2021-01-28 Thread Christoph Hellwig
Everything except the individual CFLAGS flags looks fine to me, so for all the patches except for the CFLAGS changes: Reviewed-by: Christoph Hellwig

Re: [PATCH] block: remove typo in kernel-doc of set_disk_ro()

2021-01-28 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 04/13] module: use RCU to synchronize find_module

2021-01-28 Thread Christoph Hellwig
On Thu, Jan 28, 2021 at 05:50:56PM -0300, Thiago Jung Bauermann wrote: > > struct module *find_module(const char *name) > > { > > - module_assert_mutex(); > > Does it make sense to replace the assert above with the warn below (untested)? > > RCU_LOCKDEP_WARN(rcu_read_lock_sched_held());

Re: [PATCH 01/20] ata: ahci_dm816: Ignore -Woverride-init

2021-01-28 Thread Christoph Hellwig
On Thu, Jan 28, 2021 at 06:02:20PM +, Lee Jones wrote: > Some ATA drivers use the SCSI host template, a series of interwoven > macros, to aid with initialisation. Some of these macros conflict, > resulting in the over-writing of previously set values. Please just disable this warning

[PATCH 07/13] module: mark module_mutex static

2021-01-28 Thread Christoph Hellwig
Except for two lockdep asserts module_mutex is only used in module.c. Remove the two asserts given that the functions they are in are not exported and just called from the module code, and mark module_mutex static. Signed-off-by: Christoph Hellwig --- include/linux/module.h | 2 -- kernel

[PATCH 10/13] module: pass struct find_symbol_args to find_symbol

2021-01-28 Thread Christoph Hellwig
Simplify the calling convention by passing the find_symbol_args structure to find_symbol instead of initializing it inside the function. Signed-off-by: Christoph Hellwig --- kernel/module.c | 113 ++-- 1 file changed, 52 insertions(+), 61 deletions

[PATCH 11/13] module: move struct symsearch to module.c

2021-01-28 Thread Christoph Hellwig
struct symsearch is only used inside of module.h, so move the definition out of module.h. Signed-off-by: Christoph Hellwig --- include/linux/module.h | 11 --- kernel/module.c| 11 +++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/linux

[PATCH 12/13] module: remove EXPORT_SYMBOL_GPL_FUTURE

2021-01-28 Thread Christoph Hellwig
As far as I can tell this has never been used at all, and certainly not any time recently. Signed-off-by: Christoph Hellwig --- arch/x86/tools/relocs.c | 4 ++-- include/asm-generic/vmlinux.lds.h | 14 -- include/linux/export.h| 1 - include/linux/module.h

[PATCH 04/13] module: use RCU to synchronize find_module

2021-01-28 Thread Christoph Hellwig
Allow for a RCU-sched critical section around find_module, following the lower level find_module_all helper, and switch the two callers outside of module.c to use such a RCU-sched critical section instead of module_mutex. Signed-off-by: Christoph Hellwig --- include/linux/module.h | 2

Re: [PATCH 2/3] Add swiotlb offset preserving mapping when dma_dma_parameters->page_offset_mask is non zero.

2021-01-28 Thread Christoph Hellwig
On Wed, Jan 27, 2021 at 04:38:28PM -0800, Jianxiong Gao wrote: > For devices that need to preserve address offset on mapping through > swiotlb, this patch adds offset preserving based on page_offset_mask > and keeps the offset if the mask is non zero. This is needed for > device drivers like NVMe.

Re: [PATCH 1/3] Adding page_offset_mask to device_dma_parameters

2021-01-28 Thread Christoph Hellwig
On Thu, Jan 28, 2021 at 05:27:25PM +, Robin Murphy wrote: > On 2021-01-28 00:38, Jianxiong Gao wrote: >> Some devices rely on the address offset in a page to function >> correctly (NVMe driver as an example). These devices may use >> a different page size than the Linux kernel. The address

module loader dead code removal and cleanups v2

2021-01-28 Thread Christoph Hellwig
Hi all, this series removes support for long term unused export types and cleans up various loose ends in the module loader. Changes since v1: - move struct symsearch to module.c - rework drm to not call find_module at all - llow RCU-sched locking for find_module - keep find_module as a

[PATCH 03/13] module: unexport find_module and module_mutex

2021-01-28 Thread Christoph Hellwig
find_module is not used by modular code any more, and random driver code has no business calling it to start with. Signed-off-by: Christoph Hellwig --- kernel/module.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/module.c b/kernel/module.c index 4bf30e4b3eaaa1..981302f616b411

[PATCH 01/13] powerpc/powernv: remove get_cxl_module

2021-01-28 Thread Christoph Hellwig
The static inline get_cxl_module function is entirely unused since commit 8bf6b91a5125a ("Revert "powerpc/powernv: Add support for the cxl kernel api on the real phb"), so remove it. Signed-off-by: Christoph Hellwig Reviewed-by: Andrew Donnellan --- arch/powerpc/platforms/po

Re: [PATCH 03/13] livepatch: refactor klp_init_object

2021-01-28 Thread Christoph Hellwig
On Thu, Jan 28, 2021 at 05:22:40PM +0100, Christoph Hellwig wrote: > > We need to either update the function description or keep this check. > > > > I prefer to keep the check. The function does the right thing also > > for the object "vmlinux". Also the livepa

Re: [PATCH 03/13] livepatch: refactor klp_init_object

2021-01-28 Thread Christoph Hellwig
On Wed, Jan 27, 2021 at 01:58:21PM +0100, Petr Mladek wrote: > > --- a/kernel/livepatch/core.c > > +++ b/kernel/livepatch/core.c > > @@ -54,9 +54,6 @@ static void klp_find_object_module(struct klp_object *obj) > > { > > struct module *mod; > > > > - if (!klp_is_module(obj)) > > -

Re: [PATCH 13/13] module: remove EXPORY_UNUSED_SYMBOL*

2021-01-28 Thread Christoph Hellwig
On Wed, Jan 27, 2021 at 02:49:38PM +0100, Jessica Yu wrote: >> #ifdef CONFIG_MODULE_SIG >> /* Signature was verified. */ >> bool sig_ok; >> @@ -592,7 +580,6 @@ struct symsearch { >> GPL_ONLY, >> WILL_BE_GPL_ONLY, >> } license; >> -bool unused; >> }; >

Re: [PATCH 6/6] media: uvcvideo: Use dma_alloc_noncontiguos API

2021-01-28 Thread Christoph Hellwig
I just included this patch as-is, but here are a few comments: On Thu, Jan 28, 2021 at 03:58:37PM +0100, Christoph Hellwig wrote: > +static void uvc_urb_dma_sync(struct uvc_urb *uvc_urb, bool for_device) > +{ > + struct device *dma_dev = dma_dev = stream_to_dmadev(uvc_ur

[PATCH 4/6] dma-iommu: refactor iommu_dma_alloc_remap

2021-01-28 Thread Christoph Hellwig
Split out a new helper that only allocates a sg_table worth of memory without mapping it into contiguous kernel address space. Signed-off-by: Christoph Hellwig --- drivers/iommu/dma-iommu.c | 66 +-- 1 file changed, 35 insertions(+), 31 deletions(-) diff

[PATCH 6/6] media: uvcvideo: Use dma_alloc_noncontiguos API

2021-01-28 Thread Christoph Hellwig
qty: 299.264 avg 318.080 std 1.615 min 2806.667 max (uS) raw decode speed: 365.470 Mbits/s raw URB handling speed: 295.986 Mbits/s throughput: 13.136 Mbits/s URB decode CPU usage 3.594500 % Signed-off-by: Ricardo Ribalda Signed-off-by: Christoph Hellwig --- drivers/media/usb/uvc/uvc_

[PATCH 2/6] dma-mapping: add a dma_mmap_pages helper

2021-01-28 Thread Christoph Hellwig
Add a helper to map memory allocated using dma_alloc_pages into a user address space, similar to the dma_alloc_attrs function for coherent allocations. Signed-off-by: Christoph Hellwig --- Documentation/core-api/dma-api.rst | 10 ++ include/linux/dma-mapping.h| 2 ++ kernel/dma

[PATCH 5/6] dma-iommu: implement ->alloc_noncontiguous

2021-01-28 Thread Christoph Hellwig
Implement support for allocating a non-contiguous DMA region. Signed-off-by: Christoph Hellwig --- drivers/iommu/dma-iommu.c | 47 +++ 1 file changed, 47 insertions(+) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index 65af875ba8495c

[PATCH 3/6] dma-mapping: add a dma_alloc_noncontiguous API

2021-01-28 Thread Christoph Hellwig
of the recently removed and never fully implemented DMA_ATTR_NON_CONSISTENT Signed-off-by: Christoph Hellwig --- Documentation/core-api/dma-api.rst | 72 +++ include/linux/dma-map-ops.h| 20 +++ include/linux/dma-mapping.h| 34 +++ kernel/dma/mapping.c

[PATCH 1/6] dma-mapping: remove the {alloc,free}_noncoherent methods

2021-01-28 Thread Christoph Hellwig
later. Signed-off-by: Christoph Hellwig --- Documentation/core-api/dma-api.rst | 64 ++ drivers/iommu/dma-iommu.c | 30 -- include/linux/dma-map-ops.h| 5 --- include/linux/dma-mapping.h| 17 ++-- kernel/dma/mapping.c

add a new dma_alloc_noncontiguous API

2021-01-28 Thread Christoph Hellwig
Hi all, this series adds the new noncontiguous DMA allocation API requested by various media driver maintainers.

Re: [PATCH 1/2] quota: Add mountpath based quota support

2021-01-28 Thread Christoph Hellwig
> + uint cmds, type; > + struct super_block *sb = NULL; I don't think sb needs the NULL initialization. > + struct path path, *pathp = NULL; > + struct path mountpath; > + bool excl = false, thawed = false; > + int ret; > + > + cmds = cmd >> SUBCMDSHIFT; > + type

Re: [PATCH RFC] gcc-plugins: Handle GCC version mismatch for OOT modules

2021-01-28 Thread Christoph Hellwig
On Wed, Jan 27, 2021 at 12:51:13PM -0600, Josh Poimboeuf wrote: > Is this a joke? I've never met anybody who builds OOT modules as a > development aid... I'm pretty sure you've met me before. > On the other hand I know of several very popular distros (some paid, > some not) who rely on allowing

Re: [PATCH 2/2] nds32: use get_kernel_nofault in dump_mem

2021-01-28 Thread Christoph Hellwig
On Tue, Jul 21, 2020 at 01:28:00PM +0200, Christoph Hellwig wrote: > Can you pich the patches up in the nds32 tree for Linus? There are > not short-term dependencies on them. It seems like these patches are still sitting in linux-next and never made it to Linus/

Re: [PATCH 2/2] xfs: set WQ_SYSFS on all workqueues in debug mode

2021-01-28 Thread Christoph Hellwig
On Wed, Jan 27, 2021 at 10:03:36PM -0800, Darrick J. Wong wrote: > From: Darrick J. Wong > > When CONFIG_XFS_DEBUG=y, set WQ_SYSFS on all workqueues that we create > so that we (developers) have a means to monitor cpu affinity and whatnot > for background workers. In the next patchset we'll

Re: [PATCH 1/1] dma-buf: heaps: Map system heap pages as managed by linux vm

2021-01-28 Thread Christoph Hellwig
On Thu, Jan 28, 2021 at 12:38:17AM -0800, Suren Baghdasaryan wrote: > Currently system heap maps its buffers with VM_PFNMAP flag using > remap_pfn_range. This results in such buffers not being accounted > for in PSS calculations because vm treats this memory as having no > page structs. Without

Re: [PATCH v3 5/6] media: uvcvideo: Use dma_alloc_noncontiguos API

2021-01-28 Thread . Christoph Hellwig
On Wed, Jan 27, 2021 at 10:35:02PM +0100, Ricardo Ribalda wrote: > I have used the current API here: > > https://git.kernel.org/pub/scm/linux/kernel/git/ribalda/linux.git/log/?h=uvc-noncontiguous > > And I think the result is very clean. Great work! > > I have tested it in X86 and in arm64,

Re: [PATCH RFC] gcc-plugins: Handle GCC version mismatch for OOT modules

2021-01-27 Thread Christoph Hellwig
On Wed, Jan 27, 2021 at 12:38:56PM -0600, Josh Poimboeuf wrote: > On Wed, Jan 27, 2021 at 06:02:15PM +0000, Christoph Hellwig wrote: > > Please don't add all this garbage. We only add infrastructure to the > > kernel for what the kernel itself needs, not for weird out of tree >

Re: [PATCH net-next v4 0/4] remove compat_alloc_user_space()

2021-01-27 Thread Christoph Hellwig
Just curious: what is the status of the various compat_alloc_user_space removal patches? It would be great to kill the function off for good.

Re: [PATCH] usb: dwc3: add EXPORT_SYMBOL_GPL for role init functions

2021-01-27 Thread Christoph Hellwig
On Tue, Jan 26, 2021 at 05:49:13PM +0800, Ray Chi wrote: > Currently, role init functions are used in dwc3 driver but > can't be called from kernel modules. > dwc3_host_init > dwc3_host_exit > dwc3_gadget_init > dwc3_gadget_exit > dwc3_event_buffers_setup > dwc3_event_buffers_cleanup >

Re: [PATCH RFC] gcc-plugins: Handle GCC version mismatch for OOT modules

2021-01-27 Thread Christoph Hellwig
On Tue, Jan 26, 2021 at 06:44:44AM -0600, Justin Forbes wrote: > Support and enforce are 2 completely different things. To shed a bit > more light on this, the real issue that prompted this was breaking CI > systems. As we enabled gcc plugins in Fedora, and the toolchain folks > went through 3

Re: [PATCH RFC] gcc-plugins: Handle GCC version mismatch for OOT modules

2021-01-27 Thread Christoph Hellwig
Please don't add all this garbage. We only add infrastructure to the kernel for what the kernel itself needs, not for weird out of tree infrastructure. On Mon, Jan 25, 2021 at 02:42:10PM -0600, Josh Poimboeuf wrote: > When building out-of-tree kernel modules, the build system doesn't > require

Re: [PATCH] fs: export kern_path_locked

2021-01-27 Thread Christoph Hellwig
On Mon, Jan 25, 2021 at 06:49:37PM +0300, Denis Kirjanov wrote: > the function is used outside and we have a prototype > defined in namei.h Huh? It is only used in drivers/base/devtmpfs.c, and kernel/audit_*.c. Absolutely no need to export it for that.

Re: [RFC PATCH v1 2/4] vfio: Add a page fault handler

2021-01-27 Thread Christoph Hellwig
On Mon, Jan 25, 2021 at 05:04:00PM +0800, Shenming Lu wrote: > +EXPORT_SYMBOL_GPL(vfio_iommu_dev_fault_handler); This function is only used in vfio.c itself, so it should not be exported, but rather marked static.

Re: [PATCH] bcache: dont reset bio opf in bch_data_insert_start

2021-01-27 Thread Christoph Hellwig
But the old code is also completely broken. We can't just OR in the op, as that implicitly assumes the old op was 0 (REQ_OP_READ). Please fix this to explicitly set the exact op and flags that you want instead of this fragile magic.

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-01-27 Thread Christoph Hellwig
Thanks, applied to nvme-5.11.

Re: [PATCH RESEND] dma-mapping: benchmark: fix kernel crash when dma_map_single fails

2021-01-27 Thread Christoph Hellwig
Thanks, applied.

Re: [PATCH] Revert "block: simplify set_init_blocksize" to regain lost performance

2021-01-27 Thread Christoph Hellwig
While this code is gross, I think we need to add it back for now: Acked-by: Christoph Hellwig I'll put converting the block device buffered I/O path to iomap or an iomap lookalike on the backburner to fix this..

Re: [PATCH v3 5/6] media: uvcvideo: Use dma_alloc_noncontiguos API

2021-01-27 Thread . Christoph Hellwig
On Wed, Jan 27, 2021 at 12:29:08AM +0100, Ricardo Ribalda wrote: > - Is there any platform where dma_alloc_noncontiguos can fail? > This is, !ops->alloc_noncontiguous and !dev->coherent_dma_mask > If yes then we need to add a function to let the driver know in > advance that it has to use the

Re: [RFC 0/2] Kbuild: Support nested composite objects

2021-01-27 Thread Christoph Hellwig
On Fri, Jan 22, 2021 at 11:27:16AM -0800, Elliot Berman wrote: > This series was developed after discussion in > https://lkml.org/lkml/2021/1/19/850 > > The motivation for this series is an out-of-tree module which contains a large > number of source files. This causes Kbuild to exceed the

Re: [PATCH 2/5] kernel/dma: remove unnecessary unmap_kernel_range

2021-01-26 Thread Christoph Hellwig
On Tue, Jan 26, 2021 at 05:08:46PM -0500, Konrad Rzeszutek Wilk wrote: > On Tue, Jan 26, 2021 at 02:54:01PM +1000, Nicholas Piggin wrote: > > vunmap will remove ptes. > > Should there be some ASSERT after the vunmap to make sure that is the > case? Not really. removing the PTEs is the whole

Re: linux-next: build warning after merge of the pidfd tree

2021-01-26 Thread Christoph Hellwig
On Wed, Jan 27, 2021 at 09:41:01AM +1100, Stephen Rothwell wrote: > Hi all, > > After merging the pidfd tree, today's linux-next build (powerpc > ppc64_defconfig) produced this warning: > > fs/xfs/xfs_ioctl32.c: In function 'xfs_file_compat_ioctl': > fs/xfs/xfs_ioctl32.c:441:20: warning: unused

Re: [PATCH v3 5/6] media: uvcvideo: Use dma_alloc_noncontiguos API

2021-01-26 Thread . Christoph Hellwig
Please take a quick look at this branch: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/dma_alloc_noncontiguous Warning: hot off the press, and only with the v4l conversion as that seemed at little easier than uvcvideo.

Re: [PATCH 2/3] blk-mq: Always complete remote completions requests in softirq

2021-01-26 Thread Christoph Hellwig
On Mon, Jan 25, 2021 at 09:30:29AM +0100, Sebastian Andrzej Siewior wrote: > On 2021-01-25 08:25:42 [+], Christoph Hellwig wrote: > > On Mon, Jan 25, 2021 at 08:10:16AM +0100, Hannes Reinecke wrote: > > > I don't get this. > > > This code is about _avoiding

Re: [PATCH] fs/pipe: allow sendfile() to pipe again

2021-01-26 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 3/3 v2] blk-mq: Use llist_head for blk_cpu_done

2021-01-26 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 3/5] powerpc/xive: remove unnecessary unmap_kernel_range

2021-01-26 Thread Christoph Hellwig
On Tue, Jan 26, 2021 at 02:54:02PM +1000, Nicholas Piggin wrote: > iounmap will remove ptes. Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH v11 04/13] mm/ioremap: rename ioremap_*_range to vmap_*_range

2021-01-26 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH v4 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2021-01-26 Thread Christoph Hellwig
> +config DMABUF_HEAPS_CHUNK > + bool "DMA-BUF CHUNK Heap" > + depends on DMABUF_HEAPS && DMA_CMA > + help > + Choose this option to enable dma-buf CHUNK heap. This heap is backed > + by the Contiguous Memory Allocator (CMA) and allocates the buffers > that > + are

Re: [PATCH v3 1/2] bio: limit bio max size

2021-01-26 Thread Christoph Hellwig
On Tue, Jan 26, 2021 at 11:57:48AM +0800, Ming Lei wrote: > > *same_page = false; > > return false; > > } > > So far we don't need bio->bi_disk or bio->bi_bdev(will be changed in > Christoph's patch) during adding page to

Re: [PATCH 2/5] kernel/dma: remove unnecessary unmap_kernel_range

2021-01-26 Thread Christoph Hellwig
On Tue, Jan 26, 2021 at 02:54:01PM +1000, Nicholas Piggin wrote: > vunmap will remove ptes. Looks good, Reviewed-by: Christoph Hellwig

<    2   3   4   5   6   7   8   9   10   11   >