Re: [PATCHv6 3/3] iommu: arm-smmu-impl: Add sdm845 implementation hook

From: Stephen Boyd
Date: Wed Sep 18 2019 - 20:55:13 EST


Quoting Bjorn Andersson (2019-09-18 17:25:01)
> On Tue 17 Sep 02:45 PDT 2019, Sai Prakash Ranjan wrote:
>
> > From: Vivek Gautam <vivek.gautam@xxxxxxxxxxxxxx>
> >
> > There are other boards such as cheza whose bootloaders don't enable this
> > logic. Such boards don't implement callbacks to handle the specific SCM
> > call so disabling this logic for such boards will be a no-op.
> >
[...]
> > diff --git a/drivers/iommu/arm-smmu-qcom.c b/drivers/iommu/arm-smmu-qcom.c
> > new file mode 100644
> > index 000000000000..24c071c1d8b0
> > --- /dev/null
> > +++ b/drivers/iommu/arm-smmu-qcom.c
> > @@ -0,0 +1,51 @@
> > +// SPDX-License-Identifier: GPL-2.0-only
> > +/*
> > + * Copyright (c) 2019, The Linux Foundation. All rights reserved.
> > + */
> > +
> > +#include <linux/qcom_scm.h>
> > +
> > +#include "arm-smmu.h"
> > +
> > +struct qcom_smmu {
> > + struct arm_smmu_device smmu;
> > +};
> > +
> > +static int qcom_sdm845_smmu500_reset(struct arm_smmu_device *smmu)
> > +{
> > + int ret;
> > +
> > + arm_mmu500_reset(smmu);
> > +
> > + /*
> > + * To address performance degradation in non-real time clients,
> > + * such as USB and UFS, turn off wait-for-safe on sdm845 based boards,
> > + * such as MTP and db845, whose firmwares implement secure monitor
> > + * call handlers to turn on/off the wait-for-safe logic.
> > + */
> > + ret = qcom_scm_qsmmu500_wait_safe_toggle(0);
>
> In the transition to this new design we lost the ability to
> enable/disable the safe toggle per board, which according to Vivek
> would result in some issue with Cheza.
>
> Can you confirm that this is okay? (Or introduce the DT property for
> enabling the safe_toggle logic?)
>

I can test this on Cheza. Not sure if anything will happen but it's
worth a shot.