Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3722044ybb; Tue, 31 Mar 2020 10:41:06 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsPeZCJ0STfcxe3TtUymELBH2n/QbklTo1s7MoBeY6Zg/EJe9ki5C0vZI8t18g3rRMcOWKU X-Received: by 2002:a05:6808:b3b:: with SMTP id t27mr3000259oij.5.1585676466516; Tue, 31 Mar 2020 10:41:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585676466; cv=none; d=google.com; s=arc-20160816; b=qe/I/v9+OvfSXMJ5n088LinHznZgtyUzcfaFQrIq/r6JBmO7TVHEQv1GDMyj5M4yvh nTbHGz6d4eMLzT6yg034nAHrXwsetEfD6vqGbz8YwQlD7EM3IifsnShs5e3XZR/hY6ws Pvhr9Xly/vgekuM34csAvf1L/y9enigsJKJN/B3XYffCBGniIxPI6xAkLBaBAiSQAlTK Makn5chNEczvq6v5uFPzS0F20U1x82P+OuRMEfM0p3qFhCKNOWDMXr2FwhWyAS5OscRj ROsYMqO13HO+Qoub4NJeEPMQYmmR0JQwcq8z7DmkXYi75DMkCIWmDgajQ5wIbF7Dk+oH Rf6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=4l5ETOgQ0imWwnT/8ipOuClDORxJCjuXyVXWv0vRdoI=; b=uXEzZJwHUolDqzwjFjp8wrd3/Oy2t/AywlaFApUvhdFcfpg6VmLfVYxjk+EsuhWo2j qic3xUWzCXzAYh+l4Q6ZtQ1s2oFqCjEyMQ+AW/sP6ZQRRdEh5I3KUbj294qSck9SiOHp LX7cXIgX7Q4d28kPQTkXRVinZKaz3naeW5XvW99x4PUVrF5XM0j9GyaZTTvPXezEZ0D/ KfUarzYjYVf8catTwCBt5PkvhtK6fBMkP6dCqxImjnZI+A/vXio5CSEHfk7aX/43tZHw GwzkNQt8OILH20hBheTKeuC1wR79TdZWsxwV82gs4123A+Ccr3yh46n9FLdttbjy5X1s rtFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iAxPDHZi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w188si7294589oig.183.2020.03.31.10.40.53; Tue, 31 Mar 2020 10:41:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iAxPDHZi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726194AbgCaRkV (ORCPT + 99 others); Tue, 31 Mar 2020 13:40:21 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:45354 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726000AbgCaRkU (ORCPT ); Tue, 31 Mar 2020 13:40:20 -0400 Received: by mail-pf1-f193.google.com with SMTP id r14so8165068pfl.12 for ; Tue, 31 Mar 2020 10:40:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=4l5ETOgQ0imWwnT/8ipOuClDORxJCjuXyVXWv0vRdoI=; b=iAxPDHZi6j5XJDdwzsv0gC4hIkVTp64vobCnjhVmnUmhWcTudGJ0DxkmaAcflR3Tzk qfmOb+xfqmzYhtVa4SEUkfXVw835Lf7flpWypgLk96zZmJC8Xr2gV2XAvHuqisPiFp8R qUcZdqicxs+h69FdXEIhkQoBsPMr4JyCssTZz9Tk49dv7ReiplqU618mGAtYCZcAdih+ q9f1aGerdw1UxcTeN921BXCG7KdLdJZn+0XjBqwoZePxKmWuGFD5qd90dpB475khGY71 T2yecrpkGRyBI+6IqqTPfjcAYbLkf1lCQyKsundJ28kLDjjbigtSGI7LSJTxZZ1Nvi16 8cQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=4l5ETOgQ0imWwnT/8ipOuClDORxJCjuXyVXWv0vRdoI=; b=JANLlV4k02tobZ633vzguIIJkfYjzS/eQCQCOT3if680OYe9lR8hG6i2/90gdGutUm zdYi5WqFNbmEqtuDMW3YrQ9pID2tuTXF4T0ITrZzHJJacybew50tHYZOSAlW3oFGL3T5 gAsZT0CmUmCg+PZDPDZDyFe6f1ReNlpVa3lHBawFYtqHiUGXIgycSQdqI+tzWBNHmIHt k2iGQbOQmV9R2Sc6OwgTXx/8ye61ZoIHc7bupYUQenUPvPNXdYVAx2vSHdrkXuaM8bis 1Odw3JeiC4HQI+7wEvMvXqVZMsgPLrX/IJAb/F15om9BzQpUi9uuY4oRWYxyWdGnOpoG XBNg== X-Gm-Message-State: ANhLgQ3xmEVou9u0TdfK5guxtD8GDjI4BfdZAojTYU6HzSewxZmNI0B4 m5kBkEDW4/UWdXkrSClPSMyRHQ== X-Received: by 2002:aa7:880c:: with SMTP id c12mr18142763pfo.77.1585676419418; Tue, 31 Mar 2020 10:40:19 -0700 (PDT) Received: from minitux (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id nh14sm2439979pjb.17.2020.03.31.10.40.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Mar 2020 10:40:18 -0700 (PDT) Date: Tue, 31 Mar 2020 10:40:16 -0700 From: Bjorn Andersson To: Manivannan Sadhasivam Cc: Chris Lew , gregkh@linuxfoundation.org, davem@davemloft.net, smohanad@codeaurora.org, jhugo@codeaurora.org, kvalo@codeaurora.org, hemantk@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v3 6/7] net: qrtr: Add MHI transport layer Message-ID: <20200331174016.GA254911@minitux> References: <20200324061050.14845-1-manivannan.sadhasivam@linaro.org> <20200324061050.14845-7-manivannan.sadhasivam@linaro.org> <20200324203952.GC119913@minitux> <20200325103758.GA7216@Mani-XPS-13-9360> <89f3c60c-70fb-23d3-d50f-98d1982b84b9@codeaurora.org> <20200330094913.GA2642@Mani-XPS-13-9360> <20200330221932.GB215915@minitux> <20200331112326.GB21688@Mani-XPS-13-9360> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200331112326.GB21688@Mani-XPS-13-9360> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 31 Mar 04:23 PDT 2020, Manivannan Sadhasivam wrote: > Hi Bjorn, > > On Mon, Mar 30, 2020 at 03:19:32PM -0700, Bjorn Andersson wrote: > > 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: > > > > > > > > > > > > On 3/25/2020 3:37 AM, Manivannan Sadhasivam wrote: > > > > > Hi Bjorn, > > > > > > > > > > + Chris Lew > > > > > > > > > > On Tue, Mar 24, 2020 at 01:39:52PM -0700, Bjorn Andersson wrote: > > > > > > On Mon 23 Mar 23:10 PDT 2020, Manivannan Sadhasivam wrote: > > [..] > > > > > > > + 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. > > > > [..] > > > > 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. > > > > Hmm, you're right. We can move the packet releasing part to ul_callback now. > > > > > 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. > > > > Yep, MHI stack holds the skb in buf_addr member of mhi_result. So, we can just > use below to get the skb in ul_callback: > > struct sk_buff *skb = (struct sk_buff *)mhi_res->buf_addr; > > This will help us to avoid the use of pkt, ul_pkts list and use the skb directly > everywhere. At the same time I think we can also remove the ul_lock which > was added to protect the ul_pkts list. > > Let me know your opinion, I'll just send a series with this modified QRTR MHI > client driver and MHI suspend/resume patches. > This looks more robust than having the separate list shadowing the internal state of the MHI core. +1 Thanks, Bjorn