Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3147063pxk; Mon, 21 Sep 2020 06:29:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRDzf/V3pgQPFb1MxJKBApMyZtcT4g5XiphIpi6V5aH9kmq5nESHwf3N8Ml+tXKpijyvlF X-Received: by 2002:a17:906:fca7:: with SMTP id qw7mr48809904ejb.522.1600694963067; Mon, 21 Sep 2020 06:29:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600694963; cv=none; d=google.com; s=arc-20160816; b=E1fH9DIJeMlBKTkp166fdVhqqoACfmkSrYFDPmkuLBmwZIugHspcogoXYIkI5MEc8c 2XUqzmY3XUsoHGkDKSFXKyk8ZsjNw9SIUhlne3Rbn9md6Qq9+bhXE6r/EHe4jN4IxkRe 91zMcJa5bf1DTsGlvszZMtNwqO2EtUrQPHwt5rBpR//3+asWs007QaFuZoCg8bcL/gv0 sPTQDwqs4QI7YqywNy2/g4MJHSrPlbXgb6qd/FTg8+M1lE6VMSrMSs0ImwkWXqPKu2KY PZ6u0ysQ3oOQtxCPiJ1rqY20yjdh+Y2UQYJT8oMUAoqJpBS96UpzYMyoUlXPQYSwVwrE E2qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dmarc-filter:sender :dkim-signature; bh=C53ue0U8/k0fuC8DXorjXPpqPEUUSnVbCeTh+Io7v/U=; b=tGGPLu1slQ3AC51wCANSl0Gzd0wvNXMp+MlAb31m/q9sUADVaXQkWYZPdsjKPi7ND4 Nt+anjDGMJeJvOnegS714pwhf8kKNcjjngYyVafL0EucA5unS0NNelEsy2g8Gu1D+GLR kvxwbeJ54w+BY4G5gMahE051EWOK3xVKgQMHAWYwvAIGVyCCPnpdBi12yQly77nknDw+ xyMfQ5RDOnn/9IF5l3Z43jE3cVvl5Oxt9moZyeJzeT2PQ+hkhL6uMO1DeuH4KrtoOnXj b0HSh3Np69eSxN3OtVUb+Ylxh4j+hWlTI9tMnfKKg1VxYr5+pwFZduAuznuY0P3LDPCT 9j9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=eNefw6O8; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n18si6456505edt.207.2020.09.21.06.28.59; Mon, 21 Sep 2020 06:29:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=eNefw6O8; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727216AbgIUN1y (ORCPT + 99 others); Mon, 21 Sep 2020 09:27:54 -0400 Received: from m42-4.mailgun.net ([69.72.42.4]:24558 "EHLO m42-4.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726689AbgIUN1x (ORCPT ); Mon, 21 Sep 2020 09:27:53 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1600694873; h=Content-Type: MIME-Version: Message-ID: In-Reply-To: Date: References: Subject: Cc: To: From: Sender; bh=C53ue0U8/k0fuC8DXorjXPpqPEUUSnVbCeTh+Io7v/U=; b=eNefw6O8rmg53pwQiefbTE+swntG30gsZQzdnyDEouQ32BBtVZZakw1pfB+gzWN6bkhyKs3Q O+QhNVgmXt5shXwiiKMjfRwFsXo+cj/7TcAZXxsS5uI9QiEQMQWewj+mM0UAA3Si0w9nkUM8 OtC1MIpplo2u4Lb4KmXhictcCO4= X-Mailgun-Sending-Ip: 69.72.42.4 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n04.prod.us-west-2.postgun.com with SMTP id 5f68aa4a2131f7663a9775bd (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 21 Sep 2020 13:27:38 GMT Sender: kvalo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 75A49C433F1; Mon, 21 Sep 2020 13:27:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo) by smtp.codeaurora.org (Postfix) with ESMTPSA id 679DFC433A1; Mon, 21 Sep 2020 13:27:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 679DFC433A1 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: Bo YU Cc: rmanohar@codeaurora.org, linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, kuba@kernel.org, davem@davemloft.net Subject: Re: [PATCH -next] ath11k: Add checked value for ath11k_ahb_remove References: <20200621095136.7xdbzkthoxuw2qow@debian.debian-2> <01010174681bb751-308defb0-0333-43ee-99ef-7f1d1ee3358b-000000@us-west-2.amazonses.com> Date: Mon, 21 Sep 2020 16:27:32 +0300 In-Reply-To: <01010174681bb751-308defb0-0333-43ee-99ef-7f1d1ee3358b-000000@us-west-2.amazonses.com> (Kalle Valo's message of "Mon, 7 Sep 2020 10:28:01 +0000") Message-ID: <874knr5kfv.fsf@codeaurora.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Kalle Valo writes: > + rajkumar > > Bo YU writes: > >> Return value form wait_for_completion_timeout should to be checked. >> >> This is detected by Coverity,#CID:1464479 (CHECKED_RETURN) >> >> FIXES: d5c65159f2895(ath11k: driver for Qualcomm IEEE 802.11ax devices) > > This should be > > Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") > > But I can fix that. > >> --- a/drivers/net/wireless/ath/ath11k/ahb.c >> +++ b/drivers/net/wireless/ath/ath11k/ahb.c >> @@ -981,12 +981,16 @@ static int ath11k_ahb_probe(struct platform_device *pdev) >> static int ath11k_ahb_remove(struct platform_device *pdev) >> { >> struct ath11k_base *ab = platform_get_drvdata(pdev); >> - >> + int ret = 0; >> reinit_completion(&ab->driver_recovery); >> >> if (test_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags)) >> - wait_for_completion_timeout(&ab->driver_recovery, >> - ATH11K_AHB_RECOVERY_TIMEOUT); >> + if (!wait_for_completion_timeout(&ab->driver_recovery, >> + ATH11K_AHB_RECOVERY_TIMEOUT)) { >> + ath11k_warn(ab, "fail to receive recovery response >> completion.\n"); >> + ret = -ETIMEDOUT; >> + } > > This is a good find. Rajkumar, can you take a look if this is ok? > >> >> set_bit(ATH11K_FLAG_UNREGISTERING, &ab->dev_flags); >> cancel_work_sync(&ab->restart_work); >> @@ -999,7 +1003,7 @@ static int ath11k_ahb_remove(struct platform_device *pdev) >> ath11k_core_free(ab); >> platform_set_drvdata(pdev, NULL); >> >> - return 0; >> + return ret; >> } > > Especially I wonder what happens if ath11k_ahb_remove() returns an > error. Should we just print a warning and return 0 instead? I changed this patch so that we return 0 even if timeout happens, just to be on the safe side. The patch is now in the pending branch. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches