* [PATCH v1 1/3] swiotlb: Use %pa to print phys_addr_t variables
@ 2020-08-19 17:13 Andy Shevchenko
2020-08-19 17:13 ` [PATCH v1 2/3] swiotlb: Declare swiotlb_late_init_with_default_size() in header Andy Shevchenko
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Andy Shevchenko @ 2020-08-19 17:13 UTC (permalink / raw)
To: Bjorn Helgaas, linux-pci, Konrad Rzeszutek Wilk, iommu,
Christoph Hellwig, Marek Szyprowski, x86, Robin Murphy
Cc: 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 <andriy.shevchenko@linux.intel.com>
---
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 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -165,17 +165,14 @@ unsigned long swiotlb_size_or_default(void)
void swiotlb_print_info(void)
{
- unsigned long bytes = io_tlb_nslabs << IO_TLB_SHIFT;
+ unsigned long mb = (io_tlb_nslabs << IO_TLB_SHIFT) >> 20;
if (no_iotlb_memory) {
pr_warn("No low mem\n");
return;
}
- pr_info("mapped [mem %#010llx-%#010llx] (%luMB)\n",
- (unsigned long long)io_tlb_start,
- (unsigned long long)io_tlb_end,
- bytes >> 20);
+ pr_info("mapped [mem %pa-%pa] (%luMB)\n", &io_tlb_start, &io_tlb_end, mb);
}
/*
--
2.28.0
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v1 2/3] swiotlb: Declare swiotlb_late_init_with_default_size() in header
2020-08-19 17:13 [PATCH v1 1/3] swiotlb: Use %pa to print phys_addr_t variables Andy Shevchenko
@ 2020-08-19 17:13 ` Andy Shevchenko
2020-08-19 17:13 ` [PATCH v1 3/3] swiotlb: Mark max_segment with static keyword Andy Shevchenko
2020-08-19 17:24 ` [PATCH v1 1/3] swiotlb: Use %pa to print phys_addr_t variables Fabio Estevam
2 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2020-08-19 17:13 UTC (permalink / raw)
To: Bjorn Helgaas, linux-pci, Konrad Rzeszutek Wilk, iommu,
Christoph Hellwig, Marek Szyprowski, x86, Robin Murphy
Cc: Andy Shevchenko
Compiler is not happy about one function prototype:
CC kernel/dma/swiotlb.o
kernel/dma/swiotlb.c:275:1: warning: no previous prototype for ‘swiotlb_late_init_with_default_size’ [-Wmissing-prototypes]
275 | swiotlb_late_init_with_default_size(size_t default_size)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Since it's used outside of the module, move its declaration to the header
from the user.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
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/sta2x11-fixup.c b/arch/x86/pci/sta2x11-fixup.c
index c313d784efab..64347c3372a0 100644
--- a/arch/x86/pci/sta2x11-fixup.c
+++ b/arch/x86/pci/sta2x11-fixup.c
@@ -12,10 +12,11 @@
#include <linux/export.h>
#include <linux/list.h>
#include <linux/dma-direct.h>
+#include <linux/swiotlb.h>
+
#include <asm/iommu.h>
#define STA2X11_SWIOTLB_SIZE (4*1024*1024)
-extern int swiotlb_late_init_with_default_size(size_t default_size);
/*
* We build a list of bus numbers that are under the ConneXt. The
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 046bb94bd4d6..513913ff7486 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -34,6 +34,7 @@ int swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose);
extern unsigned long swiotlb_nr_tbl(void);
unsigned long swiotlb_size_or_default(void);
extern int swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs);
+extern int swiotlb_late_init_with_default_size(size_t default_size);
extern void __init swiotlb_update_mem_attributes(void);
/*
--
2.28.0
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v1 3/3] swiotlb: Mark max_segment with static keyword
2020-08-19 17:13 [PATCH v1 1/3] swiotlb: Use %pa to print phys_addr_t variables Andy Shevchenko
2020-08-19 17:13 ` [PATCH v1 2/3] swiotlb: Declare swiotlb_late_init_with_default_size() in header Andy Shevchenko
@ 2020-08-19 17:13 ` Andy Shevchenko
2020-08-19 17:24 ` [PATCH v1 1/3] swiotlb: Use %pa to print phys_addr_t variables Fabio Estevam
2 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2020-08-19 17:13 UTC (permalink / raw)
To: Bjorn Helgaas, linux-pci, Konrad Rzeszutek Wilk, iommu,
Christoph Hellwig, Marek Szyprowski, x86, Robin Murphy
Cc: 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 <andriy.shevchenko@linux.intel.com>
---
kernel/dma/swiotlb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 676ccf0e49d3..5afbc50621fe 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -93,7 +93,7 @@ static unsigned int io_tlb_index;
* Max segment that we can provide which (if pages are contingous) will
* not be bounced (unless SWIOTLB_FORCE is set).
*/
-unsigned int max_segment;
+static unsigned int max_segment;
/*
* We need to save away the original address corresponding to a mapped entry
--
2.28.0
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v1 1/3] swiotlb: Use %pa to print phys_addr_t variables
2020-08-19 17:13 [PATCH v1 1/3] swiotlb: Use %pa to print phys_addr_t variables Andy Shevchenko
2020-08-19 17:13 ` [PATCH v1 2/3] swiotlb: Declare swiotlb_late_init_with_default_size() in header Andy Shevchenko
2020-08-19 17:13 ` [PATCH v1 3/3] swiotlb: Mark max_segment with static keyword Andy Shevchenko
@ 2020-08-19 17:24 ` Fabio Estevam
2020-08-19 17:39 ` Andy Shevchenko
2 siblings, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2020-08-19 17:24 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Konrad Rzeszutek Wilk, linux-pci, x86, iommu, Bjorn Helgaas,
Robin Murphy, Christoph Hellwig
Hi Andy,
On Wed, Aug 19, 2020 at 2:16 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> - unsigned long bytes = io_tlb_nslabs << IO_TLB_SHIFT;
> + unsigned long mb = (io_tlb_nslabs << IO_TLB_SHIFT) >> 20;
Looks like an unrelated change.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1 1/3] swiotlb: Use %pa to print phys_addr_t variables
2020-08-19 17:24 ` [PATCH v1 1/3] swiotlb: Use %pa to print phys_addr_t variables Fabio Estevam
@ 2020-08-19 17:39 ` Andy Shevchenko
0 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2020-08-19 17:39 UTC (permalink / raw)
To: Fabio Estevam
Cc: Konrad Rzeszutek Wilk, linux-pci, x86, iommu, Bjorn Helgaas,
Robin Murphy, Christoph Hellwig
On Wed, Aug 19, 2020 at 02:24:10PM -0300, Fabio Estevam wrote:
> On Wed, Aug 19, 2020 at 2:16 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
>
> > - unsigned long bytes = io_tlb_nslabs << IO_TLB_SHIFT;
> > + unsigned long mb = (io_tlb_nslabs << IO_TLB_SHIFT) >> 20;
>
> Looks like an unrelated change.
To put pr_info() onto one (not so long) line. But of course, can leave it.
--
With Best Regards,
Andy Shevchenko
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-08-19 17:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-19 17:13 [PATCH v1 1/3] swiotlb: Use %pa to print phys_addr_t variables Andy Shevchenko
2020-08-19 17:13 ` [PATCH v1 2/3] swiotlb: Declare swiotlb_late_init_with_default_size() in header Andy Shevchenko
2020-08-19 17:13 ` [PATCH v1 3/3] swiotlb: Mark max_segment with static keyword Andy Shevchenko
2020-08-19 17:24 ` [PATCH v1 1/3] swiotlb: Use %pa to print phys_addr_t variables Fabio Estevam
2020-08-19 17:39 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).