From: David Woodhouse <dwmw2@infradead.org>
To: Jeff Garzik <jeff@garzik.org>
Cc: Jes Sorensen <jes@trained-monkey.org>,
netdev@vger.kernel.org, jaswinder@infradead.org
Subject: Re: [PATCH] firmware: convert acenic driver to request_firmware()
Date: Wed, 18 Jun 2008 17:45:25 +0100 [thread overview]
Message-ID: <1213807525.26255.1331.camel@pmac.infradead.org> (raw)
In-Reply-To: <1213807439.26255.1327.camel@pmac.infradead.org>
On Wed, 2008-06-18 at 17:44 +0100, David Woodhouse wrote:
> In the patch I just
> sent, you can see exactly what's changing. Now, just for fun, let's
> try
> splitting it into two pointlessly separate patches as you seem to
> want.
>
> First we add the 'new' code path...
... and then we remove the old...
For this pair of patches to be sanely reviewable, you need to combine
them into one and see what _actually_ changed. And that's why I've
posted it like that.
--- drivers/net/acenic.c 2008-06-18 17:40:10.000000000 +0100
+++ drivers/net/acenic.c 2008-06-18 17:17:51.000000000 +0100
@@ -2873,40 +2873,7 @@ static struct net_device_stats *ace_get_
}
-static void __devinit ace_copy(struct ace_regs __iomem *regs, void *src,
- u32 dest, int size)
-{
- void __iomem *tdest;
- u32 *wsrc;
- short tsize, i;
-
- if (size <= 0)
- return;
-
- while (size > 0) {
- tsize = min_t(u32, ((~dest & (ACE_WINDOW_SIZE - 1)) + 1),
- min_t(u32, size, ACE_WINDOW_SIZE));
- tdest = (void __iomem *) ®s->Window +
- (dest & (ACE_WINDOW_SIZE - 1));
- writel(dest & ~(ACE_WINDOW_SIZE - 1), ®s->WinBase);
- /*
- * This requires byte swapping on big endian, however
- * writel does that for us
- */
- wsrc = src;
- for (i = 0; i < (tsize / 4); i++) {
- writel(wsrc[i], tdest + i*4);
- }
- dest += tsize;
- src += tsize;
- size -= tsize;
- }
-
- return;
-}
-
-
-static void __devinit ace_copy_be(struct ace_regs __iomem *regs, const __be32 *src,
+static void __devinit ace_copy(struct ace_regs __iomem *regs, const __be32 *src,
u32 dest, int size)
{
void __iomem *tdest;
@@ -2959,49 +2926,13 @@ static void __devinit ace_clear(struct a
return;
}
+
/*
* Download the firmware into the SRAM on the NIC
*
* This operation requires the NIC to be halted and is performed with
* interrupts disabled and with the spinlock hold.
*/
-static int __devinit ace_load_static_firmware(struct net_device *dev)
-{
- struct ace_private *ap = netdev_priv(dev);
- struct ace_regs __iomem *regs = ap->regs;
-
- /*
- * Do not try to clear more than 512KB or we end up seeing
- * funny things on NICs with only 512KB SRAM
- */
- ace_clear(regs, 0x2000, 0x80000-0x2000);
- if (ACE_IS_TIGON_I(ap)) {
- ap->firmware_major = tigonFwReleaseMajor;
- ap->firmware_minor = tigonFwReleaseMinor;
- ap->firmware_fix = tigonFwReleaseFix;
- ap->firmware_start = tigonFwStartAddr;
- ace_copy(regs, tigonFwText, tigonFwTextAddr, tigonFwTextLen);
- ace_copy(regs, tigonFwData, tigonFwDataAddr, tigonFwDataLen);
- ace_copy(regs, tigonFwRodata, tigonFwRodataAddr,
- tigonFwRodataLen);
- ace_clear(regs, tigonFwBssAddr, tigonFwBssLen);
- ace_clear(regs, tigonFwSbssAddr, tigonFwSbssLen);
- }else if (ap->version == 2) {
- ap->firmware_major = tigon2FwReleaseMajor;
- ap->firmware_minor = tigon2FwReleaseMinor;
- ap->firmware_fix = tigon2FwReleaseFix;
- ap->firmware_start = tigon2FwStartAddr;
- ace_clear(regs, tigon2FwBssAddr, tigon2FwBssLen);
- ace_clear(regs, tigon2FwSbssAddr, tigon2FwSbssLen);
- ace_copy(regs, tigon2FwText, tigon2FwTextAddr,tigon2FwTextLen);
- ace_copy(regs, tigon2FwRodata, tigon2FwRodataAddr,
- tigon2FwRodataLen);
- ace_copy(regs, tigon2FwData, tigon2FwDataAddr,tigon2FwDataLen);
- }
-
- return 0;
-}
-
static int __devinit ace_load_firmware(struct net_device *dev)
{
const struct firmware *fw;
@@ -3025,7 +2956,7 @@ static int __devinit ace_load_firmware(s
if (ret) {
printk(KERN_ERR "%s: Failed to load firmware \"%s\"\n",
ap->name, fw_name);
- return ace_load_static_firmware(dev);
+ return ret;
}
fw_data = (void *)fw->data;
@@ -3060,7 +2991,7 @@ static int __devinit ace_load_firmware(s
* funny things on NICs with only 512KiB SRAM
*/
ace_clear(regs, 0x2000, 0x80000-0x2000);
- ace_copy_be(regs, &fw_data[3], load_addr, fw->size-12);
+ ace_copy(regs, &fw_data[3], load_addr, fw->size-12);
out:
release_firmware(fw);
return ret;
--
dwmw2
next prev parent reply other threads:[~2008-06-18 16:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-16 9:25 [PATCH] firmware: convert acenic driver to request_firmware() David Woodhouse
2008-06-16 16:25 ` Jes Sorensen
2008-06-16 17:23 ` David Woodhouse
2008-06-17 16:50 ` Jes Sorensen
2008-06-17 16:52 ` David Woodhouse
2008-06-18 16:29 ` David Woodhouse
2008-06-16 20:34 ` Jeff Garzik
2008-06-16 21:45 ` David Woodhouse
2008-06-16 22:11 ` Jeff Garzik
2008-06-17 10:40 ` David Woodhouse
2008-06-18 16:14 ` David Woodhouse
2008-06-18 16:26 ` Jeff Garzik
2008-06-18 16:43 ` David Woodhouse
2008-06-18 16:45 ` David Woodhouse [this message]
2008-06-18 16:52 ` Jes Sorensen
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=1213807525.26255.1331.camel@pmac.infradead.org \
--to=dwmw2@infradead.org \
--cc=jaswinder@infradead.org \
--cc=jeff@garzik.org \
--cc=jes@trained-monkey.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;
as well as URLs for NNTP newsgroup(s).