From: "Justin T. Gibbs" <gibbs@scsiguy.com>
To: andersen@codepoet.org
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Adaptec 1480b SlimSCSI vs hotplug
Date: Tue, 29 Jan 2002 21:53:34 -0700 [thread overview]
Message-ID: <200201300453.g0U4rYI61847@aslan.scsiguy.com> (raw)
In-Reply-To: Your message of "Tue, 29 Jan 2002 19:52:12 MST." <20020130025212.GA5240@codepoet.org>
>On Tue Jan 29, 2002 at 05:48:53PM -0700, Justin T. Gibbs wrote:
>> >Does this look agreeable?
>>
>> The only thing you've really changed is the class_mask. I don't
>> understand why testing against *more bits* of the class allows your
>> card to be detected. Can you explain why the old code fail?
>
>Exactly, the class_mask is the significant bit. The rest I just
>tidied since I hate seeing magic numbers.
It would make your patch easier to review if you didn't intermingle
style changes with content changes.
>Anyways, I started off
>with the simple observation that it didn't work. Watching
>/sbin/hotplug (diethotplug with debugging enabled) closely during
>add events showed me the following:
[...]
>Here we can see it is looking at aic7xxx twice, once for vendor
>0x9004, where it notices that the vendor matches, but then fails
>to match due to the 0xFFFF00 class_mask filter, and once for
>vendor 9005 which of course doesn't match. After changing the
>class_mask to ~0 I now see:
[...]
Changing the mask may have the desired effect, but it doesn't
show where the true bug is.
>So let me turn the question back to you: What is the intended
>purpose of masking out part of the class space?
I'm only trying to match on the base and sub class fields. In
the kernel (see drivers/pci/pci.c), the pci device field is
three bytes wide with the programming interface stored in the
lowest byte and class information in bytes 1 and 2. Since I only
place the expected class values in my table, not the value for
the programming interface, the low byte needs to be masked away prior
to doing the comparison. The logic in the kernel handles the
mask correctly:
((ids->class ^ dev->class) & ids->class_mask) == 0
My guess is that diethotplug is not handling the mask correctly
and thus doesn't work with a partial mask.
--
Justin
next prev parent reply other threads:[~2002-01-30 4:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-29 23:26 Erik Andersen
2002-01-30 0:48 ` Justin T. Gibbs
2002-01-30 2:52 ` Erik Andersen
2002-01-30 4:53 ` Justin T. Gibbs [this message]
2002-01-31 13:19 ` Erik Andersen
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=200201300453.g0U4rYI61847@aslan.scsiguy.com \
--to=gibbs@scsiguy.com \
--cc=andersen@codepoet.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®