lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGsJ_4wOQddus_Vz5zUjy-4ETOeaiZ+STRD22SwRy+yr4YLaRA@mail.gmail.com>
Date:	Thu, 8 Sep 2011 23:27:32 +0800
From:	Barry Song <21cnbao@...il.com>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	Barry Song <Baohua.Song@....com>, vinod.koul@...el.com,
	linux-kernel@...r.kernel.org, workgroup.linux@....com,
	Rongjun Ying <rongjun.ying@....com>, dan.j.williams@...el.com,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] dmaengine: add CSR SiRFprimaII DMAC driver

Hi Arnd,
Thanks!

2011/9/8 Arnd Bergmann <arnd@...db.de>
>
> On Wednesday 07 September 2011, Barry Song wrote:
> > +/*
> > + * The DMA controller consists of 16 independent DMA channels.
> > + * Each channel is allocated to a different function
> > + */
> > +bool sirfsoc_dma_filter_id(struct dma_chan *chan, void *chan_id)
> > +{
> > +       unsigned int ch_nr = (unsigned int) chan_id;
> > +
> > +       if (ch_nr == chan->chan_id)
> > +               return true;
> > +
> > +       return false;
> > +}
> > +EXPORT_SYMBOL(sirfsoc_dma_filter_id);
> > +
>
> Hi Barry,
>
> It seems wrong that you have to export this function. The dmaengine API
> should be able to work without this, and when you have drivers using the
> interface, those should not rely on a specific implementation as the
> purpose of the API is specifically to hide that.
>
> Am I missing something?

i am not sure whether i have other way to require a special channel
for a special device. it seems dma_request_channel only gives me a
chance to use a filter function since my all channels have same DMA
cap masks.

this filter is used by all drivers with DMA since every dma channel is
fixed to be assigned to one device.

i did do some copy from coh901318.c:
bool coh901318_filter_id(struct dma_chan *chan, void *chan_id)
{
    unsigned int ch_nr = (unsigned int) chan_id;

    if (ch_nr == to_coh901318_chan(chan)->id)
        return true;

    return false;
}
EXPORT_SYMBOL(coh901318_filter_id);

if it does become a common filter,  we might have a function like:

bool dmaengine_filter_match_channel_id(struct dma_chan *chan, void *chan_id)
{
    if (ch_nr == chan->chan_id)
        return true;

    return false;
}
EXPORT_SYMBOL(dmaengine_filter_match_channel_id);

Another filter is in amba-pl08x.c, it is filtering channel by name:
bool pl08x_filter_id(struct dma_chan *chan, void *chan_id)
{
    struct pl08x_dma_chan *plchan = to_pl08x_chan(chan);
    char *name = chan_id;

    /* Check that the channel is not taken! */
    if (!strcmp(plchan->name, name))
        return true;

    return false;
}

>
>        Arnd
>

-barry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ