Commit 71f18757 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'ata-6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata

Pull ATA fixes from Damien Le Moal:
 "Three late patches to fix problems discovered recently:

   - Add a horkage to disable link power management by default for the
     Pioneer BDR-207M and BDR-205 DVD drives (from Niklas)

   - Two patches to fix setting the maximum queue depth of libsas owned
     ATA devices (from me)"

* tag 'ata-6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata:
  ata: libata-sata: Fix device queue depth control
  ata: libata-scsi: Fix initialization of device queue depth
  libata: add ATA_HORKAGE_NOLPM for Pioneer BDR-207M and BDR-205
parents 81bcd4b5 141f3d62
...@@ -3988,6 +3988,10 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { ...@@ -3988,6 +3988,10 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
{ "PIONEER DVD-RW DVR-212D", NULL, ATA_HORKAGE_NOSETXFER }, { "PIONEER DVD-RW DVR-212D", NULL, ATA_HORKAGE_NOSETXFER },
{ "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER }, { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER },
/* These specific Pioneer models have LPM issues */
{ "PIONEER BD-RW BDR-207M", NULL, ATA_HORKAGE_NOLPM },
{ "PIONEER BD-RW BDR-205", NULL, ATA_HORKAGE_NOLPM },
/* Crucial BX100 SSD 500GB has broken LPM support */ /* Crucial BX100 SSD 500GB has broken LPM support */
{ "CT500BX100SSD1", NULL, ATA_HORKAGE_NOLPM }, { "CT500BX100SSD1", NULL, ATA_HORKAGE_NOLPM },
......
...@@ -1018,26 +1018,25 @@ DEVICE_ATTR(sw_activity, S_IWUSR | S_IRUGO, ata_scsi_activity_show, ...@@ -1018,26 +1018,25 @@ DEVICE_ATTR(sw_activity, S_IWUSR | S_IRUGO, ata_scsi_activity_show,
EXPORT_SYMBOL_GPL(dev_attr_sw_activity); EXPORT_SYMBOL_GPL(dev_attr_sw_activity);
/** /**
* __ata_change_queue_depth - helper for ata_scsi_change_queue_depth * ata_change_queue_depth - Set a device maximum queue depth
* @ap: ATA port to which the device change the queue depth * @ap: ATA port of the target device
* @dev: target ATA device
* @sdev: SCSI device to configure queue depth for * @sdev: SCSI device to configure queue depth for
* @queue_depth: new queue depth * @queue_depth: new queue depth
* *
* libsas and libata have different approaches for associating a sdev to * Helper to set a device maximum queue depth, usable with both libsas
* its ata_port. * and libata.
* *
*/ */
int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev, int ata_change_queue_depth(struct ata_port *ap, struct ata_device *dev,
int queue_depth) struct scsi_device *sdev, int queue_depth)
{ {
struct ata_device *dev;
unsigned long flags; unsigned long flags;
if (queue_depth < 1 || queue_depth == sdev->queue_depth) if (!dev || !ata_dev_enabled(dev))
return sdev->queue_depth; return sdev->queue_depth;
dev = ata_scsi_find_dev(ap, sdev); if (queue_depth < 1 || queue_depth == sdev->queue_depth)
if (!dev || !ata_dev_enabled(dev))
return sdev->queue_depth; return sdev->queue_depth;
/* NCQ enabled? */ /* NCQ enabled? */
...@@ -1059,7 +1058,7 @@ int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev, ...@@ -1059,7 +1058,7 @@ int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev,
return scsi_change_queue_depth(sdev, queue_depth); return scsi_change_queue_depth(sdev, queue_depth);
} }
EXPORT_SYMBOL_GPL(__ata_change_queue_depth); EXPORT_SYMBOL_GPL(ata_change_queue_depth);
/** /**
* ata_scsi_change_queue_depth - SCSI callback for queue depth config * ata_scsi_change_queue_depth - SCSI callback for queue depth config
...@@ -1080,7 +1079,8 @@ int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth) ...@@ -1080,7 +1079,8 @@ int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth)
{ {
struct ata_port *ap = ata_shost_to_port(sdev->host); struct ata_port *ap = ata_shost_to_port(sdev->host);
return __ata_change_queue_depth(ap, sdev, queue_depth); return ata_change_queue_depth(ap, ata_scsi_find_dev(ap, sdev),
sdev, queue_depth);
} }
EXPORT_SYMBOL_GPL(ata_scsi_change_queue_depth); EXPORT_SYMBOL_GPL(ata_scsi_change_queue_depth);
......
...@@ -1055,6 +1055,7 @@ EXPORT_SYMBOL_GPL(ata_scsi_dma_need_drain); ...@@ -1055,6 +1055,7 @@ EXPORT_SYMBOL_GPL(ata_scsi_dma_need_drain);
int ata_scsi_dev_config(struct scsi_device *sdev, struct ata_device *dev) int ata_scsi_dev_config(struct scsi_device *sdev, struct ata_device *dev)
{ {
struct request_queue *q = sdev->request_queue; struct request_queue *q = sdev->request_queue;
int depth = 1;
if (!ata_id_has_unload(dev->id)) if (!ata_id_has_unload(dev->id))
dev->flags |= ATA_DFLAG_NO_UNLOAD; dev->flags |= ATA_DFLAG_NO_UNLOAD;
...@@ -1100,13 +1101,10 @@ int ata_scsi_dev_config(struct scsi_device *sdev, struct ata_device *dev) ...@@ -1100,13 +1101,10 @@ int ata_scsi_dev_config(struct scsi_device *sdev, struct ata_device *dev)
if (dev->flags & ATA_DFLAG_AN) if (dev->flags & ATA_DFLAG_AN)
set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events); set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events);
if (dev->flags & ATA_DFLAG_NCQ) { if (dev->flags & ATA_DFLAG_NCQ)
int depth;
depth = min(sdev->host->can_queue, ata_id_queue_depth(dev->id)); depth = min(sdev->host->can_queue, ata_id_queue_depth(dev->id));
depth = min(ATA_MAX_QUEUE, depth); depth = min(ATA_MAX_QUEUE, depth);
scsi_change_queue_depth(sdev, depth); scsi_change_queue_depth(sdev, depth);
}
if (dev->flags & ATA_DFLAG_TRUSTED) if (dev->flags & ATA_DFLAG_TRUSTED)
sdev->security_supported = 1; sdev->security_supported = 1;
......
...@@ -872,7 +872,8 @@ int sas_change_queue_depth(struct scsi_device *sdev, int depth) ...@@ -872,7 +872,8 @@ int sas_change_queue_depth(struct scsi_device *sdev, int depth)
struct domain_device *dev = sdev_to_domain_dev(sdev); struct domain_device *dev = sdev_to_domain_dev(sdev);
if (dev_is_sata(dev)) if (dev_is_sata(dev))
return __ata_change_queue_depth(dev->sata_dev.ap, sdev, depth); return ata_change_queue_depth(dev->sata_dev.ap,
sas_to_ata_dev(dev), sdev, depth);
if (!sdev->tagged_supported) if (!sdev->tagged_supported)
depth = 1; depth = 1;
......
...@@ -1136,8 +1136,8 @@ extern int ata_scsi_slave_config(struct scsi_device *sdev); ...@@ -1136,8 +1136,8 @@ extern int ata_scsi_slave_config(struct scsi_device *sdev);
extern void ata_scsi_slave_destroy(struct scsi_device *sdev); extern void ata_scsi_slave_destroy(struct scsi_device *sdev);
extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, extern int ata_scsi_change_queue_depth(struct scsi_device *sdev,
int queue_depth); int queue_depth);
extern int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev, extern int ata_change_queue_depth(struct ata_port *ap, struct ata_device *dev,
int queue_depth); struct scsi_device *sdev, int queue_depth);
extern struct ata_device *ata_dev_pair(struct ata_device *adev); extern struct ata_device *ata_dev_pair(struct ata_device *adev);
extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev); extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev);
extern void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap); extern void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment