From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
Jeremy Higdon <jeremy@sgi.com>
Subject: Re: [PATCH 5/7] sgiioc4: use ->init_dma method
Date: Tue, 09 Sep 2008 23:32:24 +0400 [thread overview]
Message-ID: <48C6CF48.5060309@ru.mvista.com> (raw)
In-Reply-To: <200803091631.48968.bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz wrote:
> * Move dma_base check from sgiioc4_ide_setup_pci_device()
> to ide_dma_sgiioc4().
This check should've been thrown out -- it's never true.
> * Replace ide_dma_sgiioc4() 'unsigned long dma_base' argument
> by 'const struct ide_port_info *d'.
> * Move hwif->INB setup from ide_init_sgiioc4() to
> sgiioc4_ide_setup_pci_device().
> * Move ide_init_sgiioc4() call from sgiioc4_ide_setup_pci_device()
> to ide_dma_sgiioc4().
> * Convert the driver to use ->init_dma method.
> Cc: Jeremy Higdon <jeremy@sgi.com>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Index: b/drivers/ide/pci/sgiioc4.c
> ===================================================================
> --- a/drivers/ide/pci/sgiioc4.c
> +++ b/drivers/ide/pci/sgiioc4.c
> @@ -327,15 +327,21 @@ sgiioc4_INB(unsigned long port)
> return reg;
> }
>
> +static void __devinit ide_init_sgiioc4(ide_hwif_t *);
> +
> /* Creates a dma map for the scatter-gather list entries */
> static int __devinit
> -ide_dma_sgiioc4(ide_hwif_t * hwif, unsigned long dma_base)
> +ide_dma_sgiioc4(ide_hwif_t *hwif, const struct ide_port_info *d)
> {
> struct pci_dev *dev = to_pci_dev(hwif->dev);
> + unsigned long dma_base = pci_resource_start(dev, 0) + IOC4_DMA_OFFSET;
> void __iomem *virt_dma_base;
> int num_ports = sizeof (ioc4_dma_regs_t);
> void *pad;
>
> + if (dma_base == 0)
> + return -1;
> +
It should be quite obvious that 'dma_base' will never be 0 since
IOC4_DMA_OFFSET == 0x140.
> printk(KERN_INFO "%s: BM-DMA at 0x%04lx-0x%04lx\n", hwif->name,
> dma_base, dma_base + num_ports - 1);
It should print "MMIO-DMA" since the registers are memory-mapped.
Making another notch...
MBR, Sergei
prev parent reply other threads:[~2008-09-09 19:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-09 15:31 [PATCH 5/7] sgiioc4: use ->init_dma method Bartlomiej Zolnierkiewicz
2008-09-09 19:32 ` Sergei Shtylyov [this message]
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=48C6CF48.5060309@ru.mvista.com \
--to=sshtylyov@ru.mvista.com \
--cc=bzolnier@gmail.com \
--cc=jeremy@sgi.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).