Skip to contentSkip to conversation

DMA in PCI chipset -- module vs. compiled-in

DISCUSSION William Park 5 participants 11 messages Feb 6, 2006 – Feb 8, 2006

lore
Share & tools
lore
#0 lore raw

Dear experts,

Normally, my PCI chipset (ie. via82cxxx, hpt366) are compiled in, and it correctly enables DMA of my harddisk.

But, for experiment, I tried compiling in only the "generic" options, and moved all specific PCI chipsets as modules. Hotplug loads the modules, but with all 'hdparm' options turned off. When I tried turning on DMA,

    $ hdparm -m 16 -c 1 -u 1 -d 1 /dev/hda
I get
    /dev/hda:
     setting 32-bit IO_support flag to 1
     setting multcount to 16
     setting unmaskirq to 1 (on)
     setting using_dma to 1 (on)
     HDIO_SET_DMA failed: Operation not permitted
     multcount    = 16 (on)
     IO_support   =  1 (32-bit)
     unmaskirq    =  1 (on)
     using_dma    =  0 (off)

Is this normal? How do I turn on DMA, if I load my PCI chipset as module?

Signature · 5 lines
William Park <[email protected]>, Toronto, Canada
ThinFlash: Linux thin-client on USB key (flash) drive
	   http://home.eol.ca/~parkw/thinflash.html
BashDiff: Super Bash shell
	  http://freshmeat.net/projects/bashdiff/
#1 lore raw
Quoted 4 lines · William Park

But, for experiment, I tried compiling in only the "generic" options, and moved all specific PCI chipsets as modules. Hotplug loads the modules, but with all 'hdparm' options turned off. When I tried turning on DMA,

Generic and chipset specific support are not complementary, they are mutually exclusive. Having generic PCI IDE support enabled will prevent the chipset specific support from working properly.

This is actually a problem in several areas of the kernel (it's the same for "Generic RTC" vs. the normal RTC) - I don't think the name "Generic" properly reflects that it will prevent more specific device support from working.

Lee

#2 lore raw

Hi Lee,

Quoted 4 lines · Lee Revell

This is actually a problem in several areas of the kernel (it's the same for "Generic RTC" vs. the normal RTC) - I don't think the name "Generic" properly reflects that it will prevent more specific device support from working.

What about "Fallback $DEVICE" instead?

Regards

Ingo Oeser

#3 lore raw
Quoted 9 lines · Ingo Oeser

Hi Lee,

Quoted 4 lines · Lee Revell

This is actually a problem in several areas of the kernel (it's the same for "Generic RTC" vs. the normal RTC) - I don't think the name "Generic" properly reflects that it will prevent more specific device support from working.

What about "Fallback $DEVICE" instead?

Yes, that would be much better for the RTC case.

Lee

#4 lore raw
In reply to Lee Revell
Quoted 3 lines · Lee Revell

Generic and chipset specific support are not complementary, they are mutually exclusive. Having generic PCI IDE support enabled will prevent the chipset specific support from working properly.

Untrue.

The PCI generic driver by default grabs only hardware with PCI IDS it knows can be driven generically. That list purposefully has no overlaps with chipset drivers.

Alan

#5 lore raw
Quoted 10 lines · Alan Cox
Quoted 3 lines · Lee Revell

Generic and chipset specific support are not complementary, they are mutually exclusive. Having generic PCI IDE support enabled will prevent the chipset specific support from working properly.

Untrue.

The PCI generic driver by default grabs only hardware with PCI IDS it knows can be driven generically. That list purposefully has no overlaps with chipset drivers.

OK. But wasn't this a problem in previous kernels?

Lee

#6 lore raw
Quoted 6 lines · Lee Revell
Quoted 5 lines · Alan Cox
Quoted 3 lines · Lee Revell

Generic and chipset specific support are not complementary, they are mutually exclusive. Having generic PCI IDE support enabled will prevent the chipset specific support from working properly.

Quoted 7 lines
Quoted 5 lines

Untrue.

The PCI generic driver by default grabs only hardware with PCI IDS it knows can be driven generically. That list purposefully has no overlaps with chipset drivers.

OK. But wasn't this a problem in previous kernels?

It wasn't. The issue is more complicated, you can have three host drivers driving the same hardware:

* ide-generic driver
- ISA like support
- also works for PCI in legacy mode

* IDE PCI generic (the one Alan refers to)
- generic IDE PCI support
- by default doesn't grab IDs for which we have other drivers (can be forced by using kernel parameter)

* chipset specific driver

The most common mistake is to built-in ide-generic driver and compile chipset specific driver as module...

To William:
CONFIG_IDE_GENERIC=n is a likely solution for your problem.

Bartlomiej

#7 lore raw
Quoted 4 lines · Bartlomiej Zolnierkiewicz

* chipset specific driver

The most common mistake is to built-in ide-generic driver and compile chipset specific driver as module...

Oh that no longer works. That worked in 2.4, as it would take over the chipset. Didn't work if it was in use at the time but did work correctly if idle.

#8 lore raw
Quoted 9 lines · Alan Cox
Quoted 4 lines · Bartlomiej Zolnierkiewicz

* chipset specific driver

The most common mistake is to built-in ide-generic driver and compile chipset specific driver as module...

Oh that no longer works. That worked in 2.4, as it would take over the chipset. Didn't work if it was in use at the time but did work correctly if idle.

I'm talking about _driver_ here and it works just fine.

If you are talking about "taking over" feature, you are right. It was racy and indeed "worked" depending on timing.

Bartlomiej

#9 lore raw
Quoted 7 lines · Bartlomiej Zolnierkiewicz
Quoted 6 lines · Alan Cox
Quoted 4 lines · Bartlomiej Zolnierkiewicz

* chipset specific driver

The most common mistake is to built-in ide-generic driver and compile chipset specific driver as module...

Quoted 8 lines
Quoted 3 lines

Oh that no longer works. That worked in 2.4, as it would take over the chipset. Didn't work if it was in use at the time but did work correctly if idle.

I'm talking about _driver_ here and it works just fine.

If you are talking about "taking over" feature, you are right. It was racy and indeed "worked" depending on timing.

Interesting. I'll move the "generic" as module, and see how it goes.

Signature · 5 lines
William Park <[email protected]>, Toronto, Canada
ThinFlash: Linux thin-client on USB key (flash) drive
	   http://home.eol.ca/~parkw/thinflash.html
BashDiff: Super Bash shell
	  http://freshmeat.net/projects/bashdiff/
#10 lore raw
In reply to Alan Cox
Quoted 10 lines · Alan Cox
Quoted 3 lines · Lee Revell

Generic and chipset specific support are not complementary, they are mutually exclusive. Having generic PCI IDE support enabled will prevent the chipset specific support from working properly.

Untrue.

The PCI generic driver by default grabs only hardware with PCI IDS it knows can be driven generically. That list purposefully has no overlaps with chipset drivers.

The kernel I'm using is 2.6.14. My chipset is Via 82c694x and 82c686b (Abit VP6 dual-P3 with HighPoint 370). DMA is on only when 'via82cxxx' and 'hpt366' are compiled in. Most importantly, DMA cannot be turned on if loading by module.

Does it mean that this "bug" is pecular to my chipset?

Signature · 5 lines
William Park <[email protected]>, Toronto, Canada
ThinFlash: Linux thin-client on USB key (flash) drive
	   http://home.eol.ca/~parkw/thinflash.html
BashDiff: Super Bash shell
	  http://freshmeat.net/projects/bashdiff/