linux-rockchip.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Ratiu <adrian.ratiu-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
To: Enric Balletbo Serra
	<eballetbo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Adrian Ratiu
	<adrian.ratiu-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
Cc: "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Jernej Skrabec <jernej.skrabec-gGgVlfcn5nU@public.gmane.org>,
	Adrian Pop <pop.adrian61-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Jonas Karlman <jonas-uIzNG4q0ceqzQB+pC5nmwQ@public.gmane.org>,
	linux-kernel
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	dri-devel
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	Andrzej Hajda <a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	Laurent Pinchart
	<Laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>,
	Arnaud Ferraris
	<arnaud.ferraris-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>,
	Collabora Kernel ML
	<kernel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>,
	Ezequiel Garcia
	<ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>,
	linux-stm32-XDFAJ8BFU24N7RejjzZ/Li2xQDfSxrLKVpNB7YpNyf8@public.gmane.org,
	Linux ARM
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	linux-imx-3arQi8VN3Tc@public.gmane.org
Subject: Re: [PATCH v6 1/8] drm: bridge: dw_mipi_dsi: add initial regmap infrastructure
Date: Fri, 17 Apr 2020 11:07:37 +0300	[thread overview]
Message-ID: <87imhyk01i.fsf@collabora.com> (raw)
In-Reply-To: <CAFqH_513KB+En_xbpXSBG6Q38kYxWCgw0KO3NVxCb6fqHDaKBA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Thu, 16 Apr 2020, Enric Balletbo Serra <eballetbo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 
wrote:
> Hi Adrian, 
> 
> [snip] 
> 
>> >> 
>> >> +static void dw_mipi_dsi_get_hw_version(struct dw_mipi_dsi 
>> >> *dsi) +{ +       regmap_read(dsi->regs, DSI_VERSION, 
>> >> &dsi->hw_version); +       dsi->hw_version &= VERSION; + if 
>> >> (!dsi->hw_version) +               dev_err(dsi->dev, "Failed 
>> >> to read DSI hw version register\n"); 
>> > 
>> > Is this an error that should be ignored? If you can't get the 
>> > HW version, probably, there is something wrong with your 
>> > hardware so, don't you need to return an error? 
>> > 
>> 
>> After thinking a bit more about it, that error should be a 
>> warning. 
>> 
>> I added it because in some cases (for eg. if the peripheral 
>> clock is disabled) the reads can return 0 which is obviously an 
>> invalid version and the bridge will error in the next step when 
>> not finding a layout. 
>> 
> 
> If you'll error anyway, why wait? IIUC at this point the clock 
> *must* be enabled, and if not, something is wrong with the 
> driver, I don't see any advantage on delay the error. do you 
> have a use case where this is called and peripheral clock 
> disabled? 

There should be no real use-case (maybe malfunctioning HW), and we 
could error out here to catch driver bugs ASAP, so I'll go this 
route then :)

Thank you, much appreciated!

>
>> So I'll make this a warning in v7 and explicitely mention that
>> reads version == 0 can be caused by a disabled pclk.
>>
>
> -- Enric
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2020-04-17  8:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14 15:19 [PATCH v6 0/8] Genericize DW MIPI DSI bridge and add i.MX 6 driver Adrian Ratiu
2020-04-14 15:19 ` [PATCH v6 1/8] drm: bridge: dw_mipi_dsi: add initial regmap infrastructure Adrian Ratiu
     [not found]   ` <20200414151955.311949-2-adrian.ratiu-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2020-04-15 15:53     ` Enric Balletbo Serra
     [not found]       ` <CAFqH_52eKB4jtmn5e4HQubv8ijOPqDqncp1dRGahhU3NOorJMQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-04-16 18:25         ` Adrian Ratiu
2020-04-16 18:41         ` Adrian Ratiu
2020-04-16 20:15           ` Enric Balletbo Serra
     [not found]             ` <CAFqH_513KB+En_xbpXSBG6Q38kYxWCgw0KO3NVxCb6fqHDaKBA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-04-17  8:07               ` Adrian Ratiu [this message]
     [not found] ` <20200414151955.311949-1-adrian.ratiu-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2020-04-14 15:19   ` [PATCH v6 2/8] drm: bridge: dw_mipi_dsi: abstract register access using reg_fields Adrian Ratiu
2020-04-14 15:19   ` [PATCH v6 3/8] drm: bridge: synopsis: add dsi v1.01 support Adrian Ratiu
2020-04-14 15:19   ` [PATCH v6 4/8] drm: imx: Add i.MX 6 MIPI DSI host platform driver Adrian Ratiu
     [not found]     ` <20200414151955.311949-5-adrian.ratiu-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2020-04-15 17:26       ` Enric Balletbo Serra
     [not found]         ` <CAFqH_51ZZTd6iK+G1QdqfBedxyG-A=HwPjY1kdOuWTqd7niTHQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-04-15 17:30           ` Laurent Pinchart
     [not found]             ` <20200415173018.GK4758-N3hz7ZxfLydczECFQUw77jytWr6r+dGw0E9HWUfgJXw@public.gmane.org>
2020-04-17  9:56               ` Adrian Ratiu
2020-04-14 15:19   ` [PATCH v6 5/8] dt-bindings: display: add i.MX6 MIPI DSI host controller doc Adrian Ratiu
     [not found]     ` <20200414151955.311949-6-adrian.ratiu-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2020-04-14 20:42       ` Laurent Pinchart
2020-04-15 11:28         ` Adrian Ratiu
2020-04-14 15:19   ` [PATCH v6 6/8] drm: stm: dw-mipi-dsi: let the bridge handle the HW version check Adrian Ratiu
2020-04-14 15:19   ` [PATCH v6 7/8] drm: bridge: dw-mipi-dsi: split low power cfg register into fields Adrian Ratiu
2020-04-14 15:19   ` [PATCH v6 8/8] drm: bridge: dw-mipi-dsi: fix bad register field offsets Adrian Ratiu

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=87imhyk01i.fsf@collabora.com \
    --to=adrian.ratiu-zgy8ohtn/8qb+jhodadfcq@public.gmane.org \
    --cc=Laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org \
    --cc=a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=arnaud.ferraris-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=eballetbo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
    --cc=jernej.skrabec-gGgVlfcn5nU@public.gmane.org \
    --cc=jonas-uIzNG4q0ceqzQB+pC5nmwQ@public.gmane.org \
    --cc=kernel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-imx-3arQi8VN3Tc@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-stm32-XDFAJ8BFU24N7RejjzZ/Li2xQDfSxrLKVpNB7YpNyf8@public.gmane.org \
    --cc=pop.adrian61-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).