dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Jyri Sarha <jsarha@ti.com>, dri-devel@lists.freedesktop.org
Cc: peter.ujfalusi@ti.com, laurent.pinchart@ideasonboard.com
Subject: Re: [PATCH v2 3/3] drm/omap: Make omapdss API more generic
Date: Mon, 8 Jan 2018 10:30:45 +0200	[thread overview]
Message-ID: <cb9a23bd-fd02-a9e2-ba4e-a23dce450bcd@ti.com> (raw)
In-Reply-To: <ed2ae19d-f22f-e456-511c-1fb0032334a2@ti.com>

On 07/01/18 22:14, Jyri Sarha wrote:

>>> +static u64 dispc_api_read_irqstatus(u64 clearmask)
>>> +{
>>> +	u32 hw_clearmask = dispc_api_to_hw_irq(clearmask);
>>> +	u32 hw_status = dispc_read_irqstatus();
>>> +
>>> +	dispc_clear_irqstatus(hw_clearmask & hw_status);
>>> +
>>> +	return dispc_hw_to_api_irq(hw_status);
>>> +}
>>
>> I think we always want to read the whole irqstatus, and clear it. You
>> can do that with the function above, but I'm not sure if clearmask
>> offers us anything we ever need to use.
>>
> 
> But the semantically correct way is to clear only the interrupts we
> handle. In theory there could be some other entity following some other
> interrupts and clearing the interrupts we are not handling could ruin

If that would be the case, then we need to ensure that the irqenable and
irqstatus are handled race free, and we need to make sure those entities
never touch the same bits, even if they'd use proper locking.

Yes, it's possible, but we don't do it and I hope we never do.

> that. But in practice at the moment everything would work fine without
> the clearmask too. Is that reason enough to remove it?

Well, I would ask if there's enough reason to add it? What's the
scenario you see that it would be used (not theoretical, but real one)?
Or is there any other downside to just clearing all irqstatus bits?

My main worry with this is that we somehow (well, bug) would end up
having a dispc irq enabled in irqenable, and we would not have that bit
in clearmask. The end result would be an endless irq flood.

If in the future there's a use case that needs this, it would be trivial
to add it at that point of time. So my guideline would be to keep things
as simple as possible, and only add unused features if there's a
realistic near-future use case for it which you know you'll be implementing.

 Tomi

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-01-08  8:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-01 11:55 [PATCH v2 0/3] drm/omap: Make omapdss API more generic + related patches Jyri Sarha
2018-01-01 11:55 ` [PATCH v2 1/3] drm/omap: Fail probe if irq registration fails Jyri Sarha
2018-01-05 14:34   ` Laurent Pinchart
2018-01-01 11:55 ` [PATCH v2 2/3] drm/omap: Add get_ovl_name() and get_mgr_name() to dispc_ops Jyri Sarha
     [not found] ` <be6c356220bbd92eef49d03e9a8359eae5a8df4a.1514807171.git.jsarha@ti.com>
2018-01-04 11:17   ` [PATCH v2 3/3] drm/omap: Make omapdss API more generic Tomi Valkeinen
2018-01-07 20:14     ` Jyri Sarha
2018-01-08  8:30       ` Tomi Valkeinen [this message]
2018-01-04 11:21 ` [PATCH v2 0/3] drm/omap: Make omapdss API more generic + related patches Tomi Valkeinen

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=cb9a23bd-fd02-a9e2-ba4e-a23dce450bcd@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=peter.ujfalusi@ti.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