aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_cs5536.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_cs5536.c')
-rw-r--r--drivers/ata/pata_cs5536.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/ata/pata_cs5536.c b/drivers/ata/pata_cs5536.c
index 21ee23f89e88..628c8fae5937 100644
--- a/drivers/ata/pata_cs5536.c
+++ b/drivers/ata/pata_cs5536.c
@@ -37,10 +37,22 @@
37#include <linux/delay.h> 37#include <linux/delay.h>
38#include <linux/libata.h> 38#include <linux/libata.h>
39#include <scsi/scsi_host.h> 39#include <scsi/scsi_host.h>
40
41#ifdef CONFIG_X86_32
40#include <asm/msr.h> 42#include <asm/msr.h>
43static int use_msr;
44module_param_named(msr, use_msr, int, 0644);
45MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)");
46#else
47#undef rdmsr /* avoid accidental MSR usage on, e.g. x86-64 */
48#undef wrmsr
49#define rdmsr(x, y, z) do { } while (0)
50#define wrmsr(x, y, z) do { } while (0)
51#define use_msr 0
52#endif
41 53
42#define DRV_NAME "pata_cs5536" 54#define DRV_NAME "pata_cs5536"
43#define DRV_VERSION "0.0.7" 55#define DRV_VERSION "0.0.8"
44 56
45enum { 57enum {
46 CFG = 0, 58 CFG = 0,
@@ -75,8 +87,6 @@ enum {
75 IDE_ETC_NODMA = 0x03, 87 IDE_ETC_NODMA = 0x03,
76}; 88};
77 89
78static int use_msr;
79
80static const u32 msr_reg[4] = { 90static const u32 msr_reg[4] = {
81 MSR_IDE_CFG, MSR_IDE_DTC, MSR_IDE_CAST, MSR_IDE_ETC, 91 MSR_IDE_CFG, MSR_IDE_DTC, MSR_IDE_CAST, MSR_IDE_ETC,
82}; 92};
@@ -88,7 +98,7 @@ static const u8 pci_reg[4] = {
88static inline int cs5536_read(struct pci_dev *pdev, int reg, u32 *val) 98static inline int cs5536_read(struct pci_dev *pdev, int reg, u32 *val)
89{ 99{
90 if (unlikely(use_msr)) { 100 if (unlikely(use_msr)) {
91 u32 dummy; 101 u32 dummy __maybe_unused;
92 102
93 rdmsr(msr_reg[reg], *val, dummy); 103 rdmsr(msr_reg[reg], *val, dummy);
94 return 0; 104 return 0;
@@ -294,8 +304,6 @@ MODULE_DESCRIPTION("low-level driver for the CS5536 IDE controller");
294MODULE_LICENSE("GPL"); 304MODULE_LICENSE("GPL");
295MODULE_DEVICE_TABLE(pci, cs5536); 305MODULE_DEVICE_TABLE(pci, cs5536);
296MODULE_VERSION(DRV_VERSION); 306MODULE_VERSION(DRV_VERSION);
297module_param_named(msr, use_msr, int, 0644);
298MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)");
299 307
300module_init(cs5536_init); 308module_init(cs5536_init);
301module_exit(cs5536_exit); 309module_exit(cs5536_exit);