From patchwork Fri Aug 27 08:21:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 503378 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp1039830jab; Fri, 27 Aug 2021 01:21:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznoi/WUWZbjMOsyeSZgn4EhHDBHzSA/ZOCWPtGM8ANSpugr6BlgVGyeg0E6sgklxEeMTFr X-Received: by 2002:a05:6402:17d6:: with SMTP id s22mr8668606edy.185.1630052503645; Fri, 27 Aug 2021 01:21:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630052503; cv=none; d=google.com; s=arc-20160816; b=f+FYya7UTpcEZsKZzgHMO/H2m9UE4qJT/nJSeXnh00xdj2gQQWxCU1dF6V4p/UIIRs CxwokwDoccmEjTFrd3mhMyINKZJA6aEQcD1VAT/oRxCvf2uc6tFyn6kTOeMEl3NBWK7M CyE3dEtze79Cib8bHo+dEBC6FeNJlahMXt/VToQpfXWgGswrETHCfgUbrPMSixB4tEh4 jbSHJ3qv49PskbuOofEPuZsrIIQX+2zd9J63e1sSEUcoLqisTDtqNq49/iLVT7fHgPSn meSG1EsdW+iMejup7WASdlDVuQJb/BYjCUoOWVanqCS4pUvzG/WuWd7Mi2WhBSZqLZwh HKTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=62h6uRc5/FuReu7rXAOF6mghumi9ejQXLtu8FgRmxU8=; b=V/ukfysih4MTTjU+qvlzBtVMHwcmDVzhdqegOB1/JLZlKYKHv0GNPm67sH3S+rJssV REKkao3XBA6Zdof7mdjtpowc0YyBGzrdKO6kQT+P2upKbopbB+esO6Ek5vRExy3rxxhp iafp8wAEpWVlUpe+2TOXR4KZvY3P6TLIHt+5w2xOOJYEaxZyJ6k0p+onlIwZrrZQmng5 rcnrqcal1qusaVrW79o21bKljaFfau/yllFgH43K+Z559RHOTIm+17go8kBjmYK4m/hS PkDUrCFI/jNKNVAvyxHLO9p6IcXzjnHgYhVsFXEYw0V3BquD0o+Q/5IzIlbqzn6c0GYZ GjpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Hgm8OaMB; spf=pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-usb-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. [23.128.96.18]) by mx.google.com with ESMTP id n2si6333491edi.195.2021.08.27.01.21.43; Fri, 27 Aug 2021 01:21:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Hgm8OaMB; spf=pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-usb-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 S244530AbhH0IWa (ORCPT + 4 others); Fri, 27 Aug 2021 04:22:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244505AbhH0IW3 (ORCPT ); Fri, 27 Aug 2021 04:22:29 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46A25C061757 for ; Fri, 27 Aug 2021 01:21:40 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id v20-20020a1cf714000000b002e71f4d2026so6892834wmh.1 for ; Fri, 27 Aug 2021 01:21:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=62h6uRc5/FuReu7rXAOF6mghumi9ejQXLtu8FgRmxU8=; b=Hgm8OaMBtNQZ93naj2XxwwN2zicDzre60pSwmXjyVgZg5WnAiuMv4WC11F4p2zL033 k/xmSJQnzX4iZ9OLv+UiF+Z/NxSG1d5iydT+bSUjv/I831hqrv5mCkh/hbNNq5WvFhW9 CFOrmVRETPY9VOYTN10KPCUt17pkJM7UdOcbUQnUvf/WbimPZV6X9JzGpebcvcqEGLUG 0DcCVXSMhqzfO9LCQ2Kgn9sz8rT+zldMThy4xzJDuxUZkJGck6iK1bj6+E4TWloB1/e/ rPFiZdzVvaf39kSaGk75COlohOQf2OuhLsL98h/N0wj+WHn4GcJdHAIFEjTDxGAJUIxy 79FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=62h6uRc5/FuReu7rXAOF6mghumi9ejQXLtu8FgRmxU8=; b=F1IogyJ2AnPil4cbrsLlouInca4PdReuEqCXVxLo9FP7Bo+wSxQjeTnPG/PzgpLBKU peAr7GLtf1nVBCUYBcN8KuuUifR0WwWGsFzCV93PXlowu+MSrDrzSk28Ykb9JrmuCA71 csajkBhLayTdtKM+SNGOjb7lMzrW2mE+uOvJymkJpQTng9ZMmDRJ3bgaqRpPcPeMQfLd SYM/4I0q7GDIzZor5W/KfE8N7qNqDEDaZcS0aJFu6ADcIxjsQr5buSulZi5egH6mrpj0 g3KgNCL9OqCEHvAajGS6C16eDtRuHH4YyN0Kwr0L7Zo3D2IQmz0eaCYjmCGgqUBe6tYN 4TbQ== X-Gm-Message-State: AOAM532hQQPfb/OCuUsc9aa3GmQ7h2vU/loQNygFCf0/PoURwraf83cm ODIuJDnuH5ShyHW+imSAKi/cEg== X-Received: by 2002:a1c:a181:: with SMTP id k123mr17994280wme.90.1630052498920; Fri, 27 Aug 2021 01:21:38 -0700 (PDT) Received: from arch-thunder.local (a109-49-46-234.cpe.netcabo.pt. [109.49.46.234]) by smtp.gmail.com with ESMTPSA id y1sm5177725wmq.43.2021.08.27.01.21.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Aug 2021 01:21:38 -0700 (PDT) From: Rui Miguel Silva To: Greg Kroah-Hartman , Dietmar Eggemann Cc: linux-usb@vger.kernel.org, Rui Miguel Silva Subject: [PATCH 2/5] usb: isp1760: fix qtd fill length Date: Fri, 27 Aug 2021 09:21:09 +0100 Message-Id: <20210827082112.4061086-3-rui.silva@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210827082112.4061086-1-rui.silva@linaro.org> References: <20210827082112.4061086-1-rui.silva@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org When trying to send bulks bigger than the biggest block size we need to split them over several qtd. Fix this limiting the maximum qtd size to largest block size. Reported-by: Dietmar Eggemann Signed-off-by: Rui Miguel Silva --- drivers/usb/isp1760/isp1760-hcd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.33.0 diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c index b3a55c5d2155..fba21122bb00 100644 --- a/drivers/usb/isp1760/isp1760-hcd.c +++ b/drivers/usb/isp1760/isp1760-hcd.c @@ -1829,9 +1829,11 @@ static void packetize_urb(struct usb_hcd *hcd, goto cleanup; if (len > mem->blocks_size[ISP176x_BLOCK_NUM - 1]) - len = mem->blocks_size[ISP176x_BLOCK_NUM - 1]; + this_qtd_len = mem->blocks_size[ISP176x_BLOCK_NUM - 1]; + else + this_qtd_len = len; - this_qtd_len = qtd_fill(qtd, buf, len); + this_qtd_len = qtd_fill(qtd, buf, this_qtd_len); list_add_tail(&qtd->qtd_list, head); len -= this_qtd_len;