From: Greg KH <gregkh@linuxfoundation.org>
To: Maxim Devaev <mdevaev@gmail.com>
Cc: linux-usb@vger.kernel.org, stern@rowland.harvard.edu,
balbi@kernel.org, caihuoqing@baidu.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: gadget: f_mass_storage: forced_eject attribute
Date: Wed, 6 Jul 2022 20:13:54 +0200 [thread overview]
Message-ID: <YsXQ4hFDVjO+xm3s@kroah.com> (raw)
In-Reply-To: <20220706174634.20639-1-mdevaev@gmail.com>
On Wed, Jul 06, 2022 at 08:46:34PM +0300, Maxim Devaev wrote:
> It allows to reset prevent_medium_removal flag and "eject" the image.
>
> The patch is a completely alternative implementation of the previously
> proposed [1], the idea of which was born after the mentioned discussion.
>
> Signed-off-by: Maxim Devaev <mdevaev@gmail.com>
> Link: https://lore.kernel.org/lkml/20220406092445.215288-1-mdevaev@gmail.com [1]
> ---
> drivers/usb/gadget/function/f_mass_storage.c | 25 ++++++++++++++++++++
> drivers/usb/gadget/function/storage_common.c | 11 +++++++++
> drivers/usb/gadget/function/storage_common.h | 2 ++
> 3 files changed, 38 insertions(+)
>
> diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c
> index 6ad669dde41c..00cac2a38178 100644
> --- a/drivers/usb/gadget/function/f_mass_storage.c
> +++ b/drivers/usb/gadget/function/f_mass_storage.c
> @@ -2520,10 +2520,21 @@ static ssize_t file_store(struct device *dev, struct device_attribute *attr,
> return fsg_store_file(curlun, filesem, buf, count);
> }
>
> +static ssize_t forced_eject_store(struct device *dev,
> + struct device_attribute *attr,
> + const char *buf, size_t count)
> +{
> + struct fsg_lun *curlun = fsg_lun_from_dev(dev);
> + struct rw_semaphore *filesem = dev_get_drvdata(dev);
> +
> + return fsg_store_forced_eject(curlun, filesem, buf, count);
> +}
> +
> static DEVICE_ATTR_RW(nofua);
> /* mode wil be set in fsg_lun_attr_is_visible() */
> static DEVICE_ATTR(ro, 0, ro_show, ro_store);
> static DEVICE_ATTR(file, 0, file_show, file_store);
> +static DEVICE_ATTR_WO(forced_eject);
You have to document sysfs files in Documentation/ABI/ in order for us
to be able to accept them.
thanks,
greg k-h
next prev parent reply other threads:[~2022-07-06 18:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-06 17:46 [PATCH] usb: gadget: f_mass_storage: forced_eject attribute Maxim Devaev
2022-07-06 17:54 ` Maxim Devaev
2022-07-06 18:13 ` Greg KH [this message]
2022-07-06 20:53 ` Maxim Devaev
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=YsXQ4hFDVjO+xm3s@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=balbi@kernel.org \
--cc=caihuoqing@baidu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mdevaev@gmail.com \
--cc=stern@rowland.harvard.edu \
/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