pr_err("Cannot register poller: %s\n", strerror(-ret));
> + return;
It is not obvious that a second FASTBOOT_INIT will _not_ cause this
error because fastboot_net_abort unregistered the previous poller.
I would at least add a comment to the fastboot_net_abo
for the command execution is queued, as you implemented it, when
a new command arrives.
Best regards,
Daniel
--
Dipl.-Math. Daniel Glöckner, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11,
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttin
Hello Sascha,
Am 18.06.20 um 13:59 schrieb Sascha Hauer:
> On Wed, Jun 17, 2020 at 09:32:45PM +0200, Daniel Glöckner wrote:
>>> +static void fastboot_start_download_net(struct fastboot *fb)
>>> +{
>>> + struct fastboot_net *fbn = contai
p_queue(ep, req);
> + w = xzalloc(sizeof(*w));
> + w->f_fb = f_fb;
> +
> + memcpy(w->command, req->buf, req->actual);
> +
> + wq_queue_work(&f_fb->wq, &w->work);
Do we need to check if req->actual < sizeof(w->command)?
Best
PER_SEC))
> + return;
> +
> + if (!fbn->may_send)
> + return;
> +
> + fastboot_tx_print(&fbn->fastboot, FASTBOOT_MSG_INFO, "still busy");
> +
> + fbn->host_waits_since = get_time_ns();
Why do we need this line?
host_wa
ist);
> + wq->cancel(work);
> + }
> +}
Why is this function in the header?
So far it is called only from wq_unregister.
Best regards,
Daniel
--
Dipl.-Math. Daniel Glöckner, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11,
Gothaer Platz 3, 37
t?
The fastboot UDP code in U-Boot was designed to send only a single message
for every executed command because it doesn't have code that waits for a
packet from the host when necessary. I think we should be proud that Barebox
can handle that case.
Best regards,
Daniel
--
Dipl.-Mat
restart is necessary since
contrary to USB the host will not notice when a UDP server disappears.
Signed-off-by: Edmund Henniges
Signed-off-by: Daniel Glöckner
Signed-off-by: Sascha Hauer
---
common/fastboot.c | 3 +
include/fastboot.h | 1 +
include/fastboot_net.h | 12 +
net
term from the USB specification and the Fastboot specification uses the
term "partition", we rename that variable to "fastboot.partitions".
Signed-off-by: Daniel Glöckner
Signed-off-by: Sascha Hauer
---
Documentation/user/usb.rst | 4 ++--
commands/usbgadget.c
The split of the generic Fastboot code from the Fastboot USB gadget
included renaming the CONFIG_USB_GADGET_FASTBOOT_* options to
CONFIG_FASTBOOT_*. Update all defconfigs to use the new names.
Signed-off-by: Daniel Glöckner
Signed-off-by: Sascha Hauer
---
arch/arm/configs/imx23_defconfig
From: Sascha Hauer
By adding a slice to the mdio bus we make the mdio code safe for being
called in a poller.
Signed-off-by: Sascha Hauer
---
drivers/net/phy/mdio_bus.c | 43 ++
include/linux/phy.h| 38 +
2 files chang
From: Sascha Hauer
Add ethernet code safe for being called from a poller.
Signed-off-by: Sascha Hauer
---
include/net.h | 8
net/eth.c | 21 ++---
2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/include/net.h b/include/net.h
index 54db8a179..8d2b49
From: Sascha Hauer
This adds a slice to each poller which is acquired before the poller is
executed. This allows us to run pollers inside of other pollers.
Signed-off-by: Sascha Hauer
---
common/poller.c | 19 ++-
include/poller.h | 2 ++
2 files changed, 12 insertions(+), 9
From: Sascha Hauer
Now that we have the network receive function running in a poller we
can reasonably well answer to ping requests. Implement this feature.
Signed-off-by: Sascha Hauer
---
net/net.c | 46 --
1 file changed, 44 insertions(+), 2 deleti
From: Sascha Hauer
This patch moves the ethernet receive loop into a poller. With this
network protocols no longer have to call net_loop() explicitly but
can do it implicitly by calling is_timeout() when waiting for packets.
Having the network receive loop running in a poller has the advantage
t
From: Sascha Hauer
To recognize if we have a receive packet pending we must set up a USB
bulk transfer. When there's no incoming packet we must wait until the
transfer times out. We do this with every poller call which can
considerably slow down the system. With this patch we do two things
agains
From: Sascha Hauer
Both the ethernet device and the mdio bus of a USB network controller
need the USB bus. Add dependencies to it.
Signed-off-by: Sascha Hauer
---
drivers/net/usb/usbnet.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
it
is doing that outside of any command. Code that wants to depend on the
idle slice must select CONFIG_IDLE_SLICE to make it available.
Signed-off-by: Daniel Glöckner
Signed-off-by: Sascha Hauer
---
common/hush.c | 5 +
common/ratp/ratp.c | 7 ++-
common/slice.c
From: Sascha Hauer
slices, the barebox idea of locking
barebox has pollers which execute code in the background whenever one of the
delay functions (udelay, mdelay, ...) or is_timeout() are called. This
introduces resource problems when some device triggers a poller by calling
a delay function a
From: Sascha Hauer
Signed-off-by: Sascha Hauer
---
drivers/usb/core/usb.c | 7 +++
include/usb/usb.h | 7 +++
2 files changed, 14 insertions(+)
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 30c251f40..847529526 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers
hanges since v2:
- rebased to the current master branch where some of the patches from v2
have already been merged
- timeout when waiting for host in fastboot_write_net
- reworked and unified code for aborting sessions
Daniel Glöckner (3):
Introduce idle slice
defconfigs: update renamed f
Hello Sascha,
Am 26.05.20 um 08:02 schrieb Sascha Hauer:
> On Mon, May 25, 2020 at 09:45:49PM +0200, Daniel Glöckner wrote:
>> I know that Barebox will get stuck when the host stops talking to us
>> before we had the opportunity to send the final OKAY, but that is not
>> what
but what would be the advantage?
We could fall back to rsvg-convert.
Best regards,
Daniel
--
Dipl.-Math. Daniel Glöckner, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11,
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B
t reinit to true, which discards all messages
the old session wants to send. If this is not acceptable, I suggest
adding a timeout >= 60 seconds to that loop in fastboot_write_net and
setting reinit when it expires. We can make the timeout a kconfig option
which defaults to 60 if you prefer.
Best
e.c
> +++ b/lib/readline.c
> @@ -3,7 +3,7 @@
> #include
> #include
> #include
> -#include
> +#include
> #include
> #include
> #include
Again, with your changes no include for slice.h needed.
Best regards,
Daniel
--
Dipl.-Math. Daniel Glöckner, emlix G
Hello Sascha,
On Wed, May 20, 2020 at 07:52:32AM +0200, Sascha Hauer wrote:
> On Thu, May 14, 2020 at 08:21:57PM +0200, Daniel Glöckner wrote:
> > From: Edmund Henniges
> >
> > This implements the UDP variant of the fastboot protocol. The only way to
> > start the se
term from the USB specification and the Fastboot specification uses the
term "partition", we rename that variable to "fastboot.partitions".
Signed-off-by: Daniel Glöckner
---
Documentation/user/usb.rst | 4 ++--
commands/usbgadget.c | 2 +-
common/fastboot.c
With the new idle slice there is no longer a need to have a dedicated hook
for RATP inside readline. Switch to a poller that depends on the idle
slice to execute the commands received over RATP.
Signed-off-by: Daniel Glöckner
---
common/ratp/ratp.c | 12 +++-
include/ratp_bb.h | 1
The split of the generic Fastboot code from the Fastboot USB gadget
included renaming the CONFIG_USB_GADGET_FASTBOOT_* options to
CONFIG_FASTBOOT_*. Update all defconfigs to use the new names.
Signed-off-by: Daniel Glöckner
---
arch/arm/configs/imx23_defconfig | 2 +-
arch/arm/configs
barebox is idle
- Use second poller to send keep-alive messages
- Share all settings in global variables with USB gadget
and move them to a protocol agnostic variable namespace
- Use eth_open function added recently
- Minor cleanups
Daniel Glöckner (8):
Remove CONFIG_SLICE
net: fixed-link phys are
*fb.
Signed-off-by: Edmund Henniges
Signed-off-by: Daniel Glöckner
---
common/Kconfig | 40 ++
common/Makefile | 1 +
common/fastboot.c | 957 +++
drivers/usb/gadget/Kconfig | 36 +-
drivers/usb/gadget
restart is necessary since
contrary to USB the host will not notice when a UDP server disappears.
Signed-off-by: Edmund Henniges
Signed-off-by: Daniel Glöckner
---
common/fastboot.c | 3 +
include/fastboot.h | 1 +
include/fastboot_net.h | 12 +
net/Kconfig| 18 ++
net
When downloading to a buffer, download_fd is never assigned a valid file
descriptor. We should therefore avoid calling close on the value found
in that variable.
Signed-off-by: Daniel Glöckner
---
common/fastboot.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/common
poller_register now has a second parameter.
Signed-off-by: Daniel Glöckner
---
arch/arm/boards/mioa701/gpio0_poweroff.c | 2 +-
arch/arm/boards/sama5d3xek/init.c| 2 +-
drivers/net/usb/ax88179_178a.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch
it
is doing that outside of any command. Code that wants to depend on the
idle slice must select CONFIG_IDLE_SLICE to make it available.
Signed-off-by: Daniel Glöckner
---
common/Kconfig | 4
common/binfmt.c| 3 +++
common/command.c | 3 +++
c
Fixed-link phys have their bus field set to NULL. This causes a crash when
phy_acquired tries to check the slice of the bus.
Signed-off-by: Daniel Glöckner
---
include/linux/phy.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/phy.h b/include/linux/phy.h
index
Since we are unconditionally compiling and linking the slice code, it does
not make sense to have a config option that depends on CONFIG_POLLER.
The CONFIG_SLICE option was also broken because it was missing the "bool"
line to denote its type.
Signed-off-by: Daniel Glöckner
---
comman
t; obj-$(CONFIG_AUTO_COMPLETE) += complete.o
> obj-y+= version.o
the Kconfig logic doesn't make sense to me. slice.o gets built regardless of
CONFIG_SLICE and it will still compile and link when CONFIG_POLLER is disabled.
On the other hand poller.o will fai
't have time back then, but I'm looking into it right now.
Best regards,
Daniel
--
Dipl.-Math. Daniel Glöckner, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11,
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amts
Hello Sascha,
Am 03/16/20 um 09:04 schrieb Sascha Hauer:
> On Thu, Mar 12, 2020 at 11:36:15PM +0100, Daniel Glöckner wrote:
>> On Thu, Mar 12, 2020 at 09:35:55AM +0100, Sascha Hauer wrote:
>>> This adds a slice to each poller which is acquired before the poller is
>>>
ommand
executes.
Best regards,
Daniel
--
Dipl.-Math. Daniel Glöckner, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11,
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Heike Jordan, Dr. Uwe
On Thu, Mar 12, 2020 at 09:24:59AM +0100, Sascha Hauer wrote:
> On Thu, Mar 12, 2020 at 12:51:54AM +0100, Daniel Glöckner wrote:
> > Hello Sascha,
> >
> > On Wed, Mar 11, 2020 at 03:27:46PM +0100, Sascha Hauer wrote:
> > > +/**
> > > + * slic
; + if (slice_acquired(se->slice)) {
> + ret = true;
> + break;
> + }
> +
> + slice->acquired = acquired;
no need to restore slice->acquire from acquired since
acquired must have been zero if we reach this line.
Best regards,
D
Am 03/09/20 um 08:14 schrieb Sascha Hauer:
> On Fri, Feb 28, 2020 at 09:48:20PM +0100, Daniel Glöckner wrote:
>> Contrary to U-Boot it does not send keep alive messages every 30
>> seconds because everything is executed from a poller.
>
> How does that prevent you fro
if (slice_acquired(se->slice))
> + return true;
> +
> + return false;
> +}
It would be nice if this function was able to detect cyclic dependencies
if DEBUG. This can be done by setting slice->acquired to INT_MIN while
recursing and checking if any of th
nning. The keep alives would then be sent from another poller.
Hm, I think I'll rewrite fastboot_poll to return while waiting for more
download data. Then only the command execution can trigger a watchdog
reset.
Best regards,
Daniel
--
Dipl.-Math. Daniel Glöckner, emlix GmbH, http://www.emlix.com
: Daniel Glöckner
---
include/net.h | 1 +
net/eth.c | 2 +-
net/fastboot.c | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/net.h b/include/net.h
index 6912a557b..b9b821c9a 100644
--- a/include/net.h
+++ b/include/net.h
@@ -83,6 +83,7 @@ int eth_set_ethaddr(struct
restart is necessary since
contrary to USB the host will not notice when a UDP server disappears.
Signed-off-by: Edmund Henniges
Signed-off-by: Daniel Glöckner
---
common/fastboot.c | 3 +
include/fastboot.h | 1 +
include/fastboot_net.h | 12 ++
net/Kconfig| 17 ++
net
e everything is executed from a poller. The timeout of
Google's fastboot tool is 60 seconds.
The third patch was necessary to allow network interfaces to be activated
without sending packets. The fastboot code sends packets only in reply to
received packets.
Daniel Glöckner (1):
fastboot
*fb.
Signed-off-by: Edmund Henniges
Signed-off-by: Daniel Glöckner
---
common/Kconfig | 35 ++
common/Makefile | 1 +
common/fastboot.c | 955 +++
drivers/usb/gadget/Kconfig | 3 +-
drivers/usb/gadget
50 matches
Mail list logo