mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Problems with Recent Patches to IDE Driver
@ 2010-08-13 14:41 Jon E
  2010-08-15 20:28 ` Alan Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Jon E @ 2010-08-13 14:41 UTC (permalink / raw)
  To: linux-kernel



Hi,
 
We manufacture an interface board for our product that utilizes the IDE interface.  A couple of patches were made (back in 2008, kernel 2.6.30 series) to the IDE driver code that are now causing us some grief as we port our driver from kernel 2.6.15 to 2.6.32 (FC5 to Ubuntu LL).
 
1. Refer to http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.30.y.git;a=commit;h=dafd01cc14a38690c87981eb2670d9c95f799ffd
 
A change was made to include/linux/hdreg.h that wrapped the WIN_xx macros in #ifndef/#endif __KERNEL__.  Our code utilized those macros and now no longer builds.
 
The area of code in oiur driver modules that's affected:

...
        // If writing to Audio card, indicate which Audio Channel
        if ((!reading) && (!DMAIPData))
        {
            outb(to_channel(CardAndChannel), LCYL_REG);
        }
        outb(reading ? WIN_READDMA : WIN_WRITEDMA, COMMAND_REG);
    case ide_dma_begin:
        outb(inb(dma_base)|1, dma_base); // start DMA 
        return 0;
    case ide_dma_end: // returns 1 on error, 0 otherwise 
...
 
The driver is built as a kernel module.  I'm not defining __KERNEL__ in my Makefile but the make process is picking up __KERNEL__ from /lib/modules/2.6.32-24-generic/build/Makefile and so, the compile fails thus:
 
ideDriver.c: In function ‘DmaProc’:
ideDriver.c:4208: error: ‘WIN_READDMA’ undeclared (first use in this function)
ideDriver.c:4208: error: (Each undeclared identifier is reported only once
ideDriver.c:4208: error: for each function it appears in.)
ideDriver.c:4208: error: ‘WIN_WRITEDMA’ undeclared (first use in this function)
ideDriver.o] Error 1
 
2. Refer to http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.30.y.git;a=commitdiff;h=18de10170df31d34b342612f1c896a16a52f0a5c
 
It seems that the ide_hwifs master data array has been removed from ide.h.  We're using this array in our code and I'm not sure how to code around the fact that it's no longer present.
 
Our code:
 
    for (h = 0; h < MAX_HWIFS; ++h)
    {
        ide_hwif_t *hwif = &ide_hwifs[h];
        if (hwif->major == IDEMajor[whichController])
        {
            IDEDrive = &hwif->drives[0];
            break;
        }
    }
 
I've googled for some answers but it seems there are no suggested workarounds for these problems.  Perhaps someone reading this can offer some suggestions?
 
Thanks,
Jon 		 	   		  

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

* Re: Problems with Recent Patches to IDE Driver
  2010-08-13 14:41 Problems with Recent Patches to IDE Driver Jon E
@ 2010-08-15 20:28 ` Alan Cox
  2010-08-16 14:50   ` Jon E
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Cox @ 2010-08-15 20:28 UTC (permalink / raw)
  To: Jon E; +Cc: linux-kernel

> I've googled for some answers but it seems there are no suggested workarounds for these problems.  Perhaps someone reading this can offer some suggestions?

Perhaps you could start by posting your patches ?

Most distributions have pretty much dropped the old IDE driver for
libata, which is actually better at supporting oddities so its probably
best to go that way.

Alan

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

* RE: Problems with Recent Patches to IDE Driver
  2010-08-15 20:28 ` Alan Cox
@ 2010-08-16 14:50   ` Jon E
  2010-08-18 13:50     ` Jon E
  0 siblings, 1 reply; 4+ messages in thread
From: Jon E @ 2010-08-16 14:50 UTC (permalink / raw)
  To: alan; +Cc: linux-kernel


----------------------------------------
> Date: Sun, 15 Aug 2010 21:28:52 +0100
> From: alan@lxorguk.ukuu.org.uk
> To: je_nfd@hotmail.com
> CC: linux-kernel@vger.kernel.org
> Subject: Re: Problems with Recent Patches to IDE Driver
>
> > I've googled for some answers but it seems there are no suggested workarounds for these problems. Perhaps someone reading this can offer some suggestions?
>
> Perhaps you could start by posting your patches ?
>
> Most distributions have pretty much dropped the old IDE driver for
> libata, which is actually better at supporting oddities so its probably
> best to go that way.

Could you elaborate a bit please?  Are you suggesting that the old driver was better at "supporting oddities" or that the new driver model is (better)?
 
I cannot post our code (not only because it's proprietary but it's also spread out amongst several files) but the snips I included in the original note illustrate the points of use.
 
The board is  an addon board with an ide interface, a RF-in port and an optional smartcard interface.  It starts out initializing itself as a network device (using the RF inteface) and then attempts to pick up the ide device information so it can continue the init process (set up ports, etc).
 
There's one thing I'm confused on, if I need to begin porting this to the new model.  Well, there's actually several things that confuse me, but I'll start with the basics.  Which base do I start with?  Looks to me (by reviewing the various *init routines in linux/drivers/ide, that I can choose: ide_pci, pci, platform, ioc4, ecard.  I think I can safely exclude ecard and ioc4, but that still leaves three from which to choose and I'm not how to determine how I need to proceed.
 
Jon 		 	   		  

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

* RE: Problems with Recent Patches to IDE Driver
  2010-08-16 14:50   ` Jon E
@ 2010-08-18 13:50     ` Jon E
  0 siblings, 0 replies; 4+ messages in thread
From: Jon E @ 2010-08-18 13:50 UTC (permalink / raw)
  To: linux-kernel


----------------------------------------
> Date: Sun, 15 Aug 2010 21:28:52 +0100
> From: alan@lxorguk.ukuu.org.uk
> To: je_nfd@hotmail.com
> CC: linux-kernel@vger.kernel.org
> Subject: Re: Problems with Recent Patches to IDE Driver
>
> > I've googled for some answers but it seems there are no suggested workarounds for these problems. Perhaps someone reading this can offer some suggestions?
>
> Perhaps you could start by posting your patches ?
>
> Most distributions have pretty much dropped the old IDE driver for
> libata, which is actually better at supporting oddities so its probably
> best to go that way.

Could you elaborate a bit please? Are you suggesting that the old driver was better at "supporting oddities" or that the new driver model is (better)?

I cannot post our code (not only because it's proprietary but it's also spread out amongst several files) but the snips I included in the original note illustrate the points of use.

The board is an addon board with an ide interface, a RF-in port and an optional smartcard interface. It starts out initializing itself as a network device (using the RF inteface) and then attempts to pick up the ide device information so it can continue the init process (set up ports, etc).

There's one thing I'm confused on, if I need to begin porting this to the new model. Well, there's actually several things that confuse me, but I'll start with the basics. Which base do I start with? Looks to me (by reviewing the various *init routines in linux/drivers/ide, that I can choose: ide_pci, pci, platform, ioc4, ecard. I think I can safely exclude ecard and ioc4, but that still leaves three from which to choose and I'm not how to determine how I need to proceed.

Jon
  		 	   		  

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

end of thread, other threads:[~2010-08-18 13:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-13 14:41 Problems with Recent Patches to IDE Driver Jon E
2010-08-15 20:28 ` Alan Cox
2010-08-16 14:50   ` Jon E
2010-08-18 13:50     ` Jon E

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®