From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Anton Salnikov <asalnikov@ru.mvista.com>,
linux-ide@vger.kernel.org, bzolnier@gmail.com
Subject: Re: [PATCH] Palmchip BK3710 IDE driver
Date: Fri, 18 Jan 2008 17:14:49 +0300 [thread overview]
Message-ID: <4790B459.3000407@ru.mvista.com> (raw)
In-Reply-To: <20080117232303.3f34c87a@lxorguk.ukuu.org.uk>
Hello.
Alan Cox wrote:
>>This is Palmchip BK3710 IDE controller support for kernel version 2.6.24-rc8.
>>The IDE controller logic supports PIO, multiword DMA and ultra-DMA modes.
>>Supports interface to compact Flash (CF) configured in True-IDE mode.
> New drivers should really be going at least parallel into drivers/ata and
> legacy IDE.
Alas, it's unlikely that we can spend more time on developing libata
equivalent which we don't need at this point.
>>+struct palm_bk3710_ideconfigregs {
>>+ unsigned short idetimp __attribute__((packed));
>>+ unsigned short idetims __attribute__((packed));
>>+ unsigned char sidetim;
>>+ unsigned short slewctl __attribute__((packed));
>>+ unsigned char idestatus;
>>+ unsigned short udmactl __attribute__((packed));
>>+ unsigned short udmatim __attribute__((packed));
>>+ unsigned char rsvd0[4];
>>+ unsigned int miscctl __attribute__((packed));
>>+ unsigned int regstb __attribute__((packed));
> NAK - the size of an unsigned int in the kernel isn't defined. All the
> packed stuff is also horribly platform dependant. True the driver is ARM
> only currently but that doesn't make it a good idea.
> Can't you use defined offsets ?
>>+struct palm_bk3710_ideregs {
>>+ struct palm_bk3710_dmaengineregs dmaengine;
> So why are only some packed ?
>>+ /* udmatim Register */
>>+ palm_bk3710_base->config.udmatim &= 0xFFF0;
>>+ palm_bk3710_base->config.udmatim |= level;
> Direct memory access to I/O space - should be using read/write functions
Sigh, I was anticipationg that somebody would say that... :-)
>>+ if (mate && mate->present) {
>>+ u8 mode2 = ide_get_best_pio_mode(mate, 255, 4);
> If the pair device is present but not in the best mode it can do this
> will be wrong surely ?
Why? ATA/PI says in the note to the table "Register transfer to/from device":
5 Mode shall be selected no higher than the *highest* mode supported by the
*slowest* device.
Some other drivers are already using the same code (I'm not even sure it's
needed here -- never saw the chip documentation).
>>+ if (!request_region(mem->start, 8, palm_bk3710_hwif->name)) {
>>+ printk(KERN_ERR "Error, ports in use.\n");
>>+ return -EBUSY;
>>+ }
>>+
>>+ palm_bk3710_hwif->dmatable_cpu = dma_alloc_coherent(
>>+ NULL,
>>+ PRD_ENTRIES * PRD_BYTES,
>>+ &palm_bk3710_hwif->dmatable_dma,
>>+ GFP_ATOMIC);
>>+
>>+ if (!palm_bk3710_hwif->dmatable_cpu) {
> Leaks the reserved region
My bad -- I've managed to overlook this while reviewing.
>>+ printk(KERN_ERR "Error, unable to allocate DMA table.\n");
>>+ return -ENOMEM;
>>+ }
>>-static void ide_dma_exec_cmd(ide_drive_t *drive, u8 command)
>>+void ide_dma_exec_cmd(ide_drive_t *drive, u8 command)
>> {
>> /* issue cmd to drive */
>> ide_execute_command(drive, command, &ide_dma_intr, 2*WAIT_CMD,
>>dma_timer_expiry);
>> }
>>+EXPORT_SYMBOL(ide_dma_exec_cmd);
> These are not needed the NULL default request will fill them in for you
It won't -- we can *not* call ide_setup_dma() which fills them out as this
is not a PCI chip.
MBR, Sergei
next prev parent reply other threads:[~2008-01-18 14:13 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-17 18:50 [PATCH] Palmchip BK3710 IDE driver Anton Salnikov
2008-01-17 18:57 ` Sergei Shtylyov
2008-01-17 23:23 ` Alan Cox
2008-01-18 14:14 ` Sergei Shtylyov [this message]
2008-01-18 15:04 ` Alan Cox
2008-01-18 18:03 ` Sergei Shtylyov
2008-01-18 22:20 ` Bartlomiej Zolnierkiewicz
2008-01-18 22:19 ` Bartlomiej Zolnierkiewicz
-- strict thread matches above, loose matches on Subject: below --
2008-01-21 18:44 Anton Salnikov
2008-01-21 19:51 ` Alan Cox
2008-01-22 12:11 ` Anton Salnikov
2008-01-22 14:37 ` Alan Cox
2008-01-22 19:31 ` Jeff Garzik
2008-01-22 20:30 ` Sergei Shtylyov
2008-01-22 22:22 ` Alan Cox
2008-01-23 13:38 ` Sergei Shtylyov
2008-01-23 14:59 ` Alan Cox
2008-01-23 14:32 ` Sergei Shtylyov
2008-01-24 15:01 Anton Salnikov
2008-01-24 19:18 ` Sergei Shtylyov
2008-01-25 12:12 Anton Salnikov
2008-01-29 18:36 ` Sergei Shtylyov
2008-01-29 18:38 ` Alan Cox
2008-02-02 0:29 ` Bartlomiej Zolnierkiewicz
2008-02-05 16:04 Anton Salnikov
2008-02-06 1:35 ` Bartlomiej Zolnierkiewicz
2008-05-15 18:32 ` Sergei Shtylyov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4790B459.3000407@ru.mvista.com \
--to=sshtylyov@ru.mvista.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=asalnikov@ru.mvista.com \
--cc=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.