netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "\"L. Alberto Giménez\"" <agimenez@sysvalve.es>
To: Oliver Neukum <oliver@neukum.org>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linux-usb@vger.kernel.org, linville@tuxdriver.com,
	j.dumon@option.com, steve.glendinning@smsc.com,
	davem@davemloft.net, gregkh@suse.de, dgiagio@gmail.com,
	dborca@yahoo.com
Subject: Re: [PATCHv3] drivers/net/usb: Add new driver ipheth
Date: Fri, 02 Apr 2010 20:23:21 +0200	[thread overview]
Message-ID: <4BB63619.6070607@sysvalve.es> (raw)
In-Reply-To: <201003312233.26130.oliver@neukum.org>

On 03/31/2010 10:33 PM, Oliver Neukum wrote:
> Am Mittwoch, 31. März 2010 21:42:07 schrieb L. Alberto Giménez:

Hi Oliver,

Just like with Ben's comments I still have a couple of doubts about your
comments.


>> +
>> +static int ipheth_open(struct net_device *net)
>> +{
>> +	struct ipheth_device *dev = netdev_priv(net);
>> +	struct usb_device *udev = dev->udev;
>> +	int retval = 0;
>> +
>> +	usb_set_interface(udev, IPHETH_INTFNUM, IPHETH_ALT_INTFNUM);
>> +	usb_clear_halt(udev, usb_rcvbulkpipe(udev, dev->bulk_in));
>> +	usb_clear_halt(udev, usb_sndbulkpipe(udev, dev->bulk_out));
> 
> Is this really needed? If so, please add a comment.

I understand that usb_clear_halt is only needed when the device has
transmitted data, and as it is "open" time, we can assume that no
transmissions ere made, so we don't need to clear anything (aka: remove
both lines), am I right?


>> +
>> +	retval = ipheth_carrier_set(dev);
>> +	if (retval)
>> +		goto error;
>> +
>> +	retval = ipheth_rx_submit(dev, GFP_KERNEL);
>> +	if (retval)
>> +		goto error;
>> +
>> +	schedule_delayed_work(&dev->carrier_work, IPHETH_CARRIER_CHECK_TIMEOUT);
> 
> Does it make sense to start rx while you have no carrier?

Well, I have no clue about this one. I think that upstream developers
should take a look into this (Dario, Daniel, could you?) since I don't
have the knowledge to decide what to do about it.

But I assume that as with the previous one, we have just opened the
device and we aren't (yet) doing anything with it, so we shouldn't start rx?

>> +static void ipheth_disconnect(struct usb_interface *intf)
>> +{
>> +	struct ipheth_device *dev;
>> +
>> +	dev = usb_get_intfdata(intf);
>> +	if (dev != NULL) {
> 
> is this check needed?

Does usb_get_infdata always return not NULL? I haven't found anything
about it (just manual pages for the function, but can't spot if it
cannot return NULL). We disconnected the device, but I understand that
the kernel still has the information and the allocated memory, so the
cleanup code is still needed, isn't it?


> 
>> +static struct usb_driver ipheth_driver = {
>> +	.name =		"ipheth",
>> +	.probe =	ipheth_probe,
>> +	.disconnect =	ipheth_disconnect,
>> +	.id_table =	ipheth_table,
>> +	.supports_autosuspend = 0,
> 
> redundant

Why?

Thanks a lot in advance.


Best regards,
-- 
L. Alberto Giménez
JabberID agimenez@jabber.sysvalve.es
GnuPG key ID 0x3BAABDE1

  parent reply	other threads:[~2010-04-02 18:23 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1269984864-28159-1-git-send-email-agimenez@sysvalve.es>
2010-03-31 19:42 ` [PATCHv3] drivers/net/usb: Add new driver ipheth L. Alberto Giménez
2010-03-31 20:33   ` Oliver Neukum
2010-03-31 21:38     ` "L. Alberto Giménez"
2010-04-02 18:23     ` "L. Alberto Giménez" [this message]
2010-04-04  7:24       ` Oliver Neukum
     [not found]         ` <201004040924.43949.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2010-04-05 18:51           ` "L. Alberto Giménez"
2010-03-31 23:18   ` Ben Hutchings
2010-03-31 23:25     ` Greg KH
2010-03-31 23:28       ` Ben Hutchings
2010-04-02 17:15     ` "L. Alberto Giménez"
2010-04-02 17:21       ` Ben Hutchings
2010-04-02 17:53         ` "L. Alberto Giménez"
     [not found]           ` <4BB62F33.1020507-lqZFv/KUvpAxAGwisGp4zA@public.gmane.org>
2010-04-02 18:35             ` Ben Hutchings
2010-04-07 22:11 ` [PATCH Resubmission] " L. Alberto Giménez
2010-04-07 22:37   ` Roland Dreier
     [not found]   ` <1270678281-20750-1-git-send-email-agimenez-lqZFv/KUvpAxAGwisGp4zA@public.gmane.org>
2010-04-08  6:35     ` Oliver Neukum
2010-04-13  8:15   ` David Miller
2010-04-13 19:03     ` "L. Alberto Giménez"
2010-04-13 21:29       ` David Miller
2010-04-15 19:46 ` [PATCH Resubmission v2] " L. Alberto Giménez
2010-04-16  6:44   ` David Miller
     [not found] ` <1269984864-28159-1-git-send-email-agimenez-lqZFv/KUvpAxAGwisGp4zA@public.gmane.org>
2010-04-18 18:35   ` [PATCH] " L. Alberto Giménez
2010-04-21 14:15     ` Diego Giagio
     [not found]       ` <x2g1b0798831004210715h37253bc5y74baf86556aea7c5-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-04-22  5:44         ` David Miller
2010-03-31 22:10 [PATCHv3] " Daniel Borca

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=4BB63619.6070607@sysvalve.es \
    --to=agimenez@sysvalve.es \
    --cc=davem@davemloft.net \
    --cc=dborca@yahoo.com \
    --cc=dgiagio@gmail.com \
    --cc=gregkh@suse.de \
    --cc=j.dumon@option.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=oliver@neukum.org \
    --cc=steve.glendinning@smsc.com \
    /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).