Message ID | 20231128133811.net.v2.3.Ib839d9adc704a04f99743f070d6c8e39dec6a1aa@changeid |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp4244560vqx; Tue, 28 Nov 2023 13:41:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IGfWyzJR7wwVg5b0FDR9hwH1MAFdFATFJtip1dBTrNKunAzkwy2yB3n21F1spGHQILfrsZB X-Received: by 2002:a05:6808:101:b0:3b8:4127:e48d with SMTP id b1-20020a056808010100b003b84127e48dmr18696979oie.21.1701207678757; Tue, 28 Nov 2023 13:41:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701207678; cv=none; d=google.com; s=arc-20160816; b=RnuMavoCwMTapwCpqRg6+dij+9Tk8dMts99XOsXnpbzVFxKsKsXe0iq3IiEOgn4ct2 PldHdii6InzpwY9f4OyrzpL4Q8ggPlclJEbV6vCkV9NQ1bEXR9eAxg+wivt//Vx9VNcU jWx1dpY73gZ4EvsG59Yhn/yUi71/YJd+5XBXuIalXtDXG0/De1M+a/wxj5W2C9NNxOhu Fa9sVSYq8Ru9gHp0vYA4cTkl6W8iuBOZ4yVFLzt1Ve+7YUud6/jgNttafqKl9oj0ewqP d/JZwwT/Y+cVTzESCViCb0Qqze7pq7UTIVAbSosrYcbtN2aDemWO8NmEXgaOSr0myfDm KjPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oQusyzrWbRXd2hWyvgtHM4eFYw/jkvHj52PFedjE4u8=; fh=D9dulkN/zvJqgx62bWffkTYlpM2spfXLLqBXpsKZOmw=; b=FfL+PmG7ta8j/U5BxQZqv4w6Tvzmem1kz7ih8UkE4KstEMoDOSc6rq/hNMnD/89ODc kmHDnpU4MCZCCuSJq7OtYczUjNTFeLD0MonAI5u2vWfOY7lwFfEuz8huzYCyomtZHdMg 9ha5J0OyCwBvvDljnBEEVfoHaNRph6kD/iHeyx8OjqseE3Osz/4S4Ugokish5ZZH3mjS LQ6lAp3gGN6CuCD9eZ7KJ8C8FwCCIbOt6jckd7a/Dv8ztFbmvok03FbumBuu1cRjq9O2 3L+lgutrAOFiu5luhZu5A8HtOz2hJ9yq289tzM13MzILuEJMqKGH31WvhdgQyesFRvB4 sgqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MNzPDxQQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id bw9-20020a056a02048900b005bdf5961d93si14556327pgb.387.2023.11.28.13.41.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 13:41:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MNzPDxQQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id DA68F80A418C; Tue, 28 Nov 2023 13:41:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346327AbjK1Vkd (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Tue, 28 Nov 2023 16:40:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbjK1Vk3 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 28 Nov 2023 16:40:29 -0500 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D94F99 for <linux-kernel@vger.kernel.org>; Tue, 28 Nov 2023 13:40:35 -0800 (PST) Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1cfc2d03b3aso23062885ad.1 for <linux-kernel@vger.kernel.org>; Tue, 28 Nov 2023 13:40:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1701207635; x=1701812435; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oQusyzrWbRXd2hWyvgtHM4eFYw/jkvHj52PFedjE4u8=; b=MNzPDxQQog82ruT0Pm86elahz2XWC9NgB+Nn6hJoKHKqMOhqgb6dksbftGKJSRVUSQ VWZZ5tdg8mEjIfj32a1vIinHRAVpbvALXGQ4Ncaboa0w8S1Ji6/AG49Un6J1PfJD3x8I a+EQtpP0JeS4nbS5CHHQgkxMAo2TmA3RGWD6E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701207635; x=1701812435; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oQusyzrWbRXd2hWyvgtHM4eFYw/jkvHj52PFedjE4u8=; b=joChyCfNrgUd6JLo2xm4SlE7Df2OPk3/gw0PkPk+W6h4UTv8hdMDUIQKLlwK7bGk2F EOnt1lTDygJKVAx9q8ZTUXDEjFFICXb6VTf9YUMxwfr0LKW+GI8t+vSY+jpH1DVMdHHP wOlTPQ6tdeL9o8nxIDeHy9xZEUd7gmukIGS2Waj4POKWVT5DGY2YhzvRyWxaT1OMCo+J AEBLhlp/9VsLvD2BV0UVYjhhKILhEr++zrpvyg2UHAfLBQ1L0s0E0FrUTiCeigKyJoBW mTZZv18KOTmStc2hNYJzT0cddWRc+ISJmZRh5BrCJKTQvABsnVI4HDhVS9Pdwx0Lo5ny FwDw== X-Gm-Message-State: AOJu0YxnPyKUdIhhPmBANPUOknQoCapVgCBqCcry8LGNPPnNye3n4O+I xVeeSJ5PnGrpZm7rmgk+Gd6lM6hnaxMgxC22qmQDSzyp X-Received: by 2002:a17:90b:3846:b0:285:9408:2fb8 with SMTP id nl6-20020a17090b384600b0028594082fb8mr15411756pjb.43.1701207634922; Tue, 28 Nov 2023 13:40:34 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:fc3a:13ce:3ee3:339f]) by smtp.gmail.com with ESMTPSA id ie24-20020a17090b401800b002609cadc56esm9634285pjb.11.2023.11.28.13.40.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 13:40:34 -0800 (PST) From: Douglas Anderson <dianders@chromium.org> To: Jakub Kicinski <kuba@kernel.org>, Hayes Wang <hayeswang@realtek.com>, "David S . Miller" <davem@davemloft.net> Cc: Laura Nao <laura.nao@collabora.com>, Edward Hill <ecgh@chromium.org>, Alan Stern <stern@rowland.harvard.edu>, Grant Grundler <grundler@chromium.org>, linux-usb@vger.kernel.org, Simon Horman <horms@kernel.org>, Douglas Anderson <dianders@chromium.org>, =?utf-8?q?Bj=C3=B8rn_Mork?= <bjorn@mork.no>, Eric Dumazet <edumazet@google.com>, Paolo Abeni <pabeni@redhat.com>, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH net v2 3/5] r8152: Add RTL8152_INACCESSIBLE to r8156b_wait_loading_flash() Date: Tue, 28 Nov 2023 13:38:12 -0800 Message-ID: <20231128133811.net.v2.3.Ib839d9adc704a04f99743f070d6c8e39dec6a1aa@changeid> X-Mailer: git-send-email 2.43.0.rc1.413.gea7ed67945-goog In-Reply-To: <20231128133811.net.v2.1.I77097aa9ec01aeca1b3c75fde4ba5007a17fdf76@changeid> References: <20231128133811.net.v2.1.I77097aa9ec01aeca1b3c75fde4ba5007a17fdf76@changeid> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 28 Nov 2023 13:41:16 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783845542695358927 X-GMAIL-MSGID: 1783845542695358927 |
Series |
[net,v2,1/5] r8152: Hold the rtnl_lock for all of reset
|
|
Commit Message
Doug Anderson
Nov. 28, 2023, 9:38 p.m. UTC
Delay loops in r8152 should break out if RTL8152_INACCESSIBLE is set so that they don't delay too long if the device becomes inaccessible. Add the break to the loop in r8156b_wait_loading_flash(). Fixes: 195aae321c82 ("r8152: support new chips") Reviewed-by: Grant Grundler <grundler@chromium.org> Signed-off-by: Douglas Anderson <dianders@chromium.org> --- Changes in v2: - Added Fixes tag to RTL8152_INACCESSIBLE patches. - Split RTL8152_INACCESSIBLE patches by the commit the loop came from. drivers/net/usb/r8152.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 5a9c5b790508..b7bbebf09d85 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -5521,6 +5521,8 @@ static void r8156b_wait_loading_flash(struct r8152 *tp) int i; for (i = 0; i < 100; i++) { + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; if (ocp_read_word(tp, MCU_TYPE_USB, USB_GPHY_CTRL) & GPHY_PATCH_DONE) break; usleep_range(1000, 2000);