pata_hpt3x2n: fix clock turnaround
commit14e3cd129aad425dae38ac5ba9aa7d709283a085
authorSergei Shtylyov <sshtylyov@ru.mvista.com>
Thu, 17 Dec 2009 06:11:27 +0000 (17 01:11 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 6 Jan 2010 22:26:29 +0000 (6 14:26 -0800)
treeb436902e30bbbe91414ffcb9b608f20f84a366bf
parent7564ecada882a2ec698bddcfb85a48e4b0e2b2a5
pata_hpt3x2n: fix clock turnaround

commit 256ace9bbd4cdb6d48d5f55d55d42fa20527fad1 upstream.

The clock turnaround code still doesn't work for several reasons:

- 'USE_DPLL' flag in 'ap->host->private_data' is never initialized
  or updated, so the driver can only set the chip to the DPLL clock
  mode, not the PCI mode;

- the driver doesn't serialize access to the channels depending on
  the current clock mode like the vendor drivers, so the clock
  turnaround is only executed "optionally", not always as it should be;

- the wrong ports are written to when hpt3x2n_set_clock() is called
  for the secondary channel;

- hpt3x2n_set_clock() can inadvertently enable the disabled channels
  when resetting the channel state machines.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/ata/pata_hpt3x2n.c