Re: [PATCH] dt-bindings: Drop type references on common properties

2021-03-16 Thread Dmitry Baryshkov
On Tue, 16 Mar 2021 at 22:49, Rob Herring  wrote:
>
> Users of common properties shouldn't have a type definition as the
> common schemas already have one. Drop all the unnecessary type
> references in the tree.
>
> A meta-schema update to catch these is pending.
>
> Cc: Nicolas Saenz Julienne 
> Cc: Maxime Ripard 
> Cc: Linus Walleij 
> Cc: Bartosz Golaszewski 
> Cc: Bjorn Andersson 
> Cc: Krzysztof Kozlowski 
> Cc: Marc Kleine-Budde 
> Cc: "David S. Miller" 
> Cc: Jakub Kicinski 
> Cc: Srinivas Kandagatla 
> Cc: Ohad Ben-Cohen 
> Cc: Mark Brown 
> Cc: Cheng-Yi Chiang 
> Cc: Benson Leung 
> Cc: Zhang Rui 
> Cc: Daniel Lezcano 
> Cc: Greg Kroah-Hartman 
> Cc: Stefan Wahren 
> Cc: Masahiro Yamada 
> Cc: Odelu Kukatla 
> Cc: Alex Elder 
> Cc: Suman Anna 
> Cc: Kuninori Morimoto 
> Cc: Dmitry Baryshkov 
> Cc: linux-g...@vger.kernel.org
> Cc: linux...@vger.kernel.org
> Cc: linux-...@vger.kernel.org
> Cc: netdev@vger.kernel.org
> Cc: linux-remotep...@vger.kernel.org
> Cc: alsa-de...@alsa-project.org
> Cc: linux-...@vger.kernel.org
> Signed-off-by: Rob Herring 
> ---
>  .../bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml   | 5 +
>  Documentation/devicetree/bindings/arm/cpus.yaml  | 2 --
>  .../bindings/display/allwinner,sun4i-a10-tcon.yaml   | 1 -
>  .../devicetree/bindings/gpio/socionext,uniphier-gpio.yaml| 3 +--
>  .../devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.yaml  | 1 -
>  .../devicetree/bindings/interconnect/qcom,rpmh.yaml  | 1 -
>  .../bindings/memory-controllers/nvidia,tegra210-emc.yaml | 2 +-
>  Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml   | 1 -
>  Documentation/devicetree/bindings/net/qcom,ipa.yaml  | 1 -
>  Documentation/devicetree/bindings/nvmem/nvmem-consumer.yaml  | 2 --
>  .../devicetree/bindings/remoteproc/ti,omap-remoteproc.yaml   | 2 +-
>  Documentation/devicetree/bindings/sound/ak4642.yaml  | 2 --
>  .../devicetree/bindings/sound/google,cros-ec-codec.yaml  | 2 +-
>  Documentation/devicetree/bindings/sound/renesas,rsnd.yaml| 1 -
>  .../devicetree/bindings/thermal/qcom-spmi-adc-tm5.yaml   | 1 -
>  Documentation/devicetree/bindings/usb/usb.yaml   | 1 -
>  16 files changed, 5 insertions(+), 23 deletions(-)

For the qcom-spmi-adc-tm5.yaml:
Acked-by: Dmity Baryshkov 

>
> diff --git 
> a/Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml 
> b/Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml
> index a2c63c8b1d10..c6144c8421fa 100644
> --- 
> a/Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml
> +++ 
> b/Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml
> @@ -26,10 +26,7 @@ properties:
>- const: simple-mfd
>
>mboxes:
> -$ref: '/schemas/types.yaml#/definitions/phandle'
> -description: |
> -  Phandle to the firmware device's Mailbox.
> -  (See: ../mailbox/mailbox.txt for more information)
> +maxItems: 1
>
>clocks:
>  type: object
> diff --git a/Documentation/devicetree/bindings/arm/cpus.yaml 
> b/Documentation/devicetree/bindings/arm/cpus.yaml
> index 26b886b20b27..6be4a8852ee5 100644
> --- a/Documentation/devicetree/bindings/arm/cpus.yaml
> +++ b/Documentation/devicetree/bindings/arm/cpus.yaml
> @@ -256,13 +256,11 @@ properties:
>where voltage is in V, frequency is in MHz.
>
>power-domains:
> -$ref: '/schemas/types.yaml#/definitions/phandle-array'
>  description:
>List of phandles and PM domain specifiers, as defined by bindings of 
> the
>PM domain provider (see also ../power_domain.txt).
>
>power-domain-names:
> -$ref: '/schemas/types.yaml#/definitions/string-array'
>  description:
>A list of power domain name strings sorted in the same order as the
>power-domains property.
> diff --git 
> a/Documentation/devicetree/bindings/display/allwinner,sun4i-a10-tcon.yaml 
> b/Documentation/devicetree/bindings/display/allwinner,sun4i-a10-tcon.yaml
> index c13faf3e6581..3a7d5d731712 100644
> --- a/Documentation/devicetree/bindings/display/allwinner,sun4i-a10-tcon.yaml
> +++ b/Documentation/devicetree/bindings/display/allwinner,sun4i-a10-tcon.yaml
> @@ -73,7 +73,6 @@ properties:
>clock-output-names:
>  description:
>Name of the LCD pixel clock created.
> -$ref: /schemas/types.yaml#/definitions/string-array
>  maxItems: 1
>
>dmas:
> diff --git 
> a/Documentation/devicetree/bindings/gpio/socionext,uniphier-gpio.yaml 
> b/Documentation/devicetree/bindings/gpio/socionext,

Re: [PATCH] Fallback to ipv4 if we try to add join IPv4 multicast group via ipv4-mapped address.

2007-10-03 Thread Dmitry Baryshkov

Hello,

David Stevens wrote:

Dmitry,
Good catch; a couple comments:


Thank you for the response.




struct ipv6_pinfo *np = inet6_sk(sk);
int err;
+   int addr_type = ipv6_addr_type(addr);
+
+   if (addr_type == IPV6_ADDR_MAPPED) {
+  __be32 v4addr = addr->s6_addr32[3];
+  struct ip_mreqn mreq;
+  mreq.imr_multiaddr.s_addr = v4addr;
+  mreq.imr_address.s_addr = INADDR_ANY;
+  mreq.imr_ifindex = ifindex;
+
+  return ip_mc_join_group(sk, &mreq);
+   }


ipv6_addr_type() returns a bitmask, so you should use:

if (addr_type & IPV6_ADDR_MAPPED) {


I just c'n'pasted the code that checks for mapped addresses. In most 
cases it's just ==, not bitmask operation.




Also, you should have a blank line after the "mreq" declaration.


ok.



Ditto for both in ipv6_mc_sock_drop().




I don't expect the multicast source filtering interface will
behave well for mapped addresses, either. The mapped multicast
address won't appear to be a multicast address (and return
error there), and all the source filters would have to be
v4mapped addresses and modify the v4 source filters for this
to do as you expect. So, there's more to it (and it may be a
bit messy) to support mapped multicast addresses fully. I'll
think about that part some more.



Didn't have time to test it throughly. I've only checked that call 
succeeds and that all necessary igmp are sent. I hope, this weekend I'll 
have more time to check.


--
With best wishes
Dmitry Baryshkov

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Fallback to ipv4 if we try to add join IPv4 multicast group via ipv4-mapped address.

2007-10-02 Thread Dmitry Baryshkov
Signed-off-by: Dmitry Baryshkov <[EMAIL PROTECTED]>

diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index ae98818..c70a87d 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -183,6 +184,17 @@ int ipv6_sock_mc_join(struct sock *sk, int ifindex, struct 
in6_addr *addr)
struct ipv6_mc_socklist *mc_lst;
struct ipv6_pinfo *np = inet6_sk(sk);
int err;
+   int addr_type = ipv6_addr_type(addr);
+
+   if (addr_type == IPV6_ADDR_MAPPED) {
+   __be32 v4addr = addr->s6_addr32[3];
+   struct ip_mreqn mreq;
+   mreq.imr_multiaddr.s_addr = v4addr;
+   mreq.imr_address.s_addr = INADDR_ANY;
+   mreq.imr_ifindex = ifindex;
+
+   return ip_mc_join_group(sk, &mreq);
+   }
 
if (!ipv6_addr_is_multicast(addr))
return -EINVAL;
@@ -256,6 +268,18 @@ int ipv6_sock_mc_drop(struct sock *sk, int ifindex, struct 
in6_addr *addr)
struct ipv6_pinfo *np = inet6_sk(sk);
struct ipv6_mc_socklist *mc_lst, **lnk;
 
+   int addr_type = ipv6_addr_type(addr);
+
+   if (addr_type == IPV6_ADDR_MAPPED) {
+   __be32 v4addr = addr->s6_addr32[3];
+   struct ip_mreqn mreq;
+   mreq.imr_multiaddr.s_addr = v4addr;
+   mreq.imr_address.s_addr = INADDR_ANY;
+   mreq.imr_ifindex = ifindex;
+
+   return ip_mc_leave_group(sk, &mreq);
+   }
+
write_lock_bh(&ipv6_sk_mc_lock);
for (lnk = &np->ipv6_mc_list; (mc_lst = *lnk) !=NULL ; lnk = 
&mc_lst->next) {
if ((ifindex == 0 || mc_lst->ifindex == ifindex) &&

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html