From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74EFFC433F5 for ; Thu, 20 Jan 2022 13:15:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344011AbiATNP1 (ORCPT ); Thu, 20 Jan 2022 08:15:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359583AbiATNP0 (ORCPT ); Thu, 20 Jan 2022 08:15:26 -0500 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFB91C061574; Thu, 20 Jan 2022 05:15:25 -0800 (PST) Received: by mail-lf1-x131.google.com with SMTP id p27so21587731lfa.1; Thu, 20 Jan 2022 05:15:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=Z8T4ODCid5Vg8gPhZXOgJAmkKij4UIWo8oSKzIeZ2Ac=; b=YzlNFN3Tid4qpfZ4OzWnS5ZqKpoA6cMhAbaJXB9KrFeNuxk9gHzSVPsF8kOAzNU2Cd ABRLnxcmKOZMNqC2D0kM8WzJZDk1rZ3OYs9TDwiR08rvBYcxKwOMuplhUmtwlavyBQU3 kQXSLI/CT0GYUT3tsQnhGf2+DH1otcOt55wymvj35ybfKD6IhC/oqvDfYPIdAozS0M2A vdN1Mfdwz6msgIoT5O02PagbD3goD43WPQLM7bn+gkXAvfsH6M62W7OdFgd0EE0rKoPg m+yS7xH9IUUerW7dlRglLzj08EZa4C68Kc6KyxTw1YcZGqvY4SnoeRjvmzCYUwtA06lc hijw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Z8T4ODCid5Vg8gPhZXOgJAmkKij4UIWo8oSKzIeZ2Ac=; b=q1swfJxsyf8Lff/8KU57hRdPmZhzWp3y5Z37xlHg//qo8ZBHQmE7VmuPuD3N2yFQnI G31pzBg3plY+JTyZl0GEb9vX7VWaBOG1889OxkFXWrmGhtrWcequ0KvswGw2AmMKMpsp 0O8VX69iKbWDJrpjM868cGtbQRy+m9t8L5wVEmDUYTcH2IKCdZRMSHvThCqCwqCHYGZs fllwUT7UCVjipVy88DyO5dqYePbh9XdtmXYoAN/rKs0ewP2rJ7f4Q+rrHA3kfI+Bct/K iRSZMnN+ZU6aux8PZOuGK5jlYgBfcQP/4Me61Y1WtP/MX2DwkSNlaaQYBv8/Bu4848Ga gaew== X-Gm-Message-State: AOAM530fKS7475CS5kg5oWDGBnwGxyRx62PBJpHEcsg9yFpLyJYy6hZe kfqmCSi6bRFmua8gpVG/yKU= X-Google-Smtp-Source: ABdhPJycfCNrik94+hanjb71FiMe5oe1rEjXxkRErg+pWgi5Cabbu2OB2VF8HCGDq4zAfVtsnoJ1iA== X-Received: by 2002:a05:6512:2606:: with SMTP id bt6mr32394264lfb.202.1642684524235; Thu, 20 Jan 2022 05:15:24 -0800 (PST) Received: from [192.168.2.145] (109-252-139-36.dynamic.spd-mgts.ru. [109.252.139.36]) by smtp.googlemail.com with ESMTPSA id m4sm21357lfq.204.2022.01.20.05.15.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Jan 2022 05:15:23 -0800 (PST) Message-ID: <5807426a-70e5-4513-53bf-c98e74daf42f@gmail.com> Date: Thu, 20 Jan 2022 16:15:22 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v3 1/9] brcmfmac: pcie: Release firmwares in the brcmf_pcie_setup error path Content-Language: en-US To: Andy Shevchenko Cc: Hector Martin , Kalle Valo , "David S. Miller" , Jakub Kicinski , Rob Herring , "Rafael J. Wysocki" , Len Brown , Arend van Spriel , Franky Lin , Hante Meuleman , Chi-hsien Lin , Wright Feng , Sven Peter , Alyssa Rosenzweig , Mark Kettenis , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Pieter-Paul Giesberts , Linus Walleij , Hans de Goede , "John W. Linville" , "brian m. carlson" , "open list:TI WILINK WIRELES..." , netdev , devicetree , Linux Kernel Mailing List , ACPI Devel Maling List , "open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER" , SHA-cyfmac-dev-list@infineon.com References: <20220117142919.207370-1-marcan@marcan.st> <20220117142919.207370-2-marcan@marcan.st> <9a222199-6620-15b7-395f-e079b8e6e529@gmail.com> From: Dmitry Osipenko In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 20.01.2022 00:31, Andy Shevchenko пишет: > On Wed, Jan 19, 2022 at 11:22 PM Dmitry Osipenko wrote: >> >> 19.01.2022 20:49, Andy Shevchenko пишет: >>> On Mon, Jan 17, 2022 at 4:30 PM Hector Martin wrote: >>>> >>>> This avoids leaking memory if brcmf_chip_get_raminfo fails. Note that >>>> the CLM blob is released in the device remove path. >>> >>> ... >>> >>>> if (ret) { >>> >>>> brcmf_err(bus, "Failed to get RAM info\n"); >>>> + release_firmware(fw); >>>> + brcmf_fw_nvram_free(nvram); >>> >>> Can we first undo the things and only after print a message? >> >> Having message first usually is more preferred because at minimum you'll >> get the message if "undoing the things" crashes, i.e. will be more >> obvious what happened. > > If "undo the things" crashes, I would rather like to see that crash > report, while serial UART at 9600 will continue flushing the message > and then hang without any pointers to what the heck happened. Not > here, but in general, messages are also good to be out of the locks. The hang is actually a better example. It's the most annoying when there is a silent hang and no error messages.