Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3709461pxj; Mon, 7 Jun 2021 18:42:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTP7wiZ7UXzpK1TvfIw3H4LnyQdlfYC63thlv6QxXRrp6Jp67zEtYCNgjmN08zlJB2GIP/ X-Received: by 2002:a05:6402:11c8:: with SMTP id j8mr1095001edw.200.1623116525357; Mon, 07 Jun 2021 18:42:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623116525; cv=none; d=google.com; s=arc-20160816; b=zmZ1reNowM/JIPKpDLDtN9E+9LWFXfbszi+Ouyqz6YPrQAv13Nur26moFab+/gxxxD 9++6+zRrdOJMEVt+bC8AbJFdrfIWP3u9HtYo4oF5HcG4OtlS+ey1YdPvwdeBTTUWOW/q 50u3L1LSTrhsz/LbkndXY2PwbBPt43NfTVT6fsJqCb96qgsyNkD9sJuNZddJCTkJ0oXE iVBxRWKpBk1jkbp2tL0f7zFdjGwUUNui7v9ysRtGejD5PxZyEaJ/2c6UdbYwTOH8DCvG oBOBTzZEtjTK9VIzN4kOq2EzbW3ukLCNjvhAicYQXTgZ8jFwyItP6I6CeoXVsZJ9XC14 bRjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:cc:references:to:subject :from; bh=zbFNW5Zojbhib5jsm8Lz2seKRSQNY6tURcqrs3liVfU=; b=G6xq0DyVUNuyjSJXTIf0WvE6tFt+E9wXj9c/28am3K0NhpHvC4VJmUQZ2hApM7ONP2 7s9qOuTClqvzuLJThk+6n33p/RwuxN11etoJszIzlTuh6J3BgGz+/MqM/uhMIAkHoVwv 7k3mATD0WjWKIBt0mL2W2qSbVUGGpMLCuWKxpWf1caksc0y4aoJCj5msEfAhS2Fdj7tC QCL1BS2YOLrje9KBMPptesk0gdAmHk8PVLzdrXtlPSw/jpgHFutU5y6/HjZyBdMB1abY p4AqlPx9Yp6cnVUHjh4phyOddusElPW8wj21ZTqtjaM0gT7vEdx6Pw2p5ixrCcEqdVhq jlZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v7si14299566ejk.196.2021.06.07.18.41.42; Mon, 07 Jun 2021 18:42:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231181AbhFHBlv (ORCPT + 99 others); Mon, 7 Jun 2021 21:41:51 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:3459 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230239AbhFHBlu (ORCPT ); Mon, 7 Jun 2021 21:41:50 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4FzXsL5qBLz6wx0; Tue, 8 Jun 2021 09:36:54 +0800 (CST) Received: from dggpeml500012.china.huawei.com (7.185.36.15) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 8 Jun 2021 09:39:53 +0800 Received: from [10.67.103.212] (10.67.103.212) by dggpeml500012.china.huawei.com (7.185.36.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 8 Jun 2021 09:39:52 +0800 From: "yekai(A)" Subject: Re: [PATCH] uacce: add print information if not enable sva To: Greg KH References: <1622792769-28017-1-git-send-email-yekai13@huawei.com> CC: , , , , Message-ID: <3f1590c4-b9f1-18f5-370a-57d9707f38a0@huawei.com> Date: Tue, 8 Jun 2021 09:39:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.103.212] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500012.china.huawei.com (7.185.36.15) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/6/4 15:51, Greg KH wrote: > On Fri, Jun 04, 2021 at 03:46:09PM +0800, Kai Ye wrote: >> Add print information necessary if user not enable sva. >> >> Signed-off-by: Kai Ye >> --- >> drivers/misc/uacce/uacce.c | 11 +++++++++-- >> 1 file changed, 9 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c >> index bae18ef0..fe38af8 100644 >> --- a/drivers/misc/uacce/uacce.c >> +++ b/drivers/misc/uacce/uacce.c >> @@ -387,15 +387,22 @@ static void uacce_release(struct device *dev) >> >> static unsigned int uacce_enable_sva(struct device *parent, unsigned int flags) >> { >> + int ret; >> + >> if (!(flags & UACCE_DEV_SVA)) >> return flags; >> >> flags &= ~UACCE_DEV_SVA; >> >> - if (iommu_dev_enable_feature(parent, IOMMU_DEV_FEAT_IOPF)) >> + ret = iommu_dev_enable_feature(parent, IOMMU_DEV_FEAT_IOPF); >> + if (ret) { >> + dev_err(parent, "failed to enable IOPF feature! ret = %d\n", ret); > > Why is this needed? Has this ever happened in real life such that the > log message is now required? > > > >> return flags; >> + } >> >> - if (iommu_dev_enable_feature(parent, IOMMU_DEV_FEAT_SVA)) { >> + ret = iommu_dev_enable_feature(parent, IOMMU_DEV_FEAT_SVA); >> + if (ret) { >> + dev_err(parent, "failed to enable SVA feature! ret = %d\n", ret); > > Same here, does this happen in real systems? > > thanks, > > greg k-h > . > In a other debug version, the SVA feature failed to be enabled, and no related information was printed. we don't know the cause of the problem. Finally, Although, it's not the problem here. but we find that the sva enable function doesn't have debug information. Therefore, it is inconvenient to locate the fault. so i think the log message is required. thanks Kai