All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Rui <ray.huang-5C7GfCeVMHo@public.gmane.org>
To: Trigger Huang <trigger.huang-5C7GfCeVMHo@public.gmane.org>
Cc: "Yu, Xiangliang" <Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>,
	"Liu, Monk" <Monk.Liu-5C7GfCeVMHo@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH V2] drm/amdgpu: Destroy psp ring in hw_fini
Date: Thu, 20 Apr 2017 09:16:17 +0800	[thread overview]
Message-ID: <20170420011617.GB10961@hr-amur2> (raw)
In-Reply-To: <20170420005354.GA10961@hr-amur2>

On Thu, Apr 20, 2017 at 08:53:54AM +0800, Huang Rui wrote:
> On Tue, Apr 18, 2017 at 03:04:45PM +0800, Trigger Huang wrote:
> > +int psp_v3_1_ring_destroy(struct psp_context *psp, enum psp_ring_type
> > ring_type)
> > +{
> > +       int ret = 0;
> > +       struct psp_ring *ring;
> > +       unsigned int psp_ring_reg = 0;
> > +       struct amdgpu_device *adev = psp->adev;
> > +
> > +       ring = &psp->km_ring;
> > +
> > +       /* Write the ring destroy command to C2PMSG_64 */
> > +       psp_ring_reg = 3 << 16;
> > +       WREG32(SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_64), psp_ring_reg);
> > +
> > +       /* there might be handshake issue with hardware which needs delay */
> > +       mdelay(20);
> > +
> > +       /* Wait for response flag (bit 31) in C2PMSG_64 */
> > +       ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_64),
> > +                          0x80000000, 0x8000FFFF, false);
> > +
> 
> > +       if (ring->ring_mem)
> > +               amdgpu_bo_free_kernel(&adev->firmware.rbuf,
> > +                                     &ring->ring_mem_mc_addr,
> > +                                     (void **)&ring->ring_mem);
> 
> adev->firmware.rbuf is entired memory space for storing firmware data which
> inited by amdgpu_ucode_init_bo, and it already teared down via
> amdgpu_ucode_fini_bo. You cannot free it again.
> 

Trigger, I missed read fw_buf(inited by ucode_init) and rbuf, sorry. Yes,
it need free rbuf here. Please ignore above comments.
But you still need check the load_type before destory ring.

Thanks,
Rui
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  reply	other threads:[~2017-04-20  1:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18  7:04 [PATCH V2] drm/amdgpu: Destroy psp ring in hw_fini Trigger Huang
     [not found] ` <1492499085-27761-1-git-send-email-trigger.huang-5C7GfCeVMHo@public.gmane.org>
2017-04-19 11:33   ` Huang, Trigger
2017-04-19 19:18   ` Alex Deucher
     [not found]     ` <CADnq5_OqZ6U9T2q1KxVCJ1CmEHe6dqXr_mqafqJmtvdWHyiOiw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-20  4:18       ` Huang, Trigger
2017-04-20  0:53   ` Huang Rui
2017-04-20  1:16     ` Huang Rui [this message]
2017-04-20  4:17     ` Huang, Trigger

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=20170420011617.GB10961@hr-amur2 \
    --to=ray.huang-5c7gfcevmho@public.gmane.org \
    --cc=Monk.Liu-5C7GfCeVMHo@public.gmane.org \
    --cc=Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=trigger.huang-5C7GfCeVMHo@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 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.