From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
linux-kernel@vger.kernel.org,
Sergei Shtylyov <sshtylyov@ru.mvista.com>
Subject: [PATCH 6/6] ide: rework handling of serialized ports
Date: Mon, 03 Nov 2008 21:03:26 +0100 [thread overview]
Message-ID: <20081103200326.5098.2058.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20081103200244.5098.29817.sendpatchset@localhost.localdomain>
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: rework handling of serialized ports
* hpt366: set IDE_HFLAG_SERIALIZE in hwif->host_flags if needed
in init_hwif_hpt366(). Remove HPT_SERIALIZE_IO while at it.
* Set IDE_HFLAG_SERIALIZE in hwif->host_flags if needed in
ide_init_port().
* Convert init_irq() to use IDE_HFLAG_SERIALIZE together with
hwif->host to find out ports which need to be serialized.
* Remove no longer needed save_match() and ide_hwif_t.serialized.
This patch should fix the incorrect grouping of port(s) from
host(s) that need serialization with port(s) that happen to use
the same IRQ(s) but are from the host(s) that don't need it.
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/hpt366.c | 8 -------
drivers/ide/ide-probe.c | 50 ++++--------------------------------------------
include/linux/ide.h | 1
3 files changed, 6 insertions(+), 53 deletions(-)
Index: b/drivers/ide/hpt366.c
===================================================================
--- a/drivers/ide/hpt366.c
+++ b/drivers/ide/hpt366.c
@@ -135,7 +135,6 @@
/* various tuning parameters */
#define HPT_RESET_STATE_ENGINE
#undef HPT_DELAY_INTERRUPT
-#define HPT_SERIALIZE_IO 0
static const char *quirk_drives[] = {
"QUANTUM FIREBALLlct08 08",
@@ -1288,7 +1287,6 @@ static u8 hpt3xx_cable_detect(ide_hwif_t
static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
{
struct hpt_info *info = hpt3xx_get_info(hwif->dev);
- int serialize = HPT_SERIALIZE_IO;
u8 chip_type = info->chip_type;
/* Cache the channel's MISC. control registers' offset */
@@ -1305,13 +1303,9 @@ static void __devinit init_hwif_hpt366(i
* Clock is shared between the channels,
* so we'll have to serialize them... :-(
*/
- serialize = 1;
+ hwif->host_flags |= IDE_HFLAG_SERIALIZE;
hwif->rw_disk = &hpt3xxn_rw_disk;
}
-
- /* Serialize access to this device if needed */
- if (serialize && hwif->mate)
- hwif->serialized = hwif->mate->serialized = 1;
}
static int __devinit init_dma_hpt366(ide_hwif_t *hwif,
Index: b/drivers/ide/ide-probe.c
===================================================================
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -863,31 +863,6 @@ static void ide_port_tune_devices(ide_hw
}
/*
- * save_match() is used to simplify logic in init_irq() below.
- *
- * A loophole here is that we may not know about a particular
- * hwif's irq until after that hwif is actually probed/initialized..
- * This could be a problem for the case where an hwif is on a
- * dual interface that requires serialization (eg. cmd640) and another
- * hwif using one of the same irqs is initialized beforehand.
- *
- * This routine detects and reports such situations, but does not fix them.
- */
-static void save_match(ide_hwif_t *hwif, ide_hwif_t *new, ide_hwif_t **match)
-{
- ide_hwif_t *m = *match;
-
- if (m && m->hwgroup && m->hwgroup != new->hwgroup) {
- if (!new->hwgroup)
- return;
- printk(KERN_WARNING "%s: potential IRQ problem with %s and %s\n",
- hwif->name, new->name, m->name);
- }
- if (!m || m->irq != hwif->irq) /* don't undo a prior perfect match */
- *match = new;
-}
-
-/*
* init request queue
*/
static int ide_init_queue(ide_drive_t *drive)
@@ -1051,26 +1026,13 @@ static int init_irq (ide_hwif_t *hwif)
mutex_lock(&ide_cfg_mtx);
hwif->hwgroup = NULL;
- /*
- * Group up with any other hwifs that share our irq(s).
- */
for (index = 0; index < MAX_HWIFS; index++) {
ide_hwif_t *h = ide_ports[index];
if (h && h->hwgroup) { /* scan only initialized ports */
- if (hwif->irq == h->irq) {
- if (hwif->chipset != ide_pci ||
- h->chipset != ide_pci) {
- save_match(hwif, h, &match);
- }
- }
- if (hwif->serialized) {
- if (hwif->mate && hwif->mate->irq == h->irq)
- save_match(hwif, h, &match);
- }
- if (h->serialized) {
- if (h->mate && hwif->irq == h->mate->irq)
- save_match(hwif, h, &match);
+ if (hwif->host_flags & IDE_HFLAG_SERIALIZE) {
+ if (hwif->host == h->host)
+ match = h;
}
}
}
@@ -1436,10 +1398,8 @@ static void ide_init_port(ide_hwif_t *hw
}
if ((d->host_flags & IDE_HFLAG_SERIALIZE) ||
- ((d->host_flags & IDE_HFLAG_SERIALIZE_DMA) && hwif->dma_base)) {
- if (hwif->mate)
- hwif->mate->serialized = hwif->serialized = 1;
- }
+ ((d->host_flags & IDE_HFLAG_SERIALIZE_DMA) && hwif->dma_base))
+ hwif->host_flags |= IDE_HFLAG_SERIALIZE;
if (d->host_flags & IDE_HFLAG_RQSIZE_256)
hwif->rqsize = 256;
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -832,7 +832,6 @@ typedef struct hwif_s {
unsigned extra_ports; /* number of extra dma ports */
unsigned present : 1; /* this interface exists */
- unsigned serialized : 1; /* serialized all channel operation */
unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */
struct device gendev;
next prev parent reply other threads:[~2008-11-03 20:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-03 20:02 [PATCH 1/6] ide: fix ->quirk_list checking in ide_do_request() Bartlomiej Zolnierkiewicz
2008-11-03 20:02 ` [PATCH 2/6] ide: always set nIEN on idle devices Bartlomiej Zolnierkiewicz
2008-11-03 20:03 ` [PATCH 3/6] rz1000: apply chipset quirks early Bartlomiej Zolnierkiewicz
2008-11-04 17:18 ` Sergei Shtylyov
2008-11-04 18:56 ` Sergei Shtylyov
2008-11-09 14:03 ` Bartlomiej Zolnierkiewicz
2008-11-03 20:03 ` [PATCH 4/6] trm290: add IDE_HFLAG_TRM290 host flag Bartlomiej Zolnierkiewicz
2008-11-04 17:36 ` Sergei Shtylyov
2008-11-03 20:03 ` [PATCH 5/6] cy82c693: remove superfluous ide_cy82c693 chipset type Bartlomiej Zolnierkiewicz
2008-11-03 20:03 ` Bartlomiej Zolnierkiewicz [this message]
2008-11-04 18:30 ` [PATCH 6/6] ide: rework handling of serialized ports Sergei Shtylyov
2008-11-04 18:34 ` Sergei Shtylyov
2008-11-09 14:04 ` Bartlomiej Zolnierkiewicz
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=20081103200326.5098.2058.sendpatchset@localhost.localdomain \
--to=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sshtylyov@ru.mvista.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 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).