[KERNEL 2.6.7] fix "cs: unable to map card memory!" problem

Russell King rmk+pcmcia at arm.linux.org.uk
Wed Jun 23 12:13:37 EDT 2004


On Wed, Jun 23, 2004 at 12:11:41PM -0400, Pavel Roskin wrote:
> Hi, Russell!
> 
> On Wed, 23 Jun 2004, Russell King wrote:
> 
> > On Thu, Jun 24, 2004 at 12:12:47AM +0900, komujun at nifty.com wrote:
> >> find_mem_region in rsrc_mgr.c calls allocate_resource with align=0.
> >> bogus value is loaded, then causes "cs: unable to map card memory" problem.
> >
> > Hmm, I'm wondering how we ended up with stuff working with align = 0.
> > It should actually be '1'.
> >
> > Something else to be merged _post_ 12-pcmcia-resource-2 (can't be
> > merged beforehand because this series is already half-merged and
> > I'm not going to strip my tree down, _especially_ as various people
> > have already pulled csets from it.)
> 
> I'll appreciate if you also reconsider using static variables in both 
> variants of validate_mem() in drivers/pcmcia/rsrc_mgr.c.  The can cause 
> the same error message when cardmgr is restarted.

That's a bug which needs fixing, and likewise I'm not planning any bug
fixing until after this series has been merged (iow, during the -rc
kernel series.)

> The original message didn't describe the problem in details.  It's 
> possible that the actual problem was in validate_mem().  For that to be 
> the case, the problem would not appear initially after reboot or after 
> pcmcia_core is reloaded.

Nevertheless, if you look at allocate_resource(), you'll notice
passing a value of '0' for align is bogus and _wrong_.  It should've
been '1'.  I suspect that the only reason it worked was because of
the extra alignment which pcmcia_common_align does.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core



More information about the linux-pcmcia mailing list