From: Alan Cox <alan@redhat.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Tejun Heo <htejun@gmail.com>,
list linux-ide <linux-ide@vger.kernel.org>,
Jeff Garzik <jgarzik@pobox.com>, Alan Cox <alan@redhat.com>
Subject: Re: [RFC/Review] libata driver for Apple "macio" pata
Date: Fri, 1 Aug 2008 12:58:04 -0400 [thread overview]
Message-ID: <20080801165804.GA21906@devserv.devel.redhat.com> (raw)
In-Reply-To: <1217588203.11188.507.camel@pasglop>
> I know and I believe it should still be ok ... As I said, the chipset
> should use the PIO field in the register for PIO transfers. And if the
> above unknown bit is set, I suspect it's just going to increase the
> setup time a bit or something like that, which won't hurt other than
> perfs.
What I do with some other drivers is set the PIO mode in the pio mode function
but defer DMA timing setup to bmdma_start/stop methods. Some chips need this
in the PC world and that works nicely.
> > > +static unsigned long pata_macio_mode_filter(struct ata_device *adev,
> > > + unsigned long xfer_mask)
> > > +{
> > > + struct pata_macio_priv *priv = adev->link->ap->private_data;
> > > +
> > > + if (priv->dma_regs == NULL)
> > > + xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
> > > + return xfer_mask;
> > > +}
> >
> > Wouldn't it be better to clear these during initialization?
>
> I could. Doesn't matter much where it's done, does it ? Doing there
> allows to deal with a failure in my port_start() callback, if the
> allocation of the DMA table fails, I clear dma_regs.
For x86 we clear it later in some cases too - because the allocation is
done after we pass the sht and ata parameters to the setup functions.
> The reason is that I can only have 64K-4K per transfer (I don't think I
> can do 64K per DBDMA entry). So the above routine can potentially
> breakup, in the worst case scenario, the table into twice as many
> entries if they are all 64K precisely.
See ata_sff_dumb_qc_prep - we have PC chips with the same bug!
--
"Engineers are 'small children' when it comes to product warning labels"
-- John Duino
next prev parent reply other threads:[~2008-08-01 17:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-01 9:08 [RFC/Review] libata driver for Apple "macio" pata Benjamin Herrenschmidt
2008-08-01 9:59 ` Tejun Heo
2008-08-01 10:56 ` Benjamin Herrenschmidt
2008-08-01 16:13 ` Tejun Heo
2008-08-01 22:40 ` Benjamin Herrenschmidt
2008-08-01 16:58 ` Alan Cox [this message]
2008-08-01 22:43 ` Benjamin Herrenschmidt
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=20080801165804.GA21906@devserv.devel.redhat.com \
--to=alan@redhat.com \
--cc=benh@kernel.crashing.org \
--cc=htejun@gmail.com \
--cc=jgarzik@pobox.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.