Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp240677lqr; Wed, 5 Jun 2024 04:59:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXMpeyIG2K6CbtjxFwndVTMHDg4/Gp264mDazTEx5ldMwdH3TrLWJ1HmucfyTdeMYnwzAn/Ztx44mQwfO1+O8HBywdlZP8YI1INS8SyXA== X-Google-Smtp-Source: AGHT+IFyJV/CWLfATfOQDVAEnHZF7dJQNJLccsaS2Oqb4JyAfgj6clvTSNHyTO1GDuKKjxFEfRDq X-Received: by 2002:a17:907:80e:b0:a63:41e4:ee57 with SMTP id a640c23a62f3a-a699faa8568mr192820466b.15.1717588755092; Wed, 05 Jun 2024 04:59:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717588755; cv=pass; d=google.com; s=arc-20160816; b=zXxn4APvuoIdh6SkhEBUuERoTWuKalHBGjYBAAhpSd+WWXRvkrYyfvhPBHZWYFc8MS xvvpj01nZZnF/e59dhMomNBiL/Np5JbwRrXP2k4WvLWBhLMTSgsb0KdncaiuP5UWmwOF u20Q5TCgTp2UmzKpvzt/RWxkcN3y3d9Rug/mFviD3+tkVCV4qrzLhAvBi+U4QS9HkHRX wpWSAy/rgQSLsuYyb/1hyiVmjg87Ba2am/M0ccO902qQDJKe5LdebgV/RlrxCVQJ5cU2 8dYktwhRnqO5y20rDxMcXGUjFYq096B4MUTYP1WgytFrIvzxGcbLyDEazqSrDEmTRT6w yg3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=M5nkx6vG0vBfUFRlRrA7ckQT6AS4jUOTFonTF4ijpxA=; fh=i3P+QXLBIYF6eCDeZ96TRPL0fgAjkcVhsLOlMU5kcE4=; b=m0ifCk5zV8L+WNjDz9xhqCGXYpiEjpuqyaSCSG/FSC5RpY5Kf9zEqUET1hw2coN6rt lbqvBF85ZHUDP9LnjWUpRGI7OJ4Awe4wvejD75reSKb0CugCw6yp227CalUJtNafqVxu 4KSPxOkFDHaVypjsN26tnkP1WhiRp7AsxFdH8NLy8v53HEBMoxV+WrmVaAnsgJRgyRYz bGlqb+Iqf4M0RfAkRglRbAmzLhFfZuqE+XjO5Pl0F9VbSy+36ucAmYkwP5XOpzEqFo5G vn4g7EIofEAWQI17J69x4D1P6wXEU96wXcQ3HW+DvfZFDlWBl55knTUBRGpPfp5vv8+3 e1dQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SONaxWk8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202335-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202335-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a69391f7f6bsi197696666b.760.2024.06.05.04.59.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 04:59:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202335-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SONaxWk8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202335-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202335-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CD2A51F242B1 for ; Wed, 5 Jun 2024 11:59:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 577A119E7ED; Wed, 5 Jun 2024 11:51:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SONaxWk8" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79E3119E7DD; Wed, 5 Jun 2024 11:51:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588271; cv=none; b=jRCTr1MVRc2CZW7pXbPyOxgcavIulc83z1ateRuEnyon18wkxRd8ELagj1/FKE5xBS6clNldGpeBGVZXTG1+czkKzJPSoHlczFslS5LtBorVVWqMeWHR4QQkvDgeXLPQXAdvXxMDNejpGkeDaF6+VaJ7LZTLEy4+Irks/JHqgLw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588271; c=relaxed/simple; bh=Lt+FpEM0jPpr3XwvPw7UJ/AendB5vN0IPjs2xeR8CQQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YXeUkx8CAWlMrHv4ZprvJgdfOU3G8JYevbvDvdUvarYhHyqmVsIC+/ua4QdC5Ldmh5DpuyUV7mZIhIrecWWhv8lRcZ3jKchb44w4D/IQ0D85R+elqR5Xa9nRPuXdff6XrRfowXT+lfI1PIfyvK0bB3nHMjPJ/1zg54WtFbK8CFM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SONaxWk8; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87FE1C32781; Wed, 5 Jun 2024 11:51:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717588271; bh=Lt+FpEM0jPpr3XwvPw7UJ/AendB5vN0IPjs2xeR8CQQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SONaxWk8cDU0EO1mY24CQbgoVBinXLE7FzUcPy0xAPeK5wrQOpfFtR+QyFgbqKC7J bNkCQZjlmuT7vWo+rWF4UMsdKUD9cdvopPEqpeSOWv2jEkPPHHb4RGFo8sX9GlcL5l Anfksk+nRUmJvKuKfUnGvDUD9VjG5YX+I7jrrJC+ib6z4QTHqR4igzqWwwnjZbZPVG fc9s21OtT2gnJPzmVsgPX70NdaBdLQlsQJl+csukzgOwLMqTvK4p9+DkB0AHttlHo5 3A4ktfkKiT5IFCj1hT+A1og26NocyddG9JHY2Q5uKrWl8O/CrSHVO1KcReaCvq/Yha q1jPPPkSh8lIA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alex Henrie , Greg Kroah-Hartman , Sasha Levin , sudipm.mukherjee@gmail.com, linux-usb@vger.kernel.org Subject: [PATCH AUTOSEL 6.8 04/24] usb: misc: uss720: check for incompatible versions of the Belkin F5U002 Date: Wed, 5 Jun 2024 07:50:14 -0400 Message-ID: <20240605115101.2962372-4-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240605115101.2962372-1-sashal@kernel.org> References: <20240605115101.2962372-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.8.12 Content-Transfer-Encoding: 8bit From: Alex Henrie [ Upstream commit 3295f1b866bfbcabd625511968e8a5c541f9ab32 ] The incompatible device in my possession has a sticker that says "F5U002 Rev 2" and "P80453-B", and lsusb identifies it as "050d:0002 Belkin Components IEEE-1284 Controller". There is a bug report from 2007 from Michael Trausch who was seeing the exact same errors that I saw in 2024 trying to use this cable. Link: https://lore.kernel.org/all/46DE5830.9060401@trausch.us/ Signed-off-by: Alex Henrie Link: https://lore.kernel.org/r/20240326150723.99939-5-alexhenrie24@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/misc/uss720.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c index b00d92db5dfd1..eb5a8e0d9e2d6 100644 --- a/drivers/usb/misc/uss720.c +++ b/drivers/usb/misc/uss720.c @@ -677,7 +677,7 @@ static int uss720_probe(struct usb_interface *intf, struct parport_uss720_private *priv; struct parport *pp; unsigned char reg; - int i; + int ret; dev_dbg(&intf->dev, "probe: vendor id 0x%x, device id 0x%x\n", le16_to_cpu(usbdev->descriptor.idVendor), @@ -688,8 +688,8 @@ static int uss720_probe(struct usb_interface *intf, usb_put_dev(usbdev); return -ENODEV; } - i = usb_set_interface(usbdev, intf->altsetting->desc.bInterfaceNumber, 2); - dev_dbg(&intf->dev, "set interface result %d\n", i); + ret = usb_set_interface(usbdev, intf->altsetting->desc.bInterfaceNumber, 2); + dev_dbg(&intf->dev, "set interface result %d\n", ret); interface = intf->cur_altsetting; @@ -725,12 +725,18 @@ static int uss720_probe(struct usb_interface *intf, set_1284_register(pp, 7, 0x00, GFP_KERNEL); set_1284_register(pp, 6, 0x30, GFP_KERNEL); /* PS/2 mode */ set_1284_register(pp, 2, 0x0c, GFP_KERNEL); - /* debugging */ - get_1284_register(pp, 0, ®, GFP_KERNEL); + + /* The Belkin F5U002 Rev 2 P80453-B USB parallel port adapter shares the + * device ID 050d:0002 with some other device that works with this + * driver, but it itself does not. Detect and handle the bad cable + * here. */ + ret = get_1284_register(pp, 0, ®, GFP_KERNEL); dev_dbg(&intf->dev, "reg: %7ph\n", priv->reg); + if (ret < 0) + return ret; - i = usb_find_last_int_in_endpoint(interface, &epd); - if (!i) { + ret = usb_find_last_int_in_endpoint(interface, &epd); + if (!ret) { dev_dbg(&intf->dev, "epaddr %d interval %d\n", epd->bEndpointAddress, epd->bInterval); } -- 2.43.0