Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad845636 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  libata: implement on-demand HPA unlocking
  libata: use the enlarged capacity after late HPA unlock
  SCSI: implement sd_unlock_native_capacity()
  libata-sff: trivial corrections to Kconfig help text
  sata_nv: don't diddle with nIEN on mcp55
  sata_via: magic vt6421 fix for transmission problems w/ WD drives
parents 39d11210 d8d9129e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -168,10 +168,10 @@ config ATA_BMDMA
	default y
	help
	  This option adds support for SFF ATA controllers with BMDMA
	  capability.  BMDMA stands for bus-master DMA and the
	  de-facto DMA interface for SFF controllers.
	  capability.  BMDMA stands for bus-master DMA and is the
	  de facto DMA interface for SFF controllers.

	  If unuser, say Y.
	  If unsure, say Y.

if ATA_BMDMA

+3 −3
Original line number Diff line number Diff line
@@ -4119,9 +4119,8 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
	    dev->n_sectors > n_sectors && dev->n_sectors == n_native_sectors) {
		ata_dev_printk(dev, KERN_WARNING,
			       "new n_sectors matches native, probably "
			       "late HPA unlock, continuing\n");
		/* keep using the old n_sectors */
		dev->n_sectors = n_sectors;
			       "late HPA unlock, n_sectors updated\n");
		/* use the larger n_sectors */
		return 0;
	}

@@ -6669,6 +6668,7 @@ EXPORT_SYMBOL_GPL(ata_dummy_port_info);
EXPORT_SYMBOL_GPL(ata_link_next);
EXPORT_SYMBOL_GPL(ata_dev_next);
EXPORT_SYMBOL_GPL(ata_std_bios_param);
EXPORT_SYMBOL_GPL(ata_scsi_unlock_native_capacity);
EXPORT_SYMBOL_GPL(ata_host_init);
EXPORT_SYMBOL_GPL(ata_host_alloc);
EXPORT_SYMBOL_GPL(ata_host_alloc_pinfo);
+29 −0
Original line number Diff line number Diff line
@@ -414,6 +414,35 @@ int ata_std_bios_param(struct scsi_device *sdev, struct block_device *bdev,
	return 0;
}

/**
 *	ata_scsi_unlock_native_capacity - unlock native capacity
 *	@sdev: SCSI device to adjust device capacity for
 *
 *	This function is called if a partition on @sdev extends beyond
 *	the end of the device.  It requests EH to unlock HPA.
 *
 *	LOCKING:
 *	Defined by the SCSI layer.  Might sleep.
 */
void ata_scsi_unlock_native_capacity(struct scsi_device *sdev)
{
	struct ata_port *ap = ata_shost_to_port(sdev->host);
	struct ata_device *dev;
	unsigned long flags;

	spin_lock_irqsave(ap->lock, flags);

	dev = ata_scsi_find_dev(ap, sdev);
	if (dev && dev->n_sectors < dev->n_native_sectors) {
		dev->flags |= ATA_DFLAG_UNLOCK_HPA;
		dev->link->eh_info.action |= ATA_EH_RESET;
		ata_port_schedule_eh(ap);
	}

	spin_unlock_irqrestore(ap->lock, flags);
	ata_port_wait_eh(ap);
}

/**
 *	ata_get_identity - Handler for HDIO_GET_IDENTITY ioctl
 *	@ap: target port
+0 −2
Original line number Diff line number Diff line
@@ -1669,7 +1669,6 @@ static void nv_mcp55_freeze(struct ata_port *ap)
	mask = readl(mmio_base + NV_INT_ENABLE_MCP55);
	mask &= ~(NV_INT_ALL_MCP55 << shift);
	writel(mask, mmio_base + NV_INT_ENABLE_MCP55);
	ata_sff_freeze(ap);
}

static void nv_mcp55_thaw(struct ata_port *ap)
@@ -1683,7 +1682,6 @@ static void nv_mcp55_thaw(struct ata_port *ap)
	mask = readl(mmio_base + NV_INT_ENABLE_MCP55);
	mask |= (NV_INT_MASK_MCP55 << shift);
	writel(mask, mmio_base + NV_INT_ENABLE_MCP55);
	ata_sff_thaw(ap);
}

static void nv_adma_error_handler(struct ata_port *ap)
+13 −0
Original line number Diff line number Diff line
@@ -575,6 +575,19 @@ static void svia_configure(struct pci_dev *pdev)
		tmp8 |= NATIVE_MODE_ALL;
		pci_write_config_byte(pdev, SATA_NATIVE_MODE, tmp8);
	}

	/*
	 * vt6421 has problems talking to some drives.  The following
	 * is the magic fix from Joseph Chan <JosephChan@via.com.tw>.
	 * Please add proper documentation if possible.
	 *
	 * https://bugzilla.kernel.org/show_bug.cgi?id=15173
	 */
	if (pdev->device == 0x3249) {
		pci_read_config_byte(pdev, 0x52, &tmp8);
		tmp8 |= 1 << 2;
		pci_write_config_byte(pdev, 0x52, tmp8);
	}
}

static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
Loading