public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Hinds <dhinds@sonic.net>
To: Russell King <rmk@arm.linux.org.uk>, torvalds@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: Why does printk helps PCMCIA card to initialise?
Date: Tue, 22 Feb 2005 14:34:48 -0800	[thread overview]
Message-ID: <20050222223448.GA32644@sonic.net> (raw)

On Mon, 21 Feb 2005, Linus Torvalds wrote:
> On Mon, 21 Feb 2005, Russell King wrote:
> >
> > In cs.c, alloc_io_space(), find the line:
> >
> > if (*base & ~(align-1)) {
> >
> > delete the ~ and rebuild. This may resolve your problem.
> 
> Unlikely. The code is too broken for words.

The original code is correct; you are misinterpreting the meaning of
the "align" variable here.  PCMCIA cards can request a specific base
IO address, and can also specify how many IO address lines they
decode.  The number of decoded lines determines a maximal alignment
restriction for a card; if it only decodes 3 lines, then it should not
reasonably ask for an IO region with more specificity than being on an
8 port boundary.  The "align" variable here holds this alignment.  The
"oddness" here is that the card is providing conflicting information,
that it needs IO ports at a specific address, but is only decoding 3
address lines (i.e. align=8).

The names of "base" and "align" have the expected meanings when a card
only specifies one or the other.  It's only for the case where both
are specified that the meaning is complicated.  Then, "base" is more
like an offset into a block that has "align" alignment

Given an "odd" request for a base=0x260 and align=8, the allocator
promotes this to align=0x400, and would allow addresses 0x260, 0x660,
0xa60, 0xe60, etc, subject to restrictions in /etc/pcmcia/config.opts.

The real problem here is that all the IO address ranges the card
claims to support were unavailable.  I'd first try adding:

  include port 0x0600-0x07ff

to /etc/pcmcia/config.opts to give the allocator more flexibility in
choosing port ranges.  

-- Dave

             reply	other threads:[~2005-02-22 22:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-22 22:34 David Hinds [this message]
     [not found] <3zXLc-3vg-13@gated-at.bofh.it>
     [not found] ` <3zYxA-4dY-13@gated-at.bofh.it>
     [not found]   ` <3AhTz-3pR-15@gated-at.bofh.it>
2005-02-22 10:14     ` Why does printk helps PCMCIA card to initialise? Martin Drohmann
  -- strict thread matches above, loose matches on Subject: below --
2005-02-20 11:44 Martin Drohmann
2005-02-20  9:25 ` Vicente Feito
2005-02-20 12:38 ` Russell King
2005-02-21  9:17   ` Russell King
2005-02-21 10:37     ` Andrew Morton
2005-02-21 20:20     ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050222223448.GA32644@sonic.net \
    --to=dhinds@sonic.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox