From: Ajit Khaparde <ajitk@serverengines•com>
To: Ben Hutchings <bhutchings@solarflare•com>
Cc: David Miller <davem@davemloft•net>,
netdev@vger•kernel.org, linux-net-drivers@solarflare•com
Subject: Re: [RFC][PATCH] ethtool: Add reset operation
Date: Fri, 2 Oct 2009 16:10:12 +0530 [thread overview]
Message-ID: <20091002104010.GA19862@serverengines.com> (raw)
In-Reply-To: <1254426195.2735.16.camel@achroite>
On 01/10/09 20:43 +0100, Ben Hutchings wrote:
> After updating firmware stored in flash, users may wish to reset the
> relevant hardware and start the new firmware immediately. This should
> not be completely automatic as it may be disruptive.
>
> A selective reset may also be useful for debugging or diagnostics.
>
> This adds a separate reset operation which takes flags indicating the
> components to be reset. Drivers are allowed to reset only a subset of
> those requested, and must report the actual subset. This allows the
> use of generic component masks and some future expansion.
> ---
Looks good. But one question.
> +static int ethtool_reset(struct net_device *dev, char __user *useraddr)
> +{
> + struct ethtool_value reset;
> + int ret;
> +
> + if (!dev->ethtool_ops->reset)
> + return -EOPNOTSUPP;
> +
> + if (copy_from_user(&reset, useraddr, sizeof(reset)))
> + return -EFAULT;
> +
> + ret = dev->ethtool_ops->reset(dev, &reset.data);
> + if (ret)
> + return ret;
> +
> + if (copy_to_user(useraddr, &reset, sizeof(reset)))
> + return -EFAULT;
Can you tell the intention behind this copy_to_user?
Do you envision drivers sending back some data to the userland - may be
sometime in future?
Thanks
-Ajit
next prev parent reply other threads:[~2009-10-02 10:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-01 19:43 [RFC][PATCH] ethtool: Add reset operation Ben Hutchings
2009-10-01 20:14 ` David Miller
2009-10-02 10:40 ` Ajit Khaparde [this message]
2009-10-02 11:00 ` Ben Hutchings
2009-10-07 8:28 ` David Miller
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=20091002104010.GA19862@serverengines.com \
--to=ajitk@serverengines$(echo .)com \
--cc=bhutchings@solarflare$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=linux-net-drivers@solarflare$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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