From: Albert Lee <albertcc@tw.ibm.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>, Doug Maxey <dwm@enoyolf.org>,
Mark Lord <mlord@pobox.com>, Tejun Heo <htejun@gmail.com>,
Linux IDE <linux-ide@vger.kernel.org>
Subject: [PATCH 4/7] libata: use freeze/thaw for polling PIO
Date: Sat, 07 Jul 2007 15:09:32 +0800 [thread overview]
Message-ID: <468F3C2C.4050609@tw.ibm.com> (raw)
In-Reply-To: <468F3949.5050800@tw.ibm.com>
This patch let polling pio codes to use freeze()/thaw() for irq off/on.
The reason is: some ATAPI devices raises INTRQ even of nIEN = 1.
Using the host adapter irq mask mechanism, if available, is more reliable than the device nIEN bit.
ata_qc_set_polling() is also removed since now unused.
Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
---
Considerations:
Polling PIO, the new user of freeze()/thaw(), might have higher calling frequency to freeze()/thaw() than EH.
Can current implemention of freeze()/thaw() handle that?
We might need more testing on sata_nv, sata_promise, sata_sil, sata_sil24, sata_via and sata_vsc.
diff -Nrup 03_add_thaw_freeze/drivers/ata/libata-core.c 04_use_freeze_polling/drivers/ata/libata-core.c
--- 03_add_thaw_freeze/drivers/ata/libata-core.c 2007-07-07 10:38:55.000000000 +0800
+++ 04_use_freeze_polling/drivers/ata/libata-core.c 2007-07-07 10:40:10.000000000 +0800
@@ -4753,7 +4753,7 @@ static void ata_hsm_qc_complete(struct a
qc = ata_qc_from_tag(ap, qc->tag);
if (qc) {
if (likely(!(qc->err_mask & AC_ERR_HSM))) {
- ap->ops->irq_on(ap);
+ ap->ops->thaw(ap);
ata_qc_complete(qc);
} else
ata_port_freeze(ap);
@@ -4769,7 +4769,7 @@ static void ata_hsm_qc_complete(struct a
} else {
if (in_wq) {
spin_lock_irqsave(ap->lock, flags);
- ap->ops->irq_on(ap);
+ ap->ops->thaw(ap);
ata_qc_complete(qc);
spin_unlock_irqrestore(ap->lock, flags);
} else
@@ -5411,7 +5411,7 @@ unsigned int ata_qc_issue_prot(struct at
switch (qc->tf.protocol) {
case ATA_PROT_NODATA:
if (qc->tf.flags & ATA_TFLAG_POLLING)
- ata_qc_set_polling(qc);
+ ap->ops->freeze(ap);
ata_tf_to_host(ap, &qc->tf);
ap->hsm_task_state = HSM_ST_LAST;
@@ -5432,7 +5432,7 @@ unsigned int ata_qc_issue_prot(struct at
case ATA_PROT_PIO:
if (qc->tf.flags & ATA_TFLAG_POLLING)
- ata_qc_set_polling(qc);
+ ap->ops->freeze(ap);
ata_tf_to_host(ap, &qc->tf);
@@ -5461,7 +5461,7 @@ unsigned int ata_qc_issue_prot(struct at
case ATA_PROT_ATAPI:
case ATA_PROT_ATAPI_NODATA:
if (qc->tf.flags & ATA_TFLAG_POLLING)
- ata_qc_set_polling(qc);
+ ap->ops->freeze(ap);
ata_tf_to_host(ap, &qc->tf);
diff -Nrup 03_add_thaw_freeze/include/linux/libata.h 04_use_freeze_polling/include/linux/libata.h
--- 03_add_thaw_freeze/include/linux/libata.h 2007-07-07 09:59:42.000000000 +0800
+++ 04_use_freeze_polling/include/linux/libata.h 2007-07-07 10:40:10.000000000 +0800
@@ -1094,11 +1094,6 @@ static inline u8 ata_wait_idle(struct at
return status;
}
-static inline void ata_qc_set_polling(struct ata_queued_cmd *qc)
-{
- qc->tf.ctl |= ATA_NIEN;
-}
-
static inline struct ata_queued_cmd *__ata_qc_from_tag(struct ata_port *ap,
unsigned int tag)
{
next prev parent reply other threads:[~2007-07-07 7:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-07 6:57 [PATCH 0/7] libata: irq_on/off restructuring (take #2) Albert Lee
2007-07-07 7:00 ` [PATCH 1/7] libata: remove irq_on from ata_bus_reset() and ata_std_postreset() Albert Lee
2007-07-12 20:12 ` Jeff Garzik
2007-07-07 7:02 ` [PATCH 2/7] sata_promise: pdc_freeze() semantic change Albert Lee
2007-10-02 15:28 ` Jeff Garzik
2007-07-07 7:05 ` [PATCH 3/7] libata: add freeze/thaw to old EH LLDDs Albert Lee
2007-07-07 7:09 ` Albert Lee [this message]
2007-07-13 6:53 ` [PATCH 4/7] libata: use freeze/thaw for polling PIO Tejun Heo
2007-07-07 7:12 ` [PATCH 5/7] libata: integrate freeze/thaw with irq_on/off Albert Lee
2007-07-13 6:51 ` Tejun Heo
2007-07-16 9:17 ` Albert Lee
2007-07-07 7:20 ` [PATCH 6/7] libata: remove nIEN handling from ata_tf_load() Albert Lee
2007-07-07 7:23 ` [PATCH 7/7] libata: remove ap->last_ctl Albert Lee
2007-07-13 6:58 ` Tejun Heo
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=468F3C2C.4050609@tw.ibm.com \
--to=albertcc@tw.ibm.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=albertl@mail.com \
--cc=dwm@enoyolf.org \
--cc=htejun@gmail.com \
--cc=jeff@garzik.org \
--cc=linux-ide@vger.kernel.org \
--cc=mlord@pobox.com \
/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.