From: Greg KH <greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
To: Li Shaohua <shaohua.li-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: ACPI-DEV
<acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
lkml <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Len Brown <len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Patrick Mochel
<mochel-og82NyAXoxR0I81aPRRTmR2eb7JE58TQ@public.gmane.org>
Subject: Re: [PATCH/RFC 1/4]device core changes
Date: Tue, 9 Nov 2004 17:24:43 -0800 [thread overview]
Message-ID: <20041110012443.GA9496@kroah.com> (raw)
In-Reply-To: <1099990981.15294.57.camel-U5EdaLXB8smDugQYiPIPGdh3ngVCH38I@public.gmane.org>
On Tue, Nov 09, 2004 at 05:03:01PM +0800, Li Shaohua wrote:
> On Tue, 2004-11-09 at 12:58, Greg KH wrote:
> > On Tue, Nov 09, 2004 at 11:35:41AM +0800, Li Shaohua wrote:
> > > On Tue, 2004-11-09 at 08:50, Li Shaohua wrote:
> > > > On Tue, 2004-11-09 at 06:58, Greg KH wrote:
> > > > > On Mon, Nov 08, 2004 at 12:11:11PM +0800, Li Shaohua wrote:
> > > > > > Hi,
> > > > > > This is the device core change required. Add .platform_bind method for
> > > > > > bus_type, so platform can do addition things when add a new device. A
> > > > > > case is ACPI, we want to utilize some ACPI methods for physical devices.
> > > > > > 1. Why doesn't use 'platform_notify'?
> > > > > > Current device core has a 'platform_notify' mechanism, but it's not
> > > > > > sufficient for this. Only sepcific bus type know how to parse dev.bus_id
> > > > > > and know how to encode specific device's address into ACPI _ADR syntax.
> > > > >
> > > > > I don't see why platform_notify is not sufficient. This is the exact
> > > > > reason it was added to the code.
> > > > As I said in the email, we need know the bus type to decode and encode
> > > > address. If you use platform_notify, you must do something like this:
> > > > switch (dev->bus)
> > > > {
> > > > case pci_bus_type:
> > > > bind PCI devices with ACPI devices
> > > > break;
> > > > case ide_bus_type:
> > > > bind IDE devices with ACPI devices
> > > > break;
> > > > ....
> > > > }
> > > > But note this method requires all bus types are build-in. If a bus type
> > > > is in a loadable module (such as IDE bus), the method will failed. I
> > > > searched current tree, only ARM implemented 'platform_notify', but ARM
> > > > only cares PCI bus, ACPI cares about all bus types.
> > > > >
> > > Oops, it's my bad. we can identify the bus type from bus_type->name, but
> > > it looks like a little ugly. Why the bus_type hasn't a flag to identify
> > > which bus it is?
> >
> > Because if you have a struct bus * you _have_ to know what type it is.
> >
> > > Anyway, thanks Greg. I will add as you said.
> >
> > Hm, hopefully Pat will chime in about what would be best for this, as he
> > created the platform_notify interface.
> Ok, an updated version. Use 'platform_notify', but add a 'type' in
> 'struct bus_type'. Using bus_type->name to identify the bus type is
> pretty much ugly and slow.
No, no "type" for a bus, sorry.
Maybe your other patches weren't so bad... If we implement them, can we
drop the platform notify stuff?
thanks,
greg k-h
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <greg@kroah.com>
To: Li Shaohua <shaohua.li@intel.com>
Cc: ACPI-DEV <acpi-devel@lists.sourceforge.net>,
lkml <linux-kernel@vger.kernel.org>,
Len Brown <len.brown@intel.com>,
Patrick Mochel <mochel@digitalimplant.org>
Subject: Re: [PATCH/RFC 1/4]device core changes
Date: Tue, 9 Nov 2004 17:24:43 -0800 [thread overview]
Message-ID: <20041110012443.GA9496@kroah.com> (raw)
In-Reply-To: <1099990981.15294.57.camel@sli10-desk.sh.intel.com>
On Tue, Nov 09, 2004 at 05:03:01PM +0800, Li Shaohua wrote:
> On Tue, 2004-11-09 at 12:58, Greg KH wrote:
> > On Tue, Nov 09, 2004 at 11:35:41AM +0800, Li Shaohua wrote:
> > > On Tue, 2004-11-09 at 08:50, Li Shaohua wrote:
> > > > On Tue, 2004-11-09 at 06:58, Greg KH wrote:
> > > > > On Mon, Nov 08, 2004 at 12:11:11PM +0800, Li Shaohua wrote:
> > > > > > Hi,
> > > > > > This is the device core change required. Add .platform_bind method for
> > > > > > bus_type, so platform can do addition things when add a new device. A
> > > > > > case is ACPI, we want to utilize some ACPI methods for physical devices.
> > > > > > 1. Why doesn't use 'platform_notify'?
> > > > > > Current device core has a 'platform_notify' mechanism, but it's not
> > > > > > sufficient for this. Only sepcific bus type know how to parse dev.bus_id
> > > > > > and know how to encode specific device's address into ACPI _ADR syntax.
> > > > >
> > > > > I don't see why platform_notify is not sufficient. This is the exact
> > > > > reason it was added to the code.
> > > > As I said in the email, we need know the bus type to decode and encode
> > > > address. If you use platform_notify, you must do something like this:
> > > > switch (dev->bus)
> > > > {
> > > > case pci_bus_type:
> > > > bind PCI devices with ACPI devices
> > > > break;
> > > > case ide_bus_type:
> > > > bind IDE devices with ACPI devices
> > > > break;
> > > > ....
> > > > }
> > > > But note this method requires all bus types are build-in. If a bus type
> > > > is in a loadable module (such as IDE bus), the method will failed. I
> > > > searched current tree, only ARM implemented 'platform_notify', but ARM
> > > > only cares PCI bus, ACPI cares about all bus types.
> > > > >
> > > Oops, it's my bad. we can identify the bus type from bus_type->name, but
> > > it looks like a little ugly. Why the bus_type hasn't a flag to identify
> > > which bus it is?
> >
> > Because if you have a struct bus * you _have_ to know what type it is.
> >
> > > Anyway, thanks Greg. I will add as you said.
> >
> > Hm, hopefully Pat will chime in about what would be best for this, as he
> > created the platform_notify interface.
> Ok, an updated version. Use 'platform_notify', but add a 'type' in
> 'struct bus_type'. Using bus_type->name to identify the bus type is
> pretty much ugly and slow.
No, no "type" for a bus, sorry.
Maybe your other patches weren't so bad... If we implement them, can we
drop the platform notify stuff?
thanks,
greg k-h
next prev parent reply other threads:[~2004-11-10 1:24 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-08 4:11 [PATCH/RFC 1/4]device core changes Li Shaohua
2004-11-08 22:58 ` Greg KH
2004-11-09 0:50 ` Li Shaohua
2004-11-09 3:35 ` Li Shaohua
[not found] ` <1099971341.15294.48.camel-U5EdaLXB8smDugQYiPIPGdh3ngVCH38I@public.gmane.org>
2004-11-09 4:58 ` Greg KH
2004-11-09 4:58 ` Greg KH
[not found] ` <20041109045843.GA4849-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2004-11-09 9:03 ` Li Shaohua
2004-11-09 9:03 ` Li Shaohua
[not found] ` <1099990981.15294.57.camel-U5EdaLXB8smDugQYiPIPGdh3ngVCH38I@public.gmane.org>
2004-11-10 1:24 ` Greg KH [this message]
2004-11-10 1:24 ` Greg KH
[not found] ` <20041110012443.GA9496-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2004-11-10 1:45 ` Li Shaohua
2004-11-10 1:45 ` Li Shaohua
2004-11-10 4:28 ` Russell King
[not found] ` <20041110042822.A13318-f404yB8NqCZvn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2004-11-11 7:03 ` Li Shaohua
2004-11-11 7:03 ` Li Shaohua
[not found] ` <1100156613.8769.26.camel-U5EdaLXB8smDugQYiPIPGdh3ngVCH38I@public.gmane.org>
2004-11-11 8:44 ` Russell King
2004-11-11 8:44 ` Russell King
[not found] ` <20041111084411.A2400-f404yB8NqCZvn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2004-11-11 8:46 ` Li Shaohua
2004-11-11 8:46 ` Li Shaohua
2004-11-12 0:30 ` Greg KH
2004-11-12 0:30 ` Greg KH
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=20041110012443.GA9496@kroah.com \
--to=greg-u8xffu+wg4eavxtiumwx3w@public.gmane.org \
--cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mochel-og82NyAXoxR0I81aPRRTmR2eb7JE58TQ@public.gmane.org \
--cc=shaohua.li-ral2JQCrhuEAvxtiuMwx3w@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.