Skip to contentSkip to conversation

2.5.3-dj5 synclink.c fix so that it compiles

PATCH In review reddog83 4 participants 10 messages Feb 11, 2002 – Feb 12, 2002

lore
Share & tools
lore

reddog83

author
#0 lore raw

PATCH 1/1 2.5.3-dj5 synclink.c fix so that it compiles

This is a temp fix for thje synclink.c file in drivers/char it work's for me so DJ will you please apply this patch.
Thank you Victor Torres.
All it does it removes the #error please convert me to Documentation/DMA-mapping.txt
it compiles and work's great for me.
Please apply

synclink.c renamed from synclink.c.orig +0 -2
diff -urN linux-2.5.orig/drivers/char/synclink.c.orig linux/drivers/char/synclink.c
@@ -60,6 +60,8 @@
 #  define BREAKPOINT() { }
 #endif
 
-#error Please convert me to Documentation/DMA-mapping.txt
-
 #define MAX_ISA_DEVICES 10

#define MAX_PCI_DEVICES 10
#define MAX_TOTAL_DEVICES 20

#1 lore raw
Quoted 6 lines · On Mon, Feb 11 2002, reddog83 wrote:

This is a temp fix for thje synclink.c file in drivers/char it work's for me so DJ will you please apply this patch.
Thank you Victor Torres.
All it does it removes the #error please convert me to Documentation/DMA-mapping.txt
it compiles and work's great for me.

I find this _really_ hard to believe. It may compile, but does it link?

Quoted 1 line

Please apply

Not really

Signature · 1 line
Jens Axboe
#2 lore raw
In reply to reddog83
Quoted 1 line

This is a temp fix for thje synclink.c file in drivers/char it work's for

me

Quoted 6 lines

so DJ will you please apply this patch.
Thank you Victor Torres.
All it does it removes the #error please convert me to Documentation/DMA-mapping.txt
it compiles and work's great for me.
Please apply

There is nothing in the DMA-mapping.txt that applies to the PCI version of the synclink adapter (which does not do DMA to/from system memory).

The ISA version of the synclink adapter does do ISA DMA bus master transfers. After reading DMA-mapping.txt twice it is unclear what changes need to be applied. The documentation seems to imply that ISA devices need to make some pci_xxx calls. I'm not sure how this works when there is no PCI bus.

For now, removing the #error line should work fine for the PCI adapter and probably for the ISA as well.

I will look at this again as time allows.

I usually wait 6-12 months after the new development kernel opens before attempting to sync my drivers
to the latest changes. This avoids most of the eat-your-file-system phase, prevents wasting time chasing after a rapidly changing API, and still leaves another 12 months for tweaking.

Paul Fulghum, [email protected]
Microgate Corporation, www.microgate.com

#3 lore raw
Quoted 4 lines · David S. Miller

From: Jens Axboe <[email protected]>
Date: Tue, 12 Feb 2002 07:56:36 +0100

On Mon, Feb 11 2002, reddog83 wrote:

Quoted 8 lines
Quoted 4 lines

Paul-
That is understandable. I had the same guess as you when I made this patch. Why is ths synclink.c driver using DMA Mapping. After I took that line out I was fine becuase my system is fine.

The "real" fix for synclink is just something like this, afaics.

It is a PCI driver Jens, this change is not correct.

See my repeated follow-ups :-)

Signature · 1 line
Jens Axboe
#4 lore raw
In reply to Paul Fulghum
Quoted 5 lines
Quoted 3 lines

The "real" fix for synclink is just something like this, afaics.

It is a PCI driver Jens, this change is not correct.

See my repeated follow-ups :-)

It is an ISA and PCI driver, but only the ISA adapter uses DMA and requires DMA mapping.

Thanks for the patch Jens.

Paul Fulghum, [email protected]
Microgate Corporation, www.microgate.com

author
#5 lore raw
In reply to reddog83

Paul-
That is understandable. I had the same guess as you when I made this patch. Why is ths synclink.c driver using DMA Mapping. After I took that line out I was fine becuase my system is fine.

Quoted 35 lines · you
Quoted 1 line

This is a temp fix for thje synclink.c file in drivers/char it work's for

me

Quoted 6 lines

so DJ will you please apply this patch.
Thank you Victor Torres.
All it does it removes the #error please convert me to Documentation/DMA-mapping.txt
it compiles and work's great for me.
Please apply

There is nothing in the DMA-mapping.txt that applies to the PCI version of the synclink adapter (which does not do DMA to/from system memory).

The ISA version of the synclink adapter does do ISA DMA bus master transfers. After reading DMA-mapping.txt twice it is unclear what changes need to be applied. The documentation seems to imply that ISA devices need to make some pci_xxx calls. I'm not sure how this works when there is no PCI bus.

For now, removing the #error line should work fine for the PCI adapter and probably for the ISA as well.

I will look at this again as time allows.

I usually wait 6-12 months after the new development kernel opens before attempting to sync my drivers
to the latest changes. This avoids most of the eat-your-file-system phase, prevents wasting time chasing after a rapidly changing API, and still leaves another 12 months for tweaking.

Paul Fulghum, [email protected]
Microgate Corporation, www.microgate.com

#6 lore raw
In reply to reddog83
Quoted 4 lines · On Mon, Feb 11 2002, reddog83 wrote:

Paul-
That is understandable. I had the same guess as you when I made this patch. Why is ths synclink.c driver using DMA Mapping. After I took that line out I was fine becuase my system is fine.

The "real" fix for synclink is just something like this, afaics.

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.275 -> 1.276
# drivers/char/synclink.c 1.11 -> 1.12
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/02/12 [email protected] 1.276

# synclink is an ISA-only driver, so just use isa_virt_to_bus to make
# it work
# --------------------------------------------
#
diff -Nru a/drivers/char/synclink.c b/drivers/char/synclink.c
--- a/drivers/char/synclink.c	Tue Feb 12 07:55:54 2002
+++ b/drivers/char/synclink.c	Tue Feb 12 07:55:54 2002
@@ -60,8 +60,6 @@
 #  define BREAKPOINT() { }
 #endif

-#error Please convert me to Documentation/DMA-mapping.txt -
#define MAX_ISA_DEVICES 10
#define MAX_PCI_DEVICES 10
#define MAX_TOTAL_DEVICES 20
@@ -3985,7 +3983,7 @@
if ( info->buffer_list == NULL )
return -ENOMEM;

- info->buffer_list_phys = virt_to_bus(info->buffer_list);
+ info->buffer_list_phys = isa_virt_to_bus(info->buffer_list);
}

/* We got the memory for the buffer entry lists. */
@@ -4096,7 +4094,7 @@
kmalloc(DMABUFFERSIZE, GFP_KERNEL | GFP_DMA);
if ( BufferList[i].virt_addr == NULL )
return -ENOMEM;
- phys_addr = virt_to_bus(BufferList[i].virt_addr);
+ phys_addr = isa_virt_to_bus(BufferList[i].virt_addr);
}
BufferList[i].phys_addr = phys_addr;
}

Signature · 1 line
Jens Axboe
#7 lore raw

From: Jens Axboe <[email protected]>
Date: Tue, 12 Feb 2002 07:56:36 +0100

Quoted 4 lines · On Mon, Feb 11 2002, reddog83 wrote:

Paul-
That is understandable. I had the same guess as you when I made this patch. Why is ths synclink.c driver using DMA Mapping. After I took that line out I was fine becuase my system is fine.

The "real" fix for synclink is just something like this, afaics.

It is a PCI driver Jens, this change is not correct.

#8 lore raw
In reply to reddog83
Quoted 7 lines · Jens Axboe
Quoted 4 lines · On Mon, Feb 11 2002, reddog83 wrote:

Paul-
That is understandable. I had the same guess as you when I made this patch. Why is ths synclink.c driver using DMA Mapping. After I took that line out I was fine becuase my system is fine.

The "real" fix for synclink is just something like this, afaics.

Agrh, scratch that. It's not ISA only of course, my bad.

Signature · 1 line
Jens Axboe
#9 lore raw
In reply to reddog83
Quoted 10 lines · Jens Axboe
Quoted 7 lines · Jens Axboe
Quoted 4 lines · On Mon, Feb 11 2002, reddog83 wrote:

Paul-
That is understandable. I had the same guess as you when I made this patch. Why is ths synclink.c driver using DMA Mapping. After I took that line out I was fine becuase my system is fine.

The "real" fix for synclink is just something like this, afaics.

Agrh, scratch that. It's not ISA only of course, my bad.

For fsck sake, that path was ISA only... Ok, time for coffee.

Signature · 1 line
Jens Axboe