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:	Thu, 27 Feb 2014 10:59:47 -0500
From:	Oleksandr G Zhadan <oleks@...turusnetworks.com>
To:	Mike Frysinger <vapier@...too.org>,
	Marc Kleine-Budde <mkl@...gutronix.de>
CC:	Randy Dunlap <rdunlap@...radead.org>,
	uclinux-dist-devel@...ckfin.uclinux.org,
	LKML <linux-kernel@...r.kernel.org>, dmaengine@...r.kernel.org
Subject: Re: blackfin + dmaengine: conflicting define/enum "DMA_COMPLETE"

Hello,

It's good to "... matched the manual ...", and in this case we can match 
the manual more pedantically, maybe with prefix "HOST".

In the case of Host DMA port STATUS register:

 From manual :
.... HOST_STATUS register bits include:
• DMA Ready (DMA_RDY)
• FIFO Full (FIFOFULL)
• FIFO Empty (FIFOEMPTY)
• DMA Complete (DMA_CMPLT)
• HOSTDP Handshake (HSHK)
• HOSTDP Timeout (HOSTDP_TOUT)
• HOSTDP Interrupt Request (HIRQ).
• Allow Configurations (ALLOW_CNFG)
• DMA Direction (DMA_DIR)
• Bus Timeout Enabled (BTE)

We could change definitions to something like:

#define DMA_CMPLT    0x08        /* DMA Complete */
or
#define HOST_DMA_CMPLT  0x08    /* DMA Complete */

And make the similar for other bits/registers.

Oleks

On 01/18/2014 02:02 AM, Mike Frysinger wrote:
> On Saturday 11 January 2014 13:55:15 Marc Kleine-Budde wrote:
>> On 01/11/2014 07:31 PM, Randy Dunlap wrote:
>>> On 01/11/2014 10:09 AM, Marc Kleine-Budde wrote:
>>>> Hello,
>>>>
>>>> in current linux-next (and net-next) the compilation of the CAN
>>>>
>>>> drivers[1] with ARCH=blackfin fails with:
>>>>>    CC [M]  drivers/net/can/c_can/c_can.o
>>>>>
>>>>> In file included from linux/include/linux/netdevice.h:38:0,
>>>>>
>>>>>                   from linux/drivers/net/can/c_can/c_can.c:32:
>>>>> linux/include/linux/dmaengine.h:55:2: error: expected identifier before
>>>>> numeric constant linux/include/linux/dmaengine.h: In function
>>>>> 'dma_async_is_complete': linux/include/linux/dmaengine.h:1023:9:
>>>>> error: 'DMA_IN_PROGRESS' undeclared (first use in this function)
>>>>> linux/include/linux/dmaengine.h:1023:9: note: each undeclared
>>>>> identifier is reported only once for each function it appears in
>>>> There are two locations where DMA_COMPLETE is defined:
>>>>> arch/blackfin/mach-bf548/include/mach/defBF547.h:602:#define
>>>>>    DMA_COMPLETE  0x8        /* DMA Complete */
>>>>> arch/blackfin/mach-bf548/include/mach/defBF544.h:622:#define
>>>>>     DMA_COMPLETE  0x8        /* DMA Complete */
>>>> and
>>>>
>>>>> include/linux/dmaengine.h-enum dma_status {
>>>>> include/linux/dmaengine.h:      DMA_COMPLETE,
>>>>> include/linux/dmaengine.h-      DMA_IN_PROGRESS,
>>>>> include/linux/dmaengine.h-      DMA_PAUSED,
>>>>> include/linux/dmaengine.h-      DMA_ERROR,
>>>>> include/linux/dmaengine.h-};
>>>> What's the appropriate fix for the problem?
>>> arch/blackfin/mach-bf548/ needs a less generic name for its macro.
>> Mike, is there a in tree user of blacksfin's DMA_COMPLETE? I cannot find
>> anyone.
> looks like those are defines for the host port peripheral on the BF54x.
> typically for peripherals we didn't have proper drivers for (like CAN and UART
> and SPI and such), we left the defines in the headers.  those in turn matched
> the manual so people coming from other Blackfin environments (and reading the
> manuals) didn't have to figure out what name the Linux headers used.
>
> unfortunately, it leads to cases like this where the names are pretty bad.
> considering the host peripheral most likely never saw any serious use, it
> should be fine to delete all the bit defines in those headers related to those
> registers (i see HOST_{STATUS,CONTROL,TIMEOUT}.
> -mike

--
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