From: Jason-JH Lin <jason-jh.lin@mediatek.com>
To: Tzung-Bi Shih <tzungbi@google.com>
Cc: "Chun-Kuang Hu" <chunkuang.hu@kernel.org>,
"; Philipp Zabel" <p.zabel@pengutronix.de>,
"; Matthias Brugger" <matthias.bgg@gmail.com>,
"; Jassi Brar" <jassisinghbrar@gmail.com>,
"; David Airlie" <airlied@linux.ie>,
"; Daniel Vetter" <daniel@ffwll.ch>,
"; dri-devel@lists.freedesktop.org;
linux-mediatek@lists.infradead.org;
linux-arm-kernel@lists.infradead.org;
linux-kernel@vger.kernel.org; hsinyi@chromium.org;
fshao@chromium.org; Nancy Lin (林欣螢)" <Nancy.Lin@mediatek.com>,
"; Singo Chang (張興國)" <Singo.Chang@mediatek.com>
Subject: Re: FW: [PATCH 3/3] drm/mediatek: add devlink to cmdq dev
Date: Sun, 28 Nov 2021 23:57:33 +0800 [thread overview]
Message-ID: <ae29424d8121f8951cfb5fece114b6fcba90d351.camel@mediatek.com> (raw)
In-Reply-To: <PU1PR03MB306252A252139515F7EA9ABCB8659@PU1PR03MB3062.apcprd03.prod.outlook.com>
Hi Tzung-Bi,
Thanks for the reviews.
> From: Linux-mediatek <linux-mediatek-bounces@lists.infradead.org> On
> Behalf Of Tzung-Bi Shih
> Sent: Thursday, November 18, 2021 1:55 PM
> To: Jason-JH Lin (林睿祥) <Jason-JH.Lin@mediatek.com>
> Cc: Chun-Kuang Hu <chunkuang.hu@kernel.org>; Philipp Zabel <
> p.zabel@pengutronix.de>; Matthias Brugger <matthias.bgg@gmail.com>;
> Jassi Brar <jassisinghbrar@gmail.com>; David Airlie <airlied@linux.ie
> >; Daniel Vetter <daniel@ffwll.ch>; dri-devel@lists.freedesktop.org;
> linux-mediatek@lists.infradead.org;
> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org;
> hsinyi@chromium.org; fshao@chromium.org; Nancy Lin (林欣螢) <
> Nancy.Lin@mediatek.com>; Singo Chang (張興國) <Singo.Chang@mediatek.com>
> Subject: Re: [PATCH 3/3] drm/mediatek: add devlink to cmdq dev
>
> On Wed, Nov 17, 2021 at 02:41:58PM +0800, jason-jh.lin wrote:
> > @@ -158,6 +159,7 @@ static void mtk_drm_crtc_destroy(struct
> > drm_crtc *crtc)
> > mtk_drm_cmdq_pkt_destroy(&mtk_crtc->cmdq_handle);
> >
> > if (mtk_crtc->cmdq_client.chan) {
> > + device_link_remove(mtk_crtc->drm_dev, mtk_crtc-
> > >cmdq_client.chan->mbox->dev);
> > mbox_free_channel(mtk_crtc->cmdq_client.chan);
> > mtk_crtc->cmdq_client.chan = NULL;
> > }
>
> [...]
> > @@ -956,6 +959,16 @@ int mtk_drm_crtc_create(struct drm_device
> > *drm_dev,
> > }
> >
> > if (mtk_crtc->cmdq_client.chan) {
> > + struct device_link *link;
> > +
> > + /* add devlink to cmdq dev to make sure suspend/resume
> > order is correct */
> > + link = device_link_add(dev, mtk_crtc->cmdq_client.chan-
> > >mbox->dev,
> > + DL_FLAG_PM_RUNTIME |
> > DL_FLAG_STATELESS);
> > + if (!link) {
> > + dev_err(dev, "Unable to link dev=%s\n",
> > + dev_name(mtk_crtc->cmdq_client.chan-
> > >mbox->dev));
> > + }
> > +
>
> If device_link_add() failed, doesn't mtk_drm_crtc_create() need to
> return an error and exit?
OK, I'll add the return error at the next verion.
>
> OTOH, if device_link_add() failed, won't it bring any side effects to
> call device_link_remove()?
>
Because device_link_remove() will find the device_link of supplier and
consumer, then delete the device_link between them.
If device_link_add() failed, supplier and consumer won't create the
device_link.
So calling device_link_remove() won't do anything without deive_link
and won't bring any side effects.
Regards,
Jason-JH.Lin
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@lists.infradead.org
>
https://urldefense.com/v3/__http://lists.infradead.org/mailman/listinfo/linux-mediatek__;!!CTRNKA9wMg0ARbw!125dmOZ7xCLkwbIrzZf1VqVLQBbdT4RFHoMjR38U1GeCxaTM6xvvB-mSr7sTc6BuY5IH$
>
--
Jason-JH Lin <jason-jh.lin@mediatek.com>
WARNING: multiple messages have this Message-ID
From: Jason-JH Lin <jason-jh.lin@mediatek.com>
To: Tzung-Bi Shih <tzungbi@google.com>
Cc: "Chun-Kuang Hu" <chunkuang.hu@kernel.org>,
"; Philipp Zabel" <p.zabel@pengutronix.de>,
"; Matthias Brugger" <matthias.bgg@gmail.com>,
"; Jassi Brar" <jassisinghbrar@gmail.com>,
"; David Airlie" <airlied@linux.ie>,
"; Daniel Vetter" <daniel@ffwll.ch>,
"; dri-devel@lists.freedesktop.org;
linux-mediatek@lists.infradead.org;
linux-arm-kernel@lists.infradead.org;
linux-kernel@vger.kernel.org; hsinyi@chromium.org;
fshao@chromium.org; Nancy Lin (林欣螢)" <Nancy.Lin@mediatek.com>,
"; Singo Chang (張興國)" <Singo.Chang@mediatek.com>
Subject: Re: FW: [PATCH 3/3] drm/mediatek: add devlink to cmdq dev
Date: Mon, 29 Nov 2021 00:02:33 +0800 [thread overview]
Message-ID: <ae29424d8121f8951cfb5fece114b6fcba90d351.camel@mediatek.com> (raw)
Message-ID: <20211128160233.Mbw4EN7z73rjlh-pGifinFLeuHvcDt_u7-9Ju8viKfI@z> (raw)
In-Reply-To: <PU1PR03MB306252A252139515F7EA9ABCB8659@PU1PR03MB3062.apcprd03.prod.outlook.com>
Hi Tzung-Bi,
Thanks for the reviews.
> From: Linux-mediatek <linux-mediatek-bounces@lists.infradead.org> On
> Behalf Of Tzung-Bi Shih
> Sent: Thursday, November 18, 2021 1:55 PM
> To: Jason-JH Lin (林睿祥) <Jason-JH.Lin@mediatek.com>
> Cc: Chun-Kuang Hu <chunkuang.hu@kernel.org>; Philipp Zabel <
> p.zabel@pengutronix.de>; Matthias Brugger <matthias.bgg@gmail.com>;
> Jassi Brar <jassisinghbrar@gmail.com>; David Airlie <airlied@linux.ie
> >; Daniel Vetter <daniel@ffwll.ch>; dri-devel@lists.freedesktop.org;
> linux-mediatek@lists.infradead.org;
> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org;
> hsinyi@chromium.org; fshao@chromium.org; Nancy Lin (林欣螢) <
> Nancy.Lin@mediatek.com>; Singo Chang (張興國) <Singo.Chang@mediatek.com>
> Subject: Re: [PATCH 3/3] drm/mediatek: add devlink to cmdq dev
>
> On Wed, Nov 17, 2021 at 02:41:58PM +0800, jason-jh.lin wrote:
> > @@ -158,6 +159,7 @@ static void mtk_drm_crtc_destroy(struct
> > drm_crtc *crtc)
> > mtk_drm_cmdq_pkt_destroy(&mtk_crtc->cmdq_handle);
> >
> > if (mtk_crtc->cmdq_client.chan) {
> > + device_link_remove(mtk_crtc->drm_dev, mtk_crtc-
> > >cmdq_client.chan->mbox->dev);
> > mbox_free_channel(mtk_crtc->cmdq_client.chan);
> > mtk_crtc->cmdq_client.chan = NULL;
> > }
>
> [...]
> > @@ -956,6 +959,16 @@ int mtk_drm_crtc_create(struct drm_device
> > *drm_dev,
> > }
> >
> > if (mtk_crtc->cmdq_client.chan) {
> > + struct device_link *link;
> > +
> > + /* add devlink to cmdq dev to make sure suspend/resume
> > order is correct */
> > + link = device_link_add(dev, mtk_crtc->cmdq_client.chan-
> > >mbox->dev,
> > + DL_FLAG_PM_RUNTIME |
> > DL_FLAG_STATELESS);
> > + if (!link) {
> > + dev_err(dev, "Unable to link dev=%s\n",
> > + dev_name(mtk_crtc->cmdq_client.chan-
> > >mbox->dev));
> > + }
> > +
>
> If device_link_add() failed, doesn't mtk_drm_crtc_create() need to
> return an error and exit?
OK, I'll add the return error at the next verion.
>
> OTOH, if device_link_add() failed, won't it bring any side effects to
> call device_link_remove()?
>
Because device_link_remove() will find the device_link of supplier and
consumer, then delete the device_link between them.
If device_link_add() failed, supplier and consumer won't create the
device_link.
So calling device_link_remove() won't do anything without deive_link
and won't bring any side effects.
Regards,
Jason-JH.Lin
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@lists.infradead.org
>
https://urldefense.com/v3/__http://lists.infradead.org/mailman/listinfo/linux-mediatek__;!!CTRNKA9wMg0ARbw!125dmOZ7xCLkwbIrzZf1VqVLQBbdT4RFHoMjR38U1GeCxaTM6xvvB-mSr7sTc6BuY5IH$
>
--
Jason-JH Lin <jason-jh.lin@mediatek.com>
next prev parent reply other threads:[~2021-11-28 15:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20211117064158.27451-1-jason-jh.lin@mediatek.com>
2021-11-18 5:54 ` Fix drm suspend and resume issue Tzung-Bi Shih
2021-11-28 14:52 ` Jason-JH Lin
[not found] ` <20211117064158.27451-2-jason-jh.lin@mediatek.com>
2021-11-18 5:55 ` [PATCH 1/3] mialbox: move cmdq suspend,resume and remove after cmdq_mbox_flush Tzung-Bi Shih
2021-11-28 14:50 ` Jason-JH Lin
[not found] ` <20211117064158.27451-4-jason-jh.lin@mediatek.com>
2021-11-18 5:55 ` [PATCH 3/3] drm/mediatek: add devlink to cmdq dev Tzung-Bi Shih
[not found] ` <PU1PR03MB306252A252139515F7EA9ABCB8659@PU1PR03MB3062.apcprd03.prod.outlook.com>
2021-11-28 15:57 ` Jason-JH Lin [this message]
2021-11-28 16:02 ` FW: " Jason-JH Lin
[not found] ` <20211117064158.27451-3-jason-jh.lin@mediatek.com>
2021-11-19 0:01 ` [PATCH 2/3] mailbox: add cmdq_mbox_flush to clear all task before suspend Chun-Kuang Hu
2021-11-28 15:40 ` Jason-JH Lin
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=ae29424d8121f8951cfb5fece114b6fcba90d351.camel@mediatek.com \
--to=jason-jh.lin@mediatek.com \
--cc=Nancy.Lin@mediatek.com \
--cc=Singo.Chang@mediatek.com \
--cc=airlied@linux.ie \
--cc=chunkuang.hu@kernel.org \
--cc=daniel@ffwll.ch \
--cc=jassisinghbrar@gmail.com \
--cc=matthias.bgg@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=tzungbi@google.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
all inboxes | Powered by JetHome®