From patchwork Fri Aug 27 13:11:51 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: 503399 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp1254174jab; Fri, 27 Aug 2021 06:12:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIWWcy5IQufm4uFfXZhn7mfCUgnbwjsS4v1ywDaG0M0GM16Z7c28V/7nsP5R8hG3cDTmMq X-Received: by 2002:a92:3f06:: with SMTP id m6mr6962772ila.182.1630069937930; Fri, 27 Aug 2021 06:12:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630069937; cv=none; d=google.com; s=arc-20160816; b=Umu8EWYMJ7cMphSfNOkbUWMyf5HAuvUrZJBSLuWr00pVrrQZonpPRNGb+bYgLdMmpU Ff4BWH8THm+dhkI3cASmFvzP/DEk/H05OMQXRJf8WUKdG481ebNcPfVpfJHY2nwn/a5c jpgPm4aq8KoC0gGhtUlhswEmgo5AVdWYCCB5rni0qS+jXGnap6Tihe+boBTX063AiRmf JROffJsihz/RownQEMWjfCIVsIX+ia6KJ2vKw206JZ4VhquCy5W+h9Tt0IWI2MXkRrlH p419Ugt6YhkeJcZXDdNgYq2cdFU0h8pRJ235piayvxQJV6VFV+JRYGBtvw1ih7HS55MX 6okw== 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=Y607GohRHj140++t/bVDBujNiOGNimlRlENuyUmlv6A=; b=uQ2Z3cMXqL1L//YI0656DehfoLWPI5CvBgFOHy80tTg8296VcBlsnKgCfdG8DFlgPQ BBxS4+WOGVFBiKwkZjvNflNxE54Un3KWPhkY2Bwyc0H6BCbAUZeKb48x7zy9lx1Pvxl6 2VhK0+ywCWb4JcPRsGs8+VixYxPea8AjT7iGEGGYIcRKgQU9K1utRGlsMZINnemUM3Ub aPgl7Z13o0p+z42Ruuj/JBGakfThu1mngp0x9nYfW0E8rTDYteo8GemWU8GVk/mWaCxZ 5q8Pm3oXI93xYNJxZ1mQdt+znoEA7jkZAM2w3Vfo+eNQQAjj0N5wZB/JexywGqRriBHY xROw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C7nHbTlL; 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 v66si8124989iof.105.2021.08.27.06.12.17; Fri, 27 Aug 2021 06:12:17 -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=C7nHbTlL; 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 S245182AbhH0NNE (ORCPT + 4 others); Fri, 27 Aug 2021 09:13:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245181AbhH0NND (ORCPT ); Fri, 27 Aug 2021 09:13:03 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C5D2C061757 for ; Fri, 27 Aug 2021 06:12:14 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id i6so10375133wrv.2 for ; Fri, 27 Aug 2021 06:12:14 -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=Y607GohRHj140++t/bVDBujNiOGNimlRlENuyUmlv6A=; b=C7nHbTlLc3gN7Gb40cRm587VXiYRlYZ658KbJSCQKnUt2qaC+wZj2VuXMXwZitUvWR ds0YTO69ytKcQ+VgvECBLfaS0z/0kK6iuRZR5ciXJgYIiGrehm5b5RDl/UD/luN0o152 Zcx8ReLeowxhaFd3SzlLgcg4joVUIPOz0cDZHo5ksnkL2kTJWg3j9BVIRrzm78B5Ya/G UH6Yz70jO8MjyXZmssK2eiWpxoJSkfmbJQmv55rCZdDPoUopVwyUxoGgEAr7hArIKtdN CcuUX8AaSmYYkEFy6gJLg4WlA3TI9umdMNXysQJtlHad9SzFOFUnyxbtIH2zKmnnCi6n gmKQ== 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=Y607GohRHj140++t/bVDBujNiOGNimlRlENuyUmlv6A=; b=s8alcoSHc+XeR2Tksg2NED7SwfSyv2kACF5+eo4cjJI/SwnFnGfLpzgokcnRZlf2MF 7AhDots65QDZ3blVbHoERyORGvF96AvZk7MQbfAq5x3+daRbxRds3hCdGRxoIoxlbamo 0KozF/s7mhM2KRHqoD4f8rkRxlbCbYROwCqk/kl8W9KBzNklQNef4YBjCTd22J/9cd8U LAmzegkHvHg1brd4ZM4s1Ka9tbdIusYxTfCIp7RzvSVwwesxCih9gcb7Obq4B2wUZD1l 3AkxTfw0KcClZJ+RE4d53Vg22qIbSiaYdsM6EKf0w3sx+wOOOzjuUwCBDA0zdW7SiCCd lGXg== X-Gm-Message-State: AOAM5310a4hP8BNt85RFGt+7dGkkmkvm6rJ7hnfEBliv7COzP2s/JlSb BumU3Uv/2YMH7HcLpC1nVbLJbA== X-Received: by 2002:adf:9f51:: with SMTP id f17mr8469983wrg.301.1630069933001; Fri, 27 Aug 2021 06:12:13 -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 c7sm5279349wmq.13.2021.08.27.06.12.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Aug 2021 06:12:12 -0700 (PDT) From: Rui Miguel Silva To: Greg Kroah-Hartman , Dietmar Eggemann Cc: linux-usb@vger.kernel.org, Rui Miguel Silva Subject: [PATCH v2 2/5] usb: isp1760: fix qtd fill length Date: Fri, 27 Aug 2021 14:11:51 +0100 Message-Id: <20210827131154.4151862-3-rui.silva@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210827131154.4151862-1-rui.silva@linaro.org> References: <20210827131154.4151862-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 Tested-by: Dietmar Eggemann --- 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;