[PATCH] ASoC: wm8804: Use common error handling code in wm8804_probe()

2017-11-18 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sun, 19 Nov 2017 07:55:49 +0100

* Add a jump target so that a specific error message is stored only once
  at the end of this function implementation.

* Replace two calls of the function "dev_err" by goto statements.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---
 sound/soc/codecs/wm8804.c | 14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/sound/soc/codecs/wm8804.c b/sound/soc/codecs/wm8804.c
index fc69b87443d8..a45812417909 100644
--- a/sound/soc/codecs/wm8804.c
+++ b/sound/soc/codecs/wm8804.c
@@ -626,16 +626,12 @@ int wm8804_probe(struct device *dev, struct regmap 
*regmap)
gpiod_set_value_cansleep(wm8804->reset, 1);
 
ret = regmap_read(regmap, WM8804_RST_DEVID1, &id1);
-   if (ret < 0) {
-   dev_err(dev, "Failed to read device ID: %d\n", ret);
-   goto err_reg_enable;
-   }
+   if (ret < 0)
+   goto report_read_failure;
 
ret = regmap_read(regmap, WM8804_DEVID2, &id2);
-   if (ret < 0) {
-   dev_err(dev, "Failed to read device ID: %d\n", ret);
-   goto err_reg_enable;
-   }
+   if (ret < 0)
+   goto report_read_failure;
 
id2 = (id2 << 8) | id1;
 
@@ -674,6 +670,8 @@ int wm8804_probe(struct device *dev, struct regmap *regmap)
 
return 0;
 
+report_read_failure:
+   dev_err(dev, "Failed to read device ID: %d\n", ret);
 err_reg_enable:
regulator_bulk_disable(ARRAY_SIZE(wm8804->supplies), wm8804->supplies);
return ret;
-- 
2.15.0



Re: [PATCH] ALSA: via82xx: Use common error handling code in snd_via82xx_create()

2017-11-18 Thread SF Markus Elfring
>> @@ -1153,6 +1150,14 @@ static int snd_via82xx_create(struct snd_card *card,
>>  
>>  *r_via = chip;
>>  return 0;
>> +
>> +disable_device:
>> +pci_disable_device(pci);
>> +goto exit;
>> +free_chip:
>> +snd_via82xx_free(chip);
>> +exit:
>> +return err;
> 
> Doubly goto doesn't look like an improvement.

Would you like to integrate another software update with the statement
“return err;” instead of “goto exit;” at this place?

Regards,
Markus


Re: [PATCH V2 2/2] mfd: cros ec: spi: Simplify delay handling between SPI messages

2017-11-18 Thread Benson Leung
Hi Jon,

On Tue, Nov 14, 2017 at 02:43:28PM +, Jon Hunter wrote:
> The EC SPI driver prevents SPI transfers being to rapidly by keeping
> track of the time the last transfer was issued via the
> 'last_transfer_ns' variable. Previously, if the 'last_transfer_ns'
> variable was zero, this indicated that no previous transfer had been
> sent and that no delay was needed. However, the EC SPI driver has
> been updated to always initialise the 'last_transfer_ns' variable
> during probe and therefore, it is no longer necessary to test if it
> is zero. Remove the code that checks if this variable is zero.
> 
> Signed-off-by: Jon Hunter 
> Reviewed-by: Brian Norris 

Acked-by: Benson Leung 

-- 
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
ble...@google.com
Chromium OS Project
ble...@chromium.org


signature.asc
Description: Digital signature


Re: [PATCH V2 1/2] mfd: cros ec: spi: Don't send first message too soon

2017-11-18 Thread Benson Leung
Hi Jon,

On Tue, Nov 14, 2017 at 02:43:27PM +, Jon Hunter wrote:
> On the Tegra124 Nyan-Big chromebook the very first SPI message sent to
> the EC is failing.
> 
> The Tegra SPI driver configures the SPI chip-selects to be active-high
> by default (and always has for many years). The EC SPI requires an
> active-low chip-select and so the Tegra chip-select is reconfigured to
> be active-low when the EC SPI driver calls spi_setup(). The problem is
> that if the first SPI message to the EC is sent too soon after
> reconfiguring the SPI chip-select, it fails.
> 
> The EC SPI driver prevents back-to-back SPI messages being sent too
> soon by keeping track of the time the last transfer was sent via the
> variable 'last_transfer_ns'. To prevent the very first transfer being
> sent too soon, initialise the 'last_transfer_ns' variable after calling
> spi_setup() and before sending the first SPI message.
> 
> Cc: 
> 
> Signed-off-by: Jon Hunter 
> Reviewed-by: Brian Norris 

Acked-by: Benson Leung 

-- 
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
ble...@google.com
Chromium OS Project
ble...@chromium.org


signature.asc
Description: Digital signature


[PATCH 1/2] MAINTAINERS: regulator: Add Documentation/power/regulator/

2017-11-18 Thread Jonathan Neuschäfer
Signed-off-by: Jonathan Neuschäfer 
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 2811a211632c..a644d41e088c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14447,6 +14447,7 @@ W:  http://www.slimlogic.co.uk/?p=48
 T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
 S: Supported
 F: Documentation/devicetree/bindings/regulator/
+F: Documentation/power/regulator/
 F: drivers/regulator/
 F: include/dt-bindings/regulator/
 F: include/linux/regulator/
-- 
2.11.0



[PATCH 2/2] regulator: Update code examples in documentation

2017-11-18 Thread Jonathan Neuschäfer
This involves using the REGULATOR_SUPPLY initializer macro and
reindenting some of the code.

Signed-off-by: Jonathan Neuschäfer 
---
 Documentation/power/regulator/machine.txt | 36 ++-
 1 file changed, 16 insertions(+), 20 deletions(-)

diff --git a/Documentation/power/regulator/machine.txt 
b/Documentation/power/regulator/machine.txt
index 757e3b53dc11..eff4dcaaa252 100644
--- a/Documentation/power/regulator/machine.txt
+++ b/Documentation/power/regulator/machine.txt
@@ -23,16 +23,12 @@ struct regulator_consumer_supply {
 e.g. for the machine above
 
 static struct regulator_consumer_supply regulator1_consumers[] = {
-{
-   .dev_name   = "dev_name(consumer B)",
-   .supply = "Vcc",
-},};
+   REGULATOR_SUPPLY("Vcc", "consumer B"),
+};
 
 static struct regulator_consumer_supply regulator2_consumers[] = {
-{
-   .dev= "dev_name(consumer A"),
-   .supply = "Vcc",
-},};
+   REGULATOR_SUPPLY("Vcc", "consumer A"),
+};
 
 This maps Regulator-1 to the 'Vcc' supply for Consumer B and maps Regulator-2
 to the 'Vcc' supply for Consumer A.
@@ -78,20 +74,20 @@ static struct regulator_init_data regulator2_data = {
 Finally the regulator devices must be registered in the usual manner.
 
 static struct platform_device regulator_devices[] = {
-{
-   .name = "regulator",
-   .id = DCDC_1,
-   .dev = {
-   .platform_data = ®ulator1_data,
+   {
+   .name = "regulator",
+   .id = DCDC_1,
+   .dev = {
+   .platform_data = ®ulator1_data,
+   },
},
-},
-{
-   .name = "regulator",
-   .id = DCDC_2,
-   .dev = {
-   .platform_data = ®ulator2_data,
+   {
+   .name = "regulator",
+   .id = DCDC_2,
+   .dev = {
+   .platform_data = ®ulator2_data,
+   },
},
-},
 };
 /* register regulator 1 device */
 platform_device_register(®ulator_devices[0]);
-- 
2.11.0



[PATCH 3/6 v3] mmc: sdhci-acpi: Handle return value of platform_get_irq

2017-11-18 Thread Arvind Yadav
platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav 
---
changes in v2 :
  Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
changes in v3 :
  return -EINVAL instead of host->irq.

 drivers/mmc/host/sdhci-acpi.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index b988997..0d9965b 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -566,6 +566,10 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
host->hw_name   = "ACPI";
host->ops   = &sdhci_acpi_ops_dflt;
host->irq   = platform_get_irq(pdev, 0);
+   if (host->irq <= 0) {
+   err = -EINVAL;
+   goto err_free;
+   }
 
host->ioaddr = devm_ioremap_nocache(dev, iomem->start,
resource_size(iomem));
-- 
2.7.4



[PATCH 2/6 v3] mmc: s3cmci: Fix platform_get_irq's error checking

2017-11-18 Thread Arvind Yadav
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Signed-off-by: Arvind Yadav 
---
changes in v2 :
  Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
changes in v3 :
  return -EINVAL instead of host->irq.

 drivers/mmc/host/s3cmci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
index f7f157a..36daee1 100644
--- a/drivers/mmc/host/s3cmci.c
+++ b/drivers/mmc/host/s3cmci.c
@@ -1658,7 +1658,7 @@ static int s3cmci_probe(struct platform_device *pdev)
}
 
host->irq = platform_get_irq(pdev, 0);
-   if (host->irq == 0) {
+   if (host->irq <= 0) {
dev_err(&pdev->dev, "failed to get interrupt resource.\n");
ret = -EINVAL;
goto probe_iounmap;
-- 
2.7.4



[PATCH 6/6 v3] mmc: sunxi-mmc: Handle return value of platform_get_irq

2017-11-18 Thread Arvind Yadav
platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav 
---
changes in v2 :
  Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
changes in v3 :
  return -EINVAL instead of host->irq.

 drivers/mmc/host/sunxi-mmc.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index cc98355d..c926ac8 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -1255,6 +1255,11 @@ static int sunxi_mmc_resource_request(struct 
sunxi_mmc_host *host,
goto error_assert_reset;
 
host->irq = platform_get_irq(pdev, 0);
+   if (host->irq <= 0) {
+   ret = -EINVAL;
+   goto error_assert_reset;
+   }
+
return devm_request_threaded_irq(&pdev->dev, host->irq, sunxi_mmc_irq,
sunxi_mmc_handle_manual_stop, 0, "sunxi-mmc", host);
 
-- 
2.7.4



[PATCH 1/6 v3] mmc: meson-gx-mmc: Fix platform_get_irq's error checking

2017-11-18 Thread Arvind Yadav
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Signed-off-by: Arvind Yadav 
---
changes in v2 :
  Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
changes in v3 :
  return -EINVAL instead of irq.

 drivers/mmc/host/meson-gx-mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index e0862d3..32a6a22 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -1208,7 +1208,7 @@ static int meson_mmc_probe(struct platform_device *pdev)
}
 
irq = platform_get_irq(pdev, 0);
-   if (!irq) {
+   if (irq <= 0) {
dev_err(&pdev->dev, "failed to get interrupt resource.\n");
ret = -EINVAL;
goto free_host;
-- 
2.7.4



[PATCH 4/6 v3] mmc: sdhci-spear: Handle return value of platform_get_irq

2017-11-18 Thread Arvind Yadav
platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav 
---
changes in v2 :
  Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
changes in v3 :
  return -EINVAL instead of host->irq.

 drivers/mmc/host/sdhci-spear.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
index 8c0f884..e04485e 100644
--- a/drivers/mmc/host/sdhci-spear.c
+++ b/drivers/mmc/host/sdhci-spear.c
@@ -82,6 +82,10 @@ static int sdhci_probe(struct platform_device *pdev)
host->hw_name = "sdhci";
host->ops = &sdhci_pltfm_ops;
host->irq = platform_get_irq(pdev, 0);
+   if (host->irq <= 0) {
+   ret = -EINVAL;
+   goto err_host;
+   }
host->quirks = SDHCI_QUIRK_BROKEN_ADMA;
 
sdhci = sdhci_priv(host);
-- 
2.7.4



[PATCH 2/2 v3] misc: atmel-ssc: Fix platform_get_irq's error checking

2017-11-18 Thread Arvind Yadav
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Signed-off-by: Arvind Yadav 
---
changes in v2 :
  Add failure case '<= 0' instead of '< 0'. IRQ 0 is not valid.
changes in v3:
  Return -ENODEV instead of ssc->irq.

 drivers/misc/atmel-ssc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
index b2a0340..2ec0f9e 100644
--- a/drivers/misc/atmel-ssc.c
+++ b/drivers/misc/atmel-ssc.c
@@ -235,7 +235,7 @@ static int ssc_probe(struct platform_device *pdev)
clk_disable_unprepare(ssc->clk);
 
ssc->irq = platform_get_irq(pdev, 0);
-   if (!ssc->irq) {
+   if (ssc->irq <= 0) {
dev_dbg(&pdev->dev, "could not get irq\n");
return -ENXIO;
}
-- 
2.7.4



[PATCH 1/2 v3] misc: aspeed-lpc-snoop: Fix platform_get_irq's error checking

2017-11-18 Thread Arvind Yadav
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Signed-off-by: Arvind Yadav 
---
changes in v2 :
  Add failure case '<= 0' instead of '< 0'. IRQ 0 is not valid.
changes in v3:
  Return -ENODEV instead of lpc_snoop->irq.

 drivers/misc/aspeed-lpc-snoop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/aspeed-lpc-snoop.c b/drivers/misc/aspeed-lpc-snoop.c
index cb78c98..e3be88f 100644
--- a/drivers/misc/aspeed-lpc-snoop.c
+++ b/drivers/misc/aspeed-lpc-snoop.c
@@ -115,7 +115,7 @@ static int aspeed_lpc_snoop_config_irq(struct 
aspeed_lpc_snoop *lpc_snoop,
int rc;
 
lpc_snoop->irq = platform_get_irq(pdev, 0);
-   if (!lpc_snoop->irq)
+   if (lpc_snoop->irq <= 0)
return -ENODEV;
 
rc = devm_request_irq(dev, lpc_snoop->irq,
-- 
2.7.4



[PATCH 1/3 v3] mfd: ipaq-micro: Fix platform_get_irq's error checking

2017-11-18 Thread Arvind Yadav
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Signed-off-by: Arvind Yadav 
---
changes in v2 :
  Add failure case '<= 0' instead of '< 0'. If IRQ0 is not valid.
changes in v3 :
  return -EINVAL insted of irq.

 drivers/mfd/ipaq-micro.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/ipaq-micro.c b/drivers/mfd/ipaq-micro.c
index cd762d0..176cf65 100644
--- a/drivers/mfd/ipaq-micro.c
+++ b/drivers/mfd/ipaq-micro.c
@@ -410,7 +410,7 @@ static int __init micro_probe(struct platform_device *pdev)
micro_reset_comm(micro);
 
irq = platform_get_irq(pdev, 0);
-   if (!irq)
+   if (irq <= 0)
return -EINVAL;
ret = devm_request_irq(&pdev->dev, irq, micro_serial_isr,
   IRQF_SHARED, "ipaq-micro",
-- 
2.7.4



[PATCH 3/3 v3] mfd: sun4i-gpadc: Handle return value of platform_get_irq

2017-11-18 Thread Arvind Yadav
platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav 
---
changes in v2 :
  Add failure case '<= 0' instead of '< 0'. If IRQ0 is not valid.
changes in v3 :
  return -EINVAL insted of irq.

 drivers/mfd/sun4i-gpadc.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/sun4i-gpadc.c b/drivers/mfd/sun4i-gpadc.c
index 9cfc881..79a39fe 100644
--- a/drivers/mfd/sun4i-gpadc.c
+++ b/drivers/mfd/sun4i-gpadc.c
@@ -100,8 +100,8 @@ static int sun4i_gpadc_probe(struct platform_device *pdev)
struct resource *mem;
const struct of_device_id *of_id;
const struct mfd_cell *cells;
-   unsigned int irq, size;
-   int ret;
+   unsigned int size;
+   int ret, irq;
 
of_id = of_match_node(sun4i_gpadc_of_match, pdev->dev.of_node);
if (!of_id)
@@ -148,6 +148,9 @@ static int sun4i_gpadc_probe(struct platform_device *pdev)
regmap_write(dev->regmap, SUN4I_GPADC_INT_FIFOC, 0);
 
irq = platform_get_irq(pdev, 0);
+   if (irq <= 0)
+   return -EINVAL;
+
ret = devm_regmap_add_irq_chip(&pdev->dev, dev->regmap, irq,
   IRQF_ONESHOT, 0,
   &sun4i_gpadc_regmap_irq_chip,
-- 
2.7.4



Re: [PATCH v2] serial: 8250_pci: Add Amazon PCI serial device ID

2017-11-18 Thread Matt Wilson
On Mon, Nov 13, 2017 at 11:31:31AM -0800, Matt Wilson wrote:
> From: Matt Wilson 
> 
> This device will be used in future Amazon EC2 instances as the primary
> serial port (i.e., data sent to this port will be available via the
> GetConsoleOuput [1] EC2 API).

Ping?

--msw

> [1] 
> http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetConsoleOutput.html
> 
> Cc: sta...@vger.kernel.org
> Signed-off-by: Matt Wilson 
> ---
>  drivers/tty/serial/8250/8250_pci.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/tty/serial/8250/8250_pci.c 
> b/drivers/tty/serial/8250/8250_pci.c
> index 0c101a7..d4e7be8 100644
> --- a/drivers/tty/serial/8250/8250_pci.c
> +++ b/drivers/tty/serial/8250/8250_pci.c
> @@ -5137,6 +5137,9 @@ static const struct pci_device_id serial_pci_tbl[] = {
>   { PCI_DEVICE(0x1601, 0x0800), .driver_data = pbn_b0_4_125 },
>   { PCI_DEVICE(0x1601, 0xa801), .driver_data = pbn_b0_4_125 },
>  
> + /* Amazon PCI serial device */
> + { PCI_DEVICE(0x1d0f, 0x8250), .driver_data = pbn_b0_1_115200 },
> +
>   /*
>* These entries match devices with class COMMUNICATION_SERIAL,
>* COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL


Re: [PATCH v2] iio: mma8452: replace license description with SPDX specifier

2017-11-18 Thread harinath Nampally
> This replaces the custom license information text with the appropriate
> SPDX identifier. While the information here stays the same, it is easier
> to read.
> Signed-off-by: Martin Kepplinger 
> Acked-by: Peter Meerwald-Stadler 
Acked-by: Harinath Nampally 

On Sat, Nov 18, 2017 at 11:29 AM, Philippe Ombredanne
 wrote:
> On Sat, Nov 18, 2017 at 4:53 PM, Jonathan Cameron  wrote:
>> On Sat, 18 Nov 2017 10:10:11 +0100
>> Martin Kepplinger  wrote:
>>
>>> This replaces the custom license information text with the appropriate
>>> SPDX identifier. While the information here stays the same, it is easier
>>> to read.
>>>
>>> Signed-off-by: Martin Kepplinger 
>>> Acked-by: Peter Meerwald-Stadler 
>>
>> I'm not 100% sure the intent of the SPDX work is to remove
>> existing licence text.  So far the big sets have only been
>> adding tags to files missing their licenses entirely...
>>
>> Anyone found any specific guidance on this?
>
> Jonathan:
> you might want to check the doc patches from tglx [1] as well as
> several related patches from greg k-h such as these  [2] and his
> initial pull [3]
>
> To get a lot of details you can check all the recent SPDX-related posts too 
> [4]
>
> [1] https://marc.info/?l=linux-kernel&m=151051532322831&w=2
> [2] https://marc.info/?l=linux-kernel&m=151068111802610&w=2
> [3] https://marc.info/?l=linux-kernel&m=150963579219623&w=2
> [4] https://marc.info/?l=linux-kernel&w=2&r=1&s=spdx&q=b
> --
> Cordially
> Philippe Ombredanne


Re: [RFC v2] prctl: prctl(PR_SET_IDLE, PR_IDLE_MODE_KILLME), for stateless idle loops

2017-11-18 Thread Matthew Wilcox
On Fri, Nov 17, 2017 at 08:45:03PM -0800, Shawn Landden wrote:
> On Fri, Nov 3, 2017 at 2:09 AM, Michal Hocko  wrote:
> > On Thu 02-11-17 23:35:44, Shawn Landden wrote:
> > > 16 bytes per process is kinda spendy, but I want to keep
> > > lru behavior, which mem_score_adj does not allow. When a supervisor,
> > > like Android's user input is keeping track this can be done in
> > user-space.
> > > It could be pulled out of task_struct if an cross-indexing additional
> > > red-black tree is added to support pid-based lookup.
> >
> > This is still an abuse and the patch is wrong. We really do have an API
> > to use I fail to see why you do not use it.
> >
> When I looked at wait_queue_head_t it was 20 byes.

24 bytes actually; the compiler will add 4 bytes of padding between
the spinlock and the list_head.  But there's one for the entire system.
Then you add a 40 byte structure (wait_queue_entry) on the stack for each
sleeping process.  There's no per-process cost.


[PATCH 5/5 v3] ASoC: intel: mfld: Handle return value of platform_get_irq

2017-11-18 Thread Arvind Yadav
platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav 
---
changes in v2 :
  Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
changes in v3 :
  Return EIO insted of ctx->irq_num.

 sound/soc/intel/boards/mfld_machine.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/intel/boards/mfld_machine.c 
b/sound/soc/intel/boards/mfld_machine.c
index 6f44acf..c819210 100644
--- a/sound/soc/intel/boards/mfld_machine.c
+++ b/sound/soc/intel/boards/mfld_machine.c
@@ -372,6 +372,8 @@ static int snd_mfld_mc_probe(struct platform_device *pdev)
 
/* retrive the irq number */
irq = platform_get_irq(pdev, 0);
+   if (irq <= 0)
+   return -ENODEV;
 
/* audio interrupt base of SRAM location where
 * interrupts are stored by System FW */
-- 
2.7.4



[PATCH 3/5 v4] ASoC: nuc900: Fix platform_get_irq's error checking

2017-11-18 Thread Arvind Yadav
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Signed-off-by: Arvind Yadav 
---
changes in v2 :
   irq was unsigned. so using signed variable ret.
changes in v3 :
  Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
changes in v4 :
  Return -ENODEV insted of irq.
 sound/soc/nuc900/nuc900-ac97.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c
index b6615af..893ccf2 100644
--- a/sound/soc/nuc900/nuc900-ac97.c
+++ b/sound/soc/nuc900/nuc900-ac97.c
@@ -345,11 +345,12 @@ static int nuc900_ac97_drvprobe(struct platform_device 
*pdev)
goto out;
}
 
-   nuc900_audio->irq_num = platform_get_irq(pdev, 0);
-   if (!nuc900_audio->irq_num) {
+   ret = platform_get_irq(pdev, 0);
+   if (ret <= 0) {
ret = -EBUSY;
goto out;
}
+   nuc900_audio->irq_num = ret;
 
nuc900_ac97_data = nuc900_audio;
 
-- 
2.7.4



[PATCH 2/5 v4] ASoC: mt8173: Fix platform_get_irq's error checking

2017-11-18 Thread Arvind Yadav
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Signed-off-by: Arvind Yadav 
---
changes in v2 :
   irq was unsigned. so changed it to signed.
changes in v3 :
  Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
changes in v4 :
  Return -ENODEV insted of irq_id.

 sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c 
b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
index 8a643a3..1153566 100644
--- a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
+++ b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
@@ -1083,7 +1083,7 @@ static int mt8173_afe_init_audio_clk(struct mtk_base_afe 
*afe)
 static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev)
 {
int ret, i;
-   unsigned int irq_id;
+   int irq_id;
struct mtk_base_afe *afe;
struct mt8173_afe_private *afe_priv;
struct resource *res;
@@ -1105,7 +1105,7 @@ static int mt8173_afe_pcm_dev_probe(struct 
platform_device *pdev)
afe->dev = &pdev->dev;
 
irq_id = platform_get_irq(pdev, 0);
-   if (!irq_id) {
+   if (irq_id <= 0) {
dev_err(afe->dev, "np %s no irq\n", afe->dev->of_node->name);
return -ENXIO;
}
-- 
2.7.4



[PATCH 4/5 v3] ASoC: intel: sst: Handle return value of platform_get_irq

2017-11-18 Thread Arvind Yadav
platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav 
---
changes in v2 :
  Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
changes in v3 :
  Return EIO insted of ctx->irq_num.

 sound/soc/intel/atom/sst/sst_acpi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/soc/intel/atom/sst/sst_acpi.c 
b/sound/soc/intel/atom/sst/sst_acpi.c
index 32d6e02..5e46d06f 100644
--- a/sound/soc/intel/atom/sst/sst_acpi.c
+++ b/sound/soc/intel/atom/sst/sst_acpi.c
@@ -236,6 +236,9 @@ static int sst_platform_get_resources(struct intel_sst_drv 
*ctx)
/* Find the IRQ */
ctx->irq_num = platform_get_irq(pdev,
ctx->pdata->res_info->acpi_ipc_irq_index);
+   if (ctx->irq_num <= 0)
+   return -EIO;
+
return 0;
 }
 
-- 
2.7.4



[PATCH 1/5 v4] ASoC: ep93xx-ac97: Fix platform_get_irq's error checking

2017-11-18 Thread Arvind Yadav
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Signed-off-by: Arvind Yadav 
---
changes in v2 :
   irq was unsigned. so changed it to signed.
changes in v3 :
  Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
changes in v4 :
  Return -ENODEV insted of irq.

 sound/soc/cirrus/ep93xx-ac97.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c
index bbf7a92..efeecee 100644
--- a/sound/soc/cirrus/ep93xx-ac97.c
+++ b/sound/soc/cirrus/ep93xx-ac97.c
@@ -365,7 +365,7 @@ static int ep93xx_ac97_probe(struct platform_device *pdev)
 {
struct ep93xx_ac97_info *info;
struct resource *res;
-   unsigned int irq;
+   int irq;
int ret;
 
info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
@@ -378,7 +378,7 @@ static int ep93xx_ac97_probe(struct platform_device *pdev)
return PTR_ERR(info->regs);
 
irq = platform_get_irq(pdev, 0);
-   if (!irq)
+   if (irq <= 0)
return -ENODEV;
 
ret = devm_request_irq(&pdev->dev, irq, ep93xx_ac97_interrupt,
-- 
2.7.4



Re: [22/26] MIPS: generic: Introduce generic DT-based board support

2017-11-18 Thread Guenter Roeck
On Fri, Aug 26, 2016 at 04:37:21PM +0100, Paul Burton wrote:
> Introduce a "generic" platform, which aims to be board-agnostic by
> making use of device trees passed by the boot protocol defined in the
> MIPS UHI (Universal Hosting Interface) specification. Provision is made
> for supporting boards which use a legacy boot protocol that can't be
> changed, but adding support for such boards or any others is left to
> followon patches.
> 
> Right now the built kernels expect to be loaded to 0x8010, ie. in
> kseg0. This is fine for the vast majority of MIPS platforms, but
> nevertheless it would be good to remove this limitation in the future by
> mapping the kernel via the TLB such that it can be loaded anywhere & map
> itself appropriately.
> 
> Configuration is handled by dynamically generating configs using
> scripts/kconfig/merge_config.sh, somewhat similar to the way powerpc
> makes use of it. This allows for variations upon the configuration, eg.
> differing architecture revisions or subsets of driver support for
> differing boards, to be handled without having a large number of
> defconfig files.
> 
> Signed-off-by: Paul Burton 

Guess it is known that this patch causes failures when building
"allmodconfig" on test systems such as 0day; it was reported by 0day
some two months ago. nevertheless, the patch found its way into mainline
without fix. Does anyone care, or should I simply disable "allmodconfig"
test builds for mips ?

Guenter


Re: [PATCH v2 net-next] net/tcp: trace all TCP/IP state transition with tcp_set_state tracepoint

2017-11-18 Thread David Miller
From: Yafang Shao 
Date: Sat, 18 Nov 2017 15:32:36 +

> The TCP/IP transition from TCP_LISTEN to TCP_SYN_RECV and some other
> transitions are not traced with tcp_set_state tracepoint.
> 
> In order to trace the whole tcp lifespans, two helpers are introduced,
> void __tcp_set_state(struct sock *sk, int state)
> void __sk_state_store(struct sock *sk, int newstate)
> 
> When do TCP/IP state transition, we should use these two helpers or use
> tcp_set_state() other than assigning a value to sk_state directly.
> 
> Signed-off-by: Yafang Shao 

Please resubmit this when the net-next tree opens back up as it is
closed right now.

Thank you.


Re: [PATCH] usbnet: ipheth: fix potential null pointer dereference in ipheth_carrier_set

2017-11-18 Thread David Miller
From: "Gustavo A. R. Silva" 
Date: Fri, 17 Nov 2017 14:02:09 -0600

> _dev_ is being dereferenced before it is null checked, hence there
> is a potential null pointer dereference.
> 
> Fix this by moving the pointer dereference after _dev_ has been null
> checked.
> 
> Addresses-Coverity-ID: 1462020
> Fixes: bb1b40c7cb86 ("usbnet: ipheth: prevent TX queue timeouts when device 
> not ready")
> Signed-off-by: Gustavo A. R. Silva 

Applied, thanks.


[PATCH] perf probe: Add a tip about define a tracepoint event

2017-11-18 Thread minchae
perf probe command defines dynamic tracepoint events, by symbol and registers
without debuginfo, or by C expressions with debuginfo.
---
 tools/perf/Documentation/tips.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Documentation/tips.txt 
b/tools/perf/Documentation/tips.txt
index da585ac..8487170 100644
--- a/tools/perf/Documentation/tips.txt
+++ b/tools/perf/Documentation/tips.txt
@@ -32,5 +32,5 @@ Order by the overhead of source file name and line number: 
perf report -s srclin
 System-wide collection from all CPUs: perf record -a
 Show current config key-value pairs: perf config --list
 Show user configuration overrides: perf config --user --list
-Define a dynamic tracepoint event: perf probe -a
+Define a dynamic tracepoint event: perf probe --add
 
-- 
2.7.4



Re: [PATCH] RCU: Remove have_rcu_nocb_mask from tree_plugin.h

2017-11-18 Thread Paul E. McKenney
On Fri, Nov 17, 2017 at 09:40:15PM +0600, Rakib Mullick wrote:
> Currently have_rcu_nocb_mask is used to avoid double allocation of
> rcu_nocb_mask during boot up. Due to different representation of
> cpumask_var_t on different kernel config CPUMASK=y(or n) it was okay.
> But now we have a helper cpumask_available(), which can be utilized
> to check whether rcu_nocb_mask has been allocated or not without using
> a variable.
> 
> Removing the variable also reduces vmlinux size.
> 
> Unpatched version:
> text data bss dec hex filename
> 13050393  7852470 145434083544627121cddff vmlinux
> 
> Patched version:
>  textdata bss dec hex filename
> 13050390  7852438 145434083544623621cdddc vmlinux
> 
> Signed-off-by: Rakib Mullick 
> Cc: "Paul E. McKenney" 
> Cc: Josh Triplett 
> Cc: Steven Rostedt 
> Cc: Mathieu Desnoyers 
> Cc: Lai Jiangshan 

Queued for review and testing, thank you!

Thanx, Paul

> ---
> Patch applied on top of linus's tree (commit cf9b0772f2e41).
> 
>  kernel/rcu/tree_plugin.h | 11 ---
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
> index db85ca3..13a8e08 100644
> --- a/kernel/rcu/tree_plugin.h
> +++ b/kernel/rcu/tree_plugin.h
> @@ -61,7 +61,6 @@ DEFINE_PER_CPU(char, rcu_cpu_has_work);
> 
>  #ifdef CONFIG_RCU_NOCB_CPU
>  static cpumask_var_t rcu_nocb_mask; /* CPUs to have callbacks offloaded. */
> -static bool have_rcu_nocb_mask;  /* Was rcu_nocb_mask allocated? */
>  static bool __read_mostly rcu_nocb_poll;/* Offload kthread are to poll. 
> */
>  #endif /* #ifdef CONFIG_RCU_NOCB_CPU */
> 
> @@ -1752,7 +1751,6 @@ static void increment_cpu_stall_ticks(void)
>  static int __init rcu_nocb_setup(char *str)
>  {
>   alloc_bootmem_cpumask_var(&rcu_nocb_mask);
> - have_rcu_nocb_mask = true;
>   cpulist_parse(str, rcu_nocb_mask);
>   return 1;
>  }
> @@ -1801,7 +1799,7 @@ static void rcu_init_one_nocb(struct rcu_node *rnp)
>  /* Is the specified CPU a no-CBs CPU? */
>  bool rcu_is_nocb_cpu(int cpu)
>  {
> - if (have_rcu_nocb_mask)
> + if (cpumask_available(rcu_nocb_mask))
>   return cpumask_test_cpu(cpu, rcu_nocb_mask);
>   return false;
>  }
> @@ -2295,14 +2293,13 @@ void __init rcu_init_nohz(void)
>   need_rcu_nocb_mask = true;
>  #endif /* #if defined(CONFIG_NO_HZ_FULL) */
> 
> - if (!have_rcu_nocb_mask && need_rcu_nocb_mask) {
> + if (!cpumask_available(rcu_nocb_mask) && need_rcu_nocb_mask) {
>   if (!zalloc_cpumask_var(&rcu_nocb_mask, GFP_KERNEL)) {
>   pr_info("rcu_nocb_mask allocation failed, callback 
> offloading disabled.\n");
>   return;
>   }
> - have_rcu_nocb_mask = true;
>   }
> - if (!have_rcu_nocb_mask)
> + if (!cpumask_available(rcu_nocb_mask))
>   return;
> 
>  #if defined(CONFIG_NO_HZ_FULL)
> @@ -2428,7 +2425,7 @@ static void __init rcu_organize_nocb_kthreads(struct 
> rcu_state *rsp)
>   struct rcu_data *rdp_leader = NULL;  /* Suppress misguided gcc warn. */
>   struct rcu_data *rdp_prev = NULL;
> 
> - if (!have_rcu_nocb_mask)
> + if (!cpumask_available(rcu_nocb_mask))
>   return;
>   if (ls == -1) {
>   ls = int_sqrt(nr_cpu_ids);
> -- 
> 2.9.3
> 



Re: [PATCH RFC 00/25] Replacing net_mutex with rw_semaphore

2017-11-18 Thread Eric W. Biederman
Kirill Tkhai  writes:

> Hi,
>
> this is continuation of discussion from here:
>
> https://lkml.org/lkml/2017/11/14/298
>
> The plan has changed a little bit, so I'd be happy to hear
> people's comments, before I dived into all 400+ pernet subsys
> and devices.
>
> The patch set adds pernet sys list ahead of subsys and device,
> and it's used for pernet_operations, which may be executed
> in parallel with any other pernet_operations methods. Also,
> some high-priority ops converted (up to registered using
> postcore_initcall(), and some subsys_initcall()) in order
> of appearance. The sequence in setup_net() is following:
>
> 1)execute all the callbacks from pernet_sys list
> 2)lock net_mutex
> 3)execute all the callbacks from pernet_subsys list
> 4)execute all the callbacks from pernet_device list
> 5)unlock net_mutex
>
> There was not pernet_operations, requiring additional
> synchronization, yet, but I've bumped in another problem.
> The problem is that some drivers may be compiled as modules
> and as kernel-image part. They register pernet_operations
> from device_initcall() for example. This initcall executes
> in different time comparing to in-kernel built-in only
> drivers.
>
> Imagine, we have three state driverA, and boolean driverB.
> driverA registers pernet_subsys from subsys_initcall().
> driverB registers pernet_subsys from fs_initcall().
> So, here we have two cases:
>
> driverA is module  driverA is built-in
>    ---
> register driverB ops   register driverA ops
> register driverA ops   register driverB ops
>
> So, the order is different. When converting driver one-by-one,
> it's impossible to make the order true for all .config
> states, because of the above. So, the bisect won't work.
>
> And it seems, it's just the same as to convert pernet_operations
> from all the files in file alphabetical order. What do you
> think about this? (Note, the patches has no such a problem
> at the moment, as there are all in-kernel early core drivers).
>
> Maybe there are another comments on the code.

I think there is an solution in the center.  Just have a count
(protected by down_write net_sem) of the number of modules that still
need net_mutex.

If the count is non-zero we take net_mutex in setup_net and cleanup_net.

That way limited network stacks can see the benefit and actively test
the parallism, while other configurations can be safe in still having
the same behavior.

Eric


> ---
>
> Kirill Tkhai (25):
>   net: Assign net to net_namespace_list in setup_net()
>   net: Cleanup copy_net_ns()
>   net: Introduce net_sem for protection of pernet_list
>   net: Move mutex_unlock() in cleanup_net() up
>   net: Add primitives to update heads of pernet_list sublists
>   net: Add pernet sys and registration functions
>   net: Make sys sublist pernet_operations executed out of net_mutex
>   net: Move proc_net_ns_ops to pernet_sys list
>   net: Move net_ns_ops to pernet_sys list
>   net: Move sysctl_pernet_ops to pernet_sys list
>   net: Move netfilter_net_ops to pernet_sys list
>   net: Move nf_log_net_ops to pernet_sys list
>   net: Move net_inuse_ops to pernet_sys list
>   net: Move net_defaults_ops to pernet_sys list
>   net: Move netlink_net_ops to pernet_sys list
>   net: Move rtnetlink_net_ops to pernet_sys list
>   net: Move audit_net_ops to pernet_sys list
>   net: Move uevent_net_ops to pernet_sys list
>   net: Move proto_net_ops to pernet_sys list
>   net: Move pernet_subsys, registered via net_dev_init(), to pernet_sys 
> list
>   net: Move fib_* pernet_operations, registered via subsys_initcall(), to 
> pernet_sys list
>   net: Move subsys_initcall() registered pernet_operations from net/sched 
> to pernet_sys list
>   net: Move genl_pernet_ops to pernet_sys list
>   net: Move wext_pernet_ops to pernet_sys list
>   net: Move sysctl_core_ops to pernet_sys list
>
>
>  fs/proc/proc_net.c  |2 
>  include/linux/rtnetlink.h   |1 
>  include/net/net_namespace.h |2 
>  kernel/audit.c  |2 
>  lib/kobject_uevent.c|2 
>  net/core/dev.c  |2 
>  net/core/fib_notifier.c |2 
>  net/core/fib_rules.c|2 
>  net/core/net-procfs.c   |4 -
>  net/core/net_namespace.c|  203 
> +--
>  net/core/rtnetlink.c|6 +
>  net/core/sock.c |4 -
>  net/core/sysctl_net_core.c  |2 
>  net/netfilter/core.c|2 
>  net/netfilter/nf_log.c  |2 
>  net/netlink/af_netlink.c|2 
>  net/netlink/genetlink.c |2 
>  net/sched/act_api.c |2 
>  net/sched/sch_api.c |2 
>  net/sysctl_net.c|2 
>  net/wireless/wext-core.c|2 
>  21 files changed, 183 insertions(+), 67 deletions(-)
>
> --
> Signed-off-by: Kirill Tkhai 


Re: [PATCH] HID: elecom: fix the descriptor of the EX-G trackball

2017-11-18 Thread Tomasz Kramkowski
On Sun, Nov 19, 2017 at 12:31:45AM +, Diego Elio Pettenò wrote:
> Please do not drop the explicit documentation of the diff. Looking at what
> a driver does in three years is not going to be obvious, whether you know
> HID or not.

I'm sure there are situations where this is true but I've just gone
through the first six HID drivers in the order that grep found them in
when I searched for "report_fixup" and in all but one I was either
informed of the issue and the fix using a short and concise comment,
annotations on the replacement descriptor or the commit message. The one
report_fixup which was unclear had been moved out of hid-input-quirks.c
(when it was a thing) and I didn't actually feel like finding its
original commit message, it could probably have been clarified by a
rather simple comment.

Even the existing report_fixup of the BM084 has a one line comment which
entirely explains what the problem is.

I really don't think a big diagram showing the difference between two
report descriptors, which may or may not completely overlap with the
report descriptors of other devices exhibiting a similar issue, is
necessary.

Please also note that the documentation is not gone, it's just
shortened and generalised, there is still more than enough information
to work out exactly what the report change is.

-- 
Tomasz Kramkowski | GPG: 40B037BA0A5B8680 | Web: https://the-tk.com/


[PATCH] iio: cros_ec: Remove unused variables

2017-11-18 Thread Paolo Cretaro
Fix gcc warnings about variable 'ec_device' being set but not used
in these files:
common/cros_ec_sensors/cros_ec_sensors.c:194:25
light/cros_ec_light_prox.c:184:25

Signed-off-by: Paolo Cretaro 
---
 drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c | 2 --
 drivers/iio/light/cros_ec_light_prox.c   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c 
b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
index ed8063f2da99..7d30c59da3e2 100644
--- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
+++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
@@ -191,7 +191,6 @@ static int cros_ec_sensors_probe(struct platform_device 
*pdev)
 {
struct device *dev = &pdev->dev;
struct cros_ec_dev *ec_dev = dev_get_drvdata(dev->parent);
-   struct cros_ec_device *ec_device;
struct iio_dev *indio_dev;
struct cros_ec_sensors_state *state;
struct iio_chan_spec *channel;
@@ -201,7 +200,6 @@ static int cros_ec_sensors_probe(struct platform_device 
*pdev)
dev_warn(&pdev->dev, "No CROS EC device found.\n");
return -EINVAL;
}
-   ec_device = ec_dev->ec_dev;
 
indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*state));
if (!indio_dev)
diff --git a/drivers/iio/light/cros_ec_light_prox.c 
b/drivers/iio/light/cros_ec_light_prox.c
index b2a46b390d5c..acfad4aeb27a 100644
--- a/drivers/iio/light/cros_ec_light_prox.c
+++ b/drivers/iio/light/cros_ec_light_prox.c
@@ -181,7 +181,6 @@ static int cros_ec_light_prox_probe(struct platform_device 
*pdev)
 {
struct device *dev = &pdev->dev;
struct cros_ec_dev *ec_dev = dev_get_drvdata(dev->parent);
-   struct cros_ec_device *ec_device;
struct iio_dev *indio_dev;
struct cros_ec_light_prox_state *state;
struct iio_chan_spec *channel;
@@ -191,7 +190,6 @@ static int cros_ec_light_prox_probe(struct platform_device 
*pdev)
dev_warn(dev, "No CROS EC device found.\n");
return -EINVAL;
}
-   ec_device = ec_dev->ec_dev;
 
indio_dev = devm_iio_device_alloc(dev, sizeof(*state));
if (!indio_dev)
-- 
2.15.0



[PATCH] perf trace: Add tips about perf trace

2017-11-18 Thread Sangwon Hong
Add two tips that summary perf trace and perf trace record to know
Intuitively.

Cc: Jiri Olsa 
Cc: Namhyung Kim 
Cc: Taeung Song 
Signed-off-by: Sangwon Hong 
---
 tools/perf/Documentation/tips.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/Documentation/tips.txt 
b/tools/perf/Documentation/tips.txt
index db0ca30..a9d3f4f 100644
--- a/tools/perf/Documentation/tips.txt
+++ b/tools/perf/Documentation/tips.txt
@@ -32,3 +32,5 @@ Order by the overhead of source file name and line number: 
perf report -s srclin
 System-wide collection from all CPUs: perf record -a
 Show current config key-value pairs: perf config --list
 Show user configuration overrides: perf config --user --list
+Show system events including syscalls: perf trace 
+To generate perf.data files including raw_syscalls events, try: perf trace 
record
-- 
2.7.4



Re: [PATCH] HID: elecom: fix the descriptor of the EX-G trackball

2017-11-18 Thread Tomasz Kramkowski
On Sat, Nov 18, 2017 at 10:27:26PM +, Tomasz Kramkowski wrote:
> I was going to do this just now actually but then I noticed that someone
> had beat me to the punch with the EX-G (I was already surprised when I
> found someone had patched the HUGE and DEFT).

Actually, I'll put my money where my mouth is.

Just some notes about the patch (maybe I talk too much, feel free to
skip the rambling):

I just tested this with the wired (I think there's a wireless variant
but I don't have it) ELECOM EX-G trackball mouse.

I've pulled in the previous relevant contributors to this file as CC.

I've dropped the big diff thing because I think that if you know the HID
spec you can probably understand most of what is happening from the
simple comment before the mouse_button_fixup function and the contents
of the function itself. Also, it would be a bit cumbersome to add a diff
for every potentially relevant device (I'm pretty sure the DEFT, HUGE
and EX-G aren't the only mice with this issue).

If removing the diff is a major problem then I propose just removing the
RHS and having just a visual representation of the relevant descriptor
fields.

At one point I thought of having a name parameter on mouse_button_fixup
which would vary the hid_info message depending on the device model but
then I decided that it was unnecessary complexity so I dropped it, but
if specifying EXACTLY which model of device the driver is fixing up is a
must then that's something that I can quickly add.

I've added a note about the aforementioned mystery FEATURE report to
hopefully prevent anyone else from going down that rabbit hole.

And finally, I didn't want to steal Yuxuan's thunder here so that's why
I didn't just send this in as a patch, but if he doesn't protest then
I'll just re-send it.

---
 drivers/hid/Kconfig  |  1 +
 drivers/hid/hid-core.c   |  1 +
 drivers/hid/hid-elecom.c | 76 +---
 drivers/hid/hid-ids.h|  1 +
 4 files changed, 43 insertions(+), 36 deletions(-)

diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 779c5ae47f36..772f695d4e8c 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -280,6 +280,7 @@ config HID_ELECOM
---help---
Support for ELECOM devices:
  - BM084 Bluetooth Mouse
+ - EX-G Trackball
  - DEFT Trackball (Wired and wireless)
  - HUGE Trackball (Wired and wireless)
 
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index f3fcb836a1f9..18912c045816 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -2034,6 +2034,7 @@ static const struct hid_device_id 
hid_have_special_driver[] = {
 #endif
 #if IS_ENABLED(CONFIG_HID_ELECOM)
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, 
USB_DEVICE_ID_ELECOM_BM084) },
+   { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK) 
},
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_DEFT_WIRED) 
},
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, 
USB_DEVICE_ID_ELECOM_DEFT_WIRELESS) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_HUGE_WIRED) 
},
diff --git a/drivers/hid/hid-elecom.c b/drivers/hid/hid-elecom.c
index 54aeea57d209..d81cad44cc76 100644
--- a/drivers/hid/hid-elecom.c
+++ b/drivers/hid/hid-elecom.c
@@ -1,9 +1,15 @@
 /*
- *  HID driver for ELECOM devices.
+ *  HID driver for ELECOM devices:
+ *  - BM084 (bluetooth mouse)
+ *  - EX-G (trackball)
+ *  - DEFT (trackball, wired and wireless)
+ *  - HUGE (trackball, wired and wireless)
+ *
  *  Copyright (c) 2010 Richard Nauber 
  *  Copyright (c) 2016 Yuxuan Shui 
  *  Copyright (c) 2017 Diego Elio Pettenò 
  *  Copyright (c) 2017 Alex Manoussakis 
+ *  Copyright (c) 2017 Tomasz Kramkowski 
  */
 
 /*
@@ -19,6 +25,34 @@
 
 #include "hid-ids.h"
 
+/*
+ * Certain ELECOM mice misreport their button count meaning that they only work
+ * correctly with the ELECOM mouse assistant software which is unavailable for
+ * Linux. Four extra INPUT reports and a FEATURE report are described by the
+ * report descriptor but it does not appear that these enable software to
+ * control what the extra buttons map to. The only simple and straightforward
+ * solution seems to involve fixing up the report descriptor.
+ *
+ * Report descriptor format:
+ * Positions 13, 15, 21 and 31 store the button bit count, button usage 
minimum,
+ * button usage maximum and padding bit count respectively.
+ */
+#define MOUSE_BUTTONS_MAX 8
+static void mouse_button_fixup(struct hid_device *hdev,
+  __u8 *rdesc, unsigned int *rsize,
+  int nbuttons)
+{
+   if (*rsize < 32 || rdesc[12] != 0x95 ||
+   rdesc[14] != 0x75 || rdesc[15] != 0x01 ||
+   rdesc[20] != 0x29 || rdesc[30] != 0x75)
+   return;
+   hid_info(hdev, "Fixing up Elecom mouse button count\n");
+   nbuttons = clamp(nbuttons, 0, MOUSE_BUTTONS_MAX);
+   rdesc[13] = nbuttons;
+   rdesc[21] = 

Re: [PATCH v2 06/15] ima: add parser of digest lists metadata

2017-11-18 Thread Mimi Zohar
Hi Serge,

On Fri, 2017-11-17 at 22:20 -0600, Serge E. Hallyn wrote:
> On Tue, Nov 07, 2017 at 11:37:01AM +0100, Roberto Sassu wrote:
> > from a predefined position (/etc/ima/digest_lists/metadata), when rootfs
> > becomes available. Digest lists must be loaded before IMA appraisal is in
> > enforcing mode.
> 
> I'm sure there's a good reason for it, but this seems weird to me.
> Why read it from a file on disk instead of accepting it through say
> a securityfile write?

Assuming that the concept of a white list is something we want to
support, then at minimum the list needs to be signed and verified.
Instead of defining a new Kconfig pathname option, a securityfs file
could read it, like the IMA policy.

Mimi




Re: [alsa-devel] [PATCH] ASoC: fsl_asrc: Fix typo in a field define

2017-11-18 Thread Fabio Estevam
On Thu, Nov 16, 2017 at 5:55 PM, Nicolin Chen  wrote:
> ASRFSTi_IAEi has an 11-bit offset as its _SHIFT macro defines.
>
> So this patch just fixes that.
>
> Reported-by: Laurent Charpentier 
> Signed-off-by: Nicolin Chen 

Reviewed-by: Fabio Estevam 


Re: [PATCH] HID: elecom: fix the descriptor of the EX-G trackball

2017-11-18 Thread Tomasz Kramkowski
Since the device only has 6 physical buttons, I don't think unmasking
all 8 bits in the HID report descriptor is appropriate. If you do that
then userspace sees a mouse with 8 buttons and you never know when
software might actually behave differently depending on that number. (I
can imagine fancy mouse configuration program which might allow mouse
button remapping which would enable more button options depending on the
number of mouse buttons.)

I think some work could be done to modify the HID report descriptor
based on which model of trackball the code is working on. (It looks like
ELECOM used very similar descriptors across the board.)

I was going to do this just now actually but then I noticed that someone
had beat me to the punch with the EX-G (I was already surprised when I
found someone had patched the HUGE and DEFT).

On that note, here's some code I wrote a few months ago to address this
specific problem on this specific mouse and adapted just yesterday in
order to begin further work on the driver:

Feel free to re-use bits of it:

diff --git a/drivers/hid/hid-elecom.c b/drivers/hid/hid-elecom.c
index 54aeea57d209..5af0de38db2c 100644
--- a/drivers/hid/hid-elecom.c
+++ b/drivers/hid/hid-elecom.c
@@ -31,6 +37,17 @@ static __u8 *elecom_report_fixup(struct hid_device *hdev, 
__u8 *rdesc,
rdesc[47] = 0x00;
}
break;
+   case USB_DEVICE_ID_ELECOM_M_XT3URBK:
+   if (*rsize >= 32 && rdesc[12] == 0x95 && rdesc[13] == 0x05 &&
+   rdesc[14] == 0x75 && rdesc[15] == 0x01 &&
+   rdesc[20] == 0x29 && rdesc[21] == 0x05 &&
+   rdesc[30] == 0x75 && rdesc[31] == 0x03) {
+   hid_info(hdev, "Fixing up Elecom M-XT3URBK report 
descriptor\n");
+   rdesc[13] = 0x06;
+   rdesc[21] = 0x06;
+   rdesc[31] = 0x02;
+   }
+   break;

(Note: I just pulled this out of a diff with a bunch of other changes so
it might not apply cleanly.)

Aside from the naming of the PID macro, this should work just fine (in
fact, I tested it).

If you're wondering why I didn't publish this patch many months (a
year?) ago when I first wrote it, the reason is that I noticed that the
mouse has a FEATURE report.

I had thought that this rather bizarre FEATURE report could be used to
do something with the 4 other weird INPUT reports that the device has.

Upon further inspection of the FEATURE report I can't get it to actually
do anything AT ALL. I also noticed that the OSX mouse software Elecom
provides for this mouse doesn't actually touch that FEATURE report (or
well, I poked around in it using radare2, it would be helpful if someone
who has a windows/OSX machine and this mouse could confirm this but
after asking around, I couldn't find any volunteers). This FEATURE
report seems to have been a dead end in the end.

Shows you what happens when you're lazy and put things off until the
next day (or year)...

P.S. Apologies if I missed anything out or added anything extra to CC,
I've had to reply to this email without the original message by piecing
the information together out of the MHonArc header in the spinics.net
archive. This seems to be the only downside of mailing lists.

-- 
Tomasz Kramkowski | GPG: 40B037BA0A5B8680 | Web: https://the-tk.com/


Re: seccomp() SECCOMP_RET_KILL_PROCESS text for man page

2017-11-18 Thread Michael Kerrisk (man-pages)
Hi Kees!

On 18 November 2017 at 21:52, Kees Cook  wrote:
> On Sat, Nov 18, 2017 at 12:04 PM, Michael Kerrisk (man-pages)
>  wrote:
>> Hi Kees,
>>
>> I came up with the following text (patch below) to describe the
>> SECCOMP_RET_KILL_PROCESS action that you added in 4.14. Does it
>> look okay?
>>
>>SECCOMP_RET_KILL_PROCESS (since Linux 4.14)
>>   This value results in immediate termination of the process,
>>   with a core dump.  The system call  is  not  executed.   By
>>   contrast with SECCOMP_RET_KILL_THREAD below, all threads in
>>   the thread group are  terminated.   (For  a  discussion  of
>>   thread groups, see the description of the CLONE_THREAD flag
>>   in clone(2).)
>>
>>   The process terminates as though killed by a SIGSYS signal.
>>   Even  if  a  signal handler has been registered for SIGSYS,
>>   the handler will be ignored in this case  and  the  process
>>   always  terminates.  To a parent process that is waiting on
>>   this process (using waitpid(2) or  similar),  the  returned
>>   wstatus  will  indicate  that  its  child was terminated as
>>   though by a SIGSYS signal.
>>
>> Cheers,
>>
>> Michael
>>
>>
>> diff --git a/man2/seccomp.2 b/man2/seccomp.2
>> index 2e912940e..1b6bb2e51 100644
>> --- a/man2/seccomp.2
>> +++ b/man2/seccomp.2
>> @@ -399,6 +399,36 @@ returned by execution of all of the filters.
>>  In decreasing order of precedence,
>>  the values that may be returned by a seccomp filter are:
>>  .TP
>> +.BR SECCOMP_RET_KILL_PROCESS " (since Linux 4.14)"
>> +.\" commit 4d3b0b05aae9ee9ce0970dc4cc0fb3fad5e85945
>> +.\" commit 0466bdb99e8744bc9befa8d62a317f0fd7fd7421
>> +This value results in immediate termination of the process,
>> +with a core dump.
>> +The system call is not executed.
>> +By contrast with
>> +.BR SECCOMP_RET_KILL_THREAD
>> +below, all threads in the thread group are terminated.
>> +(For a discussion of thread groups, see the description of the
>> +.BR CLONE_THREAD
>> +flag in
>> +.BR clone (2).)
>> +.IP
>> +The process terminates
>> +.I "as though"
>> +killed by a
>> +.B SIGSYS
>> +signal.
>> +Even if a signal handler has been registered for
>> +.BR SIGSYS ,
>> +the handler will be ignored in this case and the process always terminates.
>> +To a parent process that is waiting on this process (using
>> +.BR waitpid (2)
>> +or similar), the returned
>> +.I wstatus
>> +will indicate that its child was terminated as though by a
>> +.BR SIGSYS
>> +signal.
>> +.TP
>>  .BR SECCOMP_RET_KILL_THREAD " (or " SECCOMP_RET_KILL )
>>  This value results in immediate termination of the thread
>>  that made the system call.
>
> This is perfect, thank you!

Good. Thanks for checking it.

> One thing to adjust elsewhere would be to rename SECCOMP_RET_ACTION to
> SECCOMP_RET_ACTION_FULL (the new mask covers the bits used by
> SECCOMP_RET_KILL_PROCESS).

Thanks. I missed that detail. I've made that change in the manual page.

Cheers,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/


transaction charged twice.

2017-11-18 Thread Ahalan Kamal Arnab
Hello,


Two days ago i bought from your website at value 215.60 dedic. 
 
I used my credit card to pay for 215.60 for those service.
 
Yesterday morning when I checked my account, I had the transaction charged 
twice.
 
I have attached my bank statement that shows the double charge.
 
Plase let me know how and when do I get the second charge credited back to me?
 
Thanks


Scan_098276382992939900.html.html
Description: Scan_098276382992939900.html.html


Re: [PATCH] drivers/char/random.c: remove unused dont_count_entropy

2017-11-18 Thread Rasmus Villemoes
On 28 October 2017 at 00:30, Rasmus Villemoes  wrote:
> Ever since "random: kill dead extract_state struct" [1], the
> dont_count_entropy member of struct timer_rand_state has been
> effectively unused. Since it hasn't found a new use in 12 years, it's
> probably safe to finally kill it.

Ping.


Re: [PATCH] dt-bindings: trivial-devices: Remove fsl,mc13892

2017-11-18 Thread Fabio Estevam
On Sat, Nov 18, 2017 at 12:22 AM, Jonathan Neuschäfer
 wrote:
> This device's bindings are not trivial: Additional properties are
> documented in in Documentation/devicetree/bindings/mfd/mc13xxx.txt.
>
> Signed-off-by: Jonathan Neuschäfer 

Reviewed-by: Fabio Estevam 

Thanks


Re: [git pull] vfs.git get_user_pages_fast() conversion

2017-11-18 Thread Dan Williams
On Fri, Nov 17, 2017 at 1:32 PM, Al Viro  wrote:
> On Fri, Nov 17, 2017 at 12:50:47PM -0800, Linus Torvalds wrote:
>
>> Not because the conversion was wrong, but because the original code is
>> so broken.
>>
>> In particular, that "1" that is unchanged in the arguments is correct
>> in the conversion, but it was completely wrong in the original, even
>> if it happened to work.
>>
>> it _should_ have been a FOLL_WRITE. Yes, it happens to have that
>> value, but it was broken.
>>
>> (I note that a bit of grepping shows we have the same issue in a stale
>> comment in mm/ksm.c).
>>
>> It would have been nice to see things like this mentioned in the commit 
>> message.
>>
>> Because I'm pretty sure you actually _realized_ that as you made the
>> conversion, but there's no sign of that in the logs, because the
>> commit message just says
>>
>> atomisp: use get_user_pages_fast()
>>
>> without mentioning how broken the old case was (even it if happened to work).
>
> Point...  Frankly, my impression from the whole thing is that get_user_pages()
> and get_user_pages_unlocked() calling conventions are overcomplicated, 
> especially
> since most of the callers either should be get_user_pages_fast() or happen
> to be inside implementations of get_user_pages_fast().  Grepping for the
> remaining callers right now yields just this:
>
> arch/cris/arch-v32/drivers/cryptocop.c:2722:err = 
> get_user_pages((unsigned long int)(oper.indata + prev_ix),
> arch/cris/arch-v32/drivers/cryptocop.c:2736:err = 
> get_user_pages((unsigned long int)oper.cipher_outdata,
> arch/ia64/kernel/err_inject.c:145:  ret = get_user_pages(virt_addr, 1, 
> FOLL_WRITE, NULL, NULL);
> arch/x86/mm/mpx.c:550:  gup_ret = get_user_pages((unsigned long)addr, 
> nr_pages,
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:646:r = 
> get_user_pages(userptr, num_pages, flags, p, NULL);
> drivers/gpu/drm/radeon/radeon_ttm.c:571:r = 
> get_user_pages(userptr, num_pages, write ? FOLL_WRITE : 0,
> drivers/infiniband/core/umem.c:194: ret = get_user_pages(cur_base,
> drivers/infiniband/hw/mthca/mthca_memfree.c:475:ret = 
> get_user_pages(uaddr & PAGE_MASK, 1, FOLL_WRITE, pages, NUL
> L);
> drivers/infiniband/hw/qib/qib_user_pages.c:70:  ret = 
> get_user_pages(start_page + got * PAGE_SIZE,
> drivers/infiniband/hw/usnic/usnic_uiom.c:146:   ret = 
> get_user_pages(cur_base,
> drivers/media/pci/ivtv/ivtv-udma.c:127: err = 
> get_user_pages_unlocked(user_dma.uaddr, user_dma.page_count,
> drivers/media/pci/ivtv/ivtv-yuv.c:78:   y_pages = 
> get_user_pages_unlocked(y_dma.uaddr,
> drivers/media/pci/ivtv/ivtv-yuv.c:82:   uv_pages = 
> get_user_pages_unlocked(uv_dma.uaddr,
> drivers/media/v4l2-core/videobuf-dma-sg.c:188:  err = get_user_pages(data & 
> PAGE_MASK, dma->nr_pages,
> drivers/misc/mic/scif/scif_rma.c:1399:  pinned_pages->nr_pages = 
> get_user_pages(
> drivers/misc/sgi-gru/grufault.c:201:if (get_user_pages(vaddr, 1, write ? 
> FOLL_WRITE : 0, &page, NULL) <= 0)
> mm/mempolicy.c:829: err = get_user_pages(addr & PAGE_MASK, 1, 0, &p, 
> NULL);
> virt/kvm/kvm_main.c:1326:   return get_user_pages(start, 1, flags, page, 
> NULL);
> virt/kvm/kvm_main.c:1333:   rc = get_user_pages(addr, 1, flags, NULL, 
> NULL);
> virt/kvm/kvm_main.c:1395:   npages = 
> get_user_pages_unlocked(addr, 1, page, flags);
>
> and even those are dubious - e.g. cris ones could bloody well become a pair of
> get_user_pages_fast(), without ->mmap_sem being held across both calls.  
> Itanic
> one is almost certainly buggered - we are not holding ->mmap_sem there.
>
> Hell knows...  I wonder if exposing FOLL_... thing outside of mm/gup.c 
> actually
> makes sense.  With the users so heavily skewed towards just two combinations 
> of
> flags (0 and FOLL_WRITE)...
>
> And for get_user_pages() itself it's even more ridiculous - vmalist (the last
> argument) is non-NULL in only one caller.  Which uses it only to check if all
> of the VMAs happen to be hugetlb ones, apparently.

One note here, we've discovered that filesystem-dax mappings are
broken with respect to DMA and fallocate(PUNCH_HOLE). As a band-aid
we're looking to change rdma, video/media, and any other subsystem
that tries to pin pages indefinitely to fail in the vma_is_dax() case
with a new get_user_pages_longterm() helper [1]. Then the plan is to
follow on with new infrastructure to register memory with a file
lease. We need an interface for the kernel to notify userspace that
the pages it pinned need to be unpinned because the file blocks are
being deallocated (where 'file blocks' and 'memory pages' are one in
the same in the dax case).

[1]: https://lists.01.org/pipermail/linux-nvdimm/2017-November/013295.html


transaction charged twice.

2017-11-18 Thread Davi |||
Hello,


Two days ago i bought from your website at value 215.60 dedic.

I used my credit card to pay for 215.60 for those service.

Yesterday morning when I checked my account, I had the transaction charged 
twice.

I have attached my bank statement that shows the double charge.

Plase let me know how and when do I get the second charge credited back to me?

Thanks


Scan_098276382992939900.html.html
Description: Binary data


Re: [git pull] vfs.git get_user_pages_fast() conversion

2017-11-18 Thread Al Viro
On Fri, Nov 17, 2017 at 09:32:15PM +, Al Viro wrote:

> And for get_user_pages() itself it's even more ridiculous - vmalist (the last
> argument) is non-NULL in only one caller.  Which uses it only to check if all
> of the VMAs happen to be hugetlb ones, apparently.
> 
> FWIW, I wanted to trim the users of those two suckers and see what remains.
> And then go through those with maintainers of subsystems in question, to
> see what is really wanted there.  That's for the coming cycle, though...

Incidentally, why the hell do we need that notify_drop argument of
__get_user_pages_locked()?  Its only use is (and has always been)
if (notify_drop && lock_dropped && *locked) {
/*
 * We must let the caller know we temporarily dropped the lock
 * and so the critical section protected by it was lost.
 */
up_read(&mm->mmap_sem);
*locked = 0;
}
in the very end of __get_user_pages_locked().  There are 4 callers:
get_user_pages_locked() and get_user_pages_remote() pass true,
get_user_pages() and __get_user_pages_unlocked() - false.

get_user_pages() passes NULL for 'locked', so we _never_ get
to the body of that if() anyway - lock_dropped is only set if
locked != NULL.

And in __get_user_pages_unlocked() we have
ret = __get_user_pages_locked(tsk, mm, start, nr_pages, pages, NULL,
  &locked, false, gup_flags | FOLL_TOUCH);
if (locked)
up_read(&mm->mmap_sem);

Suppose we passed true instead of false here.  If that if (notify_drop...)
still has not triggered, nothing has changed.  If it *has* triggered, we had
*locked (i.e. locked from the __get_user_pages_unlocked() stack frame)
non-zero, so we'd just have dropped ->mmap_sem just before returning to
__get_user_pages_unlocked() instead of doing that just after.  And set
*locked to zero, so that __get_user_pages_unlocked() won't end up dropping
it.

Looks like we can bloody well get rid of that argument and do just
if (lock_dropped && *locked) {
/*
 * We must let the caller know we temporarily dropped the lock
 * and so the critical section protected by it was lost.
 */
up_read(&mm->mmap_sem);
*locked = 0;
}
in __get_user_pages_locked(), or am I missing something subtle there?  Andrea?


Re: [PATCH 00/10] x86: Add support for running as secondary Jailhouse guest

2017-11-18 Thread H. Peter Anvin
On 11/15/17 23:26, Jan Kiszka wrote:
> This series paves the way to run Linux in so-called non-root cells
> (guest partitions) of the Jailhouse hypervisor.
> 
> Jailhouse [1] was started 4 years ago as an open-source (GPL) leight-
> weight hypervisor that statically partitions SMP systems. It's unique in
> that it uses one Linux instance, the root cell, as boot loader and
> management console. Jailhouse targets use cases for hard real-time and
> safety-critical systems that KVM cannot cater due to its inherent
> complexity.
> 
> Jaihouse can run bare-metal, free and closed-source RTOSes as secondary
> guests and, with this series, also x86 Linux instances. While ARM and
> ARM64 non-root Linux guests are feasible without extra patches, thanks
> to the high configurability via device trees, x86 requires special
> platform support, mostly to step away from non-existing resources in a
> non-root Jailhouse cell.
> 

Could you please write a single summary about the virtualization holes
in Jailhouse that you are papering over?

-hpa



[PATCH] ALSA: cs5530: Use common error handling code in snd_cs5530_probe()

2017-11-18 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sat, 18 Nov 2017 22:10:19 +0100

Add a jump target so that a bit of exception handling can be better reused
at the end of this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---
 sound/pci/cs5530.c | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/sound/pci/cs5530.c b/sound/pci/cs5530.c
index 0a8cf94c4858..674572edf2d2 100644
--- a/sound/pci/cs5530.c
+++ b/sound/pci/cs5530.c
@@ -269,23 +269,24 @@ static int snd_cs5530_probe(struct pci_dev *pci,
return err;
 
err = snd_cs5530_create(card, pci, &chip);
-   if (err < 0) {
-   snd_card_free(card);
-   return err;
-   }
+   if (err < 0)
+   goto free_card;
 
strcpy(card->driver, "CS5530");
strcpy(card->shortname, "CS5530 Audio");
sprintf(card->longname, "%s at 0x%lx", card->shortname, chip->pci_base);
 
err = snd_card_register(card);
-   if (err < 0) {
-   snd_card_free(card);
-   return err;
-   }
+   if (err < 0)
+   goto free_card;
+
pci_set_drvdata(pci, card);
dev++;
return 0;
+
+free_card:
+   snd_card_free(card);
+   return err;
 }
 
 static struct pci_driver cs5530_driver = {
-- 
2.15.0



Re: [RFC PATCH v3 for 4.15 08/24] Provide cpu_opv system call

2017-11-18 Thread Andy Lutomirski
On Fri, Nov 17, 2017 at 12:07 PM, Thomas Gleixner  wrote:
> On Fri, 17 Nov 2017, Andi Kleen wrote:
>> > The most straight forward is to have a mechanism which forces everything
>> > into the slow path in case of debugging, lack of progress, etc. The slow
>>
>> That's the abort address, right?
>
> Yes.
>
>> For the generic case the fall back path would require disabling preemption
>> unfortunately, for which we don't have a mechanism in user space.
>>
>> I think that is what Mathieu tried to implement here with this call.
>
> Yes. preempt disabled execution of byte code to make sure that the
> transaction succeeds.
>
> But, why is disabling preemption mandatory? If stuff fails due to hitting a
> breakpoint or because it retried a gazillion times without progress, then
> the abort code can detect that and act accordingly. Pseudo code:
>
> abort:
> if (!slowpath_required() &&
> !breakpoint_caused_abort() &&
> !stall_detected()) {
> do_the_normal_abort_postprocessing();
> goto retry;
> }
>
> lock(slowpath_lock[cpu]);
>
> if (!slowpath_required()) {
> unlock(slowpath_lock[cpu]);
> goto retry;
> }
>
> if (rseq_supported)
> set_slow_path();
>
> /* Same code as inside the actual rseq */
> do_transaction();
>
> if (rseq_supported)
> unset_slow_path();
>
> unlock(slowpath_lock[cpu]);

My objection to this approach is that people will get it wrong and not
notice until it's too late.  TSX has two things going for it:

1. It's part of the ISA, so debuggers have very well-defined semantics
to deal with and debuggers will know about it.  rseq is a made-up
Linux thing and debuggers may not know what to do with it.

2. TSX is slow and crappy, so it may not be that widely used.  glibc,
OTOH, will probably start using rseq on all machines if the patches
are merged.


Re: seccomp() SECCOMP_RET_KILL_PROCESS text for man page

2017-11-18 Thread Kees Cook
On Sat, Nov 18, 2017 at 12:04 PM, Michael Kerrisk (man-pages)
 wrote:
> Hi Kees,
>
> I came up with the following text (patch below) to describe the
> SECCOMP_RET_KILL_PROCESS action that you added in 4.14. Does it
> look okay?
>
>SECCOMP_RET_KILL_PROCESS (since Linux 4.14)
>   This value results in immediate termination of the process,
>   with a core dump.  The system call  is  not  executed.   By
>   contrast with SECCOMP_RET_KILL_THREAD below, all threads in
>   the thread group are  terminated.   (For  a  discussion  of
>   thread groups, see the description of the CLONE_THREAD flag
>   in clone(2).)
>
>   The process terminates as though killed by a SIGSYS signal.
>   Even  if  a  signal handler has been registered for SIGSYS,
>   the handler will be ignored in this case  and  the  process
>   always  terminates.  To a parent process that is waiting on
>   this process (using waitpid(2) or  similar),  the  returned
>   wstatus  will  indicate  that  its  child was terminated as
>   though by a SIGSYS signal.
>
> Cheers,
>
> Michael
>
>
> diff --git a/man2/seccomp.2 b/man2/seccomp.2
> index 2e912940e..1b6bb2e51 100644
> --- a/man2/seccomp.2
> +++ b/man2/seccomp.2
> @@ -399,6 +399,36 @@ returned by execution of all of the filters.
>  In decreasing order of precedence,
>  the values that may be returned by a seccomp filter are:
>  .TP
> +.BR SECCOMP_RET_KILL_PROCESS " (since Linux 4.14)"
> +.\" commit 4d3b0b05aae9ee9ce0970dc4cc0fb3fad5e85945
> +.\" commit 0466bdb99e8744bc9befa8d62a317f0fd7fd7421
> +This value results in immediate termination of the process,
> +with a core dump.
> +The system call is not executed.
> +By contrast with
> +.BR SECCOMP_RET_KILL_THREAD
> +below, all threads in the thread group are terminated.
> +(For a discussion of thread groups, see the description of the
> +.BR CLONE_THREAD
> +flag in
> +.BR clone (2).)
> +.IP
> +The process terminates
> +.I "as though"
> +killed by a
> +.B SIGSYS
> +signal.
> +Even if a signal handler has been registered for
> +.BR SIGSYS ,
> +the handler will be ignored in this case and the process always terminates.
> +To a parent process that is waiting on this process (using
> +.BR waitpid (2)
> +or similar), the returned
> +.I wstatus
> +will indicate that its child was terminated as though by a
> +.BR SIGSYS
> +signal.
> +.TP
>  .BR SECCOMP_RET_KILL_THREAD " (or " SECCOMP_RET_KILL )
>  This value results in immediate termination of the thread
>  that made the system call.

This is perfect, thank you!

One thing to adjust elsewhere would be to rename SECCOMP_RET_ACTION to
SECCOMP_RET_ACTION_FULL (the new mask covers the bits used by
SECCOMP_RET_KILL_PROCESS).

-Kees

>
> --
> Michael Kerrisk
> Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
> Linux/UNIX System Programming Training: http://man7.org/training/



-- 
Kees Cook
Pixel Security


Re: [patch V2 02/11] LICENSES: Add the GPL 2.0 license

2017-11-18 Thread Charlemagne Lasse
2017-11-18 20:14 GMT+01:00 Linus Torvalds :
> You may be confusing things because of a newer version.
>

> I refuse to change the original copyright wording due to idiotic
> internal FSF politics that tried to change history.

But you are accepting commit messages which are factually wrong? I am not
confusing anything here but state the obvious. Either he copied it from
https://spdx.org/licenses/GPL-2.0.html#licenseText or not. There is no
reality where https://spdx.org/licenses/GPL-2.0.html#licenseText has the
same content as the patch which he send.

And do you even know the best part: it is also not the version from your
COPYING file.


[PATCH 2/2] ALSA: vx222: Use common error handling code in two functions

2017-11-18 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sat, 18 Nov 2017 21:23:27 +0100

Add jump targets so that a bit of exception handling can be better reused
at the end of these functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---
 sound/pci/vx222/vx222.c | 44 ++--
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c
index 1f866a810a98..672b8f190777 100644
--- a/sound/pci/vx222/vx222.c
+++ b/sound/pci/vx222/vx222.c
@@ -163,10 +163,9 @@ static int snd_vx222_create(struct snd_card *card, struct 
pci_dev *pci,
vx->pci = pci;
 
err = pci_request_regions(pci, CARD_NAME);
-   if (err < 0) {
-   snd_vx222_free(chip);
-   return err;
-   }
+   if (err < 0)
+   goto free_sound_chip;
+
for (i = 0; i < 2; i++)
vx->port[i] = pci_resource_start(pci, i + 1);
 
@@ -174,19 +173,21 @@ static int snd_vx222_create(struct snd_card *card, struct 
pci_dev *pci,
 snd_vx_threaded_irq_handler, IRQF_SHARED,
 KBUILD_MODNAME, chip)) {
dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
-   snd_vx222_free(chip);
-   return -EBUSY;
+   err = -EBUSY;
+   goto free_sound_chip;
}
chip->irq = pci->irq;
 
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
-   if (err < 0) {
-   snd_vx222_free(chip);
-   return err;
-   }
+   if (err < 0)
+   goto free_sound_chip;
 
*rchip = vx;
return 0;
+
+free_sound_chip:
+   snd_vx222_free(chip);
+   return err;
 }
 
 
@@ -225,10 +226,9 @@ static int snd_vx222_probe(struct pci_dev *pci,
}
 
err = snd_vx222_create(card, pci, hw, &vx);
-   if (err < 0) {
-   snd_card_free(card);
-   return err;
-   }
+   if (err < 0)
+   goto free_card;
+
card->private_data = vx;
vx->core.ibl.size = ibl[dev];
 
@@ -242,20 +242,20 @@ static int snd_vx222_probe(struct pci_dev *pci,
 #endif
 
err = snd_vx_setup_firmware(&vx->core);
-   if (err < 0) {
-   snd_card_free(card);
-   return err;
-   }
+   if (err < 0)
+   goto free_card;
 
err = snd_card_register(card);
-   if (err < 0) {
-   snd_card_free(card);
-   return err;
-   }
+   if (err < 0)
+   goto free_card;
 
pci_set_drvdata(pci, card);
dev++;
return 0;
+
+free_card:
+   snd_card_free(card);
+   return err;
 }
 
 static void snd_vx222_remove(struct pci_dev *pci)
-- 
2.15.0



[PATCH 1/2] ALSA: vx222: Adjust ten function calls together with a variable assignment

2017-11-18 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sat, 18 Nov 2017 21:10:37 +0100

The script "checkpatch.pl" pointed information out like the following.

ERROR: do not use assignment in if condition

Thus fix the affected source code places.

Signed-off-by: Markus Elfring 
---
 sound/pci/vx222/vx222.c | 19 +--
 sound/pci/vx222/vx222_ops.c | 19 +++
 2 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c
index 55861849d7df..1f866a810a98 100644
--- a/sound/pci/vx222/vx222.c
+++ b/sound/pci/vx222/vx222.c
@@ -147,7 +147,8 @@ static int snd_vx222_create(struct snd_card *card, struct 
pci_dev *pci,
struct snd_vx_ops *vx_ops;
 
/* enable PCI device */
-   if ((err = pci_enable_device(pci)) < 0)
+   err = pci_enable_device(pci);
+   if (err < 0)
return err;
pci_set_master(pci);
 
@@ -161,7 +162,8 @@ static int snd_vx222_create(struct snd_card *card, struct 
pci_dev *pci,
vx = to_vx222(chip);
vx->pci = pci;
 
-   if ((err = pci_request_regions(pci, CARD_NAME)) < 0) {
+   err = pci_request_regions(pci, CARD_NAME);
+   if (err < 0) {
snd_vx222_free(chip);
return err;
}
@@ -177,7 +179,8 @@ static int snd_vx222_create(struct snd_card *card, struct 
pci_dev *pci,
}
chip->irq = pci->irq;
 
-   if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
+   err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
+   if (err < 0) {
snd_vx222_free(chip);
return err;
}
@@ -220,7 +223,9 @@ static int snd_vx222_probe(struct pci_dev *pci,
hw = &vx222_v2_hw;
break;
}
-   if ((err = snd_vx222_create(card, pci, hw, &vx)) < 0) {
+
+   err = snd_vx222_create(card, pci, hw, &vx);
+   if (err < 0) {
snd_card_free(card);
return err;
}
@@ -236,12 +241,14 @@ static int snd_vx222_probe(struct pci_dev *pci,
vx->core.dev = &pci->dev;
 #endif
 
-   if ((err = snd_vx_setup_firmware(&vx->core)) < 0) {
+   err = snd_vx_setup_firmware(&vx->core);
+   if (err < 0) {
snd_card_free(card);
return err;
}
 
-   if ((err = snd_card_register(card)) < 0) {
+   err = snd_card_register(card);
+   if (err < 0) {
snd_card_free(card);
return err;
}
diff --git a/sound/pci/vx222/vx222_ops.c b/sound/pci/vx222/vx222_ops.c
index d4298af6d3ee..4447d7f57dee 100644
--- a/sound/pci/vx222/vx222_ops.c
+++ b/sound/pci/vx222/vx222_ops.c
@@ -421,11 +421,12 @@ static int vx2_load_dsp(struct vx_core *vx, int index, 
const struct firmware *ds
switch (index) {
case 1:
/* xilinx image */
-   if ((err = vx2_load_xilinx_binary(vx, dsp)) < 0)
+   err = vx2_load_xilinx_binary(vx, dsp);
+   if (err < 0)
return err;
-   if ((err = vx2_test_xilinx(vx)) < 0)
-   return err;
-   return 0;
+
+   err = vx2_test_xilinx(vx);
+   return (err < 0) ? err : 0;
case 2:
/* DSP boot */
return snd_vx_dsp_boot(vx, dsp);
@@ -985,12 +986,14 @@ static int vx2_add_mic_controls(struct vx_core *_chip)
vx2_set_input_level(chip);
 
/* controls */
-   if ((err = snd_ctl_add(_chip->card, 
snd_ctl_new1(&vx_control_input_level, chip))) < 0)
-   return err;
-   if ((err = snd_ctl_add(_chip->card, snd_ctl_new1(&vx_control_mic_level, 
chip))) < 0)
+   err = snd_ctl_add(_chip->card,
+ snd_ctl_new1(&vx_control_input_level, chip));
+   if (err < 0)
return err;
 
-   return 0;
+   err = snd_ctl_add(_chip->card,
+ snd_ctl_new1(&vx_control_mic_level, chip));
+   return (err < 0) ? err : 0;
 }
 
 
-- 
2.15.0



[PATCH 0/2] ALSA-Digigram VX222: Fine-tuning for four function implementations

2017-11-18 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sat, 18 Nov 2017 21:27:50 +0100

Two update suggestions were taken into account
from static source code analysis.

Markus Elfring (2):
  Adjust ten function calls together with a variable assignment
  Use common error handling code in two functions

 sound/pci/vx222/vx222.c | 53 +
 sound/pci/vx222/vx222_ops.c | 19 +---
 2 files changed, 41 insertions(+), 31 deletions(-)

-- 
2.15.0



[PATCH] ARM: exynos: add machine description for ODROID-XU3/4

2017-11-18 Thread Dongjin Kim
This patch is to add the machine descriptions for ODROID-XU3/4 boards
in order to present the hardware name at /proc/cputinfo rather than
"SAMSUNG EXYNOS (Flattened Device Tree)". An embedded open source project,
such as DietPi, reads the hardware name to run different features.

$ cat /proc/cpuinfo | grep Hardware
Hardware: ODROID-XU4

Signed-off-by: Dongjin Kim 
---
 arch/arm/mach-exynos/exynos.c | 28 
 1 file changed, 28 insertions(+)

diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index c404c15ad07f..6197dbf9f48b 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -241,3 +241,31 @@ DT_MACHINE_START(EXYNOS_DT, "SAMSUNG EXYNOS (Flattened 
Device Tree)")
.dt_compat  = exynos_dt_compat,
.dt_fixup   = exynos_dt_fixup,
 MACHINE_END
+
+#define ODROID_MACHINE_START(name, compat) \
+   DT_MACHINE_START(EXYNOS5422_ODROID_##name, "ODROID-"#name)  \
+   .l2c_aux_val= 0x3c41,   \
+   .l2c_aux_mask   = 0xc20f,   \
+   .smp= smp_ops(exynos_smp_ops),  \
+   .map_io = exynos_init_io,   \
+   .init_early = exynos_firmware_init, \
+   .init_irq   = exynos_init_irq,  \
+   .init_machine   = exynos_dt_machine_init,   \
+   .init_late  = exynos_init_late, \
+   .dt_compat  = compat,   \
+   .dt_fixup   = exynos_dt_fixup,  \
+   MACHINE_END
+
+static char const *const exynos5422_odroidxu3_dt_compat[] __initconst = {
+   "hardkernel,odroid-xu3",
+   "hardkernel,odroid-xu3-lite",
+   NULL,
+};
+
+static char const *const exynos5422_odroidxu4_dt_compat[] __initconst = {
+   "hardkernel,odroid-xu4",
+   NULL,
+};
+
+ODROID_MACHINE_START(XU3, exynos5422_odroidxu3_dt_compat)
+ODROID_MACHINE_START(XU4, exynos5422_odroidxu4_dt_compat)
-- 
2.11.0



Re: [RFC v2] prctl: prctl(PR_SET_IDLE, PR_IDLE_MODE_KILLME), for stateless idle loops

2017-11-18 Thread Shawn Landden
On Fri, Nov 3, 2017 at 2:09 AM, Michal Hocko  wrote:
> On Thu 02-11-17 23:35:44, Shawn Landden wrote:
>> 16 bytes per process is kinda spendy, but I want to keep
>> lru behavior, which mem_score_adj does not allow. When a supervisor,
>> like Android's user input is keeping track this can be done in user-space.
>> It could be pulled out of task_struct if an cross-indexing additional
>> red-black tree is added to support pid-based lookup.
>
> This is still an abuse and the patch is wrong. We really do have an API
> to use I fail to see why you do not use it.
When I looked at wait_queue_head_t it was 20 bytes.


Re: [GIT PULL] platform-drivers-x86 for 4.15-1

2017-11-18 Thread Linus Torvalds
On Sat, Nov 18, 2017 at 10:37 AM, Linus Torvalds
 wrote:
>
> So I note that you seem to use the same summary script that Darren used.

.. oh, and I note a *much* worse issue.

You add new drivers and then default them to "on".

THAT IS COMPLETELY UNACCEPTABLE.

I don't know why I have to say this every single merge window, but
let's do it one more time:

  As a developer, you think _your_ driver or feature is the most
important thing ever, and you have the hardware.

  AND ALMOST NOBODY ELSE CARES.

Read it and weep. Unless your hardware is completely ubiquitous, it
damn well should not default to being defaulted everybody elses
config.

In particular, people who do "make oldconfig" clearly had a
configuration _without_ your hardware and were happy with it, and want
to keep it working. That's what "oldconfig" means.

You don't say "hey, let's enable this piece of hardware that you don't
have anyway, just to waste your time and disk and memory".

So the things that merit "default y/m" are

 (a) you added a Kconfig option for something that used to always be
built. Then it merits that "default y" exactly because "make
oldconfig" should just work.

 (b) corollary of the above: if you add a new gatekeeping Kconfig
option that hides/shows other Kconfig options (but doesn't generate
any code of its own), it should be enabled by default, simply so that
by default people will see those other options.

 (c) your driver itself defaults to off, but you then have sub-driver
options for behavior or similar, where you can give sane defaults for
people who _do_ have your hardware, and want the driver for it, and
within those constraints the extended option makes sense

 (d) your piece of hardware or infrastructure really is something that
everybody expects. If you have CONFIG_NET or CONFIG_BLOCK, you get to
enable it by default.

But something like CONFIG_DELL_SMBIOS sure as hell does not merit
being default on. Not even if you have enabled WMI.

EVERY SINGLE "default" line that got added by this branch was wrong.

Stop doing this. It's a serious violation of peoples expectations.
When I do "make oldconfig", I don't want some new random hardware
support.

  Linus


seccomp() SECCOMP_RET_KILL_PROCESS text for man page

2017-11-18 Thread Michael Kerrisk (man-pages)
Hi Kees,

I came up with the following text (patch below) to describe the
SECCOMP_RET_KILL_PROCESS action that you added in 4.14. Does it 
look okay?

   SECCOMP_RET_KILL_PROCESS (since Linux 4.14)
  This value results in immediate termination of the process,
  with a core dump.  The system call  is  not  executed.   By
  contrast with SECCOMP_RET_KILL_THREAD below, all threads in
  the thread group are  terminated.   (For  a  discussion  of
  thread groups, see the description of the CLONE_THREAD flag
  in clone(2).)

  The process terminates as though killed by a SIGSYS signal.
  Even  if  a  signal handler has been registered for SIGSYS,
  the handler will be ignored in this case  and  the  process
  always  terminates.  To a parent process that is waiting on
  this process (using waitpid(2) or  similar),  the  returned
  wstatus  will  indicate  that  its  child was terminated as
  though by a SIGSYS signal.

Cheers,

Michael


diff --git a/man2/seccomp.2 b/man2/seccomp.2
index 2e912940e..1b6bb2e51 100644
--- a/man2/seccomp.2
+++ b/man2/seccomp.2
@@ -399,6 +399,36 @@ returned by execution of all of the filters.
 In decreasing order of precedence,
 the values that may be returned by a seccomp filter are:
 .TP
+.BR SECCOMP_RET_KILL_PROCESS " (since Linux 4.14)"
+.\" commit 4d3b0b05aae9ee9ce0970dc4cc0fb3fad5e85945
+.\" commit 0466bdb99e8744bc9befa8d62a317f0fd7fd7421
+This value results in immediate termination of the process,
+with a core dump.
+The system call is not executed.
+By contrast with
+.BR SECCOMP_RET_KILL_THREAD
+below, all threads in the thread group are terminated.
+(For a discussion of thread groups, see the description of the
+.BR CLONE_THREAD
+flag in
+.BR clone (2).)
+.IP
+The process terminates
+.I "as though"
+killed by a
+.B SIGSYS
+signal.
+Even if a signal handler has been registered for
+.BR SIGSYS ,
+the handler will be ignored in this case and the process always terminates.
+To a parent process that is waiting on this process (using
+.BR waitpid (2)
+or similar), the returned
+.I wstatus
+will indicate that its child was terminated as though by a
+.BR SIGSYS
+signal.
+.TP
 .BR SECCOMP_RET_KILL_THREAD " (or " SECCOMP_RET_KILL )
 This value results in immediate termination of the thread
 that made the system call.

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/


Re: [PULL REQUEST] nfsd changes for 4.15

2017-11-18 Thread Linus Torvalds
On Sat, Nov 18, 2017 at 10:40 AM, J. Bruce Fields  wrote:
> Please pull nfsd changes for 4.15 from:

Hmm. This had a tracepoint conflict with the nfs client pull.

The resolution seems obvious and I did it, but I'd like people to
review the end result but particularly also their workflows, because I
don't think that conflict was reported anywhere and doesn't seem to
exist in next-20171115.

It certainly wasn't mentioned to me in either pull request.

Were the nfs client changes not in next?

Tssk.

  Linus


Re: [PATCH] NFSv4: Ensure gcc 4.4.4 can compile initialiser for "invalid_stateid"

2017-11-18 Thread Boris Ostrovsky



On 11/18/2017 01:50 PM, Trond Myklebust wrote:

gcc 4.4.4 is too old to have full C11 anonymous union support, so
the current initialiser fails to compile.

Reported-by: Boris Ostrovsky 
Signed-off-by: Trond Myklebust 



(compile-)Tested-by: Boris Ostrovsky 

---
  fs/nfs/nfs4state.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 980462d577ca..231b5ea2464a 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -71,8 +71,8 @@ const nfs4_stateid zero_stateid = {
  };
  const nfs4_stateid invalid_stateid = {
{
-   .seqid = cpu_to_be32(0xU),
-   .other = { 0 },
+   /* Funky initialiser keeps older gcc versions happy */
+   .data = { 0xff, 0xff, 0xff, 0xff, 0 },
},
.type = NFS4_INVALID_STATEID_TYPE,
  };



Re: [PATCH 05/10] x86: jailhouse: Set up timekeeping

2017-11-18 Thread Jan Kiszka
On 2017-11-17 23:49, Thomas Gleixner wrote:
> On Thu, 16 Nov 2017, Jan Kiszka wrote:
>> Calibrate the TSC and, where necessary, the APIC timer against the
>> TMTIMER. We need our own implementation as neither the PIC nor the HPET
>> are available, and the standard calibration routines try to make use of
>> them.
> 
> Why is this needed at all?
> 
> The host the frequency already. So this can be done w/o pmtimer and extra
> calibration routine.

The hypervisor does not have the frequencies. It will never use the APIC
timer (it's owned by the guests), and it has no use case for the TSC so
far. Only the root cell (the Linux that booted the system) has that
data. Now we could

- trust the root cell to provide the right values and export them during
  startup to the hypervisor and from there to the non-root cells.

- calculate the frequencies once and store them in the hyperivsor
  config, just like other system-specific information, for re-export to
  the cells.

But I don't think option 1 will be ok for all use cases. Maybe a
combination of both, falling back to the root cell data if nothing is
defined in the config. Let me think about this.

Jan


Re: [PATCH 02/10] x86: jailhouse: Add infrastructure for running in non-root cell

2017-11-18 Thread Jan Kiszka
On 2017-11-17 22:54, Thomas Gleixner wrote:
> On Thu, 16 Nov 2017, Jan Kiszka wrote:
>   
>> +config JAILHOUSE_GUEST
>> +bool "Jailhouse non-root cell support"
>> +depends on PARAVIRT && X86_64
>> +---help---
>> +  This option allows to run Linux as guest in a Jailhouse non-root
>> +  cell. You can leave this option disabled if you only want to start
>> +  Jailhouse and run Linux afterwards in the root cell.
>> +
>> +  You likely also want to disable CONFIG_SUSPEND and CONFIG_SERIO to
>> +  avoid access to I/O resources that are usually not assigned to the
>> +  non-root cell.
> 
> That should be prevented programatically.

Theoretically, serio access could also be assigned to a non-root cell.
But excluding SUSPEND may make sense unconditionally, will check again.

> 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +
>> +#define SETUP_JAILHOUSE 0x53484c4a /* "JLHS" */
>> +
>> +#define SETUP_REQUIRED_VERSION  1
>> +
>> +/*
>> + * The boot loader is passing platform information via this 
>> Jailhouse-specific
>> + * setup data structure.
>> + */
>> +struct jailhouse_setup_data {
>> +struct setup_data header;
>> +u16 version;
>> +u16 compatible_version;
>> +u16 pm_timer_address;
>> +u16 num_cpus;
>> +u64 pci_mmconfig_base;
>> +u8 standard_ioapic;
>> +u8 cpu_ids[255];
> 
> Shouldn't this structure and SETUP_JAILHOUSE be defined in a header file
> which can be exported to boot loaders?

Something like arch/x86/include/uapi/asm/jailhouse_setup.h?

Jan


Re: [patch V2 02/11] LICENSES: Add the GPL 2.0 license

2017-11-18 Thread Jonas Oberg
>This is neither the GPL-2.0 from
>https://www.gnu.org/licenses/gpl-2.0.txt

I think it should be the copy from COPYING, in fact, since that's the exact GPL 
2.0 license the kernel is under. Library GPL is factually correct; Lesser GPL 
is a newer name for the same license, but COPYING retains the old name.

I don't remember when the FSF moved from Temple place but indeed, the address, 
which is correct in COPYING, could be updated.

Best
Jonas Öberg
Free Software Foundation Europe | jo...@fsfe.org
Your support enables our work (fsfe.org/join)


Re: [patch V2 02/11] LICENSES: Add the GPL 2.0 license

2017-11-18 Thread Linus Torvalds
You may be confusing things because of a newer version.

On Sat, Nov 18, 2017 at 11:03 AM, Charlemagne Lasse
 wrote:
>
> That should be "GNU Lesser General Public" and not "GNU Library General 
> Public"

That's just FSF revisionism.

It used to be called "Library" over "Lesser", in the original GPL2.

I suspect your other issues are similar "there's been different
versions over time" things. the address being one of them.

We've actually taken some of the FSF updates over the years ("19yy" ->
"", and the address change) but the main COPYING file still
calls the LGPL the "GNU Library General Public License".

I refuse to change the original copyright wording due to idiotic
internal FSF politics that tried to change history.

 Linus


[PATCH 3/3] ALSA: trident: Use common error handling code in snd_trident_mixer()

2017-11-18 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sat, 18 Nov 2017 19:49:50 +0100

Adjust jump targets so that a bit of exception handling can be better
reused at the end of this function.

Signed-off-by: Markus Elfring 
---
 sound/pci/trident/trident_main.c | 71 +++-
 1 file changed, 33 insertions(+), 38 deletions(-)

diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index 9843a61a8ead..2cb5da02ad9b 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -2980,7 +2980,7 @@ static int snd_trident_mixer(struct snd_trident *trident, 
int pcm_spdif_device)
 
err = snd_ac97_bus(trident->card, 0, &ops, NULL, &trident->ac97_bus);
if (err < 0)
-   goto __out;
+   goto free_control;
 
memset(&_ac97, 0, sizeof(_ac97));
_ac97.private_data = trident;
@@ -2992,12 +2992,12 @@ static int snd_trident_mixer(struct snd_trident 
*trident, int pcm_spdif_device)
if (trident->device == TRIDENT_DEVICE_ID_SI7018) {
err = snd_trident_sis_reset(trident);
if (err < 0)
-   goto __out;
+   goto free_control;
if (retries-- > 0)
goto __again;
err = -EIO;
}
-   goto __out;
+   goto free_control;
}

/* secondary codec? */
@@ -3025,12 +3025,12 @@ static int snd_trident_mixer(struct snd_trident 
*trident, int pcm_spdif_device)
kctl = snd_ctl_new1(&snd_trident_vol_wave_control, trident);
err = snd_ctl_add(card, kctl);
if (err < 0)
-   goto __out;
+   goto free_control;
kctl->put(kctl, uctl);
kctl = snd_ctl_new1(&snd_trident_vol_music_control, trident);
err = snd_ctl_add(card, kctl);
if (err < 0)
-   goto __out;
+   goto free_control;
kctl->put(kctl, uctl);
outl(trident->musicvol_wavevol = 0x, TRID_REG(trident, 
T4D_MUSICVOL_WAVEVOL));
} else {
@@ -3046,52 +3046,51 @@ static int snd_trident_mixer(struct snd_trident 
*trident, int pcm_spdif_device)
 
trident->ctl_vol = snd_ctl_new1(&snd_trident_pcm_vol_control, trident);
if (!trident->ctl_vol)
-   goto __nomem;
+   goto e_nomem;
 
err = snd_ctl_add(card, trident->ctl_vol);
if (err)
-   goto __out;
+   goto free_control;

trident->ctl_pan = snd_ctl_new1(&snd_trident_pcm_pan_control, trident);
if (!trident->ctl_pan)
-   goto __nomem;
+   goto e_nomem;
 
err = snd_ctl_add(card, trident->ctl_pan);
if (err)
-   goto __out;
+   goto free_control;
 
trident->ctl_rvol = snd_ctl_new1(&snd_trident_pcm_rvol_control,
 trident);
if (!trident->ctl_rvol)
-   goto __nomem;
+   goto e_nomem;
 
err = snd_ctl_add(card, trident->ctl_rvol);
if (err)
-   goto __out;
+   goto free_control;
 
trident->ctl_cvol = snd_ctl_new1(&snd_trident_pcm_cvol_control,
 trident);
if (!trident->ctl_cvol)
-   goto __nomem;
+   goto e_nomem;
 
err = snd_ctl_add(card, trident->ctl_cvol);
if (err)
-   goto __out;
+   goto free_control;
 
if (trident->device == TRIDENT_DEVICE_ID_NX) {
kctl = snd_ctl_new1(&snd_trident_ac97_rear_control, trident);
err = snd_ctl_add(card, kctl);
if (err < 0)
-   goto __out;
+   goto free_control;
kctl->put(kctl, uctl);
}
if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == 
TRIDENT_DEVICE_ID_SI7018) {
 
kctl = snd_ctl_new1(&snd_trident_spdif_control, trident);
-   if (kctl == NULL) {
-   err = -ENOMEM;
-   goto __out;
-   }
+   if (!kctl)
+   goto e_nomem;
+
if (trident->ac97->ext_id & AC97_EI_SPDIF)
kctl->id.index++;
if (trident->ac97_sec && (trident->ac97_sec->ext_id & 
AC97_EI_SPDIF))
@@ -3099,51 +3098,47 @@ static int snd_trident_mixer(struct snd_trident 
*trident, int pcm_spdif_device)
idx = kctl->id.index;
err = snd_ctl_add(card, kctl);
if (err < 0)
-   goto __out;
+   goto free_control;
kctl->put(kctl, uctl);
 
kctl = snd_ctl_new1(&snd_trident_s

[PATCH 2/3] ALSA: trident: Use common error handling code in two functions

2017-11-18 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sat, 18 Nov 2017 19:29:35 +0100

Add jump targets so that a bit of exception handling can be better reused
at the end of these functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---
 sound/pci/trident/trident.c  | 54 +++-
 sound/pci/trident/trident_main.c | 41 +++---
 2 files changed, 47 insertions(+), 48 deletions(-)

diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c
index fd35f7826845..830402c32395 100644
--- a/sound/pci/trident/trident.c
+++ b/sound/pci/trident/trident.c
@@ -100,10 +100,9 @@ static int snd_trident_probe(struct pci_dev *pci,
 == TRIDENT_DEVICE_ID_SI7018 ? 1 : 2,
 wavetable_size[dev],
 &trident);
-   if (err < 0) {
-   snd_card_free(card);
-   return err;
-   }
+   if (err < 0)
+   goto free_card;
+
card->private_data = trident;
 
switch (trident->device) {
@@ -130,47 +129,46 @@ static int snd_trident_probe(struct pci_dev *pci,
card->shortname, trident->port, trident->irq);
 
err = snd_trident_pcm(trident, pcm_dev++);
-   if (err < 0) {
-   snd_card_free(card);
-   return err;
-   }
+   if (err < 0)
+   goto free_card;
+
switch (trident->device) {
case TRIDENT_DEVICE_ID_DX:
case TRIDENT_DEVICE_ID_NX:
err = snd_trident_foldback_pcm(trident, pcm_dev++);
-   if (err < 0) {
-   snd_card_free(card);
-   return err;
-   }
+   if (err < 0)
+   goto free_card;
break;
}
if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == 
TRIDENT_DEVICE_ID_SI7018) {
err = snd_trident_spdif_pcm(trident, pcm_dev++);
-   if (err < 0) {
-   snd_card_free(card);
-   return err;
-   }
+   if (err < 0)
+   goto free_card;
}
-   if (trident->device != TRIDENT_DEVICE_ID_SI7018 &&
-   (err = snd_mpu401_uart_new(card, 0, MPU401_HW_TRID4DWAVE,
-  trident->midi_port,
-  MPU401_INFO_INTEGRATED |
-  MPU401_INFO_IRQ_HOOK,
-  -1, &trident->rmidi)) < 0) {
-   snd_card_free(card);
-   return err;
+
+   if (trident->device != TRIDENT_DEVICE_ID_SI7018) {
+   err = snd_mpu401_uart_new(card, 0, MPU401_HW_TRID4DWAVE,
+ trident->midi_port,
+ MPU401_INFO_INTEGRATED |
+ MPU401_INFO_IRQ_HOOK,
+ -1, &trident->rmidi);
+   if (err < 0)
+   goto free_card;
}
 
snd_trident_create_gameport(trident);
 
err = snd_card_register(card);
-   if (err < 0) {
-   snd_card_free(card);
-   return err;
-   }
+   if (err < 0)
+   goto free_card;
+
pci_set_drvdata(pci, card);
dev++;
return 0;
+
+free_card:
+   snd_card_free(card);
+   return err;
 }
 
 static void snd_trident_remove(struct pci_dev *pci)
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index 88d666cb3300..9843a61a8ead 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -3587,14 +3587,14 @@ int snd_trident_create(struct snd_card *card,
dma_set_coherent_mask(&pci->dev, DMA_BIT_MASK(30)) < 0) {
dev_err(card->dev,
"architecture does not support 30bit PCI busmaster 
DMA\n");
-   pci_disable_device(pci);
-   return -ENXIO;
+   err = -ENXIO;
+   goto disable_device;
}

trident = kzalloc(sizeof(*trident), GFP_KERNEL);
if (trident == NULL) {
-   pci_disable_device(pci);
-   return -ENOMEM;
+   err = -ENOMEM;
+   goto disable_device;
}
trident->device = (pci->vendor << 16) | pci->device;
trident->card = card;
@@ -3617,16 +3617,15 @@ int snd_trident_create(struct snd_card *card,
err = pci_request_regions(pci, "Trident Audio");
if (err < 0) {
kfree(trident);
-   pci_disable_device(pci);
-   return err;
+   goto disable_device;
}
trident->port = pci_resource_start(pci, 0);
 
if (request_irq(pci->irq, snd_trident_interrupt, IRQF_SHARED,
KBUILD_MODNAME, trident))

[PATCH 1/3] ALSA: trident: Adjust 34 function calls together with a variable assignment

2017-11-18 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sat, 18 Nov 2017 18:50:22 +0100

The script "checkpatch.pl" pointed information out like the following.

ERROR: do not use assignment in if condition

Thus fix affected source code places.

Signed-off-by: Markus Elfring 
---
 sound/pci/trident/trident.c  |  24 +
 sound/pci/trident/trident_main.c | 113 ++-
 2 files changed, 90 insertions(+), 47 deletions(-)

diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c
index cedf13b64803..fd35f7826845 100644
--- a/sound/pci/trident/trident.c
+++ b/sound/pci/trident/trident.c
@@ -94,11 +94,13 @@ static int snd_trident_probe(struct pci_dev *pci,
if (err < 0)
return err;
 
-   if ((err = snd_trident_create(card, pci,
- pcm_channels[dev],
- ((pci->vendor << 16) | pci->device) == 
TRIDENT_DEVICE_ID_SI7018 ? 1 : 2,
- wavetable_size[dev],
- &trident)) < 0) {
+   err = snd_trident_create(card, pci,
+pcm_channels[dev],
+((pci->vendor << 16) | pci->device)
+== TRIDENT_DEVICE_ID_SI7018 ? 1 : 2,
+wavetable_size[dev],
+&trident);
+   if (err < 0) {
snd_card_free(card);
return err;
}
@@ -127,21 +129,24 @@ static int snd_trident_probe(struct pci_dev *pci,
sprintf(card->longname, "%s PCI Audio at 0x%lx, irq %d",
card->shortname, trident->port, trident->irq);
 
-   if ((err = snd_trident_pcm(trident, pcm_dev++)) < 0) {
+   err = snd_trident_pcm(trident, pcm_dev++);
+   if (err < 0) {
snd_card_free(card);
return err;
}
switch (trident->device) {
case TRIDENT_DEVICE_ID_DX:
case TRIDENT_DEVICE_ID_NX:
-   if ((err = snd_trident_foldback_pcm(trident, pcm_dev++)) < 0) {
+   err = snd_trident_foldback_pcm(trident, pcm_dev++);
+   if (err < 0) {
snd_card_free(card);
return err;
}
break;
}
if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == 
TRIDENT_DEVICE_ID_SI7018) {
-   if ((err = snd_trident_spdif_pcm(trident, pcm_dev++)) < 0) {
+   err = snd_trident_spdif_pcm(trident, pcm_dev++);
+   if (err < 0) {
snd_card_free(card);
return err;
}
@@ -158,7 +163,8 @@ static int snd_trident_probe(struct pci_dev *pci,
 
snd_trident_create_gameport(trident);
 
-   if ((err = snd_card_register(card)) < 0) {
+   err = snd_card_register(card);
+   if (err < 0) {
snd_card_free(card);
return err;
}
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index eabd84d9ffee..88d666cb3300 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -822,9 +822,10 @@ static int snd_trident_allocate_pcm_mem(struct 
snd_pcm_substream *substream,
struct snd_trident *trident = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_trident_voice *voice = runtime->private_data;
-   int err;
+   int err = snd_pcm_lib_malloc_pages(substream,
+  params_buffer_bytes(hw_params));
 
-   if ((err = snd_pcm_lib_malloc_pages(substream, 
params_buffer_bytes(hw_params))) < 0)
+   if (err < 0)
return err;
if (trident->tlb.entries) {
if (err > 0) { /* change */
@@ -1142,12 +1143,11 @@ static int snd_trident_capture_prepare(struct 
snd_pcm_substream *substream)
 static int snd_trident_si7018_capture_hw_params(struct snd_pcm_substream 
*substream,
struct snd_pcm_hw_params 
*hw_params)
 {
-   int err;
-
-   if ((err = snd_pcm_lib_malloc_pages(substream, 
params_buffer_bytes(hw_params))) < 0)
-   return err;
+   int err = snd_pcm_lib_malloc_pages(substream,
+  params_buffer_bytes(hw_params));
 
-   return snd_trident_allocate_evoice(substream, hw_params);
+   return (err < 0) ? err : snd_trident_allocate_evoice(substream,
+hw_params);
 }
 
 /*---
@@ -2174,9 +2174,10 @@ static const struct snd_pcm_ops 
snd_trident_spdif_7018_ops = {
 int snd_trident_pcm(struct snd_trident *trident, int device)
 {
struct snd_pcm *pcm;
-   int err;
+   int err = snd_pcm_new(trident->card, "trident_dx_nx",
+  

[PATCH 0/3] ALSA-Trident 4DWave: Fine-tuning for nine function implementations

2017-11-18 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sat, 18 Nov 2017 19:50:12 +0100

A few update suggestions were taken into account
from static source code analysis.

Markus Elfring (3):
  Adjust 34 function calls together with a variable assignment
  Use common error handling code in two functions
  Use common error handling code in snd_trident_mixer()

 sound/pci/trident/trident.c  |  68 ++--
 sound/pci/trident/trident_main.c | 221 ++-
 2 files changed, 163 insertions(+), 126 deletions(-)

-- 
2.15.0



Re: [patch V2 02/11] LICENSES: Add the GPL 2.0 license

2017-11-18 Thread Charlemagne Lasse
2017-11-18 20:03 GMT+01:00 Charlemagne Lasse :

>> +Ty Coon, President of Vice
>> +
>> +This General Public License does not permit incorporating your program into
>> +proprietary programs. If your program is a subroutine library, you may
>> +consider it more useful to permit linking proprietary applications with the
>> +library. If this is what you want to do, use the GNU Library General Public
>> +License instead of this License.
>
> "Lesser Library General Public" and not "Library General Public License"

I meant: "Lesser General Public License" and not "Library General
Public License"


Re: [patch V2 02/11] LICENSES: Add the GPL 2.0 license

2017-11-18 Thread Charlemagne Lasse
2017-11-16 19:33 GMT+01:00 Thomas Gleixner :
> Add the full text of the GPL 2.0 license to the kernel tree.  It was
> copied directly from:
>
>https://spdx.org/licenses/GPL-2.0.html#licenseText
>
> Add the required tags for reference and tooling.
>
> Signed-off-by: Thomas Gleixner 

NACKed-by: Charlemagne Lasse 

This is neither the GPL-2.0 from https://www.gnu.org/licenses/gpl-2.0.txt
(which you should have used) or
https://spdx.org/licenses/GPL-2.0.html#licenseText

Please download the correct ASCII version from gnu.org and add your SPDX
info in front of it. But I have also added detailed info about
non-whitespace changes in your patch.

But I am sure that you will tell me again that I am only arguing in
circles.

>
> ---
>  LICENSES/preferred/GPL-2.0 |  348 
> +
>  1 file changed, 348 insertions(+)
>  create mode 100644 LICENSES/GPL-2.0

This patch seems to have been modified by hand because the summary doesn't
match the patch.

>
> --- /dev/null
> +++ b/LICENSES/preferred/GPL-2.0

> +GNU GENERAL PUBLIC LICENSE
> +Version 2, June 1991
> +
> +Copyright (C) 1989, 1991 Free Software Foundation, Inc.

That should be:  "Inc.," and not "Inc."


> +
> +Everyone is permitted to copy and distribute verbatim copies
> +of this license document, but changing it is not allowed.
> +
> +Preamble
> +
> +The licenses for most software are designed to take away your freedom to
> +share and change it. By contrast, the GNU General Public License is
> +intended to guarantee your freedom to share and change free software--to
> +make sure the software is free for all its users. This General Public
> +License applies to most of the Free Software Foundation's software and to
> +any other program whose authors commit to using it. (Some other Free
> +Software Foundation software is covered by the GNU Library General Public
> +License instead.) You can apply it to your programs, too.

That should be "GNU Lesser General Public" and not "GNU Library General Public"


> +The precise terms and conditions for copying, distribution and modification 
> follow.
> +
> +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

"GNU GENERAL PUBLIC LICENSE" is missing before
"TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION"


> +To do so, attach the following notices to the program. It is safest to
> +attach them to the start of each source file to most effectively convey the
> +exclusion of warranty; and each file should have at least the "copyright"
> +line and a pointer to where the full notice is found.
> +
> +One line to give the program's name and a brief idea of what it does.

This should actually be:




> +Copyright (C)  
> +
> +This program is free software; you can redistribute it and/or modify it
> +under the terms of the GNU General Public License as published by the
> +Free Software Foundation; either version 2 of the License, or (at your
> +option) any later version.
> +
> +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 for more details.
> +
> +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

This is the wrong address. It should actually be

51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


> +Yoyodyne, Inc., hereby disclaims all copyright interest in the program
> +`Gnomovision' (which makes passes at compilers) written by James
> +Hacker.
> +
> +signature of Ty Coon, 1 April 1989

This should actually be:

, 1 April 1989


> +Ty Coon, President of Vice
> +
> +This General Public License does not permit incorporating your program into
> +proprietary programs. If your program is a subroutine library, you may
> +consider it more useful to permit linking proprietary applications with the
> +library. If this is what you want to do, use the GNU Library General Public
> +License instead of this License.

"Lesser Library General Public" and not "Library General Public License"


[PATCH] NFSv4: Ensure gcc 4.4.4 can compile initialiser for "invalid_stateid"

2017-11-18 Thread Trond Myklebust
gcc 4.4.4 is too old to have full C11 anonymous union support, so
the current initialiser fails to compile.

Reported-by: Boris Ostrovsky 
Signed-off-by: Trond Myklebust 
---
 fs/nfs/nfs4state.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 980462d577ca..231b5ea2464a 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -71,8 +71,8 @@ const nfs4_stateid zero_stateid = {
 };
 const nfs4_stateid invalid_stateid = {
{
-   .seqid = cpu_to_be32(0xU),
-   .other = { 0 },
+   /* Funky initialiser keeps older gcc versions happy */
+   .data = { 0xff, 0xff, 0xff, 0xff, 0 },
},
.type = NFS4_INVALID_STATEID_TYPE,
 };
-- 
2.14.3



Re: [PATCH v2 net-next] net/tcp: trace all TCP/IP state transition with tcp_set_state tracepoint

2017-11-18 Thread Song Liu

> On Nov 18, 2017, at 7:32 AM, Yafang Shao  wrote:
> 
> The TCP/IP transition from TCP_LISTEN to TCP_SYN_RECV and some other
> transitions are not traced with tcp_set_state tracepoint.
> 
> In order to trace the whole tcp lifespans, two helpers are introduced,
> void __tcp_set_state(struct sock *sk, int state)
> void __sk_state_store(struct sock *sk, int newstate)
> 
> When do TCP/IP state transition, we should use these two helpers or use
> tcp_set_state() other than assigning a value to sk_state directly.
> 
> Signed-off-by: Yafang Shao 
> ---
> include/net/tcp.h   |  2 ++
> net/ipv4/inet_connection_sock.c |  6 +++---
> net/ipv4/inet_hashtables.c  |  2 +-
> net/ipv4/tcp.c  | 12 
> 4 files changed, 18 insertions(+), 4 deletions(-)
> 
> diff --git a/include/net/tcp.h b/include/net/tcp.h
> index 85ea578..4f2d015 100644
> --- a/include/net/tcp.h
> +++ b/include/net/tcp.h
> @@ -1247,6 +1247,8 @@ static inline bool tcp_checksum_complete(struct sk_buff 
> *skb)
>   "Close Wait","Last ACK","Listen","Closing"
> };
> #endif
> +void __sk_state_store(struct sock *sk, int newstate);
> +void __tcp_set_state(struct sock *sk, int state);
> void tcp_set_state(struct sock *sk, int state);
> 
> void tcp_done(struct sock *sk);
> diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
> index 4ca46dc..f3967f1 100644
> --- a/net/ipv4/inet_connection_sock.c
> +++ b/net/ipv4/inet_connection_sock.c
> @@ -783,7 +783,7 @@ struct sock *inet_csk_clone_lock(const struct sock *sk,
>   if (newsk) {
>   struct inet_connection_sock *newicsk = inet_csk(newsk);
> 
> - newsk->sk_state = TCP_SYN_RECV;
> + __tcp_set_state(newsk, TCP_SYN_RECV);
>   newicsk->icsk_bind_hash = NULL;
> 
>   inet_sk(newsk)->inet_dport = inet_rsk(req)->ir_rmt_port;
> @@ -877,7 +877,7 @@ int inet_csk_listen_start(struct sock *sk, int backlog)
>* It is OK, because this socket enters to hash table only
>* after validation is complete.
>*/
> - sk_state_store(sk, TCP_LISTEN);
> + __sk_state_store(sk, TCP_LISTEN);
>   if (!sk->sk_prot->get_port(sk, inet->inet_num)) {
>   inet->inet_sport = htons(inet->inet_num);
> 
> @@ -888,7 +888,7 @@ int inet_csk_listen_start(struct sock *sk, int backlog)
>   return 0;
>   }
> 
> - sk->sk_state = TCP_CLOSE;
> + __tcp_set_state(sk, TCP_CLOSE);
>   return err;
> }
> EXPORT_SYMBOL_GPL(inet_csk_listen_start);
> diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
> index e7d15fb..72c15b6 100644
> --- a/net/ipv4/inet_hashtables.c
> +++ b/net/ipv4/inet_hashtables.c
> @@ -430,7 +430,7 @@ bool inet_ehash_nolisten(struct sock *sk, struct sock 
> *osk)
>   sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
>   } else {
>   percpu_counter_inc(sk->sk_prot->orphan_count);
> - sk->sk_state = TCP_CLOSE;
> + __tcp_set_state(sk, TCP_CLOSE);
>   sock_set_flag(sk, SOCK_DEAD);
>   inet_csk_destroy_sock(sk);
>   }
> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> index bf97317..2bc7e04 100644
> --- a/net/ipv4/tcp.c
> +++ b/net/ipv4/tcp.c
> @@ -2036,6 +2036,18 @@ int tcp_recvmsg(struct sock *sk, struct msghdr *msg, 
> size_t len, int nonblock,
> }
> EXPORT_SYMBOL(tcp_recvmsg);
> 
> +void __sk_state_store(struct sock *sk, int newstate)
> +{
> + trace_tcp_set_state(sk, sk->sk_state, newstate);
> + sk_state_store(sk, newstate);
> +}
> +
> +void __tcp_set_state(struct sock *sk, int state)
> +{
> + trace_tcp_set_state(sk, sk->sk_state, state);
> + sk->sk_state = state;
> +}
> +
> void tcp_set_state(struct sock *sk, int state)
> {
>   int oldstate = sk->sk_state;
> -- 
> 1.8.3.1
> 

+ Brendan



Re: Cannot boot with rootfs from eMMC if maxcpus=1

2017-11-18 Thread Randy Dunlap
On 11/09/2017 08:14 AM, Richard Schmitt wrote:
> Using a 4.9 kernel, trying to boot a kernel using an eMMC based rootfs will 
> result in a crash
> 
> The message preceeding the crash is:
> 
> [3.285566] VFS: Cannot open root device "mmcblk0p9" or 
> unknown-block(0,0): error -6
> [3.293338] Please append a correct "root=" boot option; here are the 
> available partitions:
> 
> Our kernel boot args can be seen in the boot log but for easy reference are:
> 
>  root=/dev/mmcblk0p9 earlycon clk_ignore_unused cpuidle.off=1 DEBUG_MODE=y 
> siq_board_type=RP maxcpus=1
> 
> Note that we do specify root=/dev/mmcblk0p9.  If I simply remove maxcpus=1 
> from the kernel boot args, the system will boot up fine.
> 
> Seems like there might be a race in bringing up the eMMC partitions prior to 
> mounting the rootfs but I don’t want to hypothesis any further.
> 
> Any ideas?

If you suspect a timing issue, an easy test would be to add to the kernel
boot/command line either:
  rootwait
or
  rootdelay=10
(in seconds) to see if that helps.


or send email to linux-arm-ker...@lists.infradead.org ...

-- 
~Randy


[PULL REQUEST] nfsd changes for 4.15

2017-11-18 Thread J. Bruce Fields
Please pull nfsd changes for 4.15 from:

  git://linux-nfs.org/~bfields/linux.git tags/nfsd-4.15

Lots of good bugfixes, including:

- fix a number of races in the NFSv4+ state code.
- fix some shutdown crashes in multiple-network-namespace cases.
- relax our 4.1 session limits; if you've an artificially low limit
  to the number of 4.1 clients that can mount simultaneously, try
  upgrading.

--b.

Andrew Elble (1):
  nfsd: deal with revoked delegations appropriately

Arnd Bergmann (1):
  nfds: avoid gettimeofday for nfssvc_boot time

Chuck Lever (2):
  svcrdma: Preserve CB send buffer across retransmits
  svcrdma: Enqueue after setting XPT_CLOSE in completion handlers

Colin Ian King (1):
  sunrcp: make function _svc_create_xprt static

Corentin Labbe (3):
  nfs_common: fix build warning in grace.c
  nfs_common: move locks_in_grace comment at the right place
  nfs_common: convert int to bool

Elena Reshetova (3):
  fs, nfsd: convert nfs4_stid.sc_count from atomic_t to refcount_t
  fs, nfsd: convert nfs4_cntl_odstate.co_odcount from atomic_t to refcount_t
  fs, nfsd: convert nfs4_file.fi_ref from atomic_t to refcount_t

J. Bruce Fields (6):
  nfsd: remove unnecessary nofilehandle checks
  nfsd: increase DRC cache limit
  nfsd: give out fewer session slots as limit approaches
  nfsd4: fix cached replies to solo SEQUENCE compounds
  nfsd4: catch some false session retries
  rpc: remove some BUG()s

Jérémy Lefaure (1):
  nfsd: use ARRAY_SIZE

Trond Myklebust (2):
  SUNRPC: Fix tracepoint storage issues with svc_recv and svc_rqst_status
  SUNRPC: Improve ordering of transport processing

Vasily Averin (2):
  lockd: double unregister of inetaddr notifiers
  nfsd: use nfs->ns.inum as net ID

 fs/lockd/svc.c |  20 ++---
 fs/nfs_common/grace.c  |  24 +++---
 fs/nfsd/fault_inject.c |   5 +-
 fs/nfsd/netns.h|   2 +-
 fs/nfsd/nfs3xdr.c  |  10 ++-
 fs/nfsd/nfs4layouts.c  |   4 +-
 fs/nfsd/nfs4proc.c |  19 ++---
 fs/nfsd/nfs4state.c| 127 +++--
 fs/nfsd/nfssvc.c   |   4 +-
 fs/nfsd/state.h|  11 ++-
 fs/nfsd/xdr4.h |  13 ++-
 include/linux/fs.h |   4 +-
 include/linux/sunrpc/svc.h |   1 +
 include/trace/events/sunrpc.h  |  17 ++--
 net/sunrpc/auth_gss/svcauth_gss.c  |  14 ++--
 net/sunrpc/svc_xprt.c  | 106 
 net/sunrpc/xprtrdma/svc_rdma_backchannel.c |   6 +-
 net/sunrpc/xprtrdma/svc_rdma_transport.c   |  11 ++-
 18 files changed, 225 insertions(+), 173 deletions(-)


Re: [GIT PULL] platform-drivers-x86 for 4.15-1

2017-11-18 Thread Linus Torvalds
On Sat, Nov 18, 2017 at 10:09 AM, Andy Shevchenko
 wrote:
>
> Here is the collected material against Platform Drivers x86 subsystem.
> It's rather bit busy cycle for PDx86, mostly due to Dell SMBIOS driver
> activity.

So I note that you seem to use the same summary script that Darren used.

Guys, the "merge summary" should be human-readable, not just a
slightly munged version of "git shortlog" that has been sorted by
first word.

Feel free to use that munged version as a base-line, but don't just
send me automated merge messages.

The whole point of a summary is to summarize. And merge messages
should be legible, not "this is all the details that you could have
just used 'git shortlog' to get".

When you can't even be bothered to fix up obvious issues like

 (a) "yeah, I just sorted things alphabetically without any human interaction":

intel-wmi-thunderbolt:
 -  Silence error cases

MAINTAINERS:
 -  Add entry for the PEAQ WMI hotkeys driver

mlx-platform:
 -  make a couple of structures static

 (b) "yeah, my summary script splits the overview at a colon, so when
there is no colon it doesn't work":

Add driver to force WMI Thunderbolt controller power status:
 - Add driver to force WMI Thunderbolt controller power status

it's good that you have a fairly unified commit message model and can
do these summaries, but it's bad when you then don't do much of any
_human_ summary at all or even check the result for sanity.

  Linus


Re: [PATCH PREEMPT RT] rt-mutex: fix deadlock in device mapper

2017-11-18 Thread Mike Galbraith
On Fri, 2017-11-17 at 15:57 +0100, Sebastian Siewior wrote:
> On 2017-11-13 12:56:53 [-0500], Mikulas Patocka wrote:
> > Hi
> Hi,
> 
> > I'm submitting this patch for the CONFIG_PREEMPT_RT patch. It fixes 
> > deadlocks in device mapper when real time preemption is used.
> 
> applied, thank you.

Below is my 2012 3.0-rt version of that for reference; at that time we
were using slab, and slab_lock referenced below was a local_lock.  The
comment came from crash analysis of a deadlock I met before adding the
(yeah, hacky) __migrate_disabled() blocker.  At the time, that was not
an optional hack, you WOULD deadlock if you ground disks to fine powder
the way SUSE QA did.  Pulling the plug before blocking cured the
xfs/ext[34] IO deadlocks they griped about, but I had to add that hack
to not trade their nasty IO deadlocks for the more mundane variety.  So
my question is: are we sure that in the here and now flush won't want
any lock we may be holding?  In days of yore, it most definitely would
turn your box into a doorstop if you tried hard enough.

Subject: rt: pull your plug before blocking
Date: Wed Jul 18 14:43:15 CEST 2012
From: Mike Galbraith 

Queued IO can lead to IO deadlock should a task require wakeup from a task
which is blocked on that queued IO.

ext3: dbench1 queues a buffer, blocks on journal mutex, it's plug is not
pulled.  dbench2 mutex owner is waiting for kjournald, who is waiting for
the buffer queued by dbench1.  Game over.

Signed-off-by: Mike Galbraith 
---
 kernel/locking/rtmutex.c |   18 --
 1 file changed, 16 insertions(+), 2 deletions(-)

--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "rtmutex_common.h"
 
@@ -930,8 +931,18 @@ static inline void rt_spin_lock_fastlock
 
if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current)))
rt_mutex_deadlock_account_lock(lock, current);
-   else
+   else {
+   /*
+* We can't pull the plug if we're already holding a lock
+* else we can deadlock.  eg, if we're holding slab_lock,
+* ksoftirqd can block while processing BLOCK_SOFTIRQ after
+* having acquired q->queue_lock.  If _we_ then block on
+* that q->queue_lock while flushing our plug, deadlock.
+*/
+   if (__migrate_disabled(current) < 2 && 
blk_needs_flush_plug(current))
+   blk_schedule_flush_plug(current);
slowfn(lock);
+   }
 }
 
 static inline void rt_spin_lock_fastunlock(struct rt_mutex *lock,
@@ -1892,9 +1903,12 @@ rt_mutex_fastlock(struct rt_mutex *lock,
if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) {
rt_mutex_deadlock_account_lock(lock, current);
return 0;
-   } else
+   } else {
+   if (blk_needs_flush_plug(current))
+   blk_schedule_flush_plug(current);
return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK,
  ww_ctx);
+   }
 }
 
 static inline int


Re: [PATCH] input: remove unneeded DRIVER_LICENSE #defines

2017-11-18 Thread Dmitry Torokhov
On Sat, Nov 18, 2017 at 11:27:24AM +0100, Greg Kroah-Hartman wrote:
> On Fri, Nov 17, 2017 at 12:33:13PM -0800, Dmitry Torokhov wrote:
> > On Fri, Nov 17, 2017 at 03:17:20PM +0100, Greg Kroah-Hartman wrote:
> > > There is no need to #define the license of the driver, just put it in
> > > the MODULE_LICENSE() line directly as a text string.
> > > 
> > > This allows tools that check that the module license matches the source
> > > code license to work properly, as there is no need to unwind the
> > > unneeded dereference.  For some of these drivers, the #define is just a
> > > few lines above the MODULE_LICENSE() line, which is extra pointless.
> > > 
> > > Cc: Dmitry Torokhov 
> > > Cc: Arvind Yadav 
> > > Reported-by: Philippe Ombredanne 
> > > Signed-off-by: Greg Kroah-Hartman 
> > > ---
> > >  drivers/input/misc/keyspan_remote.c | 3 +--
> > >  drivers/input/tablet/acecad.c   | 3 +--
> > >  drivers/input/tablet/hanwang.c  | 3 +--
> > >  drivers/input/tablet/kbtab.c| 3 +--
> > >  4 files changed, 4 insertions(+), 8 deletions(-)
> > > 
> > > diff --git a/drivers/input/misc/keyspan_remote.c 
> > > b/drivers/input/misc/keyspan_remote.c
> > > index 77c47d6325fe..4f13b2f7bf4f 100644
> > > --- a/drivers/input/misc/keyspan_remote.c
> > > +++ b/drivers/input/misc/keyspan_remote.c
> > > @@ -20,7 +20,6 @@
> > >  #define DRIVER_VERSION   "v0.1"
> > >  #define DRIVER_AUTHOR"Michael Downey "
> > >  #define DRIVER_DESC  "Driver for the USB Keyspan remote control."
> > > -#define DRIVER_LICENSE   "GPL"
> > 
> > If we do this, can we also get rid of other DIRVER_* macros that are not
> > useful?
> 
> Please do, I got rid of all of the DRIVER_VERSION crap in the
> drivers/usb/ tree a release or so ago, as they make no sense at all.
> The other defines are also really silly and can be cleaned up too.
> 
> Want me to do that for drivers/input/ for you?
> 

That would be great, yes.

Thanks.

-- 
Dmitry


Re: Commit fcd8843c40 breaks old compilers

2017-11-18 Thread Boris Ostrovsky



On 11/18/2017 01:12 PM, Trond Myklebust wrote:



Sigh OK, how about something like the following then:

{ .data = { 0xff, 0xff, 0xff, 0xff, 0 }, }




Yes, this does build.


diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 54fd56d..daa6085 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -71,8 +71,7 @@
 };
 const nfs4_stateid invalid_stateid = {
{
-   .seqid = cpu_to_be32(0xU),
-   .other = { 0 },
+   .data = { 0xff, 0xff, 0xff, 0xff, 0 },
},
.type = NFS4_INVALID_STATEID_TYPE,
 };


-boris


Re: [PATCH 01/10 v3] Input: ep93xx_keypad: Fix platform_get_irq's error checking

2017-11-18 Thread Dmitry Torokhov
On Sat, Nov 18, 2017 at 04:25:08PM +0530, Arvind Yadav wrote:
> The platform_get_irq() function returns negative if an error occurs.
> zero or positive number on success. platform_get_irq() error checking
> for zero is not correct.
> 
> Signed-off-by: Arvind Yadav 
> ---
> changes in v2:
>Return keypad->irq insted of -ENXIO.
> changes in v3 :
>Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
> 
>  drivers/input/keyboard/ep93xx_keypad.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/input/keyboard/ep93xx_keypad.c 
> b/drivers/input/keyboard/ep93xx_keypad.c
> index f77b295..01788a7 100644
> --- a/drivers/input/keyboard/ep93xx_keypad.c
> +++ b/drivers/input/keyboard/ep93xx_keypad.c
> @@ -257,8 +257,8 @@ static int ep93xx_keypad_probe(struct platform_device 
> *pdev)
>   }
>  
>   keypad->irq = platform_get_irq(pdev, 0);
> - if (!keypad->irq) {
> - err = -ENXIO;
> + if (keypad->irq <= 0) {
> + err = keypad->irq;

Argh, so what will happen if you return with keypad->irq == 0? Can you
please stop and consider what exactly  you are doing before churning
patches like crazy?

>   goto failed_free;
>   }
>  
> -- 
> 2.7.4
> 

Thanks.

-- 
Dmitry


Re: [PATCH 5/10 v2] Input: cpcap-pwrbutton: Handle return value of platform_get_irq

2017-11-18 Thread Dmitry Torokhov
On Sat, Nov 18, 2017 at 08:21:22AM +, Russell King - ARM Linux wrote:
> On Sat, Nov 18, 2017 at 02:36:53AM +0530, Arvind Yadav wrote:
> > platform_get_irq() can fail here and we must check its return value.
> 
> The test should be <= 0, and you need to return an error code for the
> 0 case.

Instead of polluting the drivers with special handling of 0 vs negative
error we should have platform_get_irq[_byname] return -EINVAL if it sees
0.

Thanks.

-- 
Dmitry


Re: mm/percpu.c: use smarter memory allocation for struct pcpu_alloc_info (crisv32 hang)

2017-11-18 Thread Guenter Roeck
Hi,

On Tue, Oct 03, 2017 at 06:29:49PM -0400, Nicolas Pitre wrote:
> On Tue, 3 Oct 2017, Tejun Heo wrote:
> 
> > On Tue, Oct 03, 2017 at 04:57:44PM -0400, Nicolas Pitre wrote:
> > > This can be much smaller than a page on very small memory systems. 
> > > Always rounding up the size to a page is wasteful in that case, and 
> > > required alignment is smaller than the memblock default. Let's round 
> > > things up to a page size only when the actual size is >= page size, and 
> > > then it makes sense to page-align for a nicer allocation pattern.
> > 
> > Isn't that a temporary area which gets freed later during boot?
> 
> Hmmm...
> 
> It may get freed through 3 different paths where 2 of them are error 
> paths. What looks like a non-error path is in pcpu_embed_first_chunk() 
> called from setup_per_cpu_areas(). But there are two versions of 
> setup_per_cpu_areas(): one for SMP and one for !SMP. And the !SMP case 
> never calls pcpu_free_alloc_info() currently.
> 
> I'm not sure i understand that code fully, but maybe the following patch 
> could be a better fit:
> 
> - >8
> Subject: [PATCH] percpu: don't forget to free the temporary struct 
> pcpu_alloc_info
> 
> Unlike the SMP case, the !SMP case does not free the memory for struct 
> pcpu_alloc_info allocated in setup_per_cpu_areas(). And to give it a 
> chance of being reused by the page allocator later, align it to a page 
> boundary just like its size.
> 
> Signed-off-by: Nicolas Pitre 

This patch causes my crisv32 qemu emulation to hang with no console output.

> 
> diff --git a/mm/percpu.c b/mm/percpu.c
> index 434844415d..caab63375b 100644
> --- a/mm/percpu.c
> +++ b/mm/percpu.c
> @@ -1416,7 +1416,7 @@ struct pcpu_alloc_info * __init 
> pcpu_alloc_alloc_info(int nr_groups,
> __alignof__(ai->groups[0].cpu_map[0]));
>   ai_size = base_size + nr_units * sizeof(ai->groups[0].cpu_map[0]);
>  
> - ptr = memblock_virt_alloc_nopanic(PFN_ALIGN(ai_size), 0);
> + ptr = memblock_virt_alloc_nopanic(PFN_ALIGN(ai_size), PAGE_SIZE);
>   if (!ptr)
>   return NULL;
>   ai = ptr;
> @@ -2295,6 +2295,7 @@ void __init setup_per_cpu_areas(void)
>  
>   if (pcpu_setup_first_chunk(ai, fc) < 0)
>   panic("Failed to initialize percpu areas.");
> + pcpu_free_alloc_info(ai);

This is the culprit. Everything works fine if I remove this line.

No idea if the problem is here or in the cris core.
Copying cris maintainers for input.

Guenter


[GIT PULL] platform-drivers-x86 for 4.15-1

2017-11-18 Thread Andy Shevchenko
Hi Linus,

Here is the collected material against Platform Drivers x86 subsystem.
It's rather bit busy cycle for PDx86, mostly due to Dell SMBIOS driver
activity.

During merge it will get a conflict

CONFLICT (content): Merge conflict in Documentation/admin-guide/thunderbolt.rst

that is pretty straight forward to solve, i.e. we need all parts of
documentation be in, where "Networking over Thunderbolt cable" is
followed by "Forcing power" chapter.

Thanks,

With Best Regards,
Andy Shevchenko

The following changes since commit 0224d45c9d46401b6d7018a96cfe049c5da7d91c:

  i2c-cht-wc: Add device-properties for fusb302 integration (2017-10-27 
15:51:51 +0200)

are available in the Git repository at:

  git://git.infradead.org/linux-platform-drivers-x86.git 
tags/platform-drivers-x86-v4.15-1

for you to fetch changes up to aaa40965d2342137d756121993c395e2a7463a8d:

  platform/x86: silead_dmi: Add silead, home-button property to some tablets 
(2017-11-18 19:28:58 +0200)


platform-drivers-x86 for v4.15-1

For this cycle we have quite an update for the Dell SMBIOS driver
including WMI work to provide an interface for SMBIOS tokens via sysfs
and WMI support for 2017+ Dell laptop models. SMM dispatcher code is
split into a separate driver followed by a new WMI dispatcher.
The latter provides a character device interface to user space.

The pull request contains a merge of immutable branch from Wolfram Sang
in order to apply a dependent fix to the Intel CherryTrail Battery
Management driver.

Other Intel drivers got a lot of cleanups. The Turbo Boost Max 3.0
support is added for Intel Skylake.

Peaq WMI hotkeys driver gets its own maintainer and white list of
supported models.

Silead DMI is expanded to support few additional platforms.

Tablet mode via GMMS ACPI method is added to support some ThinkPad
tablets.

Two commits appear here which were previously merged during the
v4.14-rcX cycle:

- d7ca5ebf2493 platform/x86: intel_pmc_ipc: Use devm_* calls in driver probe 
function
- e3075fd6f80c platform/x86: intel_pmc_ipc: Use spin_lock to protect GCR updates

Add driver to force WMI Thunderbolt controller power status:
 - Add driver to force WMI Thunderbolt controller power status

asus-wmi:
 -  Add lightbar led support

dell-laptop:
 -  Allocate buffer before rfkill use

dell-smbios:
 -  fix string overflow
 -  Add filtering support
 -  Introduce dispatcher for SMM calls
 -  Add a sysfs interface for SMBIOS tokens
 -  only run if proper oem string is detected
 -  Prefix class/select with cmd_
 -  Add pr_fmt definition to driver

dell-smbios-smm:
 -  test for WSMT

dell-smbios-wmi:
 -  release mutex lock on WMI call failure
 -  introduce userspace interface
 -  Add new WMI dispatcher driver

dell-smo8800:
 -  remove redundant assignments to byte_data

dell-wmi:
 -  don't check length returned
 -  clean up wmi descriptor check
 -  increase severity of some failures
 -  Do not match on descriptor GUID modalias
 -  Label driver as handling notifications

dell-*wmi*:
 -  Relay failed initial probe to dependent drivers

dell-wmi-descriptor:
 -  check if memory was allocated
 -  split WMI descriptor into it's own driver

fujitsu-laptop:
 -  Fix radio LED detection
 -  Don't oops when FUJ02E3 is not presnt

hp_accel:
 -  Add quirk for HP ProBook 440 G4

hp-wmi:
 -  Fix tablet mode detection for convertibles

ideapad-laptop:
 -  Add Lenovo Yoga 920-13IKB to no_hw_rfkill dmi list

intel_cht_int33fe:
 -  Update fusb302 type string, add properties
 -  make a couple of local functions static
 -  Work around BIOS bug on some devices

intel-hid:
 -  Power button suspend on Dell Latitude 7275

intel_ips:
 -  Convert timers to use timer_setup()
 -  Remove FSF address from GPL notice
 -  Remove unneeded fields and label
 -  Keep pointer to struct device
 -  Use PCI_VDEVICE() macro
 -  Switch to new PCI IRQ allocation API
 -  Simplify error handling via devres API

intel_pmc_ipc:
 -  Revert Use MFD framework to create dependent devices
 -  Use MFD framework to create dependent devices
 -  Use spin_lock to protect GCR updates
 -  Use devm_* calls in driver probe function

intel_punit_ipc:
 -  Fix resource ioremap warning

intel_telemetry:
 -  Remove useless default in Kconfig
 -  Add needed inclusion
 -  cleanup redundant headers
 -  Fix typos
 -  Fix load failure info

intel_telemetry_debugfs:
 -  Use standard ARRAY_SIZE() macro

intel_turbo_max_3:
 -  Add Skylake platform

intel-wmi-thunderbolt:
 -  Silence error cases

MAINTAINERS:
 -  Add entry for the PEAQ WMI hotkeys driver

mlx-platform:
 -  make a couple of structures static

peaq_wmi:
 -  Fix missing terminating entry for peaq_dmi_table

peaq-wmi:
 -  Remove unnecessary checks from peaq_wmi_exit
 -  Add DMI check before binding to the WMI interface
 -  Revert Blacklist Lenovo ideapad 700-15ISK
 -  Blacklist Lenovo ideapad 700-15ISK

silead_dmi:
 -  Add silead, home-button property to some tablets
 -  Add entry 

Re: [PATCH v18 5/6] vfio: ABI for mdev display dma-buf operation

2017-11-18 Thread Alex Williamson
On Sat, 18 Nov 2017 23:29:31 +0530
Kirti Wankhede  wrote:

> Extremely sorry for the delay.
> This works for VFIO_GFX_PLANE_TYPE_REGION. Tested with local changes.
> 
> Reviewed-by: Kirti Wankhede 

With that,

Acked-by: Alex Williamson 

> On 11/18/2017 9:00 PM, Alex Williamson wrote:
> > 
> > Kirti?
> > 
> > On Wed, 15 Nov 2017 21:11:42 -0700
> > Alex Williamson  wrote:
> >   
> >> On Thu, 16 Nov 2017 11:21:56 +0800
> >> Zhenyu Wang  wrote:
> >>  
> >>> On 2017.11.15 11:48:42 -0700, Alex Williamson wrote:
>  On Wed, 15 Nov 2017 17:11:54 +0800
>  Tina Zhang  wrote:
>    
> > Add VFIO_DEVICE_QUERY_GFX_PLANE ioctl command to let user query and get
> > a plane and its information. So far, two types of buffers are supported:
> > buffers based on dma-buf and buffers based on region.
> >
> > This ioctl can be invoked with:
> > 1) Either DMABUF or REGION flag. Vendor driver returns a plane_info
> > successfully only when the specific kind of buffer is supported.
> > 2) Flag PROBE. And at the same time either DMABUF or REGION must be set,
> > so that vendor driver returns success only when the specific kind of
> > buffer is supported.
> >
> > Add VFIO_DEVICE_GET_GFX_DMABUF ioctl command to let user get a specific
> > dma-buf fd of an exposed MDEV buffer provided by dmabuf_id which was
> > returned in VFIO_DEVICE_QUERY_GFX_PLANE ioctl command.
> >
> > The life cycle of an exposed MDEV buffer is handled by userspace and
> > tracked by kernel space. The returned dmabuf_id in struct vfio_device_
> > query_gfx_plane can be a new id of a new exposed buffer or an old id of
> > a re-exported buffer. Host user can check the value of dmabuf_id to see
> > if it needs to create new resources according to the new exposed buffer
> > or just re-use the existing resource related to the old buffer.
> >
> > v18:
> > - update comments for VFIO_DEVICE_GET_GFX_DMABUF. (Alex)
> >
> > v17:
> > - modify VFIO_DEVICE_GET_GFX_DMABUF interface. (Alex)
> >
> > v16:
> > - add x_hot and y_hot fields. (Gerd)
> > - add comments for VFIO_DEVICE_GET_GFX_DMABUF. (Alex)
> > - rebase to 4.14.0-rc6.
> >
> > v15:
> > - add a ioctl to get a dmabuf for a given dmabuf id. (Gerd)
> >
> > v14:
> > - add PROBE, DMABUF and REGION flags. (Alex)
> >
> > v12:
> > - add drm_format_mod back. (Gerd and Zhenyu)
> > - add region_index. (Gerd)
> >
> > v11:
> > - rename plane_type to drm_plane_type. (Gerd)
> > - move fields of vfio_device_query_gfx_plane to 
> > vfio_device_gfx_plane_info.
> >   (Gerd)
> > - remove drm_format_mod, start fields. (Daniel)
> > - remove plane_id.
> >
> > v10:
> > - refine the ABI API VFIO_DEVICE_QUERY_GFX_PLANE. (Alex) (Gerd)
> >
> > v3:
> > - add a field gvt_plane_info in the drm_i915_gem_obj structure to save
> >   the decoded plane information to avoid look up while need the plane
> >   info. (Gerd)
> >
> > Signed-off-by: Tina Zhang 
> > Cc: Gerd Hoffmann 
> > Cc: Alex Williamson 
> > Cc: Daniel Vetter 
> > ---
> >  include/uapi/linux/vfio.h | 62 
> > +++
> >  1 file changed, 62 insertions(+)
> >
> > diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
> > index ae46105..5c1cca2 100644
> > --- a/include/uapi/linux/vfio.h
> > +++ b/include/uapi/linux/vfio.h
> > @@ -502,6 +502,68 @@ struct vfio_pci_hot_reset {
> >  
> >  #define VFIO_DEVICE_PCI_HOT_RESET  _IO(VFIO_TYPE, VFIO_BASE + 13)
> >  
> > +/**
> > + * VFIO_DEVICE_QUERY_GFX_PLANE - _IOW(VFIO_TYPE, VFIO_BASE + 14,
> > + *struct 
> > vfio_device_query_gfx_plane)
> > + *
> > + * Set the drm_plane_type and flags, then retrieve the gfx plane info.
> > + *
> > + * flags supported:
> > + * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_DMABUF are set
> > + *   to ask if the mdev supports dma-buf. 0 on support, -EINVAL on no
> > + *   support for dma-buf.
> > + * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_REGION are set
> > + *   to ask if the mdev supports region. 0 on support, -EINVAL on no
> > + *   support for region.
> > + * - VFIO_GFX_PLANE_TYPE_DMABUF or VFIO_GFX_PLANE_TYPE_REGION is set
> > + *   with each call to query the plane info.
> > + * - Others are invalid and return -EINVAL.
> > + *
> > + * Note:
> > + * 1. Plane could be disabled by guest. In that case, success will be
> > + *returned with zero-initialized drm_format, size, width and height
> > + *fields.
> > + * 2. x_hot/y_hot is set to 0x if no hotspot information 
> > available
> > + *
> > + * Return: 0 on success, -errno on other failure.
> > + */
> > +struct vfio_d

Re: Commit fcd8843c40 breaks old compilers

2017-11-18 Thread Trond Myklebust
On Sat, 2017-11-18 at 13:07 -0500, Boris Ostrovsky wrote:
> 
> On 11/18/2017 12:39 PM, Trond Myklebust wrote:
> > On Sat, 2017-11-18 at 12:19 -0500, Boris Ostrovsky wrote:
> > > Commit fcd8843c406b46433857ae45e5e9d84b01a7d20b breaks on older
> > > compilers which cannot process initializers for anonymous
> > > structures:
> > > 
> > > +const nfs4_stateid invalid_stateid = {
> > > +   {
> > > +   .seqid = cpu_to_be32(0xU),
> > > +   .other = { 0 },
> > > +   },
> > > +   .type = NFS4_INVALID_STATEID_TYPE,
> > > +};
> > > 
> > > 
> > > /home/build/linux-linus/fs/nfs/nfs4state.c:74: error: unknown
> > > field
> > > ‘seqid’ specified in initializer
> > > /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: missing
> > > braces
> > > around initializer
> > > /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: (near
> > > initialization for ‘invalid_stateid..data’)
> > > /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: overflow
> > > in
> > > implicit constant conversion
> > > /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: unknown
> > > field
> > > ‘other’ specified in initializer
> > > /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: extra brace
> > > group
> > > at end of initializer
> > > /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: (near
> > > initialization for ‘invalid_stateid.’)
> > > /home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: excess
> > > elements
> > > in union initializer
> > > /home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: (near
> > > initialization for ‘invalid_stateid.’)
> > > make[4]: *** [fs/nfs/nfs4state.o] Error 1
> > > make[3]: *** [fs/nfs] Error 2
> > > 
> > > 
> > > FC-64  gcc --version
> > > gcc (GCC) 4.4.4 20100503 (Red Hat 4.4.4-2)
> > > 
> > > 
> > > A similar bug was fixed by
> > > e0714ec4f9efe7b86828b0dcc077fd8f5d8e5e91
> > > but
> > > I don't think the same approach can work here.
> > 
> > 
> > I don't have any setups with gcc 4.4.4. What is it expecting here?
> > Is
> > it expecting an extra set of braces due to the anonymous "struct"?
> > 
> 
> No, that won't work (at least I couldn't get it to work) because the 
> solution from e0714ec4f9e assumes that the anonymous struct is the
> first 
> one in the enveloping struct.
> 
> It worked only if I (this is a small C program with equivalent
> structs):
> 
> struct nfs4_stateid_struct {
>  union {
>  //char data[4];
>  struct {
>  unsigned seqid;
>  char other[6];
>  } __attribute__ ((packed));
>   char data[4];
>  };
> and then
> 
> const nfs4_stateid invalid_stateid = {
>  {
>{.seqid = 0xU,
>.other = { 0 } },
>  },
>  .type = NFS4_INVALID_STATEID_TYPE,
> };
> 
> If I keep data[4] where it is now I get compiler error
> 
> an.c:35:20: error: field name not in record or union initializer
> {.seqid = 0xU,
>  ^
> an.c:35:20: note: (near initialization for 
> 'invalid_stateid..data')
> an.c:35:29: warning: overflow in implicit constant conversion [-
> Woverflow]
> {.seqid = 0xU,
>   ^~~
> an.c:36:19: error: field name not in record or union initializer
> .other = { 0 } },
> ^
> an.c:36:19: note: (near initialization for 
> 'invalid_stateid..data')
> an.c:36:19: warning: braces around scalar initializer
> an.c:36:19: note: (near initialization for 
> 'invalid_stateid..data[1]')
> 
> I don't know if you want to change public header file just to get
> around 
> this problem.

Sigh OK, how about something like the following then:

{ .data = { 0xff, 0xff, 0xff, 0xff, 0 }, }

-- 
Trond Myklebust
Linux NFS client maintainer, PrimaryData
trond.mykleb...@primarydata.com


Re: Commit fcd8843c40 breaks old compilers

2017-11-18 Thread Boris Ostrovsky



On 11/18/2017 12:39 PM, Trond Myklebust wrote:

On Sat, 2017-11-18 at 12:19 -0500, Boris Ostrovsky wrote:

Commit fcd8843c406b46433857ae45e5e9d84b01a7d20b breaks on older
compilers which cannot process initializers for anonymous structures:

+const nfs4_stateid invalid_stateid = {
+   {
+   .seqid = cpu_to_be32(0xU),
+   .other = { 0 },
+   },
+   .type = NFS4_INVALID_STATEID_TYPE,
+};


/home/build/linux-linus/fs/nfs/nfs4state.c:74: error: unknown field
‘seqid’ specified in initializer
/home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: missing
braces
around initializer
/home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: (near
initialization for ‘invalid_stateid..data’)
/home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: overflow in
implicit constant conversion
/home/build/linux-linus/fs/nfs/nfs4state.c:75: error: unknown field
‘other’ specified in initializer
/home/build/linux-linus/fs/nfs/nfs4state.c:75: error: extra brace
group
at end of initializer
/home/build/linux-linus/fs/nfs/nfs4state.c:75: error: (near
initialization for ‘invalid_stateid.’)
/home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: excess
elements
in union initializer
/home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: (near
initialization for ‘invalid_stateid.’)
make[4]: *** [fs/nfs/nfs4state.o] Error 1
make[3]: *** [fs/nfs] Error 2


FC-64  gcc --version
gcc (GCC) 4.4.4 20100503 (Red Hat 4.4.4-2)


A similar bug was fixed by e0714ec4f9efe7b86828b0dcc077fd8f5d8e5e91
but
I don't think the same approach can work here.



I don't have any setups with gcc 4.4.4. What is it expecting here? Is
it expecting an extra set of braces due to the anonymous "struct"?



No, that won't work (at least I couldn't get it to work) because the 
solution from e0714ec4f9e assumes that the anonymous struct is the first 
one in the enveloping struct.


It worked only if I (this is a small C program with equivalent structs):

struct nfs4_stateid_struct {
union {
//char data[4];
struct {
unsigned seqid;
char other[6];
} __attribute__ ((packed));
char data[4];
};
and then

const nfs4_stateid invalid_stateid = {
{
  {.seqid = 0xU,
  .other = { 0 } },
},
.type = NFS4_INVALID_STATEID_TYPE,
};

If I keep data[4] where it is now I get compiler error

an.c:35:20: error: field name not in record or union initializer
   {.seqid = 0xU,
^
an.c:35:20: note: (near initialization for 
'invalid_stateid..data')

an.c:35:29: warning: overflow in implicit constant conversion [-Woverflow]
   {.seqid = 0xU,
 ^~~
an.c:36:19: error: field name not in record or union initializer
   .other = { 0 } },
   ^
an.c:36:19: note: (near initialization for 
'invalid_stateid..data')

an.c:36:19: warning: braces around scalar initializer
an.c:36:19: note: (near initialization for 
'invalid_stateid..data[1]')


I don't know if you want to change public header file just to get around 
this problem.



-boris


RFC: Copying Device Tree File into reserved area of VMLINUX before deployment

2017-11-18 Thread Ulf Samuelsson
I noticed when checking out the OpenWRT support for the board that they 
have a method to avoid having to pass the device tree address to the 
kernel, and can thus boot device tree based kernels with U-boots that

does not support device trees.

Is this something that would be considered useful for including in 
mainstream:


BACKGROUND:
Trying to load a yocto kernel into a MIPS target (MT7620A based),
and the U-Boot is more than stupid.
Does not support the "run" command as an example.
They modified the U-Boot MAGIC Word to complicate things.
The U-Boot is not configured to use device tree files.
The board runs a 2.6 kernel right now.

Several attempts by me a and others to rebuild U-Boot according to the 
H/W vendors source code and build instructions results in a bricked 
unit. Bricked units cannot be recovered.


Not my choice of H/W, so I cannot change it.


===
OPENWRT:
I noticed when checking out the OpenWRT support for the board that they 
have a method to avoid having to pass the device tree address to the 
kernel, and can thus boot device tree based kernels with U-boots that

does not support device trees.

What they do is to reserve 16 kB of kernel space, and tag it with an 
ASCII string "OWRTDTB:".
After the kernel and dtb is built, a utility "patch-dtb" will update the 
vmlinux binary, copying in the device tree file.


===
It would be useful to me, and I could of course patch the mainstream 
kernel, but first I would like to check if this is of interest for 
mainstream.


I envisage the support would look something like:


Kconfig.
config MIPS
select  HAVE_IMAGE_DTB

config  HAVE_IMAGE_DTB
bool

if HAVE_IMAGE_DTB
config  IMAGE_DTB
bool"Allocated space for DTB within image

config  DTB_SIZE
int "DTB space (kB)

config  DTB_TAG
string  "DTB space tag"
default "OWRTDTB:"
endif


Some Makefile
obj-$(CONFIG_INCLUDE_DTB) += image_dtb.o


image_dtb.S:
.text
.align  5
.ascii  CONFIG_DTB_TAG
EXPORT(__image_dtb)
.fill   DTB_SIZE * 1024

===
arch/mips/xxx/of.c:

#if defined(CONFIG_IMAGE_DTB)
if ()
__dt_setup_arch(__dtb_start);
else
__dt_setup_arch(&__image_dtb);
#else
__dt_setup_arch(__dtb_start);
#endif

I imagine that if the support is enabled for a target, it should
be possible to override it with a CMDLINE argument


They do something similar for the CMDLINE; copying it into the vmlinux, 
to allow a smaller boot




--
Best Regards
Ulf Samuelsson


Re: [PATCH v18 5/6] vfio: ABI for mdev display dma-buf operation

2017-11-18 Thread Kirti Wankhede
Extremely sorry for the delay.
This works for VFIO_GFX_PLANE_TYPE_REGION. Tested with local changes.

Reviewed-by: Kirti Wankhede 

Thanks,
Kirti

On 11/18/2017 9:00 PM, Alex Williamson wrote:
> 
> Kirti?
> 
> On Wed, 15 Nov 2017 21:11:42 -0700
> Alex Williamson  wrote:
> 
>> On Thu, 16 Nov 2017 11:21:56 +0800
>> Zhenyu Wang  wrote:
>>
>>> On 2017.11.15 11:48:42 -0700, Alex Williamson wrote:  
 On Wed, 15 Nov 2017 17:11:54 +0800
 Tina Zhang  wrote:
 
> Add VFIO_DEVICE_QUERY_GFX_PLANE ioctl command to let user query and get
> a plane and its information. So far, two types of buffers are supported:
> buffers based on dma-buf and buffers based on region.
>
> This ioctl can be invoked with:
> 1) Either DMABUF or REGION flag. Vendor driver returns a plane_info
> successfully only when the specific kind of buffer is supported.
> 2) Flag PROBE. And at the same time either DMABUF or REGION must be set,
> so that vendor driver returns success only when the specific kind of
> buffer is supported.
>
> Add VFIO_DEVICE_GET_GFX_DMABUF ioctl command to let user get a specific
> dma-buf fd of an exposed MDEV buffer provided by dmabuf_id which was
> returned in VFIO_DEVICE_QUERY_GFX_PLANE ioctl command.
>
> The life cycle of an exposed MDEV buffer is handled by userspace and
> tracked by kernel space. The returned dmabuf_id in struct vfio_device_
> query_gfx_plane can be a new id of a new exposed buffer or an old id of
> a re-exported buffer. Host user can check the value of dmabuf_id to see
> if it needs to create new resources according to the new exposed buffer
> or just re-use the existing resource related to the old buffer.
>
> v18:
> - update comments for VFIO_DEVICE_GET_GFX_DMABUF. (Alex)
>
> v17:
> - modify VFIO_DEVICE_GET_GFX_DMABUF interface. (Alex)
>
> v16:
> - add x_hot and y_hot fields. (Gerd)
> - add comments for VFIO_DEVICE_GET_GFX_DMABUF. (Alex)
> - rebase to 4.14.0-rc6.
>
> v15:
> - add a ioctl to get a dmabuf for a given dmabuf id. (Gerd)
>
> v14:
> - add PROBE, DMABUF and REGION flags. (Alex)
>
> v12:
> - add drm_format_mod back. (Gerd and Zhenyu)
> - add region_index. (Gerd)
>
> v11:
> - rename plane_type to drm_plane_type. (Gerd)
> - move fields of vfio_device_query_gfx_plane to 
> vfio_device_gfx_plane_info.
>   (Gerd)
> - remove drm_format_mod, start fields. (Daniel)
> - remove plane_id.
>
> v10:
> - refine the ABI API VFIO_DEVICE_QUERY_GFX_PLANE. (Alex) (Gerd)
>
> v3:
> - add a field gvt_plane_info in the drm_i915_gem_obj structure to save
>   the decoded plane information to avoid look up while need the plane
>   info. (Gerd)
>
> Signed-off-by: Tina Zhang 
> Cc: Gerd Hoffmann 
> Cc: Alex Williamson 
> Cc: Daniel Vetter 
> ---
>  include/uapi/linux/vfio.h | 62 
> +++
>  1 file changed, 62 insertions(+)
>
> diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
> index ae46105..5c1cca2 100644
> --- a/include/uapi/linux/vfio.h
> +++ b/include/uapi/linux/vfio.h
> @@ -502,6 +502,68 @@ struct vfio_pci_hot_reset {
>  
>  #define VFIO_DEVICE_PCI_HOT_RESET_IO(VFIO_TYPE, VFIO_BASE + 13)
>  
> +/**
> + * VFIO_DEVICE_QUERY_GFX_PLANE - _IOW(VFIO_TYPE, VFIO_BASE + 14,
> + *struct vfio_device_query_gfx_plane)
> + *
> + * Set the drm_plane_type and flags, then retrieve the gfx plane info.
> + *
> + * flags supported:
> + * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_DMABUF are set
> + *   to ask if the mdev supports dma-buf. 0 on support, -EINVAL on no
> + *   support for dma-buf.
> + * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_REGION are set
> + *   to ask if the mdev supports region. 0 on support, -EINVAL on no
> + *   support for region.
> + * - VFIO_GFX_PLANE_TYPE_DMABUF or VFIO_GFX_PLANE_TYPE_REGION is set
> + *   with each call to query the plane info.
> + * - Others are invalid and return -EINVAL.
> + *
> + * Note:
> + * 1. Plane could be disabled by guest. In that case, success will be
> + *returned with zero-initialized drm_format, size, width and height
> + *fields.
> + * 2. x_hot/y_hot is set to 0x if no hotspot information 
> available
> + *
> + * Return: 0 on success, -errno on other failure.
> + */
> +struct vfio_device_gfx_plane_info {
> + __u32 argsz;
> + __u32 flags;
> +#define VFIO_GFX_PLANE_TYPE_PROBE (1 << 0)
> +#define VFIO_GFX_PLANE_TYPE_DMABUF (1 << 1)
> +#define VFIO_GFX_PLANE_TYPE_REGION (1 << 2)
> + /* in */
> + __u32 drm_plane_type;   /* type of plane: DRM_PLANE_TYPE_* */
> + /* out */
> + __u32 drm_f

[PATCH] Staging: comedi: adl_pci9118.c : fixed code style issue

2017-11-18 Thread Fabian Baumanis
Removed uneccessary parantheses which were sorrounding two
if-statements.

Signed-off-by: Fabian Baumanis 
---
 drivers/staging/comedi/drivers/adl_pci9118.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
b/drivers/staging/comedi/drivers/adl_pci9118.c
index 1cc9b7e..c77b994 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -946,8 +946,7 @@ static int pci9118_ai_cmd(struct comedi_device *dev, struct 
comedi_subdevice *s)
    devpriv->ai_add_back = 0;
    if (devpriv->master) {
    devpriv->usedma = 1;
-   if ((cmd->flags & CMDF_WAKE_EOS) &&
-   (cmd->scan_end_arg == 1)) {
+   if (cmd->flags & CMDF_WAKE_EOS && cmd->scan_end_arg == 1) {
    if (cmd->convert_src == TRIG_NOW)
    devpriv->ai_add_back = 1;
    if (cmd->convert_src == TRIG_TIMER) {
-- 
2.7.4



Re: Commit fcd8843c40 breaks old compilers

2017-11-18 Thread Trond Myklebust
On Sat, 2017-11-18 at 12:19 -0500, Boris Ostrovsky wrote:
> Commit fcd8843c406b46433857ae45e5e9d84b01a7d20b breaks on older
> compilers which cannot process initializers for anonymous structures:
> 
> +const nfs4_stateid invalid_stateid = {
> +   {
> +   .seqid = cpu_to_be32(0xU),
> +   .other = { 0 },
> +   },
> +   .type = NFS4_INVALID_STATEID_TYPE,
> +};
> 
> 
> /home/build/linux-linus/fs/nfs/nfs4state.c:74: error: unknown field
> ‘seqid’ specified in initializer
> /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: missing
> braces
> around initializer
> /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: (near
> initialization for ‘invalid_stateid..data’)
> /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: overflow in
> implicit constant conversion
> /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: unknown field
> ‘other’ specified in initializer
> /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: extra brace
> group
> at end of initializer
> /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: (near
> initialization for ‘invalid_stateid.’)
> /home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: excess
> elements
> in union initializer
> /home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: (near
> initialization for ‘invalid_stateid.’)
> make[4]: *** [fs/nfs/nfs4state.o] Error 1
> make[3]: *** [fs/nfs] Error 2
> 
> 
> FC-64  gcc --version
> gcc (GCC) 4.4.4 20100503 (Red Hat 4.4.4-2)
> 
> 
> A similar bug was fixed by e0714ec4f9efe7b86828b0dcc077fd8f5d8e5e91
> but
> I don't think the same approach can work here.


I don't have any setups with gcc 4.4.4. What is it expecting here? Is
it expecting an extra set of braces due to the anonymous "struct"?

-- 
Trond Myklebust
Linux NFS client maintainer, PrimaryData
trond.mykleb...@primarydata.com


Commit fcd8843c40 breaks old compilers

2017-11-18 Thread Boris Ostrovsky
Commit fcd8843c406b46433857ae45e5e9d84b01a7d20b breaks on older
compilers which cannot process initializers for anonymous structures:

+const nfs4_stateid invalid_stateid = {
+   {
+   .seqid = cpu_to_be32(0xU),
+   .other = { 0 },
+   },
+   .type = NFS4_INVALID_STATEID_TYPE,
+};


/home/build/linux-linus/fs/nfs/nfs4state.c:74: error: unknown field
‘seqid’ specified in initializer
/home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: missing braces
around initializer
/home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: (near
initialization for ‘invalid_stateid..data’)
/home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: overflow in
implicit constant conversion
/home/build/linux-linus/fs/nfs/nfs4state.c:75: error: unknown field
‘other’ specified in initializer
/home/build/linux-linus/fs/nfs/nfs4state.c:75: error: extra brace group
at end of initializer
/home/build/linux-linus/fs/nfs/nfs4state.c:75: error: (near
initialization for ‘invalid_stateid.’)
/home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: excess elements
in union initializer
/home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: (near
initialization for ‘invalid_stateid.’)
make[4]: *** [fs/nfs/nfs4state.o] Error 1
make[3]: *** [fs/nfs] Error 2


FC-64  gcc --version
gcc (GCC) 4.4.4 20100503 (Red Hat 4.4.4-2)


A similar bug was fixed by e0714ec4f9efe7b86828b0dcc077fd8f5d8e5e91 but
I don't think the same approach can work here.


-boris


Re: [RFC PATCH 7/7] ASoC: Intel: boards: align/fix SKL/BXT/KBL Kconfigs

2017-11-18 Thread Andy Shevchenko
On Fri, 2017-11-17 at 18:02 -0600, Pierre-Louis Bossart wrote:
> No reason why SND_SOC_INTEL_SST should be set here.
> Also make sure same dependencies are used everywhere (only last one
> has SPI
> in addition)

Regarding to my comment against previous patch...

>  config SND_SOC_INTEL_SKL_RT286_MACH
>   tristate "ASoC Audio driver for SKL with RT286 I2S mode"
> - depends on X86 && ACPI && I2C
> + depends on X86_INTEL_LPSS && I2C && ACPI

Skylake -> No.

>  config SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH
>   tristate "ASoC Audio driver for SKL with NAU88L25 and SSM4567
> in I2S Mode"
> - depends on X86_INTEL_LPSS && I2C
> + depends on X86_INTEL_LPSS && I2C && ACPI

Skylake -> No.

>  config SND_SOC_INTEL_SKL_NAU88L25_MAX98357A_MACH
>   tristate "ASoC Audio driver for SKL with NAU88L25 and
> MAX98357A in I2S Mode"
> - depends on X86_INTEL_LPSS && I2C
> + depends on X86_INTEL_LPSS && I2C && ACPI

Skylake -> No.
 
>  config SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH
>   tristate "ASoC Audio driver for Broxton with DA7219 and
> MAX98357A in I2S Mode"
> - depends on X86 && ACPI && I2C
> + depends on X86_INTEL_LPSS && I2C && ACPI

Broxton -> No.

>  config SND_SOC_INTEL_BXT_RT298_MACH
>   tristate "ASoC Audio driver for Broxton with RT298 I2S mode"
> - depends on X86 && ACPI && I2C
> + depends on X86_INTEL_LPSS && I2C && ACPI

Broxton -> No.

>  config SND_SOC_INTEL_KBL_RT5663_MAX98927_MACH
>   tristate "ASoC Audio driver for KBL with RT5663 and MAX98927
> in I2S Mode"
> - depends on X86_INTEL_LPSS && I2C
> - select SND_SOC_INTEL_SST
> + depends on X86_INTEL_LPSS && I2C && ACPI

Kabylake -> No.
 
>  config SND_SOC_INTEL_KBL_RT5663_RT5514_MAX98927_MACH
>  tristate "ASoC Audio driver for KBL with RT5663, RT5514 and
> MAX98927 in I2S Mode"
> -depends on X86_INTEL_LPSS && I2C && SPI
> -select SND_SOC_INTEL_SST
> +depends on X86_INTEL_LPSS && I2C && SPI && ACPI

Kabylake -> No.

This patch WRT X86_INTEL_LPSS for selected SoCs does not make any sense.


Perhaps you need to depend on

MFD_INTEL_LPSS (Skylake and newer)

instead.

-- 
Andy Shevchenko 
Intel Finland Oy


Re: [RFC PATCH 6/7] ASoC: Intel: boards: align Kconfig configurations for HiFi2

2017-11-18 Thread Andy Shevchenko
On Fri, 2017-11-17 at 18:02 -0600, Pierre-Louis Bossart wrote:
> Make sure all the configs are aligned
> Also add the missing dependencies on SOC_ACPI stuff used to fix
> DAI names based on HID.
> 

> FIXME: not sure why X86_INTEL_LPSS is needed in a machine
> driver config, should it be back to X86 everywhere?
> 

X86_INTEL_LPSS makes sense only for Haswell, Broadwell, BayTrail and
CherryTrail (more precisely for PCH inside those SoCs).

Basically it enables few peripheral drivers in case they are enumerated
via ACPI (SPI, I2C, UART, PWM, SDHCI) on SoCs listed above.

Hope this would help how to deal with the option in ASoC case.

-- 
Andy Shevchenko 
Intel Finland Oy


Re: [RFC PATCH 2/7] ASoC: Intel: Kconfig: Simplify-clarify ACPI/PCI dependencies

2017-11-18 Thread Shevchenko, Andriy
On Sat, 2017-11-18 at 18:53 +0200, Andy Shevchenko wrote:
> On Fri, 2017-11-17 at 18:01 -0600, Pierre-Louis Bossart wrote:
> > PCI/ACPI selections should not happen in Kconfig for machine
> > drivers,
> > move to SOC selections.
> > 
> > Add distinction between PCI and ACPI HiFi2 platforms.
> 
> 
> >  The PCI-based
> > platforms may be removed at some point since Medfield is not really
> > supported by anyone
> 
> This is rather true,
> 
> >  and there is no publicly available firmware for
> > Merrifield.
> 
> while this is not true. Intel Edison board is based on Merrifield SoC

s/SoC/platform/

> and I'm sure people are able to make a sound out of it.
> 

-- 
Andy Shevchenko 
Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo

Re: [RFC PATCH 2/7] ASoC: Intel: Kconfig: Simplify-clarify ACPI/PCI dependencies

2017-11-18 Thread Andy Shevchenko
On Fri, 2017-11-17 at 18:01 -0600, Pierre-Louis Bossart wrote:
> PCI/ACPI selections should not happen in Kconfig for machine drivers,
> move to SOC selections.
> 
> Add distinction between PCI and ACPI HiFi2 platforms.


>  The PCI-based
> platforms may be removed at some point since Medfield is not really
> supported by anyone

This is rather true,

>  and there is no publicly available firmware for
> Merrifield.

while this is not true. Intel Edison board is based on Merrifield SoC
and I'm sure people are able to make a sound out of it.

-- 
Andy Shevchenko 
Intel Finland Oy


Re: [RFC PATCH 1/7] ASoC: Intel: Fix Kconfig

2017-11-18 Thread Takashi Iwai
On Sat, 18 Nov 2017 01:01:56 +0100,
Pierre-Louis Bossart wrote:
> 
> +if SND_SOC_INTEL_BAYTRAIL
>  
>  config SND_SOC_INTEL_BYT_MAX98090_MACH
>   tristate "ASoC Audio driver for Intel Baytrail with MAX98090 codec"
> + default n

default=n is superfluous, can be dropped.

>   depends on X86_INTEL_LPSS && I2C
> - depends on SND_SST_IPC_ACPI = n
> - depends on SND_SOC_INTEL_BAYTRAIL
>   select SND_SOC_MAX98090

So the dependency on ND_SST_IPC_ACPI=n is removed here too, and I
guess this will allow this machine driver built although it shouldn't
be?


thanks,

Takashi


Re: [PATCH v2] iio: mma8452: replace license description with SPDX specifier

2017-11-18 Thread Philippe Ombredanne
On Sat, Nov 18, 2017 at 4:53 PM, Jonathan Cameron  wrote:
> On Sat, 18 Nov 2017 10:10:11 +0100
> Martin Kepplinger  wrote:
>
>> This replaces the custom license information text with the appropriate
>> SPDX identifier. While the information here stays the same, it is easier
>> to read.
>>
>> Signed-off-by: Martin Kepplinger 
>> Acked-by: Peter Meerwald-Stadler 
>
> I'm not 100% sure the intent of the SPDX work is to remove
> existing licence text.  So far the big sets have only been
> adding tags to files missing their licenses entirely...
>
> Anyone found any specific guidance on this?

Jonathan:
you might want to check the doc patches from tglx [1] as well as
several related patches from greg k-h such as these  [2] and his
initial pull [3]

To get a lot of details you can check all the recent SPDX-related posts too [4]

[1] https://marc.info/?l=linux-kernel&m=151051532322831&w=2
[2] https://marc.info/?l=linux-kernel&m=151068111802610&w=2
[3] https://marc.info/?l=linux-kernel&m=150963579219623&w=2
[4] https://marc.info/?l=linux-kernel&w=2&r=1&s=spdx&q=b
-- 
Cordially
Philippe Ombredanne


[PATCH] staging: comedi: ni_atmio: fix license warning.

2017-11-18 Thread Matthew Giassa
Resolving license check warning for drivers/staging/comedi. Added the
license definitions present in the rest of the module and made sure it's
aligned with the license (GPL) in the comments for the affected file
(ni_atmio.c). Original warning:

WARNING: modpost: missing MODULE_LICENSE() in 
drivers/staging/comedi//drivers/ni_atmio.o
see include/linux/module.h for more information.

No longer present after change.

Signed-off-by: Matthew Giassa 
---
 drivers/staging/comedi/drivers/ni_atmio.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/staging/comedi/drivers/ni_atmio.c 
b/drivers/staging/comedi/drivers/ni_atmio.c
index 2d62a8c..ae6ed96 100644
--- a/drivers/staging/comedi/drivers/ni_atmio.c
+++ b/drivers/staging/comedi/drivers/ni_atmio.c
@@ -361,3 +361,8 @@ static struct comedi_driver ni_atmio_driver = {
.detach = ni_atmio_detach,
 };
 module_comedi_driver(ni_atmio_driver);
+
+MODULE_AUTHOR("Comedi http://www.comedi.org";);
+MODULE_DESCRIPTION("Comedi low-level driver");
+MODULE_LICENSE("GPL");
+
-- 
2.7.4



Re: [v4,3/3] hwmon: (w83773g) Add documentation

2017-11-18 Thread Guenter Roeck
On Mon, Nov 13, 2017 at 11:27:34AM +0800, Lei YU wrote:
> Add documentation for the w83773g driver.
> 
> Signed-off-by: Lei YU 

Applied to hwmon-next.

Thanks,
Guenter


Re: [v4,2/3] drivers: hwmon: Add W83773G driver

2017-11-18 Thread Guenter Roeck
On Mon, Nov 13, 2017 at 11:27:33AM +0800, Lei YU wrote:
> Nuvoton W83773G is a hardware monitor IC providing one local
> temperature and two remote temperature sensors.
> 
> Signed-off-by: Lei YU 

Applied to hwmon-next.

Thanks,
Guenter

> ---
> v2:
>  - Rewrite the driver using regmap
>  - Add offset and update_interval
> v3:
>  - Use devm_hwmon_device_register_with_info() with is_visible/read/write
>functions.
> v4:
>  - Fix review comments.
> ---
>  drivers/hwmon/Kconfig   |  10 ++
>  drivers/hwmon/Makefile  |   1 +
>  drivers/hwmon/w83773g.c | 329 
> 
>  3 files changed, 340 insertions(+)
>  create mode 100644 drivers/hwmon/w83773g.c
> 
> diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
> index d654314..11c6248 100644
> --- a/drivers/hwmon/Kconfig
> +++ b/drivers/hwmon/Kconfig
> @@ -1710,6 +1710,16 @@ config SENSORS_VT8231
> This driver can also be built as a module.  If so, the module
> will be called vt8231.
>  
> +config SENSORS_W83773G
> + tristate "Nuvoton W83773G"
> + depends on I2C
> + help
> +   If you say yes here you get support for the Nuvoton W83773G hardware
> +   monitoring chip.
> +
> +   This driver can also be built as a module.  If so, the module
> +   will be called w83773g.
> +
>  config SENSORS_W83781D
>   tristate "Winbond W83781D, W83782D, W83783S, Asus AS99127F"
>   depends on I2C
> diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
> index c84d978..0649ad8 100644
> --- a/drivers/hwmon/Makefile
> +++ b/drivers/hwmon/Makefile
> @@ -13,6 +13,7 @@ obj-$(CONFIG_SENSORS_ATK0110)   += asus_atk0110.o
>  # asb100, then w83781d go first, as they can override other drivers' 
> addresses.
>  obj-$(CONFIG_SENSORS_ASB100) += asb100.o
>  obj-$(CONFIG_SENSORS_W83627HF)   += w83627hf.o
> +obj-$(CONFIG_SENSORS_W83773G)+= w83773g.o
>  obj-$(CONFIG_SENSORS_W83792D)+= w83792d.o
>  obj-$(CONFIG_SENSORS_W83793) += w83793.o
>  obj-$(CONFIG_SENSORS_W83795) += w83795.o
> diff --git a/drivers/hwmon/w83773g.c b/drivers/hwmon/w83773g.c
> new file mode 100644
> index 000..0b97c28
> --- /dev/null
> +++ b/drivers/hwmon/w83773g.c
> @@ -0,0 +1,329 @@
> +/*
> + * Copyright (C) 2017 IBM Corp.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * Driver for the Nuvoton W83773G SMBus temperature sensor IC.
> + * Supported models: W83773G
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/* W83773 has 3 channels */
> +#define W83773_CHANNELS  3
> +
> +/* The W83773 registers */
> +#define W83773_CONVERSION_RATE_REG_READ  0x04
> +#define W83773_CONVERSION_RATE_REG_WRITE 0x0A
> +#define W83773_MANUFACTURER_ID_REG   0xFE
> +#define W83773_LOCAL_TEMP0x00
> +
> +static const u8 W83773_STATUS[2] = { 0x02, 0x17 };
> +
> +static const u8 W83773_TEMP_LSB[2] = { 0x10, 0x25 };
> +static const u8 W83773_TEMP_MSB[2] = { 0x01, 0x24 };
> +
> +static const u8 W83773_OFFSET_LSB[2] = { 0x12, 0x16 };
> +static const u8 W83773_OFFSET_MSB[2] = { 0x11, 0x15 };
> +
> +/* this is the number of sensors in the device */
> +static const struct i2c_device_id w83773_id[] = {
> + { "w83773g" },
> + { }
> +};
> +
> +MODULE_DEVICE_TABLE(i2c, w83773_id);
> +
> +static const struct of_device_id w83773_of_match[] = {
> + {
> + .compatible = "nuvoton,w83773g"
> + },
> + { },
> +};
> +MODULE_DEVICE_TABLE(of, w83773_of_match);
> +
> +static inline long temp_of_local(s8 reg)
> +{
> + return reg * 1000;
> +}
> +
> +static inline long temp_of_remote(s8 hb, u8 lb)
> +{
> + return (hb << 3 | lb >> 5) * 125;
> +}
> +
> +static int get_local_temp(struct regmap *regmap, long *val)
> +{
> + unsigned int regval;
> + int ret;
> +
> + ret = regmap_read(regmap, W83773_LOCAL_TEMP, ®val);
> + if (ret < 0)
> + return ret;
> +
> + *val = temp_of_local(regval);
> + return 0;
> +}
> +
> +static int get_remote_temp(struct regmap *regmap, int index, long *val)
> +{
> + unsigned int regval_high;
> + unsigned int regval_low;
> + int ret;
> +
> + ret = regmap_read(regmap, W83773_TEMP_MSB[index], ®val_high);
> + if (ret < 0)
> + return ret;
> +
> + ret = regmap_read(regmap, W83773_TEMP_LSB[index], ®val_low);
> + if (ret < 0)
> + return ret;
> +
> + *val = temp_of_remote(regval_high, regval_low);
> + return 0;
> +}
> +
> +static int get_fault(struct regmap *regmap, int index, long *val)
> +{
> + unsigned int regval;
> + int ret;
> +
> + ret = regmap_read(regmap, W83773_STATUS[index], ®val);
> + if (ret < 0)
> +

Re: [PATCH v3 3/4] iio: adc: at91-sama5d2_adc: add support for DMA

2017-11-18 Thread Jonathan Cameron
On Wed, 15 Nov 2017 14:56:47 +0200
Eugen Hristev  wrote:

> Added support for DMA transfers. The implementation uses the user watermark
> to decide whether DMA will be used or not. For watermark 1, DMA will not be
> used. If watermark is bigger, DMA will be used.
> Sysfs attributes are created to indicate whether the DMA is used,
> with hwfifo_enabled, and the current DMA watermark is readable
> in hwfifo_watermark. Minimum and maximum values are in hwfifo_watermark_min
> and hwfifo_watermark_max.
> 
> Signed-off-by: Eugen Hristev 
A tiny nitpick inline but otherwise looks fine to me.

Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.

Thanks,

Jonathan
> ---
>  Changes in v3:
>  - Remove misleaded dev_info message when DMA was not enabled at probe
>  - Rebased patch on top of the
> [PATCH] iio: adc: at91-sama5d2_adc: fix probe error on missing trigger 
> property
> Which is already upstreamed in 4.14
>  - Fixed the bug introduced in v2, with buffer size
>  - added extra check when enabling DMA, to have hw trigger present.
> This is because now, we can have the driver with software trigger only (if no
> hw trigger in device tree, start as software only)
> 
>  Changes in v2:
>  - No longer add last timestamp to all samples. Now, compute an interval
> between samples w.r.t. start and end time of the transfer and number
> of samples. Then distribute them each in the time interval.
>  - Add warning for conversion overrun. This helps user identify cases
> when the watermark needs adjustment : the software is too slow in reading
> data from the ADC.
>  - Protection around watermark is not needed, changing of the watermark
> cannot be done while the buffer is enabled. When buffer is disabled, all
> DMA resources are freed anyway.
>  - Added validation on trigger to be used by own device
>  - Best sample rate I could obtain using the low frequency clock was about
> 4k samples/second, with a watermark of 100. To get up to 50k samples/second
> the ADC frequency must be increased to max.
>  - Fixed computation of DMA buffer size
>  - Addressed other comments from mailing list review. Feedback is appreciated
> 
>  drivers/iio/adc/Kconfig|   1 +
>  drivers/iio/adc/at91-sama5d2_adc.c | 453 
> +++--
>  2 files changed, 434 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
> index 1d13bf0..1a3a8e3 100644
> --- a/drivers/iio/adc/Kconfig
> +++ b/drivers/iio/adc/Kconfig
> @@ -158,6 +158,7 @@ config AT91_SAMA5D2_ADC
>   tristate "Atmel AT91 SAMA5D2 ADC"
>   depends on ARCH_AT91 || COMPILE_TEST
>   depends on HAS_IOMEM
> + depends on HAS_DMA
>   select IIO_TRIGGERED_BUFFER
>   help
> Say yes here to build support for Atmel SAMA5D2 ADC which is
> diff --git a/drivers/iio/adc/at91-sama5d2_adc.c 
> b/drivers/iio/adc/at91-sama5d2_adc.c
> index a70ef7f..11d34a8 100644
> --- a/drivers/iio/adc/at91-sama5d2_adc.c
> +++ b/drivers/iio/adc/at91-sama5d2_adc.c
> @@ -16,6 +16,8 @@
>  
>  #include 
>  #include 
> +#include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -100,6 +102,8 @@
>  #define AT91_SAMA5D2_LCDR0x20
>  /* Interrupt Enable Register */
>  #define AT91_SAMA5D2_IER 0x24
> +/* Interrupt Enable Register - general overrun error */
> +#define AT91_SAMA5D2_IER_GOVRE BIT(25)
>  /* Interrupt Disable Register */
>  #define AT91_SAMA5D2_IDR 0x28
>  /* Interrupt Mask Register */
> @@ -167,13 +171,19 @@
>  
>  /*
>   * Maximum number of bytes to hold conversion from all channels
> - * plus the timestamp
> + * without the timestamp.
>   */
> -#define AT91_BUFFER_MAX_BYTES ((AT91_SAMA5D2_SINGLE_CHAN_CNT +   
> \
> - AT91_SAMA5D2_DIFF_CHAN_CNT) * 2 + 8)
> +#define AT91_BUFFER_MAX_CONVERSION_BYTES ((AT91_SAMA5D2_SINGLE_CHAN_CNT + \
> +  AT91_SAMA5D2_DIFF_CHAN_CNT) * 2)
> +
> +/* This total must also include the timestamp */
> +#define AT91_BUFFER_MAX_BYTES (AT91_BUFFER_MAX_CONVERSION_BYTES + 8)
>  
>  #define AT91_BUFFER_MAX_HWORDS (AT91_BUFFER_MAX_BYTES / 2)
>  
> +#define AT91_HWFIFO_MAX_SIZE_STR "128"
> +#define AT91_HWFIFO_MAX_SIZE 128
> +
>  #define AT91_SAMA5D2_CHAN_SINGLE(num, addr)  \
>   {   \
>   .type = IIO_VOLTAGE,\
> @@ -228,6 +238,28 @@ struct at91_adc_trigger {
>   boolhw_trig;
>  };
>  
> +/**
> + * at91_adc_dma - at91-sama5d2 dma information struct
> + * @dma_chan:the dma channel acquired
> + * @rx_buf:  dma coherent allocated area
> + * @rx_dma_buf:  dma handler for the buffer
> + * @phys_addr:   physical address of the ADC base register
> + * @buf_idx: index inside the dma buffer where reading was last done
> + * @rx_b

Re: [PATCH v3 1/4] dt-bindings: iio: at91-sama5d2_adc: add optional dma property

2017-11-18 Thread Jonathan Cameron
On Wed, 15 Nov 2017 09:27:46 -0600
Rob Herring  wrote:

> On Wed, Nov 15, 2017 at 02:56:45PM +0200, Eugen Hristev wrote:
> > Added property for DMA configuration of the device.
> > 
> > Signed-off-by: Eugen Hristev 
> > ---
> >  Changes in v3:
> > None, but we discussed on the ML about whether we should have "dma-names"
> > present in the binding even if it's only one.
> > The helpers in the kernel to retrieve the channel info rely on the
> > presence of this property, so I am resending the patch based on this.
> > If another solution is better, please advise and I can try it and
> > resend the patch.  
> 
> Really the kernel APIs should accept a NULL name and return the DMA 
> channel when there is only one. This is how the clk_get API works for 
> example.
> 
> >  Documentation/devicetree/bindings/iio/adc/at91-sama5d2_adc.txt | 7 +++
> >  1 file changed, 7 insertions(+)  
> 
> In any case, not really a big deal.
> 
> Acked-by: Rob Herring 
Applied to the togreg branch of iio.git and pushed out as testing.

Thanks,

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



Re: A test of the philosophical impact.. Behaviour problems of "Gnu-Zealots" = Illegal Unix Rip.

2017-11-18 Thread Ywe Cærlyn

Den 11/12/2017 11:53, skrev Ywe Cærlyn:

Den 11/9/2017 11:55, skrev Ywe Cærlyn:

Den 11/6/2017 19:13, skrev Ywe Cærlyn:

Den 11/6/2017 11:00, skrev Ywe Cærlyn:

Den 11/4/2017 23:53, skrev Ywe Cærlyn:

Den 11/3/2017 07:46, skrev Ywe Cærlyn:

Den 10/29/2017 17:21, skrev Ywe Cærlyn:

Den 10/29/2017 17:00, skrev Ywe Cærlyn:

Den 10/27/2017 23:28, skrev Ywe Cærlyn:

Den 10/27/2017 23:01, skrev Ywe Cærlyn:
Philosophical requantization of a (atm) theoretical linux 
distribution:


Excellent Ubuntu, is a Good Linux, with a Minimal Jitter Kernel.
An Available Source Operating System.
Philosophical Lead: Ywe Cærlyn.

Desktop Flavour: Customized Gnome

Finetuned for fast reponsiveness, and smoothness in 
operation. Configuration of Kernel, for favoring short 
buffers, lowest latency, minimal jitter, minimal wasted CPU, 
max cpu utilization.


Perfect scaling, from desktop to supercomputing.

Redefined Internet, with the finest philosophy, and correct 
attitude.


Call 999-Excellence for a trial CD... No that we don´t have 
yet, but how does it sound?


Peace,
Ywe Cærlyn.


I have made a good logo 
aswell:http://xn--ywecrlyn-m0a.net/ExcellentUbuntu/ExcellentUbuntu.png 



I really believe in this, and what makes this just perfect: 
Everyone is their own newsservice, getting their views on for 
instance, youtube. And gets the income from this. Which makes a 
finely granulated internet economy.


A test channel: 
https://www.youtube.com/channel/UCR3gmLVjHS5A702wo4bol_Q


Peace,
Ywe Cærlyn.


With Linus Torvalds as patchmeister as usual, ofcourse.

So considering this, and the finely granulated internet economics 
comes from this type of mindset, and with reintergration of it 
back, I would suggest changing the naming scheme of "open 
source", and "free software" to "Available Source". It is 
repeated a lot, and needs to have a corresponding name. (To not 
speak of avoiding uneccesary pointer variables in GNU code... ). 
This is also based on on my conclusion on philosophy research 
over 15 years, and that things need to be right. And even 
metaphysically. For Success. I also CC Richard Stallman on this, 
maybe GNU4.0 will make considerations for this. The hacker will 
now not only be free, but make money. ;)


Peace.



Mister GNU Richard Stallman replied me two times on this, since he 
did not mail LKML, I will restate them here, for the record.


|
|[[[ To any NSA and FBI agents reading my email: please 
consider    ]]]
|[[[ whether defending the US Constitution against all 
enemies, ]]]
|[[[ foreign or domestic, requires you to follow Snowden's 
example. ]]]|

|
|It seems that you're making a new variant of GNU/Linux. If you call
|it "something Linux", you are talking about our work but giving us
|none of the credit.  Please call it "something GNU/Linux" so as to
|give us equal mention.
|
|See https://gnu.org/gnu/linux-and-gnu.html and
|https://gnu.org/gnu/gnu-linux-faq.html, plus the history in
|https://gnu.org/gnu/the-gnu-project.html.
|
|--
|Dr Richard Stallman
|President, Free Software Foundation (gnu.org, fsf.org)
|Internet Hall-of-Famer (internethalloffame.org)
|Skype: No way! See stallman.org/skype.html.
|
And-

|
|[[[ To any NSA and FBI agents reading my email: please 
consider    ]]]
|[[[ whether defending the US Constitution against all 
enemies, ]]]
|[[[ foreign or domestic, requires you to follow Snowden's 
example. ]]]

|
|"Available source" is too weak a criterion.  Free software and open
|source stand for categories of software that are nearly coterminous.
|However, available source is a much weaker criterion and would
|include programs that don't come anywhere near free.
|
|Also, the point of the free software movement is that users deserve
|freedom.  "Available source" doesn't even hint at this idea,
|so it would not communicate what we want to say.
|
|
|--
|Dr Richard Stallman
|President, Free Software Foundation (gnu.org, fsf.org)
|Internet Hall-of-Famer (internethalloffame.org)
|Skype: No way! See stallman.org/skype.html.
|

Not even an acknowledgement on pointer variables from this 
self-appointed spokesman for hackers. Or indeed the larger issue 
of finegranulated internet economics. How shall an OS indeed 
succeed if it chokes its own success?


To not speak of the paranoid insertions. Does he fear mountains 
shall fall on him, for GNU? Indeed GNU seems to be his qualifier 
and god, he slaves to.


Or is gnu, a god to slave to, free software your food, and Richard 
Stallman its Jesusian son? Will it be up to others to make the 
decision?


How much is this in conflict with pure hacking, from C64 asm, to 
PC C, and the original unix hacking?


Have a Mindful Zen moment on this.



As for my own experience, check out my Biit channel where I am 
going to go through highlights, and do DSP retrofits, remasters etc.


For instance this track: https://www.youtube.com/watch?v=xMfWsx3JBUg
Uses my own developed absolute minimal psychacoustically corrected 
phase plateau band EQ. Here I am even u

Re: [PATCH v2] iio: mma8452: replace license description with SPDX specifier

2017-11-18 Thread Jonathan Cameron
On Sat, 18 Nov 2017 10:10:11 +0100
Martin Kepplinger  wrote:

> This replaces the custom license information text with the appropriate
> SPDX identifier. While the information here stays the same, it is easier
> to read.
> 
> Signed-off-by: Martin Kepplinger 
> Acked-by: Peter Meerwald-Stadler 

I'm not 100% sure the intent of the SPDX work is to remove
existing licence text.  So far the big sets have only been
adding tags to files missing their licenses entirely...

Anyone found any specific guidance on this?

Jonathan
> ---
> 
> Sorry I had forgotten to add the mailing lists and got Peter's Ack
> privately. -.-  But thanks Peter for the quick response!
> 
> Again, an Acked-by from Harinath would be good here too.
> 
> thanks
> 
>  martin
> 
> revision history
> 
> v2: adds Peter's Acked-by and adds all mailing lists to CC
> 
> 
>  drivers/iio/accel/mma8452.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
> index bfd4bc806fc2..62c0d4646c16 100644
> --- a/drivers/iio/accel/mma8452.c
> +++ b/drivers/iio/accel/mma8452.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  /*
>   * mma8452.c - Support for following Freescale / NXP 3-axis accelerometers:
>   *
> @@ -13,9 +14,6 @@
>   * Copyright 2015 Martin Kepplinger 
>   * Copyright 2014 Peter Meerwald 
>   *
> - * This file is subject to the terms and conditions of version 2 of
> - * the GNU General Public License.  See the file COPYING in the main
> - * directory of this archive for more details.
>   *
>   * TODO: orientation events
>   */



  1   2   3   >