public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Shaohua Li <shaohua.li-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Bjorn Helgaas <bjorn.helgaas-VXdhtT5mjnY@public.gmane.org>
Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	"Brown, Len" <len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Dominik Brodowski <linux-JhLEnvuH02M@public.gmane.org>,
	Adam Belay <ambx1-IBH0VoN/3vPQT0dZR+AlfA@public.gmane.org>
Subject: Re: [RFC]convert ACPI driver model to Linux driver model - takes 2
Date: Tue, 18 Oct 2005 11:06:03 +0800	[thread overview]
Message-ID: <1129604763.3965.36.camel@linux-hp.sh.intel.com> (raw)
In-Reply-To: <200510140954.52206.bjorn.helgaas-VXdhtT5mjnY@public.gmane.org>

On Fri, 2005-10-14 at 09:54 -0600, Bjorn Helgaas wrote:
> On Friday 14 October 2005 3:35 am, Li, Shaohua wrote:
> > >> On Fri, 2005-10-14 at 04:43 +0800, Bjorn Helgaas wrote:
> > >I'm sorry to be dense, but this doesn't help me.  What do you
> > >mean by "devices in ACPI bus" as opposed to other ACPI devices?
> > >...
> > In my mind, the devices which don't belong to other physical buses (such
> > as PCI, PNP) are ACPI bus devices.
> 
> PCI is a physical bus.  It defines wires and electrical things
> that happen on those wires.  Neither PNP nor ACPI is a physical
> bus.  So every device in the ACPI namespace seems like an "ACPI
> bus device".
We already have an interface for PNP drivers, it might be better to not
include PNP devices into "ACPI bus devices". PNP devices basically are
ISA bus devices. For other devices in ACPI namespace, lets see an
example (the list is from T40 laptop):
        Device (LNKA)
        Device (MEM)
        Device (LID)
        Device (SLPB)
        Device (PCI0)
            Device (LPC)
                Device (MOU)
                Device (FDC)
                    Device (FDD0)
                Device (UART)
                Device (LPT)
                Device (ECP)
                Device (FIR)
                Device (EC)
                    Device (BAT0)
                    Device (BAT1)
                    Device (AC)
                    Device (HKEY)
            Device (AGP)
                Device (VID)
                    Device (LCD0)
                    Device (CRT0)
                    Device (TV0)
                    Device (DVI0)
            Device (PCI1)
                Device (CBS0)
                Device (CBS1)
                Device (DOCK)
                    Device (IDE1)
                        Device (PRIM)
                            Device (MSTR)
                    Device (CBS2)
                    Device (CBS3)
            Device (IDE0)
                Device (PRIM)
                    Device (MSTR)
                Device (SCND)
                    Device (MSTR)
            Device (USB0)
                Device (URTH)
                    Device (UPDK)
            Device (USB7)
                Device (URTH)
                    Device (UPDK)
            Device (AC9M)

The devices have PCI peers such as LPC, AGP, PCI1, IDE0, USB0, USB7,
AC9M should belong to PCI bus. Such devices can directly use ACPI
services or they can register an 'acpi_driver'.
The same reason, PRIM, PRIM.MSTR, SCND, SCND.MSTR should belong to IDE
bus.
URTH, UPDK might belong to USB bus.
Most devices under LPC are PNP devices. But EC should not be, as PNP
interface can't provide sufficient service, such as handle GPE.
Other devices such LID, SLPB are 'ACPI bus devices'. PCI0 is a little
strange. There is physical PCI device 0:0.0 sometimes, sometimes it's
just a fake device. I regard it as 'acpi bus devices' here.

> > These devices are: 
> > +//		"PNP0C09," /* EC */
> > ...
> > +//		ACPI_THERMAL_HID"," /* thermal */
> > The devices only can use acpi_phys_driver. Other devices still use
> > acpi_driver.
> 
> What is the rule by which you determine that the above devices
> should use acpi_phys_driver, and all other devices should use
> acpi_driver?
See above.
> 
> > >If that's the case, I think we should end up with acpi_driver,
> > >not acpi_phys_driver, because "phys" doesn't tell me anything
> > >useful.  And there aren't very many ACPI drivers, so I don't
> > >really see the problem with just moving them all at once.
> > I agree we should just have acpi_driver. Non ACPI bus devices should
> > directly use ACPI services instead of registering an acpi_driver.
> 
> Maybe it would help me understand this if you gave an example of
> a non ACPI bus device that should just use ACPI services instead
> of registering a driver.
An example is a PCI device. It belongs to PCI bus, but it might have a
peer in ACPI namespace. The PCI driver could call some ACPI methods such
as _PSW for wakeup.

> 
> > The issue is there are some ACPI drivers whose devices are hard to
> > catalog, such as video, hotkey.
> 
> I see that the ACPI video driver does not claim by _HID or _CID,
> but by a special match function.  But what is the problem?
> driver_probe_device() supports an optional match function, so
> it looks like ACPI video could be done in that model.
ok. I can add a .match callback in acpi_phys_driver.
> 
> Hotkey does look strange.  When it registers, it has no list of
> _HIDs to claim.  But hotkeys cause ACPI notify events, which go
> to a specific object in the ACPI namespace.  So it looks like
> it has a way via /proc to tell the driver which devices to
> claim.
> 
> But this doesn't seem so much different than a PCI driver that
> can be told dynamically to claim new PCI IDs.  Could a similar
> mechanism be used here?
Might we can use the similar method for video.

But we still have trouble with other devices such as pci_root and
processor. There also have some other devices which register acpi_driver
in IA64, I don't the type of such devices. And Len hopes the change can
be smoothly. 

Thanks,
Shaohua



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl

  parent reply	other threads:[~2005-10-18  3:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-14  9:35 [RFC]convert ACPI driver model to Linux driver model - takes 2 Li, Shaohua
2005-10-14 12:47 ` Matthew Wilcox
     [not found]   ` <20051014124749.GD16113-6jwH94ZQLHl74goWV3ctuw@public.gmane.org>
2005-10-18  1:30     ` Shaohua Li
     [not found]       ` <1129599034.3965.6.camel-ECwVeV2eNyQD0+JXs3kMbRL4W9x8LtSr@public.gmane.org>
2005-10-18 17:32         ` Rajesh Shah
2005-10-14 15:54 ` Bjorn Helgaas
     [not found]   ` <200510140954.52206.bjorn.helgaas-VXdhtT5mjnY@public.gmane.org>
2005-10-18  3:06     ` Shaohua Li [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-10-13  8:18 mika.penttila-9Aww8k/80nUxHbG02/KK1g
     [not found] ` <20051013081837.PTGN24578.fep01-app.kolumbus.fi-7B1qVitd7rZYRdgNIgFt/t8DI8KqlI9s@public.gmane.org>
2005-10-13  8:32   ` Shaohua Li
2005-10-13  7:45 Yu, Luming
2005-10-13  8:20 ` Shaohua Li
2005-10-13  6:37 Shaohua Li
     [not found] ` <1129185454.9074.15.camel-ECwVeV2eNyQD0+JXs3kMbRL4W9x8LtSr@public.gmane.org>
2005-10-13 20:43   ` Bjorn Helgaas
     [not found]     ` <200510131443.47844.bjorn.helgaas-VXdhtT5mjnY@public.gmane.org>
2005-10-14  1:13       ` Shaohua Li
     [not found]         ` <1129252436.3948.12.camel-ECwVeV2eNyQD0+JXs3kMbRL4W9x8LtSr@public.gmane.org>
2005-10-14  3:21           ` Bjorn Helgaas
2005-10-20 17:04   ` Bjorn Helgaas

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=1129604763.3965.36.camel@linux-hp.sh.intel.com \
    --to=shaohua.li-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=ambx1-IBH0VoN/3vPQT0dZR+AlfA@public.gmane.org \
    --cc=bjorn.helgaas-VXdhtT5mjnY@public.gmane.org \
    --cc=len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=linux-JhLEnvuH02M@public.gmane.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