Re: [PATCH v3 6/7] net: qrtr: Add MHI transport layer
From: Bjorn Andersson <hidden>
Date: 2020-03-30 22:19:40
Also in:
linux-arm-msm, lkml
On Mon 30 Mar 02:49 PDT 2020, Manivannan Sadhasivam wrote:
Hi Chris, On Thu, Mar 26, 2020 at 03:54:42PM -0700, Chris Lew wrote:quoted
On 3/25/2020 3:37 AM, Manivannan Sadhasivam wrote:quoted
Hi Bjorn, + Chris Lew On Tue, Mar 24, 2020 at 01:39:52PM -0700, Bjorn Andersson wrote:quoted
On Mon 23 Mar 23:10 PDT 2020, Manivannan Sadhasivam wrote:
[..]
quoted
quoted
quoted
quoted
+ spin_lock_irqsave(&qdev->ul_lock, flags); + list_for_each_entry(pkt, &qdev->ul_pkts, node) + complete_all(&pkt->done);Chris, shouldn't we require list_del(&pkt->node) here?No this isn't a full cleanup, with the "early notifier" we just unblocked any threads waiting for the ul_callback. Those threads will wake, check in_reset, return an error back to the caller. Any list cleanup will be done in the ul_callbacks that the mhi bus will do for each queued packet right before device remove. Again to simplify the code, we can probable remove the in_reset handling since it's not required with the current feature set.So since we are not getting status_cb for fatal errors, I think we should just remove status_cb, in_reset and timeout code.
Looks reasonable. [..]
quoted
I thought having the client get an error on timeout and resend the packet would be better than silently dropping it. In practice, we've really only seen the timeout or ul_callback errors on unrecoverable errors so I think the timeout handling can definitely be redone.You mean we can just remove the timeout handling part and return after kref_put()?
If all messages are "generated" by qcom_mhi_qrtr_send() and "released" in qcom_mhi_qrtr_ul_callback() I don't think you need the refcounting at all. Presumably though, it would have been nice to not have to carry a separate list of packets (and hope that it's in sync with the mhi core) and instead have the ul callback somehow allow us to derive the skb to be freed. Regards, Bjorn