mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Werner <andreas.werner@men.de>
To: <linux-kernel@vger.kernel.org>
Cc: <linux-ide@vger.kernel.org>, <tj@kernel.org>
Subject: [PATCH 1/2] libata-eh.c: Introduce new ata port flag for controller which lockup on read log page
Date: Fri, 4 Dec 2015 16:53:25 +0100	[thread overview]
Message-ID: <1d3460f05e6acf5c296f1b7dec0f9fdaca55c0fc.1449243748.git.andreas.werner@men.de> (raw)
In-Reply-To: <cover.1449243748.git.andreas.werner@men.de>

Some controller lockup on a ata_read_log_page.
Add new ata port flag ATA_FLAG_NO_LOG_PAGE which can used
to blacklist a controller.

If this flag is set, any attempt to read a log page returns an error
without actually issuing the command.

Signed-off-by: Andreas Werner <andreas.werner@men.de>
---
 drivers/ata/libata-eh.c | 9 +++++++++
 include/linux/libata.h  | 1 +
 2 files changed, 10 insertions(+)

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index cb0508a..f3e6277 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1505,12 +1505,21 @@ static const char *ata_err_string(unsigned int err_mask)
 unsigned int ata_read_log_page(struct ata_device *dev, u8 log,
 			       u8 page, void *buf, unsigned int sectors)
 {
+	unsigned long ap_flags = dev->link->ap->flags;
 	struct ata_taskfile tf;
 	unsigned int err_mask;
 	bool dma = false;
 
 	DPRINTK("read log page - log 0x%x, page 0x%x\n", log, page);
 
+	/*
+	 * Return error without actually issuing the
+	 * command on controller which e.g. lockup
+	 * on a read log page.
+	 */
+	if (flags & ATA_FLAG_NO_LOG_PAGE)
+		return AC_ERR_DEV;
+
 retry:
 	ata_tf_init(dev, &tf);
 	if (dev->dma_mode && ata_id_has_read_log_dma_ext(dev->id) &&
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 83577f8..600c1e0 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -210,6 +210,7 @@ enum {
 	ATA_FLAG_SLAVE_POSS	= (1 << 0), /* host supports slave dev */
 					    /* (doesn't imply presence) */
 	ATA_FLAG_SATA		= (1 << 1),
+	ATA_FLAG_NO_LOG_PAGE	= (1 << 5), /* do not issue log page read */
 	ATA_FLAG_NO_ATAPI	= (1 << 6), /* No ATAPI support */
 	ATA_FLAG_PIO_DMA	= (1 << 7), /* PIO cmds via DMA */
 	ATA_FLAG_PIO_LBA48	= (1 << 8), /* Host DMA engine is LBA28 only */
-- 
2.6.2


  reply	other threads:[~2015-12-04 15:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04 15:52 [PATCH 0/2] libata: introduce ATA_FLAG_NO_LOG_PAGE Andreas Werner
2015-12-04 15:53 ` Andreas Werner [this message]
2015-12-04 16:13   ` [PATCH 1/2] libata-eh.c: Introduce new ata port flag for controller which lockup on read log page kbuild test robot
2015-12-04 16:19   ` kbuild test robot
2015-12-04 15:53 ` [PATCH 2/2] ata/sata_fsl.c: add ATA_FLAG_NO_LOG_PAGE to blacklist the controller for log page reads Andreas Werner

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=1d3460f05e6acf5c296f1b7dec0f9fdaca55c0fc.1449243748.git.andreas.werner@men.de \
    --to=andreas.werner@men.de \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@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

all inboxes | Powered by JetHome®