From d991c872ac7ffaacc4df93efbfbcb4189cee6440 Mon Sep 17 00:00:00 2001 From: Sander Eikelenboom Date: Sun, 20 Mar 2016 22:27:06 +0100 Subject: libata: Fixup awkward whitespace in warning by removing line continuation. Signed-off-by: Sander Eikelenboom Signed-off-by: Tejun Heo --- drivers/ata/libahci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 3982054..e13ba72 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -2549,8 +2549,8 @@ int ahci_host_activate(struct ata_host *host, struct scsi_host_template *sht) if (hpriv->flags & (AHCI_HFLAG_MULTI_MSI | AHCI_HFLAG_MULTI_MSIX)) { if (hpriv->irq_handler) - dev_warn(host->dev, "both AHCI_HFLAG_MULTI_MSI flag set \ - and custom irq handler implemented\n"); + dev_warn(host->dev, + "both AHCI_HFLAG_MULTI_MSI flag set and custom irq handler implemented\n"); rc = ahci_host_activate_multi_irqs(host, sht); } else { -- cgit v1.1 From 974e0a4537f556867483f493c7f67ccdcb7fc504 Mon Sep 17 00:00:00 2001 From: Damien Le Moal Date: Mon, 4 Apr 2016 12:17:09 -0400 Subject: libata-core: Allow longer timeout for drive spinup from PUIS When spinning up a drive from powered on standby mode (PUIS), SETFEATURES_SPINUP is executed with the default timeout used for any SETFEATURES subcommand, that is 5+10 seconds. The total 15s is too short for some drives to complete spinup (e.g. drives with a large indirection table stored on media), resulting in ata_dev_read_id to fail twice on the execution of SETFEATURES_SPINUP. For this feature, allow a larger default timeout of 30 seconds. However, in the same spirit as with the timeout of other feature subcommands, do not ignore ata_probe_timeout if it is set). Signed-off-by: Damien Le Moal Signed-off-by: Tejun Heo --- drivers/ata/libata-core.c | 6 +++++- include/linux/ata.h | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 55e257c..7b21021 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -4528,6 +4528,7 @@ unsigned int ata_dev_set_feature(struct ata_device *dev, u8 enable, u8 feature) { struct ata_taskfile tf; unsigned int err_mask; + unsigned long timeout = 0; /* set up set-features taskfile */ DPRINTK("set features - SATA features\n"); @@ -4539,7 +4540,10 @@ unsigned int ata_dev_set_feature(struct ata_device *dev, u8 enable, u8 feature) tf.protocol = ATA_PROT_NODATA; tf.nsect = feature; - err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); + if (enable == SETFEATURES_SPINUP) + timeout = ata_probe_timeout ? + ata_probe_timeout * 1000 : SETFEATURES_SPINUP_TIMEOUT; + err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, timeout); DPRINTK("EXIT, err_mask=%x\n", err_mask); return err_mask; diff --git a/include/linux/ata.h b/include/linux/ata.h index c1a2f34..f310ec0 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h @@ -371,7 +371,8 @@ enum { SETFEATURES_AAM_ON = 0x42, SETFEATURES_AAM_OFF = 0xC2, - SETFEATURES_SPINUP = 0x07, /* Spin-up drive */ + SETFEATURES_SPINUP = 0x07, /* Spin-up drive */ + SETFEATURES_SPINUP_TIMEOUT = 30000, /* 30s timeout for drive spin-up from PUIS */ SETFEATURES_SATA_ENABLE = 0x10, /* Enable use of SATA feature */ SETFEATURES_SATA_DISABLE = 0x90, /* Disable use of SATA feature */ -- cgit v1.1 From c9b5560aac7aa774143ce16c1fe7e0007dea79e2 Mon Sep 17 00:00:00 2001 From: Masanari Iida Date: Wed, 13 Apr 2016 23:36:27 +0900 Subject: treewide: Fix typos in libata.xml This patch fix spelling typos found in Documentation/Docbook/libata.xml. It is because the file was generated from comments in source, I had to fix comments in libata-core.c Signed-off-by: Masanari Iida Acked-by: Randy Dunlap Signed-off-by: Tejun Heo --- drivers/ata/libata-core.c | 16 ++++++++-------- drivers/ata/libata-scsi.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 7b21021..6f33ace 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -884,7 +884,7 @@ unsigned long ata_pack_xfermask(unsigned long pio_mask, * @udma_mask: resulting udma_mask * * Unpack @xfer_mask into @pio_mask, @mwdma_mask and @udma_mask. - * Any NULL distination masks will be ignored. + * Any NULL destination masks will be ignored. */ void ata_unpack_xfermask(unsigned long xfer_mask, unsigned long *pio_mask, unsigned long *mwdma_mask, unsigned long *udma_mask) @@ -3399,7 +3399,7 @@ int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev) * EH context. * * RETURNS: - * 0 if @linke is ready before @deadline; otherwise, -errno. + * 0 if @link is ready before @deadline; otherwise, -errno. */ int ata_wait_ready(struct ata_link *link, unsigned long deadline, int (*check_ready)(struct ata_link *link)) @@ -3480,7 +3480,7 @@ int ata_wait_ready(struct ata_link *link, unsigned long deadline, * EH context. * * RETURNS: - * 0 if @linke is ready before @deadline; otherwise, -errno. + * 0 if @link is ready before @deadline; otherwise, -errno. */ int ata_wait_after_reset(struct ata_link *link, unsigned long deadline, int (*check_ready)(struct ata_link *link)) @@ -3493,7 +3493,7 @@ int ata_wait_after_reset(struct ata_link *link, unsigned long deadline, /** * sata_link_debounce - debounce SATA phy status * @link: ATA link to debounce SATA phy status for - * @params: timing parameters { interval, duratinon, timeout } in msec + * @params: timing parameters { interval, duration, timeout } in msec * @deadline: deadline jiffies for the operation * * Make sure SStatus of @link reaches stable state, determined by @@ -3563,7 +3563,7 @@ int sata_link_debounce(struct ata_link *link, const unsigned long *params, /** * sata_link_resume - resume SATA link * @link: ATA link to resume SATA - * @params: timing parameters { interval, duratinon, timeout } in msec + * @params: timing parameters { interval, duration, timeout } in msec * @deadline: deadline jiffies for the operation * * Resume SATA phy @link and debounce it. @@ -3746,7 +3746,7 @@ int ata_std_prereset(struct ata_link *link, unsigned long deadline) /** * sata_link_hardreset - reset link via SATA phy reset * @link: link to reset - * @timing: timing parameters { interval, duratinon, timeout } in msec + * @timing: timing parameters { interval, duration, timeout } in msec * @deadline: deadline jiffies for the operation * @online: optional out parameter indicating link onlineness * @check_ready: optional callback to check link readiness @@ -6212,7 +6212,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) * * After allocating an ATA host and initializing it, most libata * LLDs perform three steps to activate the host - start host, - * request IRQ and register it. This helper takes necessasry + * request IRQ and register it. This helper takes necessary * arguments and performs the three steps in one go. * * An invalid IRQ skips the IRQ registration and expects the host to @@ -6265,7 +6265,7 @@ int ata_host_activate(struct ata_host *host, int irq, } /** - * ata_port_detach - Detach ATA port in prepration of device removal + * ata_port_detach - Detach ATA port in preparation of device removal * @ap: ATA port to be detached * * Detach all ATA devices and the associated SCSI devices of @ap; diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 567859c..90397ba 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -1109,7 +1109,7 @@ static void ata_scsi_sdev_config(struct scsi_device *sdev) * @rq: request to be checked * * ATAPI commands which transfer variable length data to host - * might overflow due to application error or hardare bug. This + * might overflow due to application error or hardware bug. This * function checks whether overflow should be drained and ignored * for @request. * -- cgit v1.1 From 26f588308efc7f1834b7ee0b1dd4f9a904f555a3 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Fri, 6 May 2016 21:40:40 +0300 Subject: libata-scsi: use %*ph to dump small buffers Replace custom approach by %*ph specifier to dump small buffers in hex format. Signed-off-by: Andy Shevchenko Signed-off-by: Tejun Heo --- drivers/ata/libata-scsi.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 90397ba..7bcc870 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -3439,14 +3439,11 @@ static inline void ata_scsi_dump_cdb(struct ata_port *ap, { #ifdef ATA_DEBUG struct scsi_device *scsidev = cmd->device; - u8 *scsicmd = cmd->cmnd; - DPRINTK("CDB (%u:%d,%d,%d) %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", + DPRINTK("CDB (%u:%d,%d,%d) %9ph\n", ap->print_id, scsidev->channel, scsidev->id, scsidev->lun, - scsicmd[0], scsicmd[1], scsicmd[2], scsicmd[3], - scsicmd[4], scsicmd[5], scsicmd[6], scsicmd[7], - scsicmd[8]); + cmd->cmnd); #endif } -- cgit v1.1