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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B0FEC433F5 for ; Fri, 8 Oct 2021 12:57:04 +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 6112F60E95 for ; Fri, 8 Oct 2021 12:57:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6112F60E95 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6A0E46E0ED; Fri, 8 Oct 2021 12:57:03 +0000 (UTC) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2044.outbound.protection.outlook.com [40.107.237.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2C51F6E0ED for ; Fri, 8 Oct 2021 12:57:02 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BYsBR39RQLoEMdgCCS5zSbpAC/P1ewNkL7XDwtk6GXBK/9QSQtVr59VeDeE9+Ifs1crZaiDRWMzVQgjoIa+Hq608ZUKwdCP+ktwNTKkkN52ApU/cpKx1PzrUT5vdiuM/ZCQdoHRhAubNnjB5YQRchHUTHDEmHUKtx45R1I+Ldw/ZbfLExm4bz5Dmr4t4pt9QpGiz1HihcKQG7uGPo/aMweTjwD2BP9ISI4QPjzbmpVH+XmgPc3kEjuIAbUyfIdrcGaXSHK7hNc+hlc4w3l98J7gGTVggFNJRMY+y6rx0PHr6eUXEfK7K0KeHq1z4Y3xRnH41dOXXCbKIEIlVa/0vrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iSc/lPktkhxDrFG2mflrOGfs6EzDWqux23ecOKi4Qu8=; b=GrIv9FwWjoS9h7bra8Ne6tVDxT/PaEmkehoJo6TQGKFmLUI7mAw/g3MXkkbQotI5iW7Z6O+7G485ze9UQJy36dKnqDQ7VmI7MSWzmb9cmNQi8tKpH4iV3sq6qgTsewjZD7fDTjPIYZaAtOqSuJTitQHJNhaIJQFsAKetLN1+ijemxRdx/hI2WCcFVQDfqmYBWxUtI2piXM397oJPd83mq9UNSbop2Axaid4LMZDKENBj42EdopzWeOvUVzrh/jzHUP0eH9LSYb/+gylvu9WSCF8fJbGzo2q/8OkctEG0cZyGOUVi/nlHGn0dX+x634Ya2t2Vivy034dH2gc3P3F6Xw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iSc/lPktkhxDrFG2mflrOGfs6EzDWqux23ecOKi4Qu8=; b=vbDhe5OshZ6IGzjYSIxIRyukBtec36NT7YuY5a1UqoOy6dgnOK8S4PK7j4Pb4ffAVTtldcAJlI0sFXDUCE9PXQy1fXS/qlUraCwd5cFxDiVkf0J/HG05rq+xd4uDG6YdTD8vrwgafiFpC75yxYW9DbOW0mEXvz+AWpoUBGXBbW4= Received: from DM4PR12MB5136.namprd12.prod.outlook.com (2603:10b6:5:393::23) by DM4PR12MB5165.namprd12.prod.outlook.com (2603:10b6:5:394::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.19; Fri, 8 Oct 2021 12:56:59 +0000 Received: from DM4PR12MB5136.namprd12.prod.outlook.com ([fe80::555a:2980:a5c2:8d29]) by DM4PR12MB5136.namprd12.prod.outlook.com ([fe80::555a:2980:a5c2:8d29%8]) with mapi id 15.20.4587.022; Fri, 8 Oct 2021 12:56:59 +0000 From: "Das, Nirmoy" To: =?iso-8859-1?Q?Christian_K=F6nig?= CC: "dri-devel@lists.freedesktop.org" , "Koenig, Christian" , Greg KH , Jani Nikula Subject: Fw: [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error handling Thread-Topic: [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error handling Thread-Index: AQHXvCVOX+r98BpL20ibYh87C1bzDKvI2NmAgAAYK4CAADUDgP//6OS1 Date: Fri, 8 Oct 2021 12:56:59 +0000 Message-ID: References: <20211008091704.27094-1-nirmoy.das@amd.com> <87a6jjyhuo.fsf@intel.com> <02fc9da3-ebac-2df1-3a54-d764b273f91b@amd.com> In-Reply-To: <02fc9da3-ebac-2df1-3a54-d764b273f91b@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_Enabled=True; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_SetDate=2021-10-08T12:56:59.062Z; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_Name=AMD Official Use Only; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_ContentBits=0; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_Method=Standard; suggested_attachment_session_id: 7d9d88f6-e7a3-83fa-9b5c-02044ff22830 authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c0296679-317c-468a-3883-08d98a5b1dc4 x-ms-traffictypediagnostic: DM4PR12MB5165: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: P1aG4opSXPGQY9L8Y/H6duLa+OnJLd24BO8brGgaDJuEGkY6aS4vACClIVHyu8bY1APZo36phWaqezgKF+5ohxyHUjAc5HutEgH7FrKAKLCwBmyzxXB/fgE9XwuXRdZI5lz3oP4bDY9FxBQgHCpCwMu5Uygw3fSBL/Z/aG6L+7ziavlxeKTG8SJevoVjPBjlsP6bwGISu9mDbNXF8L+gmPbMFYP/GsS5uFO7zbNHIVp9tsU6EHuc3HXLf73r5y2ONOoCiwh90V3IF5zBsGlGobqPwVeHjTTPJ2rjNeHNo3LLpPau2hgIkqJfeA8sbixNZOYDlzLydfeunOtpswaCPGE9TP1HhoZWbYHlKagkC+uv6xnZxoF5iRcgTJq5RIYBN53S9VkwyzVZ8LOnMIP4WZmXxaFSIC62a89V4U6FTHUBF56mnXNh/EmYa/YHyRguzSXJkERPqOpgFZBJLdxPMPq+CRxOLbaDIbqkcWQIbdVzBfhW1Zs2lQRqw3A4fs4eUDrs8dY452epEChfXUrjIE00+vlCykEEhVVZ+QeT82/OHCvR2sQhid+lqE5G1+d9FsY2Hs1WjoVei+xbOstjRf9KZ2INJuPEEmrvmdYokOkwmooQgo4mDmTWV/n0cYjtNe48xRImhWBN+a8GM8Sl/8Ds8hsdcJqXI6Dm7IxZWM657hFCTzocHh+q1WIx51DITypD/OI9Z1ZKIFyRVu8vog== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5136.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(66476007)(8936002)(38100700002)(66446008)(64756008)(66556008)(122000001)(9686003)(55016002)(8676002)(508600001)(5660300002)(4326008)(52536014)(86362001)(6916009)(26005)(186003)(7696005)(2906002)(53546011)(38070700005)(6506007)(71200400001)(91956017)(19627405001)(76116006)(33656002)(54906003)(316002)(66946007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?JjesSgOhAPgmiXFmbcIJP4fowEvwiPuzcfs26NLT4ZqtsLGulDLOr/qrZb?= =?iso-8859-1?Q?bIBGIiogXol9OtoV5QQ4I2ZarHz91jen2h5ze+qy4W+GW3W2rA/fsRqMmo?= =?iso-8859-1?Q?XCjzV68DLjGo8Kkbp1xzEEK9TNB6/GwU+V6ZFuiV9b+OmXJYSje2SxLY0J?= =?iso-8859-1?Q?rTNJHXICpWmFehlx3ZACRmBIa5xXOT9xVFSVrP5KHiNdGUIrnVaCjxKpuv?= =?iso-8859-1?Q?F9D65bhZbXfc5bKwyD1U9tj9jbLuEsbL2cCcS9/B7k/mDfPEwFHqfbWYG8?= =?iso-8859-1?Q?Gw21z5UgEw+AcYk/BaVpucwRHH8FVFzAHJ4/KAF+zkvwbhd0ymjhni4ZsU?= =?iso-8859-1?Q?K3BgSZvm+qQ6MIncewAyTLrkWZ5yjZjIWLx6/JHmlftuE1Wc3hq4YzJr5m?= =?iso-8859-1?Q?rmO7/yfrDP/WfxaO7s5I888pmOlnBmGU7ZeBUd/22KQ2skac5lKBfz4e0g?= =?iso-8859-1?Q?JKmV3vlL9vErOgCJ3YaldQag3ozPxJbPUb0inb/Jod+VA1v8oR8BagACtY?= =?iso-8859-1?Q?Z0asjPihehuHk2qyG6hJJfrcjt+XfjtITc2X88zxWv6INXPcjYwarqsdyr?= =?iso-8859-1?Q?MmnhHPISHikIWXu4IT5PqgShgyGIdePQPprWThMjenSXyJW2K8JO+yUxbv?= =?iso-8859-1?Q?brQsxefFdtwv6CG7r5QxRgLBVmzvhGqBnwzaBFwzBhAy8T4lY7mPTOCboC?= =?iso-8859-1?Q?7KlPSMZk4KwO6AIZZ2XR6DKbIf0+5+dG59rdl80Qo5VwCZzkeunxRoknH0?= =?iso-8859-1?Q?+0wyhtoat1DK3QM/tRL33sTX4aE/GWQn1uG6/7BFbdJMOwlwUBc/I3Mf/7?= =?iso-8859-1?Q?bEEZab2QMcgTJNCrZN1NKWGkWV7nMRkuq1YITn3SSQD9MtU638+0tgwZBg?= =?iso-8859-1?Q?j2jIWV6vusfeW01B2hT0sjFgzr4gm5iGpdbavp/JQyHl5pOS+Fc8MOqACM?= =?iso-8859-1?Q?v6tPpZUw+DX1/qu7UJEhXVzg3UF7Q8aJ0505BgjBG5hHPj+egA4DQqqTqI?= =?iso-8859-1?Q?x6fqdweVOAwLPXVjA1ltlvWaO/TKbI9I49Osa/c3QFZDej7zkv1g51jLgV?= =?iso-8859-1?Q?Ge0JQiDVAdRfH4jP20jDB/q868cHY/ZsdtHsX4TxRFiDeQLvKnbetLodQ/?= =?iso-8859-1?Q?oFLprBQelSYCuUreJDbE+WWrX/NppWE30NgutJwis7QtSQYMCcvGtMIv7f?= =?iso-8859-1?Q?XFvEIivuFkDdrZraxvrGiLFafo3wEpRy7YO3F8OJQW46iSpSQNFlQzpobK?= =?iso-8859-1?Q?LX08nKjrSgxKTUJSwQDB3Ktm4b2NUYfD0zSB7r0gZNqLGRI7wka+BbGGxq?= =?iso-8859-1?Q?d5106cRVc/l5NREvsw8p5HGZ095EL3RU4LUSBx++qZ2bGhg=3D?= Content-Type: multipart/alternative; boundary="_000_DM4PR12MB51368C12F6338C6F245D54B28BB29DM4PR12MB5136namp_" MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5136.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0296679-317c-468a-3883-08d98a5b1dc4 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Oct 2021 12:56:59.4486 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: W6w59HXHeUx9sOb0AmpOer11pcsv3RI0AnnNIkRwcYE7OJQR+FbTfTNPWBp5wbx1XscOJVIcO7jaNuANt3ZZTw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5165 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" --_000_DM4PR12MB51368C12F6338C6F245D54B28BB29DM4PR12MB5136namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only] Trying with Christian's Gmail, as he still didn't receive previous emails. ________________________________ From: Das, Nirmoy Sent: Friday, October 8, 2021 2:17 PM To: Koenig, Christian Cc: dri-devel@lists.freedesktop.org ; inte= l-gfx@lists.freedesktop.org ; Maarten Lank= horst ; Maxime Ripard ; Thomas Zimmermann ; David Airlie ; Daniel Vetter ; Greg KH ; J= ani Nikula Subject: Re: [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error handling Adding Christian as he didn't receive the full thread yet. On 10/8/2021 1:07 PM, Greg KH wrote: > On Fri, Oct 08, 2021 at 12:40:47PM +0300, Jani Nikula wrote: >> On Fri, 08 Oct 2021, Nirmoy Das wrote: >>> Debugfs API returns encoded error instead of NULL. >>> This patch cleanups drm debugfs error handling to >>> properly set dri and its minor's root dentry to NULL. >>> >>> Also do not error out if dri/minor debugfs directory >>> creation fails as a debugfs error is not a fatal error. >> Cc: Greg >> >> I thought this is the opposite of what Greg's been telling everyone to >> do with debugfs. > Yes, that is not good. > > You should never care about the result of a debugfs_create* call. Just > take the result, and if it is a directory, save it off to use it for > creating a file, no need to check anything. > > And then throw it away, later, when you want to remove the directory, > look it up with a call to debugfs_lookup() and pass that to > debugfs_remove() (which does so recursively). > > There should never be a need to save, or check, the result of any > debugfs call. If so, odds are it is being used incorrectly. > > thanks, > > greg k-h --_000_DM4PR12MB51368C12F6338C6F245D54B28BB29DM4PR12MB5136namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

[AMD Official Use Only]


Trying with Christian's Gmail, as he still didn't receive previous emails.<= /div>


From: Das, Nirmoy <nir= moy.das@amd.com>
Sent: Friday, October 8, 2021 2:17 PM
To: Koenig, Christian <Christian.Koenig@amd.com>
Cc: dri-devel@lists.freedesktop.org <dri-devel@lists.freedesktop.= org>; intel-gfx@lists.freedesktop.org <intel-gfx@lists.freedesktop.or= g>; Maarten Lankhorst <maarten.lankhorst@linux.intel.com>; Maxime = Ripard <mripard@kernel.org>; Thomas Zimmermann <tzimmermann@suse.d= e>; David Airlie <airlied@linux.ie>; Daniel Vetter <daniel@ffwll.ch&g= t;; Greg KH <gregkh@linuxfoundation.org>; Jani Nikula <jani.nikula= @linux.intel.com>
Subject: Re: [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error hand= ling
 
Adding Christian as he didn't receive the full thr= ead yet.


On 10/8/2021 1:07 PM, Greg KH wrote:
> On Fri, Oct 08, 2021 at 12:40:47PM +0300, Jani Nikula wrote:
>> On Fri, 08 Oct 2021, Nirmoy Das <nirmoy.das@amd.com> wrote:<= br> >>> Debugfs API returns encoded error instead of NULL.
>>> This patch cleanups drm debugfs error handling to
>>> properly set dri and its minor's root dentry to NULL.
>>>
>>> Also do not error out if dri/minor debugfs directory
>>> creation fails as a debugfs error is not a fatal error.
>> Cc: Greg
>>
>> I thought this is the opposite of what Greg's been telling everyon= e to
>> do with debugfs.
> Yes, that is not good.
>
> You should never care about the result of a debugfs_create* call. = ; Just
> take the result, and if it is a directory, save it off to use it for > creating a file, no need to check anything.
>
> And then throw it away, later, when you want to remove the directory,<= br> > look it up with a call to debugfs_lookup() and pass that to
> debugfs_remove() (which does so recursively).
>
> There should never be a need to save, or check, the result of any
> debugfs call.  If so, odds are it is being used incorrectly.
>
> thanks,
>
> greg k-h
--_000_DM4PR12MB51368C12F6338C6F245D54B28BB29DM4PR12MB5136namp_--