linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [Bisected] [commit 2ad56efa80dba89162106c06ebc00b611325e584] [linux-next] WARNING while booting to kernel 6.6.0-rc3-next-20230929
       [not found] <d06cee81-c47f-9d62-dfc6-4c77b60058db@linux.vnet.ibm.com>
@ 2023-10-04 11:38 ` Jason Gunthorpe
  2023-10-04 14:11   ` Tasmiya Nalatwad
  0 siblings, 1 reply; 2+ messages in thread
From: Jason Gunthorpe @ 2023-10-04 11:38 UTC (permalink / raw)
  To: Tasmiya Nalatwad
  Cc: linux-kernel, linux-next, baolu.lu, jsnitsel, jroedel, mpe,
	npiggin, christophe.leroy, gregkh, gbatra, ruscur, linuxppc-dev,
	abdhalee, mputtash, sachinp

On Wed, Oct 04, 2023 at 04:37:10PM +0530, Tasmiya Nalatwad wrote:
>    Greetings,
> 
>    [linux-next] [6.6.0-rc3-next-20230929] [git bisect ->
>    2ad56efa80dba89162106c06ebc00b611325e584]WARNING: CPU: 0 PID: 8 at
>    arch/powerpc/kernel/[1]iommu.c:407 __iommu_free+0x1e4/0x1f0
 
>    gitbisect is pointing to the below commit
>    commit 2ad56efa80dba89162106c06ebc00b611325e584
>        powerpc/iommu: Setup a default domain and remove set_platform_dma_ops
 
I assume this means there are still sequencing problems with power at
boot time. eg we turned on the dma ops in the wrong order or something
like that

As far as I can see the only difference here is that we do the
operation to claim dma ops during the iommu drive probe. We can avoid that.

Does this work for you?

diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index d6ad3fde85a212..115b9031badac7 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -1280,13 +1280,19 @@ struct iommu_table_group_ops spapr_tce_table_group_ops = {
 /*
  * A simple iommu_ops to allow less cruft in generic VFIO code.
  */
-static int spapr_tce_platform_iommu_attach_dev(struct iommu_domain *dom,
-					       struct device *dev)
+static int
+spapr_tce_platform_iommu_attach_dev(struct iommu_domain *platform_domain,
+				    struct device *dev)
 {
+	struct iommu_domain *domain = iommu_get_domain_for_dev(dev);
 	struct iommu_group *grp = iommu_group_get(dev);
 	struct iommu_table_group *table_group;
 	int ret = -EINVAL;
 
+	/* At first attach the ownership is already set */
+	if (!domain)
+		return 0;
+
 	if (!grp)
 		return -ENODEV;
 


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Bisected] [commit 2ad56efa80dba89162106c06ebc00b611325e584] [linux-next] WARNING while booting to kernel 6.6.0-rc3-next-20230929
  2023-10-04 11:38 ` [Bisected] [commit 2ad56efa80dba89162106c06ebc00b611325e584] [linux-next] WARNING while booting to kernel 6.6.0-rc3-next-20230929 Jason Gunthorpe
@ 2023-10-04 14:11   ` Tasmiya Nalatwad
  0 siblings, 0 replies; 2+ messages in thread
From: Tasmiya Nalatwad @ 2023-10-04 14:11 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: linux-kernel, linux-next, baolu.lu, jsnitsel, jroedel, mpe,
	npiggin, christophe.leroy, gregkh, gbatra, ruscur, linuxppc-dev,
	abdhalee, mputtash, sachinp

Thanks Jason. Yes the suggested changes works and Warnings are not seen.

On 10/4/23 17:08, Jason Gunthorpe wrote:
> On Wed, Oct 04, 2023 at 04:37:10PM +0530, Tasmiya Nalatwad wrote:
>>     Greetings,
>>
>>     [linux-next] [6.6.0-rc3-next-20230929] [git bisect ->
>>     2ad56efa80dba89162106c06ebc00b611325e584]WARNING: CPU: 0 PID: 8 at
>>     arch/powerpc/kernel/[1]iommu.c:407 __iommu_free+0x1e4/0x1f0
>>     gitbisect is pointing to the below commit
>>     commit 2ad56efa80dba89162106c06ebc00b611325e584
>>         powerpc/iommu: Setup a default domain and remove set_platform_dma_ops
> I assume this means there are still sequencing problems with power at
> boot time. eg we turned on the dma ops in the wrong order or something
> like that
>
> As far as I can see the only difference here is that we do the
> operation to claim dma ops during the iommu drive probe. We can avoid that.
>
> Does this work for you?
>
> diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
> index d6ad3fde85a212..115b9031badac7 100644
> --- a/arch/powerpc/kernel/iommu.c
> +++ b/arch/powerpc/kernel/iommu.c
> @@ -1280,13 +1280,19 @@ struct iommu_table_group_ops spapr_tce_table_group_ops = {
>   /*
>    * A simple iommu_ops to allow less cruft in generic VFIO code.
>    */
> -static int spapr_tce_platform_iommu_attach_dev(struct iommu_domain *dom,
> -					       struct device *dev)
> +static int
> +spapr_tce_platform_iommu_attach_dev(struct iommu_domain *platform_domain,
> +				    struct device *dev)
>   {
> +	struct iommu_domain *domain = iommu_get_domain_for_dev(dev);
>   	struct iommu_group *grp = iommu_group_get(dev);
>   	struct iommu_table_group *table_group;
>   	int ret = -EINVAL;
>
> +	/* At first attach the ownership is already set */
> +	if (!domain)
> +		return 0;
> +
>   	if (!grp)
>   		return -ENODEV;
>
>
-- 
Regards,
Tasmiya Nalatwad
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-04 14:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <d06cee81-c47f-9d62-dfc6-4c77b60058db@linux.vnet.ibm.com>
2023-10-04 11:38 ` [Bisected] [commit 2ad56efa80dba89162106c06ebc00b611325e584] [linux-next] WARNING while booting to kernel 6.6.0-rc3-next-20230929 Jason Gunthorpe
2023-10-04 14:11   ` Tasmiya Nalatwad

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).