[PATCH] intel-iommu: fix sg_page() - Kernel

This is a discussion on [PATCH] intel-iommu: fix sg_page() - Kernel ; On Tue, Oct 23, 2007 at 01:59:26PM +0900, FUJITA Tomonori wrote: > drivers/pci/intel-iommu.c: In function 'intel_unmap_sg': > drivers/pci/intel-iommu.c:1987: error: 'struct scatterlist' has no member named 'page' > drivers/pci/intel-iommu.c: In function 'intel_nontranslate_map_sg': > drivers/pci/intel-iommu.c:2013: error: 'struct scatterlist' has no member named ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: [PATCH] intel-iommu: fix sg_page()

  1. Re: [PATCH] intel-iommu: fix sg_page()

    On Tue, Oct 23, 2007 at 01:59:26PM +0900, FUJITA Tomonori wrote:
    > drivers/pci/intel-iommu.c: In function 'intel_unmap_sg':
    > drivers/pci/intel-iommu.c:1987: error: 'struct scatterlist' has no member named 'page'
    > drivers/pci/intel-iommu.c: In function 'intel_nontranslate_map_sg':
    > drivers/pci/intel-iommu.c:2013: error: 'struct scatterlist' has no member named 'page'
    > drivers/pci/intel-iommu.c:2014: error: 'struct scatterlist' has no member named 'page'
    > drivers/pci/intel-iommu.c: In function 'intel_map_sg':
    > drivers/pci/intel-iommu.c:2044: error: 'struct scatterlist' has no member named 'page'
    > drivers/pci/intel-iommu.c:2068: error: 'struct scatterlist' has no member named 'page'
    >
    > Signed-off-by: FUJITA Tomonori

    Acked by: Anil S Keshavamurthy

    > ---
    > drivers/pci/intel-iommu.c | 11 +++++------
    > 1 files changed, 5 insertions(+), 6 deletions(-)
    >
    > diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
    > index b3d7031..0f6e528 100644
    > --- a/drivers/pci/intel-iommu.c
    > +++ b/drivers/pci/intel-iommu.c
    > @@ -1962,7 +1962,6 @@ static void intel_free_coherent(struct device *hwdev, size_t size,
    > free_pages((unsigned long)vaddr, order);
    > }
    >
    > -#define SG_ENT_VIRT_ADDRESS(sg) (page_address((sg)->page) + (sg)->offset)
    > static void intel_unmap_sg(struct device *hwdev, struct scatterlist *sglist,
    > int nelems, int dir)
    > {
    > @@ -1984,7 +1983,7 @@ static void intel_unmap_sg(struct device *hwdev, struct scatterlist *sglist,
    > if (!iova)
    > return;
    > for_each_sg(sglist, sg, nelems, i) {
    > - addr = SG_ENT_VIRT_ADDRESS(sg);
    > + addr = sg_virt(sg);
    > size += aligned_size((u64)addr, sg->length);
    > }
    >
    > @@ -2010,8 +2009,8 @@ static int intel_nontranslate_map_sg(struct device *hddev,
    > struct scatterlist *sg;
    >
    > for_each_sg(sglist, sg, nelems, i) {
    > - BUG_ON(!sg->page);
    > - sg->dma_address = virt_to_bus(SG_ENT_VIRT_ADDRESS(sg));
    > + BUG_ON(!sg_page(sg));
    > + sg->dma_address = virt_to_bus(sg_virt(sg));
    > sg->dma_length = sg->length;
    > }
    > return nelems;
    > @@ -2041,7 +2040,7 @@ static int intel_map_sg(struct device *hwdev, struct scatterlist *sglist,
    > return 0;
    >
    > for_each_sg(sglist, sg, nelems, i) {
    > - addr = SG_ENT_VIRT_ADDRESS(sg);
    > + addr = sg_virt(sg);
    > addr = (void *)virt_to_phys(addr);
    > size += aligned_size((u64)addr, sg->length);
    > }
    > @@ -2065,7 +2064,7 @@ static int intel_map_sg(struct device *hwdev, struct scatterlist *sglist,
    > start_addr = iova->pfn_lo << PAGE_SHIFT_4K;
    > offset = 0;
    > for_each_sg(sglist, sg, nelems, i) {
    > - addr = SG_ENT_VIRT_ADDRESS(sg);
    > + addr = sg_virt(sg);
    > addr = (void *)virt_to_phys(addr);
    > size = aligned_size((u64)addr, sg->length);
    > ret = domain_page_mapping(domain, start_addr + offset,
    > --
    > 1.5.2.4

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

  2. [PATCH] intel-iommu: fix sg_page()

    drivers/pci/intel-iommu.c: In function 'intel_unmap_sg':
    drivers/pci/intel-iommu.c:1987: error: 'struct scatterlist' has no member named 'page'
    drivers/pci/intel-iommu.c: In function 'intel_nontranslate_map_sg':
    drivers/pci/intel-iommu.c:2013: error: 'struct scatterlist' has no member named 'page'
    drivers/pci/intel-iommu.c:2014: error: 'struct scatterlist' has no member named 'page'
    drivers/pci/intel-iommu.c: In function 'intel_map_sg':
    drivers/pci/intel-iommu.c:2044: error: 'struct scatterlist' has no member named 'page'
    drivers/pci/intel-iommu.c:2068: error: 'struct scatterlist' has no member named 'page'

    Signed-off-by: FUJITA Tomonori
    ---
    drivers/pci/intel-iommu.c | 11 +++++------
    1 files changed, 5 insertions(+), 6 deletions(-)

    diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
    index b3d7031..0f6e528 100644
    --- a/drivers/pci/intel-iommu.c
    +++ b/drivers/pci/intel-iommu.c
    @@ -1962,7 +1962,6 @@ static void intel_free_coherent(struct device *hwdev, size_t size,
    free_pages((unsigned long)vaddr, order);
    }

    -#define SG_ENT_VIRT_ADDRESS(sg) (page_address((sg)->page) + (sg)->offset)
    static void intel_unmap_sg(struct device *hwdev, struct scatterlist *sglist,
    int nelems, int dir)
    {
    @@ -1984,7 +1983,7 @@ static void intel_unmap_sg(struct device *hwdev, struct scatterlist *sglist,
    if (!iova)
    return;
    for_each_sg(sglist, sg, nelems, i) {
    - addr = SG_ENT_VIRT_ADDRESS(sg);
    + addr = sg_virt(sg);
    size += aligned_size((u64)addr, sg->length);
    }

    @@ -2010,8 +2009,8 @@ static int intel_nontranslate_map_sg(struct device *hddev,
    struct scatterlist *sg;

    for_each_sg(sglist, sg, nelems, i) {
    - BUG_ON(!sg->page);
    - sg->dma_address = virt_to_bus(SG_ENT_VIRT_ADDRESS(sg));
    + BUG_ON(!sg_page(sg));
    + sg->dma_address = virt_to_bus(sg_virt(sg));
    sg->dma_length = sg->length;
    }
    return nelems;
    @@ -2041,7 +2040,7 @@ static int intel_map_sg(struct device *hwdev, struct scatterlist *sglist,
    return 0;

    for_each_sg(sglist, sg, nelems, i) {
    - addr = SG_ENT_VIRT_ADDRESS(sg);
    + addr = sg_virt(sg);
    addr = (void *)virt_to_phys(addr);
    size += aligned_size((u64)addr, sg->length);
    }
    @@ -2065,7 +2064,7 @@ static int intel_map_sg(struct device *hwdev, struct scatterlist *sglist,
    start_addr = iova->pfn_lo << PAGE_SHIFT_4K;
    offset = 0;
    for_each_sg(sglist, sg, nelems, i) {
    - addr = SG_ENT_VIRT_ADDRESS(sg);
    + addr = sg_virt(sg);
    addr = (void *)virt_to_phys(addr);
    size = aligned_size((u64)addr, sg->length);
    ret = domain_page_mapping(domain, start_addr + offset,
    --
    1.5.2.4

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

  3. Re: [PATCH] intel-iommu: fix sg_page()

    On Tue, 23 Oct 2007 07:04:27 +0200
    Jens Axboe wrote:

    > On Tue, Oct 23 2007, FUJITA Tomonori wrote:
    > > drivers/pci/intel-iommu.c: In function 'intel_unmap_sg':
    > > drivers/pci/intel-iommu.c:1987: error: 'struct scatterlist' has no member named 'page'
    > > drivers/pci/intel-iommu.c: In function 'intel_nontranslate_map_sg':
    > > drivers/pci/intel-iommu.c:2013: error: 'struct scatterlist' has no member named 'page'
    > > drivers/pci/intel-iommu.c:2014: error: 'struct scatterlist' has no member named 'page'
    > > drivers/pci/intel-iommu.c: In function 'intel_map_sg':
    > > drivers/pci/intel-iommu.c:2044: error: 'struct scatterlist' has no member named 'page'
    > > drivers/pci/intel-iommu.c:2068: error: 'struct scatterlist' has no member named 'page'
    > >
    > > Signed-off-by: FUJITA Tomonori
    > > ---
    > > drivers/pci/intel-iommu.c | 11 +++++------
    > > 1 files changed, 5 insertions(+), 6 deletions(-)
    > >
    > > diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
    > > index b3d7031..0f6e528 100644
    > > --- a/drivers/pci/intel-iommu.c
    > > +++ b/drivers/pci/intel-iommu.c
    > > @@ -1962,7 +1962,6 @@ static void intel_free_coherent(struct device *hwdev, size_t size,
    > > free_pages((unsigned long)vaddr, order);
    > > }
    > >
    > > -#define SG_ENT_VIRT_ADDRESS(sg) (page_address((sg)->page) + (sg)->offset)

    >
    > Thanks, though I preferred to just do the one-liner for the conversions.
    > Funny that I missed this file - ah seems it was merged yesterday as
    > well, it didn't exist in the current tree I was working against.


    Yeah, the patchset has been -mm and was merged after the sg updates.


    Signed-off-by: FUJITA Tomonori

    diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
    index b3d7031..a837d64 100644
    --- a/drivers/pci/intel-iommu.c
    +++ b/drivers/pci/intel-iommu.c
    @@ -1962,7 +1962,7 @@ static void intel_free_coherent(struct device *hwdev, size_t size,
    free_pages((unsigned long)vaddr, order);
    }

    -#define SG_ENT_VIRT_ADDRESS(sg) (page_address((sg)->page) + (sg)->offset)
    +#define SG_ENT_VIRT_ADDRESS(sg) sg_virt(sg)
    static void intel_unmap_sg(struct device *hwdev, struct scatterlist *sglist,
    int nelems, int dir)
    {
    @@ -2010,7 +2010,7 @@ static int intel_nontranslate_map_sg(struct device *hddev,
    struct scatterlist *sg;

    for_each_sg(sglist, sg, nelems, i) {
    - BUG_ON(!sg->page);
    + BUG_ON(!sg_page(sg));
    sg->dma_address = virt_to_bus(SG_ENT_VIRT_ADDRESS(sg));
    sg->dma_length = sg->length;
    }
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  4. Re: [PATCH] intel-iommu: fix sg_page()

    On Tue, Oct 23 2007, FUJITA Tomonori wrote:
    > On Tue, 23 Oct 2007 07:04:27 +0200
    > Jens Axboe wrote:
    >
    > > On Tue, Oct 23 2007, FUJITA Tomonori wrote:
    > > > drivers/pci/intel-iommu.c: In function 'intel_unmap_sg':
    > > > drivers/pci/intel-iommu.c:1987: error: 'struct scatterlist' has no member named 'page'
    > > > drivers/pci/intel-iommu.c: In function 'intel_nontranslate_map_sg':
    > > > drivers/pci/intel-iommu.c:2013: error: 'struct scatterlist' has no member named 'page'
    > > > drivers/pci/intel-iommu.c:2014: error: 'struct scatterlist' has no member named 'page'
    > > > drivers/pci/intel-iommu.c: In function 'intel_map_sg':
    > > > drivers/pci/intel-iommu.c:2044: error: 'struct scatterlist' has no member named 'page'
    > > > drivers/pci/intel-iommu.c:2068: error: 'struct scatterlist' has no member named 'page'
    > > >
    > > > Signed-off-by: FUJITA Tomonori
    > > > ---
    > > > drivers/pci/intel-iommu.c | 11 +++++------
    > > > 1 files changed, 5 insertions(+), 6 deletions(-)
    > > >
    > > > diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
    > > > index b3d7031..0f6e528 100644
    > > > --- a/drivers/pci/intel-iommu.c
    > > > +++ b/drivers/pci/intel-iommu.c
    > > > @@ -1962,7 +1962,6 @@ static void intel_free_coherent(struct device *hwdev, size_t size,
    > > > free_pages((unsigned long)vaddr, order);
    > > > }
    > > >
    > > > -#define SG_ENT_VIRT_ADDRESS(sg) (page_address((sg)->page) + (sg)->offset)

    > >
    > > Thanks, though I preferred to just do the one-liner for the conversions.
    > > Funny that I missed this file - ah seems it was merged yesterday as
    > > well, it didn't exist in the current tree I was working against.

    >
    > Yeah, the patchset has been -mm and was merged after the sg updates.
    >
    >
    > Signed-off-by: FUJITA Tomonori
    >
    > diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
    > index b3d7031..a837d64 100644
    > --- a/drivers/pci/intel-iommu.c
    > +++ b/drivers/pci/intel-iommu.c
    > @@ -1962,7 +1962,7 @@ static void intel_free_coherent(struct device *hwdev, size_t size,
    > free_pages((unsigned long)vaddr, order);
    > }
    >
    > -#define SG_ENT_VIRT_ADDRESS(sg) (page_address((sg)->page) + (sg)->offset)
    > +#define SG_ENT_VIRT_ADDRESS(sg) sg_virt(sg)
    > static void intel_unmap_sg(struct device *hwdev, struct scatterlist *sglist,
    > int nelems, int dir)
    > {
    > @@ -2010,7 +2010,7 @@ static int intel_nontranslate_map_sg(struct device *hddev,
    > struct scatterlist *sg;
    >
    > for_each_sg(sglist, sg, nelems, i) {
    > - BUG_ON(!sg->page);
    > + BUG_ON(!sg_page(sg));
    > sg->dma_address = virt_to_bus(SG_ENT_VIRT_ADDRESS(sg));
    > sg->dma_length = sg->length;
    > }


    Great, applied this one.

    --
    Jens Axboe

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

+ Reply to Thread