Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1951840ima; Thu, 25 Oct 2018 07:29:15 -0700 (PDT) X-Google-Smtp-Source: AJdET5ecWBVpipw4HEIZD/tp37GnR0qNaohN7TeG1geToWBK3clh5oWMppFt1CXISezA3BT3qhvl X-Received: by 2002:a17:902:788b:: with SMTP id q11-v6mr1791118pll.54.1540477755938; Thu, 25 Oct 2018 07:29:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540477755; cv=none; d=google.com; s=arc-20160816; b=eMANGDcg6tyAw7Lk9Rac6DwyNEqQ4i9vYbYxjbHVvjOYStb3MFzlJ9b70Hb5yK480a 0y/ASA9ivHaEpLqIJD7bn/9y8BMg0/8a/83OlVMHW+MbL8qPbt8b2I9lxFiXxYFB3dYQ AseQHADGj0WAvrtl7XIh3RvP5sMt4+Cb9Bz8EkG/0kRL9XIbIgRckoEFIczSkAuXg+t6 k8T9ywcMy7+KAF7O/GZhxcI++VQguiLg/ZwpP2GFPwLfd4OvRGDQpIjOLocmxsio3eD6 w/ngXAzf5QPljSh0kAhmoQ2C3Th6PAyGT48op2JjLfT8lF9tvITKzPnqhXGr4W4Xg5II zlJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=FlQoR7y3z2rf5aidzsW/wn5eNW6qt9IpdG94BnkaAkA=; b=x4ErUVwjvI8ZH6wuQlTKrMn0z5nr5UwZLfBfhtHRoyK7BuAyThrDwavUbi4iwDo6Ie okerzYO5dtSPTc190PcYR0eh/qZKzTjCRvgHPIp4OUkg/B8nwjpUNFYnR0cKJdhyLXXQ sNPBdcd0y+N6WSklFwKov/EwYSjy6RSPUI/mvZfrlYLiBhIvrKpkQRQBdLyd+MlccOKX TMNSDWUYHgNqyGIulhX4Y+DKIER4o82vkbu/HcFVE5VqMOz+9UWEhVyhk6dpVWTToVf5 YuWkpT0Hyentn2vqlX3CB6Izk21XLVKUuuvSqmYS4p2fdcuaZTv6xEGaaQbNfEINagpu Ik+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BGUk1aKt; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y190-v6si8265247pfy.147.2018.10.25.07.28.41; Thu, 25 Oct 2018 07:29:15 -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=BGUk1aKt; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730647AbeJYWwi (ORCPT + 99 others); Thu, 25 Oct 2018 18:52:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:34736 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728763AbeJYWwh (ORCPT ); Thu, 25 Oct 2018 18:52:37 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AABE42146E; Thu, 25 Oct 2018 14:19:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540477179; bh=pGy5HobsbYYqzypKTF+BI0w2jeXG+jJi7EsGp7eQXDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BGUk1aKtf2AoqscbNfUqC5U4eKCjHusryrzxts5iYWVppuNwZTVl9627zN1UsnbdL wgZVGuz35IJQF1xFjs+r5iAuC98JZ9Q3ZAMe/+yVTWJP6vS1Ke/rbbbwCSy7Y9XcX+ kYWlgRyZN8DEVDNLPgZ/GJeU3hjr3jb5JCG9ISKs= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Alan Stern , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL 3.18 30/98] USB: EHCI: adjust error return code Date: Thu, 25 Oct 2018 10:17:45 -0400 Message-Id: <20181025141853.214051-30-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141853.214051-1-sashal@kernel.org> References: <20181025141853.214051-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alan Stern [ Upstream commit c401e7b4a808d50ab53ef45cb8d0b99b238bf2c9 ] The USB stack uses error code -ENOSPC to indicate that the periodic schedule is too full, with insufficient bandwidth to accommodate a new allocation. It uses -EFBIG to indicate that an isochronous transfer could not be linked into the schedule because it would exceed the number of isochronous packets the host controller driver can handle (generally because the new transfer would extend too far into the future). ehci-hcd uses the wrong error code at one point. This patch fixes it, along with a misleading comment and debugging message. Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/host/ehci-sched.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index c399606f154e..f9a332775c47 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c @@ -1604,11 +1604,11 @@ iso_stream_schedule ( */ now2 = (now - base) & (mod - 1); - /* Is the schedule already full? */ + /* Is the schedule about to wrap around? */ if (unlikely(!empty && start < period)) { - ehci_dbg(ehci, "iso sched full %p (%u-%u < %u mod %u)\n", + ehci_dbg(ehci, "request %p would overflow (%u-%u < %u mod %u)\n", urb, stream->next_uframe, base, period, mod); - status = -ENOSPC; + status = -EFBIG; goto fail; } -- 2.17.1