Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1349270

Re: [PATCH 06/17] reset: Add PLX Technology Reset Controller driver

From Philipp Zabel <p.zabel@pengutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH 06/17] reset: Add PLX Technology Reset Controller driver
Date 2016-03-03 16:10 +0100
Message-ID <r8D35-k8-39@gated-at.bofh.it> (permalink)
References <r8zVw-6xi-13@gated-at.bofh.it> <r8A5c-6Bm-5@gated-at.bofh.it> <r8CgF-8cy-1@gated-at.bofh.it> <r8CA3-8lg-41@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Am Donnerstag, den 03.03.2016, 15:29 +0100 schrieb Neil Armstrong:
> >> +static int oxnas_reset_reset(struct reset_controller_dev *rcdev,
> >> +			      unsigned long id)
> >> +{
> >> +	struct oxnas_reset *data =
> >> +		container_of(rcdev, struct oxnas_reset, rcdev);
> >> +
> >> +	regmap_write(data->regmap, RST_SET_REGOFFSET, BIT(id));
> >> +	msleep(50);
> > 
> > Is this the right delay for all of the resets in this register?
> > If not, I'd drop the .reset callback.
> > 
> The delay is not strictly necessary, but better to avoid any HW issues.

Ok, maybe add a comment.

> And the .reset callback is needed since reset_control_reset
> does not assert -> deassert as fallback.

That's because some controllers don't even have manual
assertion/deassertion, and for some reset lines the drivers better know
the timing or they want to do other stuff while the reset is asserted.

[...]
> >> +static struct reset_control_ops oxnas_reset_ops = {
> > 
> > const
> > 
> Something checkpatch should report...

This is new in any case. rcdev->ops was not const* until recently.

> >> +	.reset		= oxnas_reset_reset,
> >> +	.assert		= oxnas_reset_assert,
> >> +	.deassert	= oxnas_reset_deassert,
> >> +};
> >> +
> >> +static const struct of_device_id oxnas_reset_dt_ids[] = {
> >> +	 { .compatible = "plxtech,nas782x-reset", },
> >> +	 { /* sentinel */ },
> >> +};
> >> +MODULE_DEVICE_TABLE(of, oxnas_reset_dt_ids);
> >> +
> >> +static int oxnas_reset_probe(struct platform_device *pdev)
> >> +{
> >> +	struct oxnas_reset *data;
> >> +	struct device *parent;
> >> +
> >> +	parent = pdev->dev.parent;
> >> +	if (!parent) {
> >> +		dev_err(&pdev->dev, "no parent\n");
> > 
> > Can this even happen?
> > 
> It's to make sure parent->of_node is valid for syscon_node_to_regmap.

Since this is a platform device probed via device tree,
pdev->dev.parent should always be set (see of_device_alloc()).

regards
Philipp

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/17] Add Initial support for PLX Technology OX810SE Neil Armstrong <narmstrong@baylibre.com> - 2016-03-03 13:00 +0100
  [PATCH 06/17] reset: Add PLX Technology Reset Controller driver Neil Armstrong <narmstrong@baylibre.com> - 2016-03-03 13:00 +0100
    Re: [PATCH 06/17] reset: Add PLX Technology Reset Controller driver Philipp Zabel <p.zabel@pengutronix.de> - 2016-03-03 15:20 +0100
      Re: [PATCH 06/17] reset: Add PLX Technology Reset Controller driver Neil Armstrong <narmstrong@baylibre.com> - 2016-03-03 15:40 +0100
        Re: [PATCH 06/17] reset: Add PLX Technology Reset Controller driver Philipp Zabel <p.zabel@pengutronix.de> - 2016-03-03 16:10 +0100
  [PATCH 07/17] dt-bindings: Add PLX Technology Reset Controller bindings Neil Armstrong <narmstrong@baylibre.com> - 2016-03-03 13:00 +0100
    Re: [PATCH 07/17] dt-bindings: Add PLX Technology Reset Controller  bindings Philipp Zabel <p.zabel@pengutronix.de> - 2016-03-03 15:30 +0100
      Re: [PATCH 07/17] dt-bindings: Add PLX Technology Reset Controller  bindings Neil Armstrong <narmstrong@baylibre.com> - 2016-03-03 15:30 +0100
        Re: [PATCH 07/17] dt-bindings: Add PLX Technology Reset Controller  bindings Philipp Zabel <p.zabel@pengutronix.de> - 2016-03-03 15:40 +0100
  [PATCH 05/17] dt-bindings: Add PLX Technology RPS Timer bindings Neil Armstrong <narmstrong@baylibre.com> - 2016-03-03 13:00 +0100
  [PATCH 02/17] irqchip: Add PLX Technology RPS IRQ Controller Neil Armstrong <narmstrong@baylibre.com> - 2016-03-03 13:00 +0100
    Re: [PATCH 02/17] irqchip: Add PLX Technology RPS IRQ Controller Arnd Bergmann <arnd@arndb.de> - 2016-03-03 14:10 +0100
      Re: [PATCH 02/17] irqchip: Add PLX Technology RPS IRQ Controller Russell King - ARM Linux <linux@arm.linux.org.uk> - 2016-03-03 14:40 +0100
        Re: [PATCH 02/17] irqchip: Add PLX Technology RPS IRQ Controller Arnd Bergmann <arnd@arndb.de> - 2016-03-03 18:40 +0100
    Re: [PATCH 02/17] irqchip: Add PLX Technology RPS IRQ Controller Marc Zyngier <marc.zyngier@arm.com> - 2016-03-03 14:10 +0100
    RE: [PATCH 02/17] irqchip: Add PLX Technology RPS IRQ Controller "Ma Haijun" <mahaijuns@gmail.com> - 2016-03-03 16:40 +0100
      Re: [PATCH 02/17] irqchip: Add PLX Technology RPS IRQ Controller Neil Armstrong <narmstrong@baylibre.com> - 2016-03-03 18:00 +0100
        Re: [PATCH 02/17] irqchip: Add PLX Technology RPS IRQ Controller Marc Zyngier <marc.zyngier@arm.com> - 2016-03-03 18:20 +0100
  [PATCH 09/17] dt-bindings: Add PLX Technology OXNAS Standard Clocks bindings Neil Armstrong <narmstrong@baylibre.com> - 2016-03-03 13:00 +0100
  Re: [PATCH 00/17] Add Initial support for PLX Technology OX810SE Arnd Bergmann <arnd@arndb.de> - 2016-03-03 13:30 +0100
    Re: [PATCH 00/17] Add Initial support for PLX Technology OX810SE Neil Armstrong <narmstrong@baylibre.com> - 2016-03-03 13:40 +0100

csiph-web