Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp255431lqr; Wed, 5 Jun 2024 05:21:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1jlU/v+/MB25UlGWxMv7ggdoqPV7ErgvynBlG5SVLb3EUPPmtPtRwTBuhloXLFqtdNWvIIRD99FoVN7+iQsHKtMY8t6Yf1Pib7OnQAg== X-Google-Smtp-Source: AGHT+IGF0U1PtEf2bvunf5l2J760JdpjjeZMIck3eKMD6IG6aymr9E4zmaYDd6oFBHUpkmExfaTX X-Received: by 2002:a17:903:230e:b0:1f2:f7ea:125c with SMTP id d9443c01a7336-1f6a590a9cemr30303025ad.10.1717590109895; Wed, 05 Jun 2024 05:21:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717590109; cv=pass; d=google.com; s=arc-20160816; b=uJgHJMDc2Pl1bvkeEVuEuIRRR7c3SjiSWIwkbD0bbDgMSVANDu6urJMCPATRm97RCN rklzXk+MK8PH2SJHm/5VHAwFPUrDuknzy42qrEEMxXl0hFu3M94/Y6mwy7JcfyXh/CKx ZIDCvqNd2oG/NDrGFubqKhEmByfhq9rWSJXvi4BtZp1AOyia3OKwGkjz8hqybSky5oaw VWTKZt7M2idbDZYw863C5snQRDeYikjTNai6hXxjk7wtj6bGn33xdAc+9o5vTl0nV96W Xpuo6+3VD2+XuL8IFIEbqjFrAvGwcI5srEahq+HF92eRNUZwo5beYBpvCO8+v6BRnkmn TBbg== 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=ONrE8hXnTRxMLjHgKzm/xnbqI+0knFDArmg6rY/GVjnRgRqc8+Ps6NiiGLkHNgohKF Qf3gVY/mxP2o7GXNm/Obv1U+32cY2jMWzo5vKNkOtRz2tTWkgIj6AygS0ZvttfrrwzSM 0AmyyEnOQuGaPoKiPDErzlFrasgzRN7zdaOkT4bvnDSvhGYBXGkLBSqud8SoNjeHCBe2 o3WgDeaqpydL5iuzLzDdXfot/d6ND8gYgzKjRRuo9dGc0jSXaLD8HlJLHjT3L7/hQJ1g 9vNKvqQ94P7f02QsySFRUW+++xQR0rY7EcdrhM8uGvDJXmsA5SiLxnU9Nn9s1if1WyZk 8myw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qizhYNFe; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202380-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202380-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f63233d24bsi102837425ad.90.2024.06.05.05.21.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 05:21:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202380-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qizhYNFe; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202380-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202380-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 77E482887C9 for ; Wed, 5 Jun 2024 12:10:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4136C196C6A; Wed, 5 Jun 2024 11:53:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qizhYNFe" 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 63C42195F3A; Wed, 5 Jun 2024 11:53:39 +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=1717588419; cv=none; b=kmOHHIJ+QfnMIpagOHmf7p0FFV8aNFlWY34bDQlkkbg1epqZ4YFf6xny7Vcq3JtJr1uhOAUoWNnJ0y1fn1e/9GZF8Yyp2xgw9SuVyyper+vjygePYPwfhK0+ikrcUzqzUnOGOx6aKog+uvZ4XK/STodW2vCQVLXFc9+ns6VNG/k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588419; c=relaxed/simple; bh=Lt+FpEM0jPpr3XwvPw7UJ/AendB5vN0IPjs2xeR8CQQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OUnVbogjvhQt8WrNurOeXArK82O9ju0sXBh/Xb4Bzmq6qFI0K7pkmqfq2DrCILaK6HpAT7rUfb28qR/zXdteEqvj3gNtFgUaiwGcitp9InPeVa0qU8xdOIAzNYDKV71bVVPQD7fp2WEu0JfpQYbOEfXP5dqA38hTRmwJJL8ZPO8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qizhYNFe; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B97AC3277B; Wed, 5 Jun 2024 11:53:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717588419; bh=Lt+FpEM0jPpr3XwvPw7UJ/AendB5vN0IPjs2xeR8CQQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qizhYNFeVpipdfNcLhCXSCcfNy4+ra80dWx24mG5gcjDZ940hHpWsIYhguZ0yzq9K fz/yuumHG1b23iDnOAF0ylL3aVEmakHj/sbc2smplLXwnN1tDbmqjBHbz6hDzxOE4O 2kTi8HYcDKzvgg+kDxma+BZSjMrJ3TaJe+eKUaa17bmRAi8BmhvYf1FPvQfQqG8Dn9 4LgeqCU6h832lbnrErYWpW8Nun4LNsON7HONjyvTuMSWQe6VUxta6Aw9FMTM/FXUM+ 59eY3R+bKbyeGjHgu+GhLKwCn8qT2LmqcnEQBCsjhmwMgpszXfhtn6KXi1sc8JBtTk xkakowAgQcJFA== 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.1 02/12] usb: misc: uss720: check for incompatible versions of the Belkin F5U002 Date: Wed, 5 Jun 2024 07:53:07 -0400 Message-ID: <20240605115334.2963803-2-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240605115334.2963803-1-sashal@kernel.org> References: <20240605115334.2963803-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.1.92 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