Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp253752lqr; Wed, 5 Jun 2024 05:18:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWkHP6tJ+W9IM7wLG4+v83yNUa0laT1FhV7VPkn+WJ2nR5T5aJJGQs4X8mNKaJrYcBUeIbKuEmQF5LpbLx+B7VyKsp4XV9YCAUmdF41oA== X-Google-Smtp-Source: AGHT+IEDlCLz6FTl37Kzv8xoGVOWnx0Pgc1jUQPVyCTDedCov+NlNAFW4J59lFh62ld9yN1laOSy X-Received: by 2002:a17:907:586:b0:a68:98fe:f779 with SMTP id a640c23a62f3a-a699fac1fbdmr136198366b.43.1717589935272; Wed, 05 Jun 2024 05:18:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717589935; cv=pass; d=google.com; s=arc-20160816; b=UjmXx+D4bxBseB75A/WXE9nK4lIXnjQBti8CWP7amf3w24S2Of7FYaornxsBzx2Pij Xez4ybHGLvrrwawv8HyafdfZ2+OZvHOpptjsJb6KKRowwutfJ8HzirowCSmhpaIsRwiG j3TfHmCA/F7Y9GeGQ3AlP4QsqNEletbVKP8Ibi8gUniuU/Owl2nsaZ+eHzqOGV/x1LBQ ERpjxeR2s0yA89uXfg1imQKF+mLGNuByp/ikdPRr/F2cbJfuyceJ9FyDCkGRFYewb8Nn i/aET5ggak15mDzUOtkKsAKUjL/3E7l/c0m6RC0Vb2wLZ3esdmkdNuwWXOFLZsjvenHm 8qSw== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=aV7BH4bTJ0KS+deiZLyoHPi2CIE4mm9DS/9jLD7oBFw=; fh=i3P+QXLBIYF6eCDeZ96TRPL0fgAjkcVhsLOlMU5kcE4=; b=Ec3vJp0/FgqXkHEVXPqB+0oy5ST9HKCwk31yCCH4dLRACrGLmLBmuuKRgD1ftYCzX9 PN47tG27zQqX1r7X2f5HEwom1S2QxyHNs0rRb2RqE0AKWvdjDNm9TOkEhbCQUTLD/JBy 0+BjNbNJyWMp3EiOkoSQ/4/9HQ3jwwP6Oz+aka7YVsinJuH6PGmPA1/M6z2yIY9RRccX H5XwmSYewwoxu5nCO9isvfrnCkvsGa5w12YKMM7l4Syph6f6OdijCd4Tzx1kcszO3dU/ 2ZlU8zzgC4T4jCSw1YYndsefgd4UloFdM2auflsl85DXX1N4MJU3l8zPxuPtgsQlIZ3A Xmzw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mmxHA5v4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202414-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202414-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a68b93949edsi469939166b.112.2024.06.05.05.18.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 05:18:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202414-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mmxHA5v4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202414-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202414-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 CEBFF1F21973 for ; Wed, 5 Jun 2024 12:18:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 754181BA87D; Wed, 5 Jun 2024 11:55:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mmxHA5v4" 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 991321BA867; Wed, 5 Jun 2024 11:55:20 +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=1717588520; cv=none; b=L/27zTUwIRRoA8Nr8usac2J+6RMaf9vZd4+J0Cg+vNU6/8FkQaW0SbETqrz5qmxIt7bta6UWcJb/xuoLsQ6M2Cd5agAZBsQN6xir3qMJhoNNsKsMdeufP8UxpXpwY74WHPICE/e2A1Yc/opiI0tt//BHnG2K3wklxLnEAc5SP1g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588520; c=relaxed/simple; bh=keKYWfzN1djD6KLmxuPPa4XdGqVyHQTp9UFTeJAwljs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=oRJPIlEFjm7zqqgnsdlT9XjkxoAIMHsYIl4GLXtToa5BnqPeEbVLFxoYl6HI/N/Qa2WiTo9s3LYibhBYaRjgZbpepIImEeRlLkFdB8CViR2Lboe2Xd6cT422YvnKjITS6il8GXnZwBN/42jfLg2Z8cQQV+uHT/UNuoI87WPBnMs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mmxHA5v4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8BC1C3277B; Wed, 5 Jun 2024 11:55:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717588520; bh=keKYWfzN1djD6KLmxuPPa4XdGqVyHQTp9UFTeJAwljs=; h=From:To:Cc:Subject:Date:From; b=mmxHA5v4VSrbjUI6RLb4wp/u334tvAzC5AKi5cx/4dJvbRRK+WTtS0F7WghboiSgT XGNLsPGs4mN/L1rj0MbWIiF9FenBe6NXj/NSCijJEwl2tvWCOYTBNJytDRbadG3iEF HuPtsQow7CkShCvKlBF7BCyny2EP5VeQ4Rbop3sRSgOlT+qGfFIlGVHYHJ48WlvVh0 21SXfoZ133mJYH1fh3AlypZtZZ7a69lGUsYMAMfegHqio2bBYOH9YXI21ykSK72iKO wKqCyFGYYT4Dp+0BoycfVWvtjA5MckquV7Gj7UinvQyfwbDo9Rbq3KViIsVXu+xXXS /Xks8iEArxtqg== 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 4.19 1/4] usb: misc: uss720: check for incompatible versions of the Belkin F5U002 Date: Wed, 5 Jun 2024 07:55:09 -0400 Message-ID: <20240605115518.2964670-1-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 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 4.19.315 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 0be8efcda15d5..d972c09629397 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