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]
Date:	Mon, 26 Mar 2012 09:17:55 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Ravi Kumar V <kumarrav@...eaurora.org>
Cc:	Vinod Koul <vinod.koul@...el.com>,
	Dan Williams <dan.j.williams@...el.com>,
	David Brown <davidb@...eaurora.org>,
	Daniel Walker <dwalker@...o99.com>,
	Bryan Huntsman <bryanh@...eaurora.org>,
	Russell King <linux@....linux.org.uk>,
	linux-arm-msm@...r.kernel.or, linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org, tsoni@...eaurora.org
Subject: Re: [PATCH v5 2/2] DMAEngine: Add DMAEngine driver based on old MSM
 ADM DMA APIs

On Thu, Mar 22, 2012 at 3:23 PM, Ravi Kumar V <kumarrav@...eaurora.org> wrote:

This stuff:

> +enum adm_flush_type {
> +       ADM_FORCED_FLUSH,
> +       ADM_GRACEFUL_FLUSH,
> +};

> +/*
> + *  Controlling the hardware channel like stopping, flushing.
> + */
> +static int msm_dma_chan_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
> +                                                       unsigned long arg)
> +{
> +       enum adm_flush_type cmd_type = arg;
> +
> +       if (cmd == DMA_TERMINATE_ALL) {
> +               switch (cmd_type) {
> +               case ADM_GRACEFUL_FLUSH:
> +                               msm_dmov_stop_cmd(chan->chan_id, NULL, 1);
> +                       break;
> +               case ADM_FORCED_FLUSH:
> +                       /*
> +                        * We treate default as forced flush
> +                        * so we fall through
> +                        */
> +               default:
> +                               msm_dmov_stop_cmd(chan->chan_id, NULL, 0);
> +                       break;
> +               }
> +       }
> +       return 0;
> +}

This is an interesting way of using the opaque arg. Can you describe
the different semantics of graceful vs forced flush so we understand
the usecases for them?

DMA_TERMINATE_ALL is usually not very graceful.

DMA_PAUSE might be the semantic you're looking for as the
graceful path, and then you can do away with this strange
enum altogether.

Yours,
Linus Walleij
--
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