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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6D2BC2D0F0 for ; Wed, 1 Apr 2020 19:08:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 87D6F206F6 for ; Wed, 1 Apr 2020 19:08:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732535AbgDATIX (ORCPT ); Wed, 1 Apr 2020 15:08:23 -0400 Received: from guitar.tcltek.co.il ([192.115.133.116]:52587 "EHLO mx.tkos.co.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726785AbgDATIX (ORCPT ); Wed, 1 Apr 2020 15:08:23 -0400 Received: from tarshish (unknown [10.0.8.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.tkos.co.il (Postfix) with ESMTPS id D6A15440813; Wed, 1 Apr 2020 22:08:01 +0300 (IDT) References: <16e4a15e359012fc485d22c7e413a129029fbd0f.1585676858.git.baruch@tkos.co.il> User-agent: mu4e 1.2.0; emacs 26.1 From: Baruch Siach To: Florian Fainelli Cc: Russell King , netdev@vger.kernel.org, Shmuel Hazan , Andrew Lunn , Heiner Kallweit Subject: Re: [PATCH] net: phy: marvell10g: add firmware load support In-reply-to: Date: Wed, 01 Apr 2020 22:08:18 +0300 Message-ID: <87tv23ausd.fsf@tarshish> MIME-Version: 1.0 Content-Type: text/plain Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Florian, On Tue, Mar 31 2020, Florian Fainelli wrote: > On 3/31/2020 10:47 AM, Baruch Siach wrote: [snip] >> + ret = request_firmware(&fw_entry, fw_file, &phydev->mdio.dev); >> + if (ret < 0) >> + return ret; >> + >> + /* Firmware size must be larger than header, and even */ >> + if (fw_entry->size <= MV_FIRMWARE_HEADER_SIZE || >> + (fw_entry->size % 2) != 0) { >> + dev_err(&phydev->mdio.dev, "firmware file invalid"); >> + return -EINVAL; >> + } > > You need to release the firmware file here. Will fix. > There is also possibly another case that you are not covering here, > which is that the firmware on disk is newer than the firmware > *already* loaded in the PHY, this should presumably update the running > firmware to the latest copy. Firmware is only loaded when the PHY boot state is MV_PMA_BOOT_WAITING (see below). The code does not attempt to update existing PHY firmware. > Without being able to publish the firmware in linux-firmware though, all > of this may be moot. I can't do much about that, unfortunately. baruch -- http://baruch.siach.name/blog/ ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -