Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1019837ybe; Wed, 4 Sep 2019 11:14:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqxclbvMRY5sQ+Fj8gBmJ1ZtbDcEO8A1mSNsLDVWrqZCSZy7b3Sbv8jwwGCreONjAftRfbhC X-Received: by 2002:a62:60c7:: with SMTP id u190mr48250675pfb.54.1567620867556; Wed, 04 Sep 2019 11:14:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567620867; cv=none; d=google.com; s=arc-20160816; b=SZPLcfCBRcQd2kJUKFbFVNAJSDz0ComGXWYVQQCdokkOvEfP+3WKBhQguu1Pe3FZjv i/N0VOjozI2BIcXDR5oGtHkWqujW0RajhD9Q0NU5BcwXH0amGqzX6SRKDudAKtHL42dp Wp7BNqnFEUZZEOVOP5Ma0FtFYokmReuZaa1g9+U8vEAveSa4wM6X+JlOb7lsHlKqLu5N FgGicIpuYoGQgyJaM9JyZud+30yT9pflfHLmEyemQdbWRoSW2OB1slJBbhS0OLvZ7E3L NDAkS62YTUzC2OHkFZ/8X0kXmFQ4gk06LEee2xUeGP/htdSsa2ifFcEDt99m/oktpgUM b8JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6h5lwyYlIlA6wFVfNBzZK1g7wFue0l9vxCXNT0E1RMc=; b=MNThexojaj5lqsUm5ZSRYsyqjjLBFq8K9VXr2DbnEnK2jfhLyH5m8tO872ofpQUXvI GEewVRazG48XBSWi65ZcQi7TuxmsMsVw5ak6QuRZoN6Y9kKrAP+zBNKKhCThvQwB/jq6 niXb1NkEM7VT4V3T5gyZRIebBHjHxoQi7sY8zDUb9rAK6THA2LiDfYcKveeEFpuWOt3C VEWpEpivYpsUCiq7fWUWA/ExZ+mkTbofFyDuq65UL2Ll/QKRezGDBgQWr3lWD5zLN4FM m9MZKUwu5kitGnGBMAnoW/rjI2bUddcJBgMHz2KO81PDdz3Hfggrx3bHHJTg+lhMBXW1 Ax6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q8mCAsRL; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o3si2836304pls.424.2019.09.04.11.14.11; Wed, 04 Sep 2019 11:14:27 -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=Q8mCAsRL; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390568AbfIDSMt (ORCPT + 99 others); Wed, 4 Sep 2019 14:12:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:57304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390566AbfIDSMq (ORCPT ); Wed, 4 Sep 2019 14:12:46 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AD798206BA; Wed, 4 Sep 2019 18:12:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567620766; bh=0yclGDOg7Dy3vf9xGWlNF8+UryRlkRqDD76l1GgU0bU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q8mCAsRLxDdLQ8csIIyKKyR4M4azpP38m7Nr0JZO4c9PQjdkr/7p9B17XkLyX4ErF jW5akFGtRGA6tvJ+LLjy3UEhWWBjhlhRs/UcPkHgKqZUGO3Yf4/KiEdjIfoFvDcbkx 7sIDvFx9whM/1XU6QgXZdk6gb6idaZmVX8Z59xmY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kai-Heng Feng , Alan Stern Subject: [PATCH 5.2 086/143] USB: storage: ums-realtek: Whitelist auto-delink support Date: Wed, 4 Sep 2019 19:53:49 +0200 Message-Id: <20190904175317.437575744@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904175314.206239922@linuxfoundation.org> References: <20190904175314.206239922@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kai-Heng Feng commit 1902a01e2bcc3abd7c9a18dc05e78c7ab4a53c54 upstream. Auto-delink requires writing special registers to ums-realtek devices. Unconditionally enable auto-delink may break newer devices. So only enable auto-delink by default for the original three IDs, 0x0138, 0x0158 and 0x0159. Realtek is working on a patch to properly support auto-delink for other IDs. BugLink: https://bugs.launchpad.net/bugs/1838886 Signed-off-by: Kai-Heng Feng Acked-by: Alan Stern Cc: stable Link: https://lore.kernel.org/r/20190827173450.13572-2-kai.heng.feng@canonical.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/storage/realtek_cr.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) --- a/drivers/usb/storage/realtek_cr.c +++ b/drivers/usb/storage/realtek_cr.c @@ -996,12 +996,15 @@ static int init_realtek_cr(struct us_dat goto INIT_FAIL; } - if (CHECK_FW_VER(chip, 0x5888) || CHECK_FW_VER(chip, 0x5889) || - CHECK_FW_VER(chip, 0x5901)) - SET_AUTO_DELINK(chip); - if (STATUS_LEN(chip) == 16) { - if (SUPPORT_AUTO_DELINK(chip)) + if (CHECK_PID(chip, 0x0138) || CHECK_PID(chip, 0x0158) || + CHECK_PID(chip, 0x0159)) { + if (CHECK_FW_VER(chip, 0x5888) || CHECK_FW_VER(chip, 0x5889) || + CHECK_FW_VER(chip, 0x5901)) SET_AUTO_DELINK(chip); + if (STATUS_LEN(chip) == 16) { + if (SUPPORT_AUTO_DELINK(chip)) + SET_AUTO_DELINK(chip); + } } #ifdef CONFIG_REALTEK_AUTOPM if (ss_en)