Linux-ide Archive on lore.kernel.org
 help / color / Atom feed
* Re: [PATCH 4/4] mmc: sdhci: Add DMA memory boundary workaround
       [not found]       ` <20191203165123.4e6f9e28@xhacker.debian>
@ 2019-12-03  9:18         ` Christoph Hellwig
  2019-12-03  9:49           ` Jisheng Zhang
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2019-12-03  9:18 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Jun Nie, Christoph Hellwig, ulf.hansson, robh+dt, mark.rutland,
	adrian.hunter, linux-mmc, devicetree, linux-block, linux-ide

On Tue, Dec 03, 2019 at 09:05:23AM +0000, Jisheng Zhang wrote:
> > >
> > > eg. drivers/mmc/host/sdhci-of-dwcmshc.c
> > >  
> > Thanks for the suggestion! Christoph's suggestion can prevent the the issue
> > from the block layer, thus the code can be shared across all
> 
> To be honest, I did consider similar solution from block layer, I.E set
> the seg_boundary_mask, when submitting the workaround last year, but per
> my understanding, SDHCI limitation is the physical DMA addr can't span one
> specific boundary,

As in exactly one boundary and not an alignment?  Where the one
boundary is not a power of two and thus can't be expressed?


> so setting seg_boundary_mask w/ blk_queue_segment_boundary
> can't work. I'm not sure I understand blk_queue_segment_boundary() properly.
> May Christoph help to clarify?
> 
> From another side, drivers/ata/libata-sff.c also workaround the 64K phy DMA
> boundary limitation itself rather than from block layer.

As far as I can tell that workaround should use the segment boundary
setting as well.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 4/4] mmc: sdhci: Add DMA memory boundary workaround
  2019-12-03  9:18         ` [PATCH 4/4] mmc: sdhci: Add DMA memory boundary workaround Christoph Hellwig
@ 2019-12-03  9:49           ` Jisheng Zhang
  2019-12-03 13:06             ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Jisheng Zhang @ 2019-12-03  9:49 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jun Nie, ulf.hansson, robh+dt, mark.rutland, adrian.hunter,
	linux-mmc, devicetree, linux-block, linux-ide

On Tue, 3 Dec 2019 01:18:24 -0800 Christoph Hellwig <hch@infradead.org> wrote:


> 
> 
> On Tue, Dec 03, 2019 at 09:05:23AM +0000, Jisheng Zhang wrote:
> > > >
> > > > eg. drivers/mmc/host/sdhci-of-dwcmshc.c
> > > >  
> > > Thanks for the suggestion! Christoph's suggestion can prevent the the issue
> > > from the block layer, thus the code can be shared across all  
> >
> > To be honest, I did consider similar solution from block layer, I.E set
> > the seg_boundary_mask, when submitting the workaround last year, but per
> > my understanding, SDHCI limitation is the physical DMA addr can't span one
> > specific boundary,  
> 
> As in exactly one boundary and not an alignment?  Where the one
> boundary is not a power of two and thus can't be expressed?

Take drivers/mmc/host/sdhci-of-dwcmshc.c for example, target physical DMA addr
can't span 128MB, 256MB, 128*3MB, ...128*nMB

I'm not sure whether blk_queue_segment_boundary could solve this limitation.

> 
> 
> > so setting seg_boundary_mask w/ blk_queue_segment_boundary
> > can't work. I'm not sure I understand blk_queue_segment_boundary() properly.
> > May Christoph help to clarify?
> >
> > From another side, drivers/ata/libata-sff.c also workaround the 64K phy DMA
> > boundary limitation itself rather than from block layer.  
> 
> As far as I can tell that workaround should use the segment boundary
> setting as well.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 4/4] mmc: sdhci: Add DMA memory boundary workaround
  2019-12-03  9:49           ` Jisheng Zhang
@ 2019-12-03 13:06             ` Christoph Hellwig
  2019-12-04  7:11               ` Jisheng Zhang
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2019-12-03 13:06 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Christoph Hellwig, Jun Nie, ulf.hansson, robh+dt, mark.rutland,
	adrian.hunter, linux-mmc, devicetree, linux-block, linux-ide

On Tue, Dec 03, 2019 at 09:49:49AM +0000, Jisheng Zhang wrote:
> > As in exactly one boundary and not an alignment?  Where the one
> > boundary is not a power of two and thus can't be expressed?
> 
> Take drivers/mmc/host/sdhci-of-dwcmshc.c for example, target physical DMA addr
> can't span 128MB, 256MB, 128*3MB, ...128*nMB
> 
> I'm not sure whether blk_queue_segment_boundary could solve this limitation.

That is exaxtly the kind of limitation blk_queue_segment_boundary is
intended for.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 4/4] mmc: sdhci: Add DMA memory boundary workaround
  2019-12-03 13:06             ` Christoph Hellwig
@ 2019-12-04  7:11               ` Jisheng Zhang
  0 siblings, 0 replies; 4+ messages in thread
From: Jisheng Zhang @ 2019-12-04  7:11 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jun Nie, ulf.hansson, robh+dt, mark.rutland, adrian.hunter,
	linux-mmc, devicetree, linux-block, linux-ide

Hi Christoph

On Tue, 3 Dec 2019 05:06:09 -0800 Christoph Hellwig wrote:


> 
> On Tue, Dec 03, 2019 at 09:49:49AM +0000, Jisheng Zhang wrote:
> > > As in exactly one boundary and not an alignment?  Where the one
> > > boundary is not a power of two and thus can't be expressed?  
> >
> > Take drivers/mmc/host/sdhci-of-dwcmshc.c for example, target physical DMA addr
> > can't span 128MB, 256MB, 128*3MB, ...128*nMB
> >
> > I'm not sure whether blk_queue_segment_boundary could solve this limitation.  
> 
> That is exaxtly the kind of limitation blk_queue_segment_boundary is
> intended for.

Until after dma_map_sg(), we can't know the physical DMA address range, so
how does block layer know and check the DMA range beforehand? I'm a newbie on
block layer, could you please teach me? At the same time
I'm reading the code as well.

Thanks in advance


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20191202144104.5069-1-jun.nie@linaro.org>
     [not found] ` <20191202144104.5069-5-jun.nie@linaro.org>
     [not found]   ` <20191203103320.273a7309@xhacker.debian>
     [not found]     ` <CABymUCMVi_N2Mt82YDt7wrys4Z_vnXYEu15-YBa+S1CejT9iZw@mail.gmail.com>
     [not found]       ` <20191203165123.4e6f9e28@xhacker.debian>
2019-12-03  9:18         ` [PATCH 4/4] mmc: sdhci: Add DMA memory boundary workaround Christoph Hellwig
2019-12-03  9:49           ` Jisheng Zhang
2019-12-03 13:06             ` Christoph Hellwig
2019-12-04  7:11               ` Jisheng Zhang

Linux-ide Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-ide/0 linux-ide/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-ide linux-ide/ https://lore.kernel.org/linux-ide \
		linux-ide@vger.kernel.org
	public-inbox-index linux-ide

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-ide


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git