All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] qla1280: slightly strange DMA mask
@ 2005-11-20  7:34 Alexey Dobriyan
  2005-11-20  7:40 ` Jaco Kroon
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Dobriyan @ 2005-11-20  7:34 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1088 bytes --]

The question is what to do with ~0LL.

--- linux-kj.orig/drivers/scsi/qla1280.c
+++ linux-kj/drivers/scsi/qla1280.c
@@ -348,6 +348,7 @@
 #include <linux/pci_ids.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -4571,7 +4572,7 @@ qla1280_probe_one(struct pci_dev *pdev, 
 
 #ifdef QLA_64BIT_PTR
 	if (pci_set_dma_mask(ha->pdev, (dma_addr_t) ~ 0ULL)) {
				       ^^^^^^^^^^^^^^^^^^^

-		if (pci_set_dma_mask(ha->pdev, 0xffffffff)) {
+		if (pci_set_dma_mask(ha->pdev, DMA_32BIT_MASK)) {
 			printk(KERN_WARNING "scsi(%li): Unable to set a "
 			       "suitable DMA mask - aborting\n", ha->host_no);
 			error = -ENODEV;
@@ -4581,7 +4582,7 @@ qla1280_probe_one(struct pci_dev *pdev, 
 		dprintk(2, "scsi(%li): 64 Bit PCI Addressing Enabled\n",
 			ha->host_no);
 #else
-	if (pci_set_dma_mask(ha->pdev, 0xffffffff)) {
+	if (pci_set_dma_mask(ha->pdev, DMA_32BIT_MASK)) {
 		printk(KERN_WARNING "scsi(%li): Unable to set a "
 		       "suitable DMA mask - aborting\n", ha->host_no);
 		error = -ENODEV;


[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] qla1280: slightly strange DMA mask
  2005-11-20  7:34 [KJ] qla1280: slightly strange DMA mask Alexey Dobriyan
@ 2005-11-20  7:40 ` Jaco Kroon
  0 siblings, 0 replies; 2+ messages in thread
From: Jaco Kroon @ 2005-11-20  7:40 UTC (permalink / raw)
  To: kernel-janitors


[-- Attachment #1.1: Type: text/plain, Size: 1944 bytes --]

Alexey Dobriyan wrote:
> The question is what to do with ~0LL.

Well, on x86 and amd64 at least long long is 64-bits in both cases.
Therefor I would guess that it needs to me DMA_64BIT_MASK.
Additionally, to support this, it seems it's inside an ifdef for
QLA_64BIT_PTR which supports the 64-bit theory to an extent.

Does this make sense?

Also, in that case it would try to use a 64-bit DMA mask, and try to
fallback to 32-bit if that fails.

> --- linux-kj.orig/drivers/scsi/qla1280.c
> +++ linux-kj/drivers/scsi/qla1280.c
> @@ -348,6 +348,7 @@
>  #include <linux/pci_ids.h>
>  #include <linux/interrupt.h>
>  #include <linux/init.h>
> +#include <linux/dma-mapping.h>
>  
>  #include <asm/io.h>
>  #include <asm/irq.h>
> @@ -4571,7 +4572,7 @@ qla1280_probe_one(struct pci_dev *pdev, 
>  
>  #ifdef QLA_64BIT_PTR
>  	if (pci_set_dma_mask(ha->pdev, (dma_addr_t) ~ 0ULL)) {
> 				       ^^^^^^^^^^^^^^^^^^^
> 
> -		if (pci_set_dma_mask(ha->pdev, 0xffffffff)) {
> +		if (pci_set_dma_mask(ha->pdev, DMA_32BIT_MASK)) {
>  			printk(KERN_WARNING "scsi(%li): Unable to set a "
>  			       "suitable DMA mask - aborting\n", ha->host_no);
>  			error = -ENODEV;
> @@ -4581,7 +4582,7 @@ qla1280_probe_one(struct pci_dev *pdev, 
>  		dprintk(2, "scsi(%li): 64 Bit PCI Addressing Enabled\n",
>  			ha->host_no);
>  #else
> -	if (pci_set_dma_mask(ha->pdev, 0xffffffff)) {
> +	if (pci_set_dma_mask(ha->pdev, DMA_32BIT_MASK)) {
>  		printk(KERN_WARNING "scsi(%li): Unable to set a "
>  		       "suitable DMA mask - aborting\n", ha->host_no);
>  		error = -ENODEV;
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Kernel-janitors mailing list
> Kernel-janitors@lists.osdl.org
> https://lists.osdl.org/mailman/listinfo/kernel-janitors


-- 
There are only 10 kinds of people in this world,
  those that understand binary and those that don't.
http://www.kroon.co.za/

[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3166 bytes --]

[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2005-11-20  7:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-20  7:34 [KJ] qla1280: slightly strange DMA mask Alexey Dobriyan
2005-11-20  7:40 ` Jaco Kroon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.