lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ec6d7b02-759b-2c9d-df6e-129a09fded1b@intel.com>
Date:   Fri, 18 Dec 2020 14:17:44 +0200
From:   Adrian Hunter <adrian.hunter@...el.com>
To:     Bean Huo <huobean@...il.com>,
        "Martin K . Petersen" <martin.petersen@...cle.com>,
        "James E . J . Bottomley" <jejb@...ux.ibm.com>
Cc:     linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
        Alim Akhtar <alim.akhtar@...sung.com>,
        Avri Altman <avri.altman@....com>,
        Can Guo <cang@...eaurora.org>,
        Stanley Chu <stanley.chu@...iatek.com>
Subject: Re: [PATCH V2] scsi: ufs-debugfs: Add error counters

On 18/12/20 12:57 am, Bean Huo wrote:
> On Thu, 2020-12-17 at 11:49 +0200, Adrian Hunter wrote:
>>>
>>> The purpose of patch is acceptable, but I don't know why you choose
>>> using ufshcd_core_* here. 
>>
>> Do you mean you would like a different function name?  'ufshcd_init'
>> is used
>> already.  The module is called ufshcd-core, so ufshcd_core_* seems
>> appropriate.
>>
>>> Also. I don't know if module_init()  is a proper way here.
>>
>> Can you be more specific?  It is normal to do module initialization
>> in
>> module_init().
> 
> Hi Adrian
> My concern that ufs_debugfs_init() is called in module_init(), but your
> another debugfs initialization function ufs_debugfs_hba_init(hba)
> called in the UFS host probe path. 

It is a good question, but module dependencies and initcall ordering means
that won't happen.  It is not unusual for modules to do initialization in
this way, that is completed before dependent modules initialize.

> 
> If these two (module_init() and module_platform_driver())
> initializaiton sequence always as your expectation: ufs_debugfs_init()-
> ->ufs_debugfs_hba_init(), that is fine, otherwise, it is better just
> group them, make it simpler.

Unfortunately, doing it that way, calls to debugsfs_create_dir("ufshcd",
NULL) could race. Losers of the race will get an error, and will not get the
dentry they need to proceed.  Preventing the race would require adding a
mutex.  So the other way is simpler.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ