linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aaro Koskinen <aaro.koskinen@iki.fi>
To: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Jens Axboe <axboe@kernel.dk>,
	linux-ide@vger.kernel.org, linux-mips@vger.kernel.org
Subject: Loongson 2F IDE/ATA broken with lemote2f_defconfig
Date: Sun, 6 Jan 2019 14:46:07 +0200	[thread overview]
Message-ID: <20190106124607.GK27785@darkstar.musicnaut.iki.fi> (raw)

Hi,

Commit 7ff7a5b1bfff ("MIPS: lemote2f_defconfig: Convert to use libata
PATA drivers") switched from IDE to libata PATA on Loongson 2F, but
neither PATA_AMD or PATA_CS5536 work well on this platform compared
to the AMD74XX IDE driver.

During the ATA init/probe there is interrupt storm from irq 14, and
majority of system boots end up with "nobody cared... IRQ disabled".
So the result is a very slow disk access.

It seems that the interrupt gets crazy after the port freeze done early
during the init, and for whatever reason it cannot be cleared.

With the below workaround I was able to boot the system normally. I
guess that rather than going back to old IDE driver, we should just try
to make pata_cs5536 work (and forget PATA AMD on this board)...?

A.

...

diff --git a/drivers/ata/pata_cs5536.c b/drivers/ata/pata_cs5536.c
index dc1255294628..71e485547ee8 100644
--- a/drivers/ata/pata_cs5536.c
+++ b/drivers/ata/pata_cs5536.c
@@ -229,6 +229,16 @@ static void cs5536_set_dmamode(struct ata_port *ap, struct ata_device *adev)
 	cs5536_write(pdev, ETC, etc);
 }
 
+static void cs5536_noop_freeze(struct ata_port *ap)
+{
+	/*
+	 * Some CS5536 controllers result in a screaming interrupt if ATA_NIEN
+	 * is manipulated. Leave it alone and just clear pending IRQ.
+	 */
+	ap->ops->sff_check_status(ap);
+	ata_bmdma_irq_clear(ap);
+}
+
 static struct scsi_host_template cs5536_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
@@ -238,6 +248,7 @@ static struct ata_port_operations cs5536_port_ops = {
 	.cable_detect		= cs5536_cable_detect,
 	.set_piomode		= cs5536_set_piomode,
 	.set_dmamode		= cs5536_set_dmamode,
+	.freeze			= cs5536_noop_freeze,
 };
 
 /**

             reply	other threads:[~2019-01-06 12:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-06 12:46 Aaro Koskinen [this message]
2019-01-12 15:26 ` Loongson 2F IDE/ATA broken with lemote2f_defconfig Aaro Koskinen
2019-01-14 13:16   ` Bartlomiej Zolnierkiewicz
2019-01-26 18:43     ` Aaro Koskinen
2019-02-07 15:02       ` Bartlomiej Zolnierkiewicz
2019-05-14 20:01         ` Aaro Koskinen

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=20190106124607.GK27785@darkstar.musicnaut.iki.fi \
    --to=aaro.koskinen@iki.fi \
    --cc=axboe@kernel.dk \
    --cc=b.zolnierkie@samsung.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-mips@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).