Re: [PATCH 0/5] hwmon: move include files out of include/linux/i2c

2017-05-21 Thread Guenter Roeck

On 05/21/2017 01:34 PM, Wolfram Sang wrote:

It doesn't make sense to use include/linux/i2c for client drivers which may in
fact rather be hwmon or input or whatever devices. As a result, I want to
deprecate include/linux/i2c for good. This series moves the include files to a
better location, largely include/platform_data because that is what most of th 
> moved include files contain. Note that some files don't seem to have upstream
users in board code, so they maybe could even be removed? I didn't check for


While I understand where you are coming from, I am not typically that 
aggressive.
Such removals force vendors who are not really forthcoming with upstreaming to
deviate even further from upstream. It makes them even less likely to submit 
their
code upstream, and it may result in enforcing their belief that upstream doesn't
really care about vendors struggling to release boards and systems to their
customers.


that now, but I did it for one i2c master driver recently. So, it may be
possible. pmbus.h got moved just one layer upwards, see the patch description
there.

I prefer the series to go upstream via the subsystem tree; if you prefer that I
take it via I2C, just let me know.


Series applied to hwmon-next.

Thanks,
Guenter


No runtime testing because of no HW, but buildbot is happy with this series at
least. A branch can be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/platform_data

Thanks and kind regards,

Wolfram


Wolfram Sang (5):
   hwmon: ads1015: move header file out of I2C realm
   hwmon: ds620: move header file out of I2C realm
   hwmon: ltc4245: move header file out of I2C realm
   hwmon: max6639: move header file out of I2C realm
   hwmon: pmbus: move header file out of I2C realm

  Documentation/hwmon/ads1015| 2 +-
  Documentation/hwmon/ltc4245| 2 +-
  Documentation/hwmon/pmbus-core | 2 +-
  MAINTAINERS| 4 ++--
  drivers/hwmon/ads1015.c| 2 +-
  drivers/hwmon/ds620.c  | 2 +-
  drivers/hwmon/ltc4245.c| 2 +-
  drivers/hwmon/max6639.c| 2 +-
  drivers/hwmon/pmbus/pmbus.c| 2 +-
  drivers/hwmon/pmbus/pmbus_core.c   | 2 +-
  drivers/hwmon/pmbus/ucd9000.c  | 2 +-
  drivers/hwmon/pmbus/ucd9200.c  | 2 +-
  drivers/iio/adc/ti-ads1015.c   | 2 +-
  include/linux/{i2c => platform_data}/ads1015.h | 0
  include/linux/{i2c => platform_data}/ds620.h   | 0
  include/linux/{i2c => platform_data}/ltc4245.h | 0
  include/linux/{i2c => platform_data}/max6639.h | 0
  include/linux/{i2c => }/pmbus.h| 0
  18 files changed, 14 insertions(+), 14 deletions(-)
  rename include/linux/{i2c => platform_data}/ads1015.h (100%)
  rename include/linux/{i2c => platform_data}/ds620.h (100%)
  rename include/linux/{i2c => platform_data}/ltc4245.h (100%)
  rename include/linux/{i2c => platform_data}/max6639.h (100%)
  rename include/linux/{i2c => }/pmbus.h (100%)



--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/5] hwmon: ads1015: move header file out of I2C realm

2017-05-21 Thread Wolfram Sang
include/linux/i2c is not for client devices. Move the header file to a
more appropriate location.

Signed-off-by: Wolfram Sang 
---
 Documentation/hwmon/ads1015| 2 +-
 MAINTAINERS| 2 +-
 drivers/hwmon/ads1015.c| 2 +-
 drivers/iio/adc/ti-ads1015.c   | 2 +-
 include/linux/{i2c => platform_data}/ads1015.h | 0
 5 files changed, 4 insertions(+), 4 deletions(-)
 rename include/linux/{i2c => platform_data}/ads1015.h (100%)

diff --git a/Documentation/hwmon/ads1015 b/Documentation/hwmon/ads1015
index 063b80d857b1f8..02d2a459385f39 100644
--- a/Documentation/hwmon/ads1015
+++ b/Documentation/hwmon/ads1015
@@ -40,7 +40,7 @@ By default all inputs are exported.
 Platform Data
 -
 
-In linux/i2c/ads1015.h platform data is defined, channel_data contains
+In linux/platform_data/ads1015.h platform data is defined, channel_data 
contains
 configuration data for the used input combinations:
 - pga is the programmable gain amplifier (values are full scale)
   0: +/- 6.144 V
diff --git a/MAINTAINERS b/MAINTAINERS
index 9e984645c4b08b..33541336258e77 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -478,7 +478,7 @@ L:  linux-hw...@vger.kernel.org
 S: Maintained
 F: Documentation/hwmon/ads1015
 F: drivers/hwmon/ads1015.c
-F: include/linux/i2c/ads1015.h
+F: include/linux/platform_data/ads1015.h
 
 ADT746X FAN DRIVER
 M: Colin Leroy 
diff --git a/drivers/hwmon/ads1015.c b/drivers/hwmon/ads1015.c
index 5140c27d16dd03..357b4260716404 100644
--- a/drivers/hwmon/ads1015.c
+++ b/drivers/hwmon/ads1015.c
@@ -34,7 +34,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 /* ADS1015 registers */
 enum {
diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c
index f76d979fb7e86e..884b8e461b1755 100644
--- a/drivers/iio/adc/ti-ads1015.c
+++ b/drivers/iio/adc/ti-ads1015.c
@@ -23,7 +23,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 #include 
 #include 
diff --git a/include/linux/i2c/ads1015.h b/include/linux/platform_data/ads1015.h
similarity index 100%
rename from include/linux/i2c/ads1015.h
rename to include/linux/platform_data/ads1015.h
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/5] hwmon: move include files out of include/linux/i2c

2017-05-21 Thread Wolfram Sang
It doesn't make sense to use include/linux/i2c for client drivers which may in
fact rather be hwmon or input or whatever devices. As a result, I want to
deprecate include/linux/i2c for good. This series moves the include files to a
better location, largely include/platform_data because that is what most of the
moved include files contain. Note that some files don't seem to have upstream
users in board code, so they maybe could even be removed? I didn't check for
that now, but I did it for one i2c master driver recently. So, it may be
possible. pmbus.h got moved just one layer upwards, see the patch description
there.

I prefer the series to go upstream via the subsystem tree; if you prefer that I
take it via I2C, just let me know.

No runtime testing because of no HW, but buildbot is happy with this series at
least. A branch can be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/platform_data

Thanks and kind regards,

   Wolfram


Wolfram Sang (5):
  hwmon: ads1015: move header file out of I2C realm
  hwmon: ds620: move header file out of I2C realm
  hwmon: ltc4245: move header file out of I2C realm
  hwmon: max6639: move header file out of I2C realm
  hwmon: pmbus: move header file out of I2C realm

 Documentation/hwmon/ads1015| 2 +-
 Documentation/hwmon/ltc4245| 2 +-
 Documentation/hwmon/pmbus-core | 2 +-
 MAINTAINERS| 4 ++--
 drivers/hwmon/ads1015.c| 2 +-
 drivers/hwmon/ds620.c  | 2 +-
 drivers/hwmon/ltc4245.c| 2 +-
 drivers/hwmon/max6639.c| 2 +-
 drivers/hwmon/pmbus/pmbus.c| 2 +-
 drivers/hwmon/pmbus/pmbus_core.c   | 2 +-
 drivers/hwmon/pmbus/ucd9000.c  | 2 +-
 drivers/hwmon/pmbus/ucd9200.c  | 2 +-
 drivers/iio/adc/ti-ads1015.c   | 2 +-
 include/linux/{i2c => platform_data}/ads1015.h | 0
 include/linux/{i2c => platform_data}/ds620.h   | 0
 include/linux/{i2c => platform_data}/ltc4245.h | 0
 include/linux/{i2c => platform_data}/max6639.h | 0
 include/linux/{i2c => }/pmbus.h| 0
 18 files changed, 14 insertions(+), 14 deletions(-)
 rename include/linux/{i2c => platform_data}/ads1015.h (100%)
 rename include/linux/{i2c => platform_data}/ds620.h (100%)
 rename include/linux/{i2c => platform_data}/ltc4245.h (100%)
 rename include/linux/{i2c => platform_data}/max6639.h (100%)
 rename include/linux/{i2c => }/pmbus.h (100%)

-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/5] hwmon: ltc4245: move header file out of I2C realm

2017-05-21 Thread Wolfram Sang
include/linux/i2c is not for client devices. Move the header file to a
more appropriate location.

Signed-off-by: Wolfram Sang 
---
 Documentation/hwmon/ltc4245| 2 +-
 drivers/hwmon/ltc4245.c| 2 +-
 include/linux/{i2c => platform_data}/ltc4245.h | 0
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename include/linux/{i2c => platform_data}/ltc4245.h (100%)

diff --git a/Documentation/hwmon/ltc4245 b/Documentation/hwmon/ltc4245
index b478b086496586..4ca7a9da09f918 100644
--- a/Documentation/hwmon/ltc4245
+++ b/Documentation/hwmon/ltc4245
@@ -96,7 +96,7 @@ slowly, -EAGAIN will be returned when you read the sysfs 
attribute containing
 the sensor reading.
 
 The LTC4245 chip can be configured to sample all GPIO pins with two methods:
-1) platform data -- see include/linux/i2c/ltc4245.h
+1) platform data -- see include/linux/platform_data/ltc4245.h
 2) OF device tree -- add the "ltc4245,use-extra-gpios" property to each chip
 
 The default mode of operation is to sample a single GPIO pin.
diff --git a/drivers/hwmon/ltc4245.c b/drivers/hwmon/ltc4245.c
index 4680d89556ce80..082f0a0bd8a0f1 100644
--- a/drivers/hwmon/ltc4245.c
+++ b/drivers/hwmon/ltc4245.c
@@ -23,7 +23,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 /* Here are names of the chip's registers (a.k.a. commands) */
 enum ltc4245_cmd {
diff --git a/include/linux/i2c/ltc4245.h b/include/linux/platform_data/ltc4245.h
similarity index 100%
rename from include/linux/i2c/ltc4245.h
rename to include/linux/platform_data/ltc4245.h
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/5] hwmon: pmbus: move header file out of I2C realm

2017-05-21 Thread Wolfram Sang
include/linux/i2c is not for client devices. Move the header file to a
more appropriate location.

Signed-off-by: Wolfram Sang 
---

I decided to not move it to 'platform_data' but just one level up because
'pmbus.h' sounds pretty generic to me like 'i2c.h'. And it might contain
different stuff than platform data somewhen? Let me know if you think
different. Thanks!

 Documentation/hwmon/pmbus-core   | 2 +-
 MAINTAINERS  | 2 +-
 drivers/hwmon/pmbus/pmbus.c  | 2 +-
 drivers/hwmon/pmbus/pmbus_core.c | 2 +-
 drivers/hwmon/pmbus/ucd9000.c| 2 +-
 drivers/hwmon/pmbus/ucd9200.c| 2 +-
 include/linux/{i2c => }/pmbus.h  | 0
 7 files changed, 6 insertions(+), 6 deletions(-)
 rename include/linux/{i2c => }/pmbus.h (100%)

diff --git a/Documentation/hwmon/pmbus-core b/Documentation/hwmon/pmbus-core
index 31e4720fed18c7..8ed10e9ddfb589 100644
--- a/Documentation/hwmon/pmbus-core
+++ b/Documentation/hwmon/pmbus-core
@@ -253,7 +253,7 @@ Specifically, it provides the following information.
 PMBus driver platform data
 ==
 
-PMBus platform data is defined in include/linux/i2c/pmbus.h. Platform data
+PMBus platform data is defined in include/linux/pmbus.h. Platform data
 currently only provides a flag field with a single bit used.
 
 #define PMBUS_SKIP_STATUS_CHECK (1 << 0)
diff --git a/MAINTAINERS b/MAINTAINERS
index 33541336258e77..259cf67ac17067 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10155,7 +10155,7 @@ T:  git 
git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git
 S: Maintained
 F: Documentation/hwmon/pmbus
 F: drivers/hwmon/pmbus/
-F: include/linux/i2c/pmbus.h
+F: include/linux/pmbus.h
 
 PMC SIERRA MaxRAID DRIVER
 L: linux-s...@vger.kernel.org
diff --git a/drivers/hwmon/pmbus/pmbus.c b/drivers/hwmon/pmbus/pmbus.c
index 44ca8a94873d62..7718e58dbda543 100644
--- a/drivers/hwmon/pmbus/pmbus.c
+++ b/drivers/hwmon/pmbus/pmbus.c
@@ -25,7 +25,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include "pmbus.h"
 
 /*
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index ba59eaef2e075a..f1eff6b6c79826 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -28,7 +28,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include "pmbus.h"
diff --git a/drivers/hwmon/pmbus/ucd9000.c b/drivers/hwmon/pmbus/ucd9000.c
index 3518f0c0893447..b74dbeca2e8d89 100644
--- a/drivers/hwmon/pmbus/ucd9000.c
+++ b/drivers/hwmon/pmbus/ucd9000.c
@@ -26,7 +26,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include "pmbus.h"
 
 enum chips { ucd9000, ucd90120, ucd90124, ucd90160, ucd9090, ucd90910 };
diff --git a/drivers/hwmon/pmbus/ucd9200.c b/drivers/hwmon/pmbus/ucd9200.c
index a8712c5ded4e93..3ed94585837a9d 100644
--- a/drivers/hwmon/pmbus/ucd9200.c
+++ b/drivers/hwmon/pmbus/ucd9200.c
@@ -25,7 +25,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include "pmbus.h"
 
 #define UCD9200_PHASE_INFO 0xd2
diff --git a/include/linux/i2c/pmbus.h b/include/linux/pmbus.h
similarity index 100%
rename from include/linux/i2c/pmbus.h
rename to include/linux/pmbus.h
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 17/32] x86/mm: Add support to access boot related data in the clear

2017-05-21 Thread Borislav Petkov
On Fri, May 19, 2017 at 03:50:32PM -0500, Tom Lendacky wrote:
> The "worker" function would be doing the loop through the setup data,
> but since the setup data is mapped inside the loop I can't do the __init
> calling the non-init function and still hope to consolidate the code.
> Maybe I'm missing something here...

Hmm, I see what you mean. But the below change ontop doesn't fire any
warnings here. Maybe your .config has something set which I don't...

---
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 55317ba3b6dc..199c983192ae 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -515,71 +515,50 @@ static bool memremap_is_efi_data(resource_size_t 
phys_addr,
  * Examine the physical address to determine if it is boot data by checking
  * it against the boot params setup_data chain.
  */
-static bool memremap_is_setup_data(resource_size_t phys_addr,
-  unsigned long size)
+static bool
+__memremap_is_setup_data(resource_size_t phys_addr, unsigned long size, bool 
early)
 {
struct setup_data *data;
u64 paddr, paddr_next;
+   u32 len;
 
paddr = boot_params.hdr.setup_data;
while (paddr) {
-   bool is_setup_data = false;
 
if (phys_addr == paddr)
return true;
 
-   data = memremap(paddr, sizeof(*data),
-   MEMREMAP_WB | MEMREMAP_DEC);
+   if (early)
+   data = early_memremap_decrypted(paddr, sizeof(*data));
+   else
+   data = memremap(paddr, sizeof(*data), MEMREMAP_WB | 
MEMREMAP_DEC);
 
paddr_next = data->next;
+   len = data->len;
 
-   if ((phys_addr > paddr) && (phys_addr < (paddr + data->len)))
-   is_setup_data = true;
+   if (early)
+   early_memunmap(data, sizeof(*data));
+   else
+   memunmap(data);
 
-   memunmap(data);
 
-   if (is_setup_data)
+   if ((phys_addr > paddr) && (phys_addr < (paddr + data->len)))
return true;
 
paddr = paddr_next;
}
-
return false;
 }
 
-/*
- * Examine the physical address to determine if it is boot data by checking
- * it against the boot params setup_data chain (early boot version).
- */
 static bool __init early_memremap_is_setup_data(resource_size_t phys_addr,
unsigned long size)
 {
-   struct setup_data *data;
-   u64 paddr, paddr_next;
-
-   paddr = boot_params.hdr.setup_data;
-   while (paddr) {
-   bool is_setup_data = false;
-
-   if (phys_addr == paddr)
-   return true;
-
-   data = early_memremap_decrypted(paddr, sizeof(*data));
-
-   paddr_next = data->next;
-
-   if ((phys_addr > paddr) && (phys_addr < (paddr + data->len)))
-   is_setup_data = true;
-
-   early_memunmap(data, sizeof(*data));
-
-   if (is_setup_data)
-   return true;
-
-   paddr = paddr_next;
-   }
+   return __memremap_is_setup_data(phys_addr, size, true);
+}
 
-   return false;
+static bool memremap_is_setup_data(resource_size_t phys_addr, unsigned long 
size)
+{
+   return __memremap_is_setup_data(phys_addr, size, false);
 }
 
 /*

-- 
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html