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=-9.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 62273C4742C for ; Fri, 30 Oct 2020 09:52:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 EAD372072C for ; Fri, 30 Oct 2020 09:52:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EAD372072C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2EEDA6ED29; Fri, 30 Oct 2020 09:52:53 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 654F56ED29; Fri, 30 Oct 2020 09:52:52 +0000 (UTC) IronPort-SDR: uiPkneK2UVFV2Ry18q8iPcABYOHPMzB7a+MYmz/+hAnUcKwvt/EzYXrVvO0LoPH9JgR/hs7wTX 7QbIyJgq1eGg== X-IronPort-AV: E=McAfee;i="6000,8403,9789"; a="168714896" X-IronPort-AV: E=Sophos;i="5.77,432,1596524400"; d="scan'208";a="168714896" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2020 02:52:51 -0700 IronPort-SDR: GAZHBb/NZ1aCxlqH/DTr6Gb2F06UdOtZdHy8Yb4FqYGhRIS38jMy9DVb8F5wJFhER+dmOJqmbN pgplGxfz3DBA== X-IronPort-AV: E=Sophos;i="5.77,432,1596524400"; d="scan'208";a="537011039" Received: from gcobrien-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.22.113]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2020 02:52:46 -0700 From: Jani Nikula To: Deepak R Varma , outreachy-kernel@googlegroups.com, Zhenyu Wang , Zhi Wang , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org In-Reply-To: <20201030032945.GA274850@my--box> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20201030032945.GA274850@my--box> Date: Fri, 30 Oct 2020 11:52:42 +0200 Message-ID: <87y2joghw5.fsf@intel.com> MIME-Version: 1.0 Subject: Re: [Intel-gfx] [PATCH] drm/i915/gvt: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: melissa.srw@gmail.com, daniel.vetter@ffwll.ch, mh12gx2825@gmail.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Fri, 30 Oct 2020, Deepak R Varma wrote: > Using DEFINE_DEBUGFS_ATTRIBUTE macro with debugfs_create_file_unsafe() > function in place of the debugfs_create_file() function will make the > file operation struct "reset" aware of the file's lifetime. Additional > details here: https://lists.archive.carbon60.com/linux/kernel/2369498 Please describe what the functional impact is in the commit message. I don't understand what 'make the file operation struct "reset" aware of the file's lifetime' means here. For referencing LKML posts, please prefer https://lore.kernel.org/. For referencing commits already in the kernel, please prefer the format c64688081490 ("debugfs: add support for self-protecting attribute file fops"). BR, Jani. > > Issue reported by Coccinelle script: > scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci > > Signed-off-by: Deepak R Varma > --- > Please Note: This is a Outreachy project task patch. > > drivers/gpu/drm/i915/gvt/debugfs.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/i915/gvt/debugfs.c b/drivers/gpu/drm/i915/gvt/debugfs.c > index 62e6a14ad58e..18adfa2d5f5b 100644 > --- a/drivers/gpu/drm/i915/gvt/debugfs.c > +++ b/drivers/gpu/drm/i915/gvt/debugfs.c > @@ -147,9 +147,8 @@ vgpu_scan_nonprivbb_set(void *data, u64 val) > return 0; > } > > -DEFINE_SIMPLE_ATTRIBUTE(vgpu_scan_nonprivbb_fops, > - vgpu_scan_nonprivbb_get, vgpu_scan_nonprivbb_set, > - "0x%llx\n"); > +DEFINE_DEBUGFS_ATTRIBUTE(vgpu_scan_nonprivbb_fops, vgpu_scan_nonprivbb_get, > + vgpu_scan_nonprivbb_set, "0x%llx\n"); > > /** > * intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU > @@ -165,8 +164,8 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu) > debugfs_create_bool("active", 0444, vgpu->debugfs, &vgpu->active); > debugfs_create_file("mmio_diff", 0444, vgpu->debugfs, vgpu, > &vgpu_mmio_diff_fops); > - debugfs_create_file("scan_nonprivbb", 0644, vgpu->debugfs, vgpu, > - &vgpu_scan_nonprivbb_fops); > + debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu, > + &vgpu_scan_nonprivbb_fops); > } > > /** -- Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6889250356687011840 X-Received: by 2002:a17:902:a517:b029:d5:d09d:f319 with SMTP id s23-20020a170902a517b02900d5d09df319mr8399419plq.15.1604051574364; Fri, 30 Oct 2020 02:52:54 -0700 (PDT) X-BeenThere: outreachy-kernel@googlegroups.com Received: by 2002:a17:90a:3e45:: with SMTP id t5ls1679257pjm.2.gmail; Fri, 30 Oct 2020 02:52:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYCQhVSyAaCKlSLUOpmCjT+ta/zN9fij6vLBfqY+nMGeLKcUtUIahoXRccvEQwedYUzCdF X-Received: by 2002:a17:90a:a4c9:: with SMTP id l9mr1736789pjw.203.1604051572643; Fri, 30 Oct 2020 02:52:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604051572; cv=none; d=google.com; s=arc-20160816; b=VoyzPlolzPVkxLZFnqJe2kK8MJa/XFlP7+S8fz1P96fAFBboZ7kZA48l+A2HY18gWC HWih9063ZIUupFeqo6l3tn8XLi+rxsElIKljveDC4+P401EOup1WAMnQBjVXQs0HhFTD eEpfmEs3JZhbPgJbfGAvwJaP+nwjHtMS9mI290F8bS87EmvCuU97Hzb3moJXhtFjTyQZ 64oYvLlt3bRqJXd/s/0auRl5OIwGxAcGOTY67Ryey0Igc0DZr1XnjzROeljhKqnXW1vo oj/ZzX0zPVAXXXmkoJUYqu+I9avXLQ5BYuW50tdv8lp9Cv8BUS8vdaf1+ViSdtPCqbsq tkcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:references:organization:in-reply-to :subject:cc:to:from:ironport-sdr:ironport-sdr; bh=j6+O7wialihm7+GvxoLEszSsT6KYjIk98NXE9JiuQSM=; b=wBn0yKLU+KB0LomxRQ+6C2VA9j//G5IU3NjLV6i83WRU7ZwN3Gs4DgU7k3p47YEIG3 fEiuOosiynRWEOMpSDyzj7UGLbb10wPf+GBcuzE/L4sayL0ExNm5sSV0e7oJsFGyd2bW HjlhdxV9g2cUXsU3oGkD4R78kjfwDZj1EuUsMsbK65IyS+0sW5WXxsN3erAMoGk3iaYz LjpWXzthm6Xz6RlByACaLFeP4mYBHoBV/ln40Y808vW0PXxLILOFPuB6NOXlHL84sQig nbKdvxiTsJxPgwI2IcDCAl7rEdH2+f5Pb080qgr/Kskeu2hGXmxE2sjgfMlABOu4o9Ov o/iw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jani.nikula@intel.com designates 192.55.52.88 as permitted sender) smtp.mailfrom=jani.nikula@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from mga01.intel.com (mga01.intel.com. [192.55.52.88]) by gmr-mx.google.com with ESMTPS id f189si343926pgc.4.2020.10.30.02.52.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Oct 2020 02:52:52 -0700 (PDT) Received-SPF: pass (google.com: domain of jani.nikula@intel.com designates 192.55.52.88 as permitted sender) client-ip=192.55.52.88; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jani.nikula@intel.com designates 192.55.52.88 as permitted sender) smtp.mailfrom=jani.nikula@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com IronPort-SDR: mot5EfqiUInbjut6EQGuVBGl4sCAMoP8niD9ufqjtZF6d96xCFCmxjtnbSdumJj+cOaRoYj8ED rs6q2pyScBlw== X-IronPort-AV: E=McAfee;i="6000,8403,9789"; a="186389237" X-IronPort-AV: E=Sophos;i="5.77,432,1596524400"; d="scan'208";a="186389237" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2020 02:52:51 -0700 IronPort-SDR: GAZHBb/NZ1aCxlqH/DTr6Gb2F06UdOtZdHy8Yb4FqYGhRIS38jMy9DVb8F5wJFhER+dmOJqmbN pgplGxfz3DBA== X-IronPort-AV: E=Sophos;i="5.77,432,1596524400"; d="scan'208";a="537011039" Received: from gcobrien-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.22.113]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2020 02:52:46 -0700 From: Jani Nikula To: Deepak R Varma , outreachy-kernel@googlegroups.com, Zhenyu Wang , Zhi Wang , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: mh12gx2825@gmail.com, melissa.srw@gmail.com, daniel.vetter@ffwll.ch Subject: Re: [PATCH] drm/i915/gvt: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe() In-Reply-To: <20201030032945.GA274850@my--box> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20201030032945.GA274850@my--box> Date: Fri, 30 Oct 2020 11:52:42 +0200 Message-ID: <87y2joghw5.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain On Fri, 30 Oct 2020, Deepak R Varma wrote: > Using DEFINE_DEBUGFS_ATTRIBUTE macro with debugfs_create_file_unsafe() > function in place of the debugfs_create_file() function will make the > file operation struct "reset" aware of the file's lifetime. Additional > details here: https://lists.archive.carbon60.com/linux/kernel/2369498 Please describe what the functional impact is in the commit message. I don't understand what 'make the file operation struct "reset" aware of the file's lifetime' means here. For referencing LKML posts, please prefer https://lore.kernel.org/. For referencing commits already in the kernel, please prefer the format c64688081490 ("debugfs: add support for self-protecting attribute file fops"). BR, Jani. > > Issue reported by Coccinelle script: > scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci > > Signed-off-by: Deepak R Varma > --- > Please Note: This is a Outreachy project task patch. > > drivers/gpu/drm/i915/gvt/debugfs.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/i915/gvt/debugfs.c b/drivers/gpu/drm/i915/gvt/debugfs.c > index 62e6a14ad58e..18adfa2d5f5b 100644 > --- a/drivers/gpu/drm/i915/gvt/debugfs.c > +++ b/drivers/gpu/drm/i915/gvt/debugfs.c > @@ -147,9 +147,8 @@ vgpu_scan_nonprivbb_set(void *data, u64 val) > return 0; > } > > -DEFINE_SIMPLE_ATTRIBUTE(vgpu_scan_nonprivbb_fops, > - vgpu_scan_nonprivbb_get, vgpu_scan_nonprivbb_set, > - "0x%llx\n"); > +DEFINE_DEBUGFS_ATTRIBUTE(vgpu_scan_nonprivbb_fops, vgpu_scan_nonprivbb_get, > + vgpu_scan_nonprivbb_set, "0x%llx\n"); > > /** > * intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU > @@ -165,8 +164,8 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu) > debugfs_create_bool("active", 0444, vgpu->debugfs, &vgpu->active); > debugfs_create_file("mmio_diff", 0444, vgpu->debugfs, vgpu, > &vgpu_mmio_diff_fops); > - debugfs_create_file("scan_nonprivbb", 0644, vgpu->debugfs, vgpu, > - &vgpu_scan_nonprivbb_fops); > + debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu, > + &vgpu_scan_nonprivbb_fops); > } > > /** -- Jani Nikula, Intel Open Source Graphics Center 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=-9.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 C218AC55179 for ; Fri, 30 Oct 2020 09:52:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 59FAC22245 for ; Fri, 30 Oct 2020 09:52:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 59FAC22245 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 023026ED42; Fri, 30 Oct 2020 09:52:54 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 654F56ED29; Fri, 30 Oct 2020 09:52:52 +0000 (UTC) IronPort-SDR: uiPkneK2UVFV2Ry18q8iPcABYOHPMzB7a+MYmz/+hAnUcKwvt/EzYXrVvO0LoPH9JgR/hs7wTX 7QbIyJgq1eGg== X-IronPort-AV: E=McAfee;i="6000,8403,9789"; a="168714896" X-IronPort-AV: E=Sophos;i="5.77,432,1596524400"; d="scan'208";a="168714896" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2020 02:52:51 -0700 IronPort-SDR: GAZHBb/NZ1aCxlqH/DTr6Gb2F06UdOtZdHy8Yb4FqYGhRIS38jMy9DVb8F5wJFhER+dmOJqmbN pgplGxfz3DBA== X-IronPort-AV: E=Sophos;i="5.77,432,1596524400"; d="scan'208";a="537011039" Received: from gcobrien-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.22.113]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2020 02:52:46 -0700 From: Jani Nikula To: Deepak R Varma , outreachy-kernel@googlegroups.com, Zhenyu Wang , Zhi Wang , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/i915/gvt: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe() In-Reply-To: <20201030032945.GA274850@my--box> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20201030032945.GA274850@my--box> Date: Fri, 30 Oct 2020 11:52:42 +0200 Message-ID: <87y2joghw5.fsf@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: melissa.srw@gmail.com, daniel.vetter@ffwll.ch, mh12gx2825@gmail.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, 30 Oct 2020, Deepak R Varma wrote: > Using DEFINE_DEBUGFS_ATTRIBUTE macro with debugfs_create_file_unsafe() > function in place of the debugfs_create_file() function will make the > file operation struct "reset" aware of the file's lifetime. Additional > details here: https://lists.archive.carbon60.com/linux/kernel/2369498 Please describe what the functional impact is in the commit message. I don't understand what 'make the file operation struct "reset" aware of the file's lifetime' means here. For referencing LKML posts, please prefer https://lore.kernel.org/. For referencing commits already in the kernel, please prefer the format c64688081490 ("debugfs: add support for self-protecting attribute file fops"). BR, Jani. > > Issue reported by Coccinelle script: > scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci > > Signed-off-by: Deepak R Varma > --- > Please Note: This is a Outreachy project task patch. > > drivers/gpu/drm/i915/gvt/debugfs.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/i915/gvt/debugfs.c b/drivers/gpu/drm/i915/gvt/debugfs.c > index 62e6a14ad58e..18adfa2d5f5b 100644 > --- a/drivers/gpu/drm/i915/gvt/debugfs.c > +++ b/drivers/gpu/drm/i915/gvt/debugfs.c > @@ -147,9 +147,8 @@ vgpu_scan_nonprivbb_set(void *data, u64 val) > return 0; > } > > -DEFINE_SIMPLE_ATTRIBUTE(vgpu_scan_nonprivbb_fops, > - vgpu_scan_nonprivbb_get, vgpu_scan_nonprivbb_set, > - "0x%llx\n"); > +DEFINE_DEBUGFS_ATTRIBUTE(vgpu_scan_nonprivbb_fops, vgpu_scan_nonprivbb_get, > + vgpu_scan_nonprivbb_set, "0x%llx\n"); > > /** > * intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU > @@ -165,8 +164,8 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu) > debugfs_create_bool("active", 0444, vgpu->debugfs, &vgpu->active); > debugfs_create_file("mmio_diff", 0444, vgpu->debugfs, vgpu, > &vgpu_mmio_diff_fops); > - debugfs_create_file("scan_nonprivbb", 0644, vgpu->debugfs, vgpu, > - &vgpu_scan_nonprivbb_fops); > + debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu, > + &vgpu_scan_nonprivbb_fops); > } > > /** -- Jani Nikula, Intel Open Source Graphics Center _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel