Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9770942rwl; Wed, 11 Jan 2023 09:42:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXuEkS5qNwMrINaklV9b/Cn3en9nTaif+9TXZbMCfa/aSapOMV4Tpwe6ulEouW5Pa/LFWwEO X-Received: by 2002:aa7:c597:0:b0:499:b53f:1c56 with SMTP id g23-20020aa7c597000000b00499b53f1c56mr9865648edq.38.1673458952993; Wed, 11 Jan 2023 09:42:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673458952; cv=none; d=google.com; s=arc-20160816; b=pogsp22qezHTGCN9S8grOZanpZhLof2cGy2UfzHyN8ww5U6RCNWGDe9auQQWw1KX7L 0UagRHld3xQSQdoFUN8yRKdFeMw+XJzDYwKaYuRZr5wuM27uPV5it+syVQHEZF6GUwkl Wb2Kfa9B+8RVmOVoP+h5qPmqQ74UH0Y4AAaY3tuRn8wzbGsTxylOTsYIU15yAQ77REWG F4ynME5AmyDXYW7LNsTvelJ/J9EWFrrEeVH/12vHOG5QjuiVyALcvCVCxxaJ9NoIJ2Xi PpX5mjPPSuRX+0AqU1znKkFF5LV9XKvt/Of0Rzc4rzL4xBqD4Ccw6V3G0WYH1KPFznCE ITYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=BufMsqlOmmyRV+XDYJhsyo4WkH0AKxC4lBAUlIrdNpw=; b=y3ihz0+Mj3TVVpOpOIBrdOi/xhDJn0V33vdQXafpdHaiNVa9UeN7hcOW4E7axF4dzE COqNiGuwjXH9MtrZs77IcYoSV6LZNaIGrBFQ4/+x3RgQJVvSRJSAX484C1VvxQghkSVG oJHwYQesUgoUhhPbCrlUtiB/kcxvLh66JXsWo7TtLtozhryNdeATvho8kDhLJbkPLE2x G+PDK4GHE8BopyrSNiDfoMMPkFSCU2VPsR7POstWwMx2c2MsUhuJVoJAKKfKCmVWBbGT uHO9K/C2AgixglCMZ1iGv6czPogbMbBLQtw8D2mZmj2S4E4fA3UObrTzC0sKiSykwGLy wLgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EjhiTHwg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m9-20020a056402510900b0046ca545887fsi18157269edd.500.2023.01.11.09.42.20; Wed, 11 Jan 2023 09:42:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EjhiTHwg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231510AbjAKRa4 (ORCPT + 51 others); Wed, 11 Jan 2023 12:30:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239626AbjAKR2m (ORCPT ); Wed, 11 Jan 2023 12:28:42 -0500 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E9BF3D5C2 for ; Wed, 11 Jan 2023 09:24:40 -0800 (PST) Received: by mail-lf1-x136.google.com with SMTP id f34so24575562lfv.10 for ; Wed, 11 Jan 2023 09:24:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=BufMsqlOmmyRV+XDYJhsyo4WkH0AKxC4lBAUlIrdNpw=; b=EjhiTHwgsLYT1dXXadNVuaLrEVqPaKDgcEk/n7llNSw4fOryw6ICtE72kHW7R4Nv1G xPJhEk3Ul+t5OPL2no5zC6lqaGrTYmNcEIHe+9YAtUaaUrUraNfYIa7htYIQ0QpYL6hF j/B4NujczzQGVUYvRfdA/NxTD5rHNJSiaXX6Sz7CE/Pm2S1+RRKv5YqKedMbvLKhZGsY VlxRjb0hEAOTGYrk93bdIGQKKqSTmTEz0U2tec/q69YaUizsmuCM+HlX9G4fUCXAaTvG rzB5CrEDDlzGtz23bsLMEkuzJdrZZuT2VHvvvnjMdcOY8u1U9t4JgHR8zdOpefZo5WVV 421g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BufMsqlOmmyRV+XDYJhsyo4WkH0AKxC4lBAUlIrdNpw=; b=Xeqlh/nq/vjQPCgc9DD7DBu68R4T1aJmiqw1ebo6aQcm4iKOtS9j4EL5aCgH/8MVq3 UeQJ1jI29U5IWWq89VGMIF/rpMEiWOV7zi57LA+raJalifXuGZbSTxuY2U2sxVt6/+ql yNEbYF8CGAgqhBdbaDqW5FndzH/HtIXibFAA6d/3eSCHvVhz4BtL0GTjJ2vB/RSfJ7nl pLJGtq5zoNvFVIQ13gxGxRh9ZoTnMknFAkELzrJKu63TjAj3v1Dctk1+RfFC31Ic/Iey d+xkKQazk7Owfoi6avVw4YzLj+f5eV2CSWxM3F2q4sTWY4fYOBCQ7gcNZiQzj/MGqwLQ zzJg== X-Gm-Message-State: AFqh2kqqg2yIL0JAhGcG6EZxiPvrnckPWKtejB//zkcu0uaz0jkxIVxX fyRARjotI8KAJEF4xIACx1M= X-Received: by 2002:ac2:43a4:0:b0:4cb:3a60:65cc with SMTP id t4-20020ac243a4000000b004cb3a6065ccmr9145712lfl.5.1673457878294; Wed, 11 Jan 2023 09:24:38 -0800 (PST) Received: from ?IPV6:2a00:1370:8180:6b00:a1a8:4887:1af4:637a? ([2a00:1370:8180:6b00:a1a8:4887:1af4:637a]) by smtp.gmail.com with ESMTPSA id q6-20020a056512210600b004aa0870b5e5sm2817544lfr.147.2023.01.11.09.24.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Jan 2023 09:24:37 -0800 (PST) Message-ID: Date: Wed, 11 Jan 2023 20:24:37 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH 4/4] staging: r8188eu: always process urb status Content-Language: en-US To: Martin Kaiser , Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org References: <20230110205626.183516-1-martin@kaiser.cx> <20230110205626.183516-5-martin@kaiser.cx> From: Pavel Skripkin In-Reply-To: <20230110205626.183516-5-martin@kaiser.cx> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Martin, Martin Kaiser says: > Remove the if clause in usb_write_port_complete and process the urb > status regardless of bSurpriseRemoved, bDriverStopped and > bWritePortCancel. > > The only possible results of urb status processing are updates to > bSurpriseRemoved and bDriverStopped. All of the three status variable are > set to true only if the whole USB processing has to be stopped (when the > driver is unloaded or when the system goes to sleep). > Not sure if it matters but we still have that weird rule that after 5 failed usb read/writes bSurpriseRemoved will be set to true Maybe also worth removing above logic? > It's no problem if one of the "stop everything" variables is already set > and the urb status processing sets another one. > > This patch removes the last goto in usb_write_port_complete. It's also > part of the ongoing effort to limit the use of the "stop everything" > variables. > > Signed-off-by: Martin Kaiser > --- > drivers/staging/r8188eu/os_dep/usb_ops_linux.c | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c > index 3fd080091340..62106d2f82ad 100644 > --- a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c > +++ b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c > @@ -44,9 +44,6 @@ static void usb_write_port_complete(struct urb *purb) > if (pxmitbuf->flags == HIGH_QUEUE_INX) > rtw_chk_hi_queue_cmd(padapter); > > - if (padapter->bSurpriseRemoved || padapter->bDriverStopped || padapter->bWritePortCancel) > - goto check_completion; > - > switch (purb->status) { > case 0: > case -EINPROGRESS: > @@ -63,7 +60,6 @@ static void usb_write_port_complete(struct urb *purb) > break; > } > > -check_completion: > rtw_sctx_done_err(&pxmitbuf->sctx, > purb->status ? RTW_SCTX_DONE_WRITE_PORT_ERR : RTW_SCTX_DONE_SUCCESS); > rtw_free_xmitbuf(pxmitpriv, pxmitbuf); With regards, Pavel Skripkin