Received: by 10.223.148.5 with SMTP id 5csp7510231wrq; Thu, 18 Jan 2018 06:23:56 -0800 (PST) X-Google-Smtp-Source: ACJfBovSqf1q0hxn44q97ZkyS83zeKb+Nt8YO/NlFXSSGDDj5DXYmhvC4ajftoxBLqd2UUslJvyF X-Received: by 10.99.129.199 with SMTP id t190mr14750934pgd.120.1516285436770; Thu, 18 Jan 2018 06:23:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516285436; cv=none; d=google.com; s=arc-20160816; b=oTHOWVxJaJmJCJzT7EN6ABu0MK2Gb/zSJztuAHHYybYqnzzK00yUlxd6Y9IkXYmp38 RQfoBy3SxAVFaRGc5TIcjxtmUyNvjIaPTPRBkVr4YggEJ6RPbVjuVFSuHRT+C487m4iD oWSIlQ6JOuNkCs+kvqNPs1Fh1E2rO3t24ho8kJRYyM+rYAtxF6jL15l0+cr3sOYf6KFt Tgco/x7LtvEF2Ht8fviYE4cUFaLOxJdL5bZx3W71BHoSIkf9gfPO7lMwZbimTYI8Ony7 anCG9iE4sIzrHC4lDkZ4PM/wIj+P+vrymrhzYcSq9sGaTVlclui7K3AEUYidjKBMAi13 FuqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id:arc-authentication-results; bh=nbvNhjcZL2wKPatNlDn19ny4N2UR4n32yToIRMJkZTg=; b=0nK704kh/3iSgRRmot3y9Z2u5mN/kAAg+5YeeS6lQA303uT7f87Q3XqeJDohoPpwSh ZD+La8dgIImtfNIyD20bJZt6+dXdNLjCam/bmSaEi2IQ1PvAtG3QB/rJaXrtaXutXT3h zKvcdbTWsf8FpQoIAsc3hsYgGtdWvevZF9UHV1hhgXFDGtjFNBSqWj1lfLJkxE/AK8Ba uL8AVS2j5XTl1YjSbknnfttBwrJvpmyjImiWATFe2NCvkMAf1o57MyxJT+eGxCfPKgdP aiZZwIsibzzv1loKIjyW1xzwOJZFgRGs7oGaRe5zFDdwE0WLOcCHmBmxUhKkrKEnb/n+ 91Tg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z6si6072996pge.270.2018.01.18.06.23.42; Thu, 18 Jan 2018 06:23:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756478AbeAROXI (ORCPT + 99 others); Thu, 18 Jan 2018 09:23:08 -0500 Received: from regular1.263xmail.com ([211.150.99.134]:42297 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756215AbeAROXH (ORCPT ); Thu, 18 Jan 2018 09:23:07 -0500 Received: from jeffy.chen?rock-chips.com (unknown [192.168.167.192]) by regular1.263xmail.com (Postfix) with ESMTP id 9CD27911C; Thu, 18 Jan 2018 22:23:00 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from [172.16.22.190] (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id 5AA8B39F; Thu, 18 Jan 2018 22:22:55 +0800 (CST) X-RL-SENDER: jeffy.chen@rock-chips.com X-FST-TO: robin.murphy@arm.com X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: jeffy.chen@rock-chips.com X-UNIQUE-TAG: <4a6aa7cfc8aa6065f0b9d99b226728a8> X-ATTACHMENT-NUM: 0 X-SENDER: cjf@rock-chips.com X-DNS-TYPE: 0 Received: from [172.16.22.190] (unknown [103.29.142.67]) by smtp.263.net (Postfix) whith ESMTP id 21349FYPE4V; Thu, 18 Jan 2018 22:23:02 +0800 (CST) Message-ID: <5A60ADBD.4050303@rock-chips.com> Date: Thu, 18 Jan 2018 22:22:53 +0800 From: JeffyChen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20130126 Thunderbird/19.0 MIME-Version: 1.0 To: Robin Murphy , linux-kernel@vger.kernel.org CC: jcliang@chromium.org, xxm@rock-chips.com, tfiga@chromium.org, Heiko Stuebner , linux-rockchip@lists.infradead.org, iommu@lists.linux-foundation.org, Joerg Roedel , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 04/13] iommu/rockchip: Fix error handling in attach References: <20180118115251.5542-1-jeffy.chen@rock-chips.com> <20180118115251.5542-5-jeffy.chen@rock-chips.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Robin, On 01/18/2018 09:23 PM, Robin Murphy wrote: >> >> @@ -837,7 +837,7 @@ static int rk_iommu_attach_device(struct >> iommu_domain *domain, >> ret = rk_iommu_enable_paging(iommu); >> if (ret) >> - return ret; >> + goto err_disable_stall; >> spin_lock_irqsave(&rk_domain->iommus_lock, flags); >> list_add_tail(&iommu->node, &rk_domain->iommus); >> @@ -848,6 +848,11 @@ static int rk_iommu_attach_device(struct >> iommu_domain *domain, >> rk_iommu_disable_stall(iommu); >> return 0; > > Nit: if you like, it looks reasonable to name the label > "out_disable_stall" and remove these lines above here, to save the > duplication between the error and success paths (since ret will already > be 0 on the latter). > right, i think so, will do it in the next version. > Either way, > > Reviewed-by: Robin Murphy