From: Sascha Hauer <sha@pengutronix.de>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v1 1/1] ARM: boards: protonic-imx6: fix file system access warning
Date: Fri, 1 Apr 2022 15:03:51 +0200 [thread overview]
Message-ID: <20220401130351.GO4012@pengutronix.de> (raw)
In-Reply-To: <20220328120956.2402132-1-o.rempel@pengutronix.de>
On Mon, Mar 28, 2022 at 02:09:56PM +0200, Oleksij Rempel wrote:
> We should not access a file system from the poller. So, do it from the
> worker. This patch will fix warning on FS access for Protonic board
> code.
>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
> arch/arm/boards/protonic-imx6/board.c | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
Applied, thanks
Sascha
>
> diff --git a/arch/arm/boards/protonic-imx6/board.c b/arch/arm/boards/protonic-imx6/board.c
> index def155e6ba..c2706f92ff 100644
> --- a/arch/arm/boards/protonic-imx6/board.c
> +++ b/arch/arm/boards/protonic-imx6/board.c
> @@ -21,6 +21,7 @@
> #include <sys/stat.h>
> #include <unistd.h>
> #include <usb/usb.h>
> +#include <work.h>
>
> #define GPIO_HW_REV_ID {\
> {IMX_GPIO_NR(2, 8), GPIOF_DIR_IN | GPIOF_ACTIVE_LOW, "rev_id0"}, \
> @@ -85,9 +86,10 @@ struct prt_imx6_priv {
> unsigned int hw_id;
> unsigned int hw_rev;
> const char *name;
> - struct poller_async poller;
> unsigned int usb_delay;
> unsigned int no_usb_check;
> + struct work_queue wq;
> + struct work_struct work;
> };
>
> struct prti6q_rfid_contents {
> @@ -290,9 +292,9 @@ exit_usb_mount:
>
> #define OTG_PORTSC1 (MX6_OTG_BASE_ADDR+0x184)
>
> -static void prt_imx6_check_usb_boot(void *data)
> +static void prt_imx6_check_usb_boot_do_work(struct work_struct *w)
> {
> - struct prt_imx6_priv *priv = data;
> + struct prt_imx6_priv *priv = container_of(w, struct prt_imx6_priv, work);
> struct device_d *dev = priv->dev;
> char *second_word, *bootsrc, *usbdisk;
> char buf[sizeof("vicut1q recovery")] = {};
> @@ -371,6 +373,7 @@ exit_usb_boot:
> free(usbdisk);
>
> return;
> +
> }
>
> static int prt_imx6_env_init(struct prt_imx6_priv *priv)
> @@ -462,7 +465,6 @@ exit_bbu:
> static int prt_imx6_devices_init(void)
> {
> struct prt_imx6_priv *priv = prt_priv;
> - int ret;
>
> if (!priv)
> return 0;
> @@ -477,14 +479,12 @@ static int prt_imx6_devices_init(void)
> prt_imx6_env_init(priv);
>
> if (!priv->no_usb_check) {
> - ret = poller_async_register(&priv->poller, "usb-boot");
> - if (ret) {
> - dev_err(priv->dev, "can't setup poller\n");
> - return ret;
> - }
> + priv->wq.fn = prt_imx6_check_usb_boot_do_work;
> +
> + wq_register(&priv->wq);
>
> - poller_call_async(&priv->poller, priv->usb_delay * SECOND,
> - &prt_imx6_check_usb_boot, priv);
> + wq_queue_delayed_work(&priv->wq, &priv->work,
> + priv->usb_delay * SECOND);
> }
>
> return 0;
> --
> 2.30.2
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
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
prev parent reply other threads:[~2022-04-01 13:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-28 12:09 [PATCH v1 1/1] ARM: boards: protonic-imx6: fix file system access warning Oleksij Rempel
2022-04-01 13:03 ` Sascha Hauer [this message]
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=20220401130351.GO4012@pengutronix.de \
--to=sha@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=o.rempel@pengutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.