Re: [PATCH v15 10/12] swiotlb: Add restricted DMA pool initialization

2021-08-27 Thread Andy Shevchenko
urn -EINVAL; > + } > + > + rmem->ops = _swiotlb_ops; > + pr_info("Reserved memory: created restricted DMA pool at %pa, size > %ld MiB\n", > + >base, (unsigned long)rmem->size / SZ_1M); Oh là là, besides explicit casting tha

Re: [PATCH v1 1/2] iommu/vt-d: Move intel_iommu_ops to header file

2021-08-11 Thread Andy Shevchenko
On Wed, Aug 11, 2021 at 10:02:48PM +0800, Lu Baolu wrote: > On 2021/8/11 21:49, Andy Shevchenko wrote: > > On Fri, Jul 30, 2021 at 09:01:41PM +0800, Lu Baolu wrote: > > > On 2021/7/30 16:05, Andy Shevchenko wrote: > > > > On Fri, Jul 30, 2021 at 10:20:08AM +0800, Lu

Re: [PATCH v1 1/2] iommu/vt-d: Move intel_iommu_ops to header file

2021-08-11 Thread Andy Shevchenko
On Fri, Jul 30, 2021 at 09:01:41PM +0800, Lu Baolu wrote: > On 2021/7/30 16:05, Andy Shevchenko wrote: > > On Fri, Jul 30, 2021 at 10:20:08AM +0800, Lu Baolu wrote: > > > On 7/30/21 12:35 AM, Andy Shevchenko wrote: > > > > Compiler is not happy about hidden

Re: [PATCH v1 1/2] iommu/vt-d: Move intel_iommu_ops to header file

2021-07-30 Thread Andy Shevchenko
On Fri, Jul 30, 2021 at 10:20:08AM +0800, Lu Baolu wrote: > On 7/30/21 12:35 AM, Andy Shevchenko wrote: > > Compiler is not happy about hidden declaration of intel_iommu_ops. > > > > .../drivers/iommu/intel/iommu.c:414:24: warning: symbol 'intel_iommu_ops' > &g

[PATCH v1 1/2] iommu/vt-d: Move intel_iommu_ops to header file

2021-07-29 Thread Andy Shevchenko
Compiler is not happy about hidden declaration of intel_iommu_ops. .../drivers/iommu/intel/iommu.c:414:24: warning: symbol 'intel_iommu_ops' was not declared. Should it be static? Move declaration to header file to make compiler happy. Signed-off-by: Andy Shevchenko --- drivers/iommu/intel

[PATCH v1 2/2] iommu/vt-d: Drop the kernel doc annotation

2021-07-29 Thread Andy Shevchenko
the top comment is not in the required format. Signed-off-by: Andy Shevchenko --- drivers/iommu/intel/perf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/intel/perf.c b/drivers/iommu/intel/perf.c index 73b7ec705552..0e8e03252d92 100644 --- a/drivers/iommu/intel

Re: [RESEND v2] iommu/vt-d: Use passthrough mode for the Intel IPUs

2021-04-20 Thread Andy Shevchenko
On Tue, Apr 20, 2021 at 05:37:27PM +0300, Sakari Ailus wrote: > On Tue, Apr 20, 2021 at 02:55:33PM +0300, Andy Shevchenko wrote: > > On Tue, Apr 20, 2021 at 01:56:40PM +0300, Sakari Ailus wrote: > > > On Tue, Apr 20, 2021 at 06:34:26PM +0800, Bingbu Cao wrote: > > >

Re: [RESEND v2] iommu/vt-d: Use passthrough mode for the Intel IPUs

2021-04-20 Thread Andy Shevchenko
On Tue, Apr 20, 2021 at 01:56:40PM +0300, Sakari Ailus wrote: > On Tue, Apr 20, 2021 at 06:34:26PM +0800, Bingbu Cao wrote: > > On 4/20/21 6:20 PM, Andy Shevchenko wrote: > > > On Tue, Apr 20, 2021 at 10:48:33AM +0800, Bingbu Cao wrote: ... > > > This misses the

Re: [RESEND v2] iommu/vt-d: Use passthrough mode for the Intel IPUs

2021-04-20 Thread Andy Shevchenko
I'm wondering if IPU MMU should be described properly in the DMAR table. -- With Best Regards, Andy Shevchenko ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [RESEND v2] iommu/vt-d: Use passthrough mode for the Intel IPUs

2021-04-20 Thread Andy Shevchenko
> > Fixes: 26f5689592e2 ("media: staging/intel-ipu3: mmu: Implement driver") > Signed-off-by: Bingbu Cao > --- > drivers/iommu/intel/iommu.c | 29 + This misses the changelog from v1 followed by the expla

Re: [PATCH V2 3/3] Adding device_dma_parameters->offset_preserve_mask to NVMe driver.

2021-02-02 Thread Andy Shevchenko
\n"); -- With Best Regards, Andy Shevchenko ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH V2 3/3] Adding device_dma_parameters->offset_preserve_mask to NVMe driver.

2021-02-01 Thread Andy Shevchenko
ev_warn(dev->dev, "dma_set_min_align_mask failed to reset > offset\n"); > + goto out_free_sg; > + } Seems like rebasing effect which makes empty line goes in the middle of some other group of code lines. > if (!nr_mapped) >

Re: [PATCH v3] swiotlb: Adjust SWIOTBL bounce buffer size for SEV guests.

2020-11-04 Thread Andy Shevchenko
e) { > + size = ALIGN(size, 1 << IO_TLB_SHIFT); > + io_tlb_nslabs = size >> IO_TLB_SHIFT; > + io_tlb_nslabs = ALIGN(io_tlb_nslabs, > IO_TLB_SEGSIZE); > + > + pr_info("architecture adjusted SWIOTLB slabs = > %lu\n", > + io_tlb_nslabs); > + } > + } > +} > + > void swiotlb_print_info(void) > { > unsigned long bytes = io_tlb_nslabs << IO_TLB_SHIFT; > -- > 2.17.1 > > -- With Best Regards, Andy Shevchenko ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v2 1/3] swiotlb: Use %pa to print phys_addr_t variables

2020-09-09 Thread Andy Shevchenko
On Wed, Sep 02, 2020 at 11:02:46PM -0300, Fabio Estevam wrote: > On Wed, Sep 2, 2020 at 2:31 PM Andy Shevchenko > wrote: > > > > There is an extension to a %p to print phys_addr_t type of variables. > > Use it here. > > > > Signed-off-by: Andy Shevchenko >

[PATCH v2 3/3] swiotlb: Mark max_segment with static keyword

2020-09-02 Thread Andy Shevchenko
Sparse is not happy about max_segment declaration: CHECK kernel/dma/swiotlb.c kernel/dma/swiotlb.c:96:14: warning: symbol 'max_segment' was not declared. Should it be static? Mark it static as suggested. Signed-off-by: Andy Shevchenko --- v2: no change kernel/dma/swiotlb.c | 2 +- 1

[PATCH v2 1/3] swiotlb: Use %pa to print phys_addr_t variables

2020-09-02 Thread Andy Shevchenko
There is an extension to a %p to print phys_addr_t type of variables. Use it here. Signed-off-by: Andy Shevchenko --- v2: dropped bytes replacement (Fabio) kernel/dma/swiotlb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c

[PATCH v2 2/3] swiotlb: Declare swiotlb_late_init_with_default_size() in header

2020-09-02 Thread Andy Shevchenko
) | ^~~ Since it's used outside of the module, move its declaration to the header from the user. Signed-off-by: Andy Shevchenko --- v2: no change arch/x86/pci/sta2x11-fixup.c | 1 - include/linux/swiotlb.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH v1] iommu/vt-d: Move intel_iommu_ops to header file

2020-08-31 Thread Andy Shevchenko
On Sat, Aug 29, 2020 at 07:58:46AM +0100, Christoph Hellwig wrote: > On Fri, Aug 28, 2020 at 07:05:02PM +0300, Andy Shevchenko wrote: > > Compiler is not happy about hidden declaration of intel_iommu_ops. > > > > .../drivers/iommu/intel/iommu.c:414:24: warning: sy

[PATCH v1] iommu/vt-d: Move intel_iommu_gfx_mapped to Intel IOMMU header

2020-08-28 Thread Andy Shevchenko
Static analyzer is not happy about intel_iommu_gfx_mapped declaration: .../drivers/iommu/intel/iommu.c:364:5: warning: symbol 'intel_iommu_gfx_mapped' was not declared. Should it be static? Move its declaration to Intel IOMMU header file. Signed-off-by: Andy Shevchenko --- include/drm/intel

[PATCH v1] iommu/vt-d: Move intel_iommu_ops to header file

2020-08-28 Thread Andy Shevchenko
Compiler is not happy about hidden declaration of intel_iommu_ops. .../drivers/iommu/intel/iommu.c:414:24: warning: symbol 'intel_iommu_ops' was not declared. Should it be static? Move declaration to header file to make compiler happy. Signed-off-by: Andy Shevchenko --- drivers/iommu/intel

[PATCH v1] iommu/dma: Use DMA ops setter instead of direct assignment

2020-08-28 Thread Andy Shevchenko
Use DMA ops setter instead of direct assignment. Even we know that this module doesn't perform access to the dma_ops member of struct device, it's better to use setter to avoid potential problems in the future. Signed-off-by: Andy Shevchenko --- drivers/iommu/dma-iommu.c | 2 +- 1 file changed

Re: [PATCH v11 07/11] device-mapping: Introduce DMA range map, supplanting dma_pfn_offset

2020-08-25 Thread Andy Shevchenko
an assignment of offset here? > + if (!offset) > + return 0; > + > + map = kcalloc(2, sizeof(*map), GFP_KERNEL); > + if (!map) > + return -ENOMEM; > + map[0].cpu_start = cpu_start; > + map[0].dma_start = dma_start; > + map[0].offset = offset; > + map[0].size = size; > + dev->dma_range_map = map; > + > + return 0; > +} -- With Best Regards, Andy Shevchenko ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH RESEND v10 07/11] device-mapping: Introduce DMA range map, supplanting dma_pfn_offset

2020-08-21 Thread Andy Shevchenko
On Thu, Aug 20, 2020 at 09:37:12AM -0400, Jim Quinlan wrote: > On Tue, Aug 18, 2020 at 4:14 AM Andy Shevchenko > wrote: > > On Mon, Aug 17, 2020 at 05:53:09PM -0400, Jim Quinlan wrote: ... > > > +static inline u64 dma_offset_from_dma_addr(struct device *dev, >

Re: [PATCH v1 1/3] swiotlb: Use %pa to print phys_addr_t variables

2020-08-19 Thread Andy Shevchenko
On Wed, Aug 19, 2020 at 02:24:10PM -0300, Fabio Estevam wrote: > On Wed, Aug 19, 2020 at 2:16 PM Andy Shevchenko > wrote: > > > - unsigned long bytes = io_tlb_nslabs << IO_TLB_SHIFT; > > + unsigned long mb = (io_tlb_nslabs << IO_TLB_SHIFT) >>

[PATCH v1 3/3] swiotlb: Mark max_segment with static keyword

2020-08-19 Thread Andy Shevchenko
Sparse is not happy about max_segment declaration: CHECK kernel/dma/swiotlb.c kernel/dma/swiotlb.c:96:14: warning: symbol 'max_segment' was not declared. Should it be static? Mark it static as suggested. Signed-off-by: Andy Shevchenko --- kernel/dma/swiotlb.c | 2 +- 1 file changed, 1

[PATCH v1 2/3] swiotlb: Declare swiotlb_late_init_with_default_size() in header

2020-08-19 Thread Andy Shevchenko
) | ^~~ Since it's used outside of the module, move its declaration to the header from the user. Signed-off-by: Andy Shevchenko --- arch/x86/pci/sta2x11-fixup.c | 3 ++- include/linux/swiotlb.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/pci

[PATCH v1 1/3] swiotlb: Use %pa to print phys_addr_t variables

2020-08-19 Thread Andy Shevchenko
There is an extension to a %p to print phys_addr_t type of variables. Use it here. Signed-off-by: Andy Shevchenko --- kernel/dma/swiotlb.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index c19379fabd20..676ccf0e49d3

Re: [PATCH RESEND v10 07/11] device-mapping: Introduce DMA range map, supplanting dma_pfn_offset

2020-08-18 Thread Andy Shevchenko
; + int num_ranges; > + struct bus_dma_region *new_map; > + const struct bus_dma_region *r = map; > + > + for (num_ranges = 0; r->size; num_ranges++) > + r++; > + new_map = kcalloc(num_ranges + 1, sizeof(*map), GFP_KERNEL); > + if (new_map) > + memcpy(new_map, map, sizeof(*map) * num_ranges); Looks like krealloc() on the first glance... > + > + return new_map; > +} -- With Best Regards, Andy Shevchenko ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v6 08/12] device core: Introduce DMA range map, supplanting dma_pfn_offset

2020-07-02 Thread Andy Shevchenko
R_ERR_OR_ZERO() ... > + = dma_offset_from_phys_addr(dev, > PFN_PHYS(mem->pfn_base)); > + > + return (dma_addr_t)PFN_PHYS(mem->pfn_base) - dma_offset; Looking at this more, I think you need to introduce in the same header (pfn.h) something like:

Re: [PATCH 4/4] pci: export untrusted attribute in sysfs

2020-06-18 Thread Andy Shevchenko
On Thu, Jun 18, 2020 at 6:04 PM Rajat Jain wrote: > On Thu, Jun 18, 2020 at 2:14 AM Andy Shevchenko > wrote: ... > To clarify, the attribute exposed by the firmware today is > "ExternalFacingPort" and "external-facing" respectively: > > 617654aae50e ("

Re: [PATCH 4/4] pci: export untrusted attribute in sysfs

2020-06-18 Thread Andy Shevchenko
On Thu, Jun 18, 2020 at 11:36 AM Greg Kroah-Hartman wrote: > > On Thu, Jun 18, 2020 at 11:12:56AM +0300, Andy Shevchenko wrote: > > On Wed, Jun 17, 2020 at 10:56 PM Rajat Jain wrote: > > > On Wed, Jun 17, 2020 at 12:31 AM Christoph Hellwig > > > wrote: > >

Re: [PATCH 4/4] pci: export untrusted attribute in sysfs

2020-06-18 Thread Andy Shevchenko
of it. What external does mean for M.2. WWAN card in my laptop? It's in ACPI tables, but I can replace it. This is only one example. Or if firmware of some device is altered, and it's internal (whatever it means) is it trusted or not? So, please leave it as is (I mean name). -- With Bes

Re: [PATCH v4 08/12] device core: Introduce multiple dma pfn offsets

2020-06-09 Thread Andy Shevchenko
On Mon, Jun 08, 2020 at 11:48:51AM -0400, Jim Quinlan wrote: > On Sun, Jun 7, 2020 at 12:500f9bfe0fb8840b268af1bbcc51f1cd440514e PM > Andy Shevchenko wrote: > > On Fri, Jun 05, 2020 at 05:26:48PM -0400, Jim Quinlan wrote: ... > > > + *map_size = (num_range

Re: [PATCH v4 08/12] device core: Introduce multiple dma pfn offsets

2020-06-07 Thread Andy Shevchenko
- PFN_DOWN(range.bus_addr); Ditto (indentation). ... > + unsigned long dma_pfn_offset > + = dma_pfn_offset_from_phys_addr(dev, paddr); Ditto. ... > + unsigned long dma_pfn_offset > + = dma_p

Re: [PATCH v3 09/13] device core: Introduce multiple dma pfn offsets

2020-06-04 Thread Andy Shevchenko
e kernel. For example, above line is like pfn = PFN_DOWN(phys); ... > > > + if (!WARN_ON(!dev) && dev->dma_pfn_offset_map) > > > + *dma_handle -= PFN_PHYS( > > > + dma_pfn_offset_from_phys_addr(dev, phys));

Re: [PATCH v2 09/14] device core: Add ability to handle multiple dma offsets

2020-05-26 Thread Andy Shevchenko
gt; +} > + > +static inline unsigned long dma_pfn_offset_from_phys_addr(struct device *dev, > + phys_addr_t paddr) > +{ > + return 0; > +} > +#endif /* CONFIG_DMA_PFN_OFFSET_MAP */ > + > #include > > stat

Re: [PATCH] iommu/amd: Fix get_acpihid_device_id

2020-05-09 Thread Andy Shevchenko
this buffer will be > zeroed. If we pass in a null string, acpi_dev_hid_uid_match will return acpi_dev_hid_uid_match() > false because it will try and match an empty string to the ACPI UID of > the device. Thank you for testing and producing a patch! My comments below, after addressing Reviewe

[PATCH v1 3/3] iommu/amd: Unify format of the printed messages

2020-05-07 Thread Andy Shevchenko
Unify format of the printed messages, i.e. replace printk(LEVEL ... ) with pr_level(...). Signed-off-by: Andy Shevchenko --- drivers/iommu/amd_iommu_types.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu

[PATCH v1 2/3] iommu/iova: Unify format of the printed messages

2020-05-07 Thread Andy Shevchenko
Unify format of the printed messages, i.e. replace printk(LEVEL ... ) with pr_level(...). Signed-off-by: Andy Shevchenko --- drivers/iommu/iova.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c index 0e6a9536eca62

[PATCH v1 1/3] iommu/vt-d: Unify format of the printed messages

2020-05-07 Thread Andy Shevchenko
Unify format of the printed messages, i.e. replace printk(LEVEL ... ) with pr_level(...). Signed-off-by: Andy Shevchenko --- drivers/iommu/intel-iommu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index

Re: [PATCH v2 6/6] iommu/amd: Switch to use acpi_dev_hid_uid_match()

2019-10-08 Thread Andy Shevchenko
On Mon, Oct 07, 2019 at 05:28:48PM +0200, Joerg Roedel wrote: > On Tue, Sep 24, 2019 at 10:37:39PM +0300, Andy Shevchenko wrote: > > Since we have a generic helper, drop custom implementation in the driver. > > > > Signed-off-by: Andy Shevchenko > > --- > >

Re: [PATCH v3 0/6] ACPI / utils: add new helper for HID/UID match

2019-10-03 Thread Andy Shevchenko
On Thu, Oct 03, 2019 at 12:00:29PM +0200, Ulf Hansson wrote: > On Tue, 1 Oct 2019 at 16:27, Andy Shevchenko > wrote: > > > > There are few users outside of ACPI realm that re-introduce a custom > > solution to match ACPI device against HID/UID. Add a gen

[PATCH v3 5/6] mmc: sdhci-acpi: Switch to use acpi_dev_hid_uid_match()

2019-10-01 Thread Andy Shevchenko
Since we have a generic helper, drop custom implementation in the driver. Signed-off-by: Andy Shevchenko Reviewed-by: Mika Westerberg --- drivers/mmc/host/sdhci-acpi.c | 49 --- 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/drivers/mmc/host

[PATCH v3 1/6] ACPI / utils: Describe function parameters in kernel-doc

2019-10-01 Thread Andy Shevchenko
parameters where it's appropriate. Signed-off-by: Andy Shevchenko Reviewed-by: Mika Westerberg --- drivers/acpi/utils.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index e3974a8f8fd4..dbd1c4cfd7d1 100644 --- a/drivers/acpi/utils.c +++ b

[PATCH v3 3/6] ACPI / utils: Introduce acpi_dev_hid_uid_match() helper

2019-10-01 Thread Andy Shevchenko
There are users outside of ACPI realm which reimplementing the comparator function to check if the given device matches to given HID and UID. For better utilization, introduce a helper for everyone to use. Signed-off-by: Andy Shevchenko Reviewed-by: Mika Westerberg --- drivers/acpi/utils.c

[PATCH v3 6/6] iommu/amd: Switch to use acpi_dev_hid_uid_match()

2019-10-01 Thread Andy Shevchenko
Since we have a generic helper, drop custom implementation in the driver. Signed-off-by: Andy Shevchenko Reviewed-by: Mika Westerberg --- drivers/iommu/amd_iommu.c | 30 +- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b

[PATCH v3 2/6] ACPI / utils: Move acpi_dev_get_first_match_dev() under CONFIG_ACPI

2019-10-01 Thread Andy Shevchenko
oduce acpi_dev_get_first_match_dev() helper") Reported-by: kbuild test robot Signed-off-by: Andy Shevchenko Reviewed-by: Mika Westerberg --- include/acpi/acpi_bus.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_b

[PATCH v3 4/6] ACPI / LPSS: Switch to use acpi_dev_hid_uid_match()

2019-10-01 Thread Andy Shevchenko
Since we have a generic helper, drop custom implementation in the driver. Signed-off-by: Andy Shevchenko Reviewed-by: Mika Westerberg --- drivers/acpi/acpi_lpss.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi

[PATCH v3 0/6] ACPI / utils: add new helper for HID/UID match

2019-10-01 Thread Andy Shevchenko
due to latent issue in the header (lkp) - get rid of match_hid_uid() completely in patch 6 Andy Shevchenko (6): ACPI / utils: Describe function parameters in kernel-doc ACPI / utils: Move acpi_dev_get_first_match_dev() under CONFIG_ACPI ACPI / utils: Introduce acpi_dev_hid_uid_match() helper

Re: [PATCH v2 5/6] mmc: sdhci-acpi: Switch to use acpi_dev_hid_uid_match()

2019-10-01 Thread Andy Shevchenko
On Tue, Oct 01, 2019 at 03:37:08PM +0300, Adrian Hunter wrote: > On 24/09/19 10:37 PM, Andy Shevchenko wrote: > > Since we have a generic helper, drop custom implementation in the driver. > > - if (strcmp(hid, "QCOM8051")) > > + if (acpi_dev_hid_uid_match(adev

Re: [PATCH v2 3/6] ACPI / utils: Introduce acpi_dev_hid_uid_match() helper

2019-10-01 Thread Andy Shevchenko
On Tue, Oct 01, 2019 at 12:38:54PM +0300, Mika Westerberg wrote: > On Tue, Sep 24, 2019 at 10:37:36PM +0300, Andy Shevchenko wrote: > > There are users outside of ACPI realm which reimplementing the comparator > > function to check if the given device matches to gi

[PATCH v2 2/6] ACPI / utils: Move acpi_dev_get_first_match_dev() under CONFIG_ACPI

2019-09-24 Thread Andy Shevchenko
oduce acpi_dev_get_first_match_dev() helper") Reported-by: kbuild test robot Signed-off-by: Andy Shevchenko --- include/acpi/acpi_bus.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 175f7b40c585..3f6fddeb7

[PATCH v2 3/6] ACPI / utils: Introduce acpi_dev_hid_uid_match() helper

2019-09-24 Thread Andy Shevchenko
There are users outside of ACPI realm which reimplementing the comparator function to check if the given device matches to given HID and UID. For better utilization, introduce a helper for everyone to use. Signed-off-by: Andy Shevchenko --- drivers/acpi/utils.c| 25

[PATCH v2 6/6] iommu/amd: Switch to use acpi_dev_hid_uid_match()

2019-09-24 Thread Andy Shevchenko
Since we have a generic helper, drop custom implementation in the driver. Signed-off-by: Andy Shevchenko --- drivers/iommu/amd_iommu.c | 30 +- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index

[PATCH v2 5/6] mmc: sdhci-acpi: Switch to use acpi_dev_hid_uid_match()

2019-09-24 Thread Andy Shevchenko
Since we have a generic helper, drop custom implementation in the driver. Signed-off-by: Andy Shevchenko --- drivers/mmc/host/sdhci-acpi.c | 49 --- 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host

[PATCH v2 1/6] ACPI / utils: Describe function parameters in kernel-doc

2019-09-24 Thread Andy Shevchenko
parameters where it's appropriate. Signed-off-by: Andy Shevchenko --- drivers/acpi/utils.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index e3974a8f8fd4..dbd1c4cfd7d1 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -455,6

[PATCH v2 0/6] ACPI / utils: add new helper for HID/UID match

2019-09-24 Thread Andy Shevchenko
in patch 6 Andy Shevchenko (6): ACPI / utils: Describe function parameters in kernel-doc ACPI / utils: Move acpi_dev_get_first_match_dev() under CONFIG_ACPI ACPI / utils: Introduce acpi_dev_hid_uid_match() helper ACPI / LPSS: Switch to use acpi_dev_hid_uid_match() mmc: sdhci-acpi: Switch

[PATCH v2 4/6] ACPI / LPSS: Switch to use acpi_dev_hid_uid_match()

2019-09-24 Thread Andy Shevchenko
Since we have a generic helper, drop custom implementation in the driver. Signed-off-by: Andy Shevchenko --- drivers/acpi/acpi_lpss.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index d696f165a50e

Re: [PATCH v1 5/5] iommu/amd: Switch to use acpi_dev_hid_uid_match()

2019-09-24 Thread Andy Shevchenko
On Tue, Sep 24, 2019 at 03:01:53PM +0300, Andy Shevchenko wrote: > Since we have a generic helper, drop custom implementation in the driver. Actually we may get rid of match_hid_uid() completely and thus slightly speed up get_acpihid_device_id(). I'll wait for other comments and then send

[PATCH v1 2/5] ACPI / utils: Introduce acpi_dev_hid_uid_match() helper

2019-09-24 Thread Andy Shevchenko
There are users outside of ACPI realm which reimplementing the comparator function to check if the given device matches to given HID and UID. For better utilization, introduce a helper for everyone to use. Signed-off-by: Andy Shevchenko --- drivers/acpi/utils.c| 25

[PATCH v1 1/5] ACPI / utils: Describe function parameters in kernel-doc

2019-09-24 Thread Andy Shevchenko
parameters where it's appropriate. Signed-off-by: Andy Shevchenko --- drivers/acpi/utils.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index e3974a8f8fd4..dbd1c4cfd7d1 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -455,6

[PATCH v1 3/5] ACPI / LPSS: Switch to use acpi_dev_hid_uid_match()

2019-09-24 Thread Andy Shevchenko
Since we have a generic helper, drop custom implementation in the driver. Signed-off-by: Andy Shevchenko --- drivers/acpi/acpi_lpss.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index d696f165a50e

[PATCH v1 5/5] iommu/amd: Switch to use acpi_dev_hid_uid_match()

2019-09-24 Thread Andy Shevchenko
Since we have a generic helper, drop custom implementation in the driver. Signed-off-by: Andy Shevchenko --- drivers/iommu/amd_iommu.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 61de81965c44

[PATCH v1 4/5] mmc: sdhci-acpi: Switch to use acpi_dev_hid_uid_match()

2019-09-24 Thread Andy Shevchenko
Since we have a generic helper, drop custom implementation in the driver. Signed-off-by: Andy Shevchenko --- drivers/mmc/host/sdhci-acpi.c | 49 --- 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host

Re: [PATCH v5 16/19] iommu/vt-d: Misc macro clean up for SVM

2019-08-15 Thread Andy Shevchenko
On Thu, Aug 15, 2019 at 11:52 PM Jacob Pan wrote: > > Use combined macros for_each_svm_dev() to simplify SVM device iteration > and error checking. > > Suggested-by: Andy Shevchenko > Signed-off-by: Jacob Pan > Reviewed-by: Eric Auger > --- > dri

Re: [PATCH 0/3] Add debugfs support to show scalable mode DMAR table

2019-05-10 Thread Andy Shevchenko
e second patch introduces macros that are used during PASID > table walk and the third patch actually adds support to dump scalable mode > DMAR > table. FWIW, Reviewed-by: Andy Shevchenko Since it's debugfs the format is not carved in stone. > > Sai Praneeth (3): > iommu/

[PATCH v1] iommu/vt-d: Switch to bitmap_zalloc()

2019-03-04 Thread Andy Shevchenko
Switch to bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko --- drivers/iommu/intel_irq_remapping.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers

[PATCH v2] dma-mapping: Move debug configuration options to kernel/dma

2019-02-11 Thread Andy Shevchenko
Christoph Hellwig Signed-off-by: Andy Shevchenko --- v2: Move to kernel/dma/Kconfig directly kernel/dma/Kconfig | 36 lib/Kconfig.debug | 36 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/kernel/dma

Re: [PATCH v1] dma-mapping: Move debug configuration options to kernel/dma

2019-02-11 Thread Andy Shevchenko
On Mon, Feb 11, 2019 at 04:54:50PM +0100, Christoph Hellwig wrote: > On Mon, Feb 11, 2019 at 05:54:09PM +0200, Andy Shevchenko wrote: > > This is a follow up to the commit cf65a0f6f6ff > > > > ("dma-mapping: move all DMA mapping code to kernel/dma") > > &

[PATCH v1] dma-mapping: Move debug configuration options to kernel/dma

2019-02-11 Thread Andy Shevchenko
Christoph Hellwig Signed-off-by: Andy Shevchenko --- kernel/dma/Kconfig | 2 ++ kernel/dma/Kconfig.debug | 36 lib/Kconfig.debug| 36 3 files changed, 38 insertions(+), 36 deletions(-) create mode 100644

Re: [PATCH] dcdbas: Fix Intel-IOMMU domain allocation failure

2019-01-25 Thread Andy Shevchenko
ion and could cause issues. What do you think? -- With Best Regards, Andy Shevchenko ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH] dcdbas: Fix Intel-IOMMU domain allocation failure

2019-01-24 Thread Andy Shevchenko
above code using it too first, followed by this change in dcdbas. Wait... It sounds to me like a part of arch code where we define arch_setup_pdev_archdata() and use this dummy domain. Though dummy domain definition should come from IOMMU framework. -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 9/9] dmapool: debug: prevent endless loop in case of corruption

2018-12-04 Thread Andy Shevchenko
On Tue, Dec 4, 2018 at 11:26 PM Tony Battersby wrote: > > On 12/4/18 3:30 PM, Andy Shevchenko wrote: > > On Tue, Dec 4, 2018 at 10:18 PM Matthew Wilcox wrote: > >> On Tue, Dec 04, 2018 at 12:14:43PM -0800, Andrew Morton wrote: > >>> Also, Andy had issues with

Re: [PATCH v4 9/9] dmapool: debug: prevent endless loop in case of corruption

2018-12-04 Thread Andy Shevchenko
time ago. If I _was_ in Cc list and didn't comment, I'm fine with it. -- With Best Regards, Andy Shevchenko ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v3 08/10] dmapool: improve accuracy of debug statistics

2018-08-08 Thread Andy Shevchenko
% boundary) / size; If boundary is guaranteed to be power of 2, this can avoid cost divisions (though it's a slow path anyway). -- With Best Regards, Andy Shevchenko ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v3 07/10] dmapool: cleanup integer types

2018-08-08 Thread Andy Shevchenko
; the blocks in the entire pool. > else if ((boundary < size) || (boundary & (boundary - 1))) > return NULL; Just a side note: in above it's is_power_of_2() opencoded. -- With Best Regards, Andy Shevchenko ___ iommu maili

Re: [PATCH v2 2/9] dmapool: cleanup error messages

2018-08-03 Thread Andy Shevchenko
On Fri, Aug 3, 2018 at 8:03 PM, Tony Battersby wrote: > On 08/03/2018 12:22 PM, Matthew Wilcox wrote: >> On Fri, Aug 03, 2018 at 06:59:20PM +0300, Andy Shevchenko wrote: >>>>>> I'm pretty sure this was created in an order to avoid bad looking (and >>>>>

Re: [PATCH v2 2/9] dmapool: cleanup error messages

2018-08-03 Thread Andy Shevchenko
On Fri, Aug 3, 2018 at 6:59 PM, Andy Shevchenko wrote: > On Fri, Aug 3, 2018 at 6:17 PM, Tony Battersby wrote: >> But then I decided to simplify it to just use dev_err(). I still have >> the old version. When I submit v3 of the patchset, which would you prefer? > > JFYI

Re: [PATCH v2 2/9] dmapool: cleanup error messages

2018-08-03 Thread Andy Shevchenko
On Fri, Aug 3, 2018 at 6:17 PM, Tony Battersby wrote: > On 08/03/2018 09:41 AM, Tony Battersby wrote: >> On 08/03/2018 04:56 AM, Andy Shevchenko wrote: >>> On Thu, Aug 2, 2018 at 10:57 PM, Tony Battersby >>> wrote: >>>> Remove code duplication in error

Re: [PATCH v2 4/9] dmapool: improve scalability of dma_pool_alloc

2018-08-03 Thread Andy Shevchenko
st_head page_list[POOL_N_LISTS]; To be consistent with naming scheme and common practice I would rather name the last one as POOL_MAX_IDX 2 > + INIT_LIST_HEAD(>page_list[0]); > + INIT_LIST_HEAD(>page_list[1]); You introduced defines and don't use the

Re: [PATCH v2 2/9] dmapool: cleanup error messages

2018-08-03 Thread Andy Shevchenko
rval) busy Have you checked a history of this? I'm pretty sure this was created in an order to avoid bad looking (and in some cases frightening) "NULL device *" part. If it it's the case, I would rather leave it as is, and even not the case, I'm slightly more bent to the cu

Re: [PATCH 2/3] dmapool: improve scalability of dma_pool_free

2018-07-27 Thread Andy Shevchenko
make the lists singly-linked instead of doubly-linked >> to save space. >> > > I managed to redo my dma_pool_alloc() patch to make avail_page_list > singly-linked instead of doubly-linked. Are you relying on llist.h implementation? Btw, did you see quicklist.h

Re: [PATCH 2/3] dmapool: improve scalability of dma_pool_free

2018-07-26 Thread Andy Shevchenko
proper %p extensions for the DMA addresses: https://elixir.bootlin.com/linux/latest/source/Documentation/core-api/printk-formats.rst#L150 -- With Best Regards, Andy Shevchenko ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH 1/3] dmapool: improve scalability of dma_pool_alloc

2018-07-26 Thread Andy Shevchenko
ither 0 or 1 page. In that case what's the point to have a list? -- With Best Regards, Andy Shevchenko ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH 2/2] dma-mapping: move all DMA mapping code to kernel/dma

2018-06-14 Thread Andy Shevchenko
ight switch to def_bool y instead of two lines. -- With Best Regards, Andy Shevchenko ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: usb HC busted?

2018-06-06 Thread Andy Shevchenko
gt; see: > https://elixir.bootlin.com/linux/v4.14.2/source/drivers/usb/host/xhci- > mem.c#L52 > > prints above are custom traces added right after dma_pool_zalloc() For better understanding it would be good to have dma_pool_free() calls debugged as well. Is it possible t

[PATCH v1] iommu: Remove extra NULL check when call strtobool()

2018-05-14 Thread Andy Shevchenko
strtobool() does check for NULL parameter already. No need to repeat. While here, switch to kstrtobool() and unshadow actual error code (which is still -EINVAL). No functional change intended. Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- drivers/iommu/iommu

Re: dma-mapping: clearing GFP_ZERO flag caused crashes of Ethernet on arc/hsdk board.

2018-03-27 Thread Andy Shevchenko
ce *dev, size_t size, > void *kvaddr; > int need_coh = 1, need_kvaddr = 0; > > - page = alloc_pages(gfp, order); > + page = alloc_pages(gfp | __GFP_ZERO, order); > > if (!page) > return NULL; > ->8--

Re: [PATCH v2 1/5] iommu/amd - Add debugfs support

2018-03-14 Thread Andy Shevchenko
On Wed, Mar 14, 2018 at 5:24 PM, Gary R Hook <gary.h...@amd.com> wrote: > On 03/13/2018 03:23 PM, Andy Shevchenko wrote: >>>>> +#include >>>>> +#include >>>>> +#include >>>> Keep in order? >>> What order woul

Re: [PATCH v2 5/5] iommu/amd - Add a debugfs entry to specify a IOMMU device table entry

2018-03-13 Thread Andy Shevchenko
On Tue, Mar 13, 2018 at 8:54 PM, Gary R Hook <gary.h...@amd.com> wrote: > On 03/13/2018 12:20 PM, Andy Shevchenko wrote: >>> + } else if (obuf[0] == '0' && obuf[1] == 'x') { >>> + n = sscanf(obuf, "%x", _iommu_devid); >>>

Re: [PATCH v2 1/5] iommu/amd - Add debugfs support

2018-03-13 Thread Andy Shevchenko
On Tue, Mar 13, 2018 at 8:54 PM, Gary R Hook <gary.h...@amd.com> wrote: > On 03/13/2018 12:16 PM, Andy Shevchenko wrote: >> On Fri, Mar 9, 2018 at 2:50 AM, Gary R Hook <gary.h...@amd.com> wrote: >>> +#include >>> +#include >>> +#incl

Re: [PATCH v2 5/5] iommu/amd - Add a debugfs entry to specify a IOMMU device table entry

2018-03-13 Thread Andy Shevchenko
mp; obuf[1] == 'x') { > + n = sscanf(obuf, "%x", _iommu_devid); > + } else { > + n = sscanf(obuf, "%d", _iommu_devid); > + } kstrtoint() ? -- With Best Regards, Andy Shevchenko ___ i

Re: [PATCH v2 1/5] iommu/amd - Add debugfs support

2018-03-13 Thread Andy Shevchenko
; > + > + n = amd_iommu_count_valid_dtes(0, 0x); > + oboff += OSCNPRINTF("%d\n", n); > + return ret; > +} > @@ -89,6 +89,7 @@ > #define ACPI_DEVFLAG_ATSDIS 0x1000 > > #define LOOP_TIMEOUT 100

Re: [PATCH v7 0/5] Add Intel IOMMU debugfs support

2018-02-04 Thread Andy Shevchenko
apping in that > order. The > information can be accessed in sysfs at > '/sys/kernel/debug/intel_iommu/'. > > Nice and clean in comparison to v1. Reviewed-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> Joerg, note, that macro, which patch 2 defines privately, lik

Re: [PATCH v6 0/5] Add Intel IOMMU debugfs support

2018-01-10 Thread Andy Shevchenko
nded context patch into > one > - Remove redundant IOMMU null check under for_each_active_iommu > - Update the commit title to be consistent > > Changes since v2: > - Added a macro for seq file operations based on recommendation by > Andy >Shevchenko. The marco can be moved

Re: [PATCH v6 5/5] iommu/vt-d: Add debugfs support for Interrupt remapping

2018-01-10 Thread Andy Shevchenko
of first one, it would be slightly better for my opinion. > + seq_printf(m, "Posted Interrupt supported on IOMMU: > %s\n" > + " IR table address:%p\n", iommu->name, > +iommu->ir_table); Ditto. -- Andy She

Re: [PATCH v6 4/5] iommu/vt-d: Add debugfs support to show Pasid table contents

2018-01-10 Thread Andy Shevchenko
el_iommu_get_pts(iommu); > + > + } > +} > +#else /* CONFIG_INTEL_IOMMU_SVM */ > +static void pasid_tbl_entry_show(struct seq_file *m, struct > intel_iommu *iommu) > +{ > +} I think is not a big deal if you put all in one line like static ...

Re: [PATCH v6 3/5] iommu/vt-d: Add debugfs support to show register contents

2018-01-10 Thread Andy Shevchenko
x\n", > iommu->name, > +base); Can we get rid of leading '\n'? -- Andy Shevchenko <andriy.shevche...@linux.intel.com> Intel Finland Oy ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v6 1/5] iommu/vt-d: Add debugfs support for Intel IOMMU internals

2018-01-10 Thread Andy Shevchenko
via > + debugfs. Select this option if you want to export these > internals. > + > + Say Y if you need this. Also I lost a track how this option is being used here. It looks like this part is not related to the patch itself. -- Andy Shevchenko <andriy.shevche...@linux.intel.com> I

Re: [PATCH v5 5/5] iommu/vt-d: Add debugfs support for Interrupt remapping

2017-12-28 Thread Andy Shevchenko
On Thu, 2017-12-21 at 16:32 -0800, Sohil Mehta wrote: > + seq_puts(m, "\n"); seq_putc() > + seq_puts(m, "\n"); Ditto. -- Andy Shevchenko <andriy.shevche...@linux.intel.com> Intel Finland Oy

  1   2   >