mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Michael Graichen <michael.graichen@hotmail.com>,
	"barebox@lists.infradead.org" <barebox@lists.infradead.org>
Cc: Michael Tretter <m.tretter@pengutronix.de>
Subject: Re: [PATCH 1/1] added support for zynq7000-fpga-manager
Date: Thu, 25 Mar 2021 09:09:18 +0100	[thread overview]
Message-ID: <0e0fe923-da8b-f39e-1834-4c0176e80b95@pengutronix.de> (raw)
In-Reply-To: <AM9P192MB0870C727E2A97796E63AC256AB629@AM9P192MB0870.EURP192.PROD.OUTLOOK.COM>

Hello Michael,

On 25.03.21 08:53, Michael Graichen wrote:
> +	reg = readl(mgr->regs + CTRL_OFFSET);
> +	reg &= ~CTRL_PCFG_PROG_B_MASK;
> +	writel(reg, mgr->regs + CTRL_OFFSET);
> +
> +	readl_poll_timeout(mgr->regs + STATUS_OFFSET, reg,
> +			!(reg & STATUS_PCFG_INIT_MASK), 100 * USEC_PER_MSEC);

Perhaps exit if a timeout occurred? Unchecked readx_poll_timeout looks odd.

> +	/* Check for errors */
> +	if(reg & INT_STS_ERROR_FLAGS_MASK) {

Missing space

> +		printf("interrupt status register (0x%04lx)\n", reg);

Better use pr_warn and co here with a suitable pr_fmt at top:

 - Messages will indicate where the error came from
 - Messages can be formatted according to severity
 - Messages will go into the barebox log, which Linux could read out via
   pstore if needed.

Cheers,
Ahmad

-- 
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


  reply	other threads:[~2021-03-25  8:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25  7:53 Michael Graichen
2021-03-25  8:09 ` Ahmad Fatoum [this message]
2021-03-25  8:42 ` Michael Tretter
2021-03-30 12:05   ` AW: " Michael Graichen
2021-04-08 15:28     ` Michael Tretter
2021-04-28  8:16       ` AW: " Michael Graichen

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=0e0fe923-da8b-f39e-1834-4c0176e80b95@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=m.tretter@pengutronix.de \
    --cc=michael.graichen@hotmail.com \
    /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