Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3760524pxu; Tue, 8 Dec 2020 22:59:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+8w3Kxdad7Da5YKKiO408Ac7ZvE/PPlcpHQHU+LhtKBwvE54xNkTbxHuLRhgT9/rLyHi5 X-Received: by 2002:a17:906:4b56:: with SMTP id j22mr868216ejv.443.1607497150473; Tue, 08 Dec 2020 22:59:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607497150; cv=none; d=google.com; s=arc-20160816; b=lSX/zf+A7RjJ45wdCufAZYWtSLm8rz8UMuuCHmabVEsTun35eMriBXnOuQw2DAG80R VByX5GSZuRoVn9L3MsBp6nAZBMCsJVITdHB/X9tCVIEsF7ceNfcdmid9MnhwRmgCVEGa xcU6LOt7T5OsKJ90/Udk0Erz9Ge0Di2bqPcEIsATZlRp4O9rgUPJtwNB0XNDwEerqDzn bVFdtt163P+gzNDqBnZVbNw5G/hO2VzxbXF1mPfbmZMO+OBiejBvoRPOOWdW/hTMj6K2 xd5RZlJvp0Y+saFdw+Zmejg5DjthYZ9+NAbkRZRy8WaN4C+nV3aYYFtWUyyDqk/OYtwM MBFg== 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=C2+xYoctQQS9tcuK+/MAYk2X0Bk6vkGPfvQPX+BJffI=; b=hdlctnd22V+gvKoEpO7GiDW6eO9otQ5pLDCxd14BNmUcXeIZI3csAcRLBi5RC8EJ0Q wS86rnq/R4ibKnVywRiiiS3hwcAC3FCpZ8j9F3duQYqTmrp4AlRpThuLtJtgkwE3EtPJ Al4bpir4fzyby49IB7NntE99LLmo++lcG1bLc1ti6/gEhiiioag3auob5hIKbhQWaWyk bRl1AjeKedJj7GTrxy/9Kt2eqO+M8YAGDMp04GAyXRZAu2ykvt1l6Hj34s2OclGgTTPP U0XsLGeL9MkrS+NH3LP2rQUg4PkxI+D6UKUR85XNVYieo0XJkH2bdek0hMOgKKO1DXss EW0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=wVL9k7iH; 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 o26si221299edw.74.2020.12.08.22.58.35; Tue, 08 Dec 2020 22:59:10 -0800 (PST) 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=wVL9k7iH; 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 S1728203AbgLIG6L (ORCPT + 99 others); Wed, 9 Dec 2020 01:58:11 -0500 Received: from m43-15.mailgun.net ([69.72.43.15]:44986 "EHLO m43-15.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728077AbgLIG6K (ORCPT ); Wed, 9 Dec 2020 01:58:10 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1607497070; h=Content-Type: MIME-Version: Message-ID: In-Reply-To: Date: References: Subject: Cc: To: From: Sender; bh=C2+xYoctQQS9tcuK+/MAYk2X0Bk6vkGPfvQPX+BJffI=; b=wVL9k7iHlyWu6GZiqjNZR1mkWF2E1ZQufI3HU9sLZ9x5cXhTLVNBvbhCOWeFqZONczSQYlne s/oAdXIt0R91HNxVfv7LfbZeWzMDeFyrVxtuB8bA1uFfoQD49i1lkDORtu5ZOTgL6jIfzia/ eGZLQtM+b5KyFPiR8aZP4hrEMCY= X-Mailgun-Sending-Ip: 69.72.43.15 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-n07.prod.us-west-2.postgun.com with SMTP id 5fd075526d5c2f1d20ab3418 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 09 Dec 2020 06:57:22 GMT Sender: kvalo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 1116EC43461; Wed, 9 Dec 2020 06:57:22 +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 402CAC433CA; Wed, 9 Dec 2020 06:57:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 402CAC433CA 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: Anilkumar Kolli Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org Subject: Re: [PATCH v3] ath11k: fix rmmod failure if qmi sequence fails References: <1606916215-24643-1-git-send-email-akolli@codeaurora.org> Date: Wed, 09 Dec 2020 08:57:17 +0200 In-Reply-To: <1606916215-24643-1-git-send-email-akolli@codeaurora.org> (Anilkumar Kolli's message of "Wed, 2 Dec 2020 19:06:55 +0530") Message-ID: <877dprcvqq.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 Anilkumar Kolli writes: > QMI sequence fails if caldata file is not available. > It is observed that 'rmmod ath11k' fails if qmi message fails. > With this patch rmmod/insmod is working. > > Logs: > Direct firmware load for IPQ8074/caldata.bin failed with error -2 > Falling back to user helper > qmi failed to load CAL: IPQ8074/caldata.bin > qmi failed to load board data file:-11 > > Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00009-QCAHKSWPL_SILICONZ-1 > Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01699-QCAHSTSWPLZ_V2_TO_X86-1 > > Signed-off-by: Anilkumar Kolli [...] > @@ -2637,6 +2643,7 @@ static void ath11k_qmi_driver_event_work(struct work_struct *work) > event_work); > struct ath11k_qmi_driver_event *event; > struct ath11k_base *ab = qmi->ab; > + int ret = 0; > > spin_lock(&qmi->event_lock); > while (!list_empty(&qmi->event_list)) { > @@ -2650,19 +2657,20 @@ static void ath11k_qmi_driver_event_work(struct work_struct *work) > > switch (event->type) { > case ATH11K_QMI_EVENT_SERVER_ARRIVE: > - ath11k_qmi_event_server_arrive(qmi); > + ret = ath11k_qmi_event_server_arrive(qmi); > break; > case ATH11K_QMI_EVENT_SERVER_EXIT: > set_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags); > set_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags); > break; > case ATH11K_QMI_EVENT_REQUEST_MEM: > - ath11k_qmi_event_mem_request(qmi); > + ret = ath11k_qmi_event_mem_request(qmi); > break; > case ATH11K_QMI_EVENT_FW_MEM_READY: > - ath11k_qmi_event_load_bdf(qmi); > + ret = ath11k_qmi_event_load_bdf(qmi); > break; > case ATH11K_QMI_EVENT_FW_READY: > + clear_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags); > if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) { > ath11k_hal_dump_srng_stats(ab); > queue_work(ab->workqueue, &ab->restart_work); > @@ -2688,6 +2696,9 @@ static void ath11k_qmi_driver_event_work(struct work_struct *work) > break; > } > kfree(event); > + if (ret < 0) > + set_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags); > + In the pending branch I moved the error handling after the function calls to make it more visible. Here readibility is more important than reducing lines of code. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches