Message ID | 1d3460f05e6acf5c296f1b7dec0f9fdaca55c0fc.1449243748.git.andreas.werner@men.de |
---|---|
State | Not Applicable |
Delegated to: | David Miller |
Headers | show |
Hi Andreas, [auto build test WARNING on tj-libata/for-next] [also build test WARNING on v4.4-rc3 next-20151203] url: https://github.com/0day-ci/linux/commits/Andreas-Werner/libata-introduce-ATA_FLAG_NO_LOG_PAGE/20151204-235659 base: https://git.kernel.org/pub/scm/linux/kernel/git/tj/libata for-next config: i386-randconfig-x003-12041200 (attached as .config) reproduce: # save the attached .config to linux build tree make ARCH=i386 All warnings (new ones prefixed by >>): In file included from include/linux/linkage.h:4:0, from include/linux/kernel.h:6, from drivers/ata/libata-eh.c:35: drivers/ata/libata-eh.c: In function 'ata_read_log_page': drivers/ata/libata-eh.c:1520:6: error: 'flags' undeclared (first use in this function) if (flags & ATA_FLAG_NO_LOG_PAGE) ^ include/linux/compiler.h:147:28: note: in definition of macro '__trace_if' if (__builtin_constant_p((cond)) ? !!(cond) : \ ^ >> drivers/ata/libata-eh.c:1520:2: note: in expansion of macro 'if' if (flags & ATA_FLAG_NO_LOG_PAGE) ^ drivers/ata/libata-eh.c:1520:6: note: each undeclared identifier is reported only once for each function it appears in if (flags & ATA_FLAG_NO_LOG_PAGE) ^ include/linux/compiler.h:147:28: note: in definition of macro '__trace_if' if (__builtin_constant_p((cond)) ? !!(cond) : \ ^ >> drivers/ata/libata-eh.c:1520:2: note: in expansion of macro 'if' if (flags & ATA_FLAG_NO_LOG_PAGE) ^ drivers/ata/libata-eh.c:1508:16: warning: unused variable 'ap_flags' [-Wunused-variable] unsigned long ap_flags = dev->link->ap->flags; ^ vim +/if +1520 drivers/ata/libata-eh.c 1504 */ 1505 unsigned int ata_read_log_page(struct ata_device *dev, u8 log, 1506 u8 page, void *buf, unsigned int sectors) 1507 { 1508 unsigned long ap_flags = dev->link->ap->flags; 1509 struct ata_taskfile tf; 1510 unsigned int err_mask; 1511 bool dma = false; 1512 1513 DPRINTK("read log page - log 0x%x, page 0x%x\n", log, page); 1514 1515 /* 1516 * Return error without actually issuing the 1517 * command on controller which e.g. lockup 1518 * on a read log page. 1519 */ > 1520 if (flags & ATA_FLAG_NO_LOG_PAGE) 1521 return AC_ERR_DEV; 1522 1523 retry: 1524 ata_tf_init(dev, &tf); 1525 if (dev->dma_mode && ata_id_has_read_log_dma_ext(dev->id) && 1526 !(dev->horkage & ATA_HORKAGE_NO_NCQ_LOG)) { 1527 tf.command = ATA_CMD_READ_LOG_DMA_EXT; 1528 tf.protocol = ATA_PROT_DMA; --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Hi Andreas, [auto build test ERROR on tj-libata/for-next] [also build test ERROR on v4.4-rc3 next-20151203] url: https://github.com/0day-ci/linux/commits/Andreas-Werner/libata-introduce-ATA_FLAG_NO_LOG_PAGE/20151204-235659 base: https://git.kernel.org/pub/scm/linux/kernel/git/tj/libata for-next config: i386-randconfig-x008-12041200 (attached as .config) reproduce: # save the attached .config to linux build tree make ARCH=i386 All error/warnings (new ones prefixed by >>): drivers/ata/libata-eh.c: In function 'ata_read_log_page': >> drivers/ata/libata-eh.c:1520:6: error: 'flags' undeclared (first use in this function) if (flags & ATA_FLAG_NO_LOG_PAGE) ^ drivers/ata/libata-eh.c:1520:6: note: each undeclared identifier is reported only once for each function it appears in >> drivers/ata/libata-eh.c:1508:16: warning: unused variable 'ap_flags' [-Wunused-variable] unsigned long ap_flags = dev->link->ap->flags; ^ vim +/flags +1520 drivers/ata/libata-eh.c 1502 * RETURNS: 1503 * 0 on success, AC_ERR_* mask otherwise. 1504 */ 1505 unsigned int ata_read_log_page(struct ata_device *dev, u8 log, 1506 u8 page, void *buf, unsigned int sectors) 1507 { > 1508 unsigned long ap_flags = dev->link->ap->flags; 1509 struct ata_taskfile tf; 1510 unsigned int err_mask; 1511 bool dma = false; 1512 1513 DPRINTK("read log page - log 0x%x, page 0x%x\n", log, page); 1514 1515 /* 1516 * Return error without actually issuing the 1517 * command on controller which e.g. lockup 1518 * on a read log page. 1519 */ > 1520 if (flags & ATA_FLAG_NO_LOG_PAGE) 1521 return AC_ERR_DEV; 1522 1523 retry: --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
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 */
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(+)