From: "Dan Williams" <dan.j.williams@intel.com>
To: "Benjamin Herrenschmidt" <benh@kernel.crashing.org>
Cc: linux-raid@vger.kernel.org, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] [PPC32] ADMA support for PPC 440SPe processors.
Date: Fri, 16 Mar 2007 09:57:57 -0700 [thread overview]
Message-ID: <e9c3a7c20703160957o7f1ecf41gb47d47227575629c@mail.gmail.com> (raw)
In-Reply-To: <1174033758.6861.41.camel@localhost.localdomain>
On 3/16/07, Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> > + PRINTK("\tfree slot %x: %d stride: %d\n", desc->phys, desc->idx, desc->stride);
>
> Why don't you use the kernel existing debugging facilitie, like
> pr_debug, or dev_dbg if you have a proper struct device (which you
> should have with an arch/powerpc port hopefully using
> of_platform_device).
>
This came from the the iop-adma driver. I blindly copied it from
drivers/md/raid5.c, but yes it should change to dev_dbg.
> > + spin_lock_bh(&spe_chan->lock);
> > + /* Allocate descriptor slots */
> > + i = spe_chan->slots_allocated;
> > + if (spe_chan->device->id != PPC440SPE_XOR_ID)
> > + db_sz = sizeof (dma_cdb_t);
> > + else
> > + db_sz = sizeof (xor_cb_t);
> > +
> > + for (; i < (plat_data->pool_size/db_sz); i++) {
> > + slot = kzalloc(sizeof(struct spe_adma_desc_slot), GFP_KERNEL);
>
> GFP_KERNEL within spin_lock_bh is no good...
>
This is an iop-adma wart... will fix.
> > diff --git a/include/asm-ppc/adma.h b/include/asm-ppc/adma.h
> > new file mode 100644
> > index 0000000..0be88f1
> > --- /dev/null
> > +++ b/include/asm-ppc/adma.h
>
> There's way too many code in this .h file, too big inline functions. It
> should mostly be moved to a .c file
>
The iop-adma driver uses separate .h files because the driver is
shared between iop3xx and iop13xx implementations and I did not want
the overhead of another indirect-branch layer. In this case the
hardware specific routines can be written inline since the driver is
only supporting one architecture... other suggestions?
> Cheers,
> Ben.
>
Regards,
Dan
next prev parent reply other threads:[~2007-03-16 16:57 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-15 23:29 [PATCH] [PPC32] ADMA support for PPC 440SPe processors Wolfgang Denk
2007-03-16 5:27 ` Paul Mackerras
2007-03-16 5:55 ` Dan Williams
2007-03-16 10:16 ` Wolfgang Denk
2007-03-16 16:33 ` Dan Williams
2007-03-16 8:29 ` Benjamin Herrenschmidt
2007-03-16 10:23 ` Wolfgang Denk
2007-03-16 12:44 ` Stefan Roese
2007-03-16 16:57 ` Dan Williams [this message]
2007-03-16 18:00 ` Dan Williams
2007-03-17 8:09 ` Stefan Roese
2007-03-17 18:17 ` Dan Williams
2007-03-17 18:43 ` Stefan Roese
2007-03-17 19:09 ` Dan Williams
2007-03-19 16:13 ` Benjamin Herrenschmidt
2007-03-20 3:06 ` Michael Ellerman
2007-03-20 5:39 ` Stefan Roese
2007-03-21 14:10 ` Segher Boessenkool
2007-03-21 19:55 ` Benjamin Herrenschmidt
2007-03-21 20:03 ` Segher Boessenkool
2007-03-22 11:38 ` Christoph Hellwig
2007-03-22 12:36 ` Segher Boessenkool
2007-03-22 13:20 ` Geert Uytterhoeven
2007-03-22 13:38 ` Segher Boessenkool
2007-03-17 8:57 ` Yuri Tikhonov
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=e9c3a7c20703160957o7f1ecf41gb47d47227575629c@mail.gmail.com \
--to=dan.j.williams@intel.com \
--cc=benh@kernel.crashing.org \
--cc=linux-raid@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.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).