mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stelian Pop <stelian.pop@fr.alcove.com>
To: Marcus Meissner <Marcus.Meissner@caldera.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>, linux-kernel@vger.kernel.org
Subject: Re: PATCH: sonypi wrongly claims ownership of ISA and ACPI bridges
Date: Mon, 15 Oct 2001 13:56:42 +0200	[thread overview]
Message-ID: <20011015135642.L4523@come.alcove-fr> (raw)
In-Reply-To: <20011015102110.A21699@caldera.de>
In-Reply-To: <20011015102110.A21699@caldera.de>

On Mon, Oct 15, 2001 at 10:21:10AM +0200, Marcus Meissner wrote:

> Your sonypi driver claims the ownership of 2 Intel ACPI bridges and 1 ISA 
> bridge.
> 
> All 3 are used in standard Intel chipsets, not just in Sony VAIOs.
> 
> Please do not use them, it confuses the hell out of the autoprobing and
> automatic PCI driver registration.
> 
> I suggest checking up if this device has PnPBIOS entries and using them,
> or using a different method of autoprobing.

Testing against is_sony_vaio_laptop should be sufficient here.

Alan, please apply the following patch (instead of Marcus' one).
It changes the initialisation sequence (first the ISA bridge for
the older hardware, then it supposes newer hardware), and doesn't
registers itself in the kernel pci device table.

A little documentation update is also included.

Thanks,

Stelian.

diff -uNr --exclude-from=dontdiff linux-2.4.12-ac2.orig/Documentation/sonypi.txt linux-2.4.12-ac2/Documentation/sonypi.txt
--- linux-2.4.12-ac2.orig/Documentation/sonypi.txt	Mon Oct 15 12:36:00 2001
+++ linux-2.4.12-ac2/Documentation/sonypi.txt	Mon Oct 15 12:32:35 2001
@@ -55,7 +55,9 @@
 			in order to let the driver access to the camera
 
 	fnkeyinit:	on some Vaios (C1VE, C1VR etc), the Fn key events don't
-			get enabled unless you set this parameter to 1
+			get enabled unless you set this parameter to 1.
+			Do not use this option unless it's actually necessary,
+			some Vaio models don't deal well with this option.
 
 	verbose:	print unknown events from the sonypi device
 
@@ -71,7 +73,7 @@
 lines in your /etc/modules.conf file:
 
 	alias char-major-10-250 sonypi
-	options sonypi minor=250 fnkeyinit=1
+	options sonypi minor=250
 
 This supposes the use of minor 250 for the sonypi device:
 
diff -uNr --exclude-from=dontdiff linux-2.4.12-ac2.orig/drivers/char/sonypi.c linux-2.4.12-ac2/drivers/char/sonypi.c
--- linux-2.4.12-ac2.orig/drivers/char/sonypi.c	Mon Oct 15 12:36:13 2001
+++ linux-2.4.12-ac2/drivers/char/sonypi.c	Mon Oct 15 12:36:39 2001
@@ -550,23 +550,20 @@
 	-1, "sonypi", &sonypi_misc_fops
 };
 
-static int __devinit sonypi_probe(struct pci_dev *pcidev, 
-		                  const struct pci_device_id *ent) {
+static int __devinit sonypi_probe(struct pci_dev *pcidev) {
 	int i, ret;
 	struct sonypi_ioport_list *ioport_list;
 	struct sonypi_irq_list *irq_list;
 
-	if (sonypi_device.dev) {
-		printk(KERN_ERR "sonypi: only one device allowed!\n"),
-		ret = -EBUSY;
-		goto out1;
-	}
 	sonypi_device.dev = pcidev;
-	sonypi_device.model = (int)ent->driver_data;
+	if (pcidev)
+		sonypi_device.model = SONYPI_DEVICE_MODEL_TYPE1;
+	else
+		sonypi_device.model = SONYPI_DEVICE_MODEL_TYPE2;
 	sonypi_initq();
 	init_MUTEX(&sonypi_device.lock);
 	
-	if (pci_enable_device(pcidev)) {
+	if (pcidev && pci_enable_device(pcidev)) {
 		printk(KERN_ERR "sonypi: pci_enable_device failed\n");
 		ret = -EIO;
 		goto out1;
@@ -638,11 +635,10 @@
 	printk(KERN_INFO "sonypi: Sony Programmable I/O Controller Driver v%d.%d.\n",
 	       SONYPI_DRIVER_MAJORVERSION,
 	       SONYPI_DRIVER_MINORVERSION);
-	printk(KERN_INFO "sonypi: detected %s model (%04x:%04x), "
+	printk(KERN_INFO "sonypi: detected %s model, "
 	       "camera = %s, compat = %s\n",
 	       (sonypi_device.model == SONYPI_DEVICE_MODEL_TYPE1) ?
 			"type1" : "type2",
-	       sonypi_device.dev->vendor, sonypi_device.dev->device,
 	       camera ? "on" : "off",
 	       compat ? "on" : "off");
 	printk(KERN_INFO "sonypi: enabled at irq=%d, port1=0x%x, port2=0x%x\n",
@@ -662,7 +658,7 @@
 	return ret;
 }
 
-static void __devexit sonypi_remove(struct pci_dev *pcidev) {
+static void __devexit sonypi_remove(void) {
 	sonypi_call2(0x81, 0); /* make sure we don't get any more events */
 	if (camera)
 		sonypi_camera_off();
@@ -676,37 +672,21 @@
 	printk(KERN_INFO "sonypi: removed.\n");
 }
 
-static struct pci_device_id sonypi_id_tbl[] __devinitdata = {
-	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, 
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
-	  (unsigned long) SONYPI_DEVICE_MODEL_TYPE1 },
-	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_10,
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
-	  (unsigned long) SONYPI_DEVICE_MODEL_TYPE2 },
-	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12,
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
-	  (unsigned long) SONYPI_DEVICE_MODEL_TYPE2 },
-	{ }
-};
-
-MODULE_DEVICE_TABLE(pci, sonypi_id_tbl);
-
-static struct pci_driver sonypi_driver = {
-	name:		"sonypi",
-	id_table:	sonypi_id_tbl,
-	probe:		sonypi_probe,
-	remove:		sonypi_remove,
-};
-
 static int __init sonypi_init_module(void) {
-	if (is_sony_vaio_laptop)
-		return pci_module_init(&sonypi_driver);
+	struct pci_dev *pcidev = NULL;
+
+	if (is_sony_vaio_laptop) {
+		pcidev = pci_find_device(PCI_VENDOR_ID_INTEL, 
+					 PCI_DEVICE_ID_INTEL_82371AB_3, 
+					 NULL);
+		return sonypi_probe(pcidev);
+	}
 	else
 		return -ENODEV;
 }
 
 static void __exit sonypi_cleanup_module(void) {
-	pci_unregister_driver(&sonypi_driver);
+	sonypi_remove();
 }
 
 #ifndef MODULE
diff -uNr --exclude-from=dontdiff linux-2.4.12-ac2.orig/drivers/char/sonypi.h linux-2.4.12-ac2/drivers/char/sonypi.h
--- linux-2.4.12-ac2.orig/drivers/char/sonypi.h	Mon Oct 15 12:36:13 2001
+++ linux-2.4.12-ac2/drivers/char/sonypi.h	Mon Oct 15 12:33:42 2001
@@ -35,7 +35,7 @@
 #ifdef __KERNEL__
 
 #define SONYPI_DRIVER_MAJORVERSION	1
-#define SONYPI_DRIVER_MINORVERSION	6
+#define SONYPI_DRIVER_MINORVERSION	7
 
 #include <linux/types.h>
 #include <linux/pci.h>
-- 
Stelian Pop <stelian.pop@fr.alcove.com>
|---------------- Free Software Engineer -----------------|
| Alcôve - http://www.alcove.com - Tel: +33 1 49 22 68 00 |
|------------- Alcôve, liberating software ---------------|

      reply	other threads:[~2001-10-15 11:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-15  8:21 Marcus Meissner
2001-10-15 11:56 ` Stelian Pop [this message]

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=20011015135642.L4523@come.alcove-fr \
    --to=stelian.pop@fr.alcove.com \
    --cc=Marcus.Meissner@caldera.de \
    --cc=alan@lxorguk.ukuu.org.uk \
    --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®