From: "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>
To: Jeff Johnson <quic_jjohnson@quicinc.com>, Kalle Valo <kvalo@kernel.org>
Cc: Jeff Johnson <jjohnson@kernel.org>,
<linux-wireless@vger.kernel.org>, <ath11k@lists.infradead.org>
Subject: Re: [PATCH v2] ath11k: remove error checking for debugfs_create_file()
Date: Tue, 29 Oct 2024 10:05:43 +0800 [thread overview]
Message-ID: <2baeba2a-9a77-2bde-1dee-b520069df635@huawei.com> (raw)
In-Reply-To: <ff8c3443-3651-480e-956e-81c7d592099d@quicinc.com>
On 2024/10/28 22:30, Jeff Johnson wrote:
> On 10/28/2024 7:02 AM, Kalle Valo wrote:
>> Zhen Lei <thunder.leizhen@huawei.com> 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@quicinc.com>
>>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
>>
>> 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
next prev parent reply other threads:[~2024-10-29 2:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-25 6:42 [PATCH v2] ath11k: remove error checking for debugfs_create_file() Zhen Lei
2024-10-28 14:02 ` Kalle Valo
2024-10-28 14:30 ` Jeff Johnson
2024-10-29 2:05 ` Leizhen (ThunderTown) [this message]
2024-10-29 3:41 ` Julian Calaby
2024-10-29 14:27 ` Jeff Johnson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2baeba2a-9a77-2bde-1dee-b520069df635@huawei.com \
--to=thunder.leizhen@huawei.com \
--cc=ath11k@lists.infradead.org \
--cc=jjohnson@kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=quic_jjohnson@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox