From: "Adam J. Richter" <adam@yggdrasil.com>
To: linux-kernel@vger.kernel.org
Subject: Re: PATCH: linux-2.4.7-pre3/drivers/char/sonypi.c would hang some non-Sony notebooks
Date: Mon, 9 Jul 2001 05:54:43 -0700 [thread overview]
Message-ID: <200107091254.FAA26244@baldur.yggdrasil.com> (raw)
Based on the advice and testing of Bob Dunlop, Alexander Griesser,
arjan@fenrus.demon.nl, and Stelian Pop, here is a modified sonpypi.c
patch that detects Sony Vaio computers by requiring a Cardbus bridge
that has a subsystem vendor ID of Sony, rather than just any PCI device.
This should avoid erroneous(?) installation and (possible hangs?) from
this module on Sony desktop machines, although this may break if Sony
decides to make a PCI-to-Cardbus bridge card and puts its vendor ID
in the subsystem vendor ID of that device.
I've tried this code on a machine that is a Sony Vaio
notebook computer and one that is not, and it gets it right in
both cases.
I am interested in figuring out a more perfect test, but,
in all cases, this patch should be better than the current 2.4.7-pre3
tree and the earlier patches that Bob and I have posted, so it would
be fine to apply it now. (In particular, I am following the discussion
about using "DMI tables"--something I'm not familiar with--but I have
to leave for a two day trip in a few hours.)
Anyhow, I hope this patch is helpful.
Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com \ / San Jose, California 95129-1034
+1 408 261-6630 | g g d r a s i l United States of America
fax +1 408 261-6631 "Free Software For The Rest Of Us."
--- linux-2.4.7-pre3/drivers/char/sonypi.c Mon Jul 9 05:32:41 2001
+++ linux/drivers/char/sonypi.c Mon Jul 9 05:30:22 2001
@@ -689,8 +689,23 @@
remove: sonypi_remove,
};
+static int __init sony_notebook(void) {
+ struct pci_dev *dev;
+
+ dev = NULL;
+ while ((dev = pci_find_class(PCI_CLASS_BRIDGE_CARDBUS, NULL)) != NULL){
+ if (dev->subsystem_vendor == PCI_VENDOR_ID_SONY)
+ return 1;
+ }
+
+ return 0;
+}
+
static int __init sonypi_init_module(void) {
- return pci_module_init(&sonypi_driver);
+ if (sony_notebook())
+ return pci_module_init(&sonypi_driver);
+ else
+ return -ENODEV;
}
static void __exit sonypi_cleanup_module(void) {
next reply other threads:[~2001-07-09 12:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-09 12:54 Adam J. Richter [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-07-08 10:26 Adam J. Richter
2001-07-08 16:46 ` Robert J.Dunlop
2001-07-09 7:52 ` Alexander Griesser
2001-07-09 9:35 ` Stelian Pop
2001-07-08 1:04 Adam J. Richter
2001-07-08 9:42 ` Robert J.Dunlop
2001-07-08 10:51 ` arjan
2001-07-09 9:43 ` Stelian Pop
2001-07-09 10:39 ` Alan Cox
2001-07-09 13:31 ` Stelian Pop
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=200107091254.FAA26244@baldur.yggdrasil.com \
--to=adam@yggdrasil.com \
--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®