Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp53664pxa; Fri, 31 Jul 2020 06:25:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+TVGAhBrBjbVpG6cfFIx5aokAwrcTJ/hIUOmuKaEMKVc67eRlxivr2bb5Blf+UTlqA94f X-Received: by 2002:a17:906:25c4:: with SMTP id n4mr4024077ejb.3.1596201926802; Fri, 31 Jul 2020 06:25:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596201926; cv=none; d=google.com; s=arc-20160816; b=NLninAWgAnXy7SXUiG/DbbX7c0AHniPAiEtbyDyvUqtuIyKRo4KpDJzz1uTXNAtiNi REULd3mAyO0eIyxJXbD8GWZMuZdfNW7nOUAbXYK3M6tmTrACzXrubwdbdKVWnlGa7qTq uoOh8ZCjKZUalIyGWH/g9Dt/Az3XUdDLRzhzZZLoZyrRcnY8qgt5D3GXnlrKkIlIKKKk sn2sqvs7/YE5QzTfHPHgza0w138SjivrvqNgvYbZKzpJDL4Z5c2dbkFDUtCYMwVesrw8 Qzk9EwBe6BM/1nMTMv+sJ6jfgngpAF4kIPtSYb8+DOymNsFe5LvT3+lclmjClZTDY1VQ n/Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=rSVvaXBxgarze9t7hw4Ekx14aIbEp8AdN9YLpwvWUmk=; b=wLH77Q15Tq+BEq7OG0rJYz4qTaB2CVa5FvrDJ8QC7rTZOgzJgVuROk6zT/dtu+yfP4 fCNKSJKgK+izUc9Nhn3xtTXkI0tI8JvuZ+W0uLoiiSrsf5WNvhJTVmy29NHUQjSnbAQE 3aS40oIuyljYY6Ow/CNyqNaKVOA4VXIfq9vUN5eImyz6/BC+VTO5EGkWJIE1cg3eWJaV TRxf6Go5T+ckGqUUEaY4KP7jkRSApJT0TxN959qF259oA5sinQMnVdnJicuZEqNNhn5p bPEWjFnrKfgY/i7KxRsGnRXUaQx6ddpUj2hoEuARRt3dZbDUkGuyrRy8/yUO/p2Yqofj gtMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Le2hBFz8; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lo2si4781876ejb.709.2020.07.31.06.25.04; Fri, 31 Jul 2020 06:25:26 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Le2hBFz8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387429AbgGaNWW (ORCPT + 99 others); Fri, 31 Jul 2020 09:22:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:36982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387419AbgGaNWU (ORCPT ); Fri, 31 Jul 2020 09:22:20 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A496E21744; Fri, 31 Jul 2020 13:22:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596201740; bh=fSZT8j8Q56S+X8wVCP0FfOqs/yNJDKaYWLtqjNf+5kM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Le2hBFz8FZfk929djZVF90YdpLUaDO2LYKHKDoNNYI38z2Isfu3EXpllQ9gDpAEef LmIBmoHq9LxlDex2+0hsMssnIUcexmDjeTutM+V+DsxCQCdgLpAPRwosPHcj9jJPDz GtBwC47XzO6fXUT9A1v0EoltNY0QdDPWZpRLwkck= Date: Fri, 31 Jul 2020 15:22:07 +0200 From: Greg KH To: Dongdong Yang Cc: rjw@rjwysocki.net, viresh.kumar@linaro.org, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, linux-pm@vger.kernel.org, yangdongdong@xiaomi.com, tanggeliang@xiaomi.com, taojun@xiaomi.com, huangqiwu@xiaomi.com, rocking@linux.alibaba.com, fengwei@xiaomi.com, zhangguoquan@xiaomi.com, gulinghua@xiaomi.com, duhui@xiaomi.com Subject: Re: [PATCH v2] sched: Provide USF for the portable equipment. Message-ID: <20200731132207.GB1712190@kroah.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 31, 2020 at 08:46:30PM +0800, Dongdong Yang wrote: > --- /dev/null > +++ b/drivers/staging/fbsched/usf.c > @@ -0,0 +1,346 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (C) 2020 XiaoMi Inc. > + * Author: Yang Dongdong > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > + * See http://www.gnu.org/licenses/gpl-2.0.html for more details. Please remove the license "boilerplate" text as you have the SPDX line on top. > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define BOOST_MIN_V -100 > +#define BOOST_MAX_V 100 > +#define LEVEL_TOP 3 > + > +#define USF_TAG "[usf_sched]" > + > +DEFINE_PER_CPU(unsigned long[PID_MAX_LIMIT], task_hist_nivcsw); > + > +static struct { > + bool is_sched_usf_enabled; > + int enable_debug; > + int is_screen_on; > + struct kobject *kobj; A raw kobject? For a driver? are you _SURE_??? > + struct dentry *debugfs_entry; Why do you need this? > + usf_vdev.enable_debug = 0; > + usf_vdev.debugfs_entry = debugfs_create_file("usf_dbg", > + 0660, NULL, NULL, > + &usf_dbg_fops); > + if (!usf_vdev.debugfs_entry) > + pr_err("Failed to create usf_dbg!\n"); How can that value be NULL? There is no need to check debugfs functions for error values. But in this case, why are you writing a single file to the root of debugfs? Why not put it in a directory instead? That would be much nicer, don't you think? thanks, greg k-h