Re: [PATCH net] hyperv: Fix the carrier status setting

2014-02-10 Thread Sergei Shtylyov

Hello.

On 10-02-2014 5:07, Haiyang Zhang wrote:


Signed-off-by: Haiyang Zhang haiya...@microsoft.com
Reviewed-by: K. Y. Srinivasan k...@microsoft.com
---
  drivers/net/hyperv/netvsc_drv.c |   24 +++-
  1 files changed, 15 insertions(+), 9 deletions(-)



diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 7756118..836211c 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c

[...]

@@ -229,15 +238,17 @@ void netvsc_linkstatus_callback(struct hv_device 
*device_obj,
struct net_device *net;
struct net_device_context *ndev_ctx;
struct netvsc_device *net_device;
+   struct rndis_device *rdev;

net_device = hv_get_drvdata(device_obj);
+   rdev = net_device-extension;
+
+   rdev-link_state = !(status == 1);


   Why not just 'status != 1'?

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net-next,v3] hyperv: Add support for virtual Receive Side Scaling (vRSS)

2014-03-19 Thread Sergei Shtylyov

Hello.

On 03/19/2014 11:40 PM, David Miller wrote:


+extern u8 netvsc_hash_key[];



We no longer use extern in header file function declarations.


   Wait, this is a variable declaration. :-)

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2a RESEND 2/2] of_mdio: Allow the DT to specify the phy ID and avoid autoprobing

2014-03-19 Thread Sergei Shtylyov

Hello.

On 03/20/2014 01:14 AM, Jason Gunthorpe wrote:


The preferred multi-line comment style is:



/*
  * bla
  * bla
  */



Sergei, the entire file use the 'net' multi-line commenting style, and
I have maintined that consistency with the new code.


   No, you haven't followed the networking style. It is:

/* bla
 * bla
 */

while your comment used:

/* bla
 * bla */


v3 on its way.



Regards,
Jason


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2a RESEND 2/2] of_mdio: Allow the DT to specify the phy ID and avoid autoprobing

2014-03-19 Thread Sergei Shtylyov

On 03/20/2014 01:36 AM, Jason Gunthorpe wrote:


The preferred multi-line comment style is:



/*
  * bla
  * bla
  */



Sergei, the entire file use the 'net' multi-line commenting style, and
I have maintined that consistency with the new code.



No, you haven't followed the networking style. It is:



/* bla
  * bla
  */



while your comment used:



/* bla
  * bla */



Oh Ok - but the latter is the used by the majority of pre-existing
comments..



I thought the convention on stuff like this was to stick with the
existing style?


   Hardly so when there's preferred one, described in CodingStyle.


Do you think it is worth a v4? If so, which style is appropriate?
There is one other pre-existing comment that uses net.


   Well, use the net style then. I don't see significant difference between 
it and the default preferred style.



Regards,
Jason


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] coding style: fix line over 80 characters

2014-03-20 Thread Sergei Shtylyov

Hello.

On 03/20/2014 01:04 AM, Cédric Cabessa wrote:


Signed-off-by: Cédric Cabessa c...@ryick.net
---
  drivers/staging/usbip/vhci_hcd.c | 33 ++---
  1 file changed, 22 insertions(+), 11 deletions(-)



diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c
index f690668..1e84577 100644
--- a/drivers/staging/usbip/vhci_hcd.c
+++ b/drivers/staging/usbip/vhci_hcd.c
@@ -271,12 +271,14 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 
typeReq, u16 wValue,
}
break;
case USB_PORT_FEAT_POWER:
-   usbip_dbg_vhci_rh( ClearPortFeature: 
USB_PORT_FEAT_POWER\n);
+   usbip_dbg_vhci_rh(
+ClearPortFeature: USB_PORT_FEAT_POWER\n);


   Your version of scripts/checkpatch.pl seems outdated. It shouldn't 
complain about strings violating 80-column limit (and I've just verified it 
doesn't).



@@ -539,7 +546,9 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb 
*urb,

default:
/* NOT REACHED */
-   dev_err(dev, invalid request to devnum 0 bRequest %u, wValue 
%u\n, ctrlreq-bRequest,
+   dev_err(dev,
+   invalid request to devnum 0 bRequest %u, wValue 
%u\n,
+   ctrlreq-bRequest,
ctrlreq-wValue);
ret =  -EINVAL;
goto no_need_xmit;
@@ -1060,7 +1069,9 @@ static int vhci_hcd_suspend(struct platform_device *pdev, 
pm_message_t state)
spin_unlock(the_controller-lock);

if (connected  0) {
-   dev_info(pdev-dev, We have %d active connection%s. Do not suspend.\n, 
connected, (connected == 1 ?  : s));
+   dev_info(pdev-dev,
+We have %d active connection%s. Do not suspend.\n,
+connected, (connected == 1 ?  : s));
ret =  -EBUSY;
} else {
dev_info(pdev-dev, suspend vhci_hcd);


   Hm, I don't see checkpatch.pl complaints about these either in the 
'usb-next' branch of Greg's tree.


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] coding style: fix line over 80 characters

2014-03-20 Thread Sergei Shtylyov

On 03/21/2014 12:34 AM, Sergei Shtylyov wrote:


Signed-off-by: Cédric Cabessa c...@ryick.net
---
  drivers/staging/usbip/vhci_hcd.c | 33 ++---
  1 file changed, 22 insertions(+), 11 deletions(-)



diff --git a/drivers/staging/usbip/vhci_hcd.c
b/drivers/staging/usbip/vhci_hcd.c
index f690668..1e84577 100644
--- a/drivers/staging/usbip/vhci_hcd.c
+++ b/drivers/staging/usbip/vhci_hcd.c

[...]

@@ -1060,7 +1069,9 @@ static int vhci_hcd_suspend(struct platform_device
*pdev, pm_message_t state)
  spin_unlock(the_controller-lock);

  if (connected  0) {
-dev_info(pdev-dev, We have %d active connection%s. Do not
suspend.\n, connected, (connected == 1 ?  : s));
+dev_info(pdev-dev,
+ We have %d active connection%s. Do not suspend.\n,
+ connected, (connected == 1 ?  : s));
  ret =  -EBUSY;
  } else {
  dev_info(pdev-dev, suspend vhci_hcd);



Hm, I don't see checkpatch.pl complaints about these either in the
'usb-next' branch of Greg's tree.


   In fact, it does complain but says:

WARNING: quoted string split across lines

So, it looks like your patch is against the wrong tree.

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] coding style: fix line over 80 characters

2014-03-20 Thread Sergei Shtylyov

On 03/20/2014 11:45 PM, Joe Perches wrote:


diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c

[]

@@ -271,12 +271,14 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 
typeReq, u16 wValue,
}
break;
case USB_PORT_FEAT_POWER:
-   usbip_dbg_vhci_rh( ClearPortFeature: 
USB_PORT_FEAT_POWER\n);
+   usbip_dbg_vhci_rh(
+ClearPortFeature: USB_PORT_FEAT_POWER\n);



 Your version of scripts/checkpatch.pl seems outdated. It shouldn't
complain about strings violating 80-column limit (and I've just verified it
doesn't).



checkpatch complains about  80 char lines for lines with
a function where the function name isn't understood to be
a logging use.



uspip_dbg_foo doesn't take the general form so if the
string at the EOL exceeds 80 chars, a message is emitted.



Long standalone strings on a single line do not get warnings.


   OK, but there's still issue that the patch context doesn't correspond to 
what can be seen in Greg's tree. What I am seeing there is broken up string.


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] coding style: fix line over 80 characters

2014-03-20 Thread Sergei Shtylyov

On 03/21/2014 12:34 AM, Sergei Shtylyov wrote:


Signed-off-by: Cédric Cabessa c...@ryick.net
---
  drivers/staging/usbip/vhci_hcd.c | 33 ++---
  1 file changed, 22 insertions(+), 11 deletions(-)



diff --git a/drivers/staging/usbip/vhci_hcd.c
b/drivers/staging/usbip/vhci_hcd.c
index f690668..1e84577 100644
--- a/drivers/staging/usbip/vhci_hcd.c
+++ b/drivers/staging/usbip/vhci_hcd.c

[...]

@@ -539,7 +546,9 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct
urb *urb,

  default:
  /* NOT REACHED */
-dev_err(dev, invalid request to devnum 0 bRequest %u, wValue
%u\n, ctrlreq-bRequest,
+dev_err(dev,
+invalid request to devnum 0 bRequest %u, wValue %u\n,
+ctrlreq-bRequest,
  ctrlreq-wValue);
  ret =  -EINVAL;
  goto no_need_xmit;
@@ -1060,7 +1069,9 @@ static int vhci_hcd_suspend(struct platform_device
*pdev, pm_message_t state)
  spin_unlock(the_controller-lock);

  if (connected  0) {
-dev_info(pdev-dev, We have %d active connection%s. Do not
suspend.\n, connected, (connected == 1 ?  : s));
+dev_info(pdev-dev,
+ We have %d active connection%s. Do not suspend.\n,
+ connected, (connected == 1 ?  : s));
  ret =  -EBUSY;
  } else {
  dev_info(pdev-dev, suspend vhci_hcd);



Hm, I don't see checkpatch.pl complaints about these either in the
'usb-next' branch of Greg's tree.


   Sorry, I forgot about Greg's separate staging.git repo. The patch looks 
correct in this context.


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] bonding: Inactive slaves should keep inactive flag's value to 1.

2014-03-21 Thread Sergei Shtylyov

Hello.

On 03/20/2014 11:51 AM, Zheng Li wrote:


Except bond mode 1, in other bond modes, inactive slaves should keep inactive 
flag to
1 to refuse to receive broadcast packets. Now, active slave send broadcast 
packets
(for example ARP requests) which will arrive inactive slaves on same host from 
switch,
but inactive slave's inactive flag is zero that cause bridge receive the 
broadcast
packets to produce a wrong entry in forward table. Typical situation is domu 
send some
ARP request which go out from dom0 bond's active slave, then the ARP broadcast 
request
packets go back to inactive slave from switch, because the inactive slave's 
inactive
flag is zero, kernel will receive the packets and pass them to bridge, that 
cause dom0's
bridge map domu's MAC address to port of bond, bridge should map domu's MAC to 
port of vif.



Signed-off-by: Zheng Li zheng.x...@oracle.com
---
  drivers/net/bonding/bond_main.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)



diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index e5628fc..2f73f18 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3063,7 +3063,7 @@ static int bond_open(struct net_device *bond_dev)
bond_set_slave_inactive_flags(slave,
  
BOND_SLAVE_NOTIFY_NOW);
} else {
-   bond_set_slave_active_flags(slave,
+   bond_set_slave_state(slave, BOND_STATE_ACTIVE,

BOND_SLAVE_NOTIFY_NOW);


   Now you have to re-indent this line to start right under 'state'.

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mips: export icache_flush_range

2014-03-22 Thread Sergei Shtylyov

Hello.

On 03/22/2014 06:47 PM, Kees Cook wrote:


The lkdtm module performs tests against executable memory ranges, so
it needs to flush the icache for proper behaviors. Other architectures
already export this, so do the same for MIPS.



Signed-off-by: Kees Cook keesc...@chromium.org
---
This is currently untested! I'm building a MIPS cross-compiler now...
If someone can validate this fixes the build when lkdtm is a module,
that would be appreciated. :)
---
  arch/mips/mm/cache.c |1 +
  1 file changed, 1 insertion(+)



diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
index fde7e56d13fe..b3f1df13d9f6 100644
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
@@ -38,6 +38,7 @@ void (*__flush_kernel_vmap_range)(unsigned long vaddr, int 
size);
  void (*__invalidate_kernel_vmap_range)(unsigned long vaddr, int size);

  EXPORT_SYMBOL_GPL(__flush_kernel_vmap_range);
+EXPORT_SYMBOL_GPL(flush_icache_range);


   Have you run this thru scripts/checkpatch.pl? It would have told you that 
an export should immediately follow the corresponding function body, AFAIK.


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mips: export icache_flush_range

2014-03-22 Thread Sergei Shtylyov

On 03/23/2014 12:45 AM, Sergei Shtylyov wrote:


The lkdtm module performs tests against executable memory ranges, so
it needs to flush the icache for proper behaviors. Other architectures
already export this, so do the same for MIPS.



Signed-off-by: Kees Cook keesc...@chromium.org
---
This is currently untested! I'm building a MIPS cross-compiler now...
If someone can validate this fixes the build when lkdtm is a module,
that would be appreciated. :)
---
  arch/mips/mm/cache.c |1 +
  1 file changed, 1 insertion(+)



diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
index fde7e56d13fe..b3f1df13d9f6 100644
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
@@ -38,6 +38,7 @@ void (*__flush_kernel_vmap_range)(unsigned long vaddr, int
size);
  void (*__invalidate_kernel_vmap_range)(unsigned long vaddr, int size);

  EXPORT_SYMBOL_GPL(__flush_kernel_vmap_range);
+EXPORT_SYMBOL_GPL(flush_icache_range);



Have you run this thru scripts/checkpatch.pl? It would have told you that
an export should immediately follow the corresponding function body, AFAIK.


   Hm, it doesn't now but definitely used to...

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mips: export icache_flush_range

2014-03-22 Thread Sergei Shtylyov

On 03/23/2014 12:48 AM, Sergei Shtylyov wrote:


The lkdtm module performs tests against executable memory ranges, so
it needs to flush the icache for proper behaviors. Other architectures
already export this, so do the same for MIPS.



Signed-off-by: Kees Cook keesc...@chromium.org
---
This is currently untested! I'm building a MIPS cross-compiler now...
If someone can validate this fixes the build when lkdtm is a module,
that would be appreciated. :)
---
  arch/mips/mm/cache.c |1 +
  1 file changed, 1 insertion(+)



diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
index fde7e56d13fe..b3f1df13d9f6 100644
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
@@ -38,6 +38,7 @@ void (*__flush_kernel_vmap_range)(unsigned long vaddr, int
size);
  void (*__invalidate_kernel_vmap_range)(unsigned long vaddr, int size);

  EXPORT_SYMBOL_GPL(__flush_kernel_vmap_range);
+EXPORT_SYMBOL_GPL(flush_icache_range);



Have you run this thru scripts/checkpatch.pl? It would have told you that
an export should immediately follow the corresponding function body, AFAIK.



Hm, it doesn't now but definitely used to...


   Decided to check Documentation/CodingStyle, and it still codifies this:

In source files, separate functions with one blank line.  If the function is
exported, the EXPORT* macro for it should follow immediately after the closing
function brace line.  E.g.:

int system_is_up(void)
{
return system_state == SYSTEM_RUNNING;
}
EXPORT_SYMBOL(system_is_up);

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mips: export icache_flush_range

2014-03-22 Thread Sergei Shtylyov

On 03/23/2014 12:05 AM, Kees Cook wrote:


The lkdtm module performs tests against executable memory ranges, so
it needs to flush the icache for proper behaviors. Other architectures
already export this, so do the same for MIPS.



Signed-off-by: Kees Cook keesc...@chromium.org
---
This is currently untested! I'm building a MIPS cross-compiler now...
If someone can validate this fixes the build when lkdtm is a module,
that would be appreciated. :)
---
   arch/mips/mm/cache.c |1 +
   1 file changed, 1 insertion(+)



diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
index fde7e56d13fe..b3f1df13d9f6 100644
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
@@ -38,6 +38,7 @@ void (*__flush_kernel_vmap_range)(unsigned long vaddr,
int
size);
   void (*__invalidate_kernel_vmap_range)(unsigned long vaddr, int size);

   EXPORT_SYMBOL_GPL(__flush_kernel_vmap_range);
+EXPORT_SYMBOL_GPL(flush_icache_range);



 Have you run this thru scripts/checkpatch.pl? It would have told you
that
an export should immediately follow the corresponding function body,
AFAIK.



 Hm, it doesn't now but definitely used to...



Decided to check Documentation/CodingStyle, and it still codifies this:



In source files, separate functions with one blank line.  If the function is
exported, the EXPORT* macro for it should follow immediately after the
closing
function brace line.  E.g.:



int system_is_up(void)
{
 return system_state == SYSTEM_RUNNING;
}
EXPORT_SYMBOL(system_is_up);



Yup, thanks. I know the style, but it seemed from the source file that
the style was to declare the function pointers in bulk, and then
explicitly export them in the next section, so I continued that style.
For example:



void (*flush_cache_sigtramp)(unsigned long addr);
void (*local_flush_data_cache_page)(void * addr);
void (*flush_data_cache_page)(unsigned long addr);
void (*flush_icache_all)(void);



EXPORT_SYMBOL_GPL(local_flush_data_cache_page);
EXPORT_SYMBOL(flush_data_cache_page);
EXPORT_SYMBOL(flush_icache_all);



Regardless, I'm happy to stick it in the middle of the function
pointers if that's preferred.


   Ah, that's a variable! I didn't realize that. Looking into checkpatch.pl, 
it should warn about variables as well though... but it doesn't.



-Kees


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT PULL] libata maintainership update

2013-05-07 Thread Sergei Shtylyov

Hello.

On 07-05-2013 21:19, Tejun Heo wrote:


As discussed earlier, Jeff is leaving for something more fun and I'm
inheriting the maintainership of libata.  Please pull from the
following branch to receive MAINTAINERS update.



   git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git for-3.10



I'll manage it similarly to other trees I'm maintaining.  When X-rc1
drops, for-X-fixes and for-X+1 are created on top of it and for-next
will be pulling in both branches.



Thanks!



--
tejun




Tejun Heo (1):
   libata: change maintainer



  MAINTAINERS | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/MAINTAINERS b/MAINTAINERS
index e1f5fac..c5ed056 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7140,7 +7140,7 @@ F:drivers/misc/phantom.c
  F:include/uapi/linux/phantom.h

  SERIAL ATA (SATA) SUBSYSTEM
-M: Jeff Garzik jgar...@pobox.com
+M: Tejun Heo t...@kernel.org
  L:linux-...@vger.kernel.org
  T:git git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git


   I think you've forgotten to update the git tree to yours.

MBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] net: of_mdio: fix behavior on missing phy device

2013-05-07 Thread Sergei Shtylyov

Hello.

On 07-05-2013 13:49, Sebastian Hesselbarth wrote:


of_mdiobus_register creates a phy_device even if get_phy_device failed
to create it previously. This causes indefinite polling on non-existent
PHYs. This fix makes of_mdio_register rely on get_phy_device to
properly create the device or fail otherwise.



Signed-off-by: Sebastian Hesselbarth sebastian.hesselba...@gmail.com
---
Cc: Grant Likely grant.lik...@linaro.org
Cc: Rob Herring rob.herr...@calxeda.com
Cc: David Miller da...@davemloft.net
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-kernel@vger.kernel.org
Cc: net...@vger.kernel.org
---
  drivers/of/of_mdio.c |   11 ---
  1 file changed, 4 insertions(+), 7 deletions(-)



diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index 23049ae..d5a57a9 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -84,13 +84,10 @@ int of_mdiobus_register(struct mii_bus *mdio, struct 
device_node *np)
phy = get_phy_device(mdio, addr, is_c45);



   This empty line is not needed -- would be good to drop it, while at 
this.



if (!phy || IS_ERR(phy)) {
-   phy = phy_device_create(mdio, addr, 0, false, NULL);
-   if (!phy || IS_ERR(phy)) {
-   dev_err(mdio-dev,
-   error creating PHY at address %i\n,
-   addr);
-   continue;
-   }
+   dev_err(mdio-dev,
+   cannot get PHY at address %i\n,
+   addr);
+   continue;
}

/* Associate the OF node with the device structure so it



--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: net: phy: realtek: add rtl8201f driver

2013-05-08 Thread Sergei Shtylyov

Hello.

On 08-05-2013 14:10, Jongsung Kim wrote:


This patch adds the minimal driver to manage the
Realtek RTL8201F 10/100Mbps Transceivers.



Signed-off-by: Jongsung Kim neidhard@lge.com
---
  drivers/net/phy/realtek.c |   60 +++-
  1 files changed, 53 insertions(+), 7 deletions(-)



diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
index 8e7af83..27847ca 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -16,9 +16,13 @@
  #include linux/phy.h
  #include linux/module.h

-#define RTL821x_PHYSR  0x11
-#define RTL821x_PHYSR_DUPLEX   0x2000
-#define RTL821x_PHYSR_SPEED0xc000


Removal of unused #define's is a matter of a separate cleanup patch...


+/* page 0 register 30 - interrupt indicators and SNR display register */
+#define RTL8201F_ISR   0x1e
+/* page 0 register 31 - page select register */
+#define RTL8201F_PSR   0x1f
+/* page 7 register 19 - interrupt, WOL enable, and LEDs function register */
+#define RTL8201F_IER   0x13
+
  #define RTL821x_INER  0x12
  #define RTL821x_INER_INIT 0x6400
  #define RTL821x_INSR  0x13
@@ -29,6 +33,15 @@ MODULE_DESCRIPTION(Realtek PHY driver);
  MODULE_AUTHOR(Johnson Leung);
  MODULE_LICENSE(GPL);

+static int rtl8201f_ack_interrupt(struct phy_device *phydev)
+{
+   int err;
+
+   err = phy_read(phydev, RTL8201F_ISR);


   This could be an initializer and so make the function shorter.


+
+   return (err  0) ? err : 0;
+}
+
  static int rtl821x_ack_interrupt(struct phy_device *phydev)
  {
int err;

[...]

@@ -96,16 +141,16 @@ static struct phy_driver rtl8211e_driver = {

  static int __init realtek_init(void)
  {
-   int ret;
-
-   ret = phy_driver_register(rtl8211b_driver);
-   if (ret  0)
+   if(phy_driver_register(rtl8201f_driver)  0)
+   return -ENODEV;
+   if(phy_driver_register(rtl8211b_driver)  0)


You haven't run this patch thru scripts/checkpatch.pl -- there 
should be a space between *if* and (.


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v5, part4 20/41] mm/h8300: prepare for removing num_physpages and simplify mem_init()

2013-05-08 Thread Sergei Shtylyov

Hello.

On 08-05-2013 19:51, Jiang Liu wrote:


Prepare for removing num_physpages and simplify mem_init().



Signed-off-by: Jiang Liu jiang@huawei.com
Cc: Yoshinori Sato ys...@users.sourceforge.jp
Cc: Geert Uytterhoeven ge...@linux-m68k.org
Cc: linux-kernel@vger.kernel.org
---
  arch/h8300/mm/init.c |   34 --
  1 file changed, 8 insertions(+), 26 deletions(-)



diff --git a/arch/h8300/mm/init.c b/arch/h8300/mm/init.c
index 22fd869..0088f3a 100644
--- a/arch/h8300/mm/init.c
+++ b/arch/h8300/mm/init.c
@@ -121,40 +121,22 @@ void __init paging_init(void)

  void __init mem_init(void)
  {
-   int codek = 0, datak = 0, initk = 0;
-   /* DAVIDM look at setup memory map generically with reserved area */
-   unsigned long tmp;
-   extern unsigned long  _ramend, _ramstart;
-   unsigned long len = _ramend - _ramstart;
-   unsigned long start_mem = memory_start; /* DAVIDM - these must start at 
end of kernel */
-   unsigned long end_mem   = memory_end; /* DAVIDM - this must not include 
kernel stack at top */
+   unsigned long codesize = _etext - _stext;

  #ifdef DEBUG
-   printk(KERN_DEBUG Mem_init: start=%lx, end=%lx\n, start_mem, end_mem);
+   pr_debug(Mem_init: start=%lx, end=%lx\n, memory_start, memory_end);
  #endif


pr_debug() only prints something if DEBUG is #define'd, so you can 
drop the #ifdef here.


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v5, part4 20/41] mm/h8300: prepare for removing num_physpages and simplify mem_init()

2013-05-08 Thread Sergei Shtylyov

Hello.

On 05/08/2013 08:26 PM, Sergei Shtylyov wrote:




Prepare for removing num_physpages and simplify mem_init().



Signed-off-by: Jiang Liu jiang@huawei.com
Cc: Yoshinori Sato ys...@users.sourceforge.jp
Cc: Geert Uytterhoeven ge...@linux-m68k.org
Cc: linux-kernel@vger.kernel.org
---
  arch/h8300/mm/init.c |   34 --
  1 file changed, 8 insertions(+), 26 deletions(-)



diff --git a/arch/h8300/mm/init.c b/arch/h8300/mm/init.c
index 22fd869..0088f3a 100644
--- a/arch/h8300/mm/init.c
+++ b/arch/h8300/mm/init.c
@@ -121,40 +121,22 @@ void __init paging_init(void)

  void __init mem_init(void)
  {
-int codek = 0, datak = 0, initk = 0;
-/* DAVIDM look at setup memory map generically with reserved 
area */

-unsigned long tmp;
-extern unsigned long  _ramend, _ramstart;
-unsigned long len = _ramend - _ramstart;
-unsigned long start_mem = memory_start; /* DAVIDM - these must 
start at end of kernel */
-unsigned long end_mem   = memory_end; /* DAVIDM - this must not 
include kernel stack at top */

+unsigned long codesize = _etext - _stext;

  #ifdef DEBUG
-printk(KERN_DEBUG Mem_init: start=%lx, end=%lx\n, start_mem, 
end_mem);
+pr_debug(Mem_init: start=%lx, end=%lx\n, memory_start, 
memory_end);

  #endif


pr_debug() only prints something if DEBUG is #define'd, so you can 
drop the #ifdef here.


Although, not necessarily: it also supports CONFIG_DYNAMIC_DEBUG -- 
look at how pr_debug() is defined.
So this doesn't seem to be an equivalent change, and I suggest not doing 
it at all.


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: net: phy: realtek: add rtl8201f driver

2013-05-09 Thread Sergei Shtylyov

Hello.

On 09-05-2013 6:35, Jongsung Kim wrote:


 Removal of unused #define's is a matter of a separate cleanup patch...



Sorry. I won't touch them.



+static int rtl8201f_ack_interrupt(struct phy_device *phydev) {
+   int err;
+
+   err = phy_read(phydev, RTL8201F_ISR);



This could be an initializer and so make the function shorter.



Agreed. I just thought it's better to make it similar to the
rtl821x_ack_interrupt.


   Ah, then you may leave this code as is.


Then, may I make shorter the rtl821x_ack_interrupt as
well as rtl8201f_ack_interrupt?


   In a separate patch, if you wish.

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] USB: serial/ftdi_sio.c Fix kernel oops

2013-06-07 Thread Sergei Shtylyov

Hello.

On 06/07/2013 05:14 PM, Lotfi Manseur wrote:


Handle null termios in ftdi_set_termios(), introduced in
commit 552f6bf1bb0eda0011c0525dd587aa9e7ba5b846
This has been corrected in the mainline by
commits c515598e0f5769916c31c00392cc2bfe6af74e55 and
a816e3113b63753c330ca4751ea1d208e93e3015.


   You should also give the summary lines of all mentioned commits in 
parens.



This is to be fixed in longterm 2.6.32.60 and 3.4.47.
This bug has been found with coccinelle.

Signed-off-by: Lotfi Manseur lotfi.mans...@imag.fr
Signed-off-by: Nicolas Palix nicolas.pa...@imag.fr


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] USB: cdc-acm: remove unneeded spin_lock_irqsave/restore on write path

2013-06-07 Thread Sergei Shtylyov

Hello.

On 06/07/2013 10:32 PM, Greg Kroah-Hartman wrote:


From: Greg Kroah-Hartman gre...@linuxfoundation.org

When writing data we were:
lock
do some work
unlock
call function
lock
do some work
unlock
return
return

It turns out, that function was only ever called in the one place, so
instead of locking/unlocking for no good reason, just inline the
function and only grab the lock once.

This has sped up the pathological case of sending 1 byte packets to a
loop-back cdc-acm device from 49600 bytes per second to 50100 bytes a
second on my workstation.  A tiny increase yes, but noticable, and now
the spinlock isn't the hottest thing on the perf graph anymore.  Yes, we
are still waiting for the hardware for the most part, but getting rid of
a spin_lock_irqsave() call for every packet is still a good thing.

And we end up deleting lines of code, always a win overall.

This was found by using a Teensy 3.0 device and the test program and
firmware located at:
http://www.pjrc.com/teensy/benchmark_usb_serial_receive.html

Reported-by: Paul Stoffregen p...@pjrc.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
  drivers/usb/class/cdc-acm.c |   51 
+++-
  1 file changed, 18 insertions(+), 33 deletions(-)

--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c

[...]

@@ -653,13 +621,30 @@ static int acm_tty_write(struct tty_stru
}
wb = acm-wb[wbn];
  
+	if (!acm-dev) {

+   wb-use = 0;
+   spin_unlock_irqrestore(acm-write_lock, flags);
+   return -ENODEV;
+   }
+
count = (count  acm-writesize) ? acm-writesize : count;
dev_vdbg(acm-data-dev, %s - write %d\n, __func__, count);
memcpy(wb-buf, buf, count);
wb-len = count;
spin_unlock_irqrestore(acm-write_lock, flags);
  
-	stat = acm_write_start(acm, wbn);

+   usb_autopm_get_interface_async(acm-control);
+   if (acm-susp_count) {
+   if (!acm-delayed_wb)
+   acm-delayed_wb = wb;
+   else
+   usb_autopm_put_interface_async(acm-control);
+   spin_unlock_irqrestore(acm-write_lock, flags);


   But you've already dropped it above the *if* and not taken again?


+   return count;   /* A white lie */
+   }
+   usb_mark_last_busy(acm-dev);
+
+   stat = acm_start_wb(acm, wb);
if (stat  0)
return stat;
return count;



WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 20/31] mips/kvm: Hook into TLB fault handlers.

2013-06-07 Thread Sergei Shtylyov

Hello.

On 06/08/2013 03:03 AM, David Daney wrote:


From: David Daney david.da...@cavium.com

If the CPU is operating in guest mode when a TLB related excpetion
occurs, give KVM a chance to do emulation.

Signed-off-by: David Daney david.da...@cavium.com
---
  arch/mips/mm/fault.c   | 8 
  arch/mips/mm/tlbex-fault.S | 6 ++
  2 files changed, 14 insertions(+)

diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c
index 0fead53..9391da49 100644
--- a/arch/mips/mm/fault.c
+++ b/arch/mips/mm/fault.c

[...]

@@ -50,6 +51,13 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs 
*regs, unsigned long writ
   field, regs-cp0_epc);
  #endif
  
+#ifdef CONFIG_KVM_MIPSVZ

+   if (test_tsk_thread_flag(current, TIF_GUESTMODE)) {
+   if (mipsvz_page_fault(regs, write, address))


   Any reason not to collapse these into single *if*?


+   return;
+   }
+#endif
+



--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 14/15] usb: phy: rcar-usb: Fix comment w.r.t. devm_ioremap_resource

2013-06-10 Thread Sergei Shtylyov

Hello.

On 10-06-2013 15:35, Tushar Behera wrote:


Commit 75096579c3ac (lib: devres: Introduce devm_ioremap_resource())
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().



Signed-off-by: Tushar Behera tushar.beh...@linaro.org
CC: linux-...@vger.kernel.org
CC: Felipe Balbi ba...@ti.com
---
  drivers/usb/phy/phy-rcar-usb.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/drivers/usb/phy/phy-rcar-usb.c b/drivers/usb/phy/phy-rcar-usb.c
index a35681b..23c3dd3 100644
--- a/drivers/usb/phy/phy-rcar-usb.c
+++ b/drivers/usb/phy/phy-rcar-usb.c
@@ -161,7 +161,7 @@ static int rcar_usb_phy_probe(struct platform_device *pdev)
 * CAUTION
 *
 * Because this phy address is also mapped under OHCI/EHCI address area,
-* this driver can't use devm_request_and_ioremap(dev, res) here
+* this driver can't use devm_ioremap_resource(dev, res) here
 */
reg0 = devm_ioremap_nocache(dev, res0-start, resource_size(res0));
reg1 = devm_ioremap_nocache(dev, res1-start, resource_size(res1));


I'm completely removing this comment in my series pushed thru 
renesas.git, so I advise this patch to be ignored not to create conflict 
in the future.


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 01/11] ARM: davinci: GPIO: Add platform data structure

2013-06-11 Thread Sergei Shtylyov

Hello.

On 11-06-2013 14:36, Sekhar Nori wrote:


From: KV Sujith sujit...@ti.com



Add struct davinci_gpio_platform_data davinci gpio module.



Signed-off-by: KV Sujith sujit...@ti.com
Signed-off-by: Philip Avinash avinashphi...@ti.com



As Linus commented before, this should be merged with 03/11.



---
  include/linux/platform_data/gpio-davinci.h |   27 +++
  1 file changed, 27 insertions(+)
  create mode 100644 include/linux/platform_data/gpio-davinci.h



diff --git a/include/linux/platform_data/gpio-davinci.h 
b/include/linux/platform_data/gpio-davinci.h
new file mode 100644
index 000..f1c8277
--- /dev/null
+++ b/include/linux/platform_data/gpio-davinci.h
@@ -0,0 +1,27 @@
+/*
+ * gpio-davinci.h


I would drop this unnecessary filename mention as well.


+ *
+ * DaVinci GPIO Platform Related Defines
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ASM_ARCH_DAVINCI_GPIO_H
+#define __ASM_ARCH_DAVINCI_GPIO_H



This should now be __PLATFORM_DATA_DAVINCI_GPIO_H__ or some such since
the file as been moved out of arch specific folder.


   I think __GPIO_DAVINCI_H would be enough...


Thanks,
Sekhar


WBR, Sergei


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers/net/ethernet/3com: Drop EISA dependency from VORTEX

2013-06-11 Thread Sergei Shtylyov

Hello.

On 11-06-2013 18:57, Markos Chandras wrote:


The Vortex driver depends on PCI with optional support for EISA.



This fixes build problems when EISA is selected but not PCI.



drivers/net/ethernet/3com/3c59x.c:1031:2: error: implicit declaration of
function 'pci_iomap' [-Werror=implicit-function-declaration]
drivers/net/ethernet/3com/3c59x.c:1044:3: error: implicit declaration of
function 'pci_iounmap' [-Werror=implicit-function-declaration]



Cc: David S. Miller da...@davemloft.net
Cc: Paul Gortmaker paul.gortma...@windriver.com
Cc: net...@vger.kernel.org
Signed-off-by: Markos Chandras markos.chand...@imgtec.com


   The proper way to address this is probably add empty *static inline* 
function implementations for CONFIG_PCI=n case to the header file, same 
as was done with pci_{request|release}_regions() for this same file 
several years ago...


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 2/7] usb: phy: dsps: adding usbphy driver for am33xx platform

2013-06-11 Thread Sergei Shtylyov

Hello.

On 06/11/2013 01:45 PM, B, Ravi wrote:


+
+   res = platform_get_resource_byname(pdev, IORESOURCE_MEM, phy_wkup);
+   phy-phy_wkup = ioremap(res-start, resource_size(res));



devm_ioremap?



The phy_wakeup register is common across two instances of phy, 
devm_ioremap_resource() will fail to map for twice for same register space.


I've already told you the register can't be shared between devices 
like this. BTW, you haven't replied to my request concerning your 
/proc/iomem contents...


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers/net/ethernet/3com: Drop EISA dependency from VORTEX

2013-06-11 Thread Sergei Shtylyov

Hello.

On 06/12/2013 12:16 AM, Paul Gortmaker wrote:


The Vortex driver depends on PCI with optional support for EISA.



This fixes build problems when EISA is selected but not PCI.



drivers/net/ethernet/3com/3c59x.c:1031:2: error: implicit declaration of
function 'pci_iomap' [-Werror=implicit-function-declaration]
drivers/net/ethernet/3com/3c59x.c:1044:3: error: implicit declaration of
function 'pci_iounmap' [-Werror=implicit-function-declaration]



Cc: David S. Miller da...@davemloft.net
Cc: Paul Gortmaker paul.gortma...@windriver.com
Cc: net...@vger.kernel.org
Signed-off-by: Markos Chandras markos.chand...@imgtec.com
---
  drivers/net/ethernet/3com/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/drivers/net/ethernet/3com/Kconfig 
b/drivers/net/ethernet/3com/Kconfig
index 1c71c76..5c67f44 100644
--- a/drivers/net/ethernet/3com/Kconfig
+++ b/drivers/net/ethernet/3com/Kconfig
@@ -66,7 +66,7 @@ config PCMCIA_3C589

  config VORTEX
   tristate 3c590/3c900 series (592/595/597) \Vortex/Boomerang\ support
- depends on (PCI || EISA)  HAS_IOPORT
+ depends on PCI  HAS_IOPORT



How can this fix it?  The way I read your change is that you
have now made it impossible to select for EISA=y and PCI=n,
thus breaking EISA only configurations who would find their
driver support gone when they run make oldconfig.


[...]


Hi Paul,



The driver does not seem to build if you only have EISA=y and PCI=n.
Does this driver really support EISA only



Yes.  Not that anyone really probably cares anymore.  EISA is dead.


   We have the user of 3Com EISA cards on this list and I've fixed EISA
specific bug in this driver not long ago.

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net] macvlan: don't touch promisc without passthrough

2013-06-12 Thread Sergei Shtylyov

Hello.

On 12-06-2013 15:34, Michael S. Tsirkin wrote:


commit df8ef8f3aaa6692970a436204c4429210addb23a in linux 3.5 added a way


   Please also specify that commit's summary line in parens.


to control NOPROMISC macvlan flag through netlink.



However, with a non passthrough device we don't set promisc on open or
clear it on stop, even if NOPROMISC is off.  As a result:



If userspace clears NOPROMISC on open, then does not clear it on a
netlink command, promisc counter is not decremented on stop and there
will be no way to clear it once macvlan is detached.



If userspace does not clear NOPROMISC on open, then sets NOPROMISC on a
netlink command, promisc counter will be decremented from 0 and overflow
to f with no way to clear promisc afterwards.



To fix, simply ignore NOPROMISC flag in a netlink command for
non-passthrough devices, same as we do at open/stop.



While at it - since we touch this code anyway - check
dev_set_promiscuity return code and pass it to users (though an error
here is unlikely).



Cc: David S. Miller da...@davemloft.net
CC: Roopa Prabhu ropra...@cisco.com
Cc: John Fastabend john.r.fastab...@intel.com
Signed-off-by: Michael S. Tsirkin m...@redhat.com
---



Please review, and consider for 3.10 and -stable.



  drivers/net/macvlan.c | 19 ---
  1 file changed, 12 insertions(+), 7 deletions(-)



diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 1c502bb..8812402 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -853,18 +853,23 @@ static int macvlan_changelink(struct net_device *dev,
struct nlattr *tb[], struct nlattr *data[])
  {
struct macvlan_dev *vlan = netdev_priv(dev);
-   if (data  data[IFLA_MACVLAN_MODE])
-   vlan-mode = nla_get_u32(data[IFLA_MACVLAN_MODE]);
+
if (data  data[IFLA_MACVLAN_FLAGS]) {
__u16 flags = nla_get_u16(data[IFLA_MACVLAN_FLAGS]);
bool promisc = (flags ^ vlan-flags)  MACVLAN_FLAG_NOPROMISC;
-
-   if (promisc  (flags  MACVLAN_FLAG_NOPROMISC))
-   dev_set_promiscuity(vlan-lowerdev, -1);
-   else if (promisc  !(flags  MACVLAN_FLAG_NOPROMISC))
-   dev_set_promiscuity(vlan-lowerdev, 1);
+   if (vlan-port-passthru  promisc) {
+   int err;


   Emoty line, like you did abobe, wouldn't hurt here, after declaration.


+   if (flags  MACVLAN_FLAG_NOPROMISC)
+   err = dev_set_promiscuity(vlan-lowerdev, -1);
+   else
+   err = dev_set_promiscuity(vlan-lowerdev, 1);
+   if (err  0)
+   return err;
+   }


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 03/31] mips/kvm: Fix 32-bitisms in kvm_locore.S

2013-06-14 Thread Sergei Shtylyov

Hello.

On 14-06-2013 17:09, Ralf Baechle wrote:


diff --git a/arch/mips/kvm/kvm_locore.S b/arch/mips/kvm/kvm_locore.S
index dca2aa6..e86fa2a 100644
--- a/arch/mips/kvm/kvm_locore.S
+++ b/arch/mips/kvm/kvm_locore.S
@@ -310,7 +310,7 @@ NESTED (MIPSX(GuestException), CALLFRAME_SIZ, ra)
  LONG_S  t0, VCPU_R26(k1)

  /* Get GUEST k1 and save it in VCPU */
-la  t1, ~0x2ff
+   PTR_LI  t1, ~0x2ff
  mfc0t0, CP0_EBASE
  and t0, t0, t1
  LONG_L  t0, 0x3000(t0)
@@ -384,14 +384,14 @@ NESTED (MIPSX(GuestException), CALLFRAME_SIZ, ra)
  mtc0k0, CP0_DDATA_LO

  /* Restore RDHWR access */
-la  k0, 0x200F
+   PTR_LI  k0, 0x200F
  mtc0k0,  CP0_HWRENA

  /* Jump to handler */
  FEXPORT(__kvm_mips_jump_to_handler)
  /* XXXKYMA: not sure if this is safe, how large is the stack?? */
  /* Now jump to the kvm_mips_handle_exit() to see if we can deal with this 
in the kernel */
-la  t9,kvm_mips_handle_exit
+   PTR_LA  t9, kvm_mips_handle_exit
  jalr.hb t9
  addiu   sp,sp, -CALLFRAME_SIZ   /* BD Slot */

@@ -566,7 +566,7 @@ __kvm_mips_return_to_host:
  mtlok0

  /* Restore RDHWR access */
-la  k0, 0x200F
+   PTR_LI  k0, 0x200F
  mtc0k0,  CP0_HWRENA



Technically ok, there's only a formatting issue because you indent the
changed lines with tabs while the existing file uses tab characters.


   I hope you meant the space characters? :-)


I suggest you insert an extra cleanup patch to properly re-indent the
entire file into the series before this one?



So with that sorted:



Acked-by: Ralf Baechle r...@linux-mips.org



   Ralf


WBR, Sergei


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: manual merge of the arm-soc tree with the net-next tree

2013-06-17 Thread Sergei Shtylyov

Hello.

On 17-06-2013 10:39, Stephen Rothwell wrote:


Today's linux-next merge of the arm-soc tree got a conflict in
arch/arm/mach-shmobile/clock-r8a7740.c between commit e5c9b4cd6651
(sh_eth: get R8A7740 support out of #ifdef) from the net-next tree and
commit 9e0b428f079d (ARM: shmobile: r8a7740: Add interim sh-eth device
name to clocks list) from the arm-soc tree.


   To me that latter commit looked utterly pointless, as there's no 
device tree support for the 'sh-eth' driver yet (and at this stage it 
isn't even going to happen due to procedural platform data). I'm instead 
going to use OF_DEV_AUXDATA() in the platform code which again would 
render that commit pointless.



I fixed it up (see below) and can carry the fix as necessary (no action
is required).


   Thanks.

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] AHCI: Make distinct names for ports in /proc/interrupts

2013-04-29 Thread Sergei Shtylyov

Hello.

On 29-04-2013 14:12, Alexander Gordeev wrote:


Currently all interrupts assigned to AHCI ports show up in
'/proc/interrupts' as 'ahci'. This fix adds port numbers as
suffixes and hence makes the descriptions distinct.



Reported-by: Jan Beulich jbeul...@suse.com
Signed-off-by: Alexander Gordeev agord...@redhat.com
---
  drivers/ata/ahci.c |6 --
  drivers/ata/ahci.h |1 +
  2 files changed, 5 insertions(+), 2 deletions(-)



diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 3b9a7b1..dc5c1aa 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1146,10 +1146,12 @@ int ahci_host_activate(struct ata_host *host, int irq, 
unsigned int n_msis,
return -EINVAL;

for (i = 0; i  n_irqs; i++) {
+   struct ahci_port_priv *pp = 
host-ports[i]-private_data;


   Empty line wouldn't hurt here, after declaration.


+   snprintf(pp-irq_desc, sizeof(pp-irq_desc),
+%s%d, dev_driver_string(host-dev), i);
rc = devm_request_threaded_irq(host-dev, irq + i,
ahci_multi_irqs_intr, ahci_port_thread_fn,
-   IRQF_SHARED, dev_driver_string(host-dev),
-   host-ports[i]);
+   IRQF_SHARED, pp-irq_desc, host-ports[i]);
if (rc)
goto out_free_irqs;
}


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: mtd: nand: davinci: use devm_ioremap_resource()

2013-05-02 Thread Sergei Shtylyov

Hello.

On 02-05-2013 17:22, Laurent Navet wrote:


Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.



Found with coccicheck and this semantic patch:
  scripts/coccinelle/api/devm_request_and_ioremap.cocci.



Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
  drivers/mtd/nand/davinci_nand.c |   13 -
  1 file changed, 8 insertions(+), 5 deletions(-)



diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index 94e17af..4a96e58 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -623,11 +623,14 @@ static int __init nand_davinci_probe(struct 
platform_device *pdev)
goto err_nomem;
}

-   vaddr = devm_request_and_ioremap(pdev-dev, res1);
-   base = devm_request_and_ioremap(pdev-dev, res2);
-   if (!vaddr || !base) {
-   dev_err(pdev-dev, ioremap failed\n);
-   ret = -EADDRNOTAVAIL;
+   vaddr = devm_ioremap_resource(pdev-dev, res1);
+   base = devm_ioremap_resource(pdev-dev, res2);


   I'd rather put this line before its corresponding error check.


+   if (IS_ERR(vaddr)) {
+   ret = PTR_ERR(vaddr);
+   goto err_ioremap;
+   }
+   if (IS_ERR(base)) {
+   ret = PTR_ERR(base);
goto err_ioremap;
}


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] media: davinci: vpbe: fix layer availability for NV12 format

2013-05-03 Thread Sergei Shtylyov

Hello.

On 03-05-2013 13:53, Prabhakar Lad wrote:


From: Lad, Prabhakar prabhakar.cse...@gmail.com



For NV12 format, even if display data is single image,
both VIDWIN0 and VIDWIN1 parameters must be used. The start
address of Y data plane and C data plane is configured in
VIDEOWIN0ADH/L and VIDEOWIN1ADH/L respectively.
cuurently only one layer was requested, which is suffice
for yuv422, but for yuv420(NV12) two layers are required and
fix the same by requesting for other layer if pix fmt is NV12
during set_fmt.



Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
---
  drivers/media/platform/davinci/vpbe_display.c |   16 
  1 files changed, 16 insertions(+), 0 deletions(-)



diff --git a/drivers/media/platform/davinci/vpbe_display.c 
b/drivers/media/platform/davinci/vpbe_display.c
index 0341dcc..f2ee07b 100644
--- a/drivers/media/platform/davinci/vpbe_display.c
+++ b/drivers/media/platform/davinci/vpbe_display.c
@@ -922,6 +922,22 @@ static int vpbe_display_s_fmt(struct file *file, void 
*priv,
other video window */

layer-pix_fmt = *pixfmt;
+   if (pixfmt-pixelformat == V4L2_PIX_FMT_NV12 
+   cpu_is_davinci_dm365()) {


   cpu_is_*() shouldn't be used in the drivers.


+   struct vpbe_layer *otherlayer;
+
+   otherlayer = _vpbe_display_get_other_win_layer(disp_dev, layer);
+   /* if other layer is available, only
+   * claim it, do not configure it
+   */
+   ret = osd_device-ops.request_layer(osd_device,
+   otherlayer-layer_info.id);
+   if (ret  0) {
+   v4l2_err(vpbe_dev-v4l2_dev,
+Display Manager failed to allocate layer\n);
+   return -EBUSY;
+   }
+   }


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] vhost_net: clear msg.control for non-zerocopy case during tx

2013-06-05 Thread Sergei Shtylyov

Hello.

On 05-06-2013 11:40, Jason Wang wrote:


When we decide not use zero-copy, msg.control should be set to NULL otherwise
macvtap/tap may set zerocopy callbacks which may decrease the kref of ubufs
wrongly.



Bug were introduced by commit cedb9bdce099206290a2bdd02ce47a7b253b6a84
(vhost-net: skip head management if no outstanding).



This solves the following warnings:



WARNING: at include/linux/kref.h:47 handle_tx+0x477/0x4b0 [vhost_net]()
Modules linked in: vhost_net macvtap macvlan tun nfsd exportfs bridge stp llc 
openvswitch kvm_amd kvm bnx2 megaraid_sas [last unloaded: tun]
CPU: 5 PID: 8670 Comm: vhost-8668 Not tainted 3.10.0-rc2+ #1566
Hardware name: Dell Inc. PowerEdge R715/00XHKG, BIOS 1.5.2 04/19/2011
a0198323 88007c9ebd08 81796b73 88007c9ebd48
8103d66b 7b773e20 8800779f 8800779f43f0
8800779f8418 015c 0062 88007c9ebd58
Call Trace:
[81796b73] dump_stack+0x19/0x1e
[8103d66b] warn_slowpath_common+0x6b/0xa0
[8103d6b5] warn_slowpath_null+0x15/0x20
[a0197627] handle_tx+0x477/0x4b0 [vhost_net]
[a0197690] handle_tx_kick+0x10/0x20 [vhost_net]
[a019541e] vhost_worker+0xfe/0x1a0 [vhost_net]
[a0195320] ? vhost_attach_cgroups_work+0x30/0x30 [vhost_net]
[a0195320] ? vhost_attach_cgroups_work+0x30/0x30 [vhost_net]
[81061f46] kthread+0xc6/0xd0
[81061e80] ? kthread_freezable_should_stop+0x70/0x70
[817a1aec] ret_from_fork+0x7c/0xb0
[81061e80] ? kthread_freezable_should_stop+0x70/0x70



Signed-off-by: Jason Wang jasow...@redhat.com
---
  drivers/vhost/net.c |3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)



diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 2b51e23..b07d96b 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -436,7 +436,8 @@ static void handle_tx(struct vhost_net *net)
kref_get(ubufs-kref);
}
nvq-upend_idx = (nvq-upend_idx + 1) % UIO_MAXIOV;
-   }
+   } else


   You have to use {} on the *else* branch if you have it of the *if* 
branch (and vice versa), according to Documentation/CodingStyle.



+   msg.msg_control = NULL;


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] vhost_net: clear msg.control for non-zerocopy case during tx

2013-06-06 Thread Sergei Shtylyov

Hello.

On 06/06/2013 07:27 AM, Jason Wang wrote:


When we decide not use zero-copy, msg.control should be set to NULL
otherwise
macvtap/tap may set zerocopy callbacks which may decrease the kref of
ubufs
wrongly.
Bug were introduced by commit cedb9bdce099206290a2bdd02ce47a7b253b6a84
(vhost-net: skip head management if no outstanding).
This solves the following warnings:
WARNING: at include/linux/kref.h:47 handle_tx+0x477/0x4b0 [vhost_net]()
Modules linked in: vhost_net macvtap macvlan tun nfsd exportfs bridge
stp llc openvswitch kvm_amd kvm bnx2 megaraid_sas [last unloaded: tun]
CPU: 5 PID: 8670 Comm: vhost-8668 Not tainted 3.10.0-rc2+ #1566
Hardware name: Dell Inc. PowerEdge R715/00XHKG, BIOS 1.5.2 04/19/2011
a0198323 88007c9ebd08 81796b73 88007c9ebd48
8103d66b 7b773e20 8800779f 8800779f43f0
8800779f8418 015c 0062 88007c9ebd58
Call Trace:
[81796b73] dump_stack+0x19/0x1e
[8103d66b] warn_slowpath_common+0x6b/0xa0
[8103d6b5] warn_slowpath_null+0x15/0x20
[a0197627] handle_tx+0x477/0x4b0 [vhost_net]
[a0197690] handle_tx_kick+0x10/0x20 [vhost_net]
[a019541e] vhost_worker+0xfe/0x1a0 [vhost_net]
[a0195320] ? vhost_attach_cgroups_work+0x30/0x30 [vhost_net]
[a0195320] ? vhost_attach_cgroups_work+0x30/0x30 [vhost_net]
[81061f46] kthread+0xc6/0xd0
[81061e80] ? kthread_freezable_should_stop+0x70/0x70
[817a1aec] ret_from_fork+0x7c/0xb0
[81061e80] ? kthread_freezable_should_stop+0x70/0x70
Signed-off-by: Jason Wang jasow...@redhat.com
---
   drivers/vhost/net.c |3 ++-
   1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 2b51e23..b07d96b 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -436,7 +436,8 @@ static void handle_tx(struct vhost_net *net)
   kref_get(ubufs-kref);
   }
   nvq-upend_idx = (nvq-upend_idx + 1) % UIO_MAXIOV;
-}
+} else

You have to use {} on the *else* branch if you have it of the *if*
branch (and vice versa), according to Documentation/CodingStyle.

checkpatch.pl didn't complain this, will send v2.


Yes, this check is what it seems to lack still.


Thanks



WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 07/45] CPU hotplug: Expose the new debug config option

2013-06-23 Thread Sergei Shtylyov

Hello.

On 23-06-2013 17:39, Srivatsa S. Bhat wrote:


Now that we have all the pieces of the CPU hotplug debug infrastructure
in place, expose the feature by growing a new Kconfig option,
CONFIG_DEBUG_HOTPLUG_CPU.



Cc: Andrew Morton a...@linux-foundation.org
Cc: Paul E. McKenney paul.mcken...@linaro.org
Cc: Akinobu Mita akinobu.m...@gmail.com
Cc: Catalin Marinas catalin.mari...@arm.com
Cc: Michel Lespinasse wal...@google.com
Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com
---



  lib/Kconfig.debug |9 +
  1 file changed, 9 insertions(+)



diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 566cf2b..6be1e72 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -512,6 +512,15 @@ config DEBUG_PREEMPT
  if kernel code uses it in a preemption-unsafe way. Also, the kernel
  will detect preemption count underflows.

+config DEBUG_HOTPLUG_CPU
+   bool Debug CPU hotplug
+   depends on HOTPLUG_CPU
+   default n


It's the default default, no need to specify it.

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net] tun: fix recovery from gup errors

2013-06-23 Thread Sergei Shtylyov

Hello.

On 23-06-2013 18:19, Michael S. Tsirkin wrote:


get user pages might fail partially in tun zero copy
mode. To recover we need to put all pages that we got,
but code used a wrong index resulting in double-free
errors.



Reported-by: Brad Hubbard bhubb...@redhat.com
Signed-off-by: Michael S. Tsirkin m...@redhat.com
---



I haven't figured out why do we get failures,
but recovery is clearly wrong.



This is also -stable material.



  drivers/net/tun.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)



diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index bfa9bb4..c098b1e 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1010,8 +1010,9 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, 
const struct iovec *from,
return -EMSGSIZE;
num_pages = get_user_pages_fast(base, size, 0, page[i]);
if (num_pages != size) {
-   for (i = 0; i  num_pages; i++)
-   put_page(page[i]);
+   int j;


  Empty line wouldn't hurt here, after declaration.


+   for (j = 0; j  num_pages; j++)
+   put_page(page[i + j]);


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] [NET]: Unmap fragment page once iterator is done

2013-06-24 Thread Sergei Shtylyov

Hello.

On 24-06-2013 10:33, Wedson Almeida Filho wrote:


Callers of skb_seq_read() are currently forced to call skb_abort_seq_read()
even when consuming all the data because the last call to skb_seq_read (the
one that returns 0 to indicate the end) fails to unmap the last fragment page.



With this patch callers will be allowed to traverse the SKB data by calling
skb_prepare_seq_read() once and repeatedly calling skb_seq_read() as originally
intended (and documented in the original commit 677e90eda), that is, only call


   Please also specify the summary line of that commit.


skb_abort_seq_read() if the sequential read is actually aborted.



Signed-off-by: Wedson Almeida Filho wedso...@gmail.com


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 2/2] regulators: max8973: initial DT support

2013-06-24 Thread Sergei Shtylyov

Hello.

On 06/24/2013 02:50 PM, Guennadi Liakhovetski wrote:


This patch adds primitive DT support to the max8973 regulator driver. None
of the configuration parameters, supported in the platform data are yet
available in DT, therefore no configuration is performed if booting with
no platform data. This means, that DT instantiation can only be used on
boards, where no run-time configuration of the chip is required. In such
cases the driver can be used to scale its output voltage. In the future
support for configuration parameters should be added.



Signed-off-by: Guennadi Liakhovetski g.liakhovetski+rene...@gmail.com
---



v2: as suggested by Mark, regulator bindings are now directly under the
main max8973 I2C device node.



  .../bindings/regulator/max8973-regulator.txt   |   21 +++
  drivers/regulator/max8973-regulator.c  |   37 +--
  2 files changed, 46 insertions(+), 12 deletions(-)
  create mode 100644 
Documentation/devicetree/bindings/regulator/max8973-regulator.txt



diff --git a/Documentation/devicetree/bindings/regulator/max8973-regulator.txt 
b/Documentation/devicetree/bindings/regulator/max8973-regulator.txt
new file mode 100644
index 000..8d38ab2
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/max8973-regulator.txt
@@ -0,0 +1,21 @@
+* Maxim MAX8973 Voltage Regulator
+
+Required properties:
+
+- compatible:  must be maxium,max8973


   I see only maxim and dallas for Maxim Integrated Products in 
Documentation/devicetree/bindings/vendor-prefixes.txt. Is maxium some 
new, unknown vendor?



+- reg: the i2c slave address of the regulator. It should be 0x1b.
+
+Any standard regulator properties can be used to configure the single max8973
+DCDC.
+
+Example:
+
+   max8973@1b {
+   compatible = maxium,max8973;
+   reg = 0x1b;
+
+   regulator-min-microvolt = 935000;
+   regulator-max-microvolt = 120;
+   regulator-boot-on;
+   regulator-always-on;
+   };
diff --git a/drivers/regulator/max8973-regulator.c 
b/drivers/regulator/max8973-regulator.c
index b2dbdd7..0c5195a 100644
--- a/drivers/regulator/max8973-regulator.c
+++ b/drivers/regulator/max8973-regulator.c

[...]

@@ -439,16 +447,21 @@ static int max8973_probe(struct i2c_client *client,

[...]

+   if (pdata) {
+   ret = max8973_init_dcdc(max, pdata);
+   if (ret  0) {
+   dev_err(max-dev, Max8973 Init failed, err = %d\n, 
ret);


   Not MAX8973?

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] [NET]: Unmap fragment page once iterator is done

2013-06-24 Thread Sergei Shtylyov

Hello.

On 06/25/2013 02:47 AM, Wedson Almeida Filho wrote:


The summary line of the original commit is [NET]: Zerocopy sequential
reading of skb data.


   That's interesting but please update your patch.

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] staging: usbip: replace pr_warning() with dev_warn().

2013-06-26 Thread Sergei Shtylyov

Hello.

On 26-06-2013 13:41, navin patidar wrote:


dev_warn() is preferred over pr_warning().



container_of() is used to get usb_driver pointer from usbip_device container
(stub_device or vhci_device), to get device structure required for dev_warn().



Signed-off-by: navin patidar nav...@cdac.in
---
  drivers/staging/usbip/usbip_event.c |   14 +-
  1 file changed, 13 insertions(+), 1 deletion(-)



diff --git a/drivers/staging/usbip/usbip_event.c 
b/drivers/staging/usbip/usbip_event.c
index 82123be..3bd1b94 100644
--- a/drivers/staging/usbip/usbip_event.c
+++ b/drivers/staging/usbip/usbip_event.c
@@ -21,6 +21,8 @@
  #include linux/export.h

  #include usbip_common.h
+#include stub.h
+#include vhci.h

  static int event_handler(struct usbip_device *ud)
  {
@@ -85,7 +87,17 @@ int usbip_start_eh(struct usbip_device *ud)

ud-eh = kthread_run(event_handler_loop, ud, usbip_eh);
if (IS_ERR(ud-eh)) {
-   pr_warning(Unable to start control thread\n);
+   struct device dev;


   Empty line after declaration wouldn't hurt here...


+   if (ud-side == USBIP_STUB) {
+   struct stub_device *sdev;


   ... and here.


+   sdev = container_of(ud, struct stub_device, ud);
+   dev = sdev-udev-dev;
+   } else {
+   struct vhci_device *vdev;


   ... and here.


+   vdev = container_of(ud, struct vhci_device, ud);
+   dev = vdev-udev-dev;
+   }
+   dev_warn(dev, Unable to start control thread\n);


   Patch looks clumsy...

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 11/11] net: emaclite: Update driver header

2013-05-29 Thread Sergei Shtylyov

Hello.

On 05/29/2013 07:33 PM, Michal Simek wrote:


Corrent email address and years.


   s/Corrent/Correct/. Perhaps the committer can fix.


Signed-off-by: Michal Simek michal.si...@xilinx.com


WBR, Sergei


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH, v2 13/13] mm/m68k: fix build warning of unused variable

2013-05-29 Thread Sergei Shtylyov

Hello.

On 05/29/2013 06:44 PM, Jiang Liu wrote:


Fix build warning of unused variable:
arch/m68k/mm/init.c: In function 'mem_init':
arch/m68k/mm/init.c:151:6: warning: unused variable 'i' [-Wunused-variable]

Signed-off-by: Jiang Liu jiang@huawei.com
Cc: Geert Uytterhoeven ge...@linux-m68k.org
Cc: Greg Ungerer g...@uclinux.org
Cc: Thadeu Lima de Souza Cascardo casca...@holoscopio.com
Cc: linux-m...@lists.linux-m68k.org
Cc: linux-kernel@vger.kernel.org
---
  arch/m68k/mm/init.c | 13 -
  1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
index 6e0a938..6b4baa6 100644
--- a/arch/m68k/mm/init.c
+++ b/arch/m68k/mm/init.c
@@ -146,14 +146,11 @@ void __init print_memmap(void)
MLK_ROUNDUP(__bss_start, __bss_stop));
  }
  
-void __init mem_init(void)

+static inline void init_pointer_tables(void)
  {
+#if defined(CONFIG_MMU)  !defined(CONFIG_SUN3)  !defined(CONFIG_COLDFIRE)


   #ifdef's in the function bodies are frowned upon, this should better be:

#if defined(CONFIG_MMU)  !defined(CONFIG_SUN3)  !defined(CONFIG_COLDFIRE)

static inline void init_pointer_tables(void)
{
[...]
}
#else
static inline void init_pointer_tables(void) {}
#endif


int i;
  
-	/* this will put all memory onto the freelists */

-   free_all_bootmem();
-
-#if defined(CONFIG_MMU)  !defined(CONFIG_SUN3)  !defined(CONFIG_COLDFIRE)
/* insert pointer tables allocated so far into the tablelist */
init_pointer_table((unsigned long)kernel_pg_dir);
for (i = 0; i  PTRS_PER_PGD; i++) {
@@ -165,7 +162,13 @@ void __init mem_init(void)
if (zero_pgtable)
init_pointer_table((unsigned long)zero_pgtable);
  #endif
+}
  
+void __init mem_init(void)

+{
+   /* this will put all memory onto the freelists */
+   free_all_bootmem();
+   init_pointer_tables();
mem_init_print_info(NULL);
print_memmap();
  }


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] net: skbuff: use _RET_IP_

2013-05-29 Thread Sergei Shtylyov

Hello.

On 05/30/2013 01:09 AM, Davidlohr Bueso wrote:


Use the already defined macro to pass the function return address.

Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com
---
  net/core/skbuff.c | 14 +++---
  1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index af9185d..0d06850 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -116,22 +116,22 @@ static const struct pipe_buf_operations sock_pipe_buf_ops 
= {
   *Keep out of line to prevent kernel bloat.
   *__builtin_return_address is not used because it is not always reliable.
   */
-static void skb_panic(struct sk_buff *skb, unsigned int sz, void *addr,
+static void skb_panic(struct sk_buff *skb, unsigned int sz, unsigned long addr,
  const char msg[])
  {
-   pr_emerg(%s: text:%p len:%d put:%d head:%p data:%p tail:%#lx end:%#lx 
dev:%s\n,
+   pr_emerg(%s: text:0x%lx len:%d put:%d head:%p data:%p tail:%#lx end:%#lx 
dev:%s\n,


Why not text:%#lx as already used in this string? It's equivalent 
to 0x%lx.


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] ata: increase retry count but shorten duration for Calxeda controller

2013-05-30 Thread Sergei Shtylyov

Hello.

On 30-05-2013 18:26, Timur Tabi wrote:


-   const unsigned long *timing = sata_ehc_deb_timing(link-eh_context);
+   const unsigned long timing[] = { 5, 100, 500};



You'll save space and time if you also make this array static,
otherwise the compiler will build the array every time this function is
called.


   No, *const* specifier is enough to not build this array every time. 
It will be put into the .const section.


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 4/6] MIPS: jz4740: Register jz4740 DMA device

2013-05-30 Thread Sergei Shtylyov

Hello.

On 05/30/2013 08:25 PM, Lars-Peter Clausen wrote:


Register a device for the newly added jz4740 dmaengine driver.

Signed-off-by: Lars-Peter Clausen l...@metafoo.de
Acked-by: Ralf Baechle r...@linux-mips.org

[...]

  3 files changed, 23 insertions(+)
diff --git a/arch/mips/jz4740/platform.c b/arch/mips/jz4740/platform.c
index e9348fd..35a9d8c 100644
--- a/arch/mips/jz4740/platform.c
+++ b/arch/mips/jz4740/platform.c
@@ -329,3 +329,24 @@ struct platform_device jz4740_pwm_device = {

[...]

+struct platform_device jz4740_dma_device = {
+   .name   = jz4740-dma,
+   .id = -1,


   Why not align all = in this structure?


+   .num_resources = ARRAY_SIZE(jz4740_dma_resources),
+   .resource  = jz4740_dma_resources,
+};


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] ata: increase retry count but shorten duration for Calxeda controller

2013-05-31 Thread Sergei Shtylyov

Hello.

On 31-05-2013 10:53, Clemens Ladisch wrote:


+const unsigned long timing[] = { 5, 100, 500};



You'll save space and time if you also make this array static,
otherwise the compiler will build the array every time this function is
called.



No, *const* specifier is enough to not build this array every time. It will be 
put into the .const section.



gcc disagrees:



$ cat const_static.c
int f(int x) {
const unsigned long timing[] = { 5, 100, 500};
static const unsigned long timing2[] = { 5, 100, 500};
return timing[x] + timing2[x];
}
$ gcc -Os -S const_static.c
$ cat const_static.s

...

timing2.0:
 .long   5
 .long   100
 .long   500
...
 movl8(%ebp), %edx
 movl$5, -16(%ebp)
 movl$100, -12(%ebp)
 movl$500, -8(%ebp)
 movltiming2.0(,%edx,4), %eax
 addl-16(%ebp,%edx,4), %eax


   Hm, I remember I was convinced by somebody just *const* was enough 
for the data to be put to .const section. Don't remember if he gave an 
object code example... Well, it means that person was wrong. Mark, we 
then need *static* as well...



Regards,
Clemens


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] net: skbuff: use _RET_IP_

2013-05-31 Thread Sergei Shtylyov

Hello.

On 31-05-2013 9:20, Joe Perches wrote:


 Why not text:%#lx as already used in this string? It's
equivalent to 0x%lx.



Well, I don't know the reasoning in this case, but I'd like to note that
those are not strictly equivalent.  Personally I find the formatting of 0
annoying enough to avoid %#x for any value which may be 0.  It's
especially bad if you try to line up things by adding leading zeros.



Yep, I found that 0x%lx produced the same output as %p.



Don't use a standalone gcc compiled program to
determine what the kernel outputs.



lib/vsprintf.c does not output the same. (32 bit)



The kernel output is;



printk(0x%lx\n, 0x100ul)0x100
printk(%p\n, (void *)0x100ul)   0100
printk(%#p\n, (void *)0x100ul)  0x0100



The last one isn't used at all in kernel source. (gcc complains)
It's always 0x%p


I was talking about using %#lx, not %#p. I don't see it in your 
example.


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [net-next rfc V2 6/8] macvtap: allow TUNSETIFF to create multiqueue device

2013-05-31 Thread Sergei Shtylyov

Hello.

On 31-05-2013 13:53, Jason Wang wrote:


Though the queue were in fact created by open(), we still need to add this check
to be compatible with tuntap which can let mgmt software use a single API to
manage queues. This patch only validates the device name and moves the TUNSETIFF
to a helper.



Signed-off-by: Jason Wang jasow...@redhat.com
---
  drivers/net/macvtap.c |   51 ++--
  1 files changed, 40 insertions(+), 11 deletions(-)



diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index e76484c..eac49cb 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -870,6 +870,7 @@ out:
return ret;
  }

+


   Seems like random whitespace change.


  static struct macvlan_dev *macvtap_get_vlan(struct macvtap_queue *q)
  {
struct macvlan_dev *vlan;

[...]

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] net: skbuff: use _RET_IP_

2013-05-31 Thread Sergei Shtylyov

Hello.

On 05/31/2013 08:54 PM, Joe Perches wrote:


Don't use a standalone gcc compiled program to
determine what the kernel outputs.

[]

The kernel output is;
printk(0x%lx\n, 0x100ul)0x100
printk(%p\n, (void *)0x100ul)   0100
printk(%#p\n, (void *)0x100ul)  0x0100
The last one isn't used at all in kernel source. (gcc complains)
It's always 0x%p

  I was talking about using %#lx, not %#p. I don't see it in your
example.

0x%lx and %#lx produce the same output in the kernel.

The latter isn't used very often though.


   It's already used in the same format string in this case. That's why 
I suggested

not to deviate from the existing code.

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] usb: musb: Fix format specifier warning

2013-05-31 Thread Sergei Shtylyov

Hello.

On 06/01/2013 12:22 AM, Emil Goode wrote:


This patch fixes a format specifier warning. dma_addr_t can be either
u32 or u64 so we should cast to the largest type and change the format
specifier to %llx.
The addition of urb-transfer_dma and urb-actual_length is also done a
few lines below. I have moved this code up and pass the variable buf to
dev_dbg.

Sparse output:
drivers/usb/musb/musb_host.c:1761:4: warning:
format ‘%x’ expects argument of type ‘unsigned int’,
but argument 6 has type ‘dma_addr_t’ [-Wformat]

Signed-off-by: Emil Goode emilgo...@gmail.com
---
  drivers/usb/musb/musb_host.c |   11 ---
  1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 094cf80..d647ccb 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c

[...]

@@ -1789,11 +1789,8 @@ void musb_host_rx(struct musb *musb, u8 epnum)
length = rx_count;
d-status = d_status;
buf = urb-transfer_dma + d-offset;
-   } else {
+   } else


   You should keep {} on the *else* branch since *if* branch has {},
according to Documentation/CodingStyle.


length = rx_count;
-   buf = urb-transfer_dma +
-   urb-actual_length;
-   }


WBR, Sergei


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v1 8/9] usb: phy: dts: Adding usbphy DT bindings for am33xx

2013-06-01 Thread Sergei Shtylyov

Hello.

On 24-05-2013 9:34, B, Ravi wrote:


+   phy1: usbphy-gs70@44e10620 {
+   compatible = ti,dsps-usbphy;
+   reg = 0x44e10620 0x8
+  0x44e10648 0x4;
+   reg-names = phy_ctrl,phy_wkup;
+   id = 0;
+   };
+
+   phy2: usbphy-gs70@44e10628 {
+   compatible = ti,dsps-usbphy;
+   reg = 0x44e10628 0x8
+  0x44e10648 0x4;

The second register conflicts with phy1.



The two instances of phy uses common phy wakeup register.



 That's why there is a resource conflict. Have you actually tried to 
instantiate the devices out of such tree?
This register should be declared somewhere above the PHYs I think...



I did not face any problem with this, I have tested both instances of phy used 
by dual instance controller, worked fine.


   How your /proc/iomem looks like with that?


What do you suggest, in case of common register which both phy have to use this 
for wakeup functionality.
The DT should support this.  What do you suggest in such case?


   I'd probably have to create a third device for this shared register...


--
Ravi B


WBR, Sergei


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 04/10] usb: musb: ux500: harden checks for platform data

2013-04-23 Thread Sergei Shtylyov

Hello.

On 04/23/2013 07:03 PM, Lee Jones wrote:


In its current state, the ux500-musb driver uses platform data pointers
blindly with no prior checking. If no platform data pointer is passed
this will Oops the kernel. In this patch we ensure platform data and
board data are present prior to using them.

Cc: Felipe Balbi ba...@ti.com
Cc: linux-...@vger.kernel.org
Signed-off-by: Lee Jones lee.jo...@linaro.org
---
  drivers/usb/musb/ux500_dma.c |   11 ---
  1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c
index c75e07a..02b4a6e 100644
--- a/drivers/usb/musb/ux500_dma.c
+++ b/drivers/usb/musb/ux500_dma.c
@@ -287,7 +287,7 @@ static int ux500_dma_controller_start(struct dma_controller 
*c)
struct musb *musb = controller-private_data;
struct device *dev = musb-controller;
struct musb_hdrc_platform_data *plat = dev-platform_data;
-   struct ux500_musb_board_data *data = plat-board_data;
+   struct ux500_musb_board_data *data;
struct dma_channel *dma_channel = NULL;
u32 ch_num;
u8 dir;
@@ -297,14 +297,19 @@ static int ux500_dma_controller_start(struct 
dma_controller *c)


[...]

  
  	/* Prepare the loop for RX channels */

channel_array = controller-rx_channel;
-   param_array = data-dma_rx_param_array;
+   param_array = (data) ? data-dma_rx_param_array : NULL;


   Why enclose a simple variable in parens?

  
  	for (dir = 0; dir  2; dir++) {

for (ch_num = 0;
@@ -337,7 +342,7 @@ static int ux500_dma_controller_start(struct dma_controller 
*c)
  
  		/* Prepare the loop for TX channels */

channel_array = controller-tx_channel;
-   param_array = data-dma_tx_param_array;
+   param_array = (data) ? data-dma_tx_param_array : NULL;


   Again, why?

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 04/10] usb: musb: ux500: harden checks for platform data

2013-04-24 Thread Sergei Shtylyov

Hello.

On 24-04-2013 10:53, Lee Jones wrote:


struct musb_hdrc_platform_data *plat = dev-platform_data;
-   struct ux500_musb_board_data *data = plat-board_data;
+   struct ux500_musb_board_data *data;



-   param_array = data-dma_rx_param_array;
+   param_array = (data) ? data-dma_rx_param_array : NULL;



Why enclose a simple variable in parens?



Because 'data' is a pointer, so it contains a memory location,


   Pointer points to memory location, not contains it.


but if
'plat-board_data' is NULL, then 'data' will be NULL (essentially
memory location 0x).


   So what?


So if we were to read-in to 'struct ux500_musb_board_data *data', by
index 'dma_rx_param_array', which I believe is '0' in this case:



struct ux500_musb_board_data {
 void**dma_rx_param_array;
 void**dma_tx_param_array;
 bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
};



... then we're saying take the data from this memory location:



param_array = *((0x)-(0x0));



Which will cause a kernel Oops, due to the fact that address 0x0 isn't
allocated to us, so you get something like:



Unable to handle kernel NULL pointer dereference at virtual address 


   We're not dereferencing 'data', so I completely fail to follow you.


Hope that helps.


   Not at all.


Kind regards,
Lee


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] ARM: davinci: dma: Convert to devm_* api

2013-05-16 Thread Sergei Shtylyov

Hello.

On 16-05-2013 10:58, Lad Prabhakar wrote:


From: Lad, Prabhakar prabhakar.cse...@gmail.com



Use devm_ioremap_resource instead of reques_mem_region()/ioremap() and
devm_request_irq() instead of request_irq().



This ensures more consistent error values and simplifies error paths.



Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
---
  NOte:- Boot tested on Logic-PD OMAP-L138 EVM



  arch/arm/mach-davinci/dma.c |   63 --
  1 files changed, 24 insertions(+), 39 deletions(-)



diff --git a/arch/arm/mach-davinci/dma.c b/arch/arm/mach-davinci/dma.c
index 45b7c71..aeda496 100644
--- a/arch/arm/mach-davinci/dma.c
+++ b/arch/arm/mach-davinci/dma.c

[...]

@@ -1422,25 +1421,16 @@ static int __init edma_probe(struct platform_device 
*pdev)
found = 1;
}

-   len[j] = resource_size(r[j]);
-
-   r[j] = request_mem_region(r[j]-start, len[j],
-   dev_name(pdev-dev));
-   if (!r[j]) {
-   status = -EBUSY;
-   goto fail1;
-   }
-
-   edmacc_regs_base[j] = ioremap(r[j]-start, len[j]);
-   if (!edmacc_regs_base[j]) {
+   edmacc_regs_base[j] = devm_ioremap_resource(pdev-dev, r[j]);
+   if (IS_ERR(edmacc_regs_base[j])) {
status = -EBUSY;


   And you call that more consistent error values? Why not:

status = PTR_ERR(edmacc_regs_base[j]);


edma_cc[j] = kzalloc(sizeof(struct edma), GFP_KERNEL);


   Maybe it's worth using devm_kzalloc() too?

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/5] davinci: net: cpdma: remove unwanted header file incusion and sort thme alphabetically

2013-05-16 Thread Sergei Shtylyov

Hello.

On 16-05-2013 11:30, Lad Prabhakar wrote:

   s/incusion/inclusion/, s/thme/them/ in the subject. Though instead 
of them it would be better to write headers.



From: Lad, Prabhakar prabhakar.cse...@gmail.com


   Changelog won't hurt here... which unwanted #include's you are 
removing and why are they unwanted?



Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
---
  drivers/net/ethernet/ti/davinci_cpdma.c |   10 +++---
  1 files changed, 3 insertions(+), 7 deletions(-)



diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c 
b/drivers/net/ethernet/ti/davinci_cpdma.c
index 49dfd59..f7ce97f 100644
--- a/drivers/net/ethernet/ti/davinci_cpdma.c
+++ b/drivers/net/ethernet/ti/davinci_cpdma.c
@@ -12,15 +12,11 @@
   * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
   */
-#include linux/kernel.h
-#include linux/spinlock.h
-#include linux/device.h
+
+#include linux/delay.h
+#include linux/dma-mapping.h
  #include linux/module.h
  #include linux/slab.h
-#include linux/err.h
-#include linux/dma-mapping.h
-#include linux/io.h
-#include linux/delay.h

  #include davinci_cpdma.h


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/5] net: davinci_emac: remove unwanted header inclusion and sort the alphabetically

2013-05-16 Thread Sergei Shtylyov

On 16-05-2013 11:30, Lad Prabhakar wrote:


From: Lad, Prabhakar prabhakar.cse...@gmail.com



This patch removes unwanted header inclusion


   Why are they unwanted?


and sorts them alphabetically


   In the subject you typed the instead of them.


Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 5/5] net: davinci_mdio: trivial cleanup

2013-05-16 Thread Sergei Shtylyov

On 16-05-2013 11:30, Lad Prabhakar wrote:


From: Lad, Prabhakar prabhakar.cse...@gmail.com



remove unwanted header inclusion and sort the alphabetically


   s/the/them/.


also guard the davinci_mdio_of_mtable table and davinci_mdio_probe_dt()
with CONFIG_OF.


   Saying also in the changelog is often a good sign there should be 
one more patch -- as in this case.



Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] linux/of_platform.h: fix compilation warnings with DT disabled

2013-05-16 Thread Sergei Shtylyov

Hello.

On 03/01/2013 05:02 PM, Rob Herring wrote:


Fix the following compilation warnings (in Simon Horman's
renesas.git repo):
In file included from arch/arm/mach-shmobile/setup-r8a7779.c:24:0:
include/linux/of_platform.h:107:13: warning: ‘struct of_device_id’
declared
inside parameter list [enabled by default]
include/linux/of_platform.h:107:13: warning: its scope is only this
definition
or declaration, which is probably not what you want [enabled by
default]
include/linux/of_platform.h:107:13: warning: ‘struct device_node’
declared
inside parameter list [enabled by default]
linux/of_platform.h only #include's headers with definitions of
the above
mentioned structures if CONFIG_OF_DEVICE=y but uses them even if
not. One
solution is to move some #include's out of #ifdef CONFIG_OF_DEVICE
and use
incomplete declarations for the rest of the structures where the
#ifdef move
doesn't help...
Reported-by: Vladimir Barinov vladimir.bari...@cogentembedded.com
Signed-off-by: Sergei Shtylyov sergei.shtyl...@cogentembedded.com

Reviewed-by: Simon Horman horms+rene...@verge.net.au
Grant, could you consider taking this patch?

Yes, I can, but I don't seem to have the original patch. Can you send it
again.

Nevermind. Found it. I'll apply it.

Will you drop 'struct device_node' declaration then or should I
resend? In fact, I think I should better resend it with the changelog
somewhat edited.

No, I plan to leave it as is and not rely on device.h by chance
declaring device_node.


I hoped to see this fix in 3.10-rc1. Is there any hope to see it in 
3.10-rc's?

The code it fixes the warnings in is already in Linus tree.




Rob


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 15/19] drivers/net/irda: add missing platform_driver owner

2013-05-21 Thread Sergei Shtylyov

Hello.

On 21-05-2013 6:42, Libo Chen wrote:


set the owner of platform_driver, to ensure that the
caller of driver holds a module refernece



Signed-off-by: Libo Chen libo.c...@huawei.com
---
  drivers/net/irda/bfin_sir.c   |1 +
  drivers/net/irda/sh_irda.c|1 +
  drivers/net/irda/sh_sir.c |1 +
  drivers/net/irda/smsc-ircc2.c |1 +
  4 files changed, 4 insertions(+), 0 deletions(-)



diff --git a/drivers/net/irda/bfin_sir.c b/drivers/net/irda/bfin_sir.c
index 22b4527..bf976f3 100644
--- a/drivers/net/irda/bfin_sir.c
+++ b/drivers/net/irda/bfin_sir.c
@@ -806,6 +806,7 @@ static struct platform_driver bfin_ir_driver = {
.resume  = bfin_sir_resume,
.driver  = {
.name = DRIVER_NAME,
+   .owner  = THIS_MODULE,


   Either indent last = with space as above, or indent both = with tabs.

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 18/19] drivers/net/ethernet/marvell: add missing platform_driver owne

2013-05-21 Thread Sergei Shtylyov

Hello.

On 21-05-2013 6:42, Libo Chen wrote:


set the owner of platform_driver, to ensure that the
caller of driver holds a module refernece



Signed-off-by: Libo Chen libo.c...@huawei.com
---
  drivers/net/ethernet/marvell/mvneta.c |1 +
  1 files changed, 1 insertions(+), 0 deletions(-)



diff --git a/drivers/net/ethernet/marvell/mvneta.c 
b/drivers/net/ethernet/marvell/mvneta.c
index c966785..be35a3e 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2820,6 +2820,7 @@ static struct platform_driver mvneta_driver = {
.remove = mvneta_remove,
.driver = {
.name = MVNETA_DRIVER_NAME,
+   .owner  = THIS_MODULE,


   Indent this = with space or indent all ='s with tabs.


.of_match_table = mvneta_match,
},
  };


WBR, Sergei


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 02/11] gpio: davinci: coding style correction

2013-05-22 Thread Sergei Shtylyov

Hello.

On 22-05-2013 11:10, Philip Avinash wrote:


1. Corrects coding and commenting styles
2. Variables name change to meaningful name
3. Remove unnecessary variable usage
4. Add BINTEN macro definition

Signed-off-by: Philip Avinash avinashphi...@ti.com
---
  drivers/gpio/gpio-davinci.c |  182 +--
  1 file changed, 89 insertions(+), 93 deletions(-)



diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
index 17df6db..d308955 100644
--- a/drivers/gpio/gpio-davinci.c
+++ b/drivers/gpio/gpio-davinci.c

[...]

@@ -31,10 +31,11 @@ struct davinci_gpio_regs {
u32 intstat;
  };

+#define BINTEN 0x08 /* GPIO Interrupt Per-Bank Enable Register */


   Empty line needed here.


  #define chip2controller(chip) \
container_of(chip, struct davinci_gpio_controller, chip)


[...]

@@ -98,8 +94,8 @@ static int davinci_direction_in(struct gpio_chip *chip, 
unsigned offset)
return __davinci_direction(chip, offset, false, 0);
  }

-static int
-davinci_direction_out(struct gpio_chip *chip, unsigned offset, int value)
+static int davinci_direction_out(struct gpio_chip *chip, unsigned offset,
+   int value)


This line should be aligned under the next character after (.

[...]

@@ -113,22 +109,22 @@ davinci_direction_out(struct gpio_chip *chip, unsigned 
offset, int value)

[...]

  /*
   * Assuming the pin is muxed as a gpio output, set its output value.
   */
-static void
-davinci_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+static void davinci_gpio_set(struct gpio_chip *chip, unsigned offset,
+   int value)


Same here.

[...]

@@ -368,16 +363,16 @@ static int __init davinci_gpio_irq_setup(void)

[...]

for (gpio = 0, bank = 0; gpio  ngpio; bank++, gpio += 32) {
-   chips[bank].chip.to_irq = gpio_to_irq_banked;
-   chips[bank].irq_base = soc_info-gpio_unbanked
-   ? -EINVAL
-   : (soc_info-intc_irq_num + gpio);
+   ctlrs[bank].chip.to_irq = gpio_to_irq_banked;
+   ctlrs[bank].irq_base = soc_info-gpio_unbanked ?
+   -EINVAL : (soc_info-intc_irq_num + gpio);


   () not needed here.

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH -resend 1/6] mISDN: Add support for group membership check

2013-05-22 Thread Sergei Shtylyov

Hello.

On 22-05-2013 16:59, Jiri Slaby wrote:


From: Jeff Mahoney je...@suse.com



This patch adds a module parameter to allow a group access to the
mISDN devices. Otherwise, unpriviledged users on systems with ISDN
hardware have the ability to dial out, potentially causing expensive
bills.



Based on a different implementation by Patrick Koppen isdn4li...@koppen.de



Acked-by: Jeff Mahoney je...@suse.com
Cc: Patrick Koppen isdn4li...@koppen.de
Signed-off-by: Jiri Slaby jsl...@suse.cz
Cc: Karsten Keil i...@linux-pingi.de
Cc: net...@vger.kernel.org
Cc: David S. Miller da...@davemloft.net
---
  drivers/isdn/mISDN/core.c   | 3 +++
  drivers/isdn/mISDN/core.h   | 1 +
  drivers/isdn/mISDN/socket.c | 8 
  3 files changed, 12 insertions(+)


[...]

diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c
index e47dcb9..71f4986 100644
--- a/drivers/isdn/mISDN/socket.c
+++ b/drivers/isdn/mISDN/socket.c
@@ -612,6 +612,10 @@ data_sock_create(struct net *net, struct socket *sock, int 
protocol)
  {
struct sock *sk;

+   if(!capable(CAP_SYS_ADMIN)  (misdn_permitted_gid != current_gid())


Did you run this thru scripts/checkpatch.pl? There should be space 
after *if*. Also, () around != are not neccessary...



@@ -694,6 +698,10 @@ base_sock_ioctl(struct socket *sock, unsigned int cmd, 
unsigned long arg)
case IMSETDEVNAME:
{
struct mISDN_devrename dn;
+   if(!capable(CAP_SYS_ADMIN)


   Again, need space after *if*.


+(misdn_permitted_gid != current_gid())


   Better leave  on a previous line and align the line under !. () 
again are not necessary.



+(!in_group_p(misdn_permitted_gid)))


   () around !x are simply not needed -- ! operator has very high priority.

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v1 2/9] usb: musb: nop: remove unused nop_xceiv_(un)register APIs from glue

2013-05-23 Thread Sergei Shtylyov

Hello.

On 23-05-2013 10:01, Ravi Babu wrote:


removed unused nop xceiv (un_)register API's from all musb
platform drivers


   Since when are they unused?


Signed-off-by: Ravi Babu ravib...@ti.com


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v1 7/9] usb: musb: dsps: use get-usb-phy by phandle for multi instance

2013-05-23 Thread Sergei Shtylyov

On 23-05-2013 10:01, Ravi Babu wrote:


In case of mutli instance support, use get-phy object using phandle
to return to repsective phy xceiv object for each instance


   Only respective and s/xceiv/transceiver/.


Signed-off-by: Ravi Babu ravib...@ti.com


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v1 8/9] usb: phy: dts: Adding usbphy DT bindings for am33xx

2013-05-23 Thread Sergei Shtylyov

On 23-05-2013 10:01, Ravi Babu wrote:


The am33xx platforms suppors dual musb instance which need two instances
of usb-phy. Add dual instance usb-phy DT bindings for am333x platform.



Signed-off-by: Ravi Babu ravib...@ti.com
---
  arch/arm/boot/dts/am33xx.dtsi |   17 +
  1 files changed, 17 insertions(+), 0 deletions(-)



diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 0957645..b0b4deb 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -322,6 +322,22 @@
status = disabled;
};

+   phy1: usbphy-gs70@44e10620 {
+   compatible = ti,dsps-usbphy;
+   reg = 0x44e10620 0x8
+  0x44e10648 0x4;
+   reg-names = phy_ctrl,phy_wkup;
+   id = 0;
+   };
+
+   phy2: usbphy-gs70@44e10628 {
+   compatible = ti,dsps-usbphy;
+   reg = 0x44e10628 0x8
+  0x44e10648 0x4;


   The second register conflicts with phy1.

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [net-next RFC 3/8] macvtap: introduce macvtap_get_vlan()

2013-05-23 Thread Sergei Shtylyov

Hello.

On 23-05-2013 7:12, Jason Wang wrote:


Factor out the device holding logic to a macvtap_get_vlan(), this will be also
used by multiqueue API.



Signed-off-by: Jason Wang jasow...@redhat.com
---
  drivers/net/macvtap.c |   26 +++---
  1 files changed, 19 insertions(+), 7 deletions(-)



diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index ce1c72a..a36e49e 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -890,6 +890,23 @@ out:
return ret;
  }

+static struct macvlan_dev *macvtap_get_vlan(struct macvtap_queue *q)
+{
+   struct macvlan_dev *vlan;


   Empty line wouldn't hurt here, after declaration.


+   rcu_read_lock_bh();
+   vlan = rcu_dereference_bh(q-vlan);
+   if (vlan)
+   dev_hold(vlan-dev);
+   rcu_read_unlock_bh();
+
+   return vlan;
+}

[...]

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v1 8/9] usb: phy: dts: Adding usbphy DT bindings for am33xx

2013-05-23 Thread Sergei Shtylyov

Hello.

On 05/23/2013 09:13 PM, B, Ravi wrote:




+   phy1: usbphy-gs70@44e10620 {
+   compatible = ti,dsps-usbphy;
+   reg = 0x44e10620 0x8
+  0x44e10648 0x4;
+   reg-names = phy_ctrl,phy_wkup;
+   id = 0;
+   };
+
+   phy2: usbphy-gs70@44e10628 {
+   compatible = ti,dsps-usbphy;
+   reg = 0x44e10628 0x8
+  0x44e10648 0x4;

The second register conflicts with phy1.

The two instances of phy uses common phy wakeup register.


That's why there is a resource conflict. Have you actually tried to 
instantiate the devices out of such tree?

This register should be declared somewhere above the PHYs I think...


--
Ravi B


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v1 2/9] usb: musb: nop: remove unused nop_xceiv_(un)register APIs from glue

2013-05-23 Thread Sergei Shtylyov

Hello.

On 05/23/2013 09:07 PM, B, Ravi wrote:


removed unused nop xceiv (un_)register API's from all musb
platform drivers

Since when are they unused?

Please refer to commit id 662dca54 : usb: otg: support for multiple 
transceivers by a single controller.
Usb_get_phy() is used to get the of phy used by controller, phy bindings are 
done through DT.


   Why are you sure that all these platforms support DT (in all 
configurations)?
It seems to me that you're simply breaking the patched glue layers with 
this patch.

I'll let Felipe decide the fate of this patch though...




Signed-off-by: Ravi Babu ravib...@ti.com

--
Ravi B


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v1 2/9] usb: musb: nop: remove unused nop_xceiv_(un)register APIs from glue

2013-05-24 Thread Sergei Shtylyov

Hello.

On 24-05-2013 9:34, B, Ravi wrote:


removed unused nop xceiv (un_)register API's from all musb platform
drivers



 Since when are they unused?



Please refer to commit id 662dca54 : usb: otg: support for multiple 
transceivers by a single controller.
Usb_get_phy() is used to get the of phy used by controller, phy bindings are 
done through DT.



Why are you sure that all these platforms support DT (in all 
configurations)?
It seems to me that you're simply breaking the patched glue layers with this 
patch.
I'll let Felipe decide the fate of this patch though...



You are correct, the bindings of phy and controller need not to done through DT 
alone, there is a saperate API
Phy API's available for such bindings done in respective board platform files.


   I don't see any such code in e.g. DaVinci/DA8xx platform files.


Signed-off-by: Ravi Babu ravib...@ti.com

--
Ravi B


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] usbfs: Increase arbitrary limit for USB 3 isopkt length

2013-05-24 Thread Sergei Shtylyov

Hello.

On 24-05-2013 12:47, Federico Manzan wrote:


Increase the current arbitrary limit for isocronous packet size to a
value large enough to account for USB 3.0 super bandwidth streams,
bMaxBurst (0~15 allowed, 1~16 packets)
bmAttributes (bit 1:0, mult 0~2, 1~3 packets)
so the size max for one USB 3 isocronous transfer is
1024 byte * 16 * 3 = 49152 byte



Signed-off-by: Federico Manzan f.man...@gmail.com
---
  drivers/usb/core/devio.c |8 +---
  1 file changed, 5 insertions(+), 3 deletions(-)



diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index caefc80..7ac137e 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -1287,9 +1287,11 @@ static int proc_do_submiturb(struct dev_state *ps, 
struct usbdevfs_urb *uurb,
goto error;
}
for (totlen = u = 0; u  uurb-number_of_packets; u++) {
-   /* arbitrary limit,
-* sufficient for USB 2.0 high-bandwidth iso */
-   if (isopkt[u].length  8192) {
+   /* arbitrary limit need for USB 3.0
+* bMaxBurst (0~15 allowed, 1~16 packets)
+* bmAttributes (bit 1:0, mult 0~2, 1~3 packets)
+* sizemax: 1024 * 16 * 3 = 49152*/


   The preferred style of the multi-line comments is this:

/*
 * bla
 * bla
 */

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] drivers: regulator: palmas: add an API to set/clear the switch bit on SMPS10

2013-05-24 Thread Sergei Shtylyov

Hello.

On 24-05-2013 18:31, Kishon Vijay Abraham I wrote:


From: Graeme Gregory g...@slimlogic.co.uk



Added an API to set/clear the switch bit on SMPS10 which can be used by
palmas usb. The switch bit should be set in order for palmas to
supply VBUS and is needed when OMAP is acting as USB HOST.



Signed-off-by: Graeme Gregory g...@slimlogic.co.uk
Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
  drivers/regulator/palmas-regulator.c | 26 ++
  include/linux/mfd/palmas.h   |  2 ++
  2 files changed, 28 insertions(+)



diff --git a/drivers/regulator/palmas-regulator.c 
b/drivers/regulator/palmas-regulator.c
index 92ceed0..d57ab55 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -465,6 +465,32 @@ static int palmas_smps_set_ramp_delay(struct regulator_dev 
*rdev,
return ret;
  }

+/**
+ * palmas_set_switch_smps10() - set or clear the switch bit on SMPS10
+ * @param palmas pointer to the palmas mfd structure
+ * @param sw boolean to indicate switch status


   Please follow the kernel-doc style described in 
Documentation/kernel-doc-nano-HOWTO.txt.


[...]

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 2/5] media: davinci: vpif: Convert to devm_* api

2013-05-26 Thread Sergei Shtylyov

Hello.

On 26-05-2013 4:49, Laurent Pinchart wrote:


From: Lad, Prabhakar prabhakar.cse...@gmail.com



Use devm_ioremap_resource instead of reques_mem_region()/ioremap().
This ensures more consistent error values and simplifies error paths.



Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
---
  drivers/media/platform/davinci/vpif.c |   27 ---
  1 files changed, 4 insertions(+), 23 deletions(-)



diff --git a/drivers/media/platform/davinci/vpif.c
b/drivers/media/platform/davinci/vpif.c index 761c825..164c1b7 100644
--- a/drivers/media/platform/davinci/vpif.c
+++ b/drivers/media/platform/davinci/vpif.c

[...]

@@ -421,23 +419,12 @@ EXPORT_SYMBOL(vpif_channel_getfid);

  static int vpif_probe(struct platform_device *pdev)
  {
-   int status = 0;
+   static struct resource  *res;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res)
-   return -ENOENT;
-
-   res_len = resource_size(res);
-
-   res = request_mem_region(res-start, res_len, res-name);
-   if (!res)
-   return -EBUSY;
-
-   vpif_base = ioremap(res-start, res_len);
-   if (!vpif_base) {
-   status = -EBUSY;
-   goto fail;
-   }
+   vpif_base = devm_ioremap_resource(pdev-dev, res);
+   if (IS_ERR(vpif_base))
+   return PTR_ERR(vpif_base);



You're loosing the request_mem_region().


   He's not losing anything, first look at how devm_ioremp_resource() 
is defined.



You should use devm_request_and_ioremap()


Already deprecated by now.


function instead of devm_ioremap_resource(). With
that change,



Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 2/9] media: davinci: vpif: Convert to devm_* api

2013-05-26 Thread Sergei Shtylyov

Hello.

On 26-05-2013 16:00, Prabhakar Lad wrote:


From: Lad, Prabhakar prabhakar.cse...@gmail.com



Use devm_ioremap_resource instead of reques_mem_region()/ioremap().
This ensures more consistent error values and simplifies error paths.



Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
---
  drivers/media/platform/davinci/vpif.c |   27 ---
  1 files changed, 4 insertions(+), 23 deletions(-)



diff --git a/drivers/media/platform/davinci/vpif.c 
b/drivers/media/platform/davinci/vpif.c
index 761c825..f857d8f 100644
--- a/drivers/media/platform/davinci/vpif.c
+++ b/drivers/media/platform/davinci/vpif.c

[...]

@@ -421,23 +419,12 @@ EXPORT_SYMBOL(vpif_channel_getfid);

  static int vpif_probe(struct platform_device *pdev)
  {
-   int status = 0;
+   static struct resource  *res;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

[...]

+   vpif_base = devm_request_and_ioremap(pdev-dev, res);


   No, don't use this deprecated funtion please. Undo to 
devm_ioremap_resource().



+   if (IS_ERR(vpif_base))


NAK, devm_request_and_ioremap() doesn't rethrn error cpdes, only 
NULL. BTW, it's implemented via a call to devm_ioremap_resource() now.

Is it so hard to look at the code that you've calling?


+   return PTR_ERR(vpif_base);


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 4/9] media: davinci: vpif_capture: move the freeing of irq and global variables to remove()

2013-05-26 Thread Sergei Shtylyov

Hello.

On 26-05-2013 16:00, Prabhakar Lad wrote:


From: Lad, Prabhakar prabhakar.cse...@gmail.com



Ideally the freeing of irq's and the global variables needs to be
done in the remove() rather than module_exit(), this patch moves
the freeing up of irq's and freeing the memory allocated to channel
objects to remove() callback of struct platform_driver.



Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
---
  drivers/media/platform/davinci/vpif_capture.c |   31 ++--
  1 files changed, 13 insertions(+), 18 deletions(-)



diff --git a/drivers/media/platform/davinci/vpif_capture.c 
b/drivers/media/platform/davinci/vpif_capture.c
index caaf4fe..f8b7304 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -2225,17 +2225,29 @@ vpif_int_err:
   */
  static int vpif_remove(struct platform_device *device)
  {
-   int i;
+   struct platform_device *pdev;
struct channel_obj *ch;
+   struct resource *res;
+   int irq_num, i = 0;
+
+   pdev = container_of(vpif_dev, struct platform_device, dev);


   Why you need this if you should be already called with the correct 
platform device?


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Patch v1] skbuff: Hide GFP_ATOMIC page allocation failures for dropped packets

2013-05-26 Thread Sergei Shtylyov

Hello.

On 26-05-2013 17:17, atom...@redhat.com wrote:


From: Aaron Tomlin atom...@redhat.com



Failed GFP_ATOMIC allocations by the network stack result in dropped
packets, which will be received on a subsequent retransmit, and an
unnecessary, noisy warning with a kernel backtrace.



These warnings are harmless, but they still cause users to panic and
file bug reports over dropped packets. It would be better to hide the
failed allocation warnings and backtraces, and let retransmits handle
dropped packets quietly.



Signed-off-by: Aaron Tomlin atom...@redhat.com
---
  net/core/skbuff.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index af9185d..02139d6 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -236,7 +236,7 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t 
gfp_mask,
? skbuff_fclone_cache : skbuff_head_cache;

if (sk_memalloc_socks()  (flags  SKB_ALLOC_RX))
-   gfp_mask |= __GFP_MEMALLOC;
+   gfp_mask |= (__GFP_MEMALLOC|__GFP_NOWARN);


   Parens not needed here.

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once

2013-05-27 Thread Sergei Shtylyov

Hello.

On 27-05-2013 0:35, Aaro Koskinen wrote:


When booting a new board for the first time, the console is flooded with
Unknown board messages. This is not really helpful. Board type is not
going to change after the boot, so it's sufficient to print the warning
only once.



Signed-off-by: Aaro Koskinen aaro.koski...@iki.fi
---
  arch/mips/cavium-octeon/executive/cvmx-helper-board.c |5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)



diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c 
b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
index 7c64977..e0451a0 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c

[...]

@@ -184,8 +186,7 @@ int cvmx_helper_board_get_mii_address(int ipd_port)
}

/* Some unknown board. Somebody forgot to update this function... */
-   cvmx_dprintf
-   (cvmx_helper_board_get_mii_address: Unknown board type %d\n,
+   pr_warn_once(%s: Unknown board type %d\n, __func__,
 cvmx_sysinfo_get()-board_type);


   Please align this line under the next char under (.

WVR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v8, part3 12/14] mm: correctly update zone-mamaged_pages

2013-05-27 Thread Sergei Shtylyov

On 26-05-2013 17:38, Jiang Liu wrote:

   Typo in the subject: s/mamaged_pages/managed_pages/.


Enhance adjust_managed_page_count() to adjust totalhigh_pages for
highmem pages. And change code which directly adjusts totalram_pages
to use adjust_managed_page_count() because it adjusts totalram_pages,
totalhigh_pages and zone-managed_pages altogether in a safe way.



Remove inc_totalhigh_pages() and dec_totalhigh_pages() from xen/balloon
driver bacause adjust_managed_page_count() has already adjusted
totalhigh_pages.



This patch also fixes two bugs:
1) enhances virtio_balloon driver to adjust totalhigh_pages when
reserve/unreserve pages.
2) enhance memory_hotplug.c to adjust totalhigh_pages when hot-removing
memory.



We still need to deal with modifications of totalram_pages in file
arch/powerpc/platforms/pseries/cmm.c, but need help from PPC experts.



Signed-off-by: Jiang Liu jiang@huawei.com
Cc: Chris Metcalf cmetc...@tilera.com
Cc: Rusty Russell ru...@rustcorp.com.au
Cc: Michael S. Tsirkin m...@redhat.com
Cc: Konrad Rzeszutek Wilk konrad.w...@oracle.com
Cc: Jeremy Fitzhardinge jer...@goop.org
Cc: Wen Congyang we...@cn.fujitsu.com
Cc: Andrew Morton a...@linux-foundation.org
Cc: Tang Chen tangc...@cn.fujitsu.com
Cc: Yasuaki Ishimatsu isimatu.yasu...@jp.fujitsu.com
Cc: Mel Gorman mgor...@suse.de
Cc: Minchan Kim minc...@kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: virtualizat...@lists.linux-foundation.org
Cc: xen-de...@lists.xensource.com
Cc: linux...@kvack.org
---
  drivers/virtio/virtio_balloon.c |  8 +---
  drivers/xen/balloon.c   | 23 +--
  mm/hugetlb.c|  2 +-
  mm/memory_hotplug.c | 16 +++-
  mm/page_alloc.c | 10 +-
  5 files changed, 19 insertions(+), 40 deletions(-)



diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index bd3ae32..6649968 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c

[...]

@@ -160,11 +160,13 @@ static void fill_balloon(struct virtio_balloon *vb, 
size_t num)
  static void release_pages_by_pfn(const u32 pfns[], unsigned int num)
  {
unsigned int i;
+   struct page *page;


   Why not declare it right in the *for* loop? You could use intializer 
then...




/* Find pfns pointing at start of each page, get pages and free them. */
for (i = 0; i  num; i += VIRTIO_BALLOON_PAGES_PER_PAGE) {
-   balloon_page_free(balloon_pfn_to_page(pfns[i]));
-   totalram_pages++;
+   page = balloon_pfn_to_page(pfns[i]);
+   balloon_page_free(page);
+   adjust_managed_page_count(page, 1);
}
  }


[...]

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] USB: hcd: only unmap the actual completed DMA buffer

2013-05-27 Thread Sergei Shtylyov

Hello.

On 27-05-2013 20:13, Ming Lei wrote:


This patch only unmap the actual completed DMA buffer instead of
the whole transfer buffer.


Who will unmap the rest of the buffer?


It is common to see only part of DMA transfer is completed, especially
in case of DMA_FROM_DEVICE because the length of incoming traffic often
is unknown before submitting URB, so this patch may improve USB
DMA unmapping which runs in hard irq context.



The patch has been tested on ARMv7(Pandaboard), and it is observed that
at average ~25us is saved about ehci interrupt handling on below usbnet
test case:



- Pandaboard: IP address is IP_A
- on one x86 box, run below command:
#ping -f -s 1472 IP_A
- compute ehci interrupt handling time on Pandaboard during ping
  test


   This seems just crazy to me. What has been mapped, should be unmapped.


Cc: Alan Stern st...@rowland.harvard.edu
Signed-off-by: Ming Lei ming@canonical.com
---
  drivers/usb/core/hcd.c |4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)


WBR, Sergei


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once

2013-05-27 Thread Sergei Shtylyov

On 27-05-2013 14:19, Sergei Shtylyov wrote:


When booting a new board for the first time, the console is flooded with
Unknown board messages. This is not really helpful. Board type is not
going to change after the boot, so it's sufficient to print the warning
only once.



Signed-off-by: Aaro Koskinen aaro.koski...@iki.fi
---
  arch/mips/cavium-octeon/executive/cvmx-helper-board.c |5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)



diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
index 7c64977..e0451a0 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c

[...]

@@ -184,8 +186,7 @@ int cvmx_helper_board_get_mii_address(int ipd_port)
  }

  /* Some unknown board. Somebody forgot to update this
function... */
-cvmx_dprintf
-(cvmx_helper_board_get_mii_address: Unknown board type %d\n,
+pr_warn_once(%s: Unknown board type %d\n, __func__,
   cvmx_sysinfo_get()-board_type);



Please align this line under the next char under (.


s/under (/after (/, of course.

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Patch v1] skbuff: Hide GFP_ATOMIC page allocation failures for dropped packets

2013-05-27 Thread Sergei Shtylyov

Hello.

On 26-05-2013 20:28, Sergei Shtylyov wrote:


From: Aaron Tomlin atom...@redhat.com



Failed GFP_ATOMIC allocations by the network stack result in dropped
packets, which will be received on a subsequent retransmit, and an
unnecessary, noisy warning with a kernel backtrace.



These warnings are harmless, but they still cause users to panic and
file bug reports over dropped packets. It would be better to hide the
failed allocation warnings and backtraces, and let retransmits handle
dropped packets quietly.



Signed-off-by: Aaron Tomlin atom...@redhat.com
---
  net/core/skbuff.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index af9185d..02139d6 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -236,7 +236,7 @@ struct sk_buff *__alloc_skb(unsigned int size,
gfp_t gfp_mask,
  ? skbuff_fclone_cache : skbuff_head_cache;

  if (sk_memalloc_socks()  (flags  SKB_ALLOC_RX))
-gfp_mask |= __GFP_MEMALLOC;
+gfp_mask |= (__GFP_MEMALLOC|__GFP_NOWARN);



Parens not needed here.


   And add spaces around | please, to be consistent with other code.

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Patch v2] skbuff: Hide GFP_ATOMIC page allocation failures for dropped packets

2013-05-27 Thread Sergei Shtylyov

Hello.

On 27-05-2013 0:19, atom...@redhat.com wrote:


From: Aaron Tomlin atom...@redhat.com



Since v1:
  - Removed unnecessary parentheses


   The changes since version X section should typically go after --- 
tearline, else the mainatiner will have to edit your patch before applying.



---8---



Failed GFP_ATOMIC allocations by the network stack result in dropped
packets, which will be received on a subsequent retransmit, and an
unnecessary, noisy warning with a kernel backtrace.



These warnings are harmless, but they still cause users to panic and
file bug reports over dropped packets. It would be better to hide the
failed allocation warnings and backtraces, and let retransmits handle
dropped packets quietly.



Signed-off-by: Aaron Tomlin atom...@redhat.com


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] usb: omap2430: fix memleak in err case

2013-05-28 Thread Sergei Shtylyov

Hello.

On 22-05-2013 7:30, Libo Chen wrote:


when omap_get_control_dev faild, we should release related platform_device



* Changelog from v1:
* fix spell: s/fail/fails/, s/relational/related/ , thank Sergei 
sergei.shtyl...@cogentembedded.com


   It seems you've actually replaced fail with faild, not fails.


Signed-off-by: Libo Chen libo.c...@huawei.com
---
  drivers/usb/musb/omap2430.c |3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] net/core/sock.c: add missing VSOCK string in af_family_*_key_strings

2013-05-28 Thread Sergei Shtylyov

Hello.

On 28-05-2013 19:02, Federico Vaga wrote:


The three arrays of strings: af_family_kay_strings,


   s/kay/key/. Maybe whoever applies this could fix the typo...


af_family_slock_key_strings and af_family_clock_key_strings have not
VSOCK's string



Signed-off-by: Federico Vaga federico.v...@gmail.com


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 02/12] clocksource: sh_mtu2: Add clk_prepare/unprepare support

2013-10-29 Thread Sergei Shtylyov

Hello.

On 29-10-2013 2:49, Laurent Pinchart wrote:


Prepare the clock at probe time, as there is no other appropriate place
in the driver where we're allowed to sleep.



Cc: Daniel Lezcano daniel.lezc...@linaro.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Laurent Pinchart laurent.pinchart+rene...@ideasonboard.com
---
  drivers/clocksource/sh_mtu2.c | 16 ++--
  1 file changed, 14 insertions(+), 2 deletions(-)



diff --git a/drivers/clocksource/sh_mtu2.c b/drivers/clocksource/sh_mtu2.c
index 4aac9ee..3cf1283 100644
--- a/drivers/clocksource/sh_mtu2.c
+++ b/drivers/clocksource/sh_mtu2.c
@@ -313,8 +313,20 @@ static int sh_mtu2_setup(struct sh_mtu2_priv *p, struct 
platform_device *pdev)
goto err1;
}

-   return sh_mtu2_register(p, (char *)dev_name(p-pdev-dev),
-   cfg-clockevent_rating);
+   ret = clk_prepare(p-clk);
+   if (ret  0)
+   goto err2;
+
+   ret = sh_mtu2_register(p, (char *)dev_name(p-pdev-dev),
+  cfg-clockevent_rating);
+   if (ret  0)
+   goto err3;
+
+   return 0;
+ err3:
+   clk_unprepare(p-clk);
+ err2:
+   clk_put(p-clk);


   This one seems to be a fix and so needs to be in a separate patch...

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 03/12] clocksource: sh_tmu: Add clk_prepare/unprepare support

2013-10-29 Thread Sergei Shtylyov

On 29-10-2013 2:49, Laurent Pinchart wrote:


Prepare the clock at probe time, as there is no other appropriate place
in the driver where we're allowed to sleep.



Cc: Daniel Lezcano daniel.lezc...@linaro.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Laurent Pinchart laurent.pinchart+rene...@ideasonboard.com
---
  drivers/clocksource/sh_tmu.c | 20 +---
  1 file changed, 17 insertions(+), 3 deletions(-)



diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c
index 78b8dae..63557cd 100644
--- a/drivers/clocksource/sh_tmu.c
+++ b/drivers/clocksource/sh_tmu.c
@@ -472,12 +472,26 @@ static int sh_tmu_setup(struct sh_tmu_priv *p, struct 
platform_device *pdev)
ret = PTR_ERR(p-clk);
goto err1;
}
+
+   ret = clk_prepare(p-clk);
+   if (ret  0)
+   goto err2;
+
p-cs_enabled = false;
p-enable_count = 0;

-   return sh_tmu_register(p, (char *)dev_name(p-pdev-dev),
-  cfg-clockevent_rating,
-  cfg-clocksource_rating);
+   ret = sh_tmu_register(p, (char *)dev_name(p-pdev-dev),
+ cfg-clockevent_rating,
+ cfg-clocksource_rating);
+   if (ret  0)
+   goto err3;
+
+   return 0;
+
+ err3:
+   clk_unprepare(p-clk);
+ err2:
+   clk_put(p-clk);


   This one seems to be a fix, and should be done separately.

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers/net: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO

2013-11-01 Thread Sergei Shtylyov

Hello.

On 01-11-2013 14:00, Duan Jiong wrote:


This patch fixes coccinelle error regarding usage of IS_ERR and
PTR_ERR instead of PTR_ERR_OR_ZERO.



Signed-off-by: Duan Jiong duanj.f...@cn.fujitsu.com
---
  drivers/net/appletalk/ipddp.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)



diff --git a/drivers/net/appletalk/ipddp.c b/drivers/net/appletalk/ipddp.c
index 10d0dba..78f06cb 100644
--- a/drivers/net/appletalk/ipddp.c
+++ b/drivers/net/appletalk/ipddp.c
@@ -312,9 +312,7 @@ module_param(ipddp_mode, int, 0);
  static int __init ipddp_init_module(void)
  {
dev_ipddp = ipddp_init();
-if (IS_ERR(dev_ipddp))
-return PTR_ERR(dev_ipddp);
-   return 0;
+return PTR_ERR_OR_ZERO(dev_ipddp);


   Indent with a tab, please.

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 9/9] ARM: dts: add usb udc support to bcm281xx

2013-11-01 Thread Sergei Shtylyov

Hello.

On 11/01/2013 10:45 PM, Matt Porter wrote:


Adds USB OTG/PHY and clock support to BCM281xx and enables
UDC support on the bcm11351-brt and bcm28155-ap boards.



Signed-off-by: Matt Porter matt.por...@linaro.org
Reviewed-by: Markus Mayer markus.ma...@linaro.org
Reviewed-by: Tim Kryger tim.kry...@linaro.org
---
  arch/arm/boot/dts/bcm11351-brt.dts |  6 ++
  arch/arm/boot/dts/bcm11351.dtsi| 18 ++
  arch/arm/boot/dts/bcm28155-ap.dts  |  8 
  3 files changed, 32 insertions(+)


[...]

diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi
index 0755f43..247f9fd 100644
--- a/arch/arm/boot/dts/bcm11351.dtsi
+++ b/arch/arm/boot/dts/bcm11351.dtsi
@@ -284,4 +284,22 @@
#clock-cells = 0;
};
};
+
+   usbotg: usbotg@3f12 {


   According to ePAPR spec [1], the node name should be usb@3f12.



+   compatible = snps,dwc2;
+   reg = 0x3f12 0x1;
+   interrupts = GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH;
+   clocks = usb_otg_ahb_clk;
+   clock-names = otg;
+   phys = usbphy;
+   phy-names = usb2-phy;
+   status = disabled;
+   };
+
+   usbphy: usbphy@3f13 {


   This one should probably be named usb-phy@3f13, just like 
ethernet-phy from the ePAPR spec.



+   compatible = brcm,kona-usb2-phy;
+   reg = 0x3f13 0x28;
+   #phy-cells = 0;
+   status = disabled;
+   };
  };


[1] http://www.power.org/resources/downloads/Power_ePAPR_APPROVED_v1.0.pdf

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] davinci_emac.c: Fix IFF_ALLMULTI setup

2013-10-21 Thread Sergei Shtylyov

Hello.

On 10/21/2013 08:59 PM, Mariusz Ceier wrote:


When IFF_ALLMULTI flag is set on interface and IFF_PROMISC isn't,
emac_dev_mcast_set should only enable RX of multicasts and reset
MACHASH registers.



It does this, but afterwards it either sets up multicast MACs
filtering or disables RX of multicasts and resets MACHASH registers
again, rendering IFF_ALLMULTI flag useless.



This patch fixes emac_dev_mcast_set, so that multicast MACs filtering and
disabling of RX of multicasts are skipped when IFF_ALLMULTI flag is set.



Tested with kernel 2.6.37.



Signed-off-by: Mariusz Ceier mceier+ker...@gmail.com
---
  drivers/net/ethernet/ti/davinci_emac.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/drivers/net/ethernet/ti/davinci_emac.c 
b/drivers/net/ethernet/ti/davinci_emac.c
index 67df09e..ff3bf0e 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -876,7 +876,7 @@ static void emac_dev_mcast_set(struct net_device *ndev)
netdev_mc_count(ndev)  EMAC_DEF_MAX_MULTICAST_ADDRESSES) {
mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST);
emac_add_mcast(priv, EMAC_ALL_MULTI_SET, NULL);
-   }
+   } else
if (!netdev_mc_empty(ndev)) {


   It should be:

} else if (!netdev_mc_empty(ndev)) {

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] ARM: dts: am4372: Add McASP nodes

2013-10-21 Thread Sergei Shtylyov

Hello.

On 10/21/2013 01:45 PM, Peter Ujfalusi wrote:


Add nodes for McASP0 and McASP1 for AM43xx.



Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
  arch/arm/boot/dts/am4372.dtsi | 27 +++
  1 file changed, 27 insertions(+)



diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
index c328d5c..defaad1 100644
--- a/arch/arm/boot/dts/am4372.dtsi
+++ b/arch/arm/boot/dts/am4372.dtsi
@@ -633,5 +633,32 @@
dma-names = tx, rx;
};

+   mcasp0: mcasp@48038000 {


   According to ePAPR spec [1], the name of a node should be somewhat 
generic, reflecting the function of the device and not its

precise programming model. In this case probably sound?

[1] http://www.power.org/resources/downloads/Power_ePAPR_APPROVED_v1.0.pdf

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] rcar-hpbdma: remove shdma_free_irq() calls

2013-10-09 Thread Sergei Shtylyov

Hello.

On 03-10-2013 6:00, Simon Horman wrote:


Commit c1c63a14f4f2419d093acd7164eccdff315baa86 (DMA: shdma: switch to managed
resource allocation) got rid of shdma_free_irq() but  unfortunately got merged
later than commit c4f6c41ba790bbbfcebb4c47a709ac8ff1fe1af9 (dma: add driver for
R-Car HPB-DMAC), so that the HPB-DMAC driver retained the calls and got broken:



drivers/dma/sh/rcar-hpbdma.c: In function `hpb_dmae_alloc_chan_resources':
drivers/dma/sh/rcar-hpbdma.c:435: error: implicit declaration of function
`shdma_free_irq'



Fix this compilation error by removing the remaining shdma_free_irq() calls.



Tested-by: Simon Horman horms+rene...@verge.net.au



Reported-by: Simon Horman ho...@verge.net.au
Signed-off-by: Sergei Shtylyov sergei.shtyl...@cogentembedded.com



Vinod, could you consider taking this and the following patch
as a fix for v3.12?


   Vinod, may I ask when these regression (induced by you) fixes gets merged?

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC 17/42] drivers/net/ethernet/renesas: don't check resource with devm_ioremap_resource

2013-05-10 Thread Sergei Shtylyov

Hello.

On 10-05-2013 12:17, Wolfram Sang wrote:


devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.



Signed-off-by: Wolfram Sang w...@the-dreams.de


Acked-by: Sergei Shtylyov sergei.shtyl...@cogentembedded.com

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 4/4] net: phy: realtek: cleanup code

2013-05-10 Thread Sergei Shtylyov

Hello.

On 10-05-2013 11:29, Jongsung Kim wrote:


This patch cleans up the drivers code by:



- using a consistent way to reference functions
- removing unused macro-definitions
- removing unnecessary new-lines
- making ack_interrupt functions shorter.



Signed-off-by: Jongsung Kim neidhard@lge.com
---
  drivers/net/phy/realtek.c |   29 ++---
  1 files changed, 10 insertions(+), 19 deletions(-)



diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
index 6f0726a..fd09844 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c

[...]

@@ -112,8 +103,8 @@ static struct phy_driver realtek_drv[] = {
.read_status= genphy_read_status,
.ack_interrupt  = rtl8201f_ack_interrupt,
.config_intr= rtl8201f_config_intr,
-   .suspend= genphy_suspend,
-   .resume = genphy_resume,
+   .suspend= genphy_suspend,
+   .resume = genphy_resume,


   Contrariwise, you should have dropped  from the other functions. 
It's completely superfluous.


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 08/10] usb: phy: tegra: Add error handling clean up.

2013-05-10 Thread Sergei Shtylyov

Hello.

On 05/10/2013 05:54 PM, Venu Byravarasu wrote:


Check return values from all GPIO APIs and handle errors accordingly.

Remove the call to clk_disable_unprepare(); this function does not
prepare or enable the clock, so the error path should not disable or
unprepare it.

Signed-off-by: Venu Byravarasu vbyravar...@nvidia.com

[...]

diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c
index a2a89a9..dce692a 100644
--- a/drivers/usb/phy/phy-tegra-usb.c
+++ b/drivers/usb/phy/phy-tegra-usb.c

[...]

@@ -624,24 +632,44 @@ static inttegra_phy_init(struct usb_phy *x)

[...]

phy-ulpi = otg_ulpi_create(ulpi_viewport_access_ops, 0);
+   if (!phy-ulpi) {
+   dev_err(phy-dev, otg_ulpi_create returned err\n);


   Rather returned NULL.

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] IDE: bugfix of IDE PIO size calculation

2013-05-10 Thread Sergei Shtylyov

Hello.

On 05/10/2013 10:47 PM, Leonid Yegoshin wrote:


IDE PIO calculates size wrong.
Proven by test on MIPS Malta platform with multiple CPU types
with bootparam flag ide-core.nodma=0.0.

It is still needed to test non-DMA IO.

Change-Id: Id82c2bc5965d85960846db53d84846d9a05d75a3


   Please get rid of this line.


Author: Leonid Yegoshin yegos...@mips.com


From: line at the start of message is used for that.


Signed-off-by: Leonid Yegoshin leonid.yegos...@imgtec.com
(imported from commit 43cee988ce0aa8d2ca1eec014d25f014e95eefe6)
(imported from commit d74805b8b12cada05df811e112eb7e3ec197d565)


What are those two lines? Why are they here, in upstream patch?

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] igb: add a method to get the nic hw time stamping policy

2013-05-11 Thread Sergei Shtylyov

Hello.

On 11-05-2013 18:02, Dong Zhu wrote:


 From e6a55411486de8a09b859e73140bf35c0ee36047 Mon Sep 17 00:00:00 2001
From: Dong Zhu bluezhud...@gmail.com
Date: Sat, 11 May 2013 21:44:54 +0800
Subject: [PATCH] igb: add a method to get the nic hw time stamping policy


   Please, don't send this header with your patches.


Currently kernel only support setting the hw time stamping policy
through ioctl,now add a method to check which packets(Outgoing and
Incoming) are time stamped by nic.



Signed-off-by: Dong Zhu bluezhud...@gmail.com
---
  drivers/net/ethernet/intel/igb/igb_ptp.c | 29 +
  include/uapi/linux/net_tstamp.h  |  4 +++-
  2 files changed, 32 insertions(+), 1 deletion(-)



diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c 
b/drivers/net/ethernet/intel/igb/igb_ptp.c
index 7e8c477..8c06346 100644
--- a/drivers/net/ethernet/intel/igb/igb_ptp.c
+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
@@ -577,6 +577,34 @@ int igb_ptp_hwtstamp_ioctl(struct net_device *netdev,
if (config.flags)
return -EINVAL;

+   if (config.rw == 0)
+   goto set_policy;
+   else if (config.rw == 1) {


   Both arms of the *if* statement should have {} if one does, 
according to Documentation/CodingStyle.



+   if (config.tx_type || config.rx_filter)
+   return -EINVAL;
+
+   regval = rd32(E1000_TSYNCTXCTL);
+


   Empty line not needed here.


+   if (regval  E1000_TSYNCTXCTL_ENABLED)
+   config.tx_type = HWTSTAMP_TX_ON;
+   else
+   config.tx_type = HWTSTAMP_TX_OFF;
+
+   regval = rd32(E1000_TSYNCRXCTL);
+


   ... and here.


+   if (!(regval  E1000_TSYNCRXCTL_ENABLED))
+   config.rx_filter = HWTSTAMP_FILTER_NONE;
+   else if (E1000_TSYNCRXCTL_TYPE_ALL ==
+   (regval  E1000_TSYNCRXCTL_TYPE_MASK))
+   config.rx_filter = HWTSTAMP_FILTER_ALL;
+   else
+   return -ERANGE;
+
+   goto end;
+   } else
+   return -EINVAL;


   Same comment about missing {}. This *if*, however, asks to be 
converted to *switch*...



diff --git a/include/uapi/linux/net_tstamp.h b/include/uapi/linux/net_tstamp.h
index ae5df12..77147da 100644
--- a/include/uapi/linux/net_tstamp.h
+++ b/include/uapi/linux/net_tstamp.h
@@ -28,9 +28,10 @@ enum {
  /**
   * struct hwtstamp_config - %SIOCSHWTSTAMP parameter
   *
+ * @rw:0/1 represents set/get the hw time stamp policy
   * @flags:no flags defined right now, must be zero
   * @tx_type:  one of HWTSTAMP_TX_*
- * @rx_type:   one of one of HWTSTAMP_FILTER_*
+ * @rx_filter: one of one of HWTSTAMP_FILTER_*


   You don't mention this change in the changelog. Most probably it 
should be in a separate patch.



@@ -39,6 +40,7 @@ enum {
  * 32 and 64 bit systems, don't break this!
  */
 struct hwtstamp_config {
+   int rw;


   Why not 'bool'?

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v6, part3 15/16] mm: report available pages as MemTotal for each NUMA node

2013-05-11 Thread Sergei Shtylyov

Hello.

On 05/11/2013 09:34 PM, Jiang Liu wrote:

   I've noticed a small typo in the changelog.


As reported by https://bugzilla.kernel.org/show_bug.cgi?id=53501,
MemTotal from /proc/meminfo means memory pages managed by the buddy
system (managed_pages), but MemTotal from /sys/.../node/nodex/meminfo
means phsical pages present (present_pages) within the NUMA node.


s/phsical/physical/


There's a difference between managed_pages and present_pages due to
bootmem allocator and reserved pages.

And Documentation/filesystems/proc.txt says
 MemTotal: Total usable ram (i.e. physical ram minus a few reserved
   bits and the kernel binary code)

So change /sys/.../node/nodex/meminfo to report available pages within
the node as MemTotal.

Signed-off-by: Jiang Liu jiang@huawei.com
Reported-by: sworddrag...@aol.com
Cc: Andrew Morton a...@linux-foundation.org
Cc: Mel Gorman mgor...@suse.de
Cc: Minchan Kim minc...@kernel.org
Cc: linux...@kvack.org
Cc: linux-kernel@vger.kernel.org


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC 17/42] drivers/net/ethernet/renesas: don't check resource with devm_ioremap_resource

2013-05-11 Thread Sergei Shtylyov

Hello.

On 05/10/2013 03:07 PM, Sergei Shtylyov wrote:



devm_ioremap_resource does sanity checks on the given resource. No 
need to

duplicate this in the driver.



Signed-off-by: Wolfram Sang w...@the-dreams.de


Acked-by: Sergei Shtylyov sergei.shtyl...@cogentembedded.com


I was too fast, I'm now withdawing my ACK.


WBR, Sergei



WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC 17/42] drivers/net/ethernet/renesas: don't check resource with devm_ioremap_resource

2013-05-11 Thread Sergei Shtylyov

Hello.

On 05/10/2013 12:17 PM, Wolfram Sang wrote:


devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.

Signed-off-by: Wolfram Sang w...@the-dreams.de
---
  drivers/net/ethernet/renesas/sh_eth.c |   14 +-
  1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c 
b/drivers/net/ethernet/renesas/sh_eth.c
index 33dc6f2..6175839 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -2661,14 +2661,6 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
struct sh_eth_private *mdp = NULL;
struct sh_eth_plat_data *pd = pdev-dev.platform_data;
  
-	/* get base addr */

-   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (unlikely(res == NULL)) {
-   dev_err(pdev-dev, invalid resource\n);
-   ret = -EINVAL;
-   goto out;
-   }
-
ndev = alloc_etherdev(sizeof(struct sh_eth_private));
if (!ndev) {
ret = -ENOMEM;


There's ndev-base_addr = res-start; below this which you broke. NAK.
You should really compile-test your patches.

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC 17/42] drivers/net/ethernet/renesas: don't check resource with devm_ioremap_resource

2013-05-12 Thread Sergei Shtylyov

Hello.

On 12-05-2013 13:42, Wolfram Sang wrote:


You should really compile-test your patches.



Easier said than done with a cleanup series touching various platforms
and architectures. If there are already solutions how to find a .config
compiling the source file modified, I am all ears.


   You can always try to do:

$ make drivers/net/ethernet/renesas/sh_eth.o

with a .config file you have. It will compile a file regardless of 
whether it's enabled in your .config or not...



That being said, the actual mistake I did was embarassing, I agree. I am
sorry for that and will improve. And, doing things means doing mistakes,
too.


   Be more attentive in the future please. :-)


Regards,



Wolfram


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


<    2   3   4   5   6   7   8   9   10   11   >