linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [libata] pata_cs5536: Add support for non-X86_32 platforms
@ 2010-12-19 14:32 Wu Zhangjin
  2010-12-20 11:19 ` Sergei Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: Wu Zhangjin @ 2010-12-19 14:32 UTC (permalink / raw)
  To: Martin K. Petersen, Jeff Garzik
  Cc: linux-ide, linux-kernel, Wu Zhangjin, Zhang Le, Chen Jie

pata_cs5536 does work on the other platforms(e.g. Loongson, a MIPS
variant), so, remove the dependency of X86_32 and fix the building
errors under the other platforms via only reserving the X86_32 specific
parts for X86_32.

pata_amd also supports cs5536 IDE controller, but this one saves about
33k for the compressed kernel image(vmlinuz for MIPS).

Signed-off-by: Zhang Le <r0bertz@gentoo.org>
Signed-off-by: Chen Jie <chenj@lemote.com>
Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
---
 drivers/ata/Kconfig       |    2 +-
 drivers/ata/pata_cs5536.c |   16 +++++++++++-----
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 11ec911..cfd04f4 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -366,7 +366,7 @@ config PATA_CS5535
 
 config PATA_CS5536
 	tristate "CS5536 PATA support"
-	depends on PCI && X86 && !X86_64
+	depends on PCI
 	help
 	  This option enables support for the AMD CS5536
 	  companion chip used with the Geode LX processor family.
diff --git a/drivers/ata/pata_cs5536.c b/drivers/ata/pata_cs5536.c
index 21ee23f..643488b 100644
--- a/drivers/ata/pata_cs5536.c
+++ b/drivers/ata/pata_cs5536.c
@@ -37,7 +37,17 @@
 #include <linux/delay.h>
 #include <linux/libata.h>
 #include <scsi/scsi_host.h>
+
+#ifdef CONFIG_X86_32
 #include <asm/msr.h>
+static int use_msr;
+module_param_named(msr, use_msr, int, 0644);
+MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)");
+#else
+#define rdmsr(x, y, z) do { } while (0)
+#define wrmsr(x, y, z) do { } while (0)
+#define use_msr 0
+#endif
 
 #define DRV_NAME	"pata_cs5536"
 #define DRV_VERSION	"0.0.7"
@@ -75,8 +85,6 @@ enum {
 	IDE_ETC_NODMA		= 0x03,
 };
 
-static int use_msr;
-
 static const u32 msr_reg[4] = {
 	MSR_IDE_CFG, MSR_IDE_DTC, MSR_IDE_CAST, MSR_IDE_ETC,
 };
@@ -88,7 +96,7 @@ static const u8 pci_reg[4] = {
 static inline int cs5536_read(struct pci_dev *pdev, int reg, u32 *val)
 {
 	if (unlikely(use_msr)) {
-		u32 dummy;
+		u32 dummy __maybe_unused;
 
 		rdmsr(msr_reg[reg], *val, dummy);
 		return 0;
@@ -294,8 +302,6 @@ MODULE_DESCRIPTION("low-level driver for the CS5536 IDE controller");
 MODULE_LICENSE("GPL");
 MODULE_DEVICE_TABLE(pci, cs5536);
 MODULE_VERSION(DRV_VERSION);
-module_param_named(msr, use_msr, int, 0644);
-MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)");
 
 module_init(cs5536_init);
 module_exit(cs5536_exit);
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] [libata] pata_cs5536: Add support for non-X86_32 platforms
  2010-12-19 14:32 [PATCH] [libata] pata_cs5536: Add support for non-X86_32 platforms Wu Zhangjin
@ 2010-12-20 11:19 ` Sergei Shtylyov
  2010-12-20 17:17   ` wu zhangjin
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2010-12-20 11:19 UTC (permalink / raw)
  To: Wu Zhangjin
  Cc: Martin K. Petersen, Jeff Garzik, linux-ide, linux-kernel,
	Zhang Le, Chen Jie

Hello.

On 19-12-2010 17:32, Wu Zhangjin wrote:

> pata_cs5536 does work on the other platforms(e.g. Loongson, a MIPS
> variant), so, remove the dependency of X86_32 and fix the building
> errors under the other platforms via only reserving the X86_32 specific
> parts for X86_32.

> pata_amd also supports cs5536 IDE controller, but this one saves about
> 33k for the compressed kernel image(vmlinuz for MIPS).

> Signed-off-by: Zhang Le <r0bertz@gentoo.org>
> Signed-off-by: Chen Jie <chenj@lemote.com>
> Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
[...]

> diff --git a/drivers/ata/pata_cs5536.c b/drivers/ata/pata_cs5536.c
> index 21ee23f..643488b 100644
> --- a/drivers/ata/pata_cs5536.c
> +++ b/drivers/ata/pata_cs5536.c
> @@ -37,7 +37,17 @@
>   #include<linux/delay.h>
>   #include<linux/libata.h>
>   #include<scsi/scsi_host.h>
> +
> +#ifdef CONFIG_X86_32
>   #include<asm/msr.h>
> +static int use_msr;
> +module_param_named(msr, use_msr, int, 0644);
> +MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)");
> +#else
> +#define rdmsr(x, y, z) do { } while (0)
> +#define wrmsr(x, y, z) do { } while (0)
> +#define use_msr 0
> +#endif
>
>   #define DRV_NAME	"pata_cs5536"
>   #define DRV_VERSION	"0.0.7"

    I think you should increment the driver version too.

WBR, Sergei

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [libata] pata_cs5536: Add support for non-X86_32 platforms
  2010-12-20 11:19 ` Sergei Shtylyov
@ 2010-12-20 17:17   ` wu zhangjin
  0 siblings, 0 replies; 3+ messages in thread
From: wu zhangjin @ 2010-12-20 17:17 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Martin K. Petersen, Jeff Garzik, linux-ide, linux-kernel,
	Zhang Le, Chen Jie

Hi, Sergei

On Mon, Dec 20, 2010 at 7:19 PM, Sergei Shtylyov <sshtylyov@mvista.com> wrote:
> Hello.
>
> On 19-12-2010 17:32, Wu Zhangjin wrote:
>
>> pata_cs5536 does work on the other platforms(e.g. Loongson, a MIPS
>> variant), so, remove the dependency of X86_32 and fix the building
>> errors under the other platforms via only reserving the X86_32 specific
>> parts for X86_32.
>
>> pata_amd also supports cs5536 IDE controller, but this one saves about
>> 33k for the compressed kernel image(vmlinuz for MIPS).
>
>> Signed-off-by: Zhang Le <r0bertz@gentoo.org>
>> Signed-off-by: Chen Jie <chenj@lemote.com>
>> Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
>
> [...]
>
>> diff --git a/drivers/ata/pata_cs5536.c b/drivers/ata/pata_cs5536.c
>> index 21ee23f..643488b 100644
>> --- a/drivers/ata/pata_cs5536.c
>> +++ b/drivers/ata/pata_cs5536.c
>> @@ -37,7 +37,17 @@
>>  #include<linux/delay.h>
>>  #include<linux/libata.h>
>>  #include<scsi/scsi_host.h>
>> +
>> +#ifdef CONFIG_X86_32
>>  #include<asm/msr.h>
>> +static int use_msr;
>> +module_param_named(msr, use_msr, int, 0644);
>> +MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function
>> (Default: 0)");
>> +#else
>> +#define rdmsr(x, y, z) do { } while (0)
>> +#define wrmsr(x, y, z) do { } while (0)
>> +#define use_msr 0
>> +#endif
>>
>>  #define DRV_NAME      "pata_cs5536"
>>  #define DRV_VERSION   "0.0.7"
>
>   I think you should increment the driver version too.
>

Will use 0.0.8 in the next revision of this patch.

With the version incrementation, can I get your "Acked-by:"?

Thanks & Regards,
Wu Zhangjin

> WBR, Sergei
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-20 17:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-19 14:32 [PATCH] [libata] pata_cs5536: Add support for non-X86_32 platforms Wu Zhangjin
2010-12-20 11:19 ` Sergei Shtylyov
2010-12-20 17:17   ` wu zhangjin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).