linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Evgeny Rodichev <er@sai.msu.su>, Brett Russ <russb@emc.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.14-rc2] libata: Marvell SATA support (DMA mode) (resend: v0.22)
Date: Wed, 05 Oct 2005 13:04:34 -0400	[thread overview]
Message-ID: <434407A2.6010605@pobox.com> (raw)
In-Reply-To: <Pine.GSO.4.63.0510051912230.10241@ra.sai.msu.su>

[-- Attachment #1: Type: text/plain, Size: 654 bytes --]

Evgeny Rodichev wrote:
> On Mon, 3 Oct 2005, Jeff Garzik wrote:
> 
>> applied
>>
> 
> This patch leads to freeze with Marvell MV88SX6041 4-port SATA II PCI-X 
> Controller (rev 03), as I wrote already
> (http://www.uwsg.iu.edu/hypermail/linux/kernel/0510.0/0203.html)
> 
> It is impossible to reboot the system without  harware reset (after 
> modprobe).

I'm betting a temporary workaround should be to disable CONFIG_SMP.

The first attached patch (patch.1) fixes one of the lockups.  The second 
attached patch (patch.2) should fix all the lockups, but that's just a 
guess, and it's a very ugly patch.

Note that patch.2 depends on patch.1.

	Jeff



[-- Attachment #2: patch.1 --]
[-- Type: text/plain, Size: 545 bytes --]

diff --git a/drivers/scsi/sata_mv.c b/drivers/scsi/sata_mv.c
--- a/drivers/scsi/sata_mv.c
+++ b/drivers/scsi/sata_mv.c
@@ -409,14 +409,8 @@ static void mv_irq_clear(struct ata_port
 static void mv_start_dma(void __iomem *base, struct mv_port_priv *pp,
 			 struct ata_port *ap)
 {
-	unsigned long flags;
-
-	spin_lock_irqsave(&ap->host_set->lock, flags);
-	
 	writelfl(EDMA_EN, base + EDMA_CMD_OFS);
 	pp->pp_flags |= MV_PP_FLAG_EDMA_EN;
-
-	spin_unlock_irqrestore(&ap->host_set->lock, flags);
 }
 
 static void mv_stop_dma(struct ata_port *ap)

[-- Attachment #3: patch.2 --]
[-- Type: text/plain, Size: 1815 bytes --]

diff --git a/drivers/scsi/sata_mv.c b/drivers/scsi/sata_mv.c
--- a/drivers/scsi/sata_mv.c
+++ b/drivers/scsi/sata_mv.c
@@ -413,16 +413,13 @@ static void mv_start_dma(void __iomem *b
 	pp->pp_flags |= MV_PP_FLAG_EDMA_EN;
 }
 
-static void mv_stop_dma(struct ata_port *ap)
+static void __mv_stop_dma(struct ata_port *ap)
 {
 	void __iomem *port_mmio = mv_ap_base(ap);
 	struct mv_port_priv *pp	= ap->private_data;
-	unsigned long flags;
 	u32 reg;
 	int i;
 
-	spin_lock_irqsave(&ap->host_set->lock, flags);
-	
 	if (!(MV_PP_FLAG_EDMA_DS_ACT & pp->pp_flags) &&
 	    ((MV_PP_FLAG_EDMA_EN & pp->pp_flags) ||
 	     (EDMA_EN & readl(port_mmio + EDMA_CMD_OFS)))) {
@@ -433,7 +430,6 @@ static void mv_stop_dma(struct ata_port 
 		writelfl(EDMA_DS, port_mmio + EDMA_CMD_OFS);
 		pp->pp_flags &= ~MV_PP_FLAG_EDMA_EN;
 	}
-	spin_unlock_irqrestore(&ap->host_set->lock, flags);
 	
 	/* now properly wait for the eDMA to stop */
 	for (i = 1000; i > 0; i--) {
@@ -444,15 +440,22 @@ static void mv_stop_dma(struct ata_port 
 		udelay(100);
 	}
 
-	spin_lock_irqsave(&ap->host_set->lock, flags);
 	pp->pp_flags &= ~MV_PP_FLAG_EDMA_DS_ACT;
-	spin_unlock_irqrestore(&ap->host_set->lock, flags);
 
 	if (EDMA_EN & reg) {
 		printk(KERN_ERR "ata%u: Unable to stop eDMA\n", ap->id);
 	}
 }
 
+static void mv_stop_dma(struct ata_port *ap)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&ap->host_set->lock, flags);
+	__mv_stop_dma(ap);
+	spin_unlock_irqrestore(&ap->host_set->lock, flags);
+}
+
 static void mv_dump_mem(void __iomem *start, unsigned bytes)
 {
 #ifdef ATA_DEBUG
@@ -845,7 +848,7 @@ static int mv_qc_issue(struct ata_queued
 		 * port.  Turn off EDMA so there won't be problems accessing
 		 * shadow block, etc registers.
 		 */
-		mv_stop_dma(qc->ap);
+		__mv_stop_dma(qc->ap);
 		return ata_qc_issue_prot(qc);
 	}
 

  reply	other threads:[~2005-10-05 17:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-30  5:36 [PATCH 2.6.14-rc2] libata: Marvell SATA support (DMA mode) (resend: v0.22) Brett Russ
2005-09-30 11:37 ` Lars Magne Ingebrigtsen
2005-10-04  2:08 ` Jeff Garzik
2005-10-05 15:17   ` Evgeny Rodichev
2005-10-05 17:04     ` Jeff Garzik [this message]
2005-10-05 17:10       ` Brett Russ
2005-10-05 19:14 ` Bogdan Costescu

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=434407A2.6010605@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=er@sai.msu.su \
    --cc=linux-kernel@vger.kernel.org \
    --cc=russb@emc.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).