mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: allow to actually enable sparse fastboot support
@ 2018-08-07 14:17 Uwe Kleine-König
  2018-08-07 14:23 ` [PATCH v2] " Uwe Kleine-König
  0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2018-08-07 14:17 UTC (permalink / raw)
  To: barebox

When sparse support was (intended to be) made optional it was
effectively unconditionally disabled because

	IS_ENABLED(USB_GADGET_FASTBOOT_SPARSE)

always evaluates to 0. To actually make use of the introduced kconfig
symbol the CONFIG_ prefix must not be skipped.

Fixes: f4b5d3eeb607 ("usb: gadget: fastboot: Make sparse support optional")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/usb/gadget/f_fastboot.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 7ccf22771493..df9f2a20f325 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -337,7 +337,7 @@ static int fastboot_bind(struct usb_configuration *c, struct usb_function *f)
 	fb_setvar(var, "0.4");
 	var = fb_addvar(f_fb, "bootloader-version");
 	fb_setvar(var, release_string);
-	if (IS_ENABLED(USB_GADGET_FASTBOOT_SPARSE)) {
+	if (IS_ENABLED(CONFIG_USB_GADGET_FASTBOOT_SPARSE)) {
 		var = fb_addvar(f_fb, "max-download-size");
 		fb_setvar(var, "%u", fastboot_max_download_size);
 	}
@@ -947,7 +947,7 @@ static void cb_flash(struct f_fastboot *f_fb, const char *cmd)
 	filename = fentry->filename;
 
 	if (filetype == filetype_android_sparse) {
-		if (!IS_ENABLED(USB_GADGET_FASTBOOT_SPARSE)) {
+		if (!IS_ENABLED(CONFIG_USB_GADGET_FASTBOOT_SPARSE)) {
 			fastboot_tx_print(f_fb, "FAILsparse image not supported");
 			ret = -EOPNOTSUPP;
 			goto out;
-- 
2.18.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] usb: gadget: allow to actually enable sparse fastboot support
  2018-08-07 14:17 [PATCH] usb: gadget: allow to actually enable sparse fastboot support Uwe Kleine-König
@ 2018-08-07 14:23 ` Uwe Kleine-König
  2018-08-07 14:59   ` Schenk, Gavin
  2018-08-08  7:32   ` Sascha Hauer
  0 siblings, 2 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2018-08-07 14:23 UTC (permalink / raw)
  To: barebox

When sparse support was (intended to be) made optional it was
effectively unconditionally disabled because

	IS_ENABLED(USB_GADGET_FASTBOOT_SPARSE)

always evaluates to 0. To actually make use of the introduced kconfig
symbol the CONFIG_ prefix must not be skipped.

Fixes: f4b5d3eeb607 ("usb: gadget: fastboot: Make sparse support optional")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Huh, I failed to commit the third IS_ENABLED hunk in (implicit) v1.

 drivers/usb/gadget/f_fastboot.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 7ccf22771493..40a78987e46c 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -337,7 +337,7 @@ static int fastboot_bind(struct usb_configuration *c, struct usb_function *f)
 	fb_setvar(var, "0.4");
 	var = fb_addvar(f_fb, "bootloader-version");
 	fb_setvar(var, release_string);
-	if (IS_ENABLED(USB_GADGET_FASTBOOT_SPARSE)) {
+	if (IS_ENABLED(CONFIG_USB_GADGET_FASTBOOT_SPARSE)) {
 		var = fb_addvar(f_fb, "max-download-size");
 		fb_setvar(var, "%u", fastboot_max_download_size);
 	}
@@ -947,7 +947,7 @@ static void cb_flash(struct f_fastboot *f_fb, const char *cmd)
 	filename = fentry->filename;
 
 	if (filetype == filetype_android_sparse) {
-		if (!IS_ENABLED(USB_GADGET_FASTBOOT_SPARSE)) {
+		if (!IS_ENABLED(CONFIG_USB_GADGET_FASTBOOT_SPARSE)) {
 			fastboot_tx_print(f_fb, "FAILsparse image not supported");
 			ret = -EOPNOTSUPP;
 			goto out;
@@ -1233,7 +1233,7 @@ done:
 
 static int fastboot_globalvars_init(void)
 {
-	if (IS_ENABLED(USB_GADGET_FASTBOOT_SPARSE))
+	if (IS_ENABLED(CONFIG_USB_GADGET_FASTBOOT_SPARSE))
 		globalvar_add_simple_int("usbgadget.fastboot_max_download_size",
 				 &fastboot_max_download_size, "%u");
 
-- 
2.18.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] usb: gadget: allow to actually enable sparse fastboot support
  2018-08-07 14:23 ` [PATCH v2] " Uwe Kleine-König
@ 2018-08-07 14:59   ` Schenk, Gavin
  2018-08-08  7:32   ` Sascha Hauer
  1 sibling, 0 replies; 4+ messages in thread
From: Schenk, Gavin @ 2018-08-07 14:59 UTC (permalink / raw)
  To: u.kleine-koenig, barebox

Hi,

On Tue, 2018-08-07 at 16:23 +0200, Uwe Kleine-König wrote:
> When sparse support was (intended to be) made optional it was
> effectively unconditionally disabled because
> 
> 	IS_ENABLED(USB_GADGET_FASTBOOT_SPARSE)
> 
> always evaluates to 0. To actually make use of the introduced kconfig
> symbol the CONFIG_ prefix must not be skipped.
> 
> Fixes: f4b5d3eeb607 ("usb: gadget: fastboot: Make sparse support optional")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> 
Tested-by: Gavin Schenk <g.schenk@eckelmann.de>

Finally, and with this patch, fastboot works in sparse mode on a i.MX25 based machine with 128MB RAM.
My Test:
 * cp /dev/zero /dev/mmc0.0
 * usbgadget -A /dev/mmc0.0(system0)
 * sudo fastboot flash system0 platform-eag-ci4000/images/root.ext2 (on host)
 * boot /mnt/mmc0.0
 * \o/

Thanks!

Regards
Gavin Schenk
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] usb: gadget: allow to actually enable sparse fastboot support
  2018-08-07 14:23 ` [PATCH v2] " Uwe Kleine-König
  2018-08-07 14:59   ` Schenk, Gavin
@ 2018-08-08  7:32   ` Sascha Hauer
  1 sibling, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2018-08-08  7:32 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: barebox

On Tue, Aug 07, 2018 at 04:23:44PM +0200, Uwe Kleine-König wrote:
> When sparse support was (intended to be) made optional it was
> effectively unconditionally disabled because
> 
> 	IS_ENABLED(USB_GADGET_FASTBOOT_SPARSE)
> 
> always evaluates to 0. To actually make use of the introduced kconfig
> symbol the CONFIG_ prefix must not be skipped.
> 
> Fixes: f4b5d3eeb607 ("usb: gadget: fastboot: Make sparse support optional")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Huh, I failed to commit the third IS_ENABLED hunk in (implicit) v1.
> 
>  drivers/usb/gadget/f_fastboot.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
> index 7ccf22771493..40a78987e46c 100644
> --- a/drivers/usb/gadget/f_fastboot.c
> +++ b/drivers/usb/gadget/f_fastboot.c
> @@ -337,7 +337,7 @@ static int fastboot_bind(struct usb_configuration *c, struct usb_function *f)
>  	fb_setvar(var, "0.4");
>  	var = fb_addvar(f_fb, "bootloader-version");
>  	fb_setvar(var, release_string);
> -	if (IS_ENABLED(USB_GADGET_FASTBOOT_SPARSE)) {
> +	if (IS_ENABLED(CONFIG_USB_GADGET_FASTBOOT_SPARSE)) {
>  		var = fb_addvar(f_fb, "max-download-size");
>  		fb_setvar(var, "%u", fastboot_max_download_size);
>  	}
> @@ -947,7 +947,7 @@ static void cb_flash(struct f_fastboot *f_fb, const char *cmd)
>  	filename = fentry->filename;
>  
>  	if (filetype == filetype_android_sparse) {
> -		if (!IS_ENABLED(USB_GADGET_FASTBOOT_SPARSE)) {
> +		if (!IS_ENABLED(CONFIG_USB_GADGET_FASTBOOT_SPARSE)) {
>  			fastboot_tx_print(f_fb, "FAILsparse image not supported");
>  			ret = -EOPNOTSUPP;
>  			goto out;
> @@ -1233,7 +1233,7 @@ done:
>  
>  static int fastboot_globalvars_init(void)
>  {
> -	if (IS_ENABLED(USB_GADGET_FASTBOOT_SPARSE))
> +	if (IS_ENABLED(CONFIG_USB_GADGET_FASTBOOT_SPARSE))
>  		globalvar_add_simple_int("usbgadget.fastboot_max_download_size",
>  				 &fastboot_max_download_size, "%u");
>  
> -- 
> 2.18.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-08-08  7:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-07 14:17 [PATCH] usb: gadget: allow to actually enable sparse fastboot support Uwe Kleine-König
2018-08-07 14:23 ` [PATCH v2] " Uwe Kleine-König
2018-08-07 14:59   ` Schenk, Gavin
2018-08-08  7:32   ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox