Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp290826imw; Fri, 8 Jul 2022 03:05:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tg3nYYfK/Tz86aB8mpDOJ/eF9UgQRNOeF2qOWbRX1LX99fgAsqSdBEBDO7bxYtWUyETgwv X-Received: by 2002:a05:6a00:2314:b0:528:1b60:ab7f with SMTP id h20-20020a056a00231400b005281b60ab7fmr3025866pfh.11.1657274750986; Fri, 08 Jul 2022 03:05:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657274750; cv=none; d=google.com; s=arc-20160816; b=oAayDRDP2BJ0jeuk1ZgnfcG5N3rVw9v4S/rA9yTzAbOffcMTOtct4wshGGpwRxwB5l REiV7G5aIoVYjo6XQbAVpDnWrxP8O2Sx5pKE2poArJuOiLxUgKu6iSsY7mZa2ecxmhp0 4PnIcYLXztBWP1GYs0TWAfXR6uMvz+UcPubWdUZqxsvIMg//G2fqkq26mqWbazBHqNke ZQpjdoovx2oxT1Bt+g5aeoGWAnrca+yCrt4XsTEz7/UohxYnEPsO3qRBnWP7L3WwlFSE Tr/gbgRjMaxadL8SGbelBLjnMnah5P0Jir6ZMpzAcmIj3Dwgrg9CCtQeEIKSKApj+nn6 u6+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=isH1uffiW0KuP75pYacgsRye4OamXuXFkNdxxCW5apc=; b=l6gFK7/Ph1kpGFCH68JUnJYkyhj/zAq/VRhj2cHZDelkV9JennrnmGKcfM4bnd+7Uo uXbh6aBzhni5DLpZPJoegExEMvAkG392ZQMgWObnckyohVrhn/fAdkQOtiFg/hGgk392 LfXlk7XkQ45JBmrSytnAFMmhQxFU2SY9TGHT3MBlWehyltIzKAu8toeI5BtpWzYdv3CR i3PZ9U8UgZJaeka6IkpW2lWptQy20JB7e9btwfoVxRTF+yvef14MRRBiesK/7D7J3ky/ uvcG37VyvwitLGBkWP8U8TU+/yGxSJsHcEWWzpGc/0/vb5JxOfJHMtQL9XaoKEWXe20K 9dTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d0tsQlbI; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o20-20020a635d54000000b004127330fe23si13952276pgm.601.2022.07.08.03.05.22; Fri, 08 Jul 2022 03:05:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d0tsQlbI; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229627AbiGHKBj (ORCPT + 99 others); Fri, 8 Jul 2022 06:01:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237298AbiGHKBj (ORCPT ); Fri, 8 Jul 2022 06:01:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B0A683F1A; Fri, 8 Jul 2022 03:01:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C387462315; Fri, 8 Jul 2022 10:01:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCDCFC341C0; Fri, 8 Jul 2022 10:01:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657274497; bh=u/AQjMr5Y/sNit28VcEutT4SJmwx63rssPloTC1VMoU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d0tsQlbIUX8/3kqzit/yz68WvkkUKFPstytVPvt9WU6AbWoJZwHr32t+LSIKw0Rvd +SVubFy0CwYjtwk3eIuKGbnHpVkCcli5z0gZE/m1a9C0EjWNM/Z2IZloq9sJ8fjvqG k5c7QaOMHqvZQ4ShxhNYvZCzp5D1rRK5/FSTOfds= Date: Fri, 8 Jul 2022 12:01:34 +0200 From: Greg KH To: "yekai(A)" Cc: herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, wangzhou1@hisilicon.com Subject: Re: [PATCH v5 1/3] uacce: supports device isolation feature Message-ID: References: <20220708070820.43958-1-yekai13@huawei.com> <20220708070820.43958-2-yekai13@huawei.com> <288f82bf-ca0b-b049-4dcf-fd7b6a29607b@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <288f82bf-ca0b-b049-4dcf-fd7b6a29607b@huawei.com> X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, Jul 08, 2022 at 05:33:42PM +0800, yekai(A) wrote: > > > On 2022/7/8 15:28, Greg KH wrote: > > On Fri, Jul 08, 2022 at 03:08:18PM +0800, Kai Ye wrote: > > > UACCE adds the hardware error isolation API. Users can configure > > > the isolation frequency by this sysfs node. UACCE reports the device > > > isolate state to the user space. If the AER error frequency exceeds > > > the value of setting for a certain period of time, the device will be > > > isolated. > > > > > > Signed-off-by: Kai Ye > > > --- > > > drivers/misc/uacce/uacce.c | 55 ++++++++++++++++++++++++++++++++++++++ > > > include/linux/uacce.h | 11 ++++++++ > > > 2 files changed, 66 insertions(+) > > > > > > diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c > > > index 281c54003edc..d07b5f1f0596 100644 > > > --- a/drivers/misc/uacce/uacce.c > > > +++ b/drivers/misc/uacce/uacce.c > > > @@ -7,6 +7,8 @@ > > > #include > > > #include > > > > > > +#define MAX_ERR_ISOLATE_COUNT 65535 > > > + > > > static struct class *uacce_class; > > > static dev_t uacce_devt; > > > static DEFINE_MUTEX(uacce_mutex); > > > @@ -339,12 +341,63 @@ static ssize_t region_dus_size_show(struct device *dev, > > > uacce->qf_pg_num[UACCE_QFRT_DUS] << PAGE_SHIFT); > > > } > > > > > > +static ssize_t isolate_show(struct device *dev, > > > + struct device_attribute *attr, char *buf) > > > +{ > > > + struct uacce_device *uacce = to_uacce_device(dev); > > > + > > > + if (!uacce->ops->get_isolate_state) > > > + return -ENODEV; > > > > If there is no callback, why is this sysfs even created at all? Please > > do not create it if it can not be accessed. > > > > Use the is_visable() callback for the group to do this. > > > > If is_visable() is used as the judgment, all uacce device nodes cannot be > registered if there is no callback by test. I am sorry, I do not understand. That callback is to be used for this type of thing, and works for lots of driver subsystems. Why exactly will it not work here as well? thanks, greg k-h