Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754609AbbLDPz0 (ORCPT ); Fri, 4 Dec 2015 10:55:26 -0500 Received: from mail1.bemta3.messagelabs.com ([195.245.230.166]:14945 "EHLO mail1.bemta3.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753309AbbLDPzW (ORCPT ); Fri, 4 Dec 2015 10:55:22 -0500 X-Env-Sender: Andreas.Werner@men.de X-Msg-Ref: server-12.tower-39.messagelabs.com!1449244519!10280464!1 X-Originating-IP: [80.255.6.145] X-StarScan-Received: X-StarScan-Version: 7.19.2; banners=-,-,- X-VirusChecked: Checked X-PGP-Universal: processed; by keys.men.de on Fri, 04 Dec 2015 16:55:19 +0100 Date: Fri, 4 Dec 2015 16:53:25 +0100 From: Andreas Werner To: CC: , Subject: [PATCH 1/2] libata-eh.c: Introduce new ata port flag for controller which lockup on read log page Message-ID: <1d3460f05e6acf5c296f1b7dec0f9fdaca55c0fc.1449243748.git.andreas.werner@men.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [192.1.1.170] X-ClientProxiedBy: MEN-EX01.intra.men.de (192.168.1.1) To MEN-EX01.intra.men.de (192.168.1.1) X-EXCLAIMER-MD-CONFIG: e4841e51-7998-49c0-ba41-8b8a0e2d8962 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2042 Lines: 59 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/