From: David Dillow <dave@thedillows.org>
To: Jaswinder Singh <jaswinder@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
becker@scyld.com, davidpmclean@yahoo.com,
Jeff Garzik <jeff@garzik.org>, netdev <netdev@vger.kernel.org>,
David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH] typhoon: use request_firmware
Date: Sun, 27 Jul 2008 21:43:20 -0400 [thread overview]
Message-ID: <1217209400.22789.47.camel@obelisk.thedillows.org> (raw)
In-Reply-To: <1217170232.3537.6.camel@jaswinder.satnam>
On Sun, 2008-07-27 at 20:20 +0530, Jaswinder Singh wrote:
> --- a/drivers/net/typhoon.c
> +++ b/drivers/net/typhoon.c
> MODULE_LICENSE("GPL");
> +MODULE_LICENSE("3com/typhoon.bin");
Uhm, MODULE_FIRMWARE()?
> @@ -1368,8 +1371,14 @@ typhoon_download_firmware(struct typhoon *tp)
> int i;
> int err;
>
> + err = request_firmware(&fw, fw_name, &tp->pdev->dev);
> + if (err) {
> + printk(KERN_ERR "%s: Failed to load firmware \"%s\"\n",
> + tp->name, fw_name);
> + return err;
> + }
> err = -EINVAL;
> - fHdr = (struct typhoon_file_header *) typhoon_firmware_image;
> + fHdr = (struct typhoon_file_header *) fw->data;
> image_data = (u8 *) fHdr;
>
> if(memcmp(fHdr->tag, "TYPHOON", 8)) {
> @@ -1494,6 +1503,7 @@ err_out_irq:
> pci_free_consistent(pdev, PAGE_SIZE, dpage, dpage_dma);
>
> err_out:
> + release_firmware(fw);
> return err;
> }
It is not quite this simple. By not loading the firmware on device
probe, you have opened the door to a broken resume, and the driver will
now try to sleep in an atomic context, when typhoon_tx_timeout() is
called at the very least.
I've said that I was thinking about doing the conversion myself, and I
think the firmware loader makes some sense for new drivers. But the more
I think about converting old -- fairly static -- drivers such as
typhoon, I wonder "what's the point?" We don't save memory, we add code,
and we add failure points that weren't there before. Where's the upside?
Dave
next prev parent reply other threads:[~2008-07-28 1:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-27 14:50 [PATCH] typhoon: use request_firmware Jaswinder Singh
2008-07-28 1:43 ` David Dillow [this message]
2008-07-28 3:16 ` Jaswinder Singh
2008-07-28 12:36 ` David Dillow
2008-07-28 13:54 ` Jaswinder Singh
2008-07-29 1:38 ` David Dillow
2008-07-29 3:57 ` David Dillow
2008-07-29 16:09 ` Jaswinder Singh
2008-07-30 5:25 ` David Dillow
2008-07-30 6:44 ` Jaswinder Singh
2008-07-31 3:37 ` David Dillow
2008-07-31 7:42 ` David Woodhouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1217209400.22789.47.camel@obelisk.thedillows.org \
--to=dave@thedillows.org \
--cc=becker@scyld.com \
--cc=davidpmclean@yahoo.com \
--cc=dwmw2@infradead.org \
--cc=jaswinder@infradead.org \
--cc=jeff@garzik.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox