[PATCH v1] arm64: fix bug for reloading FPSIMD state after cpu power off

2014-08-30 Thread Leo Yan
Now arm64 defers reloading FPSIMD state, but this optimization also
introduces the bug after cpu resume back from low power mode.

The reason is after the cpu has been powered off, s/w need set the
cpu's fpsimd_last_state to NULL so that it will force to reload
FPSIMD state for the thread, otherwise there has the chance to meet
the condition for both the task's fpsimd_state.cpu field contains the
id of the current cpu, and the cpu's fpsimd_last_state per-cpu variable
points to the task's fpsimd_state, so finally kernel will skip to reload
the context during it return back to userland.

Furthermore, this patch also removes the redundant operation for saving
the state for idle thread; this operation is needless due kernel's idle
thread will not use any VFP/NEON instruction. so that this also can
benefit a bit for the latency during cpu's power off.

Signed-off-by: Leo Yan 
---
 arch/arm64/kernel/fpsimd.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index ad8aebb..4caef93 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -268,13 +268,9 @@ static int fpsimd_cpu_pm_notifier(struct notifier_block 
*self,
 {
switch (cmd) {
case CPU_PM_ENTER:
-   if (current->mm && !test_thread_flag(TIF_FOREIGN_FPSTATE))
-   fpsimd_save_state(>thread.fpsimd_state);
+   this_cpu_write(fpsimd_last_state, NULL);
break;
case CPU_PM_EXIT:
-   if (current->mm)
-   set_thread_flag(TIF_FOREIGN_FPSTATE);
-   break;
case CPU_PM_ENTER_FAILED:
default:
return NOTIFY_DONE;
-- 
1.9.1

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


[PATCH] Staging: bcm: fixed a comment coding style issue

2014-08-30 Thread Anh Le
Fixed a C99 comment issue in InterfaceMisc.h.

Signed-off-by: Anh Le 
---
 drivers/staging/bcm/InterfaceMisc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/bcm/InterfaceMisc.h 
b/drivers/staging/bcm/InterfaceMisc.h
index efb6860..0e5e38b 100644
--- a/drivers/staging/bcm/InterfaceMisc.h
+++ b/drivers/staging/bcm/InterfaceMisc.h
@@ -39,4 +39,4 @@ VOID Bcm_kill_all_URBs(struct bcm_interface_adapter 
*psIntfAdapter);
 
 #define DISABLE_USB_ZERO_LEN_INT 0x0F011878
 
-#endif // __INTERFACE_MISC_H
+#endif /* __INTERFACE_MISC_H */
-- 
1.8.5.5

--
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: randconfig build error with next-20140829, in drivers/media/usb/dvb-usb/technisat-usb2.c

2014-08-30 Thread Luis R. Rodriguez
On Fri, Aug 29, 2014 at 09:19:42AM -0700, Jim Davis wrote:
> Building with the attached random configuration file,
> 
>   LD  init/built-in.o
> drivers/built-in.o: In function `technisat_usb2_set_voltage':
> technisat-usb2.c:(.text+0x3b4919): undefined reference to `stv090x_set_gpio'
> make: *** [vmlinux] Error 1

This is because MEDIA_SUBDRV_AUTOSELECT is designed to let you
pick and choose, technically we should just have:

diff --git a/drivers/media/usb/dvb-usb/Kconfig 
b/drivers/media/usb/dvb-usb/Kconfig
index c5d9566..5a4e82e 100644
--- a/drivers/media/usb/dvb-usb/Kconfig
+++ b/drivers/media/usb/dvb-usb/Kconfig
@@ -313,7 +313,7 @@ config DVB_USB_AZ6027
 config DVB_USB_TECHNISAT_USB2
tristate "Technisat DVB-S/S2 USB2.0 support"
depends on DVB_USB
-   select DVB_STV090x if MEDIA_SUBDRV_AUTOSELECT
+   select DVB_STV090x
select DVB_STV6110x if MEDIA_SUBDRV_AUTOSELECT
help
  Say Y here to support the Technisat USB2 DVB-S/S2 device

and that would fix the issue you saw but then again if we do that
we might as well also do the same for DVB_STV6110x and a slew of
different Kconfig entries on that file.

Someone needs to make a judgement call and either fix all these
Kconfig entries or document that MEDIA_SUBDRV_AUTOSELECT will
let you shoot yourself in the foot at build time. Then what
I recommend in the meantime is simply to not trust randomconfig
builds unless you are always enabling MEDIA_SUBDRV_AUTOSELECT.

I think its fair to expect for 'make randomconfig' to give you
a configuration that lets you build things without issue so
I see this more of an issue with MEDIA_SUBDRV_AUTOSELECT and
this sloppy embedded craze.

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


[PATCHv2 3/4] staging:lustre:lnet: lib-md.c erase C99 // comments

2014-08-30 Thread Janet Liu
After changing the comments format, the other error disappears.
So silences two checkpatch errors:
  ERROR: do not use C99 // comments
  ERROR: trailing statements should be on next line

Signed-off-by: Janet Liu 
---
 drivers/staging/lustre/lnet/lnet/lib-md.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/lib-md.c 
b/drivers/staging/lustre/lnet/lnet/lib-md.c
index ca08703..5b9c93a 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-md.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-md.c
@@ -125,7 +125,7 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
 
if ((umd->options & LNET_MD_MAX_SIZE) != 0 && /* max size used 
*/
(umd->max_size < 0 ||
-umd->max_size > total_length)) // illegal max_size
+umd->max_size > total_length)) /* illegal max_size */
return -EINVAL;
 
} else if ((umd->options & LNET_MD_KIOV) != 0) {
@@ -146,7 +146,7 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
 
if ((umd->options & LNET_MD_MAX_SIZE) != 0 && /* max size used 
*/
(umd->max_size < 0 ||
-umd->max_size > total_length)) // illegal max_size
+umd->max_size > total_length)) /* illegal max_size */
return -EINVAL;
} else {   /* contiguous */
lmd->md_length = umd->length;
@@ -156,7 +156,7 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
 
if ((umd->options & LNET_MD_MAX_SIZE) != 0 && /* max size used 
*/
(umd->max_size < 0 ||
-umd->max_size > (int)umd->length)) // illegal max_size
+umd->max_size > (int)umd->length)) /* illegal max_size */
return -EINVAL;
}
 
-- 
1.7.9.5

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


[PATCHv2 1/4] staging:lustre:lnet: lib-md.c make line not over 80 characters

2014-08-30 Thread Janet Liu
Reduce the following checkpatch warnings:
  WARNING: line over 80 characters

Signed-off-by: Janet Liu 
---
 drivers/staging/lustre/lnet/lnet/lib-md.c |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/lib-md.c 
b/drivers/staging/lustre/lnet/lnet/lib-md.c
index 1f386e0..b52ca0f 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-md.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-md.c
@@ -52,7 +52,8 @@ lnet_md_unlink(lnet_libmd_t *md)
 
md->md_flags |= LNET_MD_FLAG_ZOMBIE;
 
-   /* Disassociate from ME (if any), and unlink it if it was 
created
+   /* Disassociate from ME (if any),
+* and unlink it if it was created
 * with LNET_UNLINK */
if (me != NULL) {
/* detach MD from portal */
@@ -113,7 +114,8 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
 
for (i = 0; i < (int)niov; i++) {
/* We take the base address on trust */
-   if (lmd->md_iov.iov[i].iov_len <= 0) /* invalid length 
*/
+   /* invalid length */
+   if (lmd->md_iov.iov[i].iov_len <= 0)
return -EINVAL;
 
total_length += lmd->md_iov.iov[i].iov_len;
@@ -206,7 +208,8 @@ lnet_md_deconstruct(lnet_libmd_t *lmd, lnet_md_t *umd)
 * and that's all.
 */
umd->start = lmd->md_start;
-   umd->length = ((lmd->md_options & (LNET_MD_IOVEC | LNET_MD_KIOV)) == 0) 
?
+   umd->length = ((lmd->md_options &
+   (LNET_MD_IOVEC | LNET_MD_KIOV)) == 0) ?
  lmd->md_length : lmd->md_niov;
umd->threshold = lmd->md_threshold;
umd->max_size = lmd->md_max_size;
-- 
1.7.9.5

--
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 PATCH] gpiolib: Provide and export gpiod_export_name

2014-08-30 Thread Alexandre Courbot
On Fri, Aug 29, 2014 at 10:37 AM, Guenter Roeck  wrote:
> On Fri, Aug 29, 2014 at 10:00:47AM -0700, Alexandre Courbot wrote:
>> On Thu, Aug 28, 2014 at 10:54 PM, Guenter Roeck  wrote:
>> > On 08/28/2014 10:44 PM, Linus Walleij wrote:
>> >>
>> >> On Mon, Aug 11, 2014 at 5:20 PM, Alexandre Courbot 
>> >> wrote:
>> >>>
>> >>> On Tue, Aug 12, 2014 at 12:15 AM, Guenter Roeck 
>> >>> wrote:
>> >>
>> >>
>>  This is just one of many patches which would make it possible to submit
>>  the rest, which would make use of it. What you are saying is that it
>>  won't
>>  make sense to submit that series into the kernel, because one of the
>>  very
>>  first patches needed to enable that won't be accepted. Kind of a
>>  circular
>>  argument, but I guess I'll have to live with it.
>> >>>
>> >>>
>> >>> Well I have not seen the other patches you mention and cannot guess
>> >>> their existence. If you send the full series it will of course be
>> >>> considered as such, but right now this lone patch does not hint any
>> >>> upstream user for this interface.
>> >>>
>> >>> Note that this doesn't change anything to the core of the argument ;
>> >>> we have not heard what Linus thinks about named GPIOs in
>> >>> /sys/class/gpio yet, maybe he will have a different opinion...
>> >>
>> >>
>> >> The sysfs is sort of broken by design because of things like this and
>> >> some other stuff.
>> >>
>> >> I think the sysfs is scary, for example since it's not hierarchical
>> >> but flat and build on the assumption that there is one single
>> >> GPIO numberspace. As pointed out in some other message
>> >> in the thread it would be nicer to have:
>> >>
>> >> /dev/gpiochip0/gpio0
>> >> /dev/gpiochip0/gpio1
>> >> 
>> >>
>> >> instead of the horrid sysfs ABI that will have to maintain forever.
>> >>
>> > Blocking any attempts to make it more useful doesn't help much, though.
>>
>> This patch is not making it more useful. It just introduces an
>> inferior way to do something that is already possible.
>>
>> I have stated it countless times already, but again:
>> "/sys/bus/.../device/gpio_function" is better than
>> "/sys/class/gpio/device_function_foo_whatnot" (and actually,
>> "/sys/bus/.../device/gpios/function" would be even better).
>>
>> You can already do the former. I just don't see the need to introduce
>> an API to do the latter.
>>
>> Why is the former better? Because it uses the sysfs hierarchy to make
>> the GPIO visible under their consumer's node. That's how sysfs is
>> intended to be used.
>>
>> Just explain me why you cannot live with this or why your proposal is
>> better, and my concerns about this patch will be lifted.
>>
>
> "device" is a platform driver and thus platform specific, which defeats
> the purpose of having a well defined path and makes it even more difficult
> to find a pin across multiple platform variants (which will have different
> platform drivers). It means user space will still need platform specific
> configuration data to find the pin. If user space needs such configuration
> data anyway, it may as well be a "" tuple instead of
> "". Even worse, in one of my use
> cases some of the platform drivers may have multiple instances with dynamic
> instance numbers, meaning I don't even have a well defined path to start with.
>
> On the other side, as it turns out, most of the gpio chips I deal with are
> company specific, and you can not prevent me from populating the 'names'
> array for those. It is a bit on the clumsy side, as I would prefer to have
> the consumer select the name instead of the provider, but it works. For the
> other drivers (so far only one) I only need an out-of-tree patch with a
> couple of lines of code to be able to populate the 'names' field. So unless
> you take the 'names' field away, which would break the existing ABI and is
> thus at least somewhat unlikely, I can still do what I need to do.

We won't take the names field away, as you mentioned we will have to
support the user-space ABI forever and ever. I hope that at some point
we will come with a better alternative, but the old one is here to
stay anyway. Linus and myself explained why this ABI is bad ; however,
it is also true that there is no better alternative besides
implementing a custom solution.

Which allows us to reduce the argument about your patch to: "it's a
more comfortable way of doing something bad". Since that something bad
is not going away, we might as well have another (arguably better) way
of doing it.

Also:
- This patch is limited to gpiolib-sysfs.c, so damage is contained there
- The patch is small
- I cannot help but notice that Linus did not scream about it
- I did not have a strong reject about it either, but was looking for
a better way to achieve the desired  result. Looks like there is none
at the moment.

So I'm somehow ok if this patch makes it in ; I still think we should
not encourage usage of this ABI, but you do not introduce any new
harmful toy - just provide 

Re: [PATCH] staging: netlogic: fixed checkpatch.pl styling warnings

2014-08-30 Thread Greg Kroah-Hartman
On Sun, Aug 31, 2014 at 03:16:48AM +0300, Ramon Fried wrote:
> This patch fixes the following checkpatch.pl warnings:
> 
> WARNING: Possible unnecessary 'out of memory' message
> #146: FILE: ./xlr_net.c:146:
> +   if (!skb) {
> +   pr_err("SKB allocation failed\n");
> 
> WARNING: Missing a blank line after declarations
> #1107: FILE: ./xlr_net.c:1107:
> +   struct xlr_net_priv *priv = platform_get_drvdata(pdev);
> +   unregister_netdev(priv->ndev);
> 
> Signed-off-by: Ramon Fried 

This is two different things, and as such, should be sent in 2 different
patches?

Also, you sent this to a lot of people, did they all really need it?

> ---
>  drivers/staging/netlogic/xlr_net.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/netlogic/xlr_net.c 
> b/drivers/staging/netlogic/xlr_net.c
> index 9bf407d..28a42831 100644
> --- a/drivers/staging/netlogic/xlr_net.c
> +++ b/drivers/staging/netlogic/xlr_net.c
> @@ -142,10 +142,8 @@ static inline struct sk_buff *xlr_alloc_skb(void)
>  
>   /* skb->data is cache aligned */
>   skb = alloc_skb(XLR_RX_BUF_SIZE, GFP_ATOMIC);
> - if (!skb) {
> - pr_err("SKB allocation failed\n");
> + if (!skb)
>   return NULL;
> - }
>   mac_put_skb_back_ptr(skb);
>   return skb;
>  }
> @@ -1104,6 +1102,7 @@ err_gmac:
>  static int xlr_net_remove(struct platform_device *pdev)
>  {
>   struct xlr_net_priv *priv = platform_get_drvdata(pdev);
> +
>   unregister_netdev(priv->ndev);
>   mdiobus_unregister(priv->mii_bus);
>   mdiobus_free(priv->mii_bus);

Finally, this patch doesn't apply at all to my tree, so even if I wanted
to apply it, I couldn't.  Please refresh it against the staging-next
branch of the staging.git tree on git.kernel.org, and if it is still
relevant (hint, half of it isn't), then redo it and resend.

thanks,

greg k-h
--
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/


[PATCH] staging: netlogic: fixed checkpatch.pl styling warnings

2014-08-30 Thread Ramon Fried
This patch fixes the following checkpatch.pl warnings:

WARNING: Possible unnecessary 'out of memory' message
#146: FILE: ./xlr_net.c:146:
+   if (!skb) {
+   pr_err("SKB allocation failed\n");

WARNING: Missing a blank line after declarations
#1107: FILE: ./xlr_net.c:1107:
+   struct xlr_net_priv *priv = platform_get_drvdata(pdev);
+   unregister_netdev(priv->ndev);

Signed-off-by: Ramon Fried 
---
 drivers/staging/netlogic/xlr_net.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/netlogic/xlr_net.c 
b/drivers/staging/netlogic/xlr_net.c
index 9bf407d..28a42831 100644
--- a/drivers/staging/netlogic/xlr_net.c
+++ b/drivers/staging/netlogic/xlr_net.c
@@ -142,10 +142,8 @@ static inline struct sk_buff *xlr_alloc_skb(void)
 
/* skb->data is cache aligned */
skb = alloc_skb(XLR_RX_BUF_SIZE, GFP_ATOMIC);
-   if (!skb) {
-   pr_err("SKB allocation failed\n");
+   if (!skb)
return NULL;
-   }
mac_put_skb_back_ptr(skb);
return skb;
 }
@@ -1104,6 +1102,7 @@ err_gmac:
 static int xlr_net_remove(struct platform_device *pdev)
 {
struct xlr_net_priv *priv = platform_get_drvdata(pdev);
+
unregister_netdev(priv->ndev);
mdiobus_unregister(priv->mii_bus);
mdiobus_free(priv->mii_bus);
-- 
1.9.1

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


[GIT PULL] please pull file locking changes for v3.17 (pile #3)

2014-08-30 Thread Jeff Layton
The following changes since commit 5317821c08533e5f42f974e4e68e092beaf099b1:

  Merge branch 'for-3.17-fixes' of 
git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata (2014-08-21 14:26:27 
-0700)

are available in the git repository at:


  git://git.samba.org/jlayton/linux.git tags/locks-v3.17-3

for you to fetch changes up to e0b760ff71be168d4e623f7c3612e98902ab93e9:

  locks: pass correct "before" pointer to locks_unlink_lock in 
generic_add_lease (2014-08-22 09:58:22 -0400)



Just a bugfix for a bug that crept in to v3.15. It's in a rather rare
error path, and I'm not aware of anyone having hit it, but it's worth
fixing for v3.17.


Jeff Layton (1):
  locks: pass correct "before" pointer to locks_unlink_lock in 
generic_add_lease

 fs/locks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
Jeff Layton 


signature.asc
Description: PGP signature


[RFC PATCH v5] tpm_tis: verify interrupt during init

2014-08-30 Thread Scot Doyle
On Sat, 30 Aug 2014, Jason Gunthorpe wrote:

> On Fri, Aug 29, 2014 at 11:59:32PM +, Scot Doyle wrote:
>
>> I tried calling tpm_get_timeouts only during the interrupt test, but again
>> was timed out after 30 seconds. The interrupt wait in tis_send calls
>> tpm_calc_ordinal_duration, which uses a default timeout of two minutes
>> when chip->vendor.duration[duration_idx] hasn't been set. Thus the second
>> call to tpm_get_timeouts in tpm_tis_init.
>
> So the strategy is to read the timeouts and hope that the chip reports
> something small and reasonable, then do a second read?
>
> Seems reasonable, but with this new arrangement we could also use an
> alternate polling logic for 'testing_int' that did the normal polling
> loop unconditionally and then checked if the interrupt was
> delivered. This would give a minimal dealy.

I like the idea. And then tpm_do_selftest could be used for the interrupt 
verification instead of a second tpm_get_timeouts?

The output is now
[1.526798] tpm_tis 00:08: 1.2 TPM (device-id 0xB, rev-id 16)
[5.914732] tpm_tis 00:08: [Firmware Bug]: TPM interrupt not working, 
polling instead

Enjoy the weekend!

---
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 2c46734..7a5f5b2 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -75,6 +75,11 @@ enum tis_defaults {
 #defineTPM_DID_VID(l)  (0x0F00 | ((l) << 12))
 #defineTPM_RID(l)  (0x0F04 | ((l) << 12))

+struct priv_data {
+   int test_irq;
+   int int_count;
+};
+
 static LIST_HEAD(tis_chips);
 static DEFINE_MUTEX(tis_lock);

@@ -338,6 +343,21 @@ out_err:
return rc;
 }

+static void disable_interrupts(struct tpm_chip *chip)
+{
+   u32 intmask;
+   intmask =
+   ioread32(chip->vendor.iobase +
+TPM_INT_ENABLE(chip->vendor.locality));
+   intmask |= TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_INT |
+  TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT;
+   iowrite32(intmask,
+ chip->vendor.iobase +
+ TPM_INT_ENABLE(chip->vendor.locality));
+   free_irq(chip->vendor.irq, chip);
+   chip->vendor.irq = 0;
+}
+
 /*
  * If interrupts are used (signaled by an irq set in the vendor structure)
  * tpm.c can skip polling for the data to be available as the interrupt is
@@ -347,6 +367,7 @@ static int tpm_tis_send(struct tpm_chip *chip, u8 *buf, 
size_t len)
 {
int rc;
u32 ordinal;
+   struct priv_data *priv = chip->vendor.priv;

rc = tpm_tis_send_data(chip, buf, len);
if (rc < 0)
@@ -358,13 +379,27 @@ static int tpm_tis_send(struct tpm_chip *chip, u8 *buf, 
size_t len)

if (chip->vendor.irq) {
ordinal = be32_to_cpu(*((__be32 *) (buf + 6)));
-   if (wait_for_tpm_stat
-   (chip, TPM_STS_DATA_AVAIL | TPM_STS_VALID,
-tpm_calc_ordinal_duration(chip, ordinal),
->vendor.read_queue, false) < 0) {
+   if (priv->test_irq)
+   chip->vendor.irq = 0;
+   rc = wait_for_tpm_stat
+(chip, TPM_STS_DATA_AVAIL | TPM_STS_VALID,
+ tpm_calc_ordinal_duration(chip, ordinal),
+ >vendor.read_queue, false);
+   if (priv->test_irq)
+   chip->vendor.irq = priv->test_irq;
+   if (rc < 0) {
rc = -ETIME;
goto out_err;
}
+   if (priv->test_irq) {
+   priv->test_irq = 0;
+   msleep(1);
+   if (!priv->int_count) {
+   disable_interrupts(chip);
+   dev_err(chip->dev,
+   FW_BUG "TPM interrupt not working, 
polling instead\n");
+   }
+   }
}
return len;
 out_err:
@@ -505,6 +540,7 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)
if (interrupt == 0)
return IRQ_NONE;

+   ((struct priv_data*)chip->vendor.priv)->int_count++;
if (interrupt & TPM_INTF_DATA_AVAIL_INT)
wake_up_interruptible(>vendor.read_queue);
if (interrupt & TPM_INTF_LOCALITY_CHANGE_INT)
@@ -534,10 +570,14 @@ static int tpm_tis_init(struct device *dev, 
resource_size_t start,
u32 vendor, intfcaps, intmask;
int rc, i, irq_s, irq_e, probe;
struct tpm_chip *chip;
+   struct priv_data *priv;

if (!(chip = tpm_register_hardware(dev, _tis)))
return -ENODEV;

+   priv = devm_kzalloc(dev, sizeof(struct priv_data), GFP_KERNEL);
+   chip->vendor.priv = priv;
+
chip->vendor.iobase = ioremap(start, len);
if (!chip->vendor.iobase) {
rc = -EIO;
@@ -612,12 +652,6 @@ static int tpm_tis_init(struct device 

Re: scsi_debug module deadlock on 3.17-rc2

2014-08-30 Thread Douglas Gilbert

On 14-08-30 04:56 PM, Milan Broz wrote:

Hi,

I am using scsi_debug in cryptsetup testsuite and with recent 3.17-rc kernel
it deadlocks on rmmod of scsi_debug module.

For me even this simple reproducer causes deadlock:
   modprobe scsi_debug dev_size_mb=16 sector_size=512 num_tgts=1
   DEV="/dev/"$(grep -l -e scsi_debug /sys/block/*/device/model | cut -f4 -d /)
   mkfs -t ext4 $DEV
   rmmod scsi_debug

(adding small delay before rmmod obviously helps here)


So I used this slight variation for testing:

modprobe scsi_debug dev_size_mb=16 sector_size=512 num_tgts=1 num_parts=1
DEV="/dev/"$(grep -l -e scsi_debug /sys/block/*/device/model | cut -f4 -d /)"1"
echo "mkfs -t ext4 ${DEV}"
mkfs -t ext4 ${DEV}
sleep 0.1
rmmod scsi_debug


Bisect tracked it to commit
   commit cbf67842c3d9e7af8ccc031332b79e88d9cca592
   Author: Douglas Gilbert 
   Date:   Sat Jul 26 11:55:35 2014 -0400
   scsi_debug: support scsi-mq, queues and locks

I guess that with introducing mq the del_timer_sync() must not be called
with acquired queued_arr_lock.
(to me it looks like situation described in comment before
del_timer_sync() in kernel/time/timer.c...)


Looks like something a lawyer would write.


Here is the log (running on vmware VM and i686 arch):

[   67.916472] scsi_debug: host protection
[   67.916483] scsi host3: scsi_debug, version 1.84 [20140706], dev_size_mb=16, 
opts=0x0
[   67.917446] scsi 3:0:0:0: Direct-Access Linuxscsi_debug   0184 
PQ: 0 ANSI: 5
[   67.920539] sd 3:0:0:0: Attached scsi generic sg8 type 0
[   67.940542] sd 3:0:0:0: [sdh] 32768 512-byte logical blocks: (16.7 MB/16.0 
MiB)
[   67.940548] sd 3:0:0:0: [sdh] 4096-byte physical blocks
[   67.950705] sd 3:0:0:0: [sdh] Write Protect is off
[   67.950715] sd 3:0:0:0: [sdh] Mode Sense: 73 00 10 08
[   67.970514] sd 3:0:0:0: [sdh] Write cache: enabled, read cache: enabled, 
supports DPO and FUA
[   68.040566]  sdh: unknown partition table
[   68.090618] sd 3:0:0:0: [sdh] Attached SCSI disk
[   68.799699]  sdh: unknown partition table
[   69.072314]
[   69.072387] ==
[   69.072433] [ INFO: possible circular locking dependency detected ]
[   69.072487] 3.17.0-rc2+ #80 Not tainted
[   69.072518] ---
[   69.072560] rmmod/2890 is trying to acquire lock:
[   69.072595]  ((sqcp->cmnd_timerp)){+.-...}, at: [] 
del_timer_sync+0x0/0xb0
[   69.072704]
[   69.072704] but task is already holding lock:
[   69.072743]  (queued_arr_lock){..-...}, at: [] 
stop_all_queued+0x17/0xc0 [scsi_debug]
[   69.072852]
[   69.072852] which lock already depends on the new lock.
[   69.072852]





[   69.075321]  Possible unsafe locking scenario:
[   69.075321]
[   69.075380]CPU0CPU1
[   69.075424]
[   69.075468]   lock(queued_arr_lock);
[   69.075534]lock((sqcp->cmnd_timerp));
[   69.075613]lock(queued_arr_lock);
[   69.075690]   lock((sqcp->cmnd_timerp));
[   69.075758]
[   69.075758]  *** DEADLOCK ***


Interesting analysis, somewhat confusing because cmnd_timerp
is a pointer. Also my guess is the sqcp pointers in the
two threads were different.

Anyway the attached patch removes the lock(queued_arr_lock)
from around the del_timer calls. Could you try it and report
back.

Doug Gilbert


--- a/drivers/scsi/scsi_debug.c	2014-08-26 13:24:51.646948507 -0400
+++ b/drivers/scsi/scsi_debug.c	2014-08-30 18:04:54.589226679 -0400
@@ -2743,6 +2743,13 @@ static int stop_queued_cmnd(struct scsi_
 		if (test_bit(k, queued_in_use_bm)) {
 			sqcp = _arr[k];
 			if (cmnd == sqcp->a_cmnd) {
+devip = (struct sdebug_dev_info *)
+	cmnd->device->hostdata;
+if (devip)
+	atomic_dec(>num_in_q);
+sqcp->a_cmnd = NULL;
+spin_unlock_irqrestore(_arr_lock,
+		   iflags);
 if (scsi_debug_ndelay > 0) {
 	if (sqcp->sd_hrtp)
 		hrtimer_cancel(
@@ -2755,18 +2762,13 @@ static int stop_queued_cmnd(struct scsi_
 	if (sqcp->tletp)
 		tasklet_kill(sqcp->tletp);
 }
-__clear_bit(k, queued_in_use_bm);
-devip = (struct sdebug_dev_info *)
-	cmnd->device->hostdata;
-if (devip)
-	atomic_dec(>num_in_q);
-sqcp->a_cmnd = NULL;
-break;
+clear_bit(k, queued_in_use_bm);
+return 1;
 			}
 		}
 	}
 	spin_unlock_irqrestore(_arr_lock, iflags);
-	return (k < qmax) ? 1 : 0;
+	return 0;
 }
 
 /* Deletes (stops) timers or tasklets of all queued commands */
@@ -2782,6 +2784,13 @@ static void stop_all_queued(void)
 		if (test_bit(k, queued_in_use_bm)) {
 			sqcp = _arr[k];
 			if (sqcp->a_cmnd) {
+devip = (struct sdebug_dev_info *)
+	sqcp->a_cmnd->device->hostdata;
+if (devip)
+	atomic_dec(>num_in_q);
+sqcp->a_cmnd = NULL;
+spin_unlock_irqrestore(_arr_lock,
+		   iflags);
 if (scsi_debug_ndelay > 0) {
 	if (sqcp->sd_hrtp)
 		hrtimer_cancel(
@@ -2794,12 +2803,8 @@ static 

Re: [PATCH v10 00/21] Support ext4 on NV-DIMMs

2014-08-30 Thread Christian Stroetmann

On the 28th of August 2014 at 09:17, Dave Chinner wrote:

On Wed, Aug 27, 2014 at 02:30:55PM -0700, Andrew Morton wrote:

On Wed, 27 Aug 2014 16:22:20 -0500 (CDT) Christoph Lameter  
wrote:


Some explanation of why one would use ext4 instead of, say,
suitably-modified ramfs/tmpfs/rd/etc?

The NVDIMM contents survive reboot and therefore ramfs and friends wont
work with it.

See "suitably modified".  Presumably this type of memory would need to
come from a particular page allocator zone.  ramfs would be unweildy
due to its use to dentry/inode caches, but rd/etc should be feasible.




Hello Dave and the others

Thank you very much for your patience and your following summarization.


That's where we started about two years ago with that horrible
pramfs trainwreck.

To start with: brd is a block device, not a filesystem. We still
need the filesystem on top of a persistent ram disk to make it
useful to applications. We can do this with ext4/XFS right now, and
that is the fundamental basis on which DAX is built.

For sake of the discussion, however, let's walk through what is
required to make an "existing" ramfs persistent. Persistence means we
can't just wipe it and start again if it gets corrupted, and
rebooting is not a fix for problems.  Hence we need to be able to
identify it, check it, repair it, ensure metadata operations are
persistent across machine crashes, etc, so there is all sorts of
management tools required by a persistent ramfs.

But most important of all: the persistent storage format needs to be
forwards and backwards compatible across kernel versions.  Hence we
can't encode any structure the kernel uses internally into the
persistent storage because they aren't stable structures.  That
means we need to marshall objects between the persistence domain and
the volatile domain in an orderly fashion.


Two little questions:
1. If we would omit the compatiblitiy across kernel versions only for 
theoretical reasons,
then would it make sense at all to encode a structure that the kernel 
uses internally and

what advantages could be reached in this way?
2. Have the said structures used by the kernel changed so many times?


We can avoid using the dentry/inode *caches* by freeing those
volatile objects the moment reference counts dop to zero rather than
putting them on LRUs. However, we can't store them in persistent
storage and we can't avoid using them to interface with the VFS, so
it makes little sense to burn CPU continually marshalling such
structures in and out of volatile memory if we have free RAM to do
so. So even with a "persistent ramfs" caching the working set of
volatile VFS objects makes sense from a peformance point of view.


I am sorry to say so, but I am confused again and do not understand this 
argument,
because we are already talking about NVDIMMs here. So, if we have those 
volatile
VFS objects already in NVDIMMs so to say, then we have them also in 
persistent

storage and in DRAM at the same time.



Then you've got crash recovery management: NVDIMMs are not
synchronous: they can still lose data while it is being written on
power loss. And we can't update persistent memory piecemeal as the
VFS code modifies metadata - there needs to be synchronisation
points, otherwise we will always have inconsistent metadata state in
persistent memory.

Persistent memory also can't do atomic writes across multiple,
disjoint CPU cachelines or NVDIMMs, and this is what is needed for
synchroniation points for multi-object metadata modification
operations to be consistent after a crash.  There is some work in
the nvme working groups to define this, but so far there hasn't been
any useful outcome, and then we willhave to wait for CPUs to
implement those interfaces.

Hence the metadata that indexes the persistent RAM needs to use COW
techniques, use a log structure or use WAL (journalling).  Hence
that "persistent ramfs" is now looking much more like a database or
traditional filesystem.

Further, it's going to need to scale to very large amounts of
storage.  We're talking about machines with *tens of TB* of NVDIMM
capacity in the immediate future and so free space manangement and
concurrency of allocation and freeing of used space is going to be
fundamental to the performance of the persistent NVRAM filesystem.
So, you end up with block/allocation groups to subdivide the space.
Looking a lot like ext4 or XFS at this point.

And now you have to scale to indexing tens of millions of
everything. At least tens of millions - hundreds of millions to
billions is more likely, because storing tens of terabytes of small
files is going to require indexing billions of files. And because
there is no performance penalty for doing this, people will use the
filesystem as a great big database. So now you have to have a
scalable posix compatible directory structures, scalable freespace
indexation, dynamic, scalable inode allocation, freeing, etc. Oh,
and it also needs to be highly concurrent to handle machines 

Re: patch "staging: remove nokia_hp4p driver

2014-08-30 Thread Marcel Holtmann
Hi Pavel,

>>> What is going on here? I get flamed for not cleaning up the driver,
>>> because I cleaned it up before merging to -staging. Ok, so I did more
>>> cleanups, sent 3 cleanup patches, no reaction on those, and now I got
>>> a note that you are going to remove the driver...?
>> 
>> For the 3 "cleanup" patches, the first one was rejected and you said to
>> not include it, so I couldn't apply the others.
> 
> That was different series. I'm talking about:
> 
> [PATCH 1/3] staging: nokia_h4: switch to right types and use bdaddr_t
> [PATCH 2/3] staging: nokia_h4: avoid __uX types
> [PATCH 3/3] staging: use inlines where it makes sense
> 
> That is still valid and received no comments at all.

and these are all trivial cleanups and could have been done back in January 
when this driver was merged into staging. It is end of August now and nothing 
happened to address anything in the TODO file.

The warning from end of May that this driver will be removed seemed to not have 
triggered anybody to work on the core issues of the driver.

There are 3 major topics that needs addressing before this driver should come 
anywhere near upstream kernel again, staging or otherwise.

a) Convert to using device tree for device detection

b) Convert to using hdev->setup for firmware loading

c) Convert to using hdev->set_bdaddr and HCI_QUIRK_INVALID_BDADDR

Please keep in mind that this was not an ugly Windows driver with a lot of 
Windows specific typedefs or bad coding style or OS abstractions. From that 
point of view it was always good since it was written for Linux in the first 
place. It was just a bit dated. Any fixes to bring that in sync with all other 
drivers could have been done easily after it was merged into the Bluetooth 
subsystem.

The reason why it ended up in staging is that the 3 core problems needed 
fixing. And 8 month later they still have not been fixed.

>>> Please don't, I'd still like to clean the driver up and get included,
>>> as n900's are still under active use.
>> 
>> As the Bluetooth maintainer has said a number of times, he doesn't want
>> the driver in the tree as it is not doing the correct things.  It's been
>> a long time in the tree with no work on it at all, and I follow the
>> suggestions of the maintainers of the subsystems that staging drivers
>> follow.
> 
> You asked for more work and explained how easy it is to revert the
> removal.
> 
> I did more work, you ignored it, and are removing the driver, anyway.

I have seen only fluff patches. Someone needs to address the core problems of 
the driver.

>> I suggest cleaning this up  in your own tree, and then just submitting it
>> for inclusion in the "normal" part of the kernel.  That way I'm not
> 
> ...creating a mess in the history, and fun merge problems for
> people actually using the driver :-(. And yes, n900 people actually
> are using it and have their own changes on top of it.

That is even worse. We have a staging driver with external patches on top of 
it. Getting a driver into staging has an almost zero barrier and then people 
still not get their patches merged into staging. That is just plain said.

Regards

Marcel

--
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 1/5] seq_file: provide an analogue of print_hex_dump()

2014-08-30 Thread Al Viro
On Mon, Aug 25, 2014 at 12:03:11PM +0300, Andy Shevchenko wrote:
> The new seq_hex_dump() is a complete analogue of print_hex_dump().
> 
> We have few users of this functionality already. It allows to reduce their
> codebase.

I really don't like the stack footprint.

> + unsigned char linebuf[32 * 3 + 2 + 32 + 1];

... and extra copying for no good reason.  Why not check that we have
enough space in buffer and generate directly into it?  See what e.g.
seq_escape() is doing...
--
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 "staging: remove nokia_hp4p driver

2014-08-30 Thread Greg KH
On Sun, Aug 31, 2014 at 12:44:30AM +0200, Pavel Machek wrote:
> Hi!
> 
> > > 
> > > What is going on here? I get flamed for not cleaning up the driver,
> > > because I cleaned it up before merging to -staging. Ok, so I did more
> > > cleanups, sent 3 cleanup patches, no reaction on those, and now I got
> > > a note that you are going to remove the driver...?
> > 
> > For the 3 "cleanup" patches, the first one was rejected and you said to
> > not include it, so I couldn't apply the others.
> 
> That was different series. I'm talking about:
> 
> [PATCH 1/3] staging: nokia_h4: switch to right types and use bdaddr_t
> [PATCH 2/3] staging: nokia_h4: avoid __uX types
> [PATCH 3/3] staging: use inlines where it makes sense
> 
> That is still valid and received no comments at all.

I didn't see those, were they mixed in with the previous ones?

> > > Please don't, I'd still like to clean the driver up and get included,
> > > as n900's are still under active use.
> > 
> > As the Bluetooth maintainer has said a number of times, he doesn't want
> > the driver in the tree as it is not doing the correct things.  It's been
> > a long time in the tree with no work on it at all, and I follow the
> > suggestions of the maintainers of the subsystems that staging drivers
> > follow.
> 
> You asked for more work and explained how easy it is to revert the
> removal.
> 
> I did more work, you ignored it, and are removing the driver, anyway.

Those 3 patches do nothing to address the issues that the bluetooth
maintainers have raised, right?

> > I suggest cleaning this up  in your own tree, and then just submitting it
> > for inclusion in the "normal" part of the kernel.  That way I'm not
> 
> ...creating a mess in the history, and fun merge problems for
> people actually using the driver :-(. And yes, n900 people actually
> are using it and have their own changes on top of it.

Look, the driver has been in my tree for a very long time with nothing
done on it.  The bluetooth maintainer has asked me to remove it as it
does not follow the proper api calls.  So I'll remove it.  It's a
staging driver, who cares about the "history" of it, just clean it up on
your own, and submit it to the bluetooth maintainers for inclusion in
the "real" part of the tree.

greg k-h
--
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 "staging: remove nokia_hp4p driver

2014-08-30 Thread Pavel Machek
Hi!

> > 
> > What is going on here? I get flamed for not cleaning up the driver,
> > because I cleaned it up before merging to -staging. Ok, so I did more
> > cleanups, sent 3 cleanup patches, no reaction on those, and now I got
> > a note that you are going to remove the driver...?
> 
> For the 3 "cleanup" patches, the first one was rejected and you said to
> not include it, so I couldn't apply the others.

That was different series. I'm talking about:

[PATCH 1/3] staging: nokia_h4: switch to right types and use bdaddr_t
[PATCH 2/3] staging: nokia_h4: avoid __uX types
[PATCH 3/3] staging: use inlines where it makes sense

That is still valid and received no comments at all.

> > Please don't, I'd still like to clean the driver up and get included,
> > as n900's are still under active use.
> 
> As the Bluetooth maintainer has said a number of times, he doesn't want
> the driver in the tree as it is not doing the correct things.  It's been
> a long time in the tree with no work on it at all, and I follow the
> suggestions of the maintainers of the subsystems that staging drivers
> follow.

You asked for more work and explained how easy it is to revert the
removal.

I did more work, you ignored it, and are removing the driver, anyway.

> I suggest cleaning this up  in your own tree, and then just submitting it
> for inclusion in the "normal" part of the kernel.  That way I'm not

...creating a mess in the history, and fun merge problems for
people actually using the driver :-(. And yes, n900 people actually
are using it and have their own changes on top of it.
Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
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: sparc64 WARNING: at mm/mmap.c:2757 exit_mmap+0x13c/0x160()

2014-08-30 Thread Aaro Koskinen
Hi,

On Mon, Aug 18, 2014 at 10:38:50AM -0700, David Miller wrote:
> All patches are in 3,17-rc1

FYI, the warning/bug still triggers with 3.17-rc2 during GCC bootstrap:

[94075.963753] [ cut here ]
[94076.018105] WARNING: CPU: 0 PID: 17192 at 
/home/aaro/los/work/shared/linux-v3.17-rc2/mm/mmap.c:2766 
exit_mmap+0x128/0x160()
[94076.151407] Modules linked in:
[94076.187825] CPU: 0 PID: 17192 Comm: rm Not tainted 3.17.0-rc2-ultra-los_3ec1 
#1
[94076.275319] Call Trace:
[94076.304490]  [004c1308] exit_mmap+0x128/0x160
[94076.364915]  [0045118c] mmput+0x2c/0xc0
[94076.419062]  [00453cb0] do_exit+0x1b0/0x880
[94076.477387]  [00454ff8] do_group_exit+0x38/0xc0
[94076.539880]  [00455094] SyS_exit_group+0x14/0x20
[94076.603429]  [00406074] linux_sparc_syscall32+0x34/0x60
[94076.674225] ---[ end trace b4b3ce0b3bcc0234 ]---
[94076.729446] BUG: Bad rss-counter state mm:ff0016898000 idx:1 val:2

A.
--
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/


Confidential Respond.

2014-08-30 Thread BintouSawadogo
Good Day,
I am Mrs. Bintou Sawadogo director auditing and accounting department"
bank Here in Ouagadougou, Burkina Faso .I discovered the sum of seven
million, two hundred thousand dollars (usd7.2) belonging to a deceased
customer of this bank the fund has been lying in a suspense account
without anybody coming to put claim over the money since the account
owner late, Mr. Salla khat from Lebanese who was involved in the
December 28th 2008 Benin car crash.

Therefore, I am soliciting for your assistance to come forward as the
next of kin. I have agreed that 40% of this money will be for you as
the beneficiary respect of the provision of your account and service
rendered, 60% will be for me.

Contact me if you are ready to do this deal.

Yours faithful,
Mrs.Bintou Sawadogo
--
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] block: loop: say goodby to bio

2014-08-30 Thread Elliott, Robert (Server Storage)


> -Original Message-
> From: linux-kernel-ow...@vger.kernel.org [mailto:linux-kernel-
> ow...@vger.kernel.org] On Behalf Of Ming Lei
> Sent: Saturday, 30 August, 2014 11:08 AM
> To: Jens Axboe; linux-kernel@vger.kernel.org; Dave Kleikamp
> Cc: Zach Brown; Christoph Hellwig; Maxim Patlasov; Ming Lei
> Subject: [PATCH v2 4/6] block: loop: say goodby to bio
...
> -static int do_bio_filebacked(struct loop_device *lo, struct bio
> *bio)
> +static int do_req_filebacked(struct loop_device *lo, struct request
> *rq)
>  {
>   loff_t pos;
>   int ret;
> 
> - pos = ((loff_t) bio->bi_iter.bi_sector << 9) + lo->lo_offset;
> + pos = ((loff_t) blk_rq_pos(rq) << 9) + lo->lo_offset;
> 
> - if (bio_rw(bio) == WRITE) {
> + if (rq->cmd_flags & REQ_WRITE) {
>   struct file *file = lo->lo_backing_file;
> 
> - if (bio->bi_rw & REQ_FLUSH) {
> + if (rq->cmd_flags & REQ_FLUSH) {
>   ret = vfs_fsync(file, 0);
>   if (unlikely(ret && ret != -EINVAL)) {
>   ret = -EIO;
> @@ -436,7 +439,7 @@ static int do_bio_filebacked(struct loop_device
> *lo, struct bio *bio)
>* encryption is enabled, because it may give an attacker
>* useful information.
>*/
> - if (bio->bi_rw & REQ_DISCARD) {
> + if (rq->cmd_flags & REQ_DISCARD) {
>   struct file *file = lo->lo_backing_file;
>   int mode = FALLOC_FL_PUNCH_HOLE |
> FALLOC_FL_KEEP_SIZE;

Can a REQ_WRITE_SAME make it through to here?


---
Rob ElliottHP Server Storage



--
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 3/6] block: loop: convert to blk-mq

2014-08-30 Thread Elliott, Robert (Server Storage)


> -Original Message-
> From: linux-kernel-ow...@vger.kernel.org [mailto:linux-kernel-
> ow...@vger.kernel.org] On Behalf Of Ming Lei
> Sent: Saturday, 30 August, 2014 11:08 AM
> To: Jens Axboe; linux-kernel@vger.kernel.org; Dave Kleikamp
> Cc: Zach Brown; Christoph Hellwig; Maxim Patlasov; Ming Lei
> Subject: [PATCH v2 3/6] block: loop: convert to blk-mq
> 
...
> -static inline void loop_handle_bio(struct loop_device *lo, struct
> bio *bio)
> +static inline int loop_handle_bio(struct loop_device *lo, struct bio
> *bio)
>  {
> - if (unlikely(!bio->bi_bdev)) {
> - do_loop_switch(lo, bio->bi_private);
> - bio_put(bio);
> - } else {
> - int ret = do_bio_filebacked(lo, bio);
> - bio_endio(bio, ret);
> - }
> + int ret = do_bio_filebacked(lo, bio);
> + return ret;

No need for the temporary variable; just return the function
call.

...
> +static int loop_prepare_hctxs(struct loop_device *lo)
> +{
> + struct request_queue *q = lo->lo_queue;
> + struct blk_mq_hw_ctx *hctx;
> + struct loop_hctx_data *data;
> + unsigned int i;
> +
> + queue_for_each_hw_ctx(q, hctx, i) {
> + BUG_ON(i >= lo->tag_set.nr_hw_queues);

If something goes bad in the loop driver like that, is it
necessary to crash the whole kernel?  

> + data = hctx->driver_data;
> +
> + data->lo = lo;
> + init_kthread_worker(>worker);
> + data->worker_task = kthread_run(kthread_worker_fn,
> + >worker, "loop%d-%d",
> + lo->lo_number, i);
> + if (IS_ERR(data->worker_task)) {
> + loop_unprepare_hctxs(lo, i);
> + return -ENOMEM;
> + }
> + set_user_nice(data->worker_task, MIN_NICE);
> + sched_getaffinity(data->worker_task->pid, hctx->cpumask);

Is that supposed to be sched_setaffinity?  It looks like
getaffinity does have a side-effect of updating the CPU mask
based on the current active cpus, but there won't be a CPU mask
to update unless setaffinity was called.

...
> @@ -906,14 +848,10 @@ static int loop_set_fd(struct loop_device *lo,
> fmode_t mode,
> 
>   set_blocksize(bdev, lo_blocksize);
> 
> - lo->lo_thread = kthread_create(loop_thread, lo, "loop%d",
> - lo->lo_number);
> - if (IS_ERR(lo->lo_thread)) {
> - error = PTR_ERR(lo->lo_thread);
> + if ((error = loop_prepare_hctxs(lo)) != 0)
>   goto out_clr;

I've been told that linux kernel style is:
error = x();
if (error)

...
> @@ -1014,7 +951,7 @@ static int loop_clr_fd(struct loop_device *lo)
>   lo->lo_state = Lo_rundown;
>   spin_unlock_irq(>lo_lock);
> 
> - kthread_stop(lo->lo_thread);
> + loop_unprepare_hctxs(lo, lo->tag_set.nr_hw_queues);
> 
>   spin_lock_irq(>lo_lock);
>   lo->lo_backing_file = NULL;
...
> +
> +static int loop_prepare_flush_rq(void *data, struct request_queue
> *q,
> + struct request *flush_rq,
> + const struct request *src_rq)
> +{
> + /* borrow initialization helper for common rq */
> + loop_init_request(data, flush_rq, 0, -1, NUMA_NO_NODE);
> + return 0;
> +}

In patch 2/6 that function is called with:
if (orig_rq->q->mq_ops->prepare_flush_rq)
ret = orig_rq->q->mq_ops->prepare_flush_rq(
orig_rq->q->tag_set->driver_data,
orig_rq->q, flush_rq, orig_rq);


The src_rq argument is not used in this new function.
Do you anticipate it might be necessary in other drivers?

Is this new function allowed to modify *data, *flush_rq,
or *src_rq?  If not, const might be good to add.

If orig_rq is always passed, then this function could 
decode orig_rq->q and orig_rq->q->tag_set_>driver_data
on its own, eliminating the need for the first two arguments.

Similarly, in the unprepare_flush_rq function in patch 2,
which is not provided by the loop driver in this patch:

+   if (q->mq_ops->unprepare_flush_rq)
+   q->mq_ops->unprepare_flush_rq(
+   q->tag_set->driver_data,
+   q, q->flush_rq);

if q is always passed, then that function could calculate
q->tag_set_driver_data and q->flush_rq itself, eliminating
two arguments.

> +
> +static int loop_init_hctx(struct blk_mq_hw_ctx *hctx, void *data,
> + unsigned int index)
> +{
> + hctx->driver_data = kmalloc(sizeof(struct loop_hctx_data),
> + GFP_KERNEL);

hctx->numa_node has been set before this; how about passing it 
along to kmalloc_node in case it has a useful value?

blk_mq_init_hw_queues sets it before calling this function:
node = hctx->numa_node;
if (node == NUMA_NO_NODE)
node = hctx->numa_node = set->numa_node;
...

Re: [PATCH 3/4] staging: rtl8188eu: osdep_intf.h and usb_intf.c

2014-08-30 Thread Greg KH
On Sat, Aug 30, 2014 at 11:22:56PM +0200, Miguel Oliveira wrote:
> > Same comments as the previous ones, please redo all of these patches.
> >
> Should all the alterations be in one big single patch, insted of small ones?

I don't know, I don't remember what this patch even contained given that
it was 100+ patches ago in my review queue and I have the short term
memory of a squirrel.  Please fix up and resend and I'll be glad to
review it then.

thanks,

greg k-h
--
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 "staging: remove nokia_hp4p driver

2014-08-30 Thread Greg KH
On Sat, Aug 30, 2014 at 11:30:22PM +0200, Pavel Machek wrote:
> Hi!
> 
> > This is a note to let you know that I've just added the patch titled
> > 
> > staging: remove nokia_hp4p driver
> > -Re: [PATCH v6] Bluetooth: Add hci_h4p driver
> > 
> > to my staging git tree which can be found at
> > git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
> > in the staging-next branch.
> > 
> > The patch will show up in the next release of the linux-next tree
> > (usually sometime within the next 24 hours during the week.)
> > 
> > The patch will also be merged in the next major kernel release
> > during the merge window.
> > 
> > If you have any questions about this process, please let me know.
> 
> What is going on here? I get flamed for not cleaning up the driver,
> because I cleaned it up before merging to -staging. Ok, so I did more
> cleanups, sent 3 cleanup patches, no reaction on those, and now I got
> a note that you are going to remove the driver...?

For the 3 "cleanup" patches, the first one was rejected and you said to
not include it, so I couldn't apply the others.

> Please don't, I'd still like to clean the driver up and get included,
> as n900's are still under active use.

As the Bluetooth maintainer has said a number of times, he doesn't want
the driver in the tree as it is not doing the correct things.  It's been
a long time in the tree with no work on it at all, and I follow the
suggestions of the maintainers of the subsystems that staging drivers
follow.

I suggest cleaning this up in your own tree, and then just submitting it
for inclusion in the "normal" part of the kernel.  That way I'm not
standing in your way on applying patches, and you can work much quicker
to resolve the issues that Marcel has pointed out.

thanks,

greg k-h
--
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/


[PATCH v2] apf27dev: add max1027 in the dts

2014-08-30 Thread Philippe Reynes

Signed-off-by: Philippe Reynes 
---
 arch/arm/boot/dts/imx27-apf27dev.dts |   17 +
 1 files changed, 17 insertions(+), 0 deletions(-)

Changelog:
v2: (thanks Alexander Shiyan for the feedback)
- spi mode 0 is the default so no need to explicitly define it

diff --git a/arch/arm/boot/dts/imx27-apf27dev.dts 
b/arch/arm/boot/dts/imx27-apf27dev.dts
index b982309..f2bab73 100644
--- a/arch/arm/boot/dts/imx27-apf27dev.dts
+++ b/arch/arm/boot/dts/imx27-apf27dev.dts
@@ -82,6 +82,16 @@
pinctrl-names = "default";
pinctrl-0 = <_cspi1 _cspi1_cs>;
status = "okay";
+
+   adc@0 {
+   compatible = "maxim,max1027";
+   reg = <0>;
+   interrupt-parent = <>;
+   interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_max1027>;
+   spi-max-frequency = <1000>;
+   };
 };
 
  {
@@ -230,6 +240,13 @@
pinctrl_sdhc2_cd: sdhc2cdgrp {
fsl,pins = ;
};
+
+   pinctrl_max1027: max1027 {
+fsl,pins = <
+MX27_PAD_UART1_CTS__GPIO5_14 0
+MX27_PAD_UART1_RTS__GPIO5_15 0
+   >;
+   };
};
 };
 
-- 
1.7.4.4

--
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: For review: user_namespace(7) man page

2014-08-30 Thread Eric W. Biederman
"Michael Kerrisk (man-pages)"  writes:

> Hello Eric et al.,
>
> For various reasons, my work on the namespaces man pages 
> fell off the table a while back. Nevertheless, the pages have
> been close to completion for a while now, and I recently restarted,
> in an effort to finish them. As you also noted to me f2f, there have
> been recently been some small namespace changes that you may affect
> the content of the pages. Therefore, I'll take the opportunity to
> send the namespace-related pages out for further (final?) review.
>
> So, here, I start with the user_namespaces(7) page, which is shown 
> in rendered form below, with source attached to this mail. I'll
> send various other pages in follow-on mails.
>
> Review comments/suggestions for improvements / bug fixes welcome.
>
> Cheers,
>
> Michael
>
> ==
>
> NAME
>user_namespaces - overview of Linux user_namespaces
>
> DESCRIPTION
>For an overview of namespaces, see namespaces(7).
>
>User   namespaces   isolate   security-related   identifiers  and
>attributes, in particular, user IDs and group  IDs  (see  creden‐
>tials(7), the root directory, keys (see keyctl(2)), and capabili‐
>ties (see capabilities(7)).  A process's user and group  IDs  can
>be different inside and outside a user namespace.  In particular,
>a process can have a normal unprivileged user ID outside  a  user
>namespace while at the same time having a user ID of 0 inside the
>namespace; in other words, the process has  full  privileges  for
>operations  inside  the  user  namespace, but is unprivileged for
>operations outside the namespace.
>
>Nested namespaces, namespace membership
>User namespaces can be nested;  that  is,  each  user  namespace—
>except  the  initial  ("root") namespace—has a parent user names‐
>pace, and can have zero or more child user namespaces.  The  par‐
>ent user namespace is the user namespace of the process that cre‐
>ates the user namespace via a call to unshare(2) or clone(2) with
>the CLONE_NEWUSER flag.
>
>The kernel imposes (since version 3.11) a limit of 32 nested lev‐
>els of user namespaces.  Calls to  unshare(2)  or  clone(2)  that
>would cause this limit to be exceeded fail with the error EUSERS.
>
>Each  process  is  a  member  of  exactly  one user namespace.  A
>process created via fork(2) or clone(2) without the CLONE_NEWUSER
>flag  is  a  member  of the same user namespace as its parent.
>A
   ^ single-threaded

Because of chroot and other things multi-threaded processes are not
allowed to join a user namespace.  For the documentation just saying
single-threaded sounds like enough here.

>process can join another user namespace with setns(2) if  it  has
>the  CAP_SYS_ADMIN  in  that namespace; upon doing so, it gains a
>full set of capabilities in that namespace.
>
>A call to clone(2) or  unshare(2)  with  the  CLONE_NEWUSER  flag
>makes  the  new  child  process (for clone(2)) or the caller (for
>unshare(2)) a member of the new user  namespace  created  by  the
>call.
>
>Capabilities
>The child process created by clone(2) with the CLONE_NEWUSER flag
>starts out with a complete set of capabilities in  the  new  user
>namespace.  Likewise, a process that creates a new user namespace
>using unshare(2)  or  joins  an  existing  user  namespace  using
>setns(2)  gains a full set of capabilities in that namespace.  On
>the other hand, that process has no capabilities  in  the  parent
>(in  the case of clone(2)) or previous (in the case of unshare(2)
>and setns(2)) user namespace, even if the new namespace  is  cre‐
>ated  or  joined by the root user (i.e., a process with user ID 0
>in the root namespace).
>
>Note that a call to execve(2) will cause a process  to  lose  any
>capabilities that it has, unless it has a user ID of 0 within the
>namespace.  See the discussion of user  and  group  ID  mappings,
>below.
>
>A   call   to   clone(2),   unshare(2),  or  setns(2)  using  the
>CLONE_NEWUSER flag sets the  "securebits"  flags  (see  capabili‐
>ties(7))  to  their  default  values  (all flags disabled) in the
>child (for clone(2)) or caller  (for  unshare(2),  or  setns(2)).
>Note  that  because  the caller no longer has capabilities in its
>original user namespace after a call to setns(2), it is not  pos‐
>sible for a process to reset its "securebits" flags while retain‐
>ing its user namespace membership by using  a  pair  of  setns(2)
>calls  to  move  to another user namespace and then return to its
>original user namespace.
>
>Having a capability inside a user namespace 

Re: /proc/diskstats buglet

2014-08-30 Thread Alexey Dobriyan
On Tue, Aug 26, 2014 at 09:01:28AM -0600, Jens Axboe wrote:
> On 08/26/2014 09:00 AM, Alexey Dobriyan wrote:
> > On Tue, Aug 26, 2014 at 5:55 PM, Jens Axboe  wrote:
> >> On 08/26/2014 08:47 AM, Alexey Dobriyan wrote:
> >>> Found and reproduced some time ago, almost forgot about :-)
> >>>
> >>> In part_round_stats_single(), ->stamp field is written but without
> >>> locking SMP-wise.
> >>>
> >>> part->stamp = now;
> >>>
> >>> So, if two processes read /proc/diskstats, it is possible for "now -
> >>> part->stamp" value to become negative.
> >>>
> >>> And indeed this can happen:
> >>>
> >>> now 4294755500, ->stamp 4294755501
> >>> [ cut here ]
> >>> WARNING: CPU: 0 PID: 1950 at block/blk-core.c:1229
> >>> part_round_stats_single+0xc0/0xd0()
> >>>  ...
> >>>  [] part_round_stats_single+0xc0/0xd0
> >>>  [] part_round_stats+0x47/0x70
> >>>  [] diskstats_show+0x8d/0x4b0
> >>>  ...
> >>>
> >>> Dunno how important used fields in /proc/diskstats but they can be
> >>> clearly bogus.
> >>
> >> Easiest fix is probably just to do the now - part->stamp math earlier,
> >> and ignore <= 0 instead of just now == part->stamp. I think that should
> >> be good enough for disk stats, and (most importantly), it would avoid
> >> the warning.
> >>
> >> Speaking of the warning, I don't see where that is. Where is it from?
> > 
> > I inserted the warning to be sure bug exists and I am not misreading the 
> > code.
> 
> Ah got it, that makes sense. Care to send a patch to just ignore <= 0
> now - part->stamp?

It will be still possible for 2 contexts to execute part_round_stats_single()
simultaneously. Should lead to double accounting?

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


[PATCH] x86/tsc trivial: Changes Fast TSC calibration failed from error to warning

2014-08-30 Thread Alexandre Demers
Most users see this message when booting without knowning that it is of 
mostly no importance and that TSC calibration may have succeeded by 
another way.

As explained thoroufly by Paul Bolle in 2012 
(http://lkml.iu.edu//hypermail/linux/kernel/1209.3/00224.html), 
"Fast TSC calibration failed" should not be considered as an error since 
other calibration methods are being tried afterward. At most, 
those send a warning if they fail (not an error). So let's change 
the message from error to warning.

It should also fix bug 75971: fast tsc calibration faild on ubuntu 14.04 LTS

Tested on kernel 3.17-rc2.

Signed-off-by: Alexandre Demers 

---
 arch/x86/kernel/tsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index b6025f9..5a22022 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -617,7 +617,7 @@ static unsigned long quick_pit_calibrate(void)
goto success;
}
}
-   pr_err("Fast TSC calibration failed\n");
+   pr_warn("Fast TSC calibration failed\n");
return 0;
 
 success:
-- 
2.1.0

--
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 "staging: remove nokia_hp4p driver

2014-08-30 Thread Pavel Machek
Hi!

> This is a note to let you know that I've just added the patch titled
> 
> staging: remove nokia_hp4p driver
> -Re: [PATCH v6] Bluetooth: Add hci_h4p driver
> 
> to my staging git tree which can be found at
> git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
> in the staging-next branch.
> 
> The patch will show up in the next release of the linux-next tree
> (usually sometime within the next 24 hours during the week.)
> 
> The patch will also be merged in the next major kernel release
> during the merge window.
> 
> If you have any questions about this process, please let me know.

What is going on here? I get flamed for not cleaning up the driver,
because I cleaned it up before merging to -staging. Ok, so I did more
cleanups, sent 3 cleanup patches, no reaction on those, and now I got
a note that you are going to remove the driver...?

Please don't, I'd still like to clean the driver up and get included,
as n900's are still under active use.
Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
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 4/4] staging: rtl8188eu: rtw_debug.h

2014-08-30 Thread Miguel Oliveira
>
> How does this change relate to what you said you were going to do above?
>
> confused,
>
That was a fix for a sparse warning that went on this patch acidenttly.
Sorry about that.
--
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 3/4] staging: rtl8188eu: osdep_intf.h and usb_intf.c

2014-08-30 Thread Miguel Oliveira
> Same comments as the previous ones, please redo all of these patches.
>
Should all the alterations be in one big single patch, insted of small ones?
--
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/


[PATCH 02/12] staging/lustre/obdecho: remove metadata echo client

2014-08-30 Thread Oleg Drokin
From: Peng Tao 

The metadata echo client requires server support and should not have
been included.

Signed-off-by: Liu Xuezhao 
Signed-off-by: Peng Tao 
Signed-off-by: John L. Hammond 
Reviewed-on: http://review.whamcloud.com/2674
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-1330
Reviewed-by: Nathaniel Clark 
Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/obdecho/echo_client.c| 1053 +---
 1 file changed, 46 insertions(+), 1007 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c 
b/drivers/staging/lustre/lustre/obdecho/echo_client.c
index ad5acf6..68a5ed1 100644
--- a/drivers/staging/lustre/lustre/obdecho/echo_client.c
+++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c
@@ -43,7 +43,6 @@
 #include "../include/lustre_debug.h"
 #include "../include/lprocfs_status.h"
 #include "../include/cl_object.h"
-#include "../include/md_object.h"
 #include "../include/lustre_fid.h"
 #include "../include/lustre_acl.h"
 #include "../include/lustre_net.h"
@@ -62,8 +61,6 @@ struct echo_device {
struct cl_site   *ed_site;
struct lu_device   *ed_next;
int  ed_next_islov;
-   int  ed_next_ismd;
-   struct lu_client_seq   *ed_cl_seq;
 };
 
 struct echo_object {
@@ -192,17 +189,6 @@ struct echo_thread_info {
struct cl_lock_descreti_descr;
struct lu_fid  eti_fid;
struct lu_fid   eti_fid2;
-   struct md_op_spec   eti_spec;
-   struct lov_mds_md_v3eti_lmm;
-   struct lov_user_md_v3   eti_lum;
-   struct md_attreti_ma;
-   struct lu_nameeti_lname;
-   /* per-thread values, can be re-used */
-   void*eti_big_lmm;
-   int eti_big_lmmsize;
-   chareti_name[20];
-   struct lu_buf  eti_buf;
-   chareti_xattr_buf[LUSTRE_POSIX_ACL_MAX_SIZE];
 };
 
 /* No session used right now */
@@ -463,6 +449,8 @@ static int echo_object_init(const struct lu_env *env, 
struct lu_object *obj,
struct echo_device *ed   = cl2echo_dev(lu2cl_dev(obj->lo_dev));
struct echo_client_obd *ec = ed->ed_ec;
struct echo_object *eco = cl2echo_obj(lu2cl(obj));
+   const struct cl_object_conf *cconf;
+   struct echo_object_conf *econf;
 
if (ed->ed_next) {
struct lu_object  *below;
@@ -476,17 +464,13 @@ static int echo_object_init(const struct lu_env *env, 
struct lu_object *obj,
lu_object_add(obj, below);
}
 
-   if (!ed->ed_next_ismd) {
-   const struct cl_object_conf *cconf = lu2cl_conf(conf);
-   struct echo_object_conf *econf = cl2echo_conf(cconf);
+   cconf = lu2cl_conf(conf);
+   econf = cl2echo_conf(cconf);
 
-   LASSERT(econf->eoc_md);
-   eco->eo_lsm = *econf->eoc_md;
-   /* clear the lsm pointer so that it won't get freed. */
-   *econf->eoc_md = NULL;
-   } else {
-   eco->eo_lsm = NULL;
-   }
+   LASSERT(econf->eoc_md);
+   eco->eo_lsm = *econf->eoc_md;
+   /* clear the lsm pointer so that it won't get freed. */
+   *econf->eoc_md = NULL;
 
eco->eo_dev = ed;
atomic_set(>eo_npages, 0);
@@ -651,8 +635,7 @@ static int echo_site_init(const struct lu_env *env, struct 
echo_device *ed)
 static void echo_site_fini(const struct lu_env *env, struct echo_device *ed)
 {
if (ed->ed_site) {
-   if (!ed->ed_next_ismd)
-   cl_site_fini(ed->ed_site);
+   cl_site_fini(ed->ed_site);
ed->ed_site = NULL;
}
 }
@@ -719,53 +702,6 @@ static struct lu_context_key echo_session_key = {
 
 LU_TYPE_INIT_FINI(echo, _thread_key, _session_key);
 
-#define ECHO_SEQ_WIDTH 0x
-static int echo_fid_init(struct echo_device *ed, char *obd_name,
-struct seq_server_site *ss)
-{
-   char *prefix;
-   int rc;
-
-   OBD_ALLOC_PTR(ed->ed_cl_seq);
-   if (ed->ed_cl_seq == NULL)
-   return -ENOMEM;
-
-   OBD_ALLOC(prefix, MAX_OBD_NAME + 5);
-   if (prefix == NULL)
-   GOTO(out_free_seq, rc = -ENOMEM);
-
-   snprintf(prefix, MAX_OBD_NAME + 5, "srv-%s", obd_name);
-
-   /* Init client side sequence-manager */
-   rc = seq_client_init(ed->ed_cl_seq, NULL,
-LUSTRE_SEQ_METADATA,
-prefix, ss->ss_server_seq);
-   ed->ed_cl_seq->lcs_width = ECHO_SEQ_WIDTH;
-   OBD_FREE(prefix, MAX_OBD_NAME + 5);
-   if (rc)
-   GOTO(out_free_seq, rc);
-
-   return 0;
-
-out_free_seq:
-   OBD_FREE_PTR(ed->ed_cl_seq);
-   ed->ed_cl_seq = NULL;
-   return rc;
-}
-
-static int echo_fid_fini(struct obd_device *obddev)
-{
-   struct echo_device *ed = obd2echo_dev(obddev);
-
-   if (ed->ed_cl_seq != NULL) {
-   

[PATCH 03/12] staging/lustre/obdecho: remove #if 0-ed out regions

2014-08-30 Thread Oleg Drokin
From: "John L. Hammond" 

The landing of clio #if 0-ed out some regions of echo_client.c. Just
remove these regions entirely.

Signed-off-by: John L. Hammond 
Reviewed-on: http://review.whamcloud.com/5580
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675
Reviewed-by: James Simmons 
Reviewed-by: Andreas Dilger 
Reviewed-by: Oleg Drokin 
---
 .../staging/lustre/lustre/obdecho/echo_client.c| 50 --
 1 file changed, 50 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c 
b/drivers/staging/lustre/lustre/obdecho/echo_client.c
index 68a5ed1..98e4290 100644
--- a/drivers/staging/lustre/lustre/obdecho/echo_client.c
+++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c
@@ -93,16 +93,6 @@ struct echo_lock {
atomic_t   el_refcount;
 };
 
-struct echo_io {
-   struct cl_io_slice ei_cl;
-};
-
-#if 0
-struct echo_req {
-   struct cl_req_slice er_cl;
-};
-#endif
-
 static int echo_client_setup(const struct lu_env *env,
 struct obd_device *obddev,
 struct lustre_cfg *lcfg);
@@ -200,7 +190,6 @@ static struct kmem_cache *echo_lock_kmem;
 static struct kmem_cache *echo_object_kmem;
 static struct kmem_cache *echo_thread_kmem;
 static struct kmem_cache *echo_session_kmem;
-//static struct kmem_cache *echo_req_kmem;
 
 static struct lu_kmem_descr echo_caches[] = {
{
@@ -223,13 +212,6 @@ static struct lu_kmem_descr echo_caches[] = {
.ckd_name  = "echo_session_kmem",
.ckd_size  = sizeof (struct echo_session_info)
},
-#if 0
-   {
-   .ckd_cache = _req_kmem,
-   .ckd_name  = "echo_req_kmem",
-   .ckd_size  = sizeof (struct echo_req)
-   },
-#endif
{
.ckd_cache = NULL
}
@@ -2100,37 +2082,11 @@ static int echo_client_connect(const struct lu_env *env,
 
 static int echo_client_disconnect(struct obd_export *exp)
 {
-#if 0
-   struct obd_device  *obd;
-   struct echo_client_obd *ec;
-   struct ec_lock   *ecl;
-#endif
int  rc;
 
if (exp == NULL)
GOTO(out, rc = -EINVAL);
 
-#if 0
-   obd = exp->exp_obd;
-   ec = >u.echo_client;
-
-   /* no more contention on export's lock list */
-   while (!list_empty (>exp_ec_data.eced_locks)) {
-   ecl = list_entry (exp->exp_ec_data.eced_locks.next,
- struct ec_lock, ecl_exp_chain);
-   list_del (>ecl_exp_chain);
-
-   rc = obd_cancel(ec->ec_exp, ecl->ecl_object->eco_lsm,
-ecl->ecl_mode, >ecl_lock_handle);
-
-   CDEBUG (D_INFO, "Cancel lock on object %#llx on disconnect "
-   "(%d)\n", ecl->ecl_object->eco_id, rc);
-
-   echo_put_object (ecl->ecl_object);
-   OBD_FREE (ecl, sizeof (*ecl));
-   }
-#endif
-
rc = class_disconnect(exp);
GOTO(out, rc);
  out:
@@ -2139,12 +2095,6 @@ static int echo_client_disconnect(struct obd_export *exp)
 
 static struct obd_ops echo_client_obd_ops = {
.o_owner   = THIS_MODULE,
-
-#if 0
-   .o_setup   = echo_client_setup,
-   .o_cleanup = echo_client_cleanup,
-#endif
-
.o_iocontrol   = echo_client_iocontrol,
.o_connect = echo_client_connect,
.o_disconnect  = echo_client_disconnect
-- 
1.9.3

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


[PATCH 07/12] staging/lustre: remove md_object.h

2014-08-30 Thread Oleg Drokin
From: "John L. Hammond" 

The declarations from lustre/include/md_object.h are not used so
remove them.

Signed-off-by: John L. Hammond 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/fid/lproc_fid.c |   1 -
 drivers/staging/lustre/lustre/fld/fld_cache.c |   1 -
 drivers/staging/lustre/lustre/fld/fld_request.c   |   1 -
 drivers/staging/lustre/lustre/fld/lproc_fld.c |   1 -
 drivers/staging/lustre/lustre/include/md_object.h | 899 --
 5 files changed, 903 deletions(-)
 delete mode 100644 drivers/staging/lustre/lustre/include/md_object.h

diff --git a/drivers/staging/lustre/lustre/fid/lproc_fid.c 
b/drivers/staging/lustre/lustre/fid/lproc_fid.c
index 92a27fa..c9fa676 100644
--- a/drivers/staging/lustre/lustre/fid/lproc_fid.c
+++ b/drivers/staging/lustre/lustre/fid/lproc_fid.c
@@ -48,7 +48,6 @@
 #include "../include/obd.h"
 #include "../include/obd_class.h"
 #include "../include/dt_object.h"
-#include "../include/md_object.h"
 #include "../include/obd_support.h"
 #include "../include/lustre_req_layout.h"
 #include "../include/lustre_fid.h"
diff --git a/drivers/staging/lustre/lustre/fld/fld_cache.c 
b/drivers/staging/lustre/lustre/fld/fld_cache.c
index f5a340a..5d95d0b 100644
--- a/drivers/staging/lustre/lustre/fld/fld_cache.c
+++ b/drivers/staging/lustre/lustre/fld/fld_cache.c
@@ -54,7 +54,6 @@
 #include "../include/lprocfs_status.h"
 
 #include "../include/dt_object.h"
-#include "../include/md_object.h"
 #include "../include/lustre_req_layout.h"
 #include "../include/lustre_fld.h"
 #include "fld_internal.h"
diff --git a/drivers/staging/lustre/lustre/fld/fld_request.c 
b/drivers/staging/lustre/lustre/fld/fld_request.c
index f63c669..02454db 100644
--- a/drivers/staging/lustre/lustre/fld/fld_request.c
+++ b/drivers/staging/lustre/lustre/fld/fld_request.c
@@ -53,7 +53,6 @@
 #include "../include/lprocfs_status.h"
 
 #include "../include/dt_object.h"
-#include "../include/md_object.h"
 #include "../include/lustre_req_layout.h"
 #include "../include/lustre_fld.h"
 #include "../include/lustre_mdc.h"
diff --git a/drivers/staging/lustre/lustre/fld/lproc_fld.c 
b/drivers/staging/lustre/lustre/fld/lproc_fld.c
index 7f6bcc6..95e7de1 100644
--- a/drivers/staging/lustre/lustre/fld/lproc_fld.c
+++ b/drivers/staging/lustre/lustre/fld/lproc_fld.c
@@ -49,7 +49,6 @@
 #include "../include/obd.h"
 #include "../include/obd_class.h"
 #include "../include/dt_object.h"
-#include "../include/md_object.h"
 #include "../include/obd_support.h"
 #include "../include/lustre_req_layout.h"
 #include "../include/lustre_fld.h"
diff --git a/drivers/staging/lustre/lustre/include/md_object.h 
b/drivers/staging/lustre/lustre/include/md_object.h
deleted file mode 100644
index 454a230..000
--- a/drivers/staging/lustre/lustre/include/md_object.h
+++ /dev/null
@@ -1,899 +0,0 @@
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2011, 2012, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * lustre/include/md_object.h
- *
- * Extension of lu_object.h for metadata objects
- */
-
-#ifndef _LUSTRE_MD_OBJECT_H
-#define _LUSTRE_MD_OBJECT_H
-
-/** \defgroup md md
- * Sub-class of lu_object with methods common for "meta-data" objects in MDT
- * stack.
- *
- * Meta-data objects implement namespace operations: you can link, unlink
- * them, and treat them as directories.
- *
- * Examples: mdt, cmm, and mdt are implementations of md interface.
- * @{
- */
-
-
-/*
- * super-class definitions.
- */
-#include "dt_object.h"
-
-struct md_device;
-struct md_device_operations;
-struct md_object;
-struct obd_export;
-
-enum {
-   UCRED_INVALID   = -1,
-   UCRED_INIT  = 0,
-   UCRED_OLD   = 1,
-   UCRED_NEW   = 2
-};
-
-enum {
-   MD_CAPAINFO_MAX = 5
-};
-
-/** there are at most 5 fids in one 

[PATCH 08/12] staging/lustre/mgc: remove server specific handlers

2014-08-30 Thread Oleg Drokin
From: "John L. Hammond" 

Remove the server specific set_info handlers (KEY_REGISTER_TARGET,
KEY_SET_FS, KEY_CLEAR_FS) and supporting functions.

Signed-off-by: John L. Hammond 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/mgc/mgc_request.c | 177 
 1 file changed, 177 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c 
b/drivers/staging/lustre/lustre/mgc/mgc_request.c
index b21a135..970e91c 100644
--- a/drivers/staging/lustre/lustre/mgc/mgc_request.c
+++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c
@@ -47,7 +47,6 @@
 #include "../include/lprocfs_status.h"
 #include "../include/lustre_log.h"
 #include "../include/lustre_disk.h"
-#include "../include/dt_object.h"
 
 #include "mgc_internal.h"
 
@@ -628,150 +627,6 @@ static void mgc_requeue_add(struct config_llog_data *cld)
}
 }
 
-/** class fns **/
-static int mgc_local_llog_init(const struct lu_env *env,
-  struct obd_device *obd,
-  struct obd_device *disk)
-{
-   struct llog_ctxt*ctxt;
-   int  rc;
-
-   rc = llog_setup(env, obd, >obd_olg, LLOG_CONFIG_ORIG_CTXT, disk,
-   _osd_ops);
-   if (rc)
-   return rc;
-
-   ctxt = llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
-   LASSERT(ctxt);
-   ctxt->loc_dir = obd->u.cli.cl_mgc_configs_dir;
-   llog_ctxt_put(ctxt);
-
-   return 0;
-}
-
-static int mgc_local_llog_fini(const struct lu_env *env,
-  struct obd_device *obd)
-{
-   struct llog_ctxt *ctxt;
-
-   ctxt = llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
-   llog_cleanup(env, ctxt);
-
-   return 0;
-}
-
-static int mgc_fs_setup(struct obd_device *obd, struct super_block *sb)
-{
-   struct lustre_sb_info   *lsi = s2lsi(sb);
-   struct client_obd   *cli = >u.cli;
-   struct lu_fidrfid, fid;
-   struct dt_object*root, *dto;
-   struct lu_env   *env;
-   int  rc = 0;
-
-   LASSERT(lsi);
-   LASSERT(lsi->lsi_dt_dev);
-
-   OBD_ALLOC_PTR(env);
-   if (env == NULL)
-   return -ENOMEM;
-
-   /* The mgc fs exclusion mutex. Only one fs can be setup at a time. */
-   mutex_lock(>cl_mgc_mutex);
-
-   cfs_cleanup_group_info();
-
-   /* Setup the configs dir */
-   rc = lu_env_init(env, LCT_MG_THREAD);
-   if (rc)
-   goto out_err;
-
-   fid.f_seq = FID_SEQ_LOCAL_NAME;
-   fid.f_oid = 1;
-   fid.f_ver = 0;
-   rc = local_oid_storage_init(env, lsi->lsi_dt_dev, ,
-   >cl_mgc_los);
-   if (rc)
-   goto out_env;
-
-   rc = dt_root_get(env, lsi->lsi_dt_dev, );
-   if (rc)
-   goto out_env;
-
-   root = dt_locate_at(env, lsi->lsi_dt_dev, ,
-   >cl_mgc_los->los_dev->dd_lu_dev);
-   if (unlikely(IS_ERR(root))) {
-   rc = PTR_ERR(root);
-   goto out_los;
-   }
-
-   dto = local_file_find_or_create(env, cli->cl_mgc_los, root,
-   MOUNT_CONFIGS_DIR,
-   S_IFDIR | S_IRUGO | S_IWUSR | S_IXUGO);
-   lu_object_put_nocache(env, >do_lu);
-   if (IS_ERR(dto)) {
-   rc = PTR_ERR(dto);
-   goto out_los;
-   }
-
-   cli->cl_mgc_configs_dir = dto;
-
-   LASSERT(lsi->lsi_osd_exp->exp_obd->obd_lvfs_ctxt.dt);
-   rc = mgc_local_llog_init(env, obd, lsi->lsi_osd_exp->exp_obd);
-   if (rc)
-   goto out_llog;
-
-   /* We take an obd ref to insure that we can't get to mgc_cleanup
-* without calling mgc_fs_cleanup first. */
-   class_incref(obd, "mgc_fs", obd);
-
-   /* We keep the cl_mgc_sem until mgc_fs_cleanup */
-out_llog:
-   if (rc) {
-   lu_object_put(env, >cl_mgc_configs_dir->do_lu);
-   cli->cl_mgc_configs_dir = NULL;
-   }
-out_los:
-   if (rc < 0) {
-   local_oid_storage_fini(env, cli->cl_mgc_los);
-   cli->cl_mgc_los = NULL;
-   mutex_unlock(>cl_mgc_mutex);
-   }
-out_env:
-   lu_env_fini(env);
-out_err:
-   OBD_FREE_PTR(env);
-   return rc;
-}
-
-static int mgc_fs_cleanup(struct obd_device *obd)
-{
-   struct lu_envenv;
-   struct client_obd   *cli = >u.cli;
-   int  rc;
-
-   LASSERT(cli->cl_mgc_los != NULL);
-
-   rc = lu_env_init(, LCT_MG_THREAD);
-   if (rc)
-   goto unlock;
-
-   mgc_local_llog_fini(, obd);
-
-   lu_object_put_nocache(, >cl_mgc_configs_dir->do_lu);
-   cli->cl_mgc_configs_dir = NULL;
-
-   local_oid_storage_fini(, cli->cl_mgc_los);
-   cli->cl_mgc_los = NULL;
-   lu_env_fini();
-
-unlock:
-   class_decref(obd, "mgc_fs", obd);
-   

Re: [PATCH v2 6/9] usb: xhci: Add NVIDIA Tegra xHCI host-controller driver

2014-08-30 Thread Greg Kroah-Hartman
On Mon, Aug 18, 2014 at 10:08:22AM -0700, Andrew Bresticker wrote:
> Add support for the on-chip xHCI host controller present on Tegra SoCs.
> 
> The driver is currently very basic: it loads the controller with its
> firmware, starts the controller, and is able to service messages sent
> by the controller's firmware.  The hardware supports device mode as
> well as lower-power operating modes, but support for these is not yet
> implemented here.

So you are saying the device doesn't really work?  Can it handle USB
transactions properly?

I have a jetson board here, is this the controller for that hardware?
Can I test this series on that platform, or is it for something else?

> +static const struct tegra_xhci_soc_config tegra124_soc_config = {
> + .firmware_file = "nvidia/tegra124/xusb.bin",
> +};
> +MODULE_FIRMWARE("nvidia/tegra124/xusb.bin");

Has this file been submitted to the linux-firmware tree?

thanks,

greg k-h
--
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/


[PATCH 05/12] staging/lustre/obdclass: remove lu_ucred.c

2014-08-30 Thread Oleg Drokin
From: "John L. Hammond" 

The functions exported by lustre/obdclass/lu_ucred.c are not used so
remove that file.

Signed-off-by: John L. Hammond 
---
 drivers/staging/lustre/lustre/obdclass/Makefile   |   3 +-
 drivers/staging/lustre/lustre/obdclass/lu_ucred.c | 107 --
 2 files changed, 1 insertion(+), 109 deletions(-)
 delete mode 100644 drivers/staging/lustre/lustre/obdclass/lu_ucred.c

diff --git a/drivers/staging/lustre/lustre/obdclass/Makefile 
b/drivers/staging/lustre/lustre/obdclass/Makefile
index 989fb7c..91a5a2b 100644
--- a/drivers/staging/lustre/lustre/obdclass/Makefile
+++ b/drivers/staging/lustre/lustre/obdclass/Makefile
@@ -6,5 +6,4 @@ obdclass-y := linux/linux-module.o linux/linux-obdo.o 
linux/linux-sysctl.o \
  lustre_handles.o lustre_peer.o llog_osd.o \
  local_storage.o statfs_pack.o obdo.o obd_config.o obd_mount.o\
  mea.o lu_object.o dt_object.o capa.o cl_object.o   \
- cl_page.o cl_lock.o cl_io.o lu_ref.o acl.o \
- lu_ucred.o
+ cl_page.o cl_lock.o cl_io.o lu_ref.o acl.o
diff --git a/drivers/staging/lustre/lustre/obdclass/lu_ucred.c 
b/drivers/staging/lustre/lustre/obdclass/lu_ucred.c
deleted file mode 100644
index 3676563..000
--- a/drivers/staging/lustre/lustre/obdclass/lu_ucred.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2011, 2012, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * lustre/obdclass/lu_ucred.c
- *
- * Lustre user credentials context infrastructure.
- *
- *   Author: Nikita Danilov 
- *   Author: Fan Yong 
- *   Author: Vitaly Fertman 
- */
-
-#define DEBUG_SUBSYSTEM S_CLASS
-
-#include "../../include/linux/libcfs/libcfs.h"
-#include "../include/obd_support.h"
-#include "../include/lu_object.h"
-#include "../include/md_object.h"
-
-/* context key constructor/destructor: lu_ucred_key_init, lu_ucred_key_fini */
-LU_KEY_INIT_FINI(lu_ucred, struct lu_ucred);
-
-static struct lu_context_key lu_ucred_key = {
-   .lct_tags = LCT_SESSION,
-   .lct_init = lu_ucred_key_init,
-   .lct_fini = lu_ucred_key_fini
-};
-
-/**
- * Get ucred key if session exists and ucred key is allocated on it.
- * Return NULL otherwise.
- */
-struct lu_ucred *lu_ucred(const struct lu_env *env)
-{
-   if (!env->le_ses)
-   return NULL;
-   return lu_context_key_get(env->le_ses, _ucred_key);
-}
-EXPORT_SYMBOL(lu_ucred);
-
-/**
- * Get ucred key and check if it is properly initialized.
- * Return NULL otherwise.
- */
-struct lu_ucred *lu_ucred_check(const struct lu_env *env)
-{
-   struct lu_ucred *uc = lu_ucred(env);
-   if (uc && uc->uc_valid != UCRED_OLD && uc->uc_valid != UCRED_NEW)
-   return NULL;
-   return uc;
-}
-EXPORT_SYMBOL(lu_ucred_check);
-
-/**
- * Get ucred key, which must exist and must be properly initialized.
- * Assert otherwise.
- */
-struct lu_ucred *lu_ucred_assert(const struct lu_env *env)
-{
-   struct lu_ucred *uc = lu_ucred_check(env);
-   LASSERT(uc != NULL);
-   return uc;
-}
-EXPORT_SYMBOL(lu_ucred_assert);
-
-int lu_ucred_global_init(void)
-{
-   LU_CONTEXT_KEY_INIT(_ucred_key);
-   return lu_context_key_register(_ucred_key);
-}
-
-void lu_ucred_global_fini(void)
-{
-   lu_context_key_degister(_ucred_key);
-}
-- 
1.9.3

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


[PATCH 09/12] staging/lustre/obdclass: remove llog_test.ko

2014-08-30 Thread Oleg Drokin
From: "John L. Hammond" 

The llog_test module requires server support (it needs a local MGS to
function) and should not have been included.

Signed-off-by: John L. Hammond 
---
 drivers/staging/lustre/lustre/obdclass/Makefile|2 +-
 drivers/staging/lustre/lustre/obdclass/llog_test.c | 1072 
 2 files changed, 1 insertion(+), 1073 deletions(-)
 delete mode 100644 drivers/staging/lustre/lustre/obdclass/llog_test.c

diff --git a/drivers/staging/lustre/lustre/obdclass/Makefile 
b/drivers/staging/lustre/lustre/obdclass/Makefile
index f1dcf8e..9a2b83f 100644
--- a/drivers/staging/lustre/lustre/obdclass/Makefile
+++ b/drivers/staging/lustre/lustre/obdclass/Makefile
@@ -1,4 +1,4 @@
-obj-$(CONFIG_LUSTRE_FS) += obdclass.o llog_test.o
+obj-$(CONFIG_LUSTRE_FS) += obdclass.o
 
 obdclass-y := linux/linux-module.o linux/linux-obdo.o linux/linux-sysctl.o \
  llog.o llog_cat.o llog_obd.o llog_swab.o class_obd.o debug.o \
diff --git a/drivers/staging/lustre/lustre/obdclass/llog_test.c 
b/drivers/staging/lustre/lustre/obdclass/llog_test.c
deleted file mode 100644
index ef008ab..000
--- a/drivers/staging/lustre/lustre/obdclass/llog_test.c
+++ /dev/null
@@ -1,1072 +0,0 @@
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2012, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * lustre/obdclass/llog_test.c
- *
- * Author: Phil Schwan 
- * Author: Mikhail Pershin 
- */
-
-#define DEBUG_SUBSYSTEM S_CLASS
-
-#include 
-#include 
-
-#include "../include/obd_class.h"
-#include "../include/lustre_fid.h"
-#include "../include/lustre_log.h"
-
-/* This is slightly more than the number of records that can fit into a
- * single llog file, because the llog_log_header takes up some of the
- * space in the first block that cannot be used for the bitmap. */
-#define LLOG_TEST_RECNUM  (LLOG_CHUNK_SIZE * 8)
-
-static int llog_test_rand;
-static struct obd_uuid uuid = { .uuid = "test_uuid" };
-static struct llog_logid cat_logid;
-
-struct llog_mini_rec {
-   struct llog_rec_hdr lmr_hdr;
-   struct llog_rec_taillmr_tail;
-} __attribute__((packed));
-
-static int verify_handle(char *test, struct llog_handle *llh, int num_recs)
-{
-   int i;
-   int last_idx = 0;
-   int active_recs = 0;
-
-   for (i = 0; i < LLOG_BITMAP_BYTES * 8; i++) {
-   if (ext2_test_bit(i, llh->lgh_hdr->llh_bitmap)) {
-   last_idx = i;
-   active_recs++;
-   }
-   }
-
-   if (active_recs != num_recs) {
-   CERROR("%s: expected %d active recs after write, found %d\n",
-  test, num_recs, active_recs);
-   return -ERANGE;
-   }
-
-   if (llh->lgh_hdr->llh_count != num_recs) {
-   CERROR("%s: handle->count is %d, expected %d after write\n",
-  test, llh->lgh_hdr->llh_count, num_recs);
-   return -ERANGE;
-   }
-
-   if (llh->lgh_last_idx < last_idx) {
-   CERROR("%s: handle->last_idx is %d, expected %d after write\n",
-  test, llh->lgh_last_idx, last_idx);
-   return -ERANGE;
-   }
-
-   return 0;
-}
-
-/* Test named-log create/open, close */
-static int llog_test_1(const struct lu_env *env,
-  struct obd_device *obd, char *name)
-{
-   struct llog_handle  *llh;
-   struct llog_ctxt*ctxt;
-   int rc;
-   int rc2;
-
-   CWARN("1a: create a log with name: %s\n", name);
-   ctxt = llog_get_context(obd, LLOG_TEST_ORIG_CTXT);
-   LASSERT(ctxt);
-
-   rc = llog_open_create(env, ctxt, , NULL, name);
-   if (rc) {
-   CERROR("1a: llog_create with name %s failed: %d\n", name, rc);
-   GOTO(out, rc);
-   }

[PATCH 01/12] staging/lustre: Remove unused header libcfs_heap.h

2014-08-30 Thread Oleg Drokin
With removal of libcfs/heap.c, it's header can also go away now.

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/include/linux/libcfs/libcfs.h   |   1 -
 .../lustre/include/linux/libcfs/libcfs_heap.h  | 200 -
 drivers/staging/lustre/lustre/include/lustre_net.h |   1 -
 3 files changed, 202 deletions(-)
 delete mode 100644 drivers/staging/lustre/include/linux/libcfs/libcfs_heap.h

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
index 7d37bec..1122ae9 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
@@ -165,7 +165,6 @@ void cfs_get_random_bytes(void *buf, int size);
 #include "libcfs_kernelcomm.h"
 #include "libcfs_workitem.h"
 #include "libcfs_hash.h"
-#include "libcfs_heap.h"
 #include "libcfs_fail.h"
 #include "libcfs_crypto.h"
 
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_heap.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_heap.h
deleted file mode 100644
index bfa6d7b..000
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_heap.h
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License version 2 for more details.  A copy is
- * included in the COPYING file that accompanied this code.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2011 Intel Corporation
- */
-/*
- * libcfs/include/libcfs/heap.h
- *
- * Author: Eric Barton 
- *Liang Zhen   
- */
-
-#ifndef __LIBCFS_HEAP_H__
-#define __LIBCFS_HEAP_H__
-
-/** \defgroup heap Binary heap
- *
- * The binary heap is a scalable data structure created using a binary tree. It
- * is capable of maintaining large sets of elements sorted usually by one or
- * more element properties, but really based on anything that can be used as a
- * binary predicate in order to determine the relevant ordering of any two 
nodes
- * that belong to the set. There is no search operation, rather the intention 
is
- * for the element of the lowest priority which will always be at the root of
- * the tree (as this is an implementation of a min-heap) to be removed by users
- * for consumption.
- *
- * Users of the heap should embed a \e cfs_binheap_node_t object instance on
- * every object of the set that they wish the binary heap instance to handle,
- * and (at a minimum) provide a cfs_binheap_ops_t::hop_compare() implementation
- * which is used by the heap as the binary predicate during its internal 
sorting
- * operations.
- *
- * The current implementation enforces no locking scheme, and so assumes the
- * user caters for locking between calls to insert, delete and lookup
- * operations. Since the only consumer for the data structure at this point
- * are NRS policies, and these operate on a per-CPT basis, binary heap 
instances
- * are tied to a specific CPT.
- * @{
- */
-
-/**
- * Binary heap node.
- *
- * Objects of this type are embedded into objects of the ordered set that is to
- * be maintained by a \e cfs_binheap_t instance.
- */
-typedef struct {
-   /** Index into the binary tree */
-   unsigned intchn_index;
-} cfs_binheap_node_t;
-
-#define CBH_SHIFT  9
-#define CBH_SIZE   (1 << CBH_SHIFT)/* # ptrs per level 
*/
-#define CBH_MASK   (CBH_SIZE - 1)
-#define CBH_NOB(CBH_SIZE * sizeof(cfs_binheap_node_t *))
-
-#define CBH_POISON 0xdeadbeef
-
-/**
- * Binary heap flags.
- */
-enum {
-   CBH_FLAG_ATOMIC_GROW= 1,
-};
-
-struct cfs_binheap;
-
-/**
- * Binary heap operations.
- */
-typedef struct {
-   /**
-* Called right before inserting a node into the binary heap.
-*
-* Implementing this operation is optional.
-*
-* \param[in] h The heap
-* \param[in] e The node
-*
-* \retval 0 success
-* \retval != 0 error
-*/
-   int (*hop_enter)(struct cfs_binheap *h,
-cfs_binheap_node_t *e);
-   /**
-* Called right after removing a node from the binary heap.
-*
-* Implementing this operation is optional.
-*
-* \param[in] h The heap
-* \param[in] e The node
-*/
-   void(*hop_exit)(struct 

[PATCH 10/12] staging/lustre/obdclass: remove llog_osd.c

2014-08-30 Thread Oleg Drokin
From: "John L. Hammond" 

llog_osd_ops is not used so remove it and its supporting methods.

Signed-off-by: John L. Hammond 
---
 drivers/staging/lustre/lustre/include/lustre_log.h |9 -
 drivers/staging/lustre/lustre/obdclass/Makefile|2 +-
 drivers/staging/lustre/lustre/obdclass/llog_osd.c  | 1290 
 3 files changed, 1 insertion(+), 1300 deletions(-)
 delete mode 100644 drivers/staging/lustre/lustre/obdclass/llog_osd.c

diff --git a/drivers/staging/lustre/lustre/include/lustre_log.h 
b/drivers/staging/lustre/lustre/include/lustre_log.h
index 3944c6d..ed97887 100644
--- a/drivers/staging/lustre/lustre/include/lustre_log.h
+++ b/drivers/staging/lustre/lustre/include/lustre_log.h
@@ -313,15 +313,6 @@ struct llog_handle {
atomic_t lgh_refcount;
 };
 
-/* llog_osd.c */
-extern struct llog_operations llog_osd_ops;
-int llog_osd_get_cat_list(const struct lu_env *env, struct dt_device *d,
- int idx, int count,
- struct llog_catid *idarray);
-int llog_osd_put_cat_list(const struct lu_env *env, struct dt_device *d,
- int idx, int count,
- struct llog_catid *idarray);
-
 #define LLOG_CTXT_FLAG_UNINITIALIZED 0x0001
 #define LLOG_CTXT_FLAG_STOP 0x0002
 
diff --git a/drivers/staging/lustre/lustre/obdclass/Makefile 
b/drivers/staging/lustre/lustre/obdclass/Makefile
index 9a2b83f..c8c95e1 100644
--- a/drivers/staging/lustre/lustre/obdclass/Makefile
+++ b/drivers/staging/lustre/lustre/obdclass/Makefile
@@ -3,7 +3,7 @@ obj-$(CONFIG_LUSTRE_FS) += obdclass.o
 obdclass-y := linux/linux-module.o linux/linux-obdo.o linux/linux-sysctl.o \
  llog.o llog_cat.o llog_obd.o llog_swab.o class_obd.o debug.o \
  genops.o uuid.o llog_ioctl.o lprocfs_status.o\
- lustre_handles.o lustre_peer.o llog_osd.o \
+ lustre_handles.o lustre_peer.o \
  local_storage.o statfs_pack.o obdo.o obd_config.o obd_mount.o\
  lu_object.o dt_object.o capa.o cl_object.o   \
  cl_page.o cl_lock.o cl_io.o lu_ref.o acl.o
diff --git a/drivers/staging/lustre/lustre/obdclass/llog_osd.c 
b/drivers/staging/lustre/lustre/obdclass/llog_osd.c
deleted file mode 100644
index 2c6a51e..000
--- a/drivers/staging/lustre/lustre/obdclass/llog_osd.c
+++ /dev/null
@@ -1,1290 +0,0 @@
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2012, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * lustre/obdclass/llog_osd.c - low level llog routines on top of OSD API
- *
- * Author: Alexey Zhuravlev 
- * Author: Mikhail Pershin 
- */
-
-#define DEBUG_SUBSYSTEM S_LOG
-
-#include "../include/obd.h"
-#include "../include/obd_class.h"
-#include "../include/lustre_fid.h"
-#include "../include/dt_object.h"
-
-#include "llog_internal.h"
-#include "local_storage.h"
-
-/*
- * - multi-chunks or big-declaration approach
- * - use unique sequence instead of llog sb tracking unique ids
- * - re-use existing environment
- * - named llog support (can be used for testing only at the present)
- * - llog_origin_connect() work with OSD API
- */
-
-static int llog_osd_declare_new_object(const struct lu_env *env,
-  struct local_oid_storage *los,
-  struct dt_object *o,
-  struct thandle *th)
-{
-   struct llog_thread_info *lgi = llog_info(env);
-
-   lgi->lgi_attr.la_valid = LA_MODE;
-   lgi->lgi_attr.la_mode = S_IFREG | S_IRUGO | S_IWUSR;
-   lgi->lgi_dof.dof_type = dt_mode_to_dft(S_IFREG);
-
-   return local_object_declare_create(env, los, o, >lgi_attr,
-  >lgi_dof, th);
-}
-

[PATCH 04/12] staging/lustre/obdclass: remove idmap.c

2014-08-30 Thread Oleg Drokin
From: "John L. Hammond" 

The functions defined in lustre/include/lustre_idmap.h are not used so
remove them.

Signed-off-by: John L. Hammond 
Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/lustre_idmap.h   | 104 -
 drivers/staging/lustre/lustre/obdclass/Makefile|   2 +-
 drivers/staging/lustre/lustre/obdclass/idmap.c | 477 -
 3 files changed, 1 insertion(+), 582 deletions(-)
 delete mode 100644 drivers/staging/lustre/lustre/include/lustre_idmap.h
 delete mode 100644 drivers/staging/lustre/lustre/obdclass/idmap.c

diff --git a/drivers/staging/lustre/lustre/include/lustre_idmap.h 
b/drivers/staging/lustre/lustre/include/lustre_idmap.h
deleted file mode 100644
index 5624b8b..000
--- a/drivers/staging/lustre/lustre/include/lustre_idmap.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2012, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * lustre/lustre/include/lustre_idmap.h
- *
- * MDS data structures.
- * See also lustre_idl.h for wire formats of requests.
- */
-
-#ifndef _LUSTRE_IDMAP_H
-#define _LUSTRE_IDMAP_H
-
-/** \defgroup idmap idmap
- *
- * @{
- */
-
-#include "../../include/linux/libcfs/libcfs.h"
-
-#define CFS_NGROUPS_PER_BLOCK   ((int)(PAGE_CACHE_SIZE / sizeof(gid_t)))
-
-#define CFS_GROUP_AT(gi, i) \
-   ((gi)->blocks[(i) / CFS_NGROUPS_PER_BLOCK][(i) % CFS_NGROUPS_PER_BLOCK])
-
-enum {
-   CFS_IC_NOTHING = 0,/* convert nothing */
-   CFS_IC_ALL   = 1,/* convert all items */
-   CFS_IC_MAPPED  = 2,/* convert mapped uid/gid */
-   CFS_IC_UNMAPPED= 3 /* convert unmapped uid/gid */
-};
-
-#define  CFS_IDMAP_NOTFOUND (-1)
-
-#define CFS_IDMAP_HASHSIZE  32
-
-enum lustre_idmap_idx {
-   RMT_UIDMAP_IDX,
-   LCL_UIDMAP_IDX,
-   RMT_GIDMAP_IDX,
-   LCL_GIDMAP_IDX,
-   CFS_IDMAP_N_HASHES
-};
-
-struct lustre_idmap_table {
-   spinlock_t  lit_lock;
-   struct list_head
lit_idmaps[CFS_IDMAP_N_HASHES][CFS_IDMAP_HASHSIZE];
-};
-
-struct lu_ucred;
-
-extern void lustre_groups_from_list(struct group_info *ginfo, gid_t *glist);
-extern void lustre_groups_sort(struct group_info *group_info);
-extern int lustre_in_group_p(struct lu_ucred *mu, gid_t grp);
-
-extern int lustre_idmap_add(struct lustre_idmap_table *t,
-   uid_t ruid, uid_t luid,
-   gid_t rgid, gid_t lgid);
-extern int lustre_idmap_del(struct lustre_idmap_table *t,
-   uid_t ruid, uid_t luid,
-   gid_t rgid, gid_t lgid);
-extern int lustre_idmap_lookup_uid(struct lu_ucred *mu,
-  struct lustre_idmap_table *t,
-  int reverse, uid_t uid);
-extern int lustre_idmap_lookup_gid(struct lu_ucred *mu,
-  struct lustre_idmap_table *t,
-  int reverse, gid_t gid);
-extern struct lustre_idmap_table *lustre_idmap_init(void);
-extern void lustre_idmap_fini(struct lustre_idmap_table *t);
-
-/** @} idmap */
-
-#endif
diff --git a/drivers/staging/lustre/lustre/obdclass/Makefile 
b/drivers/staging/lustre/lustre/obdclass/Makefile
index ba10043..989fb7c 100644
--- a/drivers/staging/lustre/lustre/obdclass/Makefile
+++ b/drivers/staging/lustre/lustre/obdclass/Makefile
@@ -6,5 +6,5 @@ obdclass-y := linux/linux-module.o linux/linux-obdo.o 
linux/linux-sysctl.o \
  lustre_handles.o lustre_peer.o llog_osd.o \
  local_storage.o statfs_pack.o obdo.o obd_config.o obd_mount.o\
  mea.o lu_object.o dt_object.o capa.o cl_object.o   \
- cl_page.o cl_lock.o cl_io.o lu_ref.o acl.o idmap.o   \
+ cl_page.o cl_lock.o 

[PATCH 12/12] staging/lustre: remove unused som_attrs and hsm_attrs structures

2014-08-30 Thread Oleg Drokin
These structures are only used server-side to parse relevant
attributes.

Signed-off-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre/lustre_idl.h  | 37 -
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c| 48 --
 2 files changed, 85 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 88c3990..e529ad4 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -322,43 +322,6 @@ enum lma_incompat {
 #define LMA_INCOMPAT_SUPP  (LMAI_AGENT | LMAI_REMOTE_PARENT)
 
 /**
- * SOM on-disk attributes stored in a separate xattr.
- */
-struct som_attrs {
-   /** Bitfield for supported data in this structure. For future use. */
-   __u32   som_compat;
-
-   /** Incompat feature list. The supported feature mask is available in
-* SOM_INCOMPAT_SUPP */
-   __u32   som_incompat;
-
-   /** IO Epoch SOM attributes belongs to */
-   __u64   som_ioepoch;
-   /** total file size in objects */
-   __u64   som_size;
-   /** total fs blocks in objects */
-   __u64   som_blocks;
-   /** mds mount id the size is valid for */
-   __u64   som_mountid;
-};
-#define SOM_INCOMPAT_SUPP 0x0
-
-/**
- * HSM on-disk attributes stored in a separate xattr.
- */
-struct hsm_attrs {
-   /** Bitfield for supported data in this structure. For future use. */
-   __u32   hsm_compat;
-
-   /** HSM flags, see hsm_flags enum below */
-   __u32   hsm_flags;
-   /** backend archive id associated with the file */
-   __u64   hsm_arch_id;
-   /** version associated with the last archiving, if any */
-   __u64   hsm_arch_ver;
-};
-
-/**
  * fid constants
  */
 enum {
diff --git a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c 
b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
index 0624420..d6d9204 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
@@ -460,54 +460,6 @@ void lustre_assert_wire_constants(void)
LASSERTF(OBJ_INDEX_DELETE == 11, "found %lld\n",
 (long long)OBJ_INDEX_DELETE);
 
-   /* Checks for struct som_attrs */
-   LASSERTF((int)sizeof(struct som_attrs) == 40, "found %lld\n",
-(long long)(int)sizeof(struct som_attrs));
-   LASSERTF((int)offsetof(struct som_attrs, som_compat) == 0, "found 
%lld\n",
-(long long)(int)offsetof(struct som_attrs, som_compat));
-   LASSERTF((int)sizeof(((struct som_attrs *)0)->som_compat) == 4, "found 
%lld\n",
-(long long)(int)sizeof(((struct som_attrs *)0)->som_compat));
-   LASSERTF((int)offsetof(struct som_attrs, som_incompat) == 4, "found 
%lld\n",
-(long long)(int)offsetof(struct som_attrs, som_incompat));
-   LASSERTF((int)sizeof(((struct som_attrs *)0)->som_incompat) == 4, 
"found %lld\n",
-(long long)(int)sizeof(((struct som_attrs *)0)->som_incompat));
-   LASSERTF((int)offsetof(struct som_attrs, som_ioepoch) == 8, "found 
%lld\n",
-(long long)(int)offsetof(struct som_attrs, som_ioepoch));
-   LASSERTF((int)sizeof(((struct som_attrs *)0)->som_ioepoch) == 8, "found 
%lld\n",
-(long long)(int)sizeof(((struct som_attrs *)0)->som_ioepoch));
-   LASSERTF((int)offsetof(struct som_attrs, som_size) == 16, "found 
%lld\n",
-(long long)(int)offsetof(struct som_attrs, som_size));
-   LASSERTF((int)sizeof(((struct som_attrs *)0)->som_size) == 8, "found 
%lld\n",
-(long long)(int)sizeof(((struct som_attrs *)0)->som_size));
-   LASSERTF((int)offsetof(struct som_attrs, som_blocks) == 24, "found 
%lld\n",
-(long long)(int)offsetof(struct som_attrs, som_blocks));
-   LASSERTF((int)sizeof(((struct som_attrs *)0)->som_blocks) == 8, "found 
%lld\n",
-(long long)(int)sizeof(((struct som_attrs *)0)->som_blocks));
-   LASSERTF((int)offsetof(struct som_attrs, som_mountid) == 32, "found 
%lld\n",
-(long long)(int)offsetof(struct som_attrs, som_mountid));
-   LASSERTF((int)sizeof(((struct som_attrs *)0)->som_mountid) == 8, "found 
%lld\n",
-(long long)(int)sizeof(((struct som_attrs *)0)->som_mountid));
-
-   /* Checks for struct hsm_attrs */
-   LASSERTF((int)sizeof(struct hsm_attrs) == 24, "found %lld\n",
-(long long)(int)sizeof(struct hsm_attrs));
-   LASSERTF((int)offsetof(struct hsm_attrs, hsm_compat) == 0, "found 
%lld\n",
-(long long)(int)offsetof(struct hsm_attrs, hsm_compat));
-   LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_compat) == 4, "found 
%lld\n",
-(long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_compat));
-   LASSERTF((int)offsetof(struct hsm_attrs, hsm_flags) == 4, "found 
%lld\n",

[PATCH 11/12] staging/lustre/mdc: remove obsolete llog ioctl handlers

2014-08-30 Thread Oleg Drokin
From: "John L. Hammond" 

In mdc_iocontrol() remove the handlers for the obsolete llog ioctls
OBD_IOC_PARSE, OBD_IOC_LLOG_INFO, and OBD_IOC_LLOG_PRINT.

Signed-off-by: John L. Hammond 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/mdc/mdc_request.c | 15 ---
 1 file changed, 15 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c 
b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index a2a6334..e6e2515 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -1830,7 +1830,6 @@ static int mdc_iocontrol(unsigned int cmd, struct 
obd_export *exp, int len,
struct obd_device *obd = exp->exp_obd;
struct obd_ioctl_data *data = karg;
struct obd_import *imp = obd->u.cli.cl_import;
-   struct llog_ctxt *ctxt;
int rc;
 
if (!try_module_get(THIS_MODULE)) {
@@ -1886,20 +1885,6 @@ static int mdc_iocontrol(unsigned int cmd, struct 
obd_export *exp, int len,
case IOC_OSC_SET_ACTIVE:
rc = ptlrpc_set_import_active(imp, data->ioc_offset);
goto out;
-   case OBD_IOC_PARSE: {
-   ctxt = llog_get_context(exp->exp_obd, LLOG_CONFIG_REPL_CTXT);
-   rc = class_config_parse_llog(NULL, ctxt, data->ioc_inlbuf1,
-NULL);
-   llog_ctxt_put(ctxt);
-   goto out;
-   }
-   case OBD_IOC_LLOG_INFO:
-   case OBD_IOC_LLOG_PRINT: {
-   ctxt = llog_get_context(obd, LLOG_CONFIG_REPL_CTXT);
-   rc = llog_ioctl(NULL, ctxt, cmd, data);
-   llog_ctxt_put(ctxt);
-   goto out;
-   }
case OBD_IOC_POLL_QUOTACHECK:
rc = mdc_quota_poll_check(exp, (struct if_quotacheck *)karg);
goto out;
-- 
1.9.3

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


[PATCH 06/12] staging/lustre/obdclass: remove mea.c

2014-08-30 Thread Oleg Drokin
From: "John L. Hammond" 

The functions exported by lustre/obdclass/mea.c are not used so remove
them.

Signed-off-by: John L. Hammond 
---
 drivers/staging/lustre/lustre/include/obd_class.h |   4 -
 drivers/staging/lustre/lustre/obdclass/Makefile   |   2 +-
 drivers/staging/lustre/lustre/obdclass/mea.c  | 112 --
 3 files changed, 1 insertion(+), 117 deletions(-)
 delete mode 100644 drivers/staging/lustre/lustre/obdclass/mea.c

diff --git a/drivers/staging/lustre/lustre/include/obd_class.h 
b/drivers/staging/lustre/lustre/include/obd_class.h
index 4c64471..65143ab 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -2182,10 +2182,6 @@ int class_check_uuid(struct obd_uuid *uuid, __u64 nid);
 void class_init_uuidlist(void);
 void class_exit_uuidlist(void);
 
-/* mea.c */
-int mea_name2idx(struct lmv_stripe_md *mea, const char *name, int namelen);
-int raw_name2idx(int hashtype, int count, const char *name, int namelen);
-
 /* class_obd.c */
 extern char obd_jobid_node[];
 
diff --git a/drivers/staging/lustre/lustre/obdclass/Makefile 
b/drivers/staging/lustre/lustre/obdclass/Makefile
index 91a5a2b..f1dcf8e 100644
--- a/drivers/staging/lustre/lustre/obdclass/Makefile
+++ b/drivers/staging/lustre/lustre/obdclass/Makefile
@@ -5,5 +5,5 @@ obdclass-y := linux/linux-module.o linux/linux-obdo.o 
linux/linux-sysctl.o \
  genops.o uuid.o llog_ioctl.o lprocfs_status.o\
  lustre_handles.o lustre_peer.o llog_osd.o \
  local_storage.o statfs_pack.o obdo.o obd_config.o obd_mount.o\
- mea.o lu_object.o dt_object.o capa.o cl_object.o   \
+ lu_object.o dt_object.o capa.o cl_object.o   \
  cl_page.o cl_lock.o cl_io.o lu_ref.o acl.o
diff --git a/drivers/staging/lustre/lustre/obdclass/mea.c 
b/drivers/staging/lustre/lustre/obdclass/mea.c
deleted file mode 100644
index d6ce084..000
--- a/drivers/staging/lustre/lustre/obdclass/mea.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- */
-
-#define DEBUG_SUBSYSTEM S_CLASS
-#include "../include/obd_class.h"
-#include/* for request_module() */
-#include 
-#include 
-#include 
-#include "../include/lprocfs_status.h"
-#include "../include/lustre/lustre_idl.h"
-
-static int mea_last_char_hash(int count, char *name, int namelen)
-{
-   unsigned int c;
-
-   c = name[namelen - 1];
-   if (c == 0)
-   CWARN("looks like wrong len is passed\n");
-   c = c % count;
-   return c;
-}
-
-static int mea_all_chars_hash(int count, char *name, int namelen)
-{
-   unsigned int c = 0;
-
-   while (--namelen >= 0)
-   c += name[namelen];
-   c = c % count;
-   return c;
-}
-
-int raw_name2idx(int hashtype, int count, const char *name, int namelen)
-{
-   unsigned intc = 0;
-   int idx;
-
-   LASSERT(namelen > 0);
-
-   if (filename_is_volatile(name, namelen, )) {
-   if ((idx >= 0) && (idx < count))
-   return idx;
-   goto hashchoice;
-   }
-
-   if (count <= 1)
-   return 0;
-
-hashchoice:
-   switch (hashtype) {
-   case MEA_MAGIC_LAST_CHAR:
-   c = mea_last_char_hash(count, (char *)name, namelen);
-   break;
-   case MEA_MAGIC_ALL_CHARS:
-   c = mea_all_chars_hash(count, (char *)name, namelen);
-   break;
-   case MEA_MAGIC_HASH_SEGMENT:
-   CERROR("Unsupported hash type MEA_MAGIC_HASH_SEGMENT\n");
-   break;
-   default:
-   CERROR("Unknown hash type 0x%x\n", hashtype);
-   }
-
-   LASSERT(c < count);
-   return c;
-}

[PATCH 00/12] lustre: continues dead code removal

2014-08-30 Thread Oleg Drokin
This series of patches continues removal of unused code in
lustre client tree.

John L. Hammond (9):
  staging/lustre/obdecho: remove #if 0-ed out regions
  staging/lustre/obdclass: remove idmap.c
  staging/lustre/obdclass: remove lu_ucred.c
  staging/lustre/obdclass: remove mea.c
  staging/lustre: remove md_object.h
  staging/lustre/mgc: remove server specific handlers
  staging/lustre/obdclass: remove llog_test.ko
  staging/lustre/obdclass: remove llog_osd.c
  staging/lustre/mdc: remove obsolete llog ioctl handlers

Oleg Drokin (2):
  staging/lustre: Remove unused header libcfs_heap.h
  staging/lustre: remove unused som_attrs and hsm_attrs structures

Peng Tao (1):
  staging/lustre/obdecho: remove metadata echo client

 .../staging/lustre/include/linux/libcfs/libcfs.h   |1 -
 .../lustre/include/linux/libcfs/libcfs_heap.h  |  200 ---
 drivers/staging/lustre/lustre/fid/lproc_fid.c  |1 -
 drivers/staging/lustre/lustre/fld/fld_cache.c  |1 -
 drivers/staging/lustre/lustre/fld/fld_request.c|1 -
 drivers/staging/lustre/lustre/fld/lproc_fld.c  |1 -
 .../lustre/lustre/include/lustre/lustre_idl.h  |   37 -
 .../staging/lustre/lustre/include/lustre_idmap.h   |  104 --
 drivers/staging/lustre/lustre/include/lustre_log.h |9 -
 drivers/staging/lustre/lustre/include/lustre_net.h |1 -
 drivers/staging/lustre/lustre/include/md_object.h  |  899 --
 drivers/staging/lustre/lustre/include/obd_class.h  |4 -
 drivers/staging/lustre/lustre/mdc/mdc_request.c|   15 -
 drivers/staging/lustre/lustre/mgc/mgc_request.c|  177 ---
 drivers/staging/lustre/lustre/obdclass/Makefile|9 +-
 drivers/staging/lustre/lustre/obdclass/idmap.c |  477 
 drivers/staging/lustre/lustre/obdclass/llog_osd.c  | 1290 
 drivers/staging/lustre/lustre/obdclass/llog_test.c | 1072 
 drivers/staging/lustre/lustre/obdclass/lu_ucred.c  |  107 --
 drivers/staging/lustre/lustre/obdclass/mea.c   |  112 --
 .../staging/lustre/lustre/obdecho/echo_client.c| 1103 +
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c|   48 -
 22 files changed, 50 insertions(+), 5619 deletions(-)
 delete mode 100644 drivers/staging/lustre/include/linux/libcfs/libcfs_heap.h
 delete mode 100644 drivers/staging/lustre/lustre/include/lustre_idmap.h
 delete mode 100644 drivers/staging/lustre/lustre/include/md_object.h
 delete mode 100644 drivers/staging/lustre/lustre/obdclass/idmap.c
 delete mode 100644 drivers/staging/lustre/lustre/obdclass/llog_osd.c
 delete mode 100644 drivers/staging/lustre/lustre/obdclass/llog_test.c
 delete mode 100644 drivers/staging/lustre/lustre/obdclass/lu_ucred.c
 delete mode 100644 drivers/staging/lustre/lustre/obdclass/mea.c

-- 
1.9.3

--
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] staging: android: sw_sync.c: fix new line style issues

2014-08-30 Thread Greg KH
On Mon, Aug 25, 2014 at 08:35:31PM +0100, Koray Gulcu wrote:
> Add two new lines that are missing after declerations as detected by 
> checkpatch.pl
> 
> Signed-off-by: Koray Gulcu 
> ---
>  drivers/staging/android/sw_sync.c |2 ++
>  1 file changed, 2 insertions(+)

2 other people sent this same patch before you did :(

sorry,

greg k-h
--
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] staging: android: Add blank line after declaration

2014-08-30 Thread Greg KH
On Wed, Aug 20, 2014 at 04:19:19PM +0100, Purnendu Kapadia wrote:
> Signed-off-by: Purnendu Kapadia 
> ---
>  drivers/staging/android/sync.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
> index e7b2e02..0d37495 100644
> --- a/drivers/staging/android/sync.c
> +++ b/drivers/staging/android/sync.c
> @@ -705,6 +705,7 @@ static long sync_fence_ioctl(struct file *file, unsigned 
> int cmd,
>unsigned long arg)
>  {
>   struct sync_fence *fence = file->private_data;
> +
>   switch (cmd) {
>   case SYNC_IOC_WAIT:
>   return sync_fence_ioctl_wait(fence, arg);

Someone sent this same patch just before you did, sorry.

greg k-h
--
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] os_dep: Replace rcu_dereference() with rcu_access_pointer()

2014-08-30 Thread Greg KH
On Sun, Aug 17, 2014 at 04:39:16PM +0300, Andreea-Cristina Bernat wrote:
> The "rcu_dereference()" call is used directly in a condition.
> Since its return value is never dereferenced it is recommended to use
> "rcu_access_pointer()" instead of "rcu_dereference()".
> Therefore, this patch makes the replacement.
> 
> The following Coccinelle semantic patch was used:
> @@
> @@
> 
> (
>  if(
>  (<+...
> - rcu_dereference
> + rcu_access_pointer
>   (...)
>   ...+>)) {...}
> |
>  while(
>  (<+...
> - rcu_dereference
> + rcu_access_pointer
>   (...)
>   ...+>)) {...}
> )
> 
> Signed-off-by: Andreea-Cristina Bernat 
> ---
>  drivers/staging/rtl8188eu/os_dep/os_intfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

This also doesn't apply :(
--
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] staging: netlogic: fixed checkpatch.pl styling warnings

2014-08-30 Thread Greg KH
On Sat, Aug 30, 2014 at 10:54:32PM +0300, Ramon Fried wrote:
> This patch fixes the following checkpatch.pl warnings:
> 
> WARNING: Possible unnecessary 'out of memory' message
> #146: FILE: ./xlr_net.c:146:
> + if (!skb) {
> + pr_err("SKB allocation failed\n");
> 
> WARNING: Missing a blank line after declarations
> #1107: FILE: ./xlr_net.c:1107:
> + struct xlr_net_priv *priv = platform_get_drvdata(pdev);
> + unregister_netdev(priv->ndev);

> >From 27b58d9b1d39ab99bf6022b82ac9e602621b2822 Mon Sep 17 00:00:00 2001
> From: Ramon Fried 
> Date: Sat, 30 Aug 2014 22:26:11 +0300
> Subject: [PATCH] staging: netlogic: fixed checkpatch.pl styling warnings
> 
> Signed-off-by: Ramon Fried 

WHy did you not put the information above in the changelog area here?

And why send a patch as an attachment, I can't do much of anything with
that :(

Also, please use the scripts/get_maintainer.pl tool to determine who and
what mailing lists to cc: for a patch.

Please fix this up and resend.

thanks,

greg k-h
--
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] Staging: rtl8821ae: hal_bt_coexist: fix coding style issue

2014-08-30 Thread Greg KH
On Sat, Aug 30, 2014 at 02:10:52PM -0400, An Ha wrote:
> Fix coding style issues, these changes include:
> -Add space between "if" and brackets
> -Add space after comma in an argument
> -Add space between equal sign to separate the variable and the assignment
> -Remove unnecessary curly braces around one-line if statements
> -Remove unnecessary whitespace between two brackets
> -Remove unnecessary whitespace before newline
> -Join else-if statement onto same line as end curly brace
> -Join open curly brace onto same line as if statement
> -Use "foo *" instead of "foo*" for the pointer placement
> -Switch commenting style from C99 comments to C89 comments
> 
> Signed-off-by: An Ha 

That's a lot of different things all to be doing in one single patch.
Please break this up into "one thing at a time per patch" so that it is
reviewable and readable.

thanks,

greg k-h
--
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] staging:r8190_rtl8256: coding style: Fixed commenting style

2014-08-30 Thread Greg KH
On Mon, Aug 25, 2014 at 12:55:27PM +0530, Sanjeev Sharma wrote:
> This is a patch to the r8190_rtl8256.c file that fixes
> commenting style Error
> 
> Signed-off-by: Sanjeev Sharma 
> ---
>  drivers/staging/rtl8192u/r8190_rtl8256.c | 59 
> +---
>  1 file changed, 31 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192u/r8190_rtl8256.c 
> b/drivers/staging/rtl8192u/r8190_rtl8256.c
> index 43ed768..8fe35ad 100644
> --- a/drivers/staging/rtl8192u/r8190_rtl8256.c
> +++ b/drivers/staging/rtl8192u/r8190_rtl8256.c
> @@ -61,13 +61,15 @@ void PHY_SetRF8256Bandwidth(struct net_device *dev , 
> HT_CHANNEL_WIDTH Bandwidth)
>   break;
>   case HT_CHANNEL_WIDTH_20_40:
>   if (priv->card_8192_version == VERSION_819xU_A 
> || priv->card_8192_version == VERSION_819xU_B) { /* 8256 D-cut, E-cut, xiong: 
> consider it later! */
> - rtl8192_phy_SetRFReg(dev, 
> (RF90_RADIO_PATH_E)eRFPath, 0x0b, bMask12Bits, 0x300); //phy para:3ba
> + rtl8192_phy_SetRFReg(dev, 
> (RF90_RADIO_PATH_E)eRFPath, 0x0b, bMask12Bits, 0x300); /* phy para:3ba */
>   rtl8192_phy_SetRFReg(dev, 
> (RF90_RADIO_PATH_E)eRFPath, 0x2c, bMask12Bits, 0x3df);
>   rtl8192_phy_SetRFReg(dev, 
> (RF90_RADIO_PATH_E)eRFPath, 0x0e, bMask12Bits, 0x0a1);
>  
> - //cosa add for sd3's request 01/23/2008
> + /* cosa add for sd3's request 01/23/2008
> +  *
> +  */
>   if (priv->chan == 3 || priv->chan == 9)
> - //I need to set priv->chan 
> whenever current channel changes
> + /* I need to set priv->chan 
> whenever current channel changes */
>   rtl8192_phy_SetRFReg(dev, 
> (RF90_RADIO_PATH_E)eRFPath, 0x14, bMask12Bits, 0x59b);
>   else
>   rtl8192_phy_SetRFReg(dev, 
> (RF90_RADIO_PATH_E)eRFPath, 0x14, bMask12Bits, 0x5ab);
> @@ -91,11 +93,12 @@ void PHY_SetRF8256Bandwidth(struct net_device *dev , 
> HT_CHANNEL_WIDTH Bandwidth)
>  void PHY_RF8256_Config(struct net_device *dev)
>  {
>   struct r8192_priv *priv = ieee80211_priv(dev);
> - // Initialize general global value
> - //
> - // TODO: Extend RF_PATH_C and RF_PATH_D in the future
> + /* Initialize general global value
> +  *
> +  * TODO: Extend RF_PATH_C and RF_PATH_D in the future
> +  */
>   priv->NumTotalRFPath = RTL819X_TOTAL_RF_PATH;
> - // Config BB and RF
> + /* Config BB and RF */
>   phy_RF8256_Config_ParaFile(dev);
>  }
>  /*--
> @@ -107,10 +110,11 @@ void PHY_RF8256_Config(struct net_device *dev)
>  void phy_RF8256_Config_ParaFile(struct net_device *dev)
>  {
>   u32 u4RegValue = 0;
> - //static s1Byte szRadioAFile[] = 
> RTL819X_PHY_RADIO_A;
> - //static s1Byte szRadioBFile[] = 
> RTL819X_PHY_RADIO_B;
> - //static s1Byte szRadioCFile[] = 
> RTL819X_PHY_RADIO_C;
> - //static s1Byte szRadioDFile[] = 
> RTL819X_PHY_RADIO_D;
> + /* static s1ByteszRadioAFile[] = 
> RTL819X_PHY_RADIO_A;
> +  * static s1ByteszRadioBFile[] = 
> RTL819X_PHY_RADIO_B;
> +  * static s1ByteszRadioCFile[] = 
> RTL819X_PHY_RADIO_C;
> +  * static s1ByteszRadioDFile[] = 
> RTL819X_PHY_RADIO_D;
> +  */

Why not just remove stuff like this if it's not being used?

Same goes for other commented out code lines.

thanks,

greg k-h
--
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] staging: rtl8821ae: fix sparse warning for static declarations in rtl8821ae/stats.c

2014-08-30 Thread Greg Kroah-Hartman
On Sat, Aug 23, 2014 at 10:55:51AM +0800, Hoang Tran wrote:
> This patch fixes the following sparse warnings in rtl8821ae/stats.c
> 
> drivers/staging/rtl8821ae/stats.c:62:6: warning: symbol 'rtl_translate_todbm' 
> was not declared. Should it be static?
> drivers/staging/rtl8821ae/stats.c:101:6: warning: symbol 
> 'rtl_process_ui_rssi' was not declared. Should it be static?
> 
> Signed-off-by: Hoang Tran 
> ---
>  drivers/staging/rtl8821ae/stats.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

I applied the second patch you sent, why resend it?  What was different
between this one and the previous 2?  Please always be specific about
what you are changing, otherwise I have no idea what to do...

greg k-h
--
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/


scsi_debug module deadlock on 3.17-rc2

2014-08-30 Thread Milan Broz
Hi,

I am using scsi_debug in cryptsetup testsuite and with recent 3.17-rc kernel
it deadlocks on rmmod of scsi_debug module.

For me even this simple reproducer causes deadlock:
  modprobe scsi_debug dev_size_mb=16 sector_size=512 num_tgts=1
  DEV="/dev/"$(grep -l -e scsi_debug /sys/block/*/device/model | cut -f4 -d /)
  mkfs -t ext4 $DEV
  rmmod scsi_debug

(adding small delay before rmmod obviously helps here)

Bisect tracked it to commit
  commit cbf67842c3d9e7af8ccc031332b79e88d9cca592
  Author: Douglas Gilbert 
  Date:   Sat Jul 26 11:55:35 2014 -0400
  scsi_debug: support scsi-mq, queues and locks

I guess that with introducing mq the del_timer_sync() must not be called
with acquired queued_arr_lock.
(to me it looks like situation described in comment before
del_timer_sync() in kernel/time/timer.c...)

Here is the log (running on vmware VM and i686 arch):

[   67.916472] scsi_debug: host protection
[   67.916483] scsi host3: scsi_debug, version 1.84 [20140706], dev_size_mb=16, 
opts=0x0
[   67.917446] scsi 3:0:0:0: Direct-Access Linuxscsi_debug   0184 
PQ: 0 ANSI: 5
[   67.920539] sd 3:0:0:0: Attached scsi generic sg8 type 0
[   67.940542] sd 3:0:0:0: [sdh] 32768 512-byte logical blocks: (16.7 MB/16.0 
MiB)
[   67.940548] sd 3:0:0:0: [sdh] 4096-byte physical blocks
[   67.950705] sd 3:0:0:0: [sdh] Write Protect is off
[   67.950715] sd 3:0:0:0: [sdh] Mode Sense: 73 00 10 08
[   67.970514] sd 3:0:0:0: [sdh] Write cache: enabled, read cache: enabled, 
supports DPO and FUA
[   68.040566]  sdh: unknown partition table
[   68.090618] sd 3:0:0:0: [sdh] Attached SCSI disk
[   68.799699]  sdh: unknown partition table
[   69.072314] 
[   69.072387] ==
[   69.072433] [ INFO: possible circular locking dependency detected ]
[   69.072487] 3.17.0-rc2+ #80 Not tainted
[   69.072518] ---
[   69.072560] rmmod/2890 is trying to acquire lock:
[   69.072595]  ((sqcp->cmnd_timerp)){+.-...}, at: [] 
del_timer_sync+0x0/0xb0
[   69.072704] 
[   69.072704] but task is already holding lock:
[   69.072743]  (queued_arr_lock){..-...}, at: [] 
stop_all_queued+0x17/0xc0 [scsi_debug]
[   69.072852] 
[   69.072852] which lock already depends on the new lock.
[   69.072852] 
[   69.072902] 
[   69.072902] the existing dependency chain (in reverse order) is:
[   69.072949] 
[   69.072949] -> #1 (queued_arr_lock){..-...}:
[   69.073045][] lock_acquire+0x59/0xa0
[   69.073114][] _raw_spin_lock_irqsave+0x31/0x70
[   69.073438][] sdebug_q_cmd_complete+0x27/0x190 [scsi_debug]
[   69.073515][] call_timer_fn+0x5b/0xd0
[   69.073581][] run_timer_softirq+0x161/0x200
[   69.073649][] __do_softirq+0x119/0x230
[   69.073726][] do_softirq_own_stack+0x27/0x30
[   69.073811][] irq_exit+0x7e/0xa0
[   69.073889][] smp_apic_timer_interrupt+0x33/0x40
[   69.073969][] apic_timer_interrupt+0x32/0x38
[   69.074254][] arch_cpu_idle+0x9/0x10
[   69.074318][] cpu_startup_entry+0x22c/0x280
[   69.074381][] rest_init+0x9c/0xb0
[   69.074441][] start_kernel+0x2e9/0x2ee
[   69.074504][] i386_start_kernel+0x79/0x7d
[   69.074567] 
[   69.074567] -> #0 ((sqcp->cmnd_timerp)){+.-...}:
[   69.074794][] __lock_acquire+0x16e4/0x1c30
[   69.074859][] lock_acquire+0x59/0xa0
[   69.074919][] del_timer_sync+0x29/0xb0
[   69.074981][] stop_all_queued+0x8a/0xc0 [scsi_debug]
[   69.075050][] scsi_debug_exit+0x16/0xac [scsi_debug]
[   69.075117][] SyS_delete_module+0xfd/0x180
[   69.075181][] syscall_after_call+0x0/0x4
[   69.075243] 
[   69.075243] other info that might help us debug this:
[   69.075243] 
[   69.075321]  Possible unsafe locking scenario:
[   69.075321] 
[   69.075380]CPU0CPU1
[   69.075424]
[   69.075468]   lock(queued_arr_lock);
[   69.075534]lock((sqcp->cmnd_timerp));
[   69.075613]lock(queued_arr_lock);
[   69.075690]   lock((sqcp->cmnd_timerp));
[   69.075758] 
[   69.075758]  *** DEADLOCK ***
[   69.075758] 
[   69.075827] 1 lock held by rmmod/2890:
[   69.075867]  #0:  (queued_arr_lock){..-...}, at: [] 
stop_all_queued+0x17/0xc0 [scsi_debug]
[   69.076009] 
[   69.076009] stack backtrace:
[   69.076064] CPU: 1 PID: 2890 Comm: rmmod Not tainted 3.17.0-rc2+ #80
[   69.076117] Hardware name: VMware, Inc. VMware Virtual Platform/440BX 
Desktop Reference Platform, BIOS 6.00 07/31/2013
[   69.076200]  c1c93200  da25fe30 c146081f c1c93330 da25fe60 c145fbf6 
c158bbfc
[   69.076375]  c158bb99 c158bb7c c158bb91 c158bb7c da25fe9c df319070 df319098 
df319618
[   69.076550]  df3195f0 da25fecc c1071b94 df3195f0 c1c4a0b0 0001  
0001
[   69.076724] Call Trace:
[   69.076760]  [] dump_stack+0x4b/0x75
[   69.076805]  [] 

Re: [PATCH 03/20] staging: rtl8188eu: Rework function PHY_QueryBBReg()

2014-08-30 Thread Greg KH
On Sat, Aug 23, 2014 at 07:48:24PM +0530, navin patidar wrote:
> Rename CamelCase variables and function name.
> 
> Signed-off-by: navin patidar 

This patch fails to apply:

checking file drivers/staging/rtl8188eu/hal/HalHWImg8188E_RF.c
checking file drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c
checking file drivers/staging/rtl8188eu/hal/odm.c
checking file drivers/staging/rtl8188eu/hal/odm_RTL8188E.c
checking file drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c
checking file drivers/staging/rtl8188eu/hal/usb_halinit.c
checking file drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h
checking file drivers/staging/rtl8188eu/include/phy.h
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED

Can you please refresh it against my staging-next branch of the
staging.git tree on git.kernel.org and resend it, and the rest of the
patches in this series so that I can apply them?

thanks,

greg k-h
--
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] rtl8188eu: Replace rcu_dereference() with rcu_access_pointer()

2014-08-30 Thread Greg KH
On Sun, Aug 17, 2014 at 02:43:37PM +0300, Andreea-Cristina Bernat wrote:
> The "rcu_dereference()" call is used directly in a condition.
> Since its return value is never dereferenced it is recommended to use
> "rcu_access_pointer()" instead of "rcu_dereference()".
> Therefore, this patch makes the replacement.
> 
> The following Coccinelle semantic patch was used:
> @@
> @@
> 
> (
>  if(
>  (<+...
> - rcu_dereference
> + rcu_access_pointer
>   (...)
>   ...+>)) {...}
> |
>  while(
>  (<+...
> - rcu_dereference
> + rcu_access_pointer
>   (...)
>   ...+>)) {...}
> )
> 
> Signed-off-by: Andreea-Cristina Bernat 
> ---
>  drivers/staging/rtl8188eu/core/rtw_mlme.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

This patch fails to apply to my tree, can you refresh it against the
staging-next branch of the staging.git tree on kernel.org and resend?

thanks,

greg k-h
--
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 4/4] staging: rtl8188eu: rtw_debug.h

2014-08-30 Thread Greg KH
On Fri, Aug 22, 2014 at 11:33:52AM +0100, Miguel Oliveira wrote:
> Convert all rtw_proc_xxx references to rtw_sys_xxx in file
> include/rtw_debug.h

That's interesting, but:

> 
> Signed-off-by: Miguel Oliveira 
> ---
>  drivers/staging/rtl8188eu/include/rtw_debug.h |  227 
> +++--
>  1 file changed, 98 insertions(+), 129 deletions(-)
> 
> diff --git a/drivers/staging/rtl8188eu/include/rtw_debug.h 
> b/drivers/staging/rtl8188eu/include/rtw_debug.h
> index a38616e..aa0f46a 100644
> --- a/drivers/staging/rtl8188eu/include/rtw_debug.h
> +++ b/drivers/staging/rtl8188eu/include/rtw_debug.h
> @@ -87,7 +87,7 @@ extern u32 GlobalDebugLevel;
>  #define MSG_88E(...) \
>   do {\
>   if (_drv_err_ <= GlobalDebugLevel)  \
> - pr_info(DRIVER_PREFIX __VA_ARGS__); 
> \
> + pr_info(DRIVER_PREFIX __VA_ARGS__); \

How does this change relate to what you said you were going to do above?

confused,

greg k-h
--
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 3/4] staging: rtl8188eu: osdep_intf.h and usb_intf.c

2014-08-30 Thread Greg KH
On Fri, Aug 22, 2014 at 11:33:37AM +0100, Miguel Oliveira wrote:
> Convert all rtw_proc_xxx references to rtw_sys_xxx in files
> include/osdep_intf.h and os_dep/usb_intf.c

Same comments as the previous ones, please redo all of these patches.

greg k-h
--
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/4] staging: rtl8188eu: rtw_debug.c

2014-08-30 Thread Greg KH
On Fri, Aug 22, 2014 at 11:33:20AM +0100, Miguel Oliveira wrote:
> Convert all rtw_proc_xxx references to rtw_sys_xxx

Again, your subject: is not understandable.

And what are you doing here?

> Code with 62 WARNING: line over 80 characters, I'll write another patch
> to clean the whole file.

What do you mean by this?  Why refer to a future patch in this
changelog, that doesn't help anyone.

confused,

greg k-h
--
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/4] staging: rtl8188eu: os_intfs.c

2014-08-30 Thread Greg KH
Your subject does not say what is going on in this patch, only the file
being modified :(


On Fri, Aug 22, 2014 at 11:32:38AM +0100, Miguel Oliveira wrote:
> void rtw_proc_remove_one(struct net_device *dev)
> {
> }
> void rtw_proc_init_one(struct net_device *dev)
>   /* TODO: Convert these to /sys */
> 
> Converting the above from proc into debugfs.
> Convert all rtw_proc_xxx references to rtw_sys_xxx

I don't understand, what exactly are you doing here?

Are you moving stuff to debugfs or to sysfs?  And what exactly are you
moving?  And why?  And if sysfs, you need to document the files.

> 
> Signed-off-by: Miguel Oliveira 
> ---
>  drivers/staging/rtl8188eu/os_dep/os_intfs.c |  517 
> +--
>  1 file changed, 326 insertions(+), 191 deletions(-)
> 
> diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c 
> b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
> index c7a44ab..49b441a 100644
> --- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
> +++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
> @@ -29,6 +29,8 @@
>  
>  #include 
>  
> +#include 
> +
>  MODULE_LICENSE("GPL");
>  MODULE_DESCRIPTION("Realtek Wireless Lan Driver");
>  MODULE_AUTHOR("Realtek Semiconductor Corp.");
> @@ -166,50 +168,254 @@ MODULE_PARM_DESC(rtw_notch_filter, "0:Disable, 
> 1:Enable, 2:Enable only for P2P")
>  module_param_named(debug, rtw_debug, int, 0444);
>  MODULE_PARM_DESC(debug, "Set debug level (1-9) (default 1)");
>  
> -/* dummy routines */
> -void rtw_proc_remove_one(struct net_device *dev)
> -{
> -}
> +static const struct file_operations drv_version = {
> + .owner =THIS_MODULE,
> + .read = sys_get_drv_version,
> + .llseek =   default_llseek,
> +};



You do know that debugfs can handle single variables very easily, with
no need for a file_operations structure, right?  Are you sure you need
all of these new structures?

thanks,

greg k-h
--
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/


[Patch v2 0/2] Move Digi Neo card support from dgnc to jsm

2014-08-30 Thread wfp5p
From: Bill Pemberton 

The jsm driver (drivers/tty/serial/jsm) already supports the Digi Neo
cards that dgnc (staging) supports.  In fact, it appears that jsm was
based on dgnc.  The dgnc driver has PCI ids for more cards than jsm,
this patch moves support for all the Neo cards to jsm.

The result of this will be that dgnc will only support the Classic
cards since the jsm driver doesn't support those cards yet.


Bill Pemberton (2):
  jsm: add support for additional Neo cards
  staging: dgnc: remove Neo card ids from device table

 drivers/staging/dgnc/dgnc_driver.c  | 13 -
 drivers/tty/serial/jsm/jsm.h| 10 ++
 drivers/tty/serial/jsm/jsm_driver.c | 38 +
 3 files changed, 44 insertions(+), 17 deletions(-)

-- 
1.9.3

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


[Patch v2 2/2] staging: dgnc: remove Neo card ids from device table

2014-08-30 Thread wfp5p
From: Bill Pemberton 

The Digi Neo cards are supported by the jsm driver.  Remove support
for these cards from dgnc.

Signed-off-by: Bill Pemberton 
---
 drivers/staging/dgnc/dgnc_driver.c | 13 -
 1 file changed, 13 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index 764613b2f4b4..ad07cc698147 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -128,19 +128,6 @@ static struct pci_device_id dgnc_pci_tbl[] = {
{   DIGI_VID, PCI_DEVICE_CLASSIC_4_422_DID, PCI_ANY_ID, PCI_ANY_ID, 
0, 0,   1 },
{   DIGI_VID, PCI_DEVICE_CLASSIC_8_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 
0,   2 },
{   DIGI_VID, PCI_DEVICE_CLASSIC_8_422_DID, PCI_ANY_ID, PCI_ANY_ID, 
0, 0,   3 },
-   {   DIGI_VID, PCI_DEVICE_NEO_4_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,   
4 },
-   {   DIGI_VID, PCI_DEVICE_NEO_8_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,   
5 },
-   {   DIGI_VID, PCI_DEVICE_NEO_2DB9_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 
0,6 },
-   {   DIGI_VID, PCI_DEVICE_NEO_2DB9PRI_DID, PCI_ANY_ID, PCI_ANY_ID, 
0, 0, 7 },
-   {   DIGI_VID, PCI_DEVICE_NEO_2RJ45_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 
0,   8 },
-   {   DIGI_VID, PCI_DEVICE_NEO_2RJ45PRI_DID, PCI_ANY_ID, PCI_ANY_ID, 
0, 0,9 },
-   {   DIGI_VID, PCI_DEVICE_NEO_1_422_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 
0,   10 },
-   {   DIGI_VID, PCI_DEVICE_NEO_1_422_485_DID, PCI_ANY_ID, PCI_ANY_ID, 
0, 0,   11 },
-   {   DIGI_VID, PCI_DEVICE_NEO_2_422_485_DID, PCI_ANY_ID, PCI_ANY_ID, 
0, 0,   12 },
-   {   DIGI_VID, PCI_DEVICE_NEO_EXPRESS_8_DID, PCI_ANY_ID, PCI_ANY_ID, 
0, 0,13 },
-   {   DIGI_VID, PCI_DEVICE_NEO_EXPRESS_4_DID, PCI_ANY_ID, PCI_ANY_ID, 
0, 0,   14 },
-   {   DIGI_VID, PCI_DEVICE_NEO_EXPRESS_4RJ45_DID, PCI_ANY_ID, 
PCI_ANY_ID, 0, 0,   15 },
-   {   DIGI_VID, PCI_DEVICE_NEO_EXPRESS_8RJ45_DID, PCI_ANY_ID, 
PCI_ANY_ID, 0, 0,   16 },
{0,}/* 0 terminated list. */
 };
 MODULE_DEVICE_TABLE(pci, dgnc_pci_tbl);
-- 
1.9.3

--
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] iio: adc: rockchip_saradc: add support for rk3066-tsadc variant

2014-08-30 Thread Heiko Stübner
Am Samstag, 30. August 2014, 21:15:53 schrieb Jonathan Cameron:
> On 30/08/14 14:07, Heiko Stübner wrote:
> > Older Rockchip SoCs, at least the rk3066, used a slightly modified saradc
> > for temperature measurements. This so called tsadc does not contain any
> > active parts like temperature interrupts and only supports polling the
> > current temperature. The returned voltage can then be converted by a
> > suitable thermal driver to and actual temperature and used for thermal
> > handling.
> > 
> > Signed-off-by: Heiko Stuebner 
> 
> Looks, good to me, but will let this sit for a few days for other comments
> on it. 

ok, cool


> Long shot, but are the docs for the vairous rockchip parts
> publically available somewhere?

Not publically, at this point ... maybe somewhere in the future [hope :-) ]


Heiko

> 
> > ---
> > This is a different IP than the rk3288-tsadc Ceasar provided a driver for.
> > As the commit messages states, the one used on the rk3066 is just a
> > saradc,
> > while the new tsadc in the rk3288 contains active components for thermal
> > handling.
> > 
> > A working example using the pending iio-thermal driver can found on
> > https://github.com/mmind/linux-rockchip/commit/c07e02f069d9677d489f2541766
> > 19fae36f2aad0> 
> >  .../bindings/iio/adc/rockchip-saradc.txt   |  2 +-
> >  drivers/iio/adc/rockchip_saradc.c  | 62
> >  +- 2 files changed, 50 insertions(+), 14
> >  deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt
> > b/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt index
> > 5d3ec1d..a9a5fe1 100644
> > --- a/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt
> > +++ b/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt
> > @@ -1,7 +1,7 @@
> > 
> >  Rockchip Successive Approximation Register (SAR) A/D Converter bindings
> > 
> >  Required properties:
> > -- compatible: Should be "rockchip,saradc"
> > +- compatible: Should be "rockchip,saradc" or "rockchip,rk3066-tsadc"
> > 
> >  - reg: physical base address of the controller and length of memory
> >  mapped
> >  
> > region.
> >  
> >  - interrupts: The interrupt number to the cpu. The interrupt specifier
> >  format> 
> > diff --git a/drivers/iio/adc/rockchip_saradc.c
> > b/drivers/iio/adc/rockchip_saradc.c index e074a0b..7effada 100644
> > --- a/drivers/iio/adc/rockchip_saradc.c
> > +++ b/drivers/iio/adc/rockchip_saradc.c
> > @@ -18,13 +18,13 @@
> > 
> >  #include 
> >  #include 
> >  #include 
> > 
> > +#include 
> > 
> >  #include 
> >  #include 
> >  #include 
> >  #include 
> >  
> >  #define SARADC_DATA0x00
> > 
> > -#define SARADC_DATA_MASK   0x3ff
> > 
> >  #define SARADC_STAS0x04
> >  #define SARADC_STAS_BUSY   BIT(0)
> > 
> > @@ -38,15 +38,22 @@
> > 
> >  #define SARADC_DLY_PU_SOC  0x0c
> >  #define SARADC_DLY_PU_SOC_MASK 0x3f
> > 
> > -#define SARADC_BITS10
> > 
> >  #define SARADC_TIMEOUT msecs_to_jiffies(100)
> > 
> > +struct rockchip_saradc_data {
> > +   int num_bits;
> > +   const struct iio_chan_spec  *channels;
> > +   int num_channels;
> > +   unsigned long   clk_rate;
> > +};
> > +
> > 
> >  struct rockchip_saradc {
> >  
> > void __iomem*regs;
> > struct clk  *pclk;
> > struct clk  *clk;
> > struct completion   completion;
> > struct regulator*vref;
> > 
> > +   const struct rockchip_saradc_data *data;
> > 
> > u16 last_val;
> >  
> >  };
> > 
> > @@ -90,7 +97,7 @@ static int rockchip_saradc_read_raw(struct iio_dev
> > *indio_dev,> 
> > }
> > 
> > *val = ret / 1000;
> > 
> > -   *val2 = SARADC_BITS;
> > +   *val2 = info->data->num_bits;
> > 
> > return IIO_VAL_FRACTIONAL_LOG2;
> > 
> > default:
> > return -EINVAL;
> > 
> > @@ -103,7 +110,7 @@ static irqreturn_t rockchip_saradc_isr(int irq, void
> > *dev_id)> 
> > /* Read value */
> > info->last_val = readl_relaxed(info->regs + SARADC_DATA);
> > 
> > -   info->last_val &= SARADC_DATA_MASK;
> > +   info->last_val &= BIT(info->data->num_bits) - 1;
> > 
> > /* Clear irq & power down adc */
> > writel_relaxed(0, info->regs + SARADC_CTRL);
> > 
> > @@ -133,12 +140,44 @@ static const struct iio_chan_spec
> > rockchip_saradc_iio_channels[] = {> 
> > ADC_CHANNEL(2, "adc2"),
> >  
> >  };
> > 
> > +static const struct rockchip_saradc_data saradc_data = {
> > +   .num_bits = 10,
> > +   .channels = rockchip_saradc_iio_channels,
> > +   .num_channels = ARRAY_SIZE(rockchip_saradc_iio_channels),
> > +   .clk_rate = 100,
> > +};
> > +
> > +static const struct iio_chan_spec rockchip_rk3066_tsadc_iio_channels[] =
> > {
> > +   ADC_CHANNEL(0, 

[Patch v2 1/2] jsm: add support for additional Neo cards

2014-08-30 Thread wfp5p
From: Bill Pemberton 

Add device ids for additional Neo cards.  The ids come from the dgnc
driver.

Signed-off-by: Bill Pemberton 
---
 drivers/tty/serial/jsm/jsm.h| 10 ++
 drivers/tty/serial/jsm/jsm_driver.c | 38 +
 2 files changed, 44 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/jsm/jsm.h b/drivers/tty/serial/jsm/jsm.h
index 844d5e4eb1aa..af7013488aeb 100644
--- a/drivers/tty/serial/jsm/jsm.h
+++ b/drivers/tty/serial/jsm/jsm.h
@@ -67,6 +67,16 @@ do { 
\
 #define MAXPORTS   8
 #define MAX_STOPS_SENT 5
 
+/* Board ids */
+#define PCI_DEVICE_ID_NEO_4 0x00B0
+#define PCI_DEVICE_ID_NEO_1_422 0x00CC
+#define PCI_DEVICE_ID_NEO_1_422_485 0x00CD
+#define PCI_DEVICE_ID_NEO_2_422_485 0x00CE
+#define PCIE_DEVICE_ID_NEO_80x00F0
+#define PCIE_DEVICE_ID_NEO_40x00F1
+#define PCIE_DEVICE_ID_NEO_4RJ450x00F2
+#define PCIE_DEVICE_ID_NEO_8RJ450x00F3
+
 /* Board type definitions */
 
 #define T_NEO  
diff --git a/drivers/tty/serial/jsm/jsm_driver.c 
b/drivers/tty/serial/jsm/jsm_driver.c
index a47d882d6743..d2885a7bb090 100644
--- a/drivers/tty/serial/jsm/jsm_driver.c
+++ b/drivers/tty/serial/jsm/jsm_driver.c
@@ -93,12 +93,34 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct 
pci_device_id *ent)
/* store the info for the board we've found */
brd->boardnum = adapter_count++;
brd->pci_dev = pdev;
-   if (pdev->device == PCIE_DEVICE_ID_NEO_4_IBM)
+
+   switch (pdev->device) {
+
+   case PCI_DEVICE_ID_NEO_2DB9:
+   case PCI_DEVICE_ID_NEO_2DB9PRI:
+   case PCI_DEVICE_ID_NEO_2RJ45:
+   case PCI_DEVICE_ID_NEO_2RJ45PRI:
+   case PCI_DEVICE_ID_NEO_2_422_485:
+   brd->maxports = 2;
+   break;
+
+   case PCI_DEVICE_ID_NEO_4:
+   case PCIE_DEVICE_ID_NEO_4:
+   case PCIE_DEVICE_ID_NEO_4RJ45:
+   case PCIE_DEVICE_ID_NEO_4_IBM:
brd->maxports = 4;
-   else if (pdev->device == PCI_DEVICE_ID_DIGI_NEO_8)
+   break;
+
+   case PCI_DEVICE_ID_DIGI_NEO_8:
+   case PCIE_DEVICE_ID_NEO_8:
+   case PCIE_DEVICE_ID_NEO_8RJ45:
brd->maxports = 8;
-   else
-   brd->maxports = 2;
+   break;
+
+   default:
+   brd->maxports = 1;
+   break;
+   }
 
spin_lock_init(>bd_intr_lock);
 
@@ -209,6 +231,14 @@ static struct pci_device_id jsm_pci_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_2RJ45PRI), 0, 0, 3 },
{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_4_IBM), 0, 0, 4 },
{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_NEO_8), 0, 0, 5 },
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_4), 0, 0, 6 },
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_1_422), 0, 0, 7 },
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_1_422_485), 0, 0, 8 
},
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_2_422_485), 0, 0, 9 
},
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_8), 0, 0, 10 },
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_4), 0, 0, 11 },
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_4RJ45), 0, 0, 12 },
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_8RJ45), 0, 0, 13 },
{ 0, }
 };
 MODULE_DEVICE_TABLE(pci, jsm_pci_tbl);
-- 
1.9.3

--
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 3/8] staging: et131x: Use for loop to initialise contiguous registers to zero

2014-08-30 Thread Greg KH
On Wed, Aug 20, 2014 at 11:17:53PM +0100, Mark Einon wrote:
> Replace a long list of contiguous writel() calls with a for loop iterating
> over the same values.
> 
> Signed-off-by: Mark Einon 
> ---
>  drivers/staging/et131x/et131x.c | 27 +++
>  1 file changed, 3 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
> index fffe763..44cc684 100644
> --- a/drivers/staging/et131x/et131x.c
> +++ b/drivers/staging/et131x/et131x.c
> @@ -1138,6 +1138,7 @@ static void et1310_config_rxmac_regs(struct 
> et131x_adapter *adapter)
>   u32 sa_lo;
>   u32 sa_hi = 0;
>   u32 pf_ctrl = 0;
> + u32 *wolw;
>  
>   /* Disable the MAC while it is being configured (also disable WOL) */
>   writel(0x8, >ctrl);
> @@ -1151,30 +1152,8 @@ static void et1310_config_rxmac_regs(struct 
> et131x_adapter *adapter)
>* its default Values of 0x because there are not WOL masks
>* as of this time.
>*/
> - writel(0, >mask0_word0);
> - writel(0, >mask0_word1);
> - writel(0, >mask0_word2);
> - writel(0, >mask0_word3);
> -
> - writel(0, >mask1_word0);
> - writel(0, >mask1_word1);
> - writel(0, >mask1_word2);
> - writel(0, >mask1_word3);
> -
> - writel(0, >mask2_word0);
> - writel(0, >mask2_word1);
> - writel(0, >mask2_word2);
> - writel(0, >mask2_word3);
> -
> - writel(0, >mask3_word0);
> - writel(0, >mask3_word1);
> - writel(0, >mask3_word2);
> - writel(0, >mask3_word3);
> -
> - writel(0, >mask4_word0);
> - writel(0, >mask4_word1);
> - writel(0, >mask4_word2);
> - writel(0, >mask4_word3);
> + for (wolw = >mask0_word0; wolw <= >mask4_word3; wolw++)
> + writel(0, wolw);

You are now only writing to all locations 1 time, instead of 4 times,
like before, are you sure that is ok?  Hardware is flaky, sometimes it
wants to be written to multiple times...

greg k-h
--
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] iio: adc: rockchip_saradc: add support for rk3066-tsadc variant

2014-08-30 Thread Jonathan Cameron
On 30/08/14 14:07, Heiko Stübner wrote:
> Older Rockchip SoCs, at least the rk3066, used a slightly modified saradc
> for temperature measurements. This so called tsadc does not contain any
> active parts like temperature interrupts and only supports polling the
> current temperature. The returned voltage can then be converted by a
> suitable thermal driver to and actual temperature and used for thermal
> handling.
>
> Signed-off-by: Heiko Stuebner 
Looks, good to me, but will let this sit for a few days for other comments on
it.  Long shot, but are the docs for the vairous rockchip parts publically
available somewhere?
> ---
> This is a different IP than the rk3288-tsadc Ceasar provided a driver for.
> As the commit messages states, the one used on the rk3066 is just a saradc,
> while the new tsadc in the rk3288 contains active components for thermal
> handling.
>
> A working example using the pending iio-thermal driver can found on
> https://github.com/mmind/linux-rockchip/commit/c07e02f069d9677d489f254176619fae36f2aad0
>
>  .../bindings/iio/adc/rockchip-saradc.txt   |  2 +-
>  drivers/iio/adc/rockchip_saradc.c  | 62 
> +-
>  2 files changed, 50 insertions(+), 14 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt 
> b/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt
> index 5d3ec1d..a9a5fe1 100644
> --- a/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt
> +++ b/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt
> @@ -1,7 +1,7 @@
>  Rockchip Successive Approximation Register (SAR) A/D Converter bindings
>
>  Required properties:
> -- compatible: Should be "rockchip,saradc"
> +- compatible: Should be "rockchip,saradc" or "rockchip,rk3066-tsadc"
>  - reg: physical base address of the controller and length of memory mapped
> region.
>  - interrupts: The interrupt number to the cpu. The interrupt specifier format
> diff --git a/drivers/iio/adc/rockchip_saradc.c 
> b/drivers/iio/adc/rockchip_saradc.c
> index e074a0b..7effada 100644
> --- a/drivers/iio/adc/rockchip_saradc.c
> +++ b/drivers/iio/adc/rockchip_saradc.c
> @@ -18,13 +18,13 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
>  #include 
>
>  #define SARADC_DATA  0x00
> -#define SARADC_DATA_MASK 0x3ff
>
>  #define SARADC_STAS  0x04
>  #define SARADC_STAS_BUSY BIT(0)
> @@ -38,15 +38,22 @@
>  #define SARADC_DLY_PU_SOC0x0c
>  #define SARADC_DLY_PU_SOC_MASK   0x3f
>
> -#define SARADC_BITS  10
>  #define SARADC_TIMEOUT   msecs_to_jiffies(100)
>
> +struct rockchip_saradc_data {
> + int num_bits;
> + const struct iio_chan_spec  *channels;
> + int num_channels;
> + unsigned long   clk_rate;
> +};
> +
>  struct rockchip_saradc {
>   void __iomem*regs;
>   struct clk  *pclk;
>   struct clk  *clk;
>   struct completion   completion;
>   struct regulator*vref;
> + const struct rockchip_saradc_data *data;
>   u16 last_val;
>  };
>
> @@ -90,7 +97,7 @@ static int rockchip_saradc_read_raw(struct iio_dev 
> *indio_dev,
>   }
>
>   *val = ret / 1000;
> - *val2 = SARADC_BITS;
> + *val2 = info->data->num_bits;
>   return IIO_VAL_FRACTIONAL_LOG2;
>   default:
>   return -EINVAL;
> @@ -103,7 +110,7 @@ static irqreturn_t rockchip_saradc_isr(int irq, void 
> *dev_id)
>
>   /* Read value */
>   info->last_val = readl_relaxed(info->regs + SARADC_DATA);
> - info->last_val &= SARADC_DATA_MASK;
> + info->last_val &= BIT(info->data->num_bits) - 1;
>
>   /* Clear irq & power down adc */
>   writel_relaxed(0, info->regs + SARADC_CTRL);
> @@ -133,12 +140,44 @@ static const struct iio_chan_spec 
> rockchip_saradc_iio_channels[] = {
>   ADC_CHANNEL(2, "adc2"),
>  };
>
> +static const struct rockchip_saradc_data saradc_data = {
> + .num_bits = 10,
> + .channels = rockchip_saradc_iio_channels,
> + .num_channels = ARRAY_SIZE(rockchip_saradc_iio_channels),
> + .clk_rate = 100,
> +};
> +
> +static const struct iio_chan_spec rockchip_rk3066_tsadc_iio_channels[] = {
> + ADC_CHANNEL(0, "adc0"),
> + ADC_CHANNEL(1, "adc1"),
> +};
> +
> +static const struct rockchip_saradc_data rk3066_tsadc_data = {
> + .num_bits = 12,
> + .channels = rockchip_rk3066_tsadc_iio_channels,
> + .num_channels = ARRAY_SIZE(rockchip_rk3066_tsadc_iio_channels),
> + .clk_rate = 5,
> +};
> +
> +static const struct of_device_id rockchip_saradc_match[] = {
> + {
> + .compatible = "rockchip,saradc",
> + .data = _data,
> + }, {
> + .compatible = 

[PATCH] staging: lustre: adjust spacing within pointer casts

2014-08-30 Thread Julia Lawall
From: Julia Lawall 

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
type T;
expression e;
@@
 (
- T *
+ T *
 )
 e
// 

This semantic patch just removes the cast and adds it back, but when it
does so, it follows the spacing conventions of Linux.

Signed-off-by: Julia Lawall 

---
This should be applied after the first set of GOTO patches.

 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c  |4 ++--
 drivers/staging/lustre/lustre/llite/file.c  |4 ++--
 drivers/staging/lustre/lustre/llite/llite_lib.c |2 +-
 drivers/staging/lustre/lustre/llite/lloop.c |2 +-
 drivers/staging/lustre/lustre/obdclass/class_obd.c  |2 +-
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c |2 +-
 drivers/staging/lustre/lustre/obdclass/obd_config.c |2 +-
 drivers/staging/lustre/lustre/osc/osc_quota.c   |2 +-
 drivers/staging/lustre/lustre/ptlrpc/connection.c   |2 +-
 9 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
index 3143222..0cb098e 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
@@ -1746,7 +1746,7 @@ ldlm_work_revoke_ast_lock(struct ptlrpc_request_set 
*rqset, void *opaq)
desc.l_req_mode = LCK_EX;
desc.l_granted_mode = 0;
 
-   rc = lock->l_blocking_ast(lock, , (void*)arg, LDLM_CB_BLOCKING);
+   rc = lock->l_blocking_ast(lock, , (void *)arg, LDLM_CB_BLOCKING);
LDLM_LOCK_RELEASE(lock);
 
return rc;
@@ -1775,7 +1775,7 @@ int ldlm_work_gl_ast_lock(struct ptlrpc_request_set 
*rqset, void *opaq)
arg->gl_desc = gl_work->gl_desc;
 
/* invoke the actual glimpse callback */
-   if (lock->l_glimpse_ast(lock, (void*)arg) == 0)
+   if (lock->l_glimpse_ast(lock, (void *)arg) == 0)
rc = 1;
 
LDLM_LOCK_RELEASE(lock);
diff --git a/drivers/staging/lustre/lustre/llite/file.c 
b/drivers/staging/lustre/lustre/llite/file.c
index 531e062..098deaf 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -1489,7 +1489,7 @@ static int ll_lov_setea(struct inode *inode, struct file 
*file,
if (lump == NULL)
return -ENOMEM;
 
-   if (copy_from_user(lump, (struct lov_user_md  *)arg, lum_size)) {
+   if (copy_from_user(lump, (struct lov_user_md *)arg, lum_size)) {
OBD_FREE_LARGE(lump, lum_size);
return -EFAULT;
}
@@ -2323,7 +2323,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, 
unsigned long arg)
if (mdtidx < 0)
return mdtidx;
 
-   if (put_user((int)mdtidx, (int*)arg))
+   if (put_user((int)mdtidx, (int *)arg))
return -EFAULT;
 
return 0;
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c 
b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 5e39e3a..dc87bfe 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -2173,7 +2173,7 @@ int ll_obd_statfs(struct inode *inode, void *arg)
if (rc)
goto out_statfs;
 
-   data = (void*)buf;
+   data = (void *)buf;
if (!data->ioc_inlbuf1 || !data->ioc_inlbuf2 ||
!data->ioc_pbuf1 || !data->ioc_pbuf2) {
rc = -EINVAL;
diff --git a/drivers/staging/lustre/lustre/llite/lloop.c 
b/drivers/staging/lustre/lustre/llite/lloop.c
index 177137a..a5a4115 100644
--- a/drivers/staging/lustre/lustre/llite/lloop.c
+++ b/drivers/staging/lustre/lustre/llite/lloop.c
@@ -705,7 +705,7 @@ static enum llioc_iter lloop_ioctl(struct inode *unused, 
struct file *file,
dev = MKDEV(lloop_major, lo->lo_number);
 
/* quit if the used pointer is writable */
-   if (put_user((long)old_encode_dev(dev), (long*)arg)) {
+   if (put_user((long)old_encode_dev(dev), (long *)arg)) {
err = -EFAULT;
goto out;
}
diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c 
b/drivers/staging/lustre/lustre/obdclass/class_obd.c
index 701c6a7..b3c16bc 100644
--- a/drivers/staging/lustre/lustre/obdclass/class_obd.c
+++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c
@@ -208,7 +208,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg)
 
/* only for debugging */
if (cmd == LIBCFS_IOC_DEBUG_MASK) {
-   debug_data = (struct libcfs_debug_ioctl_data*)arg;
+   debug_data = (struct libcfs_debug_ioctl_data *)arg;
libcfs_subsystem_debug = debug_data->subs;
libcfs_debug = debug_data->debug;
return 0;
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c 

Re: [PATCH] Staging: nokia_h4p: nokia_fw: remove extra return

2014-08-30 Thread Greg KH
On Sat, Aug 30, 2014 at 07:14:51PM +0100, Andrew Plummer wrote:
> Remove empty return at end of function.
> 
> Signed-off-by: Andrew Plummer 
> ---
>  drivers/staging/nokia_h4p/nokia_fw.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/staging/nokia_h4p/nokia_fw.c 
> b/drivers/staging/nokia_h4p/nokia_fw.c
> index 14ba219..18953ae 100644
> --- a/drivers/staging/nokia_h4p/nokia_fw.c
> +++ b/drivers/staging/nokia_h4p/nokia_fw.c
> @@ -197,8 +197,6 @@ void hci_h4p_parse_fw_event(struct hci_h4p_info *info, 
> struct sk_buff *skb)
>   dev_err(info->dev, "Don't know how to parse fw event\n");
>   info->fw_error = -EINVAL;
>   }
> -
> - return;
>  }
>  
>  MODULE_FIRMWARE(FW_NAME_TI1271_PRELE);

Sorry, but I just deleted this driver from my tree, so I can't take a
patch for the code :(

greg k-h
--
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] iio: accel: kxcjk-1013: add support for kxcj9-1008

2014-08-30 Thread Jonathan Cameron
On 30/08/14 12:44, Daniel Baluta wrote:
> On Tue, Aug 19, 2014 at 6:25 PM, Daniel Baluta  
> wrote:
>> This patch adds support for KXCJ9-1008 3-axis acceleromenter sensor.
>> KXCJ9-1008 uses the same register definitions as KXCJK-1013.
>>
>> The specification for KXCJ9-1008 can be downloaded from:
>> http://www.kionix.com/sites/default/files/KXCJ9-1008%20Specifications%20Rev%205.pdf
>>
>> Signed-off-by: Daniel Baluta 
> 
> Hi Jonathan,
> 
> Any comments on this?
Sorry, I was just being slow!

Anyhow, applied to the togreg branch of iio.git - initially pushed out as 
testing
for the autobuilders to play.
> 
> On Monday I will send a patch that adds support  KXTJ2-1009 and its
> based on this patch.
> I can squash them together if you want.
A separate patch would be great - I'm guessing htis one is a little more 
involved!

Jonathan
> 
> Daniel.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
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] jsm: add support for additional Neo cards

2014-08-30 Thread Bill Pemberton

On 08/30/2014 02:59 PM, Greg KH wrote:

On Sat, Aug 30, 2014 at 02:54:36PM -0400, wf...@worldbroken.com wrote:

From: Bill Pemberton 

Add device ids for additional Neo cards.  The ids come from the dgnc
driver.

Signed-off-by: Bill Pemberton 
---
  drivers/tty/serial/jsm/jsm_driver.c | 38 +
  include/linux/pci_ids.h |  8 
  2 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/jsm/jsm_driver.c 
b/drivers/tty/serial/jsm/jsm_driver.c
index a47d882d6743..d2885a7bb090 100644
--- a/drivers/tty/serial/jsm/jsm_driver.c
+++ b/drivers/tty/serial/jsm/jsm_driver.c
@@ -93,12 +93,34 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct 
pci_device_id *ent)
/* store the info for the board we've found */
brd->boardnum = adapter_count++;
brd->pci_dev = pdev;
-   if (pdev->device == PCIE_DEVICE_ID_NEO_4_IBM)
+
+   switch (pdev->device) {
+
+   case PCI_DEVICE_ID_NEO_2DB9:
+   case PCI_DEVICE_ID_NEO_2DB9PRI:
+   case PCI_DEVICE_ID_NEO_2RJ45:
+   case PCI_DEVICE_ID_NEO_2RJ45PRI:
+   case PCI_DEVICE_ID_NEO_2_422_485:
+   brd->maxports = 2;
+   break;
+
+   case PCI_DEVICE_ID_NEO_4:
+   case PCIE_DEVICE_ID_NEO_4:
+   case PCIE_DEVICE_ID_NEO_4RJ45:
+   case PCIE_DEVICE_ID_NEO_4_IBM:
brd->maxports = 4;
-   else if (pdev->device == PCI_DEVICE_ID_DIGI_NEO_8)
+   break;
+
+   case PCI_DEVICE_ID_DIGI_NEO_8:
+   case PCIE_DEVICE_ID_NEO_8:
+   case PCIE_DEVICE_ID_NEO_8RJ45:
brd->maxports = 8;
-   else
-   brd->maxports = 2;
+   break;
+
+   default:
+   brd->maxports = 1;
+   break;
+   }

spin_lock_init(>bd_intr_lock);

@@ -209,6 +231,14 @@ static struct pci_device_id jsm_pci_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_2RJ45PRI), 0, 0, 3 },
{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_4_IBM), 0, 0, 4 },
{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_NEO_8), 0, 0, 5 },
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_4), 0, 0, 6 },
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_1_422), 0, 0, 7 },
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_1_422_485), 0, 0, 8 
},
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_2_422_485), 0, 0, 9 
},
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_8), 0, 0, 10 },
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_4), 0, 0, 11 },
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_4RJ45), 0, 0, 12 },
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_8RJ45), 0, 0, 13 },
{ 0, }
  };
  MODULE_DEVICE_TABLE(pci, jsm_pci_tbl);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 6ed0bb73a864..f0f610c94bb2 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1516,11 +1516,19 @@
  #define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071
  #define PCI_DEVICE_ID_DIGI_DF_M_IOM2_A0x0072
  #define PCI_DEVICE_ID_DIGI_DF_M_A 0x0073
+#define PCI_DEVICE_ID_NEO_4 0x00B0
  #define PCI_DEVICE_ID_DIGI_NEO_8  0x00B1
  #define PCI_DEVICE_ID_NEO_2DB9  0x00C8
  #define PCI_DEVICE_ID_NEO_2DB9PRI   0x00C9
  #define PCI_DEVICE_ID_NEO_2RJ45 0x00CA
  #define PCI_DEVICE_ID_NEO_2RJ45PRI  0x00CB
+#define PCI_DEVICE_ID_NEO_1_422 0x00CC
+#define PCI_DEVICE_ID_NEO_1_422_485 0x00CD
+#define PCI_DEVICE_ID_NEO_2_422_485 0x00CE
+#define PCIE_DEVICE_ID_NEO_80x00F0
+#define PCIE_DEVICE_ID_NEO_40x00F1
+#define PCIE_DEVICE_ID_NEO_4RJ450x00F2
+#define PCIE_DEVICE_ID_NEO_8RJ450x00F3
  #define PCIE_DEVICE_ID_NEO_4_IBM0x00F4


As per the information in the top of this file, we only add new ids when
they cross multiple files.  Right now these values you are adding are
only for a single driver, so they don't need to be added here.

Can you redo this series without touching the pci_ids.h file?



Ah, my apologies, obviously I didn't read the top of the pci_ids.h. 
I'll redo these.


--
Bill

--
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 2/2] dt-bindings: document Rockchip saradc

2014-08-30 Thread Jonathan Cameron
On 30/08/14 13:41, Heiko Stübner wrote:
> Am Donnerstag, 7. August 2014, 15:15:52 schrieb Jonathan Cameron:
>> On 23/07/14 22:24, Heiko Stübner wrote:
>>> This add the necessary binding documentation for the saradc found in all
>>> recent processors from Rockchip.
>>>
>>> Signed-off-by: Heiko Stuebner 
>>
>> Applied to the togreg branch of iio.git.
>> I have exercised a small amount of discretion wrt to the standard 3 weeks
>> as there really is very little different in here from previous versions
>> and no one has raised any comments on them.
> 
> Did the binding patch make it into any tree? Because when I grep for saradc 
> in 
> either linux-next or the iio tree I only get patch 1/2 (the driver itself) 
> but 
> the binding document is somehow missing.
Good spot.  Interestingly I had the file in my local tree but not the commit.
Odd, but now applied to the togreg branch of iio.git and pushed out.

Sorry about that!

Jonathan
> 
> 
> Thanks
> Heiko
> 
> 
>>
>> It's nearly 3 weeks anyway!
>>
>> J
>>
>>> ---
>>> changes since v5:
>>> - remove clock-frquency property as described in patch 1/2
>>>
>>>  .../bindings/iio/adc/rockchip-saradc.txt   | 24
>>>  ++ 1 file changed, 24 insertions(+)
>>>  create mode 100644
>>>  Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt> 
>>> diff --git a/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt
>>> b/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt new file
>>> mode 100644
>>> index 000..5d3ec1d
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt
>>> @@ -0,0 +1,24 @@
>>> +Rockchip Successive Approximation Register (SAR) A/D Converter bindings
>>> +
>>> +Required properties:
>>> +- compatible: Should be "rockchip,saradc"
>>> +- reg: physical base address of the controller and length of memory
>>> mapped
>>> +   region.
>>> +- interrupts: The interrupt number to the cpu. The interrupt specifier
>>> format +  depends on the interrupt controller.
>>> +- clocks: Must contain an entry for each entry in clock-names.
>>> +- clock-names: Shall be "saradc" for the converter-clock, and "apb_pclk"
>>> for +   the peripheral clock.
>>> +- vref-supply: The regulator supply ADC reference voltage.
>>> +- #io-channel-cells: Should be 1, see ../iio-bindings.txt
>>> +
>>> +Example:
>>> +   saradc: saradc@2006c000 {
>>> +   compatible = "rockchip,saradc";
>>> +   reg = <0x2006c000 0x100>;
>>> +   interrupts = ;
>>> +   clocks = < SCLK_SARADC>, < PCLK_SARADC>;
>>> +   clock-names = "saradc", "apb_pclk";
>>> +   #io-channel-cells = <1>;
>>> +   vref-supply = <>;
>>> +   };
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
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/


[PATCH] staging: netlogic: fixed checkpatch.pl styling warnings

2014-08-30 Thread Ramon Fried
This patch fixes the following checkpatch.pl warnings:

WARNING: Possible unnecessary 'out of memory' message
#146: FILE: ./xlr_net.c:146:
+   if (!skb) {
+   pr_err("SKB allocation failed\n");

WARNING: Missing a blank line after declarations
#1107: FILE: ./xlr_net.c:1107:
+   struct xlr_net_priv *priv = platform_get_drvdata(pdev);
+   unregister_netdev(priv->ndev);
>From 27b58d9b1d39ab99bf6022b82ac9e602621b2822 Mon Sep 17 00:00:00 2001
From: Ramon Fried 
Date: Sat, 30 Aug 2014 22:26:11 +0300
Subject: [PATCH] staging: netlogic: fixed checkpatch.pl styling warnings

Signed-off-by: Ramon Fried 
---
 drivers/staging/netlogic/xlr_net.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c
index 9bf407d..28a42831 100644
--- a/drivers/staging/netlogic/xlr_net.c
+++ b/drivers/staging/netlogic/xlr_net.c
@@ -142,10 +142,8 @@ static inline struct sk_buff *xlr_alloc_skb(void)
 
 	/* skb->data is cache aligned */
 	skb = alloc_skb(XLR_RX_BUF_SIZE, GFP_ATOMIC);
-	if (!skb) {
-		pr_err("SKB allocation failed\n");
+	if (!skb)
 		return NULL;
-	}
 	mac_put_skb_back_ptr(skb);
 	return skb;
 }
@@ -1104,6 +1102,7 @@ err_gmac:
 static int xlr_net_remove(struct platform_device *pdev)
 {
 	struct xlr_net_priv *priv = platform_get_drvdata(pdev);
+
 	unregister_netdev(priv->ndev);
 	mdiobus_unregister(priv->mii_bus);
 	mdiobus_free(priv->mii_bus);
-- 
1.9.1



Re: [PATCHv1 3/4] staging:lustre:lnet: lib-md.c erase C99 // comments

2014-08-30 Thread Greg KH
On Sat, Aug 30, 2014 at 02:57:33PM +0800, Janet Liu wrote:
> After changing the comments format, the other error disappears.
> So silences two checkpatch errors:
>   ERROR: do not use C99 // comments
>   ERROR: trailing statements should be on next line
> 
> Signed-off-by: Janet Liu 
> ---
>  drivers/staging/lustre/lnet/lnet/lib-md.c |6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

This doesn't apply properly, maybe due to the first patch not being
applied?

Can you redo patches 1/4 and 3/4 and resend them?  I've taken 2/4 and
4/4 now.

thanks,

greg k-h
--
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: [PATCHv1 2/4] staging:lustre:lnet: lib-md.c delete space before '(' for code style

2014-08-30 Thread Greg KH
On Sat, Aug 30, 2014 at 02:56:09PM +0800, Janet Liu wrote:
> Silences the following checkpatch warning:
>   WARNING: space prohibited between function name and open parenthesis '('
> 
> Signed-off-by: Janet Liu 
> ---
>  drivers/staging/lustre/lnet/lnet/lib-md.c |   18 +-
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lnet/lnet/lib-md.c 
> b/drivers/staging/lustre/lnet/lnet/lib-md.c
> index efd1b82..13f4332 100644
> --- a/drivers/staging/lustre/lnet/lnet/lib-md.c
> +++ b/drivers/staging/lustre/lnet/lnet/lib-md.c
> @@ -110,7 +110,7 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int 
> unlink)
>  
>   lmd->md_niov = niov = umd->length;
>   memcpy(lmd->md_iov.iov, umd->start,
> -niov * sizeof (lmd->md_iov.iov[0]));
> +niov * sizeof(lmd->md_iov.iov[0]));
>  
>   for (i = 0; i < (int)niov; i++) {
>   /* We take the base address on trust */
> @@ -131,7 +131,7 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int 
> unlink)
>   } else if ((umd->options & LNET_MD_KIOV) != 0) {
>   lmd->md_niov = niov = umd->length;
>   memcpy(lmd->md_iov.kiov, umd->start,
> -niov * sizeof (lmd->md_iov.kiov[0]));
> +niov * sizeof(lmd->md_iov.kiov[0]));
>  
>   for (i = 0; i < (int)niov; i++) {
>   /* We take the page pointer on trust */
> @@ -266,15 +266,15 @@ int
>  LNetMDAttach(lnet_handle_me_t meh, lnet_md_t umd,
>lnet_unlink_t unlink, lnet_handle_md_t *handle)
>  {
> - LIST_HEAD   (matches);
> - LIST_HEAD   (drops);
> + LIST_HEAD(matches);
> + LIST_HEAD(drops);

This really isn't a "function", but I'll take it anyway...

greg k-h
--
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 00/11] staging/lustre flatten some headers

2014-08-30 Thread Greg KH
On Thu, Aug 28, 2014 at 06:35:08PM -0500, John L. Hammond wrote:
> This series removes several headers from lustre/include/linux by
> taking whatever was worthwhile from linux/lustre_barf.h and moving it
> to lustre_barf.h or to wherever it's needed.

Very nice, all now applied, thanks.

greg k-h
--
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/


[PATCH 2/2] staging: dgnc: remove Neo card ids from device table

2014-08-30 Thread wfp5p
From: Bill Pemberton 

The Digi Neo cards are supported by the jsm driver.  Remove support
for these cards from dgnc.

Signed-off-by: Bill Pemberton 
---
 drivers/staging/dgnc/dgnc_driver.c | 13 -
 1 file changed, 13 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index 764613b2f4b4..ad07cc698147 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -128,19 +128,6 @@ static struct pci_device_id dgnc_pci_tbl[] = {
{   DIGI_VID, PCI_DEVICE_CLASSIC_4_422_DID, PCI_ANY_ID, PCI_ANY_ID, 
0, 0,   1 },
{   DIGI_VID, PCI_DEVICE_CLASSIC_8_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 
0,   2 },
{   DIGI_VID, PCI_DEVICE_CLASSIC_8_422_DID, PCI_ANY_ID, PCI_ANY_ID, 
0, 0,   3 },
-   {   DIGI_VID, PCI_DEVICE_NEO_4_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,   
4 },
-   {   DIGI_VID, PCI_DEVICE_NEO_8_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,   
5 },
-   {   DIGI_VID, PCI_DEVICE_NEO_2DB9_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 
0,6 },
-   {   DIGI_VID, PCI_DEVICE_NEO_2DB9PRI_DID, PCI_ANY_ID, PCI_ANY_ID, 
0, 0, 7 },
-   {   DIGI_VID, PCI_DEVICE_NEO_2RJ45_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 
0,   8 },
-   {   DIGI_VID, PCI_DEVICE_NEO_2RJ45PRI_DID, PCI_ANY_ID, PCI_ANY_ID, 
0, 0,9 },
-   {   DIGI_VID, PCI_DEVICE_NEO_1_422_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 
0,   10 },
-   {   DIGI_VID, PCI_DEVICE_NEO_1_422_485_DID, PCI_ANY_ID, PCI_ANY_ID, 
0, 0,   11 },
-   {   DIGI_VID, PCI_DEVICE_NEO_2_422_485_DID, PCI_ANY_ID, PCI_ANY_ID, 
0, 0,   12 },
-   {   DIGI_VID, PCI_DEVICE_NEO_EXPRESS_8_DID, PCI_ANY_ID, PCI_ANY_ID, 
0, 0,13 },
-   {   DIGI_VID, PCI_DEVICE_NEO_EXPRESS_4_DID, PCI_ANY_ID, PCI_ANY_ID, 
0, 0,   14 },
-   {   DIGI_VID, PCI_DEVICE_NEO_EXPRESS_4RJ45_DID, PCI_ANY_ID, 
PCI_ANY_ID, 0, 0,   15 },
-   {   DIGI_VID, PCI_DEVICE_NEO_EXPRESS_8RJ45_DID, PCI_ANY_ID, 
PCI_ANY_ID, 0, 0,   16 },
{0,}/* 0 terminated list. */
 };
 MODULE_DEVICE_TABLE(pci, dgnc_pci_tbl);
-- 
1.9.3

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


[PATCH 1/2] jsm: add support for additional Neo cards

2014-08-30 Thread wfp5p
From: Bill Pemberton 

Add device ids for additional Neo cards.  The ids come from the dgnc
driver.

Signed-off-by: Bill Pemberton 
---
 drivers/tty/serial/jsm/jsm_driver.c | 38 +
 include/linux/pci_ids.h |  8 
 2 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/jsm/jsm_driver.c 
b/drivers/tty/serial/jsm/jsm_driver.c
index a47d882d6743..d2885a7bb090 100644
--- a/drivers/tty/serial/jsm/jsm_driver.c
+++ b/drivers/tty/serial/jsm/jsm_driver.c
@@ -93,12 +93,34 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct 
pci_device_id *ent)
/* store the info for the board we've found */
brd->boardnum = adapter_count++;
brd->pci_dev = pdev;
-   if (pdev->device == PCIE_DEVICE_ID_NEO_4_IBM)
+
+   switch (pdev->device) {
+
+   case PCI_DEVICE_ID_NEO_2DB9:
+   case PCI_DEVICE_ID_NEO_2DB9PRI:
+   case PCI_DEVICE_ID_NEO_2RJ45:
+   case PCI_DEVICE_ID_NEO_2RJ45PRI:
+   case PCI_DEVICE_ID_NEO_2_422_485:
+   brd->maxports = 2;
+   break;
+
+   case PCI_DEVICE_ID_NEO_4:
+   case PCIE_DEVICE_ID_NEO_4:
+   case PCIE_DEVICE_ID_NEO_4RJ45:
+   case PCIE_DEVICE_ID_NEO_4_IBM:
brd->maxports = 4;
-   else if (pdev->device == PCI_DEVICE_ID_DIGI_NEO_8)
+   break;
+
+   case PCI_DEVICE_ID_DIGI_NEO_8:
+   case PCIE_DEVICE_ID_NEO_8:
+   case PCIE_DEVICE_ID_NEO_8RJ45:
brd->maxports = 8;
-   else
-   brd->maxports = 2;
+   break;
+
+   default:
+   brd->maxports = 1;
+   break;
+   }
 
spin_lock_init(>bd_intr_lock);
 
@@ -209,6 +231,14 @@ static struct pci_device_id jsm_pci_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_2RJ45PRI), 0, 0, 3 },
{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_4_IBM), 0, 0, 4 },
{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_NEO_8), 0, 0, 5 },
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_4), 0, 0, 6 },
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_1_422), 0, 0, 7 },
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_1_422_485), 0, 0, 8 
},
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_2_422_485), 0, 0, 9 
},
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_8), 0, 0, 10 },
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_4), 0, 0, 11 },
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_4RJ45), 0, 0, 12 },
+   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_8RJ45), 0, 0, 13 },
{ 0, }
 };
 MODULE_DEVICE_TABLE(pci, jsm_pci_tbl);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 6ed0bb73a864..f0f610c94bb2 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1516,11 +1516,19 @@
 #define PCI_DEVICE_ID_DIGI_DF_M_E  0x0071
 #define PCI_DEVICE_ID_DIGI_DF_M_IOM2_A 0x0072
 #define PCI_DEVICE_ID_DIGI_DF_M_A  0x0073
+#define PCI_DEVICE_ID_NEO_4 0x00B0
 #define PCI_DEVICE_ID_DIGI_NEO_8   0x00B1
 #define PCI_DEVICE_ID_NEO_2DB9  0x00C8
 #define PCI_DEVICE_ID_NEO_2DB9PRI   0x00C9
 #define PCI_DEVICE_ID_NEO_2RJ45 0x00CA
 #define PCI_DEVICE_ID_NEO_2RJ45PRI  0x00CB
+#define PCI_DEVICE_ID_NEO_1_422 0x00CC
+#define PCI_DEVICE_ID_NEO_1_422_485 0x00CD
+#define PCI_DEVICE_ID_NEO_2_422_485 0x00CE
+#define PCIE_DEVICE_ID_NEO_80x00F0
+#define PCIE_DEVICE_ID_NEO_40x00F1
+#define PCIE_DEVICE_ID_NEO_4RJ450x00F2
+#define PCIE_DEVICE_ID_NEO_8RJ450x00F3
 #define PCIE_DEVICE_ID_NEO_4_IBM0x00F4
 
 #define PCI_VENDOR_ID_XIRCOM   0x115d
-- 
1.9.3

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


[PATCH 0/2] Move Digi Neo card support from dgnc to jsm

2014-08-30 Thread wfp5p
From: Bill Pemberton 

The jsm driver (drivers/tty/serial/jsm) already supports the Digi Neo
cards that dgnc (staging) supports.  In fact, it appears that jsm was
based on dgnc.  The dgnc driver has PCI ids for more cards than jsm,
this patch moves support for all the Neo cards to jsm.

The result of this will be that dgnc will only support the Classic
cards since the jsm driver doesn't support those cards yet.


Bill Pemberton (2):
  jsm: add support for additional Neo cards
  staging: dgnc: remove Neo card ids from device table

 drivers/staging/dgnc/dgnc_driver.c  | 13 -
 drivers/tty/serial/jsm/jsm_driver.c | 38 +
 include/linux/pci_ids.h |  8 
 3 files changed, 42 insertions(+), 17 deletions(-)

-- 
1.9.3

--
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] staging: fix style in lustre_import.h

2014-08-30 Thread Greg KH
On Fri, Aug 22, 2014 at 07:57:40PM -0400, Spencer Baugh wrote:
> This patch fixes style errors and warnings reported by
> scripts/checkpatch.pl

Which errors and warnings does it fix?

Please always be specific.

And only do one type of "fix" per patch, you do a few different ones
here, right?

Can you redo it and resend please?

thanks,

greg k-h
--
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] jsm: add support for additional Neo cards

2014-08-30 Thread Greg KH
On Sat, Aug 30, 2014 at 02:54:36PM -0400, wf...@worldbroken.com wrote:
> From: Bill Pemberton 
> 
> Add device ids for additional Neo cards.  The ids come from the dgnc
> driver.
> 
> Signed-off-by: Bill Pemberton 
> ---
>  drivers/tty/serial/jsm/jsm_driver.c | 38 
> +
>  include/linux/pci_ids.h |  8 
>  2 files changed, 42 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/tty/serial/jsm/jsm_driver.c 
> b/drivers/tty/serial/jsm/jsm_driver.c
> index a47d882d6743..d2885a7bb090 100644
> --- a/drivers/tty/serial/jsm/jsm_driver.c
> +++ b/drivers/tty/serial/jsm/jsm_driver.c
> @@ -93,12 +93,34 @@ static int jsm_probe_one(struct pci_dev *pdev, const 
> struct pci_device_id *ent)
>   /* store the info for the board we've found */
>   brd->boardnum = adapter_count++;
>   brd->pci_dev = pdev;
> - if (pdev->device == PCIE_DEVICE_ID_NEO_4_IBM)
> +
> + switch (pdev->device) {
> +
> + case PCI_DEVICE_ID_NEO_2DB9:
> + case PCI_DEVICE_ID_NEO_2DB9PRI:
> + case PCI_DEVICE_ID_NEO_2RJ45:
> + case PCI_DEVICE_ID_NEO_2RJ45PRI:
> + case PCI_DEVICE_ID_NEO_2_422_485:
> + brd->maxports = 2;
> + break;
> +
> + case PCI_DEVICE_ID_NEO_4:
> + case PCIE_DEVICE_ID_NEO_4:
> + case PCIE_DEVICE_ID_NEO_4RJ45:
> + case PCIE_DEVICE_ID_NEO_4_IBM:
>   brd->maxports = 4;
> - else if (pdev->device == PCI_DEVICE_ID_DIGI_NEO_8)
> + break;
> +
> + case PCI_DEVICE_ID_DIGI_NEO_8:
> + case PCIE_DEVICE_ID_NEO_8:
> + case PCIE_DEVICE_ID_NEO_8RJ45:
>   brd->maxports = 8;
> - else
> - brd->maxports = 2;
> + break;
> +
> + default:
> + brd->maxports = 1;
> + break;
> + }
>  
>   spin_lock_init(>bd_intr_lock);
>  
> @@ -209,6 +231,14 @@ static struct pci_device_id jsm_pci_tbl[] = {
>   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_2RJ45PRI), 0, 0, 3 },
>   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_4_IBM), 0, 0, 4 },
>   { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_NEO_8), 0, 0, 5 },
> + { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_4), 0, 0, 6 },
> + { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_1_422), 0, 0, 7 },
> + { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_1_422_485), 0, 0, 8 
> },
> + { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_2_422_485), 0, 0, 9 
> },
> + { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_8), 0, 0, 10 },
> + { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_4), 0, 0, 11 },
> + { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_4RJ45), 0, 0, 12 },
> + { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_8RJ45), 0, 0, 13 },
>   { 0, }
>  };
>  MODULE_DEVICE_TABLE(pci, jsm_pci_tbl);
> diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
> index 6ed0bb73a864..f0f610c94bb2 100644
> --- a/include/linux/pci_ids.h
> +++ b/include/linux/pci_ids.h
> @@ -1516,11 +1516,19 @@
>  #define PCI_DEVICE_ID_DIGI_DF_M_E0x0071
>  #define PCI_DEVICE_ID_DIGI_DF_M_IOM2_A   0x0072
>  #define PCI_DEVICE_ID_DIGI_DF_M_A0x0073
> +#define PCI_DEVICE_ID_NEO_4 0x00B0
>  #define PCI_DEVICE_ID_DIGI_NEO_8 0x00B1
>  #define PCI_DEVICE_ID_NEO_2DB9  0x00C8
>  #define PCI_DEVICE_ID_NEO_2DB9PRI   0x00C9
>  #define PCI_DEVICE_ID_NEO_2RJ45 0x00CA
>  #define PCI_DEVICE_ID_NEO_2RJ45PRI  0x00CB
> +#define PCI_DEVICE_ID_NEO_1_422 0x00CC
> +#define PCI_DEVICE_ID_NEO_1_422_485 0x00CD
> +#define PCI_DEVICE_ID_NEO_2_422_485 0x00CE
> +#define PCIE_DEVICE_ID_NEO_80x00F0
> +#define PCIE_DEVICE_ID_NEO_40x00F1
> +#define PCIE_DEVICE_ID_NEO_4RJ450x00F2
> +#define PCIE_DEVICE_ID_NEO_8RJ450x00F3
>  #define PCIE_DEVICE_ID_NEO_4_IBM0x00F4

As per the information in the top of this file, we only add new ids when
they cross multiple files.  Right now these values you are adding are
only for a single driver, so they don't need to be added here.

Can you redo this series without touching the pci_ids.h file?

thanks,

greg k-h
--
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] staging: lustre: lustre: ptlrpc: Fix space required

2014-08-30 Thread Greg KH
On Thu, Aug 21, 2014 at 06:59:07PM +0530, Hema Prathaban wrote:
> This patch fixes the checkpatch.pl issue
> Error: Required space after " '+' ',' '=' '(' ' if' "
> 
> Signed-off-by: Hema Prathaban 
> ---
>  drivers/staging/lustre/lustre/ptlrpc/client.c   |  2 +-
>  drivers/staging/lustre/lustre/ptlrpc/events.c   |  4 ++--
>  drivers/staging/lustre/lustre/ptlrpc/import.c   |  8 
>  drivers/staging/lustre/lustre/ptlrpc/llog_client.c  | 16 
>  drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c |  6 +++---
>  drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c |  2 +-
>  drivers/staging/lustre/lustre/ptlrpc/sec_config.c   |  6 +++---
>  drivers/staging/lustre/lustre/ptlrpc/sec_null.c |  2 +-
>  drivers/staging/lustre/lustre/ptlrpc/service.c  |  2 +-
>  9 files changed, 24 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c 
> b/drivers/staging/lustre/lustre/ptlrpc/client.c
> index 8fa9b71..a327d19 100644
> --- a/drivers/staging/lustre/lustre/ptlrpc/client.c
> +++ b/drivers/staging/lustre/lustre/ptlrpc/client.c
> @@ -289,7 +289,7 @@ static void ptlrpc_at_adj_net_latency(struct 
> ptlrpc_request *req,
>   at = >rq_import->imp_at;
>  
>   /* Network latency is total time less server processing time */
> - nl = max_t(int, now - req->rq_sent - service_time, 0) +1/*st rounding*/;
> + nl = max_t(int, now - req->rq_sent - service_time, 0) + 1/*st 
> rounding*/;
>   if (service_time > now - req->rq_sent + 3 /* bz16408 */)
>   CWARN("Reported service time %u > total measured time "
> CFS_DURATION_T"\n", service_time,
> diff --git a/drivers/staging/lustre/lustre/ptlrpc/events.c 
> b/drivers/staging/lustre/lustre/ptlrpc/events.c
> index c3ec21d..9f5af45 100644
> --- a/drivers/staging/lustre/lustre/ptlrpc/events.c
> +++ b/drivers/staging/lustre/lustre/ptlrpc/events.c
> @@ -186,7 +186,7 @@ void client_bulk_callback(lnet_event_t *ev)
>   if (CFS_FAIL_CHECK_ORSET(OBD_FAIL_PTLRPC_CLIENT_BULK_CB, CFS_FAIL_ONCE))
>   ev->status = -EIO;
>  
> - if (CFS_FAIL_CHECK_ORSET(OBD_FAIL_PTLRPC_CLIENT_BULK_CB2,CFS_FAIL_ONCE))
> + if (CFS_FAIL_CHECK_ORSEuT(OBD_FAIL_PTLRPC_CLIENT_BULK_CB2, 
> CFS_FAIL_ONCE))

You obviously did not compile this code as it breaks the build :(

Please _always_ test build your patches, don't force others to find
errors like this, it's a huge waste of time on my end when it happens...

greg k-h
--
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 0/2] rockchip-i2s: add power setting for I2S controller and fix some critical bugs

2014-08-30 Thread Heiko Stübner
Am Freitag, 29. August 2014, 21:30:43 schrieb Doug Anderson:
> Jianqun,
> 
> On Fri, Aug 29, 2014 at 3:07 PM, Jianqun  wrote:
> > Add optional power setting for i2s controller found on rk3066, rk3168 and
> > rk3288 processors from rockchip, should according to hardware design.
> > 
> > Default setting for I2S controller is powered by 3.3V, there needs this
> > patch if it's powered by 1.8V by hardware design.
> > 
> > Jianqun (2):
> >   rockchip-i2s: dt: add grf requested properties to set power of I2S
> >   controller rockchip-i2s: add power setting for I2S controller, also fix
> >   some bugs>  
> >  .../devicetree/bindings/sound/rockchip-i2s.txt |  6 +-
> >  sound/soc/rockchip/rockchip_i2s.c  | 93
> >  +- sound/soc/rockchip/rockchip_i2s.h
> >   | 13 +--
> >  3 files changed, 68 insertions(+), 44 deletions(-)
> 
> Did the general solution I posted at
>  not work for you?  ...or
> did you not see that?

Also, I don't think it's a good idea to set the io voltage bit simply from a 
dt setting without looking at the actual regulator voltage ... as a 1.8V 
setting when the regulator supplies 3.3V supposedly is able to damage the 
chip.


--
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 09/10] lustre: Add MAINTAINERS entry

2014-08-30 Thread Greg Kroah-Hartman
On Sun, Aug 17, 2014 at 12:47:57PM -0400, Oleg Drokin wrote:
> 
> On Aug 17, 2014, at 12:37 PM, Greg Kroah-Hartman wrote:
> 
> > On Fri, Aug 15, 2014 at 12:48:14PM -0400, Oleg Drokin wrote:
> >> Just add the entry with some info.
> >> 
> >> Signed-off-by: Oleg Drokin 
> >> ---
> >> MAINTAINERS | 8 
> >> 1 file changed, 8 insertions(+)
> >> 
> >> diff --git a/MAINTAINERS b/MAINTAINERS
> >> index 7e2eb4c..369183b 100644
> >> --- a/MAINTAINERS
> >> +++ b/MAINTAINERS
> >> @@ -8646,6 +8646,14 @@ W:  http://www.lirc.org/
> >> S: Odd Fixes
> >> F: drivers/staging/media/lirc/
> >> 
> >> +STAGING - LUSTRE PARALLEL FILESYSTEM
> >> +M:Oleg Drokin 
> >> +M:Andreas Dilger 
> >> +L:hpdd-disc...@lists.01.org (moderated for non-subscribers)
> > 
> > I _really_ hate moderated mailing lists for kernel development stuff.
> > Why not just use the driverdev mailing list instead?
> 
> I guess this could be done if we really need to, but ...
> 
> > I note that you didn't even cc: this patch series to that list...
> 
> The instructions in the beginning of the file say:
> "L: Mailing list that is relevant to this area"
> This is the mailing list that is relevant to the area, but we don't really 
> send patches in there,
> and because it's premoderated it's not really convenient anyway as you 
> rightly notice.
> People can ask other questions they might have bout their problems there, 
> though, and there's
> a higher chance that somebody familiar with lustre will read and answer them.
> 
> the 'M:' is the send patches to according to the instructions?

Yes, this is correct, but watch out, this isn't going to keep patches
from being sent to the driverdevel mailing list and me applying them
directly.

Personally, I'll never cc: your hpdd mailing list, as I get bounces from
it, and don't feel that kernel mailing lists should ever be "closed"
(I run an open kernel mailing list, it can be done, and isn't all that
hard...)

So I'll go apply this, but don't really like it...

greg k-h
--
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/


[PATCH] Staging: emxx_udc: emxx_udc: remove spaces before semicolons

2014-08-30 Thread Andrew Plummer
Remove spaces before semicolons to remove checkpatch warnings.

Signed-off-by: Andrew Plummer 
---
 drivers/staging/emxx_udc/emxx_udc.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index b2eaf01..adc24a9 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -77,14 +77,14 @@ struct nbu2ss_udc udc_controller;
 /* Read */
 static inline u32 _nbu2ss_readl(void *address)
 {
-   return __raw_readl(address) ;
+   return __raw_readl(address);
 }
 
 /*-*/
 /* Write */
 static inline void _nbu2ss_writel(void *address, u32 udata)
 {
-   __raw_writel(udata, address) ;
+   __raw_writel(udata, address);
 }
 
 /*-*/
@@ -92,7 +92,7 @@ static inline void _nbu2ss_writel(void *address, u32 udata)
 static inline void _nbu2ss_bitset(void *address, u32 udata)
 {
u32 reg_dt = __raw_readl(address) | (udata);
-   __raw_writel(reg_dt, address) ;
+   __raw_writel(reg_dt, address);
 }
 
 /*-*/
@@ -100,7 +100,7 @@ static inline void _nbu2ss_bitset(void *address, u32 udata)
 static inline void _nbu2ss_bitclr(void *address, u32 udata)
 {
u32 reg_dt = __raw_readl(address) & ~(udata);
-   __raw_writel(reg_dt, address) ;
+   __raw_writel(reg_dt, address);
 }
 
 #ifdef UDC_DEBUG_DUMP
-- 
1.9.1

--
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] rockchip-i2s: add power setting for I2S controller, also fix some bugs

2014-08-30 Thread Mark Brown
On Fri, Aug 29, 2014 at 03:09:56PM -0700, Jianqun wrote:
> changes:
> * add snd_soc_dai_init_dma_data
> * fix duplicated argument to "I2S_DMACR_TDE_DISABLE"
> * set 1.8v or 3.3v power for I2S controller by GRF interface
> * enable "hclk" always
> * dma maxburst change to 16
> 
> Requested on RK3XXX I2S controllers, and tested ok on rk3288-pinky board.

Please don't submit multiple changes in one patch unless there's a
strong, specific reason to do so.  It makes it very hard to review the
change if there's lots of different things going on (in this case
there's also some coding style updates that aren't mentioned in the
changelog which doesn't help either).  Split the changes out into
multiple patches instead.

> Change-Id: If17b8022a38c2974f32bfb2dd4b8d16644ec57ac

Don't include noise from your internal review system in upstream
commits.


signature.asc
Description: Digital signature


[PATCH] Staging: rtl8821ae: hal_bt_coexist: fix coding style issue

2014-08-30 Thread An Ha
Fix coding style issues, these changes include:
-Add space between "if" and brackets
-Add space after comma in an argument
-Add space between equal sign to separate the variable and the assignment
-Remove unnecessary curly braces around one-line if statements
-Remove unnecessary whitespace between two brackets
-Remove unnecessary whitespace before newline
-Join else-if statement onto same line as end curly brace
-Join open curly brace onto same line as if statement
-Use "foo *" instead of "foo*" for the pointer placement
-Switch commenting style from C99 comments to C89 comments

Signed-off-by: An Ha 
---
 .../staging/rtl8821ae/rtl8821ae/hal_bt_coexist.c   | 102 ++---
 1 file changed, 49 insertions(+), 53 deletions(-)

diff --git a/drivers/staging/rtl8821ae/rtl8821ae/hal_bt_coexist.c 
b/drivers/staging/rtl8821ae/rtl8821ae/hal_bt_coexist.c
index 8bee772..293bf9d 100644
--- a/drivers/staging/rtl8821ae/rtl8821ae/hal_bt_coexist.c
+++ b/drivers/staging/rtl8821ae/rtl8821ae/hal_bt_coexist.c
@@ -43,13 +43,13 @@ void rtl8821ae_dm_bt_reject_ap_aggregated_packet(struct 
ieee80211_hw *hw, bool b
struct rtl_priv rtlpriv = rtl_priv(hw);
PRX_TS_RECORD   pRxTs = NULL;
 
-   if(b_reject){
-   // Do not allow receiving A-MPDU aggregation.
+   if (b_reject) {
+   /* Do not allow receiving A-MPDU aggregation. */
if (rtlpriv->mac80211.vendor == PEER_CISCO) {
if (pHTInfo->bAcceptAddbaReq) {
-   RTPRINT(FBT, BT_TRACE, ("BT_Disallow 
AMPDU \n"));
+   RTPRINT(FBT, BT_TRACE, ("BT_Disallow 
AMPDU\n"));
pHTInfo->bAcceptAddbaReq = FALSE;
-   if(GetTs(Adapter, 
(PTS_COMMON_INFO*)(), pMgntInfo->Bssid, 0, RX_DIR, FALSE))
+   if (GetTs(Adapter, (PTS_COMMON_INFO 
*)(), pMgntInfo->Bssid, 0, RX_DIR, FALSE))
TsInitDelBA(Adapter, 
(PTS_COMMON_INFO)pRxTs, RX_DIR);
}
} else {
@@ -59,9 +59,9 @@ void rtl8821ae_dm_bt_reject_ap_aggregated_packet(struct 
ieee80211_hw *hw, bool b
}
}
} else {
-   if(rtlpriv->mac80211.vendor == PEER_CISCO) {
+   if (rtlpriv->mac80211.vendor == PEER_CISCO) {
if (!pHTInfo->bAcceptAddbaReq) {
-   RTPRINT(FBT, BT_TRACE, ("BT_Allow AMPDU 
\n"));
+   RTPRINT(FBT, BT_TRACE, ("BT_Allow 
AMPDU\n"));
pHTInfo->bAcceptAddbaReq = TRUE;
}
}
@@ -78,17 +78,15 @@ struct rtl_phy *rtlphy = &(rtlpriv->phy);
 if (rtlpriv->link_info.b_busytraffic) {
rtlpcipriv->btcoexist.current_state &= ~BT_COEX_STATE_WIFI_IDLE;
 
-   if(rtlpriv->link_info.b_tx_busy_traffic) {
+   if (rtlpriv->link_info.b_tx_busy_traffic)
rtlpcipriv->btcoexist.current_state |= 
BT_COEX_STATE_WIFI_UPLINK;
-   } else {
+   else
rtlpcipriv->btcoexist.current_state &= 
~BT_COEX_STATE_WIFI_UPLINK;
-   }
 
-   if(rtlpriv->link_info.b_rx_busy_traffic) {
+   if (rtlpriv->link_info.b_rx_busy_traffic)
rtlpcipriv->btcoexist.current_state |= 
BT_COEX_STATE_WIFI_DOWNLINK;
-   } else {
+   else
rtlpcipriv->btcoexist.current_state &= 
~BT_COEX_STATE_WIFI_DOWNLINK;
-   }
 } else {
rtlpcipriv->btcoexist.current_state |= BT_COEX_STATE_WIFI_IDLE;
rtlpcipriv->btcoexist.current_state &= ~BT_COEX_STATE_WIFI_UPLINK;
@@ -102,7 +100,7 @@ if (rtlpriv->mac80211.mode == WIRELESS_MODE_G
rtlpcipriv->btcoexist.current_state &= ~BT_COEX_STATE_WIFI_HT40;
 } else {
rtlpcipriv->btcoexist.current_state &= ~BT_COEX_STATE_WIFI_LEGACY;
-   if(rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20_40) {
+   if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20_40) {
rtlpcipriv->btcoexist.current_state |= BT_COEX_STATE_WIFI_HT40;
rtlpcipriv->btcoexist.current_state &= ~BT_COEX_STATE_WIFI_HT20;
} else {
@@ -111,12 +109,11 @@ if (rtlpriv->mac80211.mode == WIRELESS_MODE_G
}
 }
 
-if (bt_operation_on) {
+if (bt_operation_on)
rtlpcipriv->btcoexist.current_state |= BT_COEX_STATE_BT30;
-} else {
+else
rtlpcipriv->btcoexist.current_state &= ~BT_COEX_STATE_BT30;
 }
-}
 
 
 u8 rtl8821ae_dm_bt_check_coex_rssi_state1(struct ieee80211_hw *hw,
@@ -130,12 +127,12 @@ u8 rtl8821ae_dm_bt_check_coex_rssi_state1(struct 
ieee80211_hw *hw,
 
undecoratedsmoothed_pwdb =  rtl8821ae_dm_bt_get_rx_ss(hw);
 
-   if(level_num == 2) {
+   if (level_num == 2) {
rtlpcipriv->btcoexist.current_state 

[PATCH] Staging: nokia_h4p: nokia_fw: remove extra return

2014-08-30 Thread Andrew Plummer
Remove empty return at end of function.

Signed-off-by: Andrew Plummer 
---
 drivers/staging/nokia_h4p/nokia_fw.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/nokia_h4p/nokia_fw.c 
b/drivers/staging/nokia_h4p/nokia_fw.c
index 14ba219..18953ae 100644
--- a/drivers/staging/nokia_h4p/nokia_fw.c
+++ b/drivers/staging/nokia_h4p/nokia_fw.c
@@ -197,8 +197,6 @@ void hci_h4p_parse_fw_event(struct hci_h4p_info *info, 
struct sk_buff *skb)
dev_err(info->dev, "Don't know how to parse fw event\n");
info->fw_error = -EINVAL;
}
-
-   return;
 }
 
 MODULE_FIRMWARE(FW_NAME_TI1271_PRELE);
-- 
1.9.1

--
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/RFC 2/2] lib: string: Make all calls to strnicmp into calls to strncasecmp

2014-08-30 Thread Rasmus Villemoes
On Wed, Aug 27 2014, Dan Carpenter  wrote:

> On Wed, Aug 27, 2014 at 11:13:16AM +0200, Rasmus Villemoes wrote:
>> Anyway, I was also planning on sending tree-wide patches doing
>> s/strnicmp/strncasecmp/, and then removing the hack from string.h, but I
>> first wanted to get feedback on the first patch and maybe some guidance
>> on how to properly deal with the module issue (e.g., does the kernel
>> need to export a strnicmp symbol forever?).
>
> Once we remove the in kernel users then we can remove the function.
> Don't worry about out of tree modules.

OK, that makes everything simpler. Any objections to the first patch?
Andrew, could you take it through your tree?

Thanks,
Rasmus
--
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 08/12] sched: move cfs task on a CPU with higher capacity

2014-08-30 Thread Preeti U Murthy
Hi Vincent,

On 08/26/2014 04:36 PM, Vincent Guittot wrote:
> If the CPU is used for handling lot of IRQs, trig a load balance to check if
> it's worth moving its tasks on another CPU that has more capacity.
> 
> As a sidenote, this will note generate more spurious ilb because we already
> trig an ilb if there is more than 1 busy cpu. If this cpu is the only one that
> has a task, we will trig the ilb once for migrating the task.
> 
> The nohz_kick_needed function has been cleaned up a bit while adding the new
> test
> 
> Signed-off-by: Vincent Guittot 
> ---
>  kernel/sched/fair.c | 69 
> +
>  1 file changed, 49 insertions(+), 20 deletions(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 18db43e..60ae1ce 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -6049,6 +6049,14 @@ static bool update_sd_pick_busiest(struct lb_env *env,
>   return true;
>   }
> 
> + /*
> +  * The group capacity is reduced probably because of activity from other
> +  * sched class or interrupts which use part of the available capacity
> +  */
> + if ((sg->sgc->capacity_orig * 100) > (sgs->group_capacity *
> + env->sd->imbalance_pct))

Wouldn't the check on avg_load let us know if we are packing more tasks
in this group than its capacity ? Isn't that the metric we are more
interested in?

> + return true;
> +
>   return false;
>  }
> 
> @@ -6534,13 +6542,23 @@ static int need_active_balance(struct lb_env *env)
>   struct sched_domain *sd = env->sd;
> 
>   if (env->idle == CPU_NEWLY_IDLE) {
> + int src_cpu = env->src_cpu;
> 
>   /*
>* ASYM_PACKING needs to force migrate tasks from busy but
>* higher numbered CPUs in order to pack all tasks in the
>* lowest numbered CPUs.
>*/
> - if ((sd->flags & SD_ASYM_PACKING) && env->src_cpu > 
> env->dst_cpu)
> + if ((sd->flags & SD_ASYM_PACKING) && src_cpu > env->dst_cpu)
> + return 1;
> +
> + /*
> +  * If the CPUs share their cache and the src_cpu's capacity is
> +  * reduced because of other sched_class or IRQs, we trig an
> +  * active balance to move the task
> +  */
> + if ((capacity_orig_of(src_cpu) * 100) > (capacity_of(src_cpu) *
> + sd->imbalance_pct))
>   return 1;
>   }
> 
> @@ -6643,6 +6661,8 @@ static int load_balance(int this_cpu, struct rq 
> *this_rq,
> 
>   schedstat_add(sd, lb_imbalance[idle], env.imbalance);
> 
> + env.src_cpu = busiest->cpu;
> +
>   ld_moved = 0;
>   if (busiest->nr_running > 1) {
>   /*
> @@ -6652,7 +6672,6 @@ static int load_balance(int this_cpu, struct rq 
> *this_rq,
>* correctly treated as an imbalance.
>*/
>   env.flags |= LBF_ALL_PINNED;
> - env.src_cpu   = busiest->cpu;
>   env.src_rq= busiest;
>   env.loop_max  = min(sysctl_sched_nr_migrate, 
> busiest->nr_running);
> 
> @@ -7359,10 +7378,12 @@ static void nohz_idle_balance(struct rq *this_rq, 
> enum cpu_idle_type idle)
> 
>  /*
>   * Current heuristic for kicking the idle load balancer in the presence
> - * of an idle cpu is the system.
> + * of an idle cpu in the system.
>   *   - This rq has more than one task.
> - *   - At any scheduler domain level, this cpu's scheduler group has multiple
> - * busy cpu's exceeding the group's capacity.
> + *   - This rq has at least one CFS task and the capacity of the CPU is
> + * significantly reduced because of RT tasks or IRQs.
> + *   - At parent of LLC scheduler domain level, this cpu's scheduler group 
> has
> + * multiple busy cpu.
>   *   - For SD_ASYM_PACKING, if the lower numbered cpu's in the scheduler
>   * domain span are idle.
>   */
> @@ -7372,9 +7393,10 @@ static inline int nohz_kick_needed(struct rq *rq)
>   struct sched_domain *sd;
>   struct sched_group_capacity *sgc;
>   int nr_busy, cpu = rq->cpu;
> + bool kick = false;
> 
>   if (unlikely(rq->idle_balance))
> - return 0;
> + return false;
> 
> /*
>   * We may be recently in ticked or tickless idle mode. At the first
> @@ -7388,38 +7410,45 @@ static inline int nohz_kick_needed(struct rq *rq)
>* balancing.
>*/
>   if (likely(!atomic_read(_cpus)))
> - return 0;
> + return false;
> 
>   if (time_before(now, nohz.next_balance))
> - return 0;
> + return false;
> 
>   if (rq->nr_running >= 2)

Will this check ^^ not catch those cases which this patch is targeting?

Regards
Preeti U Murthy

> - goto need_kick;
> + return true;
> 
>   rcu_read_lock();
>   sd = 

Re: [RFC PATCH v4] tpm_tis: verify interrupt during init

2014-08-30 Thread Jason Gunthorpe
On Fri, Aug 29, 2014 at 11:59:32PM +, Scot Doyle wrote:

> (current->pending.signal.sig[0] == 0x0100 == SIGKILL?) about 30 
> seconds after module load begins. wait_for_tpm_stat sees that the return 
> value from wait_event_interruptible_timeout is positive and returns 0. 
> tpm_tis_send thinks everything is fine and continues. However, since a 
> signal was received, but not cleared, then the next time 
> wait_event_interruptible_timeout is used within wait_for_tpm_stat it 
> returns with -ERESTARTSYS, and continues doing so until tpm_send_data 
> returns -ETIME.

Oh, I see. That is another bug you've found - ERESTARTSYS should not
be translated into ETIME!

It is also not exciting that udev is overriding the driver timeouts. :(

> [1.536850] tpm_tis 00:08: 1.2 TPM (device-id 0xB, rev-id 16)
> [7.650172] tpm_tis 00:08: [Firmware Bug]: TPM interrupt not working, 
> polling instead
> 
> I tried calling tpm_get_timeouts only during the interrupt test, but again 
> was timed out after 30 seconds. The interrupt wait in tis_send calls 
> tpm_calc_ordinal_duration, which uses a default timeout of two minutes 
> when chip->vendor.duration[duration_idx] hasn't been set. Thus the second 
> call to tpm_get_timeouts in tpm_tis_init.

So the strategy is to read the timeouts and hope that the chip reports
something small and reasonable, then do a second read?

Seems reasonable, but with this new arrangement we could also use an
alternate polling logic for 'testing_int' that did the normal polling
loop unconditionally and then checked if the interrupt was
delivered. This would give a minimal dealy.

> What do you think about the guard logic? My intent is to prevent a signal 
> received after the test period from causing a fallback to polling mode. 
> Plus, it seems good to preserve the current logic where practical.

I think this is looking very reasonable now, I'll have to read it
closer next week!

> + if (priv->testing_int)
> + priv->int_received = true;

This could just be a simple counter, if the counter is 0 then test
the interrupt otherwise proceed normally.

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


[PATCH] pinctrl: adi2: Remove duplicate gpiochip_remove_pin_ranges from remove function

2014-08-30 Thread Pramod Gurav
This patch removes call to gpiochip_remove_pin_ranges() from platform_driver 
remove
function as it will anway be called by gpiochip_remove().

CC: Sonic Zhang 
CC: Linus Walleij 
Signed-off-by: Pramod Gurav 
---
 drivers/pinctrl/pinctrl-adi2.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-adi2.c b/drivers/pinctrl/pinctrl-adi2.c
index b092b93..e9909b9 100644
--- a/drivers/pinctrl/pinctrl-adi2.c
+++ b/drivers/pinctrl/pinctrl-adi2.c
@@ -1041,7 +1041,6 @@ static int adi_gpio_remove(struct platform_device *pdev)
u8 offset;
 
list_del(>node);
-   gpiochip_remove_pin_ranges(>chip);
gpiochip_remove(>chip);
if (port->pint) {
for (offset = 0; offset < port->width; offset++)
-- 
1.7.0.4

--
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 1/2] target: Add documentation on the target userspace pass-through driver

2014-08-30 Thread Richard W.M. Jones
On Tue, Jul 01, 2014 at 12:11:14PM -0700, Andy Grover wrote:
> Describes the driver and its interface to make it possible for user
> programs to back a LIO-exported LUN.
> 
> Signed-off-by: Andy Grover 
> ---
>  Documentation/target/tcmu-design.txt | 210 
> +++
>  1 file changed, 210 insertions(+)
>  create mode 100644 Documentation/target/tcmu-design.txt
> 
> diff --git a/Documentation/target/tcmu-design.txt 
> b/Documentation/target/tcmu-design.txt
> new file mode 100644
> index 000..200ff3e
> --- /dev/null
> +++ b/Documentation/target/tcmu-design.txt
> @@ -0,0 +1,210 @@
> +TCM Userspace Design
> +
> +
> +
> +Background:
> +
> +In addition to modularizing the transport protocol used for carrying
> +SCSI commands ("fabrics"), the Linux kernel target, LIO, also modularizes
> +the actual data storage as well. These are referred to as "backstores"
> +or "storage engines". The target comes with backstores that allow a
> +file, a block device, RAM, or another SCSI device to be used for the
> +local storage needed for the exported SCSI LUN. Like the rest of LIO,
> +these are implemented entirely as kernel code.
> +
> +These backstores cover the most common use cases, but not all. One new
> +use case that other non-kernel target solutions, such as tgt, are able
> +to support is using Gluster's GLFS or Ceph's RBD as a backstore. The
> +target then serves as a translator, allowing initiators to store data
> +in these non-traditional networked storage systems, while still only
> +using standard protocols themselves.
> +
> +If the target is a userspace process, supporting these is easy. tgt,
> +for example, needs only a small adapter module for each, because the
> +modules just use the available userspace libraries for RBD and GLFS.
> +
> +Adding support for these backstores in LIO is considerably more
> +difficult, because LIO is entirely kernel code. Instead of undertaking
> +the significant work to port the GLFS or RBD APIs and protocols to the
> +kernel, another approach is to create a userspace pass-through
> +backstore for LIO, "TCMU".

It has to be said that this documentation is terrible.

Jumping "in medias res"[1] is great for fiction, awful for technical
documentation.

I would recommend the Economist Style Guide[2].  They always say
"Barak Obama, President of the United States" the first time he is
mentioned in an article, even though almost everyone knows who Barak
Obama is.

In this case you're leaping into something .. fabrics, LIO,
backstores, target solutions, ... aargh.  Explain what you mean by
each term and how it all fits together.

Thanks,
Rich.

[1] https://en.wikipedia.org/wiki/In_medias_res

[2] http://www.economist.com/styleguide/introduction

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html
--
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: RTNL: assertion failed at net/ipv6/addrconf.c (1699)

2014-08-30 Thread Sabrina Dubroca
2014-08-30, 12:58:21 +0200, Sabrina Dubroca wrote:
>- pndisc_constructor, called from pneigh_lookup -- pneigh_lookup
>  has ASSERT_RTNL(), but pneigh_lookup is called from ip6_forward and
>  ndisc_recv_na

Ah, these have creat = 0, so it's fine. I missed that earlier.

Sorry for the noise.

-- 
Sabrina
--
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 04/12] sched: Allow all archs to set the capacity_orig

2014-08-30 Thread Preeti U Murthy
Hi Vincent,

On 08/26/2014 04:36 PM, Vincent Guittot wrote:
> capacity_orig is only changed for system with a SMT sched_domain level in 
> order

I think I had asked this before, but why only capacity_orig? The
capacity of a group is also being updated the same way. This patch fixes
the capacity of a group to reflect the capacity of the heterogeneous
CPUs in it, this capacity being both the full capacity of the group:
capacity_orig and the capacity available for the fair tasks. So I feel
in the subject as well as the changelog it would suffice to say 'capacity'.

> to reflect the lower capacity of CPUs. Heterogenous system also have to 
> reflect an
> original capacity that is different from the default value.
> 
> Create a more generic function arch_scale_cpu_capacity that can be also used 
> by
> non SMT platform to set capacity_orig.
> 
> The weak behavior of arch_scale_cpu_capacity is the previous SMT one in order 
> to
> keep backward compatibility in the use of capacity_orig.
> 
> arch_scale_smt_capacity and default_scale_smt_capacity have been removed as
> they were not use elsewhere than in arch_scale_cpu_capacity.
> 
> Signed-off-by: Vincent Guittot 
> ---
>  kernel/sched/fair.c | 25 ++---
>  1 file changed, 6 insertions(+), 19 deletions(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index b85e9f7..8176bda 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -5705,19 +5705,12 @@ unsigned long __weak arch_scale_freq_capacity(struct 
> sched_domain *sd, int cpu)
>   return default_scale_capacity(sd, cpu);
>  }
> 
> -static unsigned long default_scale_smt_capacity(struct sched_domain *sd, int 
> cpu)
> +unsigned long __weak arch_scale_cpu_capacity(struct sched_domain *sd, int 
> cpu)
>  {
> - unsigned long weight = sd->span_weight;
> - unsigned long smt_gain = sd->smt_gain;
> + if ((sd->flags & SD_SHARE_CPUCAPACITY) && (sd->span_weight > 1))
> + return sd->smt_gain / sd->span_weight;
> 
> - smt_gain /= weight;
> -
> - return smt_gain;
> -}
> -
> -unsigned long __weak arch_scale_smt_capacity(struct sched_domain *sd, int 
> cpu)
> -{
> - return default_scale_smt_capacity(sd, cpu);
> + return SCHED_CAPACITY_SCALE;
>  }
> 
>  static unsigned long scale_rt_capacity(int cpu)
> @@ -5756,18 +5749,12 @@ static unsigned long scale_rt_capacity(int cpu)
> 
>  static void update_cpu_capacity(struct sched_domain *sd, int cpu)
>  {
> - unsigned long weight = sd->span_weight;
>   unsigned long capacity = SCHED_CAPACITY_SCALE;
>   struct sched_group *sdg = sd->groups;
> 
> - if ((sd->flags & SD_SHARE_CPUCAPACITY) && weight > 1) {
> - if (sched_feat(ARCH_CAPACITY))

Aren't you missing this check above? I understand that it is not
crucial, but that would also mean removing ARCH_CAPACITY sched_feat
altogether, wouldn't it?

Regards
Preeti U Murthy
> - capacity *= arch_scale_smt_capacity(sd, cpu);
> - else
> - capacity *= default_scale_smt_capacity(sd, cpu);
> + capacity *= arch_scale_cpu_capacity(sd, cpu);
> 
> - capacity >>= SCHED_CAPACITY_SHIFT;
> - }
> + capacity >>= SCHED_CAPACITY_SHIFT;
> 
>   sdg->sgc->capacity_orig = capacity;
> 

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


[PATCH v2 1/6] mm/balloon_compaction: ignore anonymous pages

2014-08-30 Thread Konstantin Khlebnikov
From: Konstantin Khlebnikov 

Sasha Levin reported KASAN splash inside isolate_migratepages_range().
Problem is in function __is_movable_balloon_page() which tests AS_BALLOON_MAP
in page->mapping->flags. This function has no protection against anonymous
pages. As result it tried to check address space flags in inside anon-vma.

Signed-off-by: Konstantin Khlebnikov 
Reported-by: Sasha Levin 
Link: http://lkml.kernel.org/p/53e6ceaa.9020...@oracle.com
Cc: stable  # v3.8
---
 include/linux/balloon_compaction.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/balloon_compaction.h 
b/include/linux/balloon_compaction.h
index 089743a..53d482e 100644
--- a/include/linux/balloon_compaction.h
+++ b/include/linux/balloon_compaction.h
@@ -128,7 +128,7 @@ static inline bool page_flags_cleared(struct page *page)
 static inline bool __is_movable_balloon_page(struct page *page)
 {
struct address_space *mapping = page->mapping;
-   return mapping_balloon(mapping);
+   return !PageAnon(page) && mapping_balloon(mapping);
 }
 
 /*

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


[PATCH v2 2/6] mm/balloon_compaction: keep ballooned pages away from normal migration path

2014-08-30 Thread Konstantin Khlebnikov
From: Konstantin Khlebnikov 

Proper testing shows yet another problem in balloon migration: it works only
once for each page. balloon_page_movable() check page flags and page_count.
In __unmap_and_move page is locked, reference counter is elevated, so
balloon_page_movable() _always_ fails here. As result in __unmap_and_move()
migration goes to the normal migration path.

Balloon ->migratepage() is so special, it returns MIGRATEPAGE_BALLOON_SUCCESS
instead of MIGRATEPAGE_SUCCESS. After that in move_to_new_page() successfully
migrated page got NULL into its mapping pointer and loses connectivity with
balloon and ability for further migration.

It's safe to use __is_movable_balloon_page here: page is isolated and pinned.

Signed-off-by: Konstantin Khlebnikov 
Cc: stable  # v3.8
---
 include/linux/balloon_compaction.h |5 +
 mm/migrate.c   |2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/linux/balloon_compaction.h 
b/include/linux/balloon_compaction.h
index 53d482e..284fc1d 100644
--- a/include/linux/balloon_compaction.h
+++ b/include/linux/balloon_compaction.h
@@ -258,6 +258,11 @@ static inline void balloon_page_delete(struct page *page)
list_del(>lru);
 }
 
+static inline bool __is_movable_balloon_page(struct page *page)
+{
+   return false;
+}
+
 static inline bool balloon_page_movable(struct page *page)
 {
return false;
diff --git a/mm/migrate.c b/mm/migrate.c
index 905b1aa..57c94f9 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -873,7 +873,7 @@ static int __unmap_and_move(struct page *page, struct page 
*newpage,
}
}
 
-   if (unlikely(balloon_page_movable(page))) {
+   if (unlikely(__is_movable_balloon_page(page))) {
/*
 * A ballooned page does not need any special attention from
 * physical to virtual reverse mapping procedures.

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


[PATCH v2 3/6] mm/balloon_compaction: isolate balloon pages without lru_lock

2014-08-30 Thread Konstantin Khlebnikov
From: Konstantin Khlebnikov 

LRU-lock isn't required for balloon page isolation. This check makes migration
of some ballooned pages mostly impossible because isolate_migratepages_range()
drops LRU lock periodically.

Signed-off-by: Konstantin Khlebnikov 
Cc: stable  # v3.8
---
 mm/compaction.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index 73466e1..ad58f73 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -643,7 +643,7 @@ isolate_migratepages_block(struct compact_control *cc, 
unsigned long low_pfn,
 */
if (!PageLRU(page)) {
if (unlikely(balloon_page_movable(page))) {
-   if (locked && balloon_page_isolate(page)) {
+   if (balloon_page_isolate(page)) {
/* Successfully isolated */
goto isolate_success;
}

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


[PATCH v2 5/6] mm/balloon_compaction: use common page ballooning

2014-08-30 Thread Konstantin Khlebnikov
From: Konstantin Khlebnikov 

This patch replaces checking AS_BALLOON_MAP in page->mapping->flags
with PageBalloon which is stored directly in the struct page.
All code of balloon_compaction now under CONFIG_MEMORY_BALLOON.

Signed-off-by: Konstantin Khlebnikov 
---
 drivers/virtio/Kconfig |1 
 include/linux/balloon_compaction.h |  135 ++--
 mm/Kconfig |2 -
 mm/Makefile|3 +
 mm/balloon_compaction.c|7 +-
 mm/compaction.c|9 +-
 mm/migrate.c   |6 +-
 mm/vmscan.c|2 -
 8 files changed, 39 insertions(+), 126 deletions(-)

diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig
index c6683f2..00b2286 100644
--- a/drivers/virtio/Kconfig
+++ b/drivers/virtio/Kconfig
@@ -25,6 +25,7 @@ config VIRTIO_PCI
 config VIRTIO_BALLOON
tristate "Virtio balloon driver"
depends on VIRTIO
+   select MEMORY_BALLOON
---help---
 This driver supports increasing and decreasing the amount
 of memory within a KVM guest.
diff --git a/include/linux/balloon_compaction.h 
b/include/linux/balloon_compaction.h
index 284fc1d..09f8c5a 100644
--- a/include/linux/balloon_compaction.h
+++ b/include/linux/balloon_compaction.h
@@ -46,6 +46,8 @@
 #include 
 #include 
 
+#ifdef CONFIG_MEMORY_BALLOON
+
 /*
  * Balloon device information descriptor.
  * This struct is used to allow the common balloon compaction interface
@@ -93,91 +95,6 @@ static inline void balloon_page_free(struct page *page)
__free_page(page);
 }
 
-#ifdef CONFIG_BALLOON_COMPACTION
-extern bool balloon_page_isolate(struct page *page);
-extern void balloon_page_putback(struct page *page);
-extern int balloon_page_migrate(struct page *newpage,
-   struct page *page, enum migrate_mode mode);
-extern struct address_space
-*balloon_mapping_alloc(struct balloon_dev_info *b_dev_info,
-   const struct address_space_operations *a_ops);
-
-static inline void balloon_mapping_free(struct address_space *balloon_mapping)
-{
-   kfree(balloon_mapping);
-}
-
-/*
- * page_flags_cleared - helper to perform balloon @page ->flags tests.
- *
- * As balloon pages are obtained from buddy and we do not play with page->flags
- * at driver level (exception made when we get the page lock for compaction),
- * we can safely identify a ballooned page by checking if the
- * PAGE_FLAGS_CHECK_AT_PREP page->flags are all cleared.  This approach also
- * helps us skip ballooned pages that are locked for compaction or release, 
thus
- * mitigating their racy check at balloon_page_movable()
- */
-static inline bool page_flags_cleared(struct page *page)
-{
-   return !(page->flags & PAGE_FLAGS_CHECK_AT_PREP);
-}
-
-/*
- * __is_movable_balloon_page - helper to perform @page mapping->flags tests
- */
-static inline bool __is_movable_balloon_page(struct page *page)
-{
-   struct address_space *mapping = page->mapping;
-   return !PageAnon(page) && mapping_balloon(mapping);
-}
-
-/*
- * balloon_page_movable - test page->mapping->flags to identify balloon pages
- *   that can be moved by compaction/migration.
- *
- * This function is used at core compaction's page isolation scheme, therefore
- * most pages exposed to it are not enlisted as balloon pages and so, to avoid
- * undesired side effects like racing against __free_pages(), we cannot afford
- * holding the page locked while testing page->mapping->flags here.
- *
- * As we might return false positives in the case of a balloon page being just
- * released under us, the page->mapping->flags need to be re-tested later,
- * under the proper page lock, at the functions that will be coping with the
- * balloon page case.
- */
-static inline bool balloon_page_movable(struct page *page)
-{
-   /*
-* Before dereferencing and testing mapping->flags, let's make sure
-* this is not a page that uses ->mapping in a different way
-*/
-   if (page_flags_cleared(page) && !page_mapped(page) &&
-   page_count(page) == 1)
-   return __is_movable_balloon_page(page);
-
-   return false;
-}
-
-/*
- * isolated_balloon_page - identify an isolated balloon page on private
- *compaction/migration page lists.
- *
- * After a compaction thread isolates a balloon page for migration, it raises
- * the page refcount to prevent concurrent compaction threads from re-isolating
- * the same page. For that reason putback_movable_pages(), or other routines
- * that need to identify isolated balloon pages on private pagelists, cannot
- * rely on balloon_page_movable() to accomplish the task.
- */
-static inline bool isolated_balloon_page(struct page *page)
-{
-   /* Already isolated balloon pages, by default, have a raised refcount */
-   if (page_flags_cleared(page) && !page_mapped(page) 

[PATCH v2 4/6] mm: introduce common page state for ballooned memory

2014-08-30 Thread Konstantin Khlebnikov
From: Konstantin Khlebnikov 

This patch adds page state PageBallon() and functions __Set/ClearPageBalloon.
Like PageBuddy() PageBalloon() looks like page-flag but actually this is special
state of page->_mapcount counter. There is no conflict because ballooned pages
cannot be mapped and cannot be in buddy allocator.

Ballooned pages are counted in vmstat counter NR_BALLOON_PAGES, it's shown them
in /proc/meminfo and /proc/meminfo. Also this patch it exports PageBallon into
userspace via /proc/kpageflags as KPF_BALLOON.

All new code is under CONFIG_MEMORY_BALLOON, it should be selected by
ballooning driver which wants use this feature.

Signed-off-by: Konstantin Khlebnikov 
---
 Documentation/filesystems/proc.txt |2 ++
 drivers/base/node.c|   16 ++--
 fs/proc/meminfo.c  |6 ++
 fs/proc/page.c |3 +++
 include/linux/mm.h |   20 
 include/linux/mmzone.h |3 +++
 include/uapi/linux/kernel-page-flags.h |1 +
 mm/Kconfig |5 +
 mm/vmstat.c|8 +++-
 tools/vm/page-types.c  |1 +
 10 files changed, 58 insertions(+), 7 deletions(-)

diff --git a/Documentation/filesystems/proc.txt 
b/Documentation/filesystems/proc.txt
index eb8a10e..154a345 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -796,6 +796,7 @@ VmallocTotal:   112216 kB
 VmallocUsed:   428 kB
 VmallocChunk:   111088 kB
 AnonHugePages:   49152 kB
+BalloonPages:0 kB
 
 MemTotal: Total usable ram (i.e. physical ram minus a few reserved
   bits and the kernel binary code)
@@ -838,6 +839,7 @@ MemAvailable: An estimate of how much memory is available 
for starting new
Writeback: Memory which is actively being written back to the disk
AnonPages: Non-file backed pages mapped into userspace page tables
 AnonHugePages: Non-file backed huge pages mapped into userspace page tables
+BalloonPages: Memory which was ballooned, not included into MemTotal
   Mapped: files which have been mmaped, such as libraries
 Slab: in-kernel data structures cache
 SReclaimable: Part of Slab, that might be reclaimed, such as caches
diff --git a/drivers/base/node.c b/drivers/base/node.c
index c6d3ae0..59e565c 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -120,6 +120,9 @@ static ssize_t node_read_meminfo(struct device *dev,
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
   "Node %d AnonHugePages:  %8lu kB\n"
 #endif
+#ifdef CONFIG_MEMORY_BALLOON
+  "Node %d BalloonPages:   %8lu kB\n"
+#endif
,
   nid, K(node_page_state(nid, NR_FILE_DIRTY)),
   nid, K(node_page_state(nid, NR_WRITEBACK)),
@@ -136,14 +139,15 @@ static ssize_t node_read_meminfo(struct device *dev,
   nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE) +
node_page_state(nid, NR_SLAB_UNRECLAIMABLE)),
   nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE)),
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
   nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE))
-   , nid,
-   K(node_page_state(nid, NR_ANON_TRANSPARENT_HUGEPAGES) *
-   HPAGE_PMD_NR));
-#else
-  nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE)));
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+  ,nid, K(node_page_state(nid,
+   NR_ANON_TRANSPARENT_HUGEPAGES) * HPAGE_PMD_NR)
+#endif
+#ifdef CONFIG_MEMORY_BALLOON
+  ,nid, K(node_page_state(nid, NR_BALLOON_PAGES))
 #endif
+  );
n += hugetlb_report_node_meminfo(nid, buf + n);
return n;
 }
diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
index aa1eee0..f897fbf 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
@@ -138,6 +138,9 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
"AnonHugePages:  %8lu kB\n"
 #endif
+#ifdef CONFIG_MEMORY_BALLOON
+   "BalloonPages:   %8lu kB\n"
+#endif
,
K(i.totalram),
K(i.freeram),
@@ -193,6 +196,9 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
,K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
   HPAGE_PMD_NR)
 #endif
+#ifdef CONFIG_MEMORY_BALLOON
+   ,K(global_page_state(NR_BALLOON_PAGES))
+#endif
);
 
hugetlb_report_meminfo(m);
diff --git a/fs/proc/page.c b/fs/proc/page.c
index e647c55..1e3187d 100644
--- a/fs/proc/page.c
+++ b/fs/proc/page.c
@@ -133,6 +133,9 @@ u64 stable_page_flags(struct page *page)
if (PageBuddy(page))
u |= 1 << KPF_BUDDY;
 
+   if 

[PATCH v2 6/6] mm/balloon_compaction: general cleanup

2014-08-30 Thread Konstantin Khlebnikov
From: Konstantin Khlebnikov 

* move special branch for balloon migraion into migrate_pages
* remove special mapping for balloon and its flag AS_BALLOON_MAP
* embed struct balloon_dev_info into struct virtio_balloon
* cleanup balloon_page_dequeue, kill balloon_page_free

Signed-off-by: Konstantin Khlebnikov 
---
 drivers/virtio/virtio_balloon.c|   77 -
 include/linux/balloon_compaction.h |  127 ++---
 include/linux/migrate.h|   11 --
 include/linux/pagemap.h|   18 ---
 mm/balloon_compaction.c|  214 
 mm/migrate.c   |   29 +
 6 files changed, 134 insertions(+), 342 deletions(-)

diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 25ebe8e..c84d6a8 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -59,7 +59,7 @@ struct virtio_balloon
 * Each page on this list adds VIRTIO_BALLOON_PAGES_PER_PAGE
 * to num_pages above.
 */
-   struct balloon_dev_info *vb_dev_info;
+   struct balloon_dev_info vb_dev_info;
 
/* Synchronize access/update to this struct virtio_balloon elements */
struct mutex balloon_lock;
@@ -127,7 +127,7 @@ static void set_page_pfns(u32 pfns[], struct page *page)
 
 static void fill_balloon(struct virtio_balloon *vb, size_t num)
 {
-   struct balloon_dev_info *vb_dev_info = vb->vb_dev_info;
+   struct balloon_dev_info *vb_dev_info = >vb_dev_info;
 
/* We can only do one array worth at a time. */
num = min(num, ARRAY_SIZE(vb->pfns));
@@ -163,15 +163,15 @@ static void release_pages_by_pfn(const u32 pfns[], 
unsigned int num)
/* Find pfns pointing at start of each page, get pages and free them. */
for (i = 0; i < num; i += VIRTIO_BALLOON_PAGES_PER_PAGE) {
struct page *page = balloon_pfn_to_page(pfns[i]);
-   balloon_page_free(page);
adjust_managed_page_count(page, 1);
+   put_page(page);
}
 }
 
 static void leak_balloon(struct virtio_balloon *vb, size_t num)
 {
struct page *page;
-   struct balloon_dev_info *vb_dev_info = vb->vb_dev_info;
+   struct balloon_dev_info *vb_dev_info = >vb_dev_info;
 
/* We can only do one array worth at a time. */
num = min(num, ARRAY_SIZE(vb->pfns));
@@ -353,12 +353,11 @@ static int init_vqs(struct virtio_balloon *vb)
return 0;
 }
 
-static const struct address_space_operations virtio_balloon_aops;
 #ifdef CONFIG_BALLOON_COMPACTION
 /*
  * virtballoon_migratepage - perform the balloon page migration on behalf of
  *  a compation thread. (called under page lock)
- * @mapping: the page->mapping which will be assigned to the new migrated page.
+ * @vb_dev_info: the balloon device
  * @newpage: page that will replace the isolated page after migration finishes.
  * @page   : the isolated (old) page that is about to be migrated to newpage.
  * @mode   : compaction mode -- not used for balloon page migration.
@@ -373,17 +372,13 @@ static const struct address_space_operations 
virtio_balloon_aops;
  * This function preforms the balloon page migration task.
  * Called through balloon_mapping->a_ops->migratepage
  */
-static int virtballoon_migratepage(struct address_space *mapping,
+static int virtballoon_migratepage(struct balloon_dev_info *vb_dev_info,
struct page *newpage, struct page *page, enum migrate_mode mode)
 {
-   struct balloon_dev_info *vb_dev_info = balloon_page_device(page);
-   struct virtio_balloon *vb;
+   struct virtio_balloon *vb = container_of(vb_dev_info,
+   struct virtio_balloon, vb_dev_info);
unsigned long flags;
 
-   BUG_ON(!vb_dev_info);
-
-   vb = vb_dev_info->balloon_device;
-
/*
 * In order to avoid lock contention while migrating pages concurrently
 * to leak_balloon() or fill_balloon() we just give up the balloon_lock
@@ -395,42 +390,34 @@ static int virtballoon_migratepage(struct address_space 
*mapping,
if (!mutex_trylock(>balloon_lock))
return -EAGAIN;
 
+   get_page(newpage); /* balloon reference */
+
/* balloon's page migration 1st step  -- inflate "newpage" */
spin_lock_irqsave(_dev_info->pages_lock, flags);
-   balloon_page_insert(newpage, mapping, _dev_info->pages);
+   balloon_page_insert(vb_dev_info, newpage);
vb_dev_info->isolated_pages--;
spin_unlock_irqrestore(_dev_info->pages_lock, flags);
vb->num_pfns = VIRTIO_BALLOON_PAGES_PER_PAGE;
set_page_pfns(vb->pfns, newpage);
tell_host(vb, vb->inflate_vq);
 
-   /*
-* balloon's page migration 2nd step -- deflate "page"
-*
-* It's safe to delete page->lru here because this page is at
-* an isolated migration list, and this step is expected to happen here
-*/
-   

[PATCH v2 0/6] mm/balloon_compaction: fixes and cleanups

2014-08-30 Thread Konstantin Khlebnikov
I've checked compilation of linux-next/x86 for allnoconfig, defconfig and
defconfig + kvmconfig + virtio-balloon with and without balloon-compaction.
For stable kernels first three patches should be enough.

changes since v1:

mm/balloon_compaction: ignore anonymous pages
* no changes

mm/balloon_compaction: keep ballooned pages away from normal migration path
* fix compilation without CONFIG_BALLOON_COMPACTION

mm/balloon_compaction: isolate balloon pages without lru_lock
* no changes

mm: introduce common page state for ballooned memory
* move __Set/ClearPageBalloon into linux/mm.h
* remove inc/dec_zone_page_state from __Set/ClearPageBalloon

mm/balloon_compaction: use common page ballooning
* call inc/dec_zone_page_state from balloon_page_insert/delete

mm/balloon_compaction: general cleanup
* fix compilation without CONFIG_MIGRATION
* fix compilation without CONFIG_BALLOON_COMPACTION

---

Konstantin Khlebnikov (6):
  mm/balloon_compaction: ignore anonymous pages
  mm/balloon_compaction: keep ballooned pages away from normal migration 
path
  mm/balloon_compaction: isolate balloon pages without lru_lock
  mm: introduce common page state for ballooned memory
  mm/balloon_compaction: use common page ballooning
  mm/balloon_compaction: general cleanup


 Documentation/filesystems/proc.txt |2 
 drivers/base/node.c|   16 +-
 drivers/virtio/Kconfig |1 
 drivers/virtio/virtio_balloon.c|   77 +++
 fs/proc/meminfo.c  |6 +
 fs/proc/page.c |3 
 include/linux/balloon_compaction.h |  223 ++--
 include/linux/migrate.h|   11 --
 include/linux/mm.h |   20 +++
 include/linux/mmzone.h |3 
 include/linux/pagemap.h|   18 ---
 include/uapi/linux/kernel-page-flags.h |1 
 mm/Kconfig |7 +
 mm/Makefile|3 
 mm/balloon_compaction.c|  219 ++-
 mm/compaction.c|9 +
 mm/migrate.c   |   29 +---
 mm/vmscan.c|2 
 mm/vmstat.c|8 +
 tools/vm/page-types.c  |1 
 20 files changed, 210 insertions(+), 449 deletions(-)

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


[PATCH] mm: rename "migrate_page" to "generic_migrate_page"

2014-08-30 Thread Konstantin Khlebnikov
If CONFIG_MIGRATION=n "migrate_page" turns into NULL. This kills ifdef-endif
mess inside definitions of address space operations. But this macro affects
everything with this name, "migrate_page" is too short and generic.

This patch renames it into generic_migrate_page. Fortunately it's used only in
few places. Also here minor update for documentation: a_ops method is called
"migratepage", without underscore, obviously for keeping the macro away.

Signed-off-by: Konstantin Khlebnikov 
---
 Documentation/filesystems/vfs.txt |   13 -
 fs/btrfs/disk-io.c|2 +-
 fs/nfs/write.c|2 +-
 include/linux/migrate.h   |6 +++---
 mm/migrate.c  |   10 +-
 mm/shmem.c|2 +-
 mm/swap_state.c   |2 +-
 7 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/Documentation/filesystems/vfs.txt 
b/Documentation/filesystems/vfs.txt
index 02a766c..a633fa7 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -746,12 +746,15 @@ struct address_space_operations {
Filesystems that want to use execute-in-place (XIP) need to implement
it.  An example implementation can be found in fs/ext2/xip.c.
 
-  migrate_page:  This is used to compact the physical memory usage.
-If the VM wants to relocate a page (maybe off a memory card
-that is signalling imminent failure) it will pass a new page
-   and an old page to this function.  migrate_page should
+  migratepage:  This is used to compact the physical memory usage.
+   If the VM wants to relocate a page (maybe off a memory card
+   that is signalling imminent failure) it will pass a new page
+   and an old page to this function.  migratepage should
transfer any private data across and update any references
-that it has to the page.
+   that it has to the page.
+
+   Filesystem might use here generic_migrate_page if pages have no
+   private data or buffer_migrate_page for pages with buffers.
 
   launder_page: Called before freeing a page - it writes back the dirty page. 
To
prevent redirtying the page, it is kept locked during the whole
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index a1d36e6..af1a274 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -973,7 +973,7 @@ static int btree_migratepage(struct address_space *mapping,
if (page_has_private(page) &&
!try_to_release_page(page, GFP_KERNEL))
return -EAGAIN;
-   return migrate_page(mapping, newpage, page, mode);
+   return generic_migrate_page(mapping, newpage, page, mode);
 }
 #endif
 
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 175d5d0..7101a6d 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1898,7 +1898,7 @@ int nfs_migrate_page(struct address_space *mapping, 
struct page *newpage,
if (!nfs_fscache_release_page(page, GFP_KERNEL))
return -EBUSY;
 
-   return migrate_page(mapping, newpage, page, mode);
+   return generic_migrate_page(mapping, newpage, page, mode);
 }
 #endif
 
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index a2901c4..0a4604a 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -38,7 +38,7 @@ enum migrate_reason {
 #ifdef CONFIG_MIGRATION
 
 extern void putback_movable_pages(struct list_head *l);
-extern int migrate_page(struct address_space *,
+extern int generic_migrate_page(struct address_space *,
struct page *, struct page *, enum migrate_mode);
 extern int migrate_pages(struct list_head *l, new_page_t new, free_page_t free,
unsigned long private, enum migrate_mode mode, int reason);
@@ -82,8 +82,8 @@ static inline int migrate_huge_page_move_mapping(struct 
address_space *mapping,
return -ENOSYS;
 }
 
-/* Possible settings for the migrate_page() method in address_operations */
-#define migrate_page NULL
+/* Possible settings for the migratepage() method in address_operations */
+#define generic_migrate_page   NULL
 
 #endif /* CONFIG_MIGRATION */
 
diff --git a/mm/migrate.c b/mm/migrate.c
index f78ec9b..905b1aa 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -588,7 +588,7 @@ void migrate_page_copy(struct page *newpage, struct page 
*page)
  *
  * Pages are locked upon entry and exit.
  */
-int migrate_page(struct address_space *mapping,
+int generic_migrate_page(struct address_space *mapping,
struct page *newpage, struct page *page,
enum migrate_mode mode)
 {
@@ -604,7 +604,7 @@ int migrate_page(struct address_space *mapping,
migrate_page_copy(newpage, page);
return MIGRATEPAGE_SUCCESS;
 }
-EXPORT_SYMBOL(migrate_page);
+EXPORT_SYMBOL(generic_migrate_page);
 
 #ifdef CONFIG_BLOCK
 /*
@@ -619,7 +619,7 @@ int buffer_migrate_page(struct address_space *mapping,
int rc;
 
if (!page_has_buffers(page))
-  

[PATCH] pinctrl: bcm281xx: Add remove function to pinctrl_unregister

2014-08-30 Thread Pramod Gurav
This patch adds a remove function in platform_driver to pinctrl_unregister
for clean unloading.
This makes local struct pinctrl_dev a part of struct bcm281xx_pinctrl_data to
be accessed from pdev in remove function.

CC: Sherman Yin 
CC: Linus Walleij 
Signed-off-by: Pramod Gurav 
---
 drivers/pinctrl/pinctrl-bcm281xx.c |   17 +
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-bcm281xx.c 
b/drivers/pinctrl/pinctrl-bcm281xx.c
index c5ca9e6..63db3b6 100644
--- a/drivers/pinctrl/pinctrl-bcm281xx.c
+++ b/drivers/pinctrl/pinctrl-bcm281xx.c
@@ -87,7 +87,7 @@ struct bcm281xx_pin_function {
  */
 struct bcm281xx_pinctrl_data {
void __iomem *reg_base;
-
+   struct pinctrl_dev *pctl;
/* List of all pins */
const struct pinctrl_pin_desc *pins;
const unsigned npins;
@@ -1400,7 +1400,6 @@ static int __init bcm281xx_pinctrl_probe(struct 
platform_device *pdev)
 {
struct bcm281xx_pinctrl_data *pdata = _pinctrl;
struct resource *res;
-   struct pinctrl_dev *pctl;
 
/* So far We can assume there is only 1 bank of registers */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1427,10 +1426,10 @@ static int __init bcm281xx_pinctrl_probe(struct 
platform_device *pdev)
bcm281xx_pinctrl_desc.pins = bcm281xx_pinctrl.pins;
bcm281xx_pinctrl_desc.npins = bcm281xx_pinctrl.npins;
 
-   pctl = pinctrl_register(_pinctrl_desc,
+   pdata->pctl = pinctrl_register(_pinctrl_desc,
>dev,
pdata);
-   if (!pctl) {
+   if (!pdata->pctl) {
dev_err(>dev, "Failed to register pinctrl\n");
return -ENODEV;
}
@@ -1440,6 +1439,15 @@ static int __init bcm281xx_pinctrl_probe(struct 
platform_device *pdev)
return 0;
 }
 
+static int bcm281xx_pinctrl_remove(struct platform_device *pdev)
+{
+   struct bcm281xx_pinctrl_data *pdata = platform_get_drvdata(pdev);
+
+   pinctrl_unregister(pdata->pctl);
+
+   return 0;
+}
+
 static struct of_device_id bcm281xx_pinctrl_of_match[] = {
{ .compatible = "brcm,bcm11351-pinctrl", },
{ },
@@ -1451,6 +1459,7 @@ static struct platform_driver bcm281xx_pinctrl_driver = {
.owner = THIS_MODULE,
.of_match_table = bcm281xx_pinctrl_of_match,
},
+   .remove = bcm281xx_pinctrl_remove,
 };
 
 module_platform_driver_probe(bcm281xx_pinctrl_driver, bcm281xx_pinctrl_probe);
-- 
1.7.0.4

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


  1   2   3   4   >