From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Luis R. Rodriguez" Subject: Re: [RFT v2] iommu/amd: use subsys_initcall() on amdv2 iommu Date: Sun, 17 Apr 2016 23:55:45 -0700 Message-ID: References: <20160316171719.GE2195@8bytes.org> <1459273313-5139-1-git-send-email-mcgrof@kernel.org> <570BA694.8040900@amd.com> <570BAC2B.4090508@amd.com> <20160412220715.GL1990@wotan.suse.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1907045455101721765==" Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Oded Gabbay Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, christian.koenig-5C7GfCeVMHo@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: iommu@lists.linux-foundation.org --===============1907045455101721765== Content-Type: multipart/alternative; boundary=001a1149039093a1670530bcd9dc --001a1149039093a1670530bcd9dc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Apr 18, 2016 7:48 AM, "Oded Gabbay" wrote: > > On Wed, Apr 13, 2016 at 1:07 AM, Luis R. Rodriguez wrote: > > On Mon, Apr 11, 2016 at 03:52:43PM +0200, Christian K=C3=B6nig wrote: > >> Am 11.04.2016 um 15:39 schrieb Oded Gabbay: > >> >On Mon, Apr 11, 2016 at 4:28 PM, Christian K=C3=B6nig > >> > wrote: > >> >>Am 09.04.2016 um 02:25 schrieb Luis R. Rodriguez: > >> >>>On Tue, Mar 29, 2016 at 10:41 AM, Luis R. Rodriguez < mcgrof-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote: > >> >>>>We need to ensure amd iommu v2 initializes before > >> >>>>driver uses such as drivers/gpu/drm/amd/amdkfd/kfd_module.c, > >> >>>>to do this make its init routine a subsys_initcall() which > >> >>>>ensures its load init is called first than modules when > >> >>>>built-in. > >> >>>> > >> >>>>This reverts the old work around implemented through commit > >> >>>>1bacc894c227fad8a7 ("drivers: Move iommu/ before gpu/ in Makefile"), > >> >>>>instead of making the dependency implicit by linker order this > >> >>>>makes the ordering requirement explicit through proper kernel > >> >>>>APIs. > >> >>>> > >> >>>>Cc: Oded Gabbay > >> >>>>Cc: Christian K=C3=B6nig > >> >>>>Signed-off-by: Luis R. Rodriguez > >> >> > >> >>Sorry for not responding earlier. Just coming back to all the stuff on my TODO list. > >> >> > >> >>Patch is Acked-by: Christian K=C3=B6nig > >> > > >> >Christian, > >> >Just wanted to be sure if you tested this patch-set or not. > >> > >> I did NOT tested it. If AMD IOMMU requires something which will now > >> initialize after the IOMMU module we will obviously run into trouble > >> again. > >> > >> I assumed that the creator of the patch did some testing. > > > > Nope, hence [RTF] Request For Testing. > > > >> >I don't think it should be merged without testing. If you already > >> >tested it than fine. If not, I think I can do it in the next week or > >> >so (just came back from PTO). > >> > >> Yeah, agree totally. > > > > Agreed, please let me know if someone is able to test and confirm > > this works. It should work. > > > > Luis > > Hi, > So I finally got to test this patch and it's not working. > The reason is that AMD IOMMUv2 gets initialized *before* AMD IOMMUv1 driver ! Thanks can you try using late_initcall() instead then? Luis --001a1149039093a1670530bcd9dc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Apr 18, 2016 7:48 AM, "Oded Gabbay" <oded.gabbay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> On Wed, Apr 13, 2016 at 1:07 AM, Luis R. Rodriguez <mcgrof-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> > On Mon, Apr 11, 2016 at 03:52:43PM +0200, Christian K=C3=B6nig wr= ote:
> >> Am 11.04.2016 um 15:39 schrieb Oded Gabbay:
> >> >On Mon, Apr 11, 2016 at 4:28 PM, Christian K=C3=B6nig
> >> ><christian= .koenig-5C7GfCeVMHo@public.gmane.org> wrote:
> >> >>Am 09.04.2016 um 02:25 schrieb Luis R. Rodriguez:
> >> >>>On Tue, Mar 29, 2016 at 10:41 AM, Luis R. Rodrigu= ez <mcgrof-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote= :
> >> >>>>We need to ensure amd iommu v2 initializes be= fore
> >> >>>>driver uses such as drivers/gpu/drm/amd/amdkf= d/kfd_module.c,
> >> >>>>to do this make its init routine a subsys_ini= tcall() which
> >> >>>>ensures its load init is called first than mo= dules when
> >> >>>>built-in.
> >> >>>>
> >> >>>>This reverts the old work around implemented = through commit
> >> >>>>1bacc894c227fad8a7 ("drivers: Move iommu= / before gpu/ in Makefile"),
> >> >>>>instead of making the dependency implicit by = linker order this
> >> >>>>makes the ordering requirement explicit throu= gh proper kernel
> >> >>>>APIs.
> >> >>>>
> >> >>>>Cc: Oded Gabbay <oded.gabbay-5C7GfCeVMHo@public.gmane.org>
> >> >>>>Cc: Christian K=C3=B6nig <christian.koenig-5C7GfCeVMHo@public.gmane.org>
> >> >>>>Signed-off-by: Luis R. Rodriguez <mcgrof-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> >> >>
> >> >>Sorry for not responding earlier. Just coming back to= all the stuff on my TODO list.
> >> >>
> >> >>Patch is Acked-by: Christian K=C3=B6nig <christian.koenig-5C7GfCeVMHo@public.gmane.org>
> >> >
> >> >Christian,
> >> >Just wanted to be sure if you tested this patch-set or no= t.
> >>
> >> I did NOT tested it. If AMD IOMMU requires something which wi= ll now
> >> initialize after the IOMMU module we will obviously run into = trouble
> >> again.
> >>
> >> I assumed that the creator of the patch did some testing.
> >
> > Nope, hence [RTF] Request For Testing.
> >
> >> >I don't think it should be merged without testing. If= you already
> >> >tested it than fine. If not, I think I can do it in the n= ext week or
> >> >so (just came back from PTO).
> >>
> >> Yeah, agree totally.
> >
> > Agreed, please let me know if someone is able to test and confirm=
> > this works. It should work.
> >
> >=C2=A0 =C2=A0Luis
>
> Hi,
> So I finally got to test this patch and it's not working.
> The reason is that AMD IOMMUv2 gets initialized *before* AMD IOMMUv1 d= river !

Thanks can you try using late_initcall() instead then?

=C2=A0 Luis

--001a1149039093a1670530bcd9dc-- --===============1907045455101721765== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============1907045455101721765==--