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

Commit 80b8987c authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by Jeff Garzik
Browse files

pata_hpt{37x|3x2n}: fix clock reporting (take 2)



Fix several inconsistencies in these drivers WRT reporting the clocks:

- when using DPLL mode, 'pata_hpt37x' driver reported the DPLL frequency as the
  PCI clock -- make it properly report both clocks and add the same ability to
  the 'pata_hpt3x2n' driver;

- both drivers sometimes use "pata_hpt3*:" and sometimes "hpt3*:" in the
  messages -- make them use only the former one;

- the message about failed DPLL stablizatios deserves KERN_ERR and a bang. :-)

Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent d44a65f7
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -24,7 +24,7 @@
#include <linux/libata.h>
#include <linux/libata.h>


#define DRV_NAME	"pata_hpt37x"
#define DRV_NAME	"pata_hpt37x"
#define DRV_VERSION	"0.6.8"
#define DRV_VERSION	"0.6.9"


struct hpt_clock {
struct hpt_clock {
	u8	xfer_speed;
	u8	xfer_speed;
@@ -1112,7 +1112,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
			pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low | 0x100);
			pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low | 0x100);
		}
		}
		if (adjust == 8) {
		if (adjust == 8) {
			printk(KERN_WARNING "hpt37x: DPLL did not stabilize.\n");
			printk(KERN_ERR "pata_hpt37x: DPLL did not stabilize!\n");
			return -ENODEV;
			return -ENODEV;
		}
		}
		if (dpll == 3)
		if (dpll == 3)
@@ -1120,7 +1120,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
		else
		else
			private_data = (void *)hpt37x_timings_50;
			private_data = (void *)hpt37x_timings_50;


		printk(KERN_INFO "hpt37x: Bus clock %dMHz, using DPLL.\n", MHz[dpll]);
		printk(KERN_INFO "pata_hpt37x: bus clock %dMHz, using %dMHz DPLL.\n",
		       MHz[clock_slot], MHz[dpll]);
	} else {
	} else {
		private_data = (void *)chip_table->clocks[clock_slot];
		private_data = (void *)chip_table->clocks[clock_slot];
		/*
		/*
@@ -1133,7 +1134,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
			port = &info_hpt370_33;
			port = &info_hpt370_33;
		if (clock_slot < 2 && port == &info_hpt370a)
		if (clock_slot < 2 && port == &info_hpt370a)
			port = &info_hpt370a_33;
			port = &info_hpt370a_33;
		printk(KERN_INFO "hpt37x: %s: Bus clock %dMHz.\n", chip_table->name, MHz[clock_slot]);
		printk(KERN_INFO "pata_hpt37x: %s using %dMHz bus clock.\n",
		       chip_table->name, MHz[clock_slot]);
	}
	}


	/* Now kick off ATA set up */
	/* Now kick off ATA set up */
+5 −3
Original line number Original line Diff line number Diff line
@@ -8,7 +8,7 @@
 * Copyright (C) 1999-2003		Andre Hedrick <andre@linux-ide.org>
 * Copyright (C) 1999-2003		Andre Hedrick <andre@linux-ide.org>
 * Portions Copyright (C) 2001	        Sun Microsystems, Inc.
 * Portions Copyright (C) 2001	        Sun Microsystems, Inc.
 * Portions Copyright (C) 2003		Red Hat Inc
 * Portions Copyright (C) 2003		Red Hat Inc
 * Portions Copyright (C) 2005-2006	MontaVista Software, Inc.
 * Portions Copyright (C) 2005-2007	MontaVista Software, Inc.
 *
 *
 *
 *
 * TODO
 * TODO
@@ -25,7 +25,7 @@
#include <linux/libata.h>
#include <linux/libata.h>


#define DRV_NAME	"pata_hpt3x2n"
#define DRV_NAME	"pata_hpt3x2n"
#define DRV_VERSION	"0.3.3"
#define DRV_VERSION	"0.3.4"


enum {
enum {
	HPT_PCI_FAST	=	(1 << 31),
	HPT_PCI_FAST	=	(1 << 31),
@@ -579,10 +579,12 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
		pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low);
		pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low);
	}
	}
	if (adjust == 8) {
	if (adjust == 8) {
		printk(KERN_WARNING "hpt3x2n: DPLL did not stabilize.\n");
		printk(KERN_ERR "pata_hpt3x2n: DPLL did not stabilize!\n");
		return -ENODEV;
		return -ENODEV;
	}
	}


	printk(KERN_INFO "pata_hpt37x: bus clock %dMHz, using 66MHz DPLL.\n",
	       pci_mhz);
	/* Set our private data up. We only need a few flags so we use
	/* Set our private data up. We only need a few flags so we use
	   it directly */
	   it directly */
	port.private_data = NULL;
	port.private_data = NULL;