Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1838549ybv; Thu, 6 Feb 2020 10:42:42 -0800 (PST) X-Google-Smtp-Source: APXvYqzK/j7zuOig8Z68F5MezciV7a3B7h/7IT2jzoK94Qkp1UYbJ3boo7D1/zP8hJBxPtG6I1dS X-Received: by 2002:a54:4085:: with SMTP id i5mr8012878oii.17.1581014562257; Thu, 06 Feb 2020 10:42:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581014562; cv=none; d=google.com; s=arc-20160816; b=SO0uXnYzgg/p+TJWBVqC63zC1A9MQ7TT0r61RWN1BAVTHPK/QqZrdjq19fRNA2Tdza s7ZfM1alAEIqN8OdIBKTk5yNnQq66Z5x3A2cjgU1du9SyW5/yYn1U7f8NLfufCtva58+ +Vzd7nQ84POSwKPHHEu5BZF54LCLbbKv3QiwPEtM8kgQhQSl7G+jny5/51kgFutg3hrI zZ3zpcUwr5NTtSB/jQGYtA7/hdvcigl4wf0/c6GcY7rDXg1sjDuSMLP1kQlnBtIePa2X vWjLKCJUIjbIEREJ5SqixdCzWj6vW9fEYURLrNkHCWowr2GyruZavC3RuabXF2VCb/oM jj9g== 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=Q08ftOUoyei97FPuiT9NtyQjBazlRzN9kuWqUvxH82M=; b=xUU3IoEkf8iYxK5abZXgWNUADKjjEeRME6vZlpmBCjb01iFNh4YEPolZTvTcDzGv+6 nbizUfZpmU4j2HHN4X/nwknvPNnDJmFULvTluyWV6bxketVis248F332YCoQ1w33GP/X TI8wM2LuAvaCTj3X8/9wFIVtYl94VhFa2qe1uFkvBckxnp+T4HNbJRwGkbT74VUm52cQ 5RZbSU4gTjdC41+gnDe8cE5uC7Hr7tz0uUEhybleIxPzibSSL+U4oB21/xb2MmRcxd7+ WZNPoigUkMXH8f/bW93abN/VY54zL3s8Pzl4BMNlJ4Y/7AM6sBxN6QTvnvtwpTJ0fB1l FQrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="Sd/l60BD"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l10si203484oth.243.2020.02.06.10.42.29; Thu, 06 Feb 2020 10:42:42 -0800 (PST) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="Sd/l60BD"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727790AbgBFSli (ORCPT + 99 others); Thu, 6 Feb 2020 13:41:38 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:38550 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726990AbgBFSli (ORCPT ); Thu, 6 Feb 2020 13:41:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Q08ftOUoyei97FPuiT9NtyQjBazlRzN9kuWqUvxH82M=; b=Sd/l60BDPZrpNVJCH76HWt2KQY 78r8ovu9yE0ts3Mz5ukvQXOuWS3r0hgZxMaUc24m2fEPFebomk2RCZf3C+pSzcetpwtHSymx6UANj lXil3ylWqN9fg6idv8CR7oaUduchmPwqz3y/8RyeQl0T5hUcbW0gC1kgW0scwiLWmO//7aKNR66OL fHvC3P7rn2pAOdtT2k1NNxcOlST5pjzUiwWt271ez9wE0mhwhRbheZCD+CjjdZKhVW84cZ3OnA1n6 8OzcWKOweAPV8HJ05OUTwV8usk/MeJbt9RscmKrhorxWx9qHFPBjRyljZiFJL5iv+UgSoypMnqAcC 421RZmBA==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1izm5m-0004hy-Gd; Thu, 06 Feb 2020 18:41:34 +0000 Date: Thu, 6 Feb 2020 10:41:34 -0800 From: Christoph Hellwig To: Felipe Balbi Cc: Christoph Hellwig , John Stultz , "Yang, Fei" , Andrzej Pietrasiewicz , lkml , Felipe Balbi , Thinh Nguyen , Tejas Joglekar , Jack Pham , Todd Kjos , Greg KH , Linux USB List , stable , Jens Axboe Subject: Re: [RFC][PATCH 0/2] Avoiding DWC3 transfer stalls/hangs when using adb over f_fs Message-ID: <20200206184134.GA11027@infradead.org> References: <20200122222645.38805-1-john.stultz@linaro.org> <02E7334B1630744CBDC55DA8586225837F9EE280@ORSMSX102.amr.corp.intel.com> <87o8uu3wqd.fsf@kernel.org> <02E7334B1630744CBDC55DA8586225837F9EE335@ORSMSX102.amr.corp.intel.com> <87lfpy3w1g.fsf@kernel.org> <20200206074005.GA28365@infradead.org> <87ftfn602u.fsf@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ftfn602u.fsf@kernel.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 06, 2020 at 08:29:45PM +0200, Felipe Balbi wrote: > > No, it shoudn't. dma_map_sg returns the number of mapped segments, > > and the callers need to remember that. > > We _do_ remember that: That helps :) > that req->request.num_mapped_sgs is the returned value. So you're saying > we should test for i == num_mapped_sgs, instead of using > sg_is_last(). Is that it? Yes. > Fair enough. Just out of curiosity, then, when *should* we use > sg_is_last()? Outside of sg_next/sg_last it really shoud not be used at all as far as I'm concerned.