public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: robin.murphy@arm.com (Robin Murphy)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 1/2] iommu/arm-smmu-v3: Poll for CMD_SYNC outside cmdq lock
Date: Thu, 18 Oct 2018 12:19:51 +0100	[thread overview]
Message-ID: <535fd13d-4cc5-e551-01d9-f7eb05c3ddb0@arm.com> (raw)
In-Reply-To: <2c4e00a2-cd53-a6f5-8561-97379dcf9c02@huawei.com>

On 18/10/18 11:55, John Garry wrote:
[...]
>> @@ -976,18 +1019,19 @@ static int __arm_smmu_cmdq_issue_sync(struct 
>> arm_smmu_device *smmu)
>> ?{
>> ???? u64 cmd[CMDQ_ENT_DWORDS];
>> ???? unsigned long flags;
>> -??? bool wfe = !!(smmu->features & ARM_SMMU_FEAT_SEV);
>> ???? struct arm_smmu_cmdq_ent ent = { .opcode = CMDQ_OP_CMD_SYNC };
>> -??? int ret;
>> +??? int sync_idx, sync_gen;
>>
>> ???? arm_smmu_cmdq_build_cmd(cmd, &ent);
>>
>> ???? spin_lock_irqsave(&smmu->cmdq.lock, flags);
>> -??? arm_smmu_cmdq_insert_cmd(smmu, cmd);
>> -??? ret = queue_poll_cons(&smmu->cmdq.q, true, wfe);
>> +??? if (smmu->prev_cmd_opcode != CMDQ_OP_CMD_SYNC)
>> +??????? arm_smmu_cmdq_insert_cmd(smmu, cmd);
> 
> Hi Robin,
> 
> If we did stop rebuilding the non-MSI command as I suggested, then we 
> would not have the case of building the command and then discarding it, 
> right?

I suppose so. But that build/discard case can also be avoided by 
applying patch 2/2 of this series ;)

Robin.

> 
> Thanks,
> John
> 
>> +??? sync_idx = smmu->cmdq.q.prod;
>> +??? sync_gen = READ_ONCE(smmu->cmdq_generation);
>> ???? spin_unlock_irqrestore(&smmu->cmdq.lock, flags);
>>
>> -??? return ret;
>> +??? return arm_smmu_sync_poll_cons(smmu, sync_idx, sync_gen);
>> ?}
>>
>> ?static void arm_smmu_cmdq_issue_sync(struct arm_smmu_device *smmu)
>>
> 
> 

  reply	other threads:[~2018-10-18 11:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-17 13:56 [PATCH v5 1/2] iommu/arm-smmu-v3: Poll for CMD_SYNC outside cmdq lock Robin Murphy
2018-10-17 13:56 ` [PATCH v5 2/2] iommu/arm-smmu-v3: Reunify arm_smmu_cmdq_issue_sync() Robin Murphy
2018-10-17 14:38   ` John Garry
2018-10-18 11:18     ` Robin Murphy
2018-10-18 11:29       ` John Garry
2018-10-18  8:58   ` Andrew Murray
2018-10-22 12:29   ` John Garry
2018-10-18  8:56 ` [PATCH v5 1/2] iommu/arm-smmu-v3: Poll for CMD_SYNC outside cmdq lock Andrew Murray
2018-10-18 10:55 ` John Garry
2018-10-18 11:19   ` Robin Murphy [this message]
2018-10-18 11:48     ` John Garry
2018-10-19 14:30       ` John Garry

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=535fd13d-4cc5-e551-01d9-f7eb05c3ddb0@arm.com \
    --to=robin.murphy@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox