All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pavel Machek" <pavel@denx.de>
To: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Cc: cip-dev@lists.cip-project.org,
	Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>,
	Pavel Machek <pavel@denx.de>,
	Biju Das <biju.das.jz@bp.renesas.com>
Subject: Re: [cip-dev] [PATCH 4.19.y-cip 2/7] memory: add Renesas RPC-IF driver
Date: Mon, 23 Nov 2020 20:37:39 +0100	[thread overview]
Message-ID: <20201123193739.GA5619@amd> (raw)
In-Reply-To: <20201123120354.26413-3-prabhakar.mahadev-lad.rj@bp.renesas.com>


[-- Attachment #1.1: Type: text/plain, Size: 2148 bytes --]

Hi!

> +EXPORT_SYMBOL(rpcif_sw_init);

EXPORT_SYMBOL_GPL?

> +void rpcif_enable_rpm(struct rpcif *rpc)
> +{
> +	pm_runtime_enable(rpc->dev);
> +}
> +EXPORT_SYMBOL(rpcif_enable_rpm);
> +
> +void rpcif_disable_rpm(struct rpcif *rpc)
> +{
> +	pm_runtime_put_sync(rpc->dev);
> +}
> +EXPORT_SYMBOL(rpcif_disable_rpm);

Should these go to header as static inlines?

> +static int wait_msg_xfer_end(struct rpcif *rpc)
> +{
> +	u32 sts;
> +
> +	return regmap_read_poll_timeout(rpc->regmap, RPCIF_CMNSR, sts,
> +					sts & RPCIF_CMNSR_TEND, 0,
> +					USEC_PER_SEC);
> +}

This can't be right. sts is used uninitialized here.

> +int rpcif_manual_xfer(struct rpcif *rpc)
> +{
> +	default:
> +		regmap_write(rpc->regmap, RPCIF_SMENR, rpc->enable);
> +		regmap_write(rpc->regmap, RPCIF_SMCR,
> +			     rpc->smcr | RPCIF_SMCR_SPIE);
> +		ret = wait_msg_xfer_end(rpc);
> +		if (ret)
> +			goto err_out;
> +	}
> +
> +exit:
> +	pm_runtime_put(rpc->dev);
> +	return ret;
> +
> +err_out:
> +	ret = reset_control_reset(rpc->rstc);
> +	rpcif_hw_init(rpc, rpc->bus_size == 2);
> +	goto exit;
> +}

So we get failure in wait_msg_xfer_end(rpc); but then
reset_control_reset(rpc->rstc); returns success and whole function
returns success. Is that ok?

> +static int rpcif_probe(struct platform_device *pdev)
> +{
> +	struct platform_device *vdev;
> +	struct device_node *flash;
> +	const char *name;
> +
> +	flash = of_get_next_child(pdev->dev.of_node, NULL);
> +	if (!flash) {
> +		dev_warn(&pdev->dev, "no flash node found\n");
> +		return -ENODEV;
> +	}

Does this need corresponding of_node_put()?

> +struct	rpcif_op {

Weird formatting; we normally use spaces (not tabs) for this.

> +	struct {
> +		u8 buswidth;
...
> +	struct {
> +		u8 ncycles;
> +		u8 buswidth;
> +	} dummy;

Are you sure this will be consistent accross architectures? Should the
structure be marked attribute packed or something?

Best regards,
								Pavel
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 420 bytes --]


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#5827): https://lists.cip-project.org/g/cip-dev/message/5827
Mute This Topic: https://lists.cip-project.org/mt/78451541/4520388
Group Owner: cip-dev+owner@lists.cip-project.org
Unsubscribe: https://lists.cip-project.org/g/cip-dev/leave/8129055/727948398/xyzzy [cip-dev@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-


  reply	other threads:[~2020-11-23 19:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-23 12:03 [cip-dev] [PATCH 4.19.y-cip 0/7] Add RPC-IF driver for RZ/G2x SoC's Lad Prabhakar
2020-11-23 12:03 ` [cip-dev] [PATCH 4.19.y-cip 1/7] dt-bindings: memory: document Renesas RPC-IF bindings Lad Prabhakar
2020-11-23 12:03 ` [cip-dev] [PATCH 4.19.y-cip 2/7] memory: add Renesas RPC-IF driver Lad Prabhakar
2020-11-23 19:37   ` Pavel Machek [this message]
2020-11-23 23:00     ` Lad Prabhakar
2020-11-24  9:27       ` Pavel Machek
2020-11-23 19:38   ` Pavel Machek
2020-11-23 23:02     ` Lad Prabhakar
2020-11-23 12:03 ` [cip-dev] [PATCH 4.19.y-cip 3/7] spi: spi-mem: Add SPI_MEM_NO_DATA to the spi_mem_data_dir enum Lad Prabhakar
2020-11-23 12:03 ` [cip-dev] [PATCH 4.19.y-cip 4/7] spi: spi-mem: export spi_mem_default_supports_op() Lad Prabhakar
2020-11-23 12:03 ` [cip-dev] [PATCH 4.19.y-cip 5/7] spi: spi-mem: Split spi_mem_exec_op() code Lad Prabhakar
2020-11-23 19:43   ` Pavel Machek
2020-11-23 23:05     ` Lad Prabhakar
2020-11-23 12:03 ` [cip-dev] [PATCH 4.19.y-cip 6/7] spi: spi-mem: Add a new API to support direct mapping Lad Prabhakar
2020-11-23 19:46   ` Pavel Machek
2020-11-23 23:08     ` Lad Prabhakar
2020-11-23 12:03 ` [cip-dev] [PATCH 4.19.y-cip 7/7] spi: add Renesas RPC-IF driver Lad Prabhakar
2020-11-23 19:52   ` Pavel Machek
2020-11-23 23:12     ` Lad Prabhakar

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=20201123193739.GA5619@amd \
    --to=pavel@denx.de \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=nobuhiro1.iwamatsu@toshiba.co.jp \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.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 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.