Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp229308ybg; Thu, 17 Oct 2019 22:00:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzX0qHMEOYY61j1B/BaDqeTIMFucO1xJIDEDuKQJYGvnaR/rvr+keV9pM8Urw8hJRK1VV1Z X-Received: by 2002:a05:6402:1804:: with SMTP id g4mr7639770edy.266.1571374850379; Thu, 17 Oct 2019 22:00:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571374850; cv=none; d=google.com; s=arc-20160816; b=Vu19fJSzcXm9v1/kQsi7poozGYYZI23Kt9Arkm+u6HOA6vgfifxlp6950OjkJ0J0aq gs51z1W3liJcWNyerX/uDfD9SPVhueZxjoL482ExcZmPVcwuUlT9yIAwN0y4sOeB5Atg ee9QaxZ/UZHiIgpFwi7aSouez1pFQRjSKHAJGIxv/bzA7Pxj9hO4eHh7WasHUqVyKCj8 fH2VEdeLAy5RtD4z7x81pS/K0pi4xK0WO/9GvS2SbnCA1VU9zLcwVDmXTOxgid2M81KD ySrNLRy8zgJ29sMGhXer+h+oN9GhtWJF97TB+8UEwd/PauRyB1N7e9RzB0XvZU/1zwrE 1rfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pvi9oiGHw2L6e+43tSdwC2UAtOLsE61GwqekGigu9+8=; b=khOPLShSI583IiwHS6zQQgVH2xHJF6tjo8HJre47RXkniFnsKGtYNb9kpaql4Roosb JITg6d9onyPZo92Qf8TeWNZdhKs4IzAxPCWbU68oFfDsuavZsajUvkCgTCzOcgTNcQw3 30n88gkqdlmfDyYH2gdveZW+2ybJmZDzCovGzO7MBVlh/CGJhw9oZrU2fqW125hYedeC CdIzw+xcE2k3G0sQxaGrRIsi5ho73vyr/nL63L4CT9egCLv9U1/99L27S4nl+4SVMASc EWsBK5zxgWULh3/qZe5PEpW7M3s9wmJJG+enG8c2asxIrlaI9EVZw2MJElWh/kgIcHDj HWUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="dCc3o/4u"; 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 d24si3290815ede.119.2019.10.17.22.00.27; Thu, 17 Oct 2019 22:00:50 -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=@kernel.org header.s=default header.b="dCc3o/4u"; 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 S2388651AbfJPWRk (ORCPT + 99 others); Wed, 16 Oct 2019 18:17:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:44792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733243AbfJPVyp (ORCPT ); Wed, 16 Oct 2019 17:54:45 -0400 Received: from localhost (unknown [192.55.54.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 84B5421928; Wed, 16 Oct 2019 21:54:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571262884; bh=ETT6k0FHLbyFEEH0jp8KcmUsarCWhizwve0BhgUsxXU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dCc3o/4uUONh0P8AZlKm71DU9zERtRFCQqlTNQvpnGoAMnQ8nGlRYbpnsIR6PC3ch jidnfGa/XMSXyNr57GNjnskbbw3iQym3tdzubBUSx48MvQgZ9v/spPXZMRqpTa4fT/ i47/vmXtflbU41S5Nfnq/FXtXio3K+QKPK5uf2qA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathias Nyman Subject: [PATCH 4.9 42/92] xhci: Fix false warning message about wrong bounce buffer write length Date: Wed, 16 Oct 2019 14:50:15 -0700 Message-Id: <20191016214832.941082581@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191016214759.600329427@linuxfoundation.org> References: <20191016214759.600329427@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mathias Nyman commit c03101ff4f74bb30679c1a03d551ecbef1024bf6 upstream. The check printing out the "WARN Wrong bounce buffer write length:" uses incorrect values when comparing bytes written from scatterlist to bounce buffer. Actual copied lengths are fine. The used seg->bounce_len will be set to equal new_buf_len a few lines later in the code, but is incorrect when doing the comparison. The patch which added this false warning was backported to 4.8+ kernels so this should be backported as far as well. Cc: # v4.8+ Fixes: 597c56e372da ("xhci: update bounce buffer with correct sg num") Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/1570190373-30684-2-git-send-email-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-ring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -3200,10 +3200,10 @@ static int xhci_align_td(struct xhci_hcd if (usb_urb_dir_out(urb)) { len = sg_pcopy_to_buffer(urb->sg, urb->num_sgs, seg->bounce_buf, new_buff_len, enqd_len); - if (len != seg->bounce_len) + if (len != new_buff_len) xhci_warn(xhci, "WARN Wrong bounce buffer write length: %zu != %d\n", - len, seg->bounce_len); + len, new_buff_len); seg->bounce_dma = dma_map_single(dev, seg->bounce_buf, max_pkt, DMA_TO_DEVICE); } else {