[PATCH RFC] pcmcia: load include_io, include_mem from /etc/modprobe.d/pcmcia.conf

2009-11-07 Thread Komuro

load include_io, include_mem from /etc/modprobe.d/pcmcia.conf
instead of running pcmcia-socket-startup.
(integration of pcmcia-socket-startup to the kernel)

if /etc/modprobe.d/pcmcia.conf does not exist,
rsrc_nonstatic allocates minimum io/mem resource.

exclude_io, exclude_mem, include_irq, exclude_irq
are not yet implemented.

Here is example of pcmcia.conf

options rsrc_nonstatic 
include_io_list=0x100,0x3af,0x3e0,0x4ff,0x800,0x820,0xc00,0xcf7,0xa00,0xaff
options rsrc_nonstatic 
include_mem_list=0xc,0xf,0xa000,0xa0ff,0x6000,0x60ff



--- linux-2.6.32-rc5-git3/drivers/pcmcia/rsrc_nonstatic.c.orig  2009-11-01 
20:51:39.0 +0900
+++ linux-2.6.32-rc5-git3/drivers/pcmcia/rsrc_nonstatic.c   2009-11-08 
11:00:14.0 +0900
@@ -47,6 +47,13 @@ INT_MODULE_PARM(probe_io,1); /* IO por
 INT_MODULE_PARM(mem_limit, 0x1);
 #endif
 
+static int include_io_list[16];
+static unsigned int include_io_count = 0;
+module_param_array(include_io_list, int, &include_io_count, 0444);
+static int include_mem_list[16];
+static unsigned int include_mem_count = 0;
+module_param_array(include_mem_list, int, &include_mem_count, 0444);
+
 /* for io_db and mem_db */
 struct resource_map {
u_long  base, num;
@@ -779,8 +786,49 @@ static int nonstatic_autoadd_resources(s
struct resource *res;
int i, done = 0;
 
-   if (!s->cb_dev || !s->cb_dev->bus)
-   return -ENODEV;
+   if (include_io_count) {
+   for (i = 0; i < include_io_count; i=i+2) {
+   if (!adjust_io(s, ADD_MANAGED_RESOURCE, 
+   include_io_list[i], include_io_list[i+1])) {
+   done |= IORESOURCE_IO;
+   }
+   }
+   }
+#if defined(CONFIG_X86)
+ else {
+   /* allocate minimum io resource */
+   if (!adjust_io(s, ADD_MANAGED_RESOURCE, 0x100, 0x03af)) {
+   done |= IORESOURCE_IO;
+   }
+   } 
+#endif
+
+   if (include_mem_count) {
+   for (i = 0; i < include_mem_count; i=i+2) {
+   if (!adjust_memory(s, ADD_MANAGED_RESOURCE, 
+   include_mem_list[i], include_mem_list[i+1])) {
+   done |= IORESOURCE_MEM;
+   }
+   }
+   }
+
+#if defined(CONFIG_X86)
+ else  {
+   /* allocate minimum memory resource */
+   if (!adjust_memory(s, ADD_MANAGED_RESOURCE, 
+   0xa000, 0xa0ff)) {
+   done |= IORESOURCE_MEM;
+   }
+   } 
+#endif
+
+   if (!s->cb_dev || !s->cb_dev->bus) {
+   if (done == (IORESOURCE_MEM | IORESOURCE_IO)) {
+   s->resource_setup_done = 1;
+   return 0;
+   } else 
+   return -ENODEV;
+   }
 
 #if defined(CONFIG_X86)
/* If this is the root bus, the risk of hitting
@@ -789,8 +837,13 @@ static int nonstatic_autoadd_resources(s
 * resources is too big. Therefore, don't do auto-adding
 * of resources at the moment.
 */
-   if (s->cb_dev->bus->number == 0)
-   return -EINVAL;
+   if (s->cb_dev->bus->number == 0) {
+   if (done == (IORESOURCE_MEM | IORESOURCE_IO)) {
+   s->resource_setup_done = 1;
+   return 0;
+   } else 
+   return -EINVAL;
+   }
 #endif
 
for (i=0; i < PCI_BUS_NUM_RESOURCES; i++) {

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: pcmciamtd -- what's broken, who needs it?

2009-11-07 Thread Komuro

Hi,


At least, we need to add one line below to pcmciamtd.c .

   PCMCIA_DEVICE_PROD_ID12("PRETEC", "  2MB SRAM CARD", 0xebf91155, 0x805360ca
),

>Hey,
>
>it seems that just as we were preparing to move pcmciamtd to staging, an
>user who still tries to use it has appeared:
>
>> ATTR{modalias}=="pcmcia:mcf00fn00pfn00paEBF91155pb805360CApc000
0pd"
>> ? ? ATTR{prod_id2}==" ?2MB SRAM CARD"
>> ? ? ATTR{prod_id1}=="PRETEC"
>> ? ? ATTR{pm_state}=="on"
>> ? ? ATTR{function}=="0x00"
>
>So, what is actually BROKEN with pcmciamtd.c ?
>
>Best,
>   Dominik
>
>___
>Linux PCMCIA reimplementation list
>http://lists.infradead.org/mailman/listinfo/linux-pcmcia


___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: Re: Re: Re: [PATCH] pcmcia: cs.c : load "pcmcia" module automatically.

2009-11-07 Thread Komuro


>Hey,
>
>> >yes, but why? Also, wouldn't request_module_nowait() suffice?
>> >
>> 
>
>What about this?
>

OK. Thanks,


Best Regards
Komuro


___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


[PATCH 59/75] serial-cs: declare MODULE_FIRMWARE

2009-11-07 Thread Ben Hutchings
Signed-off-by: Ben Hutchings 
---
 drivers/serial/serial_cs.c |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c
index f02d1a9..df54e96 100644
--- a/drivers/serial/serial_cs.c
+++ b/drivers/serial/serial_cs.c
@@ -861,6 +861,18 @@ static struct pcmcia_device_id serial_ids[] = {
PCMCIA_DEVICE_NULL,
 };
 MODULE_DEVICE_TABLE(pcmcia, serial_ids);
+MODULE_FIRMWARE("cis/PCMLM28.cis");
+MODULE_FIRMWARE("cis/DP83903.cis");
+MODULE_FIRMWARE("cis/3CCFEM556.cis");
+MODULE_FIRMWARE("cis/3CXEM556.cis");
+MODULE_FIRMWARE("cis/SW_8xx_SER.cis");
+MODULE_FIRMWARE("cis/SW_7xx_SER.cis");
+MODULE_FIRMWARE("cis/SW_555_SER.cis");
+MODULE_FIRMWARE("cis/MT5634ZLX.cis");
+MODULE_FIRMWARE("cis/COMpad2.cis");
+MODULE_FIRMWARE("cis/COMpad4.cis");
+MODULE_FIRMWARE("cis/RS-COM-2P.cis");
+MODULE_FIRMWARE("GLOBETROTTER.cis");
 
 static struct pcmcia_driver serial_cs_driver = {
.owner  = THIS_MODULE,
-- 
1.6.5.2




___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


[PATCH 58/75] pcnet-cs: declare MODULE_FIRMWARE

2009-11-07 Thread Ben Hutchings
Signed-off-by: Ben Hutchings 
---
 drivers/net/pcmcia/pcnet_cs.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index 42aa81b..9088f06 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -1752,6 +1752,13 @@ static struct pcmcia_device_id pcnet_ids[] = {
PCMCIA_DEVICE_NULL
 };
 MODULE_DEVICE_TABLE(pcmcia, pcnet_ids);
+MODULE_FIRMWARE("cis/PCMLM28.cis");
+MODULE_FIRMWARE("cis/DP83903.cis");
+MODULE_FIRMWARE("cis/LA-PCM.cis");
+MODULE_FIRMWARE("PE520.cis");
+MODULE_FIRMWARE("cis/NE2K.cis");
+MODULE_FIRMWARE("cis/PE-200.cis");
+MODULE_FIRMWARE("cis/tamarack.cis");
 
 static struct pcmcia_driver pcnet_driver = {
.drv= {
-- 
1.6.5.2




___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: pcmciamtd -- what's broken, who needs it?

2009-11-07 Thread Kristoffer Ericson
On Sat, 7 Nov 2009 12:33:46 +0100
Dominik Brodowski  wrote:

> Hey,
> 
> On Sat, Nov 07, 2009 at 08:29:09PM +0900, Komuro wrote:
> > staging directory is not the place for broken driver,
> > is it?
> 
> 
> It is becoming the place for drivers on their way out of the kernel tree.
> An indication for drivers being unused is that they have been marked broken
> or obsolete for a lng time; and then they'll remain in staging for 3
> releases or so before being removed (or being moved in again).

Is the 3 releases a fixed date? Got a couple of drivers in there
that I "might" want to use in the near future. Just havent had time to
looking at cleaning them up.

> 
> Best,
>   Dominik
> 
> ___
> Linux PCMCIA reimplementation list
> http://lists.infradead.org/mailman/listinfo/linux-pcmcia


-- 
Kristoffer Ericson 

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: Re: Re: [PATCH] pcmcia: cs.c : load "pcmcia" module automatically.

2009-11-07 Thread Wolfram Sang
> + /*
> +  * Let's try to get the PCMCIA module for 16-bit PCMCIA support.
> +  * If it fails, it doesn't matter -- we still havae 32-bit CardBus
> +  * support to offer, so this is not a failure mode.
> +  */
> + request_module_nowait("pcmcia");
> +

Typo: "havae"

-- 
Pengutronix e.K.   | Wolfram Sang|
Industrial Linux Solutions | http://www.pengutronix.de/  |


signature.asc
Description: Digital signature
___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: Re: Re: [PATCH] pcmcia: cs.c : load "pcmcia" module automatically.

2009-11-07 Thread Dominik Brodowski
Hey,

On Tue, Nov 03, 2009 at 08:22:48AM +0900, Komuro wrote:
> >> This patch integrates some of the pcmciautils feature into the kernel.
> >
> >yes, but why? Also, wouldn't request_module_nowait() suffice?
> >
> 
> (1)
> Because the "pcmcia" is kernel module, so I think it should be
> loaded by kernel, if kernel can do it.
> 
> (2)
> Even if distribution developer forgets to install the pcmciautils,
> the "pcmcia" is loaded with this patch.
> (especially embedded systems)
> 
> (3)
> I think request_module_nowait is better.

What about this?

Best,
Dominik


[PATCH] pcmcia: autoload module pcmcia

Attempt to load the "pcmcia" module for 16-bit PCMCIA cards, so that
PCMCIA support becomes available without pcmciautils/udev userspace
interaction. Based on a suggestion and a patch
Signed-off-by: Komuro 
but converted it to request_module_nowait() and move it to a later
stage.

Signed-off-by: Dominik Brodowski 

diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index b229f6d..f56e88c 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -243,6 +243,13 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
 
pcmcia_parse_events(socket, SS_DETECT);
 
+   /*
+* Let's try to get the PCMCIA module for 16-bit PCMCIA support.
+* If it fails, it doesn't matter -- we still havae 32-bit CardBus
+* support to offer, so this is not a failure mode.
+*/
+   request_module_nowait("pcmcia");
+
return 0;
 
  err:

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: pcmciamtd -- what's broken, who needs it?

2009-11-07 Thread Dominik Brodowski
Hey,

On Sat, Nov 07, 2009 at 08:29:09PM +0900, Komuro wrote:
> staging directory is not the place for broken driver,
> is it?


It is becoming the place for drivers on their way out of the kernel tree.
An indication for drivers being unused is that they have been marked broken
or obsolete for a lng time; and then they'll remain in staging for 3
releases or so before being removed (or being moved in again).

Best,
Dominik

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: pcmciamtd -- what's broken, who needs it?

2009-11-07 Thread Komuro
Hi,

staging directory is not the place for broken driver,
is it?

>Hey,
>
>it seems that just as we were preparing to move pcmciamtd to staging, an
>user who still tries to use it has appeared:
>
>> ATTR{modalias}=="pcmcia:mcf00fn00pfn00paEBF91155pb805360CApc000
0pd"
>> ? ? ATTR{prod_id2}==" ?2MB SRAM CARD"
>> ? ? ATTR{prod_id1}=="PRETEC"
>> ? ? ATTR{pm_state}=="on"
>> ? ? ATTR{function}=="0x00"
>
>So, what is actually BROKEN with pcmciamtd.c ?

Best Regards
Komuro


___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: Re: Re: [PATCH 16/16] pcmcia: use dev_dbg and dev_print in pd6729.c

2009-11-07 Thread Komuro
Hi,


>> There are still 3(three) printk in pd6729.c.
>> 
>> >static u_int __devinit pd6729_isa_scan(void)
>> >{
>> >u_int mask0, mask = 0;
>> >int i;
>> >
>> >if (irq_mode == 1) {
>> >printk(KERN_INFO "pd6729: PCI card interrupts, "
>> >"PCI status changes\n");
>> >return 0;
>> >}
>> 
>> 
>
>Well, we don't have a struct device to use here, don't we?
>

Ah, you are right.

Best Regards
Komuro



___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


pcmciamtd -- what's broken, who needs it?

2009-11-07 Thread Dominik Brodowski
Hey,

it seems that just as we were preparing to move pcmciamtd to staging, an
user who still tries to use it has appeared:

> ATTR{modalias}=="pcmcia:mcf00fn00pfn00paEBF91155pb805360CApcpd"
>     ATTR{prod_id2}=="  2MB SRAM CARD"
>     ATTR{prod_id1}=="PRETEC"
>     ATTR{pm_state}=="on"
>     ATTR{function}=="0x00"

So, what is actually BROKEN with pcmciamtd.c ?

Best,
Dominik

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: Re: [PATCH 16/16] pcmcia: use dev_dbg and dev_print in pd6729.c

2009-11-07 Thread Dominik Brodowski
On Sat, Nov 07, 2009 at 07:09:31PM +0900, Komuro wrote:
> Hi,
> 
> There are still 3(three) printk in pd6729.c.
> 
> >static u_int __devinit pd6729_isa_scan(void)
> >{
> >u_int mask0, mask = 0;
> >int i;
> >
> >if (irq_mode == 1) {
> >printk(KERN_INFO "pd6729: PCI card interrupts, "
> >"PCI status changes\n");
> >return 0;
> >}
> 
> 

Well, we don't have a struct device to use here, don't we?

Best,
Dominik

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: Re: [PATCH 16/16] pcmcia: use dev_dbg and dev_print in pd6729.c

2009-11-07 Thread Komuro
Hi,

There are still 3(three) printk in pd6729.c.

>static u_int __devinit pd6729_isa_scan(void)
>{
>u_int mask0, mask = 0;
>int i;
>
>if (irq_mode == 1) {
>printk(KERN_INFO "pd6729: PCI card interrupts, "
>"PCI status changes\n");
>return 0;
>}




___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia