On 2024/10/28 22:30, Jeff Johnson wrote: > On 10/28/2024 7:02 AM, Kalle Valo wrote: >> Zhen Lei <thunder.leizhen@xxxxxxxxxx> writes: >> >>> Driver ath11k can work fine even if the debugfs files fail to be created. >>> Therefore, the return value check of debugfs_create_file() should be >>> ignored, as it says. >>> >>> Suggested-by: Jeff Johnson <quic_jjohnson@xxxxxxxxxxx> >>> Signed-off-by: Zhen Lei <thunder.leizhen@xxxxxxxxxx> >> >> Are you just guessing or did you confirm on a real device that ath11k >> spectral really works without debugfs? Let's be honest, the only thing I know for sure is that debugfs_create_file() returns an error code when it fails, not NULL. When I was locating a problem, I found that a call to debugfs_create_file() did not process the return value correctly. So I searched for other drivers, including ath11k. I'm not familiar with ath11k. How to modify requires your help and decision. > > The debugfs_create_file() documentation tells us: > * NOTE: it's expected that most callers should _ignore_ the errors returned > * by this function. Other debugfs functions handle the fact that the "dentry" > * passed to them could be an error and they don't crash in that case. > * Drivers should generally work fine even if debugfs fails to init anyway. > > The caveat is that any driver functionality that relies upon debugfs obviously > won't work if the underlying file isn't created. Hence the language that the > driver "should generally work fine" since all functionality that isn't tied to > debugfs will still be available. > > Since the relayfs functionality that spectral scan uses is dependent upon > debugfs, this functionality won't work if the debugfs operation fails. So the > question is, if that fails, do you continue running the driver that generally > works fine supporting all other wifi operations, or do you return an error, > and as part of the error handling, not init the driver and hence have no wifi > operation? Maybe Kalle just pointed out that my description was incorrect. Hi Kalle: Can you give me a clear instruction? 1) Rollback to v1 https://www.spinics.net/lists/linux-wireless/msg257219.html 2) Update commit message, I think I can borrow the description above. > > The one thing I didn't check is that although the documentation tells us that > debugfs functions handle an "error" dentry, I didn't check if relayfs handles it. > > /jeff > > . > -- Regards, Zhen Lei