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

Commit 852ee16a authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik
Browse files

[PATCH] libata: preserve SATA SPD setting over hard resets



Don't overwrite SPD setting during hard reset.  This change has the
(intended) side effect of honoring the BIOS configuration.

Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent e82cbdb9
Loading
Loading
Loading
Loading
+9 −3
Original line number Original line Diff line number Diff line
@@ -2132,9 +2132,11 @@ void ata_bus_reset(struct ata_port *ap)
static int sata_phy_resume(struct ata_port *ap)
static int sata_phy_resume(struct ata_port *ap)
{
{
	unsigned long timeout = jiffies + (HZ * 5);
	unsigned long timeout = jiffies + (HZ * 5);
	u32 sstatus;
	u32 scontrol, sstatus;


	scr_write_flush(ap, SCR_CONTROL, 0x300);
	scontrol = scr_read(ap, SCR_CONTROL);
	scontrol = (scontrol & 0x0f0) | 0x300;
	scr_write_flush(ap, SCR_CONTROL, scontrol);


	/* Wait for phy to become ready, if necessary. */
	/* Wait for phy to become ready, if necessary. */
	do {
	do {
@@ -2247,10 +2249,14 @@ int ata_std_softreset(struct ata_port *ap, int verbose, unsigned int *classes)
 */
 */
int sata_std_hardreset(struct ata_port *ap, int verbose, unsigned int *class)
int sata_std_hardreset(struct ata_port *ap, int verbose, unsigned int *class)
{
{
	u32 scontrol;

	DPRINTK("ENTER\n");
	DPRINTK("ENTER\n");


	/* Issue phy wake/reset */
	/* Issue phy wake/reset */
	scr_write_flush(ap, SCR_CONTROL, 0x301);
	scontrol = scr_read(ap, SCR_CONTROL);
	scontrol = (scontrol & 0x0f0) | 0x301;
	scr_write_flush(ap, SCR_CONTROL, scontrol);


	/*
	/*
	 * Couldn't find anything in SATA I/II specs, but AHCI-1.1
	 * Couldn't find anything in SATA I/II specs, but AHCI-1.1