Re: [PATCH v6 14/19] swiotlb: print a warning when the swiotlb is full

2013-10-09 Thread Stefano Stabellini
On Mon, 30 Sep 2013, Konrad Rzeszutek Wilk wrote:
> On Fri, Sep 27, 2013 at 05:10:02PM +0100, Stefano Stabellini wrote:
> > Signed-off-by: Stefano Stabellini 
> > ---
> >  drivers/xen/swiotlb-xen.c |1 +
> >  lib/swiotlb.c |1 +
> >  2 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
> > index 96ad316..790c2eb 100644
> > --- a/drivers/xen/swiotlb-xen.c
> > +++ b/drivers/xen/swiotlb-xen.c
> > @@ -674,6 +674,7 @@ xen_swiotlb_map_sg_attrs(struct device *hwdev, struct 
> > scatterlist *sgl,
> >  sg->length,
> >  dir);
> > if (map == SWIOTLB_MAP_ERROR) {
> > +   pr_warn("swiotlb buffer is full\n");
> 
> It would be beneficial to use dev_warn instead.

OK

> And perhaps even call debug_dma_dump_mappings to help in diagnosing
> a problem?

I don't think that would be very beneficial because this is an internal
swiotlb issue: we just run out of buffer space.


> > /* Don't panic here, we expect map_sg users
> >to do proper error handling. */
> > xen_swiotlb_unmap_sg_attrs(hwdev, sgl, i, dir,
> > diff --git a/lib/swiotlb.c b/lib/swiotlb.c
> > index eb45d17..f06da0d 100644
> > --- a/lib/swiotlb.c
> > +++ b/lib/swiotlb.c
> > @@ -502,6 +502,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *hwdev,
> >  
> >  not_found:
> > spin_unlock_irqrestore(_tlb_lock, flags);
> > +   pr_warn("swiotlb buffer is full\n");
> > return SWIOTLB_MAP_ERROR;
> >  found:
> > spin_unlock_irqrestore(_tlb_lock, flags);
> > -- 
> > 1.7.2.5
> > 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v6 14/19] swiotlb: print a warning when the swiotlb is full

2013-10-09 Thread Stefano Stabellini
On Mon, 30 Sep 2013, Konrad Rzeszutek Wilk wrote:
 On Fri, Sep 27, 2013 at 05:10:02PM +0100, Stefano Stabellini wrote:
  Signed-off-by: Stefano Stabellini stefano.stabell...@eu.citrix.com
  ---
   drivers/xen/swiotlb-xen.c |1 +
   lib/swiotlb.c |1 +
   2 files changed, 2 insertions(+), 0 deletions(-)
  
  diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
  index 96ad316..790c2eb 100644
  --- a/drivers/xen/swiotlb-xen.c
  +++ b/drivers/xen/swiotlb-xen.c
  @@ -674,6 +674,7 @@ xen_swiotlb_map_sg_attrs(struct device *hwdev, struct 
  scatterlist *sgl,
   sg-length,
   dir);
  if (map == SWIOTLB_MAP_ERROR) {
  +   pr_warn(swiotlb buffer is full\n);
 
 It would be beneficial to use dev_warn instead.

OK

 And perhaps even call debug_dma_dump_mappings to help in diagnosing
 a problem?

I don't think that would be very beneficial because this is an internal
swiotlb issue: we just run out of buffer space.


  /* Don't panic here, we expect map_sg users
 to do proper error handling. */
  xen_swiotlb_unmap_sg_attrs(hwdev, sgl, i, dir,
  diff --git a/lib/swiotlb.c b/lib/swiotlb.c
  index eb45d17..f06da0d 100644
  --- a/lib/swiotlb.c
  +++ b/lib/swiotlb.c
  @@ -502,6 +502,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *hwdev,
   
   not_found:
  spin_unlock_irqrestore(io_tlb_lock, flags);
  +   pr_warn(swiotlb buffer is full\n);
  return SWIOTLB_MAP_ERROR;
   found:
  spin_unlock_irqrestore(io_tlb_lock, flags);
  -- 
  1.7.2.5
  
 
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v6 14/19] swiotlb: print a warning when the swiotlb is full

2013-09-30 Thread Konrad Rzeszutek Wilk
On Fri, Sep 27, 2013 at 05:10:02PM +0100, Stefano Stabellini wrote:
> Signed-off-by: Stefano Stabellini 
> ---
>  drivers/xen/swiotlb-xen.c |1 +
>  lib/swiotlb.c |1 +
>  2 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
> index 96ad316..790c2eb 100644
> --- a/drivers/xen/swiotlb-xen.c
> +++ b/drivers/xen/swiotlb-xen.c
> @@ -674,6 +674,7 @@ xen_swiotlb_map_sg_attrs(struct device *hwdev, struct 
> scatterlist *sgl,
>sg->length,
>dir);
>   if (map == SWIOTLB_MAP_ERROR) {
> + pr_warn("swiotlb buffer is full\n");

It would be beneficial to use dev_warn instead.

And perhaps even call debug_dma_dump_mappings to help in diagnosing
a problem?

>   /* Don't panic here, we expect map_sg users
>  to do proper error handling. */
>   xen_swiotlb_unmap_sg_attrs(hwdev, sgl, i, dir,
> diff --git a/lib/swiotlb.c b/lib/swiotlb.c
> index eb45d17..f06da0d 100644
> --- a/lib/swiotlb.c
> +++ b/lib/swiotlb.c
> @@ -502,6 +502,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *hwdev,
>  
>  not_found:
>   spin_unlock_irqrestore(_tlb_lock, flags);
> + pr_warn("swiotlb buffer is full\n");
>   return SWIOTLB_MAP_ERROR;
>  found:
>   spin_unlock_irqrestore(_tlb_lock, flags);
> -- 
> 1.7.2.5
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v6 14/19] swiotlb: print a warning when the swiotlb is full

2013-09-30 Thread Konrad Rzeszutek Wilk
On Fri, Sep 27, 2013 at 05:10:02PM +0100, Stefano Stabellini wrote:
 Signed-off-by: Stefano Stabellini stefano.stabell...@eu.citrix.com
 ---
  drivers/xen/swiotlb-xen.c |1 +
  lib/swiotlb.c |1 +
  2 files changed, 2 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
 index 96ad316..790c2eb 100644
 --- a/drivers/xen/swiotlb-xen.c
 +++ b/drivers/xen/swiotlb-xen.c
 @@ -674,6 +674,7 @@ xen_swiotlb_map_sg_attrs(struct device *hwdev, struct 
 scatterlist *sgl,
sg-length,
dir);
   if (map == SWIOTLB_MAP_ERROR) {
 + pr_warn(swiotlb buffer is full\n);

It would be beneficial to use dev_warn instead.

And perhaps even call debug_dma_dump_mappings to help in diagnosing
a problem?

   /* Don't panic here, we expect map_sg users
  to do proper error handling. */
   xen_swiotlb_unmap_sg_attrs(hwdev, sgl, i, dir,
 diff --git a/lib/swiotlb.c b/lib/swiotlb.c
 index eb45d17..f06da0d 100644
 --- a/lib/swiotlb.c
 +++ b/lib/swiotlb.c
 @@ -502,6 +502,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *hwdev,
  
  not_found:
   spin_unlock_irqrestore(io_tlb_lock, flags);
 + pr_warn(swiotlb buffer is full\n);
   return SWIOTLB_MAP_ERROR;
  found:
   spin_unlock_irqrestore(io_tlb_lock, flags);
 -- 
 1.7.2.5
 
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v6 14/19] swiotlb: print a warning when the swiotlb is full

2013-09-27 Thread Stefano Stabellini
Signed-off-by: Stefano Stabellini 
---
 drivers/xen/swiotlb-xen.c |1 +
 lib/swiotlb.c |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index 96ad316..790c2eb 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -674,6 +674,7 @@ xen_swiotlb_map_sg_attrs(struct device *hwdev, struct 
scatterlist *sgl,
 sg->length,
 dir);
if (map == SWIOTLB_MAP_ERROR) {
+   pr_warn("swiotlb buffer is full\n");
/* Don't panic here, we expect map_sg users
   to do proper error handling. */
xen_swiotlb_unmap_sg_attrs(hwdev, sgl, i, dir,
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index eb45d17..f06da0d 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -502,6 +502,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *hwdev,
 
 not_found:
spin_unlock_irqrestore(_tlb_lock, flags);
+   pr_warn("swiotlb buffer is full\n");
return SWIOTLB_MAP_ERROR;
 found:
spin_unlock_irqrestore(_tlb_lock, flags);
-- 
1.7.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v6 14/19] swiotlb: print a warning when the swiotlb is full

2013-09-27 Thread Stefano Stabellini
Signed-off-by: Stefano Stabellini stefano.stabell...@eu.citrix.com
---
 drivers/xen/swiotlb-xen.c |1 +
 lib/swiotlb.c |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index 96ad316..790c2eb 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -674,6 +674,7 @@ xen_swiotlb_map_sg_attrs(struct device *hwdev, struct 
scatterlist *sgl,
 sg-length,
 dir);
if (map == SWIOTLB_MAP_ERROR) {
+   pr_warn(swiotlb buffer is full\n);
/* Don't panic here, we expect map_sg users
   to do proper error handling. */
xen_swiotlb_unmap_sg_attrs(hwdev, sgl, i, dir,
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index eb45d17..f06da0d 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -502,6 +502,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *hwdev,
 
 not_found:
spin_unlock_irqrestore(io_tlb_lock, flags);
+   pr_warn(swiotlb buffer is full\n);
return SWIOTLB_MAP_ERROR;
 found:
spin_unlock_irqrestore(io_tlb_lock, flags);
-- 
1.7.2.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/