Re: [PATCH] firewire: fw-sbp2: prepare for s/g chaining

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 15 Jan 2008 21:10:50 +0100 (CET)
Stefan Richter <stefanr@xxxxxxxxxxxxxxxxx> wrote:

> Signed-off-by: Stefan Richter <stefanr@xxxxxxxxxxxxxxxxx>
> ---
> 
> Replacement of patch "firewire: fw-sbp2: enable s/g chaining".
> 
> It's the same, minus '+ .use_sg_chaining = ENABLE_SG_CHAINING,' hunk
> to prevent conflicts when James is going to remove .use_sg_chaining.
> 
> 
>  drivers/firewire/fw-sbp2.c |    7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> Index: linux/drivers/firewire/fw-sbp2.c
> ===================================================================
> --- linux.orig/drivers/firewire/fw-sbp2.c
> +++ linux/drivers/firewire/fw-sbp2.c
> @@ -1107,9 +1107,9 @@ sbp2_map_scatterlist(struct sbp2_command
>  	 * elements larger than 65535 bytes, some IOMMUs may merge sg elements
>  	 * during DMA mapping, and Linux currently doesn't prevent this.
>  	 */

On a relate note, I fixed the IOMMU merge issue. The patches have been
-mm though I'm not sure whether they will go into v2.6.25. The patches
enable you to remove the following workaround if you configure the
maximum sg element length.

>From a quick look, fw-sbp2 uses scsi-ml in a different way so it would
be a bit trick to configure the maximum sg element length.

You call dma_map_sg with pci_dev::dev but don't call scsi_add_host
with pci_dev::dev.

If you set the maximum sg element length to pci_dev::dev, and then
call scsi_add_host with it, the block layer and the IOMMU send you
proper size sg elements.


> -	for (i = 0, j = 0; i < count; i++) {
> -		sg_len = sg_dma_len(sg + i);
> -		sg_addr = sg_dma_address(sg + i);
> +	for (i = 0, j = 0; i < count; i++, sg = sg_next(sg)) {
> +		sg_len = sg_dma_len(sg);
> +		sg_addr = sg_dma_address(sg);
>  		while (sg_len) {
>  			/* FIXME: This won't get us out of the pinch. */
>  			if (unlikely(j >= ARRAY_SIZE(orb->page_table))) {
> 
> -- 
> Stefan Richter
> -=====-==--- ---= -====
> http://arcgraph.de/sr/
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux