1. Dec 29, 2017
  2. Dec 28, 2017
    • Satendra Singh Thakur's avatar
      media: videobuf2: Add new uAPI for DVB streaming I/O · 57868acc
      Satendra Singh Thakur authored
      Adds a new uAPI for DVB to use streaming I/O which is implemented
      based on videobuf2, using those new ioctls:
      
      - DMX_REQBUFS:  Request kernel to allocate buffers which count and size
      	        are dedicated by user.
      - DMX_QUERYBUF: Get the buffer information like a memory offset which
      		will mmap() and be shared with user-space.
      - DMX_EXPBUF:   Just for testing whether buffer-exporting success or not.
      - DMX_QBUF:     Pass the buffer to kernel-space.
      - DMX_DQBUF:    Get back the buffer which may contain TS data.
      
      Originally developed by: Junghak Sung <jh1009.sung@samsung.com>, as
      seen at:
      	https://patchwork.linuxtv.org/patch/31613/
      	https://patchwork.kernel.org/patch/7334301/
      
      
      
      The original patch was written before merging VB2-core functionalities
      upstream. When such series was added, several adjustments were made,
      fixing some issues with	V4L2, causing the original patch to be
      non-trivially rebased.
      
      After rebased, a few bugs in the patch were fixed. The patch was
      also enhanced it and polling functionality got added.
      
      The main changes over the original patch are:
      
      dvb_vb2_fill_buffer():
      	- Set the size of the outgoing buffer after while loop using
      	  vb2_set_plane_payload;
      
      	- Added NULL check for source buffer as per normal convention
      	  of demux driver, this is called twice, first time with valid
      	  buffer second time with NULL pointer, if its not handled,
      	  it will result in  crash
      
      	- Restricted spinlock for only list_* operations
      
      dvb_vb2_init():
      	- Restricted q->io_modes to only VB2_MMAP as its the only
      	  supported mode
      
      dvb_vb2_release():
      	- Replaced the && in if condiion with &, because otherwise
      	  it was always getting satisfied.
      
      dvb_vb2_stream_off():
      	- Added list_del code for enqueud buffers upon stream off
      
      dvb_vb2_poll():
      	- Added this new function in order to support polling
      
      dvb_demux_poll() and dvb_dvr_poll()
      	- dvb_vb2_poll() is now called from these functions
      
      - Ported this patch and latest videobuf2 to lower kernel versions and
        tested auto scan.
      
      Co-developed-by: default avatarJunghak Sung <jh1009.sung@samsung.com>
      
      [mchehab@s-opensource.com: checkpatch fixes]
      Signed-off-by: default avatarJunghak Sung <jh1009.sung@samsung.com>
      Signed-off-by: default avatarGeunyoung Kim <nenggun.kim@samsung.com>
      Acked-by: default avatarSeung-Woo Kim <sw0312.kim@samsung.com>
      Acked-by: default avatarInki Dae <inki.dae@samsung.com>
      Signed-off-by: default avatarSatendra Singh Thakur <satendra.t@samsung.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      57868acc
  3. Dec 23, 2017
    • Mauro Carvalho Chehab's avatar
      Merge branch 'docs-next' of git://git.lwn.net/linux into patchwork · 9eb124fe
      Mauro Carvalho Chehab authored
      * 'docs-next' of git://git.lwn.net/linux: (888 commits)
        w1_netlink.h: add support for nested structs
        scripts: kernel-doc: apply filtering rules to warnings
        scripts: kernel-doc: improve nested logic to handle multiple identifiers
        scripts: kernel-doc: handle nested struct function arguments
        scripts: kernel-doc: print the declaration name on warnings
        scripts: kernel-doc: get rid of $nested parameter
        scripts: kernel-doc: parse next structs/unions
        scripts: kernel-doc: replace tabs by spaces
        scripts: kernel-doc: change default to ReST format
        scripts: kernel-doc: improve argument handling
        scripts: kernel-doc: get rid of unused output formats
        docs: get rid of kernel-doc-nano-HOWTO.txt
        docs: kernel-doc.rst: add documentation about man pages
        docs: kernel-doc.rst: improve typedef documentation
        docs: kernel-doc.rst: improve structs chapter
        docs: kernel-doc.rst: improve function documentation section
        docs: kernel-doc.rst: improve private members description
        docs: kernel-doc.rst: better describe kernel-doc arguments
        docs: fix process/submit-checklist.rst Sphinx warning
        docs: ftrace-uses.rst fix varios code-block directives
        ...
      9eb124fe
  4. Dec 22, 2017
    • Mauro Carvalho Chehab's avatar
      w1_netlink.h: add support for nested structs · aa931b44
      Mauro Carvalho Chehab authored
      
      
      Now that kernel-doc can hanle nested structs/unions, describe
      such fields at w1_netlink_message_types.
      
      Acked-by: default avatarEvgeniy Polyakov <zbr@ioremap.net>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      aa931b44
    • Mauro Carvalho Chehab's avatar
      scripts: kernel-doc: apply filtering rules to warnings · 2defb272
      Mauro Carvalho Chehab authored
      
      
      When kernel-doc is called with output selection filters,
      it will be called lots of time for a single file. If
      there is a warning present there, it means that it may
      print hundreds of identical warnings.
      
      Worse than that, the -function NAME actually filters only
      functions. So, it makes no sense at all to print warnings
      for structs or enums.
      
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      2defb272
    • Mauro Carvalho Chehab's avatar
      scripts: kernel-doc: improve nested logic to handle multiple identifiers · 84ce5b98
      Mauro Carvalho Chehab authored
      
      
      It is possible to use nested structs like:
      
      struct {
      	struct {
      		void *arg1;
      	} st1, st2, *st3, st4;
      };
      
      Handling it requires to split each parameter. Change the logic
      to allow such definitions.
      
      In order to test the new nested logic, the following file
      was used to test
      
      <code>
      struct foo { int a; }; /* Just to avoid errors if compiled */
      
      /**
       * struct my_struct - a struct with nested unions and structs
       * @arg1: first argument of anonymous union/anonymous struct
       * @arg2: second argument of anonymous union/anonymous struct
       * @arg1b: first argument of anonymous union/anonymous struct
       * @arg2b: second argument of anonymous union/anonymous struct
       * @arg3: third argument of anonymous union/anonymous struct
       * @arg4: fourth argument of anonymous union/anonymous struct
       * @bar.st1.arg1: first argument of struct st1 on union bar
       * @bar.st1.arg2: second argument of struct st1 on union bar
       * @bar.st1.bar1: bar1 at st1
       * @bar.st1.bar2: bar2 at st1
       * @bar.st2.arg1: first argument of struct st2 on union bar
       * @bar.st2.arg2: second argument of struct st2 on union bar
       * @bar.st3.arg2: second argument of struct st3 on union bar
       * @f1: nested function on anonimous union/struct
       * @bar.st2.f2: nested function on named union/struct
       */
      struct my_struct {
         /* Anonymous union/struct*/
         union {
      	struct {
      	    char arg1 : 1;
      	    char arg2 : 3;
      	};
             struct {
                 int arg1b;
                 int arg2b;
             };
             struct {
                 void *arg3;
                 int arg4;
                 int (*f1)(char foo, int bar);
             };
         };
         union {
             struct {
                 int arg1;
                 int arg2;
      	   struct foo bar1, *bar2;
             } st1;           /* bar.st1 is undocumented, cause a warning */
             struct {
                 void *arg1;  /* bar.st3.arg1 is undocumented, cause a warning */
      	    int arg2;
                int (*f2)(char foo, int bar); /* bar.st3.fn2 is undocumented, cause a warning */
             } st2, st3, *st4;
             int (*f3)(char foo, int bar); /* f3 is undocumented, cause a warning */
         } bar;               /* bar is undocumented, cause a warning */
      
         /* private: */
         int undoc_privat;    /* is undocumented but private, no warning */
      
         /* public: */
         int undoc_public;    /* is undocumented, cause a warning */
      };
      </code>
      
      It produces the following warnings, as expected:
      
      test2.h:57: warning: Function parameter or member 'bar' not described in 'my_struct'
      test2.h:57: warning: Function parameter or member 'bar.st1' not described in 'my_struct'
      test2.h:57: warning: Function parameter or member 'bar.st2' not described in 'my_struct'
      test2.h:57: warning: Function parameter or member 'bar.st3' not described in 'my_struct'
      test2.h:57: warning: Function parameter or member 'bar.st3.arg1' not described in 'my_struct'
      test2.h:57: warning: Function parameter or member 'bar.st3.f2' not described in 'my_struct'
      test2.h:57: warning: Function parameter or member 'bar.st4' not described in 'my_struct'
      test2.h:57: warning: Function parameter or member 'bar.st4.arg1' not described in 'my_struct'
      test2.h:57: warning: Function parameter or member 'bar.st4.arg2' not described in 'my_struct'
      test2.h:57: warning: Function parameter or member 'bar.st4.f2' not described in 'my_struct'
      test2.h:57: warning: Function parameter or member 'bar.f3' not described in 'my_struct'
      test2.h:57: warning: Function parameter or member 'undoc_public' not described in 'my_struct'
      
      Suggested-by: default avatarMarkus Heiser <markus.heiser@darmarit.de>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      84ce5b98
    • Mauro Carvalho Chehab's avatar
      scripts: kernel-doc: handle nested struct function arguments · 7c0d7e87
      Mauro Carvalho Chehab authored
      
      
      Function arguments are different than usual ones. So, an
      special logic is needed in order to handle such arguments
      on nested structs.
      
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      7c0d7e87
    • Mauro Carvalho Chehab's avatar
      scripts: kernel-doc: print the declaration name on warnings · 151c468b
      Mauro Carvalho Chehab authored
      
      
      The logic at create_parameterlist()'s ancillary push_parameter()
      function has already a way to output the declaration name, with
      would help to discover what declaration is missing.
      
      However, currently, the logic is utterly broken, as it uses
      the var $type with a wrong meaning. With the current code,
      it will never print anything. I suspect that originally
      it was using the second argument of output_declaration().
      
      I opted to not rely on a globally defined $declaration_name,
      but, instead, to pass it explicitly as a parameter.
      
      While here, I removed a unaligned check for !$anon_struct_union.
      This is not needed, as, if $anon_struct_union is not zero,
      $parameterdescs{$param} will be defined.
      
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      151c468b
    • Mauro Carvalho Chehab's avatar
      scripts: kernel-doc: get rid of $nested parameter · 1081de2d
      Mauro Carvalho Chehab authored
      
      
      The check_sections() function has a $nested parameter, meant
      to identify when a nested struct is present. As we now have
      a logic that handles it, get rid of such parameter.
      
      Suggested-by: default avatarMarkus Heiser <markus.heiser@darmarit.de>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      1081de2d
    • Mauro Carvalho Chehab's avatar
      scripts: kernel-doc: parse next structs/unions · 8ad72163
      Mauro Carvalho Chehab authored
      
      
      There are several places within the Kernel tree with nested
      structs/unions, like this one:
      
        struct ingenic_cgu_clk_info {
          const char *name;
          enum {
            CGU_CLK_NONE = 0,
            CGU_CLK_EXT = BIT(0),
            CGU_CLK_PLL = BIT(1),
            CGU_CLK_GATE = BIT(2),
            CGU_CLK_MUX = BIT(3),
            CGU_CLK_MUX_GLITCHFREE = BIT(4),
            CGU_CLK_DIV = BIT(5),
            CGU_CLK_FIXDIV = BIT(6),
            CGU_CLK_CUSTOM = BIT(7),
          } type;
          int parents[4];
          union {
            struct ingenic_cgu_pll_info pll;
            struct {
              struct ingenic_cgu_gate_info gate;
              struct ingenic_cgu_mux_info mux;
              struct ingenic_cgu_div_info div;
              struct ingenic_cgu_fixdiv_info fixdiv;
            };
            struct ingenic_cgu_custom_info custom;
          };
        };
      
      Currently, such struct is documented as:
      
      	**Definition**
      
      	::
      	struct ingenic_cgu_clk_info {
      	    const char * name;
      	};
      
      	**Members**
      
      	``name``
      	  name of the clock
      
      With is obvioulsy wrong. It also generates an error:
      	drivers/clk/ingenic/cgu.h:169: warning: No description found for parameter 'enum'
      
      However, there's nothing wrong with this kernel-doc markup: everything
      is documented there.
      
      It makes sense to document all fields there. So, add a
      way for the core to parse those structs.
      
      With this patch, all documented fields will properly generate
      documentation.
      
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      8ad72163
    • Mauro Carvalho Chehab's avatar
      scripts: kernel-doc: replace tabs by spaces · 7c9aa015
      Mauro Carvalho Chehab authored
      
      
      Sphinx has a hard time dealing with tabs, causing it to
      misinterpret paragraph continuation.
      
      As we're now mainly focused on supporting ReST output,
      replace tabs by spaces, in order to avoid troubles when
      the output is parsed by Sphinx.
      
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      7c9aa015
    • Mauro Carvalho Chehab's avatar
      scripts: kernel-doc: change default to ReST format · bdfe2be3
      Mauro Carvalho Chehab authored
      
      
      Right now, if kernel-doc is called without arguments, it
      defaults to man pages. IMO, it makes more sense to
      default to ReST, as this is the output that it is most
      used nowadays, and it easier to check if everything got
      parsed fine on an enriched text mode format.
      
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      bdfe2be3
    • Mauro Carvalho Chehab's avatar
      scripts: kernel-doc: improve argument handling · b031ac4e
      Mauro Carvalho Chehab authored
      
      
      Right now, if one uses "--rst" instead of "-rst", it just
      ignore the argument and produces a man page. Change the
      logic to accept both "-cmd" and "--cmd". Also, if
      "cmd" doesn't exist, print the usage information and exit.
      
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      b031ac4e
    • Mauro Carvalho Chehab's avatar
      scripts: kernel-doc: get rid of unused output formats · b0514267
      Mauro Carvalho Chehab authored
      
      
      Since there isn't any docbook code anymore upstream,
      we can get rid of several output formats:
      
      - docbook/xml, html, html5 and list formats were used by
        the old build system;
      - As ReST is text, there's not much sense on outputting
        on a different text format.
      
      After this patch, only man and rst output formats are
      supported.
      
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Acked-by: default avatarJani Nikula <jani.nikula@intel.com>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      b0514267