From: Greg KH <greg@kroah.com>
To: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: gregkh@suse.de, linux-kernel@vger.kernel.org,
devel@linuxdriverproject.org, virtualization@lists.osdl.org
Subject: Re: Hyper-V TODO file
Date: Thu, 1 Sep 2011 13:30:31 -0700 [thread overview]
Message-ID: <20110901203031.GB15185@kroah.com> (raw)
In-Reply-To: <20110901202733.GA15185@kroah.com>
On Thu, Sep 01, 2011 at 01:27:33PM -0700, Greg KH wrote:
> On Wed, Aug 31, 2011 at 03:16:51PM -0700, K. Y. Srinivasan wrote:
> > 2) With your help, we have fixed all of the issues related to these drivers
> > conforming to the Linux Device Driver model. One of the TODO work items is
> > "audit the vmbus to verify it is working properly with the driver model".
>
> I have a few comments about this, I'll respond in another email.
Ok, it looks a _lot_ better, but I have a few minor nits, and one larger
one:
- rename the vmbus_child_* functions to vmbus_* as there's no need to
think of "children" here.
- vmbus_onoffer comment is incorrect. You handle offers from lots of
other types. Or if not, am I reading the code incorrectly?
- the static hv_cb_utils array needs to go away. In the hv_utils.c
util_probe() call, properly register the channel callback, and the
same goes for the util_remove() call, unregister things there.
Note, you can use the driver_data field to determine exactly which
callback needs to be registered to make things easy. Something like
the following (pseudo code only):
static const struct hv_vmbus_device_id id_table[] = {
/* Shutdown guid */
{ VMBUS_DEVICE(0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49,
0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB),
.driver_data = &shutdown_onchannelcallback },
....
};
util_probe(struct hv_device *dev, const struct hv_vmbus_device_id *id)
[ Yes, you will have to change the probe callback signature, but that's fine. ]
{
void *fn(void *context);
u8 *buffer;
fn = id->driver_data;
buffer = kmalloc(PAGE_SIZE, GFP_KERNEL);
/* Hook up callback and buffer with a call to the proper vmbus
* function
*/
...
}
util_remove()
{
/* undo what you did in util_probe(), unhooking the callback and
* freeing the data */
}
Does that make any sense?
thanks,
greg k-h
next prev parent reply other threads:[~2011-09-01 20:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-31 22:16 Hyper-V TODO file K. Y. Srinivasan
2011-08-31 23:11 ` Peter Foley
2011-09-01 20:31 ` Greg KH
2011-09-02 14:09 ` KY Srinivasan
2011-09-02 15:17 ` KY Srinivasan
2011-09-02 16:03 ` Greg KH
2011-09-01 20:27 ` Greg KH
2011-09-01 20:30 ` Greg KH [this message]
2011-09-01 21:08 ` KY Srinivasan
2011-09-02 16:09 ` Greg KH
2011-09-02 19:47 ` KY Srinivasan
2011-09-02 19:58 ` Greg KH
2011-09-02 20:54 ` KY Srinivasan
2011-09-01 20:57 ` KY Srinivasan
-- strict thread matches above, loose matches on Subject: below --
2011-09-22 16:17 K. Y. Srinivasan
2011-09-22 16:05 ` Joe Perches
2011-09-22 17:04 ` Greg KH
2011-09-22 17:20 ` KY Srinivasan
2011-09-22 17:36 ` Greg KH
2011-09-22 18:22 ` KY Srinivasan
2011-10-04 13:59 ` KY Srinivasan
2011-10-04 17:04 ` Greg KH
2011-10-04 17:23 ` KY Srinivasan
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=20110901203031.GB15185@kroah.com \
--to=greg@kroah.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@suse.de \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=virtualization@lists.osdl.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;
as well as URLs for NNTP newsgroup(s).