Re: [PATCH v2 00/15] Habana Labs kernel driver

2019-02-11 Thread Oded Gabbay
On Sat, Feb 9, 2019 at 12:05 AM Oded Gabbay  wrote:
>
> On Sun, Feb 3, 2019 at 10:35 PM Oded Gabbay  wrote:
> >
> > On Sun, Feb 3, 2019 at 1:50 PM Mike Rapoport  wrote:
> > >
> > > Hi Oded,
> > >
> > > On Thu, Jan 31, 2019 at 12:06:02AM +0200, Oded Gabbay wrote:
> > > > Hello,
> > > > This is v2 of the Habana Labs kernel driver patch-set. It contains fixes
> > > > for almost everything that was brought up in the review of v1.
> > > >
> > > > In addition to local changes in each patch that are detailed in each
> > > > patch's commit message, the global/major changes are:
> > > >
> > > > - Rebased on v5.0-rc4
> > > > - Removed all bitfields from interface files to H/W and F/W
> > > > - Use __le16/32/64 instead of __u16/32/64 in F/W or H/W structures
> > >
> > > For v2 I had comments only for "[PATCH v2 07/15] habanalabs: add h/w 
> > > queues
> > > module".
> > >
> > > There are still several over-exited printk calls with three exclamation
> > > marks. ;-)
> > >
> > > I've also spotted several places where checkpatch.pl may complain, but I
> > > was to lazy to actually check it.
> > >
> > > > Link to v1 cover letter: https://lwn.net/Articles/777342/
> > > >
> > > > I would appricate any feedback, question and/or review.
> > > >
> > > > Thanks,
> > > > Oded
> > > >
> > > > p.s. for those who prefer to clone the tree instead of looking at the
> > > > emails, you can grab a copy from our company's page in GitHub:
> > > >
> > > > https://github.com/HabanaAI/linux/releases/tag/hl_patchset_v2_20190130
> > > >
> > > > Oded Gabbay (14):
> > > >   habanalabs: add skeleton driver
> > > >   habanalabs: add Goya registers header files
> > >
> > > This one is 4.3M which is 6 times the entire habanalabs driver without
> > > those headers.
> > > Any chance some of it can be dropped?
> > Hi Mike,
> > Managed to remove about 30 files (~1.5MB) from this patch. The patch
> > now is around 2.9MB
> > Unfortunately, I don't see how I can reduce it much more without
> > seriously reducing the readability and maintainability of the driver.
> >
> > Oded
> Thought about another idea how to reduce the size of this patch.
> I will separate the registers from the MASK and SHIFT defines into two
> files per H/W block.
> For most of the blocks, I only need the registers file, without all
> the MASK and SHIFT defines of the fields, so I think this will reduce
> most of the patch size.
> I'm talking to our devOps to create for me the new set of files from
> the H/W database and will update on the results, probably by end of
> next week.
>
> Oded
>
I'm happy to say I managed to reduce the total size of the registers
patch to ~1.4MB (from 2.9MB).
I will soon send v4 of the patch-set with this reduction + fixes for
MMU and Greg's comments.

Oded


Re: [PATCH v2 00/15] Habana Labs kernel driver

2019-02-08 Thread Oded Gabbay
On Sun, Feb 3, 2019 at 10:35 PM Oded Gabbay  wrote:
>
> On Sun, Feb 3, 2019 at 1:50 PM Mike Rapoport  wrote:
> >
> > Hi Oded,
> >
> > On Thu, Jan 31, 2019 at 12:06:02AM +0200, Oded Gabbay wrote:
> > > Hello,
> > > This is v2 of the Habana Labs kernel driver patch-set. It contains fixes
> > > for almost everything that was brought up in the review of v1.
> > >
> > > In addition to local changes in each patch that are detailed in each
> > > patch's commit message, the global/major changes are:
> > >
> > > - Rebased on v5.0-rc4
> > > - Removed all bitfields from interface files to H/W and F/W
> > > - Use __le16/32/64 instead of __u16/32/64 in F/W or H/W structures
> >
> > For v2 I had comments only for "[PATCH v2 07/15] habanalabs: add h/w queues
> > module".
> >
> > There are still several over-exited printk calls with three exclamation
> > marks. ;-)
> >
> > I've also spotted several places where checkpatch.pl may complain, but I
> > was to lazy to actually check it.
> >
> > > Link to v1 cover letter: https://lwn.net/Articles/777342/
> > >
> > > I would appricate any feedback, question and/or review.
> > >
> > > Thanks,
> > > Oded
> > >
> > > p.s. for those who prefer to clone the tree instead of looking at the
> > > emails, you can grab a copy from our company's page in GitHub:
> > >
> > > https://github.com/HabanaAI/linux/releases/tag/hl_patchset_v2_20190130
> > >
> > > Oded Gabbay (14):
> > >   habanalabs: add skeleton driver
> > >   habanalabs: add Goya registers header files
> >
> > This one is 4.3M which is 6 times the entire habanalabs driver without
> > those headers.
> > Any chance some of it can be dropped?
> Hi Mike,
> Managed to remove about 30 files (~1.5MB) from this patch. The patch
> now is around 2.9MB
> Unfortunately, I don't see how I can reduce it much more without
> seriously reducing the readability and maintainability of the driver.
>
> Oded
Thought about another idea how to reduce the size of this patch.
I will separate the registers from the MASK and SHIFT defines into two
files per H/W block.
For most of the blocks, I only need the registers file, without all
the MASK and SHIFT defines of the fields, so I think this will reduce
most of the patch size.
I'm talking to our devOps to create for me the new set of files from
the H/W database and will update on the results, probably by end of
next week.

Oded

>
> >
> > >   habanalabs: add basic Goya support
> > >   habanalabs: add context and ASID modules
> > >   habanalabs: add command buffer module
> > >   habanalabs: add basic Goya h/w initialization
> > >   habanalabs: add h/w queues module
> > >   habanalabs: add event queue and interrupts
> > >   habanalabs: add sysfs and hwmon support
> > >   habanalabs: add device reset support
> > >   habanalabs: add command submission module
> > >   habanalabs: implement INFO IOCTL
> > >   habanalabs: add debugfs support
> > >   Update MAINTAINERS and CREDITS with habanalabs info
> > >
> > > Omer Shpigelman (1):
> > >   habanalabs: add virtual memory and MMU modules
> > >
> > >  CREDITS   |2 +-
> > >  .../ABI/testing/debugfs-driver-habanalabs |  127 +
> > >  .../ABI/testing/sysfs-driver-habanalabs   |  190 +
> > >  MAINTAINERS   |9 +
> > >  drivers/misc/Kconfig  |1 +
> > >  drivers/misc/Makefile |1 +
> > >  drivers/misc/habanalabs/Kconfig   |   22 +
> > >  drivers/misc/habanalabs/Makefile  |   15 +
> > >  drivers/misc/habanalabs/asid.c|   58 +
> > >  drivers/misc/habanalabs/command_buffer.c  |  432 +
> > >  drivers/misc/habanalabs/command_submission.c  |  787 ++
> > >  drivers/misc/habanalabs/context.c |  216 +
> > >  drivers/misc/habanalabs/debugfs.c | 1071 ++
> > >  drivers/misc/habanalabs/device.c  | 1110 ++
> > >  drivers/misc/habanalabs/goya/Makefile |4 +
> > >  drivers/misc/habanalabs/goya/goya.c   | 5338 ++
> > >  drivers/misc/habanalabs/goya/goyaP.h  |  193 +
> > >  drivers/misc/habanalabs/goya/goya_hwmgr.c |  306 +
> > >  drivers/misc/habanalabs/goya/goya_security.c  | 2999 ++
> > >  drivers/misc/habanalabs/habanalabs.h  | 1448 +++
> > >  drivers/misc/habanalabs/habanalabs_drv.c  |  469 +
> > >  drivers/misc/habanalabs/habanalabs_ioctl.c|  234 +
> > >  drivers/misc/habanalabs/hw_queue.c|  654 ++
> > >  drivers/misc/habanalabs/hwmon.c   |  449 +
> > >  drivers/misc/habanalabs/include/armcp_if.h|  335 +
> > >  .../include/goya/asic_reg/cpu_ca53_cfg_regs.h |  213 +
> > >  .../include/goya/asic_reg/cpu_if_regs.h   |  110 +
> > >  .../include/goya/asic_reg/cpu_pll_regs.h  |  186 +
> > >  .../include/goya/asic_reg/ddr_mc_ch0_regs.h   | 1158 +++
> > >  .../include/goya/asic_reg/ddr_mc_ch1_regs.h   | 1158 +++
> > >  .../include/goya/asic_reg/ddr_misc_ch0_regs.h |  156 +
> > >  

Re: [PATCH v2 00/15] Habana Labs kernel driver

2019-02-03 Thread Oded Gabbay
On Sun, Feb 3, 2019 at 1:50 PM Mike Rapoport  wrote:
>
> Hi Oded,
>
> On Thu, Jan 31, 2019 at 12:06:02AM +0200, Oded Gabbay wrote:
> > Hello,
> > This is v2 of the Habana Labs kernel driver patch-set. It contains fixes
> > for almost everything that was brought up in the review of v1.
> >
> > In addition to local changes in each patch that are detailed in each
> > patch's commit message, the global/major changes are:
> >
> > - Rebased on v5.0-rc4
> > - Removed all bitfields from interface files to H/W and F/W
> > - Use __le16/32/64 instead of __u16/32/64 in F/W or H/W structures
>
> For v2 I had comments only for "[PATCH v2 07/15] habanalabs: add h/w queues
> module".
>
> There are still several over-exited printk calls with three exclamation
> marks. ;-)
>
> I've also spotted several places where checkpatch.pl may complain, but I
> was to lazy to actually check it.
>
> > Link to v1 cover letter: https://lwn.net/Articles/777342/
> >
> > I would appricate any feedback, question and/or review.
> >
> > Thanks,
> > Oded
> >
> > p.s. for those who prefer to clone the tree instead of looking at the
> > emails, you can grab a copy from our company's page in GitHub:
> >
> > https://github.com/HabanaAI/linux/releases/tag/hl_patchset_v2_20190130
> >
> > Oded Gabbay (14):
> >   habanalabs: add skeleton driver
> >   habanalabs: add Goya registers header files
>
> This one is 4.3M which is 6 times the entire habanalabs driver without
> those headers.
> Any chance some of it can be dropped?
Hi Mike,
Managed to remove about 30 files (~1.5MB) from this patch. The patch
now is around 2.9MB
Unfortunately, I don't see how I can reduce it much more without
seriously reducing the readability and maintainability of the driver.

Oded

>
> >   habanalabs: add basic Goya support
> >   habanalabs: add context and ASID modules
> >   habanalabs: add command buffer module
> >   habanalabs: add basic Goya h/w initialization
> >   habanalabs: add h/w queues module
> >   habanalabs: add event queue and interrupts
> >   habanalabs: add sysfs and hwmon support
> >   habanalabs: add device reset support
> >   habanalabs: add command submission module
> >   habanalabs: implement INFO IOCTL
> >   habanalabs: add debugfs support
> >   Update MAINTAINERS and CREDITS with habanalabs info
> >
> > Omer Shpigelman (1):
> >   habanalabs: add virtual memory and MMU modules
> >
> >  CREDITS   |2 +-
> >  .../ABI/testing/debugfs-driver-habanalabs |  127 +
> >  .../ABI/testing/sysfs-driver-habanalabs   |  190 +
> >  MAINTAINERS   |9 +
> >  drivers/misc/Kconfig  |1 +
> >  drivers/misc/Makefile |1 +
> >  drivers/misc/habanalabs/Kconfig   |   22 +
> >  drivers/misc/habanalabs/Makefile  |   15 +
> >  drivers/misc/habanalabs/asid.c|   58 +
> >  drivers/misc/habanalabs/command_buffer.c  |  432 +
> >  drivers/misc/habanalabs/command_submission.c  |  787 ++
> >  drivers/misc/habanalabs/context.c |  216 +
> >  drivers/misc/habanalabs/debugfs.c | 1071 ++
> >  drivers/misc/habanalabs/device.c  | 1110 ++
> >  drivers/misc/habanalabs/goya/Makefile |4 +
> >  drivers/misc/habanalabs/goya/goya.c   | 5338 ++
> >  drivers/misc/habanalabs/goya/goyaP.h  |  193 +
> >  drivers/misc/habanalabs/goya/goya_hwmgr.c |  306 +
> >  drivers/misc/habanalabs/goya/goya_security.c  | 2999 ++
> >  drivers/misc/habanalabs/habanalabs.h  | 1448 +++
> >  drivers/misc/habanalabs/habanalabs_drv.c  |  469 +
> >  drivers/misc/habanalabs/habanalabs_ioctl.c|  234 +
> >  drivers/misc/habanalabs/hw_queue.c|  654 ++
> >  drivers/misc/habanalabs/hwmon.c   |  449 +
> >  drivers/misc/habanalabs/include/armcp_if.h|  335 +
> >  .../include/goya/asic_reg/cpu_ca53_cfg_regs.h |  213 +
> >  .../include/goya/asic_reg/cpu_if_regs.h   |  110 +
> >  .../include/goya/asic_reg/cpu_pll_regs.h  |  186 +
> >  .../include/goya/asic_reg/ddr_mc_ch0_regs.h   | 1158 +++
> >  .../include/goya/asic_reg/ddr_mc_ch1_regs.h   | 1158 +++
> >  .../include/goya/asic_reg/ddr_misc_ch0_regs.h |  156 +
> >  .../include/goya/asic_reg/ddr_misc_ch1_regs.h |  156 +
> >  .../include/goya/asic_reg/dma_ch_0_regs.h |  512 +
> >  .../include/goya/asic_reg/dma_ch_1_regs.h |  512 +
> >  .../include/goya/asic_reg/dma_ch_2_regs.h |  512 +
> >  .../include/goya/asic_reg/dma_ch_3_regs.h |  512 +
> >  .../include/goya/asic_reg/dma_ch_4_regs.h |  512 +
> >  .../include/goya/asic_reg/dma_macro_regs.h|  242 +
> >  .../include/goya/asic_reg/dma_nrtr_regs.h |  380 +
> >  .../include/goya/asic_reg/dma_qm_0_regs.h |  543 +
> >  .../include/goya/asic_reg/dma_qm_1_regs.h |  543 +
> >  .../include/goya/asic_reg/dma_qm_2_regs.h |  543 +
> >  .../include/goya/asic_reg/dma_qm_3_regs.h |  543 +
> >  

Re: [PATCH v2 00/15] Habana Labs kernel driver

2019-02-03 Thread Mike Rapoport
On Sun, Feb 03, 2019 at 01:57:49PM +0200, Oded Gabbay wrote:
> On Sun, Feb 3, 2019 at 1:50 PM Mike Rapoport  wrote:
> >
> > Hi Oded,
> >
> > On Thu, Jan 31, 2019 at 12:06:02AM +0200, Oded Gabbay wrote:
> > > Hello,
> > > This is v2 of the Habana Labs kernel driver patch-set. It contains fixes
> > > for almost everything that was brought up in the review of v1.
> > >
> > > In addition to local changes in each patch that are detailed in each
> > > patch's commit message, the global/major changes are:
> > >
> > > - Rebased on v5.0-rc4
> > > - Removed all bitfields from interface files to H/W and F/W
> > > - Use __le16/32/64 instead of __u16/32/64 in F/W or H/W structures
> >
> > For v2 I had comments only for "[PATCH v2 07/15] habanalabs: add h/w queues
> > module".
> Saw this and I will address it (didn't have time yet).
> Thanks for the entire review!
> 
> >
> > There are still several over-exited printk calls with three exclamation
> > marks. ;-)
> I'll go over the code again and remove them :)
> 
> >
> > I've also spotted several places where checkpatch.pl may complain, but I
> > was to lazy to actually check it.
> >
> I actually make sure to checkpatch every patch I send, and except for
> patch 1/15 which complains about 1 use of volatile, there are 0
> comments. I don't run with --strict though.

Could be a false positive on my side as well :)
 
> > > Link to v1 cover letter: https://lwn.net/Articles/777342/
> > >
> > > I would appricate any feedback, question and/or review.
> > >
> > > Thanks,
> > > Oded
> > >
> > > p.s. for those who prefer to clone the tree instead of looking at the
> > > emails, you can grab a copy from our company's page in GitHub:
> > >
> > > https://github.com/HabanaAI/linux/releases/tag/hl_patchset_v2_20190130
> > >
> > > Oded Gabbay (14):
> > >   habanalabs: add skeleton driver
> > >   habanalabs: add Goya registers header files
> >
> > This one is 4.3M which is 6 times the entire habanalabs driver without
> > those headers.
> > Any chance some of it can be dropped?
> I'll do another round of checking to see if I can cut anything.
> 
> >
> > >   habanalabs: add basic Goya support
> > >   habanalabs: add context and ASID modules
> > >   habanalabs: add command buffer module
> > >   habanalabs: add basic Goya h/w initialization
> > >   habanalabs: add h/w queues module
> > >   habanalabs: add event queue and interrupts
> > >   habanalabs: add sysfs and hwmon support
> > >   habanalabs: add device reset support
> > >   habanalabs: add command submission module
> > >   habanalabs: implement INFO IOCTL
> > >   habanalabs: add debugfs support
> > >   Update MAINTAINERS and CREDITS with habanalabs info
> > >
> > > Omer Shpigelman (1):
> > >   habanalabs: add virtual memory and MMU modules
> > >
> > >  CREDITS   |2 +-
> > >  .../ABI/testing/debugfs-driver-habanalabs |  127 +
> > >  .../ABI/testing/sysfs-driver-habanalabs   |  190 +
> > >  MAINTAINERS   |9 +
> > >  drivers/misc/Kconfig  |1 +
> > >  drivers/misc/Makefile |1 +
> > >  drivers/misc/habanalabs/Kconfig   |   22 +
> > >  drivers/misc/habanalabs/Makefile  |   15 +
> > >  drivers/misc/habanalabs/asid.c|   58 +
> > >  drivers/misc/habanalabs/command_buffer.c  |  432 +
> > >  drivers/misc/habanalabs/command_submission.c  |  787 ++
> > >  drivers/misc/habanalabs/context.c |  216 +
> > >  drivers/misc/habanalabs/debugfs.c | 1071 ++
> > >  drivers/misc/habanalabs/device.c  | 1110 ++
> > >  drivers/misc/habanalabs/goya/Makefile |4 +
> > >  drivers/misc/habanalabs/goya/goya.c   | 5338 ++
> > >  drivers/misc/habanalabs/goya/goyaP.h  |  193 +
> > >  drivers/misc/habanalabs/goya/goya_hwmgr.c |  306 +
> > >  drivers/misc/habanalabs/goya/goya_security.c  | 2999 ++
> > >  drivers/misc/habanalabs/habanalabs.h  | 1448 +++
> > >  drivers/misc/habanalabs/habanalabs_drv.c  |  469 +
> > >  drivers/misc/habanalabs/habanalabs_ioctl.c|  234 +
> > >  drivers/misc/habanalabs/hw_queue.c|  654 ++
> > >  drivers/misc/habanalabs/hwmon.c   |  449 +
> > >  drivers/misc/habanalabs/include/armcp_if.h|  335 +
> > >  .../include/goya/asic_reg/cpu_ca53_cfg_regs.h |  213 +
> > >  .../include/goya/asic_reg/cpu_if_regs.h   |  110 +
> > >  .../include/goya/asic_reg/cpu_pll_regs.h  |  186 +
> > >  .../include/goya/asic_reg/ddr_mc_ch0_regs.h   | 1158 +++
> > >  .../include/goya/asic_reg/ddr_mc_ch1_regs.h   | 1158 +++
> > >  .../include/goya/asic_reg/ddr_misc_ch0_regs.h |  156 +
> > >  .../include/goya/asic_reg/ddr_misc_ch1_regs.h |  156 +
> > >  .../include/goya/asic_reg/dma_ch_0_regs.h |  512 +
> > >  .../include/goya/asic_reg/dma_ch_1_regs.h |  512 +
> > >  .../include/goya/asic_reg/dma_ch_2_regs.h |  512 +
> > >  

Re: [PATCH v2 00/15] Habana Labs kernel driver

2019-02-03 Thread Oded Gabbay
On Sun, Feb 3, 2019 at 1:50 PM Mike Rapoport  wrote:
>
> Hi Oded,
>
> On Thu, Jan 31, 2019 at 12:06:02AM +0200, Oded Gabbay wrote:
> > Hello,
> > This is v2 of the Habana Labs kernel driver patch-set. It contains fixes
> > for almost everything that was brought up in the review of v1.
> >
> > In addition to local changes in each patch that are detailed in each
> > patch's commit message, the global/major changes are:
> >
> > - Rebased on v5.0-rc4
> > - Removed all bitfields from interface files to H/W and F/W
> > - Use __le16/32/64 instead of __u16/32/64 in F/W or H/W structures
>
> For v2 I had comments only for "[PATCH v2 07/15] habanalabs: add h/w queues
> module".
Saw this and I will address it (didn't have time yet).
Thanks for the entire review!

>
> There are still several over-exited printk calls with three exclamation
> marks. ;-)
I'll go over the code again and remove them :)

>
> I've also spotted several places where checkpatch.pl may complain, but I
> was to lazy to actually check it.
>
I actually make sure to checkpatch every patch I send, and except for
patch 1/15 which complains about 1 use of volatile, there are 0
comments. I don't run with --strict though.

> > Link to v1 cover letter: https://lwn.net/Articles/777342/
> >
> > I would appricate any feedback, question and/or review.
> >
> > Thanks,
> > Oded
> >
> > p.s. for those who prefer to clone the tree instead of looking at the
> > emails, you can grab a copy from our company's page in GitHub:
> >
> > https://github.com/HabanaAI/linux/releases/tag/hl_patchset_v2_20190130
> >
> > Oded Gabbay (14):
> >   habanalabs: add skeleton driver
> >   habanalabs: add Goya registers header files
>
> This one is 4.3M which is 6 times the entire habanalabs driver without
> those headers.
> Any chance some of it can be dropped?
I'll do another round of checking to see if I can cut anything.

>
> >   habanalabs: add basic Goya support
> >   habanalabs: add context and ASID modules
> >   habanalabs: add command buffer module
> >   habanalabs: add basic Goya h/w initialization
> >   habanalabs: add h/w queues module
> >   habanalabs: add event queue and interrupts
> >   habanalabs: add sysfs and hwmon support
> >   habanalabs: add device reset support
> >   habanalabs: add command submission module
> >   habanalabs: implement INFO IOCTL
> >   habanalabs: add debugfs support
> >   Update MAINTAINERS and CREDITS with habanalabs info
> >
> > Omer Shpigelman (1):
> >   habanalabs: add virtual memory and MMU modules
> >
> >  CREDITS   |2 +-
> >  .../ABI/testing/debugfs-driver-habanalabs |  127 +
> >  .../ABI/testing/sysfs-driver-habanalabs   |  190 +
> >  MAINTAINERS   |9 +
> >  drivers/misc/Kconfig  |1 +
> >  drivers/misc/Makefile |1 +
> >  drivers/misc/habanalabs/Kconfig   |   22 +
> >  drivers/misc/habanalabs/Makefile  |   15 +
> >  drivers/misc/habanalabs/asid.c|   58 +
> >  drivers/misc/habanalabs/command_buffer.c  |  432 +
> >  drivers/misc/habanalabs/command_submission.c  |  787 ++
> >  drivers/misc/habanalabs/context.c |  216 +
> >  drivers/misc/habanalabs/debugfs.c | 1071 ++
> >  drivers/misc/habanalabs/device.c  | 1110 ++
> >  drivers/misc/habanalabs/goya/Makefile |4 +
> >  drivers/misc/habanalabs/goya/goya.c   | 5338 ++
> >  drivers/misc/habanalabs/goya/goyaP.h  |  193 +
> >  drivers/misc/habanalabs/goya/goya_hwmgr.c |  306 +
> >  drivers/misc/habanalabs/goya/goya_security.c  | 2999 ++
> >  drivers/misc/habanalabs/habanalabs.h  | 1448 +++
> >  drivers/misc/habanalabs/habanalabs_drv.c  |  469 +
> >  drivers/misc/habanalabs/habanalabs_ioctl.c|  234 +
> >  drivers/misc/habanalabs/hw_queue.c|  654 ++
> >  drivers/misc/habanalabs/hwmon.c   |  449 +
> >  drivers/misc/habanalabs/include/armcp_if.h|  335 +
> >  .../include/goya/asic_reg/cpu_ca53_cfg_regs.h |  213 +
> >  .../include/goya/asic_reg/cpu_if_regs.h   |  110 +
> >  .../include/goya/asic_reg/cpu_pll_regs.h  |  186 +
> >  .../include/goya/asic_reg/ddr_mc_ch0_regs.h   | 1158 +++
> >  .../include/goya/asic_reg/ddr_mc_ch1_regs.h   | 1158 +++
> >  .../include/goya/asic_reg/ddr_misc_ch0_regs.h |  156 +
> >  .../include/goya/asic_reg/ddr_misc_ch1_regs.h |  156 +
> >  .../include/goya/asic_reg/dma_ch_0_regs.h |  512 +
> >  .../include/goya/asic_reg/dma_ch_1_regs.h |  512 +
> >  .../include/goya/asic_reg/dma_ch_2_regs.h |  512 +
> >  .../include/goya/asic_reg/dma_ch_3_regs.h |  512 +
> >  .../include/goya/asic_reg/dma_ch_4_regs.h |  512 +
> >  .../include/goya/asic_reg/dma_macro_regs.h|  242 +
> >  .../include/goya/asic_reg/dma_nrtr_regs.h |  380 +
> >  .../include/goya/asic_reg/dma_qm_0_regs.h |  543 +
> >  .../include/goya/asic_reg/dma_qm_1_regs.h |  543 +

Re: [PATCH v2 00/15] Habana Labs kernel driver

2019-02-03 Thread Mike Rapoport
Hi Oded,

On Thu, Jan 31, 2019 at 12:06:02AM +0200, Oded Gabbay wrote:
> Hello,
> This is v2 of the Habana Labs kernel driver patch-set. It contains fixes
> for almost everything that was brought up in the review of v1.
> 
> In addition to local changes in each patch that are detailed in each
> patch's commit message, the global/major changes are:
> 
> - Rebased on v5.0-rc4
> - Removed all bitfields from interface files to H/W and F/W
> - Use __le16/32/64 instead of __u16/32/64 in F/W or H/W structures

For v2 I had comments only for "[PATCH v2 07/15] habanalabs: add h/w queues
module".

There are still several over-exited printk calls with three exclamation
marks. ;-)

I've also spotted several places where checkpatch.pl may complain, but I
was to lazy to actually check it.
 
> Link to v1 cover letter: https://lwn.net/Articles/777342/
> 
> I would appricate any feedback, question and/or review.
> 
> Thanks,
> Oded
> 
> p.s. for those who prefer to clone the tree instead of looking at the
> emails, you can grab a copy from our company's page in GitHub:
> 
> https://github.com/HabanaAI/linux/releases/tag/hl_patchset_v2_20190130
> 
> Oded Gabbay (14):
>   habanalabs: add skeleton driver
>   habanalabs: add Goya registers header files

This one is 4.3M which is 6 times the entire habanalabs driver without
those headers.
Any chance some of it can be dropped?

>   habanalabs: add basic Goya support
>   habanalabs: add context and ASID modules
>   habanalabs: add command buffer module
>   habanalabs: add basic Goya h/w initialization
>   habanalabs: add h/w queues module
>   habanalabs: add event queue and interrupts
>   habanalabs: add sysfs and hwmon support
>   habanalabs: add device reset support
>   habanalabs: add command submission module
>   habanalabs: implement INFO IOCTL
>   habanalabs: add debugfs support
>   Update MAINTAINERS and CREDITS with habanalabs info
> 
> Omer Shpigelman (1):
>   habanalabs: add virtual memory and MMU modules
> 
>  CREDITS   |2 +-
>  .../ABI/testing/debugfs-driver-habanalabs |  127 +
>  .../ABI/testing/sysfs-driver-habanalabs   |  190 +
>  MAINTAINERS   |9 +
>  drivers/misc/Kconfig  |1 +
>  drivers/misc/Makefile |1 +
>  drivers/misc/habanalabs/Kconfig   |   22 +
>  drivers/misc/habanalabs/Makefile  |   15 +
>  drivers/misc/habanalabs/asid.c|   58 +
>  drivers/misc/habanalabs/command_buffer.c  |  432 +
>  drivers/misc/habanalabs/command_submission.c  |  787 ++
>  drivers/misc/habanalabs/context.c |  216 +
>  drivers/misc/habanalabs/debugfs.c | 1071 ++
>  drivers/misc/habanalabs/device.c  | 1110 ++
>  drivers/misc/habanalabs/goya/Makefile |4 +
>  drivers/misc/habanalabs/goya/goya.c   | 5338 ++
>  drivers/misc/habanalabs/goya/goyaP.h  |  193 +
>  drivers/misc/habanalabs/goya/goya_hwmgr.c |  306 +
>  drivers/misc/habanalabs/goya/goya_security.c  | 2999 ++
>  drivers/misc/habanalabs/habanalabs.h  | 1448 +++
>  drivers/misc/habanalabs/habanalabs_drv.c  |  469 +
>  drivers/misc/habanalabs/habanalabs_ioctl.c|  234 +
>  drivers/misc/habanalabs/hw_queue.c|  654 ++
>  drivers/misc/habanalabs/hwmon.c   |  449 +
>  drivers/misc/habanalabs/include/armcp_if.h|  335 +
>  .../include/goya/asic_reg/cpu_ca53_cfg_regs.h |  213 +
>  .../include/goya/asic_reg/cpu_if_regs.h   |  110 +
>  .../include/goya/asic_reg/cpu_pll_regs.h  |  186 +
>  .../include/goya/asic_reg/ddr_mc_ch0_regs.h   | 1158 +++
>  .../include/goya/asic_reg/ddr_mc_ch1_regs.h   | 1158 +++
>  .../include/goya/asic_reg/ddr_misc_ch0_regs.h |  156 +
>  .../include/goya/asic_reg/ddr_misc_ch1_regs.h |  156 +
>  .../include/goya/asic_reg/dma_ch_0_regs.h |  512 +
>  .../include/goya/asic_reg/dma_ch_1_regs.h |  512 +
>  .../include/goya/asic_reg/dma_ch_2_regs.h |  512 +
>  .../include/goya/asic_reg/dma_ch_3_regs.h |  512 +
>  .../include/goya/asic_reg/dma_ch_4_regs.h |  512 +
>  .../include/goya/asic_reg/dma_macro_regs.h|  242 +
>  .../include/goya/asic_reg/dma_nrtr_regs.h |  380 +
>  .../include/goya/asic_reg/dma_qm_0_regs.h |  543 +
>  .../include/goya/asic_reg/dma_qm_1_regs.h |  543 +
>  .../include/goya/asic_reg/dma_qm_2_regs.h |  543 +
>  .../include/goya/asic_reg/dma_qm_3_regs.h |  543 +
>  .../include/goya/asic_reg/dma_qm_4_regs.h |  543 +
>  .../include/goya/asic_reg/gic_regs.h  | 9079 +
>  .../include/goya/asic_reg/goya_blocks.h   | 1372 +++
>  .../include/goya/asic_reg/goya_masks.h|  262 +
>  .../include/goya/asic_reg/goya_regs.h |  119 +
>  .../include/goya/asic_reg/ic_pll_regs.h   |  186 +
>  .../include/goya/asic_reg/mc_pll_regs.h   |  186 +
>  .../include/goya/asic_reg/mme1_rtr_regs.h |  876 ++
>  

[PATCH v2 00/15] Habana Labs kernel driver

2019-01-30 Thread Oded Gabbay
Hello,
This is v2 of the Habana Labs kernel driver patch-set. It contains fixes
for almost everything that was brought up in the review of v1.

In addition to local changes in each patch that are detailed in each
patch's commit message, the global/major changes are:

- Rebased on v5.0-rc4
- Removed all bitfields from interface files to H/W and F/W
- Use __le16/32/64 instead of __u16/32/64 in F/W or H/W structures

Link to v1 cover letter: https://lwn.net/Articles/777342/

I would appricate any feedback, question and/or review.

Thanks,
Oded

p.s. for those who prefer to clone the tree instead of looking at the
emails, you can grab a copy from our company's page in GitHub:

https://github.com/HabanaAI/linux/releases/tag/hl_patchset_v2_20190130

Oded Gabbay (14):
  habanalabs: add skeleton driver
  habanalabs: add Goya registers header files
  habanalabs: add basic Goya support
  habanalabs: add context and ASID modules
  habanalabs: add command buffer module
  habanalabs: add basic Goya h/w initialization
  habanalabs: add h/w queues module
  habanalabs: add event queue and interrupts
  habanalabs: add sysfs and hwmon support
  habanalabs: add device reset support
  habanalabs: add command submission module
  habanalabs: implement INFO IOCTL
  habanalabs: add debugfs support
  Update MAINTAINERS and CREDITS with habanalabs info

Omer Shpigelman (1):
  habanalabs: add virtual memory and MMU modules

 CREDITS   |2 +-
 .../ABI/testing/debugfs-driver-habanalabs |  127 +
 .../ABI/testing/sysfs-driver-habanalabs   |  190 +
 MAINTAINERS   |9 +
 drivers/misc/Kconfig  |1 +
 drivers/misc/Makefile |1 +
 drivers/misc/habanalabs/Kconfig   |   22 +
 drivers/misc/habanalabs/Makefile  |   15 +
 drivers/misc/habanalabs/asid.c|   58 +
 drivers/misc/habanalabs/command_buffer.c  |  432 +
 drivers/misc/habanalabs/command_submission.c  |  787 ++
 drivers/misc/habanalabs/context.c |  216 +
 drivers/misc/habanalabs/debugfs.c | 1071 ++
 drivers/misc/habanalabs/device.c  | 1110 ++
 drivers/misc/habanalabs/goya/Makefile |4 +
 drivers/misc/habanalabs/goya/goya.c   | 5338 ++
 drivers/misc/habanalabs/goya/goyaP.h  |  193 +
 drivers/misc/habanalabs/goya/goya_hwmgr.c |  306 +
 drivers/misc/habanalabs/goya/goya_security.c  | 2999 ++
 drivers/misc/habanalabs/habanalabs.h  | 1448 +++
 drivers/misc/habanalabs/habanalabs_drv.c  |  469 +
 drivers/misc/habanalabs/habanalabs_ioctl.c|  234 +
 drivers/misc/habanalabs/hw_queue.c|  654 ++
 drivers/misc/habanalabs/hwmon.c   |  449 +
 drivers/misc/habanalabs/include/armcp_if.h|  335 +
 .../include/goya/asic_reg/cpu_ca53_cfg_regs.h |  213 +
 .../include/goya/asic_reg/cpu_if_regs.h   |  110 +
 .../include/goya/asic_reg/cpu_pll_regs.h  |  186 +
 .../include/goya/asic_reg/ddr_mc_ch0_regs.h   | 1158 +++
 .../include/goya/asic_reg/ddr_mc_ch1_regs.h   | 1158 +++
 .../include/goya/asic_reg/ddr_misc_ch0_regs.h |  156 +
 .../include/goya/asic_reg/ddr_misc_ch1_regs.h |  156 +
 .../include/goya/asic_reg/dma_ch_0_regs.h |  512 +
 .../include/goya/asic_reg/dma_ch_1_regs.h |  512 +
 .../include/goya/asic_reg/dma_ch_2_regs.h |  512 +
 .../include/goya/asic_reg/dma_ch_3_regs.h |  512 +
 .../include/goya/asic_reg/dma_ch_4_regs.h |  512 +
 .../include/goya/asic_reg/dma_macro_regs.h|  242 +
 .../include/goya/asic_reg/dma_nrtr_regs.h |  380 +
 .../include/goya/asic_reg/dma_qm_0_regs.h |  543 +
 .../include/goya/asic_reg/dma_qm_1_regs.h |  543 +
 .../include/goya/asic_reg/dma_qm_2_regs.h |  543 +
 .../include/goya/asic_reg/dma_qm_3_regs.h |  543 +
 .../include/goya/asic_reg/dma_qm_4_regs.h |  543 +
 .../include/goya/asic_reg/gic_regs.h  | 9079 +
 .../include/goya/asic_reg/goya_blocks.h   | 1372 +++
 .../include/goya/asic_reg/goya_masks.h|  262 +
 .../include/goya/asic_reg/goya_regs.h |  119 +
 .../include/goya/asic_reg/ic_pll_regs.h   |  186 +
 .../include/goya/asic_reg/mc_pll_regs.h   |  186 +
 .../include/goya/asic_reg/mme1_rtr_regs.h |  876 ++
 .../include/goya/asic_reg/mme2_rtr_regs.h |  876 ++
 .../include/goya/asic_reg/mme3_rtr_regs.h |  876 ++
 .../include/goya/asic_reg/mme4_rtr_regs.h |  876 ++
 .../include/goya/asic_reg/mme5_rtr_regs.h |  876 ++
 .../include/goya/asic_reg/mme6_rtr_regs.h |  876 ++
 .../include/goya/asic_reg/mme_cmdq_regs.h |  431 +
 .../include/goya/asic_reg/mme_qm_regs.h   |  543 +
 .../include/goya/asic_reg/mme_regs.h  | 2422 +
 .../include/goya/asic_reg/mmu_regs.h  |  158 +
 .../include/goya/asic_reg/pci_nrtr_regs.h |  380 +
 .../include/goya/asic_reg/pcie_aux_regs.h |  476 +
 .../include/goya/asic_reg/pcie_dbi_regs.h |