From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DA9AECE58E for ; Wed, 9 Oct 2019 10:10:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4C2B0206C0 for ; Wed, 9 Oct 2019 10:10:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RtHZ8yfm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C2B0206C0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gyn8Ii9x6eOuRcOybK7Ifs1D1eUV2bdIk0IMN4PNcXs=; b=RtHZ8yfmPno4u9hrcg0n0AP9Q rhB61KBG6K0MUAJX0hfdAMGmviWZtUeWWyngldX3Hb+zltw2AkY1BG95Cz0Prgq7+KtoWkG5gt2xh UNjivO1+yPIHKzbF+5cOWs7qQ7yDMJQDKB9jaW7J0Jo+v9zARUiFvkeOv1BMm51Z+T0YbWDrIy6Ck M6evZyW7BGOH/+3BXMRzjOw8PuGTxYuDVpHbFSvXzNof2m1hI321TKPLdQmzU7CGRE5Crfo0HrCBG 9CBAeFu/4n3dT6hB3Q2eZTdgmDMiUXadzRpaaUn7/0tNrjd83UIlP84XNJv/9zibafyLUAQb003xM LTGiKN8UA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iI8vb-00063S-Px; Wed, 09 Oct 2019 10:10:43 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iI8vY-00062x-U2 for linux-arm-kernel@lists.infradead.org; Wed, 09 Oct 2019 10:10:42 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 56F3F28; Wed, 9 Oct 2019 03:10:40 -0700 (PDT) Received: from [192.168.1.124] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EA2923F68E; Wed, 9 Oct 2019 03:10:38 -0700 (PDT) Subject: Re: [PATCH v2] iommu/arm-smmu: fix "hang" when games exit To: Rob Clark , iommu@lists.linux-foundation.org References: <418d8426-f299-1269-2b2e-f86677cf22c2@arm.com> <20191007204906.19571-1-robdclark@gmail.com> From: Robin Murphy Message-ID: Date: Wed, 9 Oct 2019 11:10:33 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20191007204906.19571-1-robdclark@gmail.com> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191009_031041_013700_FAF00B21 X-CRM114-Status: GOOD ( 20.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Clark , freedreno@lists.freedesktop.org, Joerg Roedel , open list , Will Deacon , "moderated list:ARM SMMU DRIVERS" Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2019-10-07 9:49 pm, Rob Clark wrote: > From: Rob Clark > > When games, browser, or anything using a lot of GPU buffers exits, there > can be many hundreds or thousands of buffers to unmap and free. If the > GPU is otherwise suspended, this can cause arm-smmu to resume/suspend > for each buffer, resulting 5-10 seconds worth of reprogramming the > context bank (arm_smmu_write_context_bank()/arm_smmu_write_s2cr()/etc). > To the user it would appear that the system just locked up. > > A simple solution is to use pm_runtime_put_autosuspend() instead, so we > don't immediately suspend the SMMU device. Reviewed-by: Robin Murphy > Signed-off-by: Rob Clark > --- > v1: original > v2: unconditionally use autosuspend, rather than deciding based on what > consumer does > > drivers/iommu/arm-smmu.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c > index 3f1d55fb43c4..b7b41f5001bc 100644 > --- a/drivers/iommu/arm-smmu.c > +++ b/drivers/iommu/arm-smmu.c > @@ -289,7 +289,7 @@ static inline int arm_smmu_rpm_get(struct arm_smmu_device *smmu) > static inline void arm_smmu_rpm_put(struct arm_smmu_device *smmu) > { > if (pm_runtime_enabled(smmu->dev)) > - pm_runtime_put(smmu->dev); > + pm_runtime_put_autosuspend(smmu->dev); > } > > static struct arm_smmu_domain *to_smmu_domain(struct iommu_domain *dom) > @@ -1445,6 +1445,9 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev) > /* Looks ok, so add the device to the domain */ > ret = arm_smmu_domain_add_master(smmu_domain, fwspec); > > + pm_runtime_set_autosuspend_delay(smmu->dev, 20); > + pm_runtime_use_autosuspend(smmu->dev); > + > rpm_put: > arm_smmu_rpm_put(smmu); > return ret; > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel