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:	Wed, 14 Sep 2011 12:41:26 +0530
From:	Jassi Brar <jassisinghbrar@...il.com>
To:	Barry Song <21cnbao@...il.com>
Cc:	"Koul, Vinod" <vinod.koul@...el.com>,
	"linus.walleij@...aro.org" <linus.walleij@...aro.org>,
	"Williams, Dan J" <dan.j.williams@...el.com>,
	"arnd@...db.de" <arnd@...db.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"workgroup.linux@....com" <workgroup.linux@....com>,
	"rongjun.ying@....com" <rongjun.ying@....com>,
	"Baohua.Song@....com" <Baohua.Song@....com>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] dmaengine: add CSR SiRFprimaII DMAC driver

On Wed, Sep 14, 2011 at 12:16 PM, Barry Song <21cnbao@...il.com> wrote:

>> Anyways, every case can be easily expressed using the generic api
>> I proposed. See 'struct xfer_template' in https://lkml.org/lkml/2011/8/12/128
>>
>> Roughly speaking, the following should be done...
>> Client driver :-
>> **************
>> For a 'Rectangular' transfer (2d-dma.PNG) :-
>>      xfer_template.numf = Ylen;  /* height of rectangle */
>>      xfer_template.frame_size = 1;
>>      xfer_template.sgl[0].size = Xlen; /* width of rectangle */
>>      xfer_template.sgl[0].icg = start_addr_Y(n) - end_addr_Y(n-1);
>
> For prima2:
>
> xfer_template.numf = ylen + 1
> xfer_template.frame_size = 1;
> xfer_template.sgl[0].size = xlen;
> xfer_template.sgl[0].icg = dma_width - xlen;
>
All is same as I suggested except for 'numf'.
You might want to keep 'numf' same as well. Because the client
driver shouldn't need to know that the DMAC's register expect "+1" value.
Remember the client is supposed to be reusable over other DMACs as well.
So, rather in the DMAC driver, please do
    schan->ylen = xfer_template.numf + 1;


>> DMAC driver :-
>> ***************
>>      if (xfer_template.frame_size == 1) {
>>           /* rectangle */
>>           schan->xlen = xfer_template.sgl[0].size;
>>           schan->width = schan->xlen + xfer_template.sgl[0].icg;
>>      } else if (xfer_template.frame_size == 2 &&
>>                  xfer_template.numf == 1 &&
>>                  xfer_template.sgl[1].size == xfer_template.sgl[0].icg){
>>           /* a line and some */
>>           schan->xlen = xfer_template.sgl[0].size +  xfer_template.sgl[1].size.
>>           schan->width = xfer_template.sgl[0].size;
>>      } else {
>>           /* _Hardware_ doesn't support the transfer as such. *
>>           return -EINVAL;
>>      }
>>      schan->ylen = xfer_template.numf /* -1? */;
>>
>
> For prima2:
> xfer_template.frame_size is always 1, then
> schan->xlen = xfer_template.sgl[0].size;
> schan->width = schan->xlen + xfer_template.sgl[0].icg;
>
Ok, you don't need the 'else if' clause because as you said
{xlen > width} is not an option.
But you do need the other two checks, so that the DMAC driver
cleanly rejects any interleaved-format that it doesn't support.

Point being, the clients and DMAC drivers are supposed to be
very 'promiscuous' - any Client could be 'riding' any DMAC ;)
--
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