Re: [PATCH] staging: rtl8192u: check return value of read_nic_word_E

2016-03-03 Thread kbuild test robot
Hi Salah,

[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v4.5-rc6 next-20160303]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improving the system]

url:
https://github.com/0day-ci/linux/commits/Salah-Triki/staging-rtl8192u-check-return-value-of-read_nic_word_E/20160304-093832
config: i386-allmodconfig (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All warnings (new ones prefixed by >>):

   drivers/staging/rtl8192u/r8192U_core.c: In function 
'rtl8192_read_eeprom_info':
>> drivers/staging/rtl8192u/r8192U_core.c:2496:8: warning: unused variable 
>> 'tmp' [-Wunused-variable]
   u16 tmp = 0;
   ^
   drivers/staging/rtl8192u/r8192U_core.c:2707:1: warning: control reaches end 
of non-void function [-Wreturn-type]
}
^

vim +/tmp +2496 drivers/staging/rtl8192u/r8192U_core.c

8fc8598e Jerry Chuang 2009-11-03  2480  priv->eeprom_vid = 0;
8fc8598e Jerry Chuang 2009-11-03  2481  priv->eeprom_pid = 0;
8fc8598e Jerry Chuang 2009-11-03  2482  priv->card_8192_version 
= VERSION_819xU_B;
8fc8598e Jerry Chuang 2009-11-03  2483  
priv->eeprom_ChannelPlan = 0;
8fc8598e Jerry Chuang 2009-11-03  2484  priv->eeprom_CustomerID 
= 0;
8fc8598e Jerry Chuang 2009-11-03  2485  }
069b3162 Raphaël Beamonte 2015-09-20  2486  RT_TRACE(COMP_EPROM,
069b3162 Raphaël Beamonte 2015-09-20  2487   "vid:0x%4x, pid:0x%4x, 
CustomID:0x%2x, ChanPlan:0x%x\n",
069b3162 Raphaël Beamonte 2015-09-20  2488   priv->eeprom_vid, 
priv->eeprom_pid, priv->eeprom_CustomerID,
069b3162 Raphaël Beamonte 2015-09-20  2489   
priv->eeprom_ChannelPlan);
14285c1f Raphaël Beamonte 2015-08-18  2490  /* set channelplan from eeprom 
*/
8fc8598e Jerry Chuang 2009-11-03  2491  priv->ChannelPlan = 
priv->eeprom_ChannelPlan;
2716141c Xenia Ragiadakou 2013-06-03  2492  if (bLoad_From_EEPOM) {
8fc8598e Jerry Chuang 2009-11-03  2493  int i;
7b25c24e Raphaël Beamonte 2015-08-18  2494  
2716141c Xenia Ragiadakou 2013-06-03  2495  for (i = 0; i < 6; i += 
2) {
8fc8598e Jerry Chuang 2009-11-03 @2496  u16 tmp = 0;
7b25c24e Raphaël Beamonte 2015-08-18  2497  
f32e9126 Salah Triki  2016-03-03  2498  ret = 
eprom_read(dev, (u16)((EEPROM_NODE_ADDRESS_BYTE_0 + i) >> 1));
f32e9126 Salah Triki  2016-03-03  2499  if (ret)
f32e9126 Salah Triki  2016-03-03  2500  return 
ret;
f32e9126 Salah Triki  2016-03-03  2501  *(u16 
*)(>dev_addr[i]) = (u16) ret;
8fc8598e Jerry Chuang 2009-11-03  2502  }
2716141c Xenia Ragiadakou 2013-06-03  2503  } else {
8fc8598e Jerry Chuang 2009-11-03  2504  memcpy(dev->dev_addr, 
bMac_Tmp_Addr, 6);

:: The code at line 2496 was first introduced by commit
:: 8fc8598e61f6f384f3eaf1d9b09500c12af47b37 Staging: Added Realtek rtl8192u 
driver to staging

:: TO: Jerry Chuang <jerry-chu...@realtek.com>
:: CC: Greg Kroah-Hartman <gre...@suse.de>

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8192u: check return value of read_nic_word_E

2016-03-03 Thread kbuild test robot
Hi Salah,

[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v4.5-rc6 next-20160303]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improving the system]

url:
https://github.com/0day-ci/linux/commits/Salah-Triki/staging-rtl8192u-check-return-value-of-read_nic_word_E/20160304-093832
config: sparc64-allyesconfig (attached as .config)
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=sparc64 

All warnings (new ones prefixed by >>):

   drivers/staging/rtl8192u/r8192U_core.c: In function 
'rtl8192_read_eeprom_info':
   drivers/staging/rtl8192u/r8192U_core.c:2496:8: warning: unused variable 
'tmp' [-Wunused-variable]
   u16 tmp = 0;
   ^
>> drivers/staging/rtl8192u/r8192U_core.c:2707:1: warning: control reaches end 
>> of non-void function [-Wreturn-type]
}
^

vim +2707 drivers/staging/rtl8192u/r8192U_core.c

8fc8598e Jerry Chuang 2009-11-03  2691  break;
8fc8598e Jerry Chuang 2009-11-03  2692  
8fc8598e Jerry Chuang 2009-11-03  2693  }
8fc8598e Jerry Chuang 2009-11-03  2694  
8fc8598e Jerry Chuang 2009-11-03  2695  
cf47ca02 Raphaël Beamonte 2015-08-18  2696  if (priv->rf_type == RF_1T2R)
8fc8598e Jerry Chuang 2009-11-03  2697  RT_TRACE(COMP_EPROM, 
"\n1T2R config\n");
cf47ca02 Raphaël Beamonte 2015-08-18  2698  else
8fc8598e Jerry Chuang 2009-11-03  2699  RT_TRACE(COMP_EPROM, 
"\n2T4R config\n");
8fc8598e Jerry Chuang 2009-11-03  2700  
14285c1f Raphaël Beamonte 2015-08-18  2701  /* We can only know RF type in 
the function. So we have to init
14285c1f Raphaël Beamonte 2015-08-18  2702   * DIG RATR table again.
14285c1f Raphaël Beamonte 2015-08-18  2703   */
8fc8598e Jerry Chuang 2009-11-03  2704  init_rate_adaptive(dev);
8fc8598e Jerry Chuang 2009-11-03  2705  
5b3b215b Xenia Ragiadakou 2013-05-23  2706  RT_TRACE(COMP_EPROM, 
"<===%s()\n", __func__);
8fc8598e Jerry Chuang 2009-11-03 @2707  }
8fc8598e Jerry Chuang 2009-11-03  2708  
f4c6074a Ana Rey  2014-03-13  2709  static short 
rtl8192_get_channel_map(struct net_device *dev)
8fc8598e Jerry Chuang 2009-11-03  2710  {
8fc8598e Jerry Chuang 2009-11-03  2711  struct r8192_priv *priv = 
ieee80211_priv(dev);
7b25c24e Raphaël Beamonte 2015-08-18  2712  
8fc8598e Jerry Chuang 2009-11-03  2713  if (priv->ChannelPlan > 
COUNTRY_CODE_GLOBAL_DOMAIN) {
069b3162 Raphaël Beamonte 2015-09-20  2714  netdev_err(dev,
069b3162 Raphaël Beamonte 2015-09-20  2715 
"rtl8180_init: Error channel plan! Set to default.\n");

:: The code at line 2707 was first introduced by commit
:: 8fc8598e61f6f384f3eaf1d9b09500c12af47b37 Staging: Added Realtek rtl8192u 
driver to staging

:: TO: Jerry Chuang <jerry-chu...@realtek.com>
:: CC: Greg Kroah-Hartman <gre...@suse.de>

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging/android: change IOCTLs opcode after ABI change

2016-03-03 Thread Gustavo Padovan
From: Gustavo Padovan 

Burn the old opcode to avoid any potential old userspace running the old
API to get weird errors. Changing the opcodes will make them fail right
away.

This is just a precaution, there no upstream users of these interfaces
yet and the only user is Android, but we don't expect anyone trying to
run android userspace and all it dependencies on top of upstream kernels.

Moreover Android should be converted to use upstream sync_files.

Suggested-by: Rob Clark 
Signed-off-by: Gustavo Padovan 
---
 drivers/staging/android/uapi/sync.h | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/uapi/sync.h 
b/drivers/staging/android/uapi/sync.h
index 859977c..fbadb8a 100644
--- a/drivers/staging/android/uapi/sync.h
+++ b/drivers/staging/android/uapi/sync.h
@@ -69,13 +69,20 @@ struct sync_file_info {
 #define SYNC_IOC_MAGIC '>'
 
 /**
+ * Opcodes  0, 1 and 2 were burned during a API change to avoid users of the
+ * old API to get weird errors when trying to handling sync_files. The API
+ * change happened during the de-stage of the Sync Framework when there was
+ * no upstream users available.
+ */
+
+/**
  * DOC: SYNC_IOC_MERGE - merge two fences
  *
  * Takes a struct sync_merge_data.  Creates a new fence containing copies of
  * the sync_pts in both the calling fd and sync_merge_data.fd2.  Returns the
  * new fence's fd in sync_merge_data.fence
  */
-#define SYNC_IOC_MERGE _IOWR(SYNC_IOC_MAGIC, 1, struct sync_merge_data)
+#define SYNC_IOC_MERGE _IOWR(SYNC_IOC_MAGIC, 3, struct sync_merge_data)
 
 /**
  * DOC: SYNC_IOC_FENCE_INFO - get detailed information on a fence
@@ -88,6 +95,6 @@ struct sync_file_info {
  * pt_info is a buffer containing sync_pt_infos for every sync_pt in the fence.
  * To iterate over the sync_pt_infos, use the sync_pt_info.len field.
  */
-#define SYNC_IOC_FILE_INFO _IOWR(SYNC_IOC_MAGIC, 2, struct sync_file_info)
+#define SYNC_IOC_FILE_INFO _IOWR(SYNC_IOC_MAGIC, 4, struct sync_file_info)
 
 #endif /* _UAPI_LINUX_SYNC_H */
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/2] isdn: i4l: move active-isdn drivers to staging

2016-03-03 Thread Greg KH
On Thu, Mar 03, 2016 at 05:22:22PM -0500, David Miller wrote:
> From: Arnd Bergmann 
> Date: Wed,  2 Mar 2016 20:06:46 +0100
> 
> > The icn, act2000 and pcbit drivers are all for very old hardware,
> > and it is highly unlikely that anyone is actually still using them
> > on modern kernels, if at all.
> > 
> > All three drivers apparently are for hardware that predates PCI
> > being the common connector, as they are ISA-only and active
> > PCI ISDN cards were widely available in the 1990s.
> > 
> > Looking through the git logs, it I cannot find any indication of a
> > patch to any of these drivers that has been tested on real hardware,
> > only cleanups or global API changes.
> > 
> > Signed-off-by: Arnd Bergmann 
> 
> Greg, can you please take these two patches?

will do

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/2] isdn: i4l: move active-isdn drivers to staging

2016-03-03 Thread David Miller
From: Arnd Bergmann 
Date: Wed,  2 Mar 2016 20:06:46 +0100

> The icn, act2000 and pcbit drivers are all for very old hardware,
> and it is highly unlikely that anyone is actually still using them
> on modern kernels, if at all.
> 
> All three drivers apparently are for hardware that predates PCI
> being the common connector, as they are ISA-only and active
> PCI ISDN cards were widely available in the 1990s.
> 
> Looking through the git logs, it I cannot find any indication of a
> patch to any of these drivers that has been tested on real hardware,
> only cleanups or global API changes.
> 
> Signed-off-by: Arnd Bergmann 

Greg, can you please take these two patches?

Thanks!

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging/android: add flags member to sync ioctl structs

2016-03-03 Thread Rob Clark
On Thu, Mar 3, 2016 at 3:54 PM, Rob Clark  wrote:
> On Thu, Mar 3, 2016 at 11:17 AM, Greg Kroah-Hartman
>  wrote:
>> On Thu, Mar 03, 2016 at 11:37:17AM -0300, Gustavo Padovan wrote:
>>> From: Gustavo Padovan 
>>>
>>> Play safe and add flags member to all structs. So we don't need to
>>> break API or create new IOCTL in the future if new features that requires
>>> flags arises.
>>>
>>> v2: check if flags are valid (zero, in this case)
>>>
>>> v3: return -EINVAL if flags are not zero'ed
>>>
>>> v4: add padding for 64-bit alignment
>>>
>>> v5: rebase to use only stacked sync_file_info
>>
>> Why are these vX things here in the changelog?
>>
>> And you just broke all existing userspace users of this code, why are
>> you allowed to do that?
>>
>> not ok...
>
> There are not really any users of this on an upstream kernel yet, so
> it makes sense to fix the ABI to something we can live with now,
> before that changes.  If we are stuck not breaking ABI with android
> stuff pulled into staging as we destage it, then maybe we should be a
> *lot* slower at pulling android stuff into staging.  (Ie. if that is
> the case, please kick it all out now and we'll re-add things
> properly.)

That all said, I suppose one sensible concession to practicality would
be to burn the old ioctl numbers and pick new ioctl numbers.  At least
this way if someone did manage to take an old android userspace (with
it's various dependencies on other non-upstream SoC specific platform
drivers, etc) and run it on upstream kernel, at least things would
fail in an obvious way.  I could live with this as the
mode-of-operations for fixing up and destaging staging/android stuff.

BR,
-R
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v7 4/5] staging/android: refactor SYNC_IOC_FILE_INFO

2016-03-03 Thread Gustavo Padovan
From: Gustavo Padovan 

Change SYNC_IOC_FILE_INFO behaviour to avoid future API breaks and
optimize buffer

Now num_fences can be filled by the caller to inform how many fences it
wants to retrieve from the kernel. If the num_fences passed is greater
than zero info->sync_fence_info should point to a buffer with enough space
to fit all fences.

However if num_fences passed to the kernel is 0, the kernel will reply
with number of fences of the sync_file.

Sending first an ioctl with num_fences = 0 can optimize buffer allocation,
in a first call with num_fences = 0 userspace will receive the actual
number of fences in the num_fences filed.

Then it can allocate a buffer with the correct size on sync_fence_info and
call SYNC_IOC_FILE_INFO again, but now with the actual value of num_fences
in the sync_file.

Also, info->sync_fence_info was converted to __u64 pointer to prevent
32bit compatibility issues.

An example userspace code for the later would be:

struct sync_file_info *info;
int err, size, num_fences;

info = malloc(sizeof(*info));

info.flags = 0;
err = ioctl(fd, SYNC_IOC_FILE_INFO, info);
num_fences = info->num_fences;

if (num_fences) {
info.flags = 0;
size = sizeof(struct sync_fence_info) * num_fences;
info->num_fences = num_fences;
info->sync_fence_info = (uint64_t) calloc(num_fences,
  sizeof(struct 
sync_fence_info));

err = ioctl(fd, SYNC_IOC_FILE_INFO, info);
}

Signed-off-by: Gustavo Padovan 
Reviewed-by: Maarten Lankhorst 
---
v2: fix fence_info memory leak

v3: Comments from Emil Velikov
- improve commit message
- remove __u64 cast
- remove check for output fields in file_info
- clean up sync_fill_fence_info()

Comments from Maarten Lankhorst
- remove in.num_fences && !in.sync_fence_info check
- remove info->len and use only num_fences to calculate size

Comments from Dan Carpenter
- fix info->sync_fence_info documentation

v4: remove allocated struct sync_file_info (comment from Maarten)
---
 drivers/staging/android/sync.c  | 70 +
 drivers/staging/android/uapi/sync.h |  9 ++---
 2 files changed, 36 insertions(+), 43 deletions(-)

diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index dc5f382..48ee175 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -479,13 +479,9 @@ err_put_fd:
return err;
 }
 
-static int sync_fill_fence_info(struct fence *fence, void *data, int size)
+static void sync_fill_fence_info(struct fence *fence,
+   struct sync_fence_info *info)
 {
-   struct sync_fence_info *info = data;
-
-   if (size < sizeof(*info))
-   return -ENOMEM;
-
strlcpy(info->obj_name, fence->ops->get_timeline_name(fence),
sizeof(info->obj_name));
strlcpy(info->driver_name, fence->ops->get_driver_name(fence),
@@ -495,60 +491,60 @@ static int sync_fill_fence_info(struct fence *fence, void 
*data, int size)
else
info->status = 0;
info->timestamp_ns = ktime_to_ns(fence->timestamp);
-
-   return sizeof(*info);
 }
 
 static long sync_file_ioctl_fence_info(struct sync_file *sync_file,
unsigned long arg)
 {
-   struct sync_file_info *info;
+   struct sync_file_info info;
+   struct sync_fence_info *fence_info = NULL;
__u32 size;
-   __u32 len = 0;
int ret, i;
 
-   if (copy_from_user(, (void __user *)arg, sizeof(size)))
+   if (copy_from_user(, (void __user *)arg, sizeof(info)))
return -EFAULT;
 
-   if (size < sizeof(struct sync_file_info))
-   return -EINVAL;
+   /*
+* Passing num_fences = 0 means that userspace doesn't want to
+* retrieve any sync_fence_info. If num_fences = 0 we skip filling
+* sync_fence_info and return the actual number of fences on
+* info->num_fences.
+*/
+   if (!info.num_fences)
+   goto no_fences;
 
-   if (size > 4096)
-   size = 4096;
+   if (info.num_fences < sync_file->num_fences)
+   return -EINVAL;
 
-   info = kzalloc(size, GFP_KERNEL);
-   if (!info)
+   size = sync_file->num_fences * sizeof(*fence_info);
+   fence_info = kzalloc(size, GFP_KERNEL);
+   if (!fence_info)
return -ENOMEM;
 
-   strlcpy(info->name, sync_file->name, sizeof(info->name));
-   info->status = atomic_read(_file->status);
-   if (info->status >= 0)
-   info->status = !info->status;
+   for (i = 0; i < sync_file->num_fences; ++i)
+   

[PATCH v7 3/5] staging/android: remove redundant comments on sync_merge_data

2016-03-03 Thread Gustavo Padovan
From: Gustavo Padovan 

struct sync_merge_data already have documentation on top of the
struct definition. No need to duplicate it.

Signed-off-by: Gustavo Padovan 
Reviewed-by: Maarten Lankhorst 
---
 drivers/staging/android/uapi/sync.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/android/uapi/sync.h 
b/drivers/staging/android/uapi/sync.h
index dd0dd84..f0b41ce 100644
--- a/drivers/staging/android/uapi/sync.h
+++ b/drivers/staging/android/uapi/sync.h
@@ -21,9 +21,9 @@
  * @fence: returns the fd of the new fence to userspace
  */
 struct sync_merge_data {
-   __s32   fd2; /* fd of second fence */
-   charname[32]; /* name of new fence */
-   __s32   fence; /* fd on newly created fence */
+   __s32   fd2;
+   charname[32];
+   __s32   fence;
 };
 
 /**
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v7 5/5] staging/android: add flags member to sync ioctl structs

2016-03-03 Thread Gustavo Padovan
From: Gustavo Padovan 

Play safe and add flags member to all structs. So we don't need to
break API or create new IOCTL in the future if new features that requires
flags arises.

Signed-off-by: Gustavo Padovan 
Reviewed-by: Maarten Lankhorst 
---

v2: check if flags are valid (zero, in this case)

v3: return -EINVAL if flags are not zero'ed

v4: add padding for 64-bit alignment

v5: rebase to use only stacked sync_file_info
---
 drivers/staging/android/sync.c  |  8 
 drivers/staging/android/uapi/sync.h | 14 --
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index 48ee175..ae81c95 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -445,6 +445,11 @@ static long sync_file_ioctl_merge(struct sync_file 
*sync_file,
goto err_put_fd;
}
 
+   if (data.flags || data.pad) {
+   err = -EINVAL;
+   goto err_put_fd;
+   }
+
fence2 = sync_file_fdget(data.fd2);
if (!fence2) {
err = -ENOENT;
@@ -504,6 +509,9 @@ static long sync_file_ioctl_fence_info(struct sync_file 
*sync_file,
if (copy_from_user(, (void __user *)arg, sizeof(info)))
return -EFAULT;
 
+   if (info.flags || info.pad)
+   return -EINVAL;
+
/*
 * Passing num_fences = 0 means that userspace doesn't want to
 * retrieve any sync_fence_info. If num_fences = 0 we skip filling
diff --git a/drivers/staging/android/uapi/sync.h 
b/drivers/staging/android/uapi/sync.h
index a122bb5..859977c 100644
--- a/drivers/staging/android/uapi/sync.h
+++ b/drivers/staging/android/uapi/sync.h
@@ -16,14 +16,18 @@
 
 /**
  * struct sync_merge_data - data passed to merge ioctl
- * @fd2:   file descriptor of second fence
  * @name:  name of new fence
+ * @fd2:   file descriptor of second fence
  * @fence: returns the fd of the new fence to userspace
+ * @flags: merge_data flags
+ * @pad:   padding for 64-bit alignment, should always be zero
  */
 struct sync_merge_data {
-   __s32   fd2;
charname[32];
+   __s32   fd2;
__s32   fence;
+   __u32   flags;
+   __u32   pad;
 };
 
 /**
@@ -31,12 +35,14 @@ struct sync_merge_data {
  * @obj_name:  name of parent sync_timeline
  * @driver_name:   name of driver implementing the parent
  * @status:status of the fence 0:active 1:signaled <0:error
+ * @flags: fence_info flags
  * @timestamp_ns:  timestamp of status change in nanoseconds
  */
 struct sync_fence_info {
charobj_name[32];
chardriver_name[32];
__s32   status;
+   __u32   flags;
__u64   timestamp_ns;
 };
 
@@ -44,14 +50,18 @@ struct sync_fence_info {
  * struct sync_file_info - data returned from fence info ioctl
  * @name:  name of fence
  * @status:status of fence. 1: signaled 0:active <0:error
+ * @flags: sync_file_info flags
  * @num_fences number of fences in the sync_file
+ * @pad:   padding for 64-bit alignment, should always be zero
  * @sync_fence_info: pointer to array of structs sync_fence_info with all
  *  fences in the sync_file
  */
 struct sync_file_info {
charname[32];
__s32   status;
+   __u32   flags;
__u32   num_fences;
+   __u32   pad;
 
__u64   sync_fence_info;
 };
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v7 1/5] staging/android: add num_fences field to struct sync_file_info

2016-03-03 Thread Gustavo Padovan
From: Gustavo Padovan 

Inform userspace how many fences are in the sync_fence_info field.

Signed-off-by: Gustavo Padovan 
Reviewed-by: Maarten Lankhorst 
---
 drivers/staging/android/sync.c  | 2 ++
 drivers/staging/android/uapi/sync.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index 3a8f210..31aa462 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -525,6 +525,8 @@ static long sync_file_ioctl_fence_info(struct sync_file 
*sync_file,
if (info->status >= 0)
info->status = !info->status;
 
+   info->num_fences = sync_file->num_fences;
+
len = sizeof(struct sync_file_info);
 
for (i = 0; i < sync_file->num_fences; ++i) {
diff --git a/drivers/staging/android/uapi/sync.h 
b/drivers/staging/android/uapi/sync.h
index a0cf357..4ffb7cc 100644
--- a/drivers/staging/android/uapi/sync.h
+++ b/drivers/staging/android/uapi/sync.h
@@ -47,12 +47,14 @@ struct sync_fence_info {
  * userspace including pt_info.
  * @name:  name of fence
  * @status:status of fence. 1: signaled 0:active <0:error
+ * @num_fences number of fences in the sync_file
  * @sync_fence_info: array of sync_fence_info for every fence in the sync_file
  */
 struct sync_file_info {
__u32   len;
charname[32];
__s32   status;
+   __u32   num_fences;
 
__u8sync_fence_info[0];
 };
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v7 2/5] staging/android: rename SYNC_IOC_FENCE_INFO

2016-03-03 Thread Gustavo Padovan
From: Gustavo Padovan 

We don't use the 'fence' name to refer to sync_file anymore. So rename it
to SYNC_IOC_FILE_INFO.

Signed-off-by: Gustavo Padovan 
Reviewed-by: Maarten Lankhorst 
---
 drivers/staging/android/sync.c  | 2 +-
 drivers/staging/android/uapi/sync.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index 31aa462..dc5f382 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -562,7 +562,7 @@ static long sync_file_ioctl(struct file *file, unsigned int 
cmd,
case SYNC_IOC_MERGE:
return sync_file_ioctl_merge(sync_file, arg);
 
-   case SYNC_IOC_FENCE_INFO:
+   case SYNC_IOC_FILE_INFO:
return sync_file_ioctl_fence_info(sync_file, arg);
 
default:
diff --git a/drivers/staging/android/uapi/sync.h 
b/drivers/staging/android/uapi/sync.h
index 4ffb7cc..dd0dd84 100644
--- a/drivers/staging/android/uapi/sync.h
+++ b/drivers/staging/android/uapi/sync.h
@@ -81,6 +81,6 @@ struct sync_file_info {
  * pt_info is a buffer containing sync_pt_infos for every sync_pt in the fence.
  * To iterate over the sync_pt_infos, use the sync_pt_info.len field.
  */
-#define SYNC_IOC_FENCE_INFO_IOWR(SYNC_IOC_MAGIC, 2, struct sync_file_info)
+#define SYNC_IOC_FILE_INFO _IOWR(SYNC_IOC_MAGIC, 2, struct sync_file_info)
 
 #endif /* _UAPI_LINUX_SYNC_H */
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging/android: add flags member to sync ioctl structs

2016-03-03 Thread Gustavo Padovan
Hi Greg,

2016-03-03 Greg Kroah-Hartman :

> On Thu, Mar 03, 2016 at 11:37:17AM -0300, Gustavo Padovan wrote:
> > From: Gustavo Padovan 
> > 
> > Play safe and add flags member to all structs. So we don't need to
> > break API or create new IOCTL in the future if new features that requires
> > flags arises.
> > 
> > v2: check if flags are valid (zero, in this case)
> > 
> > v3: return -EINVAL if flags are not zero'ed
> > 
> > v4: add padding for 64-bit alignment
> > 
> > v5: rebase to use only stacked sync_file_info
> 
> Why are these vX things here in the changelog?

There are few people who does this in drm, so I just followed that.  

> 
> And you just broke all existing userspace users of this code, why are
> you allowed to do that?

Because we've discussed this extensively in the last versions of this
patches. Most of the people from CC agreed with it.

We are cleaning up the Android sync and coming up with a better ABI for
it before we de-stage it. Android people agreed with this and we will
patch it.

Gustavo
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH V2] staging: rtl8192u: check return value of read_nic_word_E

2016-03-03 Thread Salah Triki
The call of read_nic_word_E may fail, therefore its return value must be
checked.

Signed-off-by: Salah Triki 
---
 drivers/staging/rtl8192u/r8180_93cx6.c |  30 ++--
 drivers/staging/rtl8192u/r8180_93cx6.h |   2 +-
 drivers/staging/rtl8192u/r8192U_core.c | 129 ++---
 3 files changed, 112 insertions(+), 49 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8180_93cx6.c 
b/drivers/staging/rtl8192u/r8180_93cx6.c
index 97d9b3f..fa940e2 100644
--- a/drivers/staging/rtl8192u/r8180_93cx6.c
+++ b/drivers/staging/rtl8192u/r8180_93cx6.c
@@ -23,8 +23,11 @@
 static void eprom_cs(struct net_device *dev, short bit)
 {
u8 cmdreg;
+   int err;
 
-   read_nic_byte_E(dev, EPROM_CMD, );
+   err = read_nic_byte_E(dev, EPROM_CMD, );
+   if (err)
+   return;
if (bit)
/* enable EPROM */
write_nic_byte_E(dev, EPROM_CMD, cmdreg | EPROM_CS_BIT);
@@ -40,8 +43,11 @@ static void eprom_cs(struct net_device *dev, short bit)
 static void eprom_ck_cycle(struct net_device *dev)
 {
u8 cmdreg;
+   int err;
 
-   read_nic_byte_E(dev, EPROM_CMD, );
+   err = read_nic_byte_E(dev, EPROM_CMD, );
+   if (err)
+   return;
write_nic_byte_E(dev, EPROM_CMD, cmdreg | EPROM_CK_BIT);
force_pci_posting(dev);
udelay(EPROM_DELAY);
@@ -56,8 +62,11 @@ static void eprom_ck_cycle(struct net_device *dev)
 static void eprom_w(struct net_device *dev, short bit)
 {
u8 cmdreg;
+   int err;
 
-   read_nic_byte_E(dev, EPROM_CMD, );
+   err = read_nic_byte_E(dev, EPROM_CMD, );
+   if (err)
+   return;
if (bit)
write_nic_byte_E(dev, EPROM_CMD, cmdreg | EPROM_W_BIT);
else
@@ -68,11 +77,14 @@ static void eprom_w(struct net_device *dev, short bit)
 }
 
 
-static short eprom_r(struct net_device *dev)
+static int eprom_r(struct net_device *dev)
 {
u8 bit;
+   int ret;
 
-   read_nic_byte_E(dev, EPROM_CMD, );
+   ret = read_nic_byte_E(dev, EPROM_CMD, );
+   if (ret)
+   return ret;
udelay(EPROM_DELAY);
 
if (bit & EPROM_R_BIT)
@@ -93,7 +105,7 @@ static void eprom_send_bits_string(struct net_device *dev, 
short b[], int len)
 }
 
 
-u32 eprom_read(struct net_device *dev, u32 addr)
+int eprom_read(struct net_device *dev, u32 addr)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
short read_cmd[] = {1, 1, 0};
@@ -101,6 +113,7 @@ u32 eprom_read(struct net_device *dev, u32 addr)
int i;
int addr_len;
u32 ret;
+   int err;
 
ret = 0;
/* enable EPROM programming */
@@ -144,7 +157,10 @@ u32 eprom_read(struct net_device *dev, u32 addr)
 * and reading data. (eeprom outs a dummy 0)
 */
eprom_ck_cycle(dev);
-   ret |= (eprom_r(dev)<<(15-i));
+   err = eprom_r(dev)<<(15-i);
+   if (err)
+   return err;
+   ret |= ((u32)err);
}
 
eprom_cs(dev, 0);
diff --git a/drivers/staging/rtl8192u/r8180_93cx6.h 
b/drivers/staging/rtl8192u/r8180_93cx6.h
index b840348..9cf7f58 100644
--- a/drivers/staging/rtl8192u/r8180_93cx6.h
+++ b/drivers/staging/rtl8192u/r8180_93cx6.h
@@ -40,4 +40,4 @@
 #define EPROM_TXPW1 0x3d
 
 
-u32 eprom_read(struct net_device *dev, u32 addr); /* reads a 16 bits word */
+int eprom_read(struct net_device *dev, u32 addr); /* reads a 16 bits word */
diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 3a93218..e320b2d 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -2432,7 +2432,7 @@ static inline u16 endian_swap(u16 *data)
*data = (tmp >> 8) | (tmp << 8);
return *data;
 }
-static void rtl8192_read_eeprom_info(struct net_device *dev)
+static int rtl8192_read_eeprom_info(struct net_device *dev)
 {
u16 wEPROM_ID = 0;
u8 bMac_Tmp_Addr[6] = {0x00, 0xe0, 0x4c, 0x00, 0x00, 0x02};
@@ -2440,9 +2440,13 @@ static void rtl8192_read_eeprom_info(struct net_device 
*dev)
struct r8192_priv *priv = ieee80211_priv(dev);
u16 tmpValue = 0;
int i;
+   int ret;
 
RT_TRACE(COMP_EPROM, "===>%s()\n", __func__);
-   wEPROM_ID = eprom_read(dev, 0); /* first read EEPROM ID out; */
+   ret = eprom_read(dev, 0); /* first read EEPROM ID out; */
+   if (ret)
+   return ret;
+   wEPROM_ID = (u16) ret;
RT_TRACE(COMP_EPROM, "EEPROM ID is 0x%x\n", wEPROM_ID);
 
if (wEPROM_ID != RTL8190_EEPROM_ID)
@@ -2453,14 +2457,25 @@ static void rtl8192_read_eeprom_info(struct net_device 
*dev)
bLoad_From_EEPOM = true;
 
if (bLoad_From_EEPOM) {
-   tmpValue = eprom_read(dev, EEPROM_VID >> 1);
+   ret = eprom_read(dev, EEPROM_VID >> 1);
+   if (ret)
+ 

[PATCH] staging: rtl8192u: check return value of read_nic_word_E

2016-03-03 Thread Salah Triki
The call of read_nic_word_E may fail, therefore its return value must be
checked.

Signed-off-by: Salah Triki 
---
 drivers/staging/rtl8192u/r8180_93cx6.c |  30 ++--
 drivers/staging/rtl8192u/r8180_93cx6.h |   2 +-
 drivers/staging/rtl8192u/r8192U_core.c | 129 ++---
 3 files changed, 112 insertions(+), 49 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8180_93cx6.c 
b/drivers/staging/rtl8192u/r8180_93cx6.c
index 97d9b3f..fa940e2 100644
--- a/drivers/staging/rtl8192u/r8180_93cx6.c
+++ b/drivers/staging/rtl8192u/r8180_93cx6.c
@@ -23,8 +23,11 @@
 static void eprom_cs(struct net_device *dev, short bit)
 {
u8 cmdreg;
+   int err;
 
-   read_nic_byte_E(dev, EPROM_CMD, );
+   err = read_nic_byte_E(dev, EPROM_CMD, );
+   if (err)
+   return;
if (bit)
/* enable EPROM */
write_nic_byte_E(dev, EPROM_CMD, cmdreg | EPROM_CS_BIT);
@@ -40,8 +43,11 @@ static void eprom_cs(struct net_device *dev, short bit)
 static void eprom_ck_cycle(struct net_device *dev)
 {
u8 cmdreg;
+   int err;
 
-   read_nic_byte_E(dev, EPROM_CMD, );
+   err = read_nic_byte_E(dev, EPROM_CMD, );
+   if (err)
+   return;
write_nic_byte_E(dev, EPROM_CMD, cmdreg | EPROM_CK_BIT);
force_pci_posting(dev);
udelay(EPROM_DELAY);
@@ -56,8 +62,11 @@ static void eprom_ck_cycle(struct net_device *dev)
 static void eprom_w(struct net_device *dev, short bit)
 {
u8 cmdreg;
+   int err;
 
-   read_nic_byte_E(dev, EPROM_CMD, );
+   err = read_nic_byte_E(dev, EPROM_CMD, );
+   if (err)
+   return;
if (bit)
write_nic_byte_E(dev, EPROM_CMD, cmdreg | EPROM_W_BIT);
else
@@ -68,11 +77,14 @@ static void eprom_w(struct net_device *dev, short bit)
 }
 
 
-static short eprom_r(struct net_device *dev)
+static int eprom_r(struct net_device *dev)
 {
u8 bit;
+   int ret;
 
-   read_nic_byte_E(dev, EPROM_CMD, );
+   ret = read_nic_byte_E(dev, EPROM_CMD, );
+   if (ret)
+   return ret;
udelay(EPROM_DELAY);
 
if (bit & EPROM_R_BIT)
@@ -93,7 +105,7 @@ static void eprom_send_bits_string(struct net_device *dev, 
short b[], int len)
 }
 
 
-u32 eprom_read(struct net_device *dev, u32 addr)
+int eprom_read(struct net_device *dev, u32 addr)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
short read_cmd[] = {1, 1, 0};
@@ -101,6 +113,7 @@ u32 eprom_read(struct net_device *dev, u32 addr)
int i;
int addr_len;
u32 ret;
+   int err;
 
ret = 0;
/* enable EPROM programming */
@@ -144,7 +157,10 @@ u32 eprom_read(struct net_device *dev, u32 addr)
 * and reading data. (eeprom outs a dummy 0)
 */
eprom_ck_cycle(dev);
-   ret |= (eprom_r(dev)<<(15-i));
+   err = eprom_r(dev)<<(15-i);
+   if (err)
+   return err;
+   ret |= ((u32)err);
}
 
eprom_cs(dev, 0);
diff --git a/drivers/staging/rtl8192u/r8180_93cx6.h 
b/drivers/staging/rtl8192u/r8180_93cx6.h
index b840348..9cf7f58 100644
--- a/drivers/staging/rtl8192u/r8180_93cx6.h
+++ b/drivers/staging/rtl8192u/r8180_93cx6.h
@@ -40,4 +40,4 @@
 #define EPROM_TXPW1 0x3d
 
 
-u32 eprom_read(struct net_device *dev, u32 addr); /* reads a 16 bits word */
+int eprom_read(struct net_device *dev, u32 addr); /* reads a 16 bits word */
diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 3a93218..e320b2d 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -2432,7 +2432,7 @@ static inline u16 endian_swap(u16 *data)
*data = (tmp >> 8) | (tmp << 8);
return *data;
 }
-static void rtl8192_read_eeprom_info(struct net_device *dev)
+static int rtl8192_read_eeprom_info(struct net_device *dev)
 {
u16 wEPROM_ID = 0;
u8 bMac_Tmp_Addr[6] = {0x00, 0xe0, 0x4c, 0x00, 0x00, 0x02};
@@ -2440,9 +2440,13 @@ static void rtl8192_read_eeprom_info(struct net_device 
*dev)
struct r8192_priv *priv = ieee80211_priv(dev);
u16 tmpValue = 0;
int i;
+   int ret;
 
RT_TRACE(COMP_EPROM, "===>%s()\n", __func__);
-   wEPROM_ID = eprom_read(dev, 0); /* first read EEPROM ID out; */
+   ret = eprom_read(dev, 0); /* first read EEPROM ID out; */
+   if (ret)
+   return ret;
+   wEPROM_ID = (u16) ret;
RT_TRACE(COMP_EPROM, "EEPROM ID is 0x%x\n", wEPROM_ID);
 
if (wEPROM_ID != RTL8190_EEPROM_ID)
@@ -2453,14 +2457,25 @@ static void rtl8192_read_eeprom_info(struct net_device 
*dev)
bLoad_From_EEPOM = true;
 
if (bLoad_From_EEPOM) {
-   tmpValue = eprom_read(dev, EEPROM_VID >> 1);
+   ret = eprom_read(dev, EEPROM_VID >> 1);
+   if (ret)
+ 

[PATCH] staging: unisys: visorbus: variable adjustment should be a u64

2016-03-03 Thread David Kershner
This patch fixes the smatch error:

drivers/staging/unisys/visorbus/visorchipset.c:2217 visorchipset_ioctl()
warn: user controlled 'adjustment' cast to postive rl = 's64min-s64max'

This is because we read a s64 and pass it to a function as u64.

Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 5515845..5fbda7b 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -2248,7 +2248,7 @@ static inline int issue_vmcall_update_physical_time(u64 
adjustment)
 static long visorchipset_ioctl(struct file *file, unsigned int cmd,
   unsigned long arg)
 {
-   s64 adjustment;
+   u64 adjustment;
s64 vrtc_offset;
 
switch (cmd) {
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging/android: add flags member to sync ioctl structs

2016-03-03 Thread Greg Kroah-Hartman
On Thu, Mar 03, 2016 at 11:37:17AM -0300, Gustavo Padovan wrote:
> From: Gustavo Padovan 
> 
> Play safe and add flags member to all structs. So we don't need to
> break API or create new IOCTL in the future if new features that requires
> flags arises.
> 
> v2: check if flags are valid (zero, in this case)
> 
> v3: return -EINVAL if flags are not zero'ed
> 
> v4: add padding for 64-bit alignment
> 
> v5: rebase to use only stacked sync_file_info

Why are these vX things here in the changelog?

And you just broke all existing userspace users of this code, why are
you allowed to do that?

not ok...

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: handle complex strings in cfs_str2num_check

2016-03-03 Thread James Simmons
Originally the function cfs_str2num_check used simple_strtoul
but has been updated to kstrtoul. The string passed into
cfs_str2num_check can be a very complex, for example we could
have 10.37.202.[59-61]. When simple_strtoul was used the first
number until we hit a non-digit character could be extracted
but testing showed that kstrtoul will not return any value if
it detects any non-digit character. Because of this change in
behavior a different approach is needed to handle these types
of complex strings. The use of sscanf was investigated to see
if it could be used to extract numbers from the passed in
string but unlike its glibc counterpart the kernel version
also just reported a error with no results if a non-digit value
in the string was encountered. Another possible approach would
be to use __parse_int directly but that class of functions is
not exported by the kernel. So the approach in this patch is
to scan the string passed in for the first non-digit character
and replace that character with a '\0' so kstrtoul can be used.
Once completed the original character is restored. We also
restore a original behavior that was removed to return 0 when
we encounter any non digit character before the nob count.

Signed-off-by: James Simmons 
---
 .../staging/lustre/lustre/libcfs/libcfs_string.c   |   27 +++-
 1 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c 
b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
index 9dca666..50ac153 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
@@ -229,11 +229,36 @@ int
 cfs_str2num_check(char *str, int nob, unsigned *num,
  unsigned min, unsigned max)
 {
+   bool all_numbers = true;
+   char *endp, cache;
int rc;
 
str = cfs_trimwhite(str);
+
+   /**
+* kstrouint can only handle strings composed
+* of only numbers. We need to scan the string
+* passed in for the first non-digit character
+* and end the string at that location. If we
+* don't find any non-digit character we still
+* need to place a '\0' at position nob since
+* we are not interested in the rest of the
+* string which is longer than nob in size.
+* After we are done the character at the
+* position we placed '\0' must be restored.
+*/
+   for (endp = str; endp < str + nob; endp++) {
+   if (!isdigit(*endp)) {
+   all_numbers = false;
+   break;
+   }
+   }
+   cache = *endp;
+   *endp = '\0';
+
rc = kstrtouint(str, 10, num);
-   if (rc)
+   *endp = cache;
+   if (rc || !all_numbers)
return 0;
 
return (*num >= min && *num <= max);
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RESEND v3 5/6] staging/rdma/hfi1: adding per SDMA engine stats to hfistats

2016-03-03 Thread Doug Ledford
On 03/01/2016 03:27 PM, Jubin John wrote:
>>> diff --git a/drivers/staging/rdma/hfi1/sdma.c 
>>> b/drivers/staging/rdma/hfi1/sdma.c
>>> index 1d38be5..cb66bd0 100644
>>> --- a/drivers/staging/rdma/hfi1/sdma.c
>>> +++ b/drivers/staging/rdma/hfi1/sdma.c
>>> @@ -1061,7 +1061,6 @@ int sdma_init(struct hfi1_devdata *dd, u8 port)
>>> sde->desc_avail = sdma_descq_freecnt(sde);
>>> sde->sdma_shift = ilog2(descq_cnt);
>>> sde->sdma_mask = (1 << sde->sdma_shift) - 1;
>>> -   sde->descq_full_count = 0;
>>>  
>>> /* Create a mask for all 3 chip interrupt sources */
>>> sde->imask = (u64)1 << (0*TXE_NUM_SDMA_ENGINES + this_idx)
>>> @@ -1073,6 +1072,8 @@ int sdma_init(struct hfi1_devdata *dd, u8 port)
>>> /* Create a mask specifically for sdma_progress */
>>> sde->progress_mask =
>>> (u64)1 << (TXE_NUM_SDMA_ENGINES + this_idx);
>>> +   sde->int_mask =
>>> +   (u64)1 << (0 * TXE_NUM_SDMA_ENGINES + this_idx);
>>
>> Why is that there?
>>
> 
> Hi Doug,
> 
> The zero was intentionally added in an attempt to highlight that this
> was for the first interrupt source, like we do in other places above this
> where we have 1 * TXE_NUM_SDMA_ENGINES, 2 * TXE_NUM_SDMA_ENGINES etc.
> The interrupt sources are separated by the number of SDMA engines
> i.e TXE_NUM_SDMA_ENGINES. However, we agree that the code is not
> consistent throughout. Would you like us to do a cleanup of this code
> in a follow-on patch or rework this patch and resend the series?
> 
> Jubin
> 

Thanks, the code is confusing to read, so a cleanup would be nice.  Just
send me something I can squash into this patch is good enough.

-- 
Doug Ledford 
  GPG KeyID: 0E572FDD




signature.asc
Description: OpenPGP digital signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging/android: refactor SYNC_IOC_FILE_INFO

2016-03-03 Thread Maarten Lankhorst
Op 03-03-16 om 15:34 schreef Gustavo Padovan:
> From: Gustavo Padovan 
>
> Change SYNC_IOC_FILE_INFO behaviour to avoid future API breaks and
> optimize buffer
>
> Now num_fences can be filled by the caller to inform how many fences it
> wants to retrieve from the kernel. If the num_fences passed is greater
> than zero info->sync_fence_info should point to a buffer with enough space
> to fit all fences.
>
> However if num_fences passed to the kernel is 0, the kernel will reply
> with number of fences of the sync_file.
>
> Sending first an ioctl with num_fences = 0 can optimize buffer allocation,
> in a first call with num_fences = 0 userspace will receive the actual
> number of fences in the num_fences filed.
>
> Then it can allocate a buffer with the correct size on sync_fence_info and
> call SYNC_IOC_FILE_INFO again, but now with the actual value of num_fences
> in the sync_file.
>
> Also, info->sync_fence_info was converted to __u64 pointer to prevent
> 32bit compatibility issues.
For this patch and 6/6:

Reviewed-by: Maarten Lankhorst 

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging/android: add flags member to sync ioctl structs

2016-03-03 Thread Gustavo Padovan
From: Gustavo Padovan 

Play safe and add flags member to all structs. So we don't need to
break API or create new IOCTL in the future if new features that requires
flags arises.

v2: check if flags are valid (zero, in this case)

v3: return -EINVAL if flags are not zero'ed

v4: add padding for 64-bit alignment

v5: rebase to use only stacked sync_file_info

Signed-off-by: Gustavo Padovan 
---
 drivers/staging/android/sync.c  |  8 
 drivers/staging/android/uapi/sync.h | 14 --
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index 48ee175..ae81c95 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -445,6 +445,11 @@ static long sync_file_ioctl_merge(struct sync_file 
*sync_file,
goto err_put_fd;
}
 
+   if (data.flags || data.pad) {
+   err = -EINVAL;
+   goto err_put_fd;
+   }
+
fence2 = sync_file_fdget(data.fd2);
if (!fence2) {
err = -ENOENT;
@@ -504,6 +509,9 @@ static long sync_file_ioctl_fence_info(struct sync_file 
*sync_file,
if (copy_from_user(, (void __user *)arg, sizeof(info)))
return -EFAULT;
 
+   if (info.flags || info.pad)
+   return -EINVAL;
+
/*
 * Passing num_fences = 0 means that userspace doesn't want to
 * retrieve any sync_fence_info. If num_fences = 0 we skip filling
diff --git a/drivers/staging/android/uapi/sync.h 
b/drivers/staging/android/uapi/sync.h
index a122bb5..859977c 100644
--- a/drivers/staging/android/uapi/sync.h
+++ b/drivers/staging/android/uapi/sync.h
@@ -16,14 +16,18 @@
 
 /**
  * struct sync_merge_data - data passed to merge ioctl
- * @fd2:   file descriptor of second fence
  * @name:  name of new fence
+ * @fd2:   file descriptor of second fence
  * @fence: returns the fd of the new fence to userspace
+ * @flags: merge_data flags
+ * @pad:   padding for 64-bit alignment, should always be zero
  */
 struct sync_merge_data {
-   __s32   fd2;
charname[32];
+   __s32   fd2;
__s32   fence;
+   __u32   flags;
+   __u32   pad;
 };
 
 /**
@@ -31,12 +35,14 @@ struct sync_merge_data {
  * @obj_name:  name of parent sync_timeline
  * @driver_name:   name of driver implementing the parent
  * @status:status of the fence 0:active 1:signaled <0:error
+ * @flags: fence_info flags
  * @timestamp_ns:  timestamp of status change in nanoseconds
  */
 struct sync_fence_info {
charobj_name[32];
chardriver_name[32];
__s32   status;
+   __u32   flags;
__u64   timestamp_ns;
 };
 
@@ -44,14 +50,18 @@ struct sync_fence_info {
  * struct sync_file_info - data returned from fence info ioctl
  * @name:  name of fence
  * @status:status of fence. 1: signaled 0:active <0:error
+ * @flags: sync_file_info flags
  * @num_fences number of fences in the sync_file
+ * @pad:   padding for 64-bit alignment, should always be zero
  * @sync_fence_info: pointer to array of structs sync_fence_info with all
  *  fences in the sync_file
  */
 struct sync_file_info {
charname[32];
__s32   status;
+   __u32   flags;
__u32   num_fences;
+   __u32   pad;
 
__u64   sync_fence_info;
 };
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging/android: refactor SYNC_IOC_FILE_INFO

2016-03-03 Thread Gustavo Padovan
From: Gustavo Padovan 

Change SYNC_IOC_FILE_INFO behaviour to avoid future API breaks and
optimize buffer

Now num_fences can be filled by the caller to inform how many fences it
wants to retrieve from the kernel. If the num_fences passed is greater
than zero info->sync_fence_info should point to a buffer with enough space
to fit all fences.

However if num_fences passed to the kernel is 0, the kernel will reply
with number of fences of the sync_file.

Sending first an ioctl with num_fences = 0 can optimize buffer allocation,
in a first call with num_fences = 0 userspace will receive the actual
number of fences in the num_fences filed.

Then it can allocate a buffer with the correct size on sync_fence_info and
call SYNC_IOC_FILE_INFO again, but now with the actual value of num_fences
in the sync_file.

Also, info->sync_fence_info was converted to __u64 pointer to prevent
32bit compatibility issues.

An example userspace code for the later would be:

struct sync_file_info *info;
int err, size, num_fences;

info = malloc(sizeof(*info));

info.flags = 0;
err = ioctl(fd, SYNC_IOC_FILE_INFO, info);
num_fences = info->num_fences;

if (num_fences) {
info.flags = 0;
size = sizeof(struct sync_fence_info) * num_fences;
info->num_fences = num_fences;
info->sync_fence_info = (uint64_t) calloc(num_fences,
  sizeof(struct 
sync_fence_info));

err = ioctl(fd, SYNC_IOC_FILE_INFO, info);
}

v2: fix fence_info memory leak

v3: Comments from Emil Velikov
- improve commit message
- remove __u64 cast
- remove check for output fields in file_info
- clean up sync_fill_fence_info()

Comments from Maarten Lankhorst
- remove in.num_fences && !in.sync_fence_info check
- remove info->len and use only num_fences to calculate size

Comments from Dan Carpenter
- fix info->sync_fence_info documentation

v4: remove allocated struct sync_file_info (comment from Maarten)

Signed-off-by: Gustavo Padovan 
---
 drivers/staging/android/sync.c  | 70 +
 drivers/staging/android/uapi/sync.h |  9 ++---
 2 files changed, 36 insertions(+), 43 deletions(-)

diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index dc5f382..48ee175 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -479,13 +479,9 @@ err_put_fd:
return err;
 }
 
-static int sync_fill_fence_info(struct fence *fence, void *data, int size)
+static void sync_fill_fence_info(struct fence *fence,
+   struct sync_fence_info *info)
 {
-   struct sync_fence_info *info = data;
-
-   if (size < sizeof(*info))
-   return -ENOMEM;
-
strlcpy(info->obj_name, fence->ops->get_timeline_name(fence),
sizeof(info->obj_name));
strlcpy(info->driver_name, fence->ops->get_driver_name(fence),
@@ -495,60 +491,60 @@ static int sync_fill_fence_info(struct fence *fence, void 
*data, int size)
else
info->status = 0;
info->timestamp_ns = ktime_to_ns(fence->timestamp);
-
-   return sizeof(*info);
 }
 
 static long sync_file_ioctl_fence_info(struct sync_file *sync_file,
unsigned long arg)
 {
-   struct sync_file_info *info;
+   struct sync_file_info info;
+   struct sync_fence_info *fence_info = NULL;
__u32 size;
-   __u32 len = 0;
int ret, i;
 
-   if (copy_from_user(, (void __user *)arg, sizeof(size)))
+   if (copy_from_user(, (void __user *)arg, sizeof(info)))
return -EFAULT;
 
-   if (size < sizeof(struct sync_file_info))
-   return -EINVAL;
+   /*
+* Passing num_fences = 0 means that userspace doesn't want to
+* retrieve any sync_fence_info. If num_fences = 0 we skip filling
+* sync_fence_info and return the actual number of fences on
+* info->num_fences.
+*/
+   if (!info.num_fences)
+   goto no_fences;
 
-   if (size > 4096)
-   size = 4096;
+   if (info.num_fences < sync_file->num_fences)
+   return -EINVAL;
 
-   info = kzalloc(size, GFP_KERNEL);
-   if (!info)
+   size = sync_file->num_fences * sizeof(*fence_info);
+   fence_info = kzalloc(size, GFP_KERNEL);
+   if (!fence_info)
return -ENOMEM;
 
-   strlcpy(info->name, sync_file->name, sizeof(info->name));
-   info->status = atomic_read(_file->status);
-   if (info->status >= 0)
-   info->status = !info->status;
+   for (i = 0; i < sync_file->num_fences; ++i)
+   sync_fill_fence_info(sync_file->cbs[i].fence, _info[i]);
 
-   

Re: [rtc-linux] Re: [RFC 09/15] media: platform: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Arnd Bergmann
On Thursday 03 March 2016 21:40:23 Krzysztof Kozlowski wrote:
> >> select MFD_SYSCON
> >> diff --git a/drivers/media/platform/exynos4-is/Kconfig 
> >> b/drivers/media/platform/exynos4-is/Kconfig
> >> index 57d42c6172c5..c4317b99d257 100644
> >> --- a/drivers/media/platform/exynos4-is/Kconfig
> >> +++ b/drivers/media/platform/exynos4-is/Kconfig
> >> @@ -17,6 +17,7 @@ config VIDEO_S5P_FIMC
> >> tristate "S5P/EXYNOS4 FIMC/CAMIF camera interface driver"
> >> depends on I2C
> >> depends on HAS_DMA
> >> +   depends on HAS_IOMEM# For MFD_SYSCON
> >> select VIDEOBUF2_DMA_CONTIG
> >> select V4L2_MEM2MEM_DEV
> >
> > This  is guarded by HAS_DMA, which implies HAS_IOMEM afaik.
> 
> Looking at Kconfigs - no, it is not implied (or am I missing
> something)... and sometimes dependency on HAS_IOMEM is next to
> HAS_DMA.
> 
> 

Ah, you are right: UML has no DMA and no IOMEM, but s390 can
have IOMEM (if PCI is enabled) and always sets HAS_DMA.

In practice, I think the HAS_DMA symbol is not as well-defined
as it should be, it basically refers to the presence of the dma-mapping.h
API, and that only really makes sense when you also have IOMEM,
so there might be an implied dependency between the two, but it's
not enforced or actually true.

Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC 08/15] rtc: at91sam9: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Arnd Bergmann
On Thursday 03 March 2016 13:27:59 Geert Uytterhoeven wrote:
> On Thu, Mar 3, 2016 at 11:55 AM, Arnd Bergmann  wrote:
> > On Thursday 03 March 2016 17:03:34 Krzysztof Kozlowski wrote:
> >> index 0da40e2e4280..5c530b6b125d 100644
> >> --- a/drivers/rtc/Kconfig
> >> +++ b/drivers/rtc/Kconfig
> >> @@ -1302,6 +1302,7 @@ config RTC_DRV_AT91RM9200
> >>  config RTC_DRV_AT91SAM9
> >> tristate "AT91SAM9 RTT as RTC"
> >> depends on ARCH_AT91 || COMPILE_TEST
> >> +   depends on HAS_IOMEM# For MFD_SYSCON
> >> select MFD_SYSCON
> >> help
> >>   Some AT91SAM9 SoCs provide an RTT (Real Time Timer) block which
> >>
> >
> > This is technically correct, but the entire RTC menu is hidden
> > inside of 'depends on !UML && !S390', so we won't ever get there
> > on any configuration that does not use HAS_IOMEM.
> >
> > If we did, all other RTC drivers would also fail.
> 
> So UML has no RTC. Should/can it use RTC_DRV_GENERIC?

I think nothing should use that, even if it could ;-)

Funny enough, RTC_DRV_GENERIC would probably actually work if you
run UML as root and set iopl() to allow port access, but we don't
really want it to mess with the host RTC.

I don't know where UML gets it real time, but it doesn't actually
need much other than calling clock_gettime(CLOCK_REALTIME, ...)
to get the host time. Presumably it uses some variation of that.

Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [rtc-linux] [RFC 06/15] pinctrl: rockchip: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
2016-03-03 17:03 GMT+09:00 Krzysztof Kozlowski :
> The MFD_SYSCON depends on HAS_IOMEM so when selecting it avoid unmet
> direct dependencies.
>
> Signed-off-by: Krzysztof Kozlowski 
> ---
>  drivers/pinctrl/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
> index fb8200b8e8ec..dc7ab58d4d74 100644
> --- a/drivers/pinctrl/Kconfig
> +++ b/drivers/pinctrl/Kconfig
> @@ -131,6 +131,7 @@ config PINCTRL_MESON
>
>  config PINCTRL_ROCKCHIP
> bool
> +   depends on HAS_IOMEM# For MFD_SYSCON
> select PINMUX

False alarm, no need for the patch (non-selectable symbol)

Best regards,
Krzysztof
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [rtc-linux] [RFC 07/15] pinctrl: mvebu: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
2016-03-03 17:03 GMT+09:00 Krzysztof Kozlowski :
> The MFD_SYSCON depends on HAS_IOMEM so when selecting it avoid unmet
> direct dependencies.
>
> Signed-off-by: Krzysztof Kozlowski 
> ---
>  drivers/pinctrl/mvebu/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/pinctrl/mvebu/Kconfig b/drivers/pinctrl/mvebu/Kconfig
> index 170602407c0d..13685923729c 100644
> --- a/drivers/pinctrl/mvebu/Kconfig
> +++ b/drivers/pinctrl/mvebu/Kconfig
> @@ -7,6 +7,7 @@ config PINCTRL_MVEBU
>
>  config PINCTRL_DOVE
> bool
> +   depends on HAS_IOMEM# For MFD_SYSCON
> select PINCTRL_MVEBU
> select MFD_SYSCON

False alarm, no need for the patch (non-selectable symbol)

Best regards,
Krzysztof
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [rtc-linux] [RFC 12/15] soc: qcom: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
2016-03-03 17:03 GMT+09:00 Krzysztof Kozlowski :
> The MFD_SYSCON depends on HAS_IOMEM so when selecting it avoid unmet
> direct dependencies.
>
> Signed-off-by: Krzysztof Kozlowski 
> ---
>  drivers/soc/qcom/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
> index 461b387d03cc..24de48134c15 100644
> --- a/drivers/soc/qcom/Kconfig
> +++ b/drivers/soc/qcom/Kconfig
> @@ -4,6 +4,7 @@
>  config QCOM_GSBI
>  tristate "QCOM General Serial Bus Interface"
>  depends on ARCH_QCOM
> +depends on HAS_IOMEM   # For MFD_SYSCON
>  select MFD_SYSCON

False alarm, no need for the patch (this depends on ARCH_QCOM).

Best regards,
Krzysztof
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [rtc-linux] [RFC 13/15] staging: media: omap4iss: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
2016-03-03 17:03 GMT+09:00 Krzysztof Kozlowski :
> The MFD_SYSCON depends on HAS_IOMEM so when selecting it avoid unmet
> direct dependencies.
>
> Signed-off-by: Krzysztof Kozlowski 
> ---
>  drivers/staging/media/omap4iss/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/staging/media/omap4iss/Kconfig 
> b/drivers/staging/media/omap4iss/Kconfig
> index 46183464ee79..7dea072172aa 100644
> --- a/drivers/staging/media/omap4iss/Kconfig
> +++ b/drivers/staging/media/omap4iss/Kconfig
> @@ -2,6 +2,7 @@ config VIDEO_OMAP4
> tristate "OMAP 4 Camera support"
> depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && I2C && ARCH_OMAP4
> depends on HAS_DMA
> +   depends on HAS_IOMEM# For MFD_SYSCON
> select MFD_SYSCON
> select VIDEOBUF2_DMA_CONTIG
> ---help---

False alarm, no need for the patch (this depends on ARCH_OMAP4).

Best regards,
Krzysztof
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [rtc-linux] Re: [RFC 09/15] media: platform: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
2016-03-03 19:57 GMT+09:00 Arnd Bergmann :
> On Thursday 03 March 2016 17:03:35 Krzysztof Kozlowski wrote:
>> diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
>> index 201f5c296a95..e5931e434fa2 100644
>> --- a/drivers/media/platform/Kconfig
>> +++ b/drivers/media/platform/Kconfig
>> @@ -79,6 +79,7 @@ config VIDEO_OMAP3
>> depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API && ARCH_OMAP3
>> depends on HAS_DMA && OF
>> depends on OMAP_IOMMU
>> +   depends on HAS_IOMEM# For MFD_SYSCON
>> select ARM_DMA_USE_IOMMU
>> select VIDEOBUF2_DMA_CONTIG
>
> This is only built for OMAP3, so we won't get here without HAS_IOMEM

Indeed.

>
>> select MFD_SYSCON
>> diff --git a/drivers/media/platform/exynos4-is/Kconfig 
>> b/drivers/media/platform/exynos4-is/Kconfig
>> index 57d42c6172c5..c4317b99d257 100644
>> --- a/drivers/media/platform/exynos4-is/Kconfig
>> +++ b/drivers/media/platform/exynos4-is/Kconfig
>> @@ -17,6 +17,7 @@ config VIDEO_S5P_FIMC
>> tristate "S5P/EXYNOS4 FIMC/CAMIF camera interface driver"
>> depends on I2C
>> depends on HAS_DMA
>> +   depends on HAS_IOMEM# For MFD_SYSCON
>> select VIDEOBUF2_DMA_CONTIG
>> select V4L2_MEM2MEM_DEV
>
> This  is guarded by HAS_DMA, which implies HAS_IOMEM afaik.

Looking at Kconfigs - no, it is not implied (or am I missing
something)... and sometimes dependency on HAS_IOMEM is next to
HAS_DMA.

BR,
Krzysztof
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [rtc-linux] Re: [RFC 11/15] power: reset: keystone: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
2016-03-03 21:33 GMT+09:00 Sebastian Reichel :
> Hi,
>
> On Thu, Mar 03, 2016 at 12:00:14PM +0100, Arnd Bergmann wrote:
>> On Thursday 03 March 2016 17:03:37 Krzysztof Kozlowski wrote:
>> > diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
>> > index 0a6408a39c66..0f34846ae80d 100644
>> > --- a/drivers/power/reset/Kconfig
>> > +++ b/drivers/power/reset/Kconfig
>> > @@ -141,6 +141,7 @@ config POWER_RESET_XGENE
>> >  config POWER_RESET_KEYSTONE
>> > bool "Keystone reset driver"
>> > depends on ARCH_KEYSTONE
>> > +   depends on HAS_IOMEM# For MFD_SYSCON
>> > select MFD_SYSCON
>> > help
>> >   Reboot support for the KEYSTONE SoCs.
>> >
>>
>> This is platform specific, but we should probably add || COMPILE_TEST
>> along with the HAS_IOMEM dependency.
>
> Sounds sensible. Will you guys send an updated patch?
>

Sure, I'll make some compile tests and send a v2.

Best regards,
Krzysztof
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC 11/15] power: reset: keystone: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Sebastian Reichel
Hi,

On Thu, Mar 03, 2016 at 12:00:14PM +0100, Arnd Bergmann wrote:
> On Thursday 03 March 2016 17:03:37 Krzysztof Kozlowski wrote:
> > diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
> > index 0a6408a39c66..0f34846ae80d 100644
> > --- a/drivers/power/reset/Kconfig
> > +++ b/drivers/power/reset/Kconfig
> > @@ -141,6 +141,7 @@ config POWER_RESET_XGENE
> >  config POWER_RESET_KEYSTONE
> > bool "Keystone reset driver"
> > depends on ARCH_KEYSTONE
> > +   depends on HAS_IOMEM# For MFD_SYSCON
> > select MFD_SYSCON
> > help
> >   Reboot support for the KEYSTONE SoCs.
> > 
> 
> This is platform specific, but we should probably add || COMPILE_TEST
> along with the HAS_IOMEM dependency.

Sounds sensible. Will you guys send an updated patch?

-- Sebastian


signature.asc
Description: PGP signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [rtc-linux] Re: [RFC 04/15] irqchip: st: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozłowski
2016-03-03 21:28 GMT+09:00 Arnd Bergmann :
> On Thursday 03 March 2016 21:00:57 Krzysztof Kozlowski wrote:
>> >
>> > Not user visible.
>>
>> Hmmm... you are right (here and in other patches) but why am I getting
>> all these errors:
>> warning: (ST_IRQCHIP && HIP04_ETH && STMMAC_PLATFORM && DWMAC_IPQ806X
>> && DWMAC_LPC18XX && DWMAC_ROCKCHIP && DWMAC_SOCFPGA && DWMAC_STI &&
>> TI_CPSW && PINCTRL_ROCKCHIP && PINCTRL_DOVE && POWER_RESET_KEYSTONE &&
>> S3C2410_WATCHDOG && VIDEO_OMAP3 && VIDEO_S5P_FIMC && USB_XHCI_MTK &&
>> RTC_DRV_AT91SAM9 && LPC18XX_DMAMUX && VIDEO_OMAP4 && HWSPINLOCK_QCOM
>> && ATMEL_ST && QCOM_GSBI && PHY_HI6220_USB) selects MFD_SYSCON which
>> has unmet direct dependencies (HAS_IOMEM)
>> ?
>> (ARCH=um, allyesconfig)
>
> The problem is that Kconfig will just print any option that
> selects the one that has a missing dependency, but doesn't
> show which of those are actually enabled.

Indeed... but apparently putting direct HAS_IOMEM dependency on these
symbols silences the Kconfig warning.

>> Adding depends here (and in other places) really helps... but it
>> should not have any impact...
>
> I think patch 5 by itself would have been sufficient.

Thanks for analysis. Since all patches are independent (and IMHO the
last one is not needed really) so I won't resend the patchset. Instead
let maintainer pick what is meaningful.

Best regards,
Krzysztof
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [rtc-linux] Re: [RFC 04/15] irqchip: st: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Arnd Bergmann
On Thursday 03 March 2016 21:00:57 Krzysztof Kozlowski wrote:
> >
> > Not user visible.
> 
> Hmmm... you are right (here and in other patches) but why am I getting
> all these errors:
> warning: (ST_IRQCHIP && HIP04_ETH && STMMAC_PLATFORM && DWMAC_IPQ806X
> && DWMAC_LPC18XX && DWMAC_ROCKCHIP && DWMAC_SOCFPGA && DWMAC_STI &&
> TI_CPSW && PINCTRL_ROCKCHIP && PINCTRL_DOVE && POWER_RESET_KEYSTONE &&
> S3C2410_WATCHDOG && VIDEO_OMAP3 && VIDEO_S5P_FIMC && USB_XHCI_MTK &&
> RTC_DRV_AT91SAM9 && LPC18XX_DMAMUX && VIDEO_OMAP4 && HWSPINLOCK_QCOM
> && ATMEL_ST && QCOM_GSBI && PHY_HI6220_USB) selects MFD_SYSCON which
> has unmet direct dependencies (HAS_IOMEM)
> ?
> (ARCH=um, allyesconfig)

The problem is that Kconfig will just print any option that
selects the one that has a missing dependency, but doesn't
show which of those are actually enabled.

> Adding depends here (and in other places) really helps... but it
> should not have any impact...

I think patch 5 by itself would have been sufficient.

Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC 08/15] rtc: at91sam9: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Geert Uytterhoeven
On Thu, Mar 3, 2016 at 11:55 AM, Arnd Bergmann  wrote:
> On Thursday 03 March 2016 17:03:34 Krzysztof Kozlowski wrote:
>> index 0da40e2e4280..5c530b6b125d 100644
>> --- a/drivers/rtc/Kconfig
>> +++ b/drivers/rtc/Kconfig
>> @@ -1302,6 +1302,7 @@ config RTC_DRV_AT91RM9200
>>  config RTC_DRV_AT91SAM9
>> tristate "AT91SAM9 RTT as RTC"
>> depends on ARCH_AT91 || COMPILE_TEST
>> +   depends on HAS_IOMEM# For MFD_SYSCON
>> select MFD_SYSCON
>> help
>>   Some AT91SAM9 SoCs provide an RTT (Real Time Timer) block which
>>
>
> This is technically correct, but the entire RTC menu is hidden
> inside of 'depends on !UML && !S390', so we won't ever get there
> on any configuration that does not use HAS_IOMEM.
>
> If we did, all other RTC drivers would also fail.

So UML has no RTC. Should/can it use RTC_DRV_GENERIC?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC 09/15] media: platform: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Geert Uytterhoeven
On Thu, Mar 3, 2016 at 11:57 AM, Arnd Bergmann  wrote:
>> --- a/drivers/media/platform/exynos4-is/Kconfig
>> +++ b/drivers/media/platform/exynos4-is/Kconfig
>> @@ -17,6 +17,7 @@ config VIDEO_S5P_FIMC
>> tristate "S5P/EXYNOS4 FIMC/CAMIF camera interface driver"
>> depends on I2C
>> depends on HAS_DMA
>> +   depends on HAS_IOMEM# For MFD_SYSCON
>> select VIDEOBUF2_DMA_CONTIG
>> select V4L2_MEM2MEM_DEV
>
> This  is guarded by HAS_DMA, which implies HAS_IOMEM afaik.

No systems around with HV-based DMA?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [rtc-linux] Re: [RFC 15/15] mfd: syscon: Fix build of missing ioremap on UM

2016-03-03 Thread Krzysztof Kozlowski
2016-03-03 19:50 GMT+09:00 Arnd Bergmann :
> On Thursday 03 March 2016 17:03:41 Krzysztof Kozlowski wrote:
>> Since commit c89c0114955a ("mfd: syscon: Set regmap max_register in
>> of_syscon_register") the syscon uses ioremap so it fails on COMPILE_TEST
>> without HAS_IOMEM:
>>
>> drivers/mfd/syscon.c: In function ‘of_syscon_register’:
>> drivers/mfd/syscon.c:67:9: error: implicit declaration of function ‘ioremap’ 
>> [-Werror=implicit-function-declaration]
>>   base = ioremap(res.start, resource_size());
>>  ^
>> drivers/mfd/syscon.c:67:7: warning: assignment makes pointer from integer 
>> without a cast [-Wint-conversion]
>>   base = ioremap(res.start, resource_size());
>>^
>> drivers/mfd/syscon.c:109:2: error: implicit declaration of function 
>> ‘iounmap’ [-Werror=implicit-function-declaration]
>>   iounmap(base);
>>
>> When selecting MFD_SYSCON, depend on HAS_IOMEM to avoid unmet direct
>> dependencies.
>>
>> Reported-by: kbuild test robot 
>> Fixes: c89c0114955a ("mfd: syscon: Set regmap max_register in 
>> of_syscon_register")
>> Signed-off-by: Krzysztof Kozlowski 
>> ---
>
> Thanks for looking into this, the patches all look right to me, but
> I fear we are forever playing catch-up here, as the number of syscon users
> is only growing, and it's not obvious to the average driver developer
> why they have to select this symbol.

Actually I screwed something because entire MFD menuconfig (including
MFD_SYSCON) is already guarded by if HAS_IOMEM.

I was fixing the problem from the end (the build error) and then hit
these unmet direct dependencies (mentioned this in other mail).

I think this patch 15/15 is not needed.

>
> Interestingly, when I try to build an allmodconfig kernel for UML,
> it seems to reject any driver calling ioremap/iounmap but not
> the wrapper functions around that (of_iomap, devm_ioremap,
> devm_ioremap_resource, ...)

The declaration of devm-like functions is always there. However it
should fail during linking stage (see my other patches like for
thermal, nvram etc. this is still in progress because I did not manage
to build allyesconfig on UML yet).

> or the actual accessors that make no
> sense without ioremap (readl, writel, inb, outb, iowrite32, ...).
>
> I've played with this a bit, and arrived at the patch below, is this
> something we want as well?
>
> Arnd
>
>> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
>> index aa21dc55eb15..2e5b1e525a1d 100644
>> --- a/drivers/mfd/Kconfig
>> +++ b/drivers/mfd/Kconfig
>> @@ -1034,6 +1034,7 @@ config MFD_SUN6I_PRCM
>>
>>  config MFD_SYSCON
>>   bool "System Controller Register R/W Based on Regmap"
>> + depends on HAS_IOMEM
>>   select REGMAP_MMIO
>>   help
>> Select this option to enable accessing system control registers
>>
>
>
>  arch/um/include/asm/io.h   |1 +
>  drivers/char/Kconfig   |3 +++
>  drivers/char/mem.c |   16 
>  drivers/clocksource/Kconfig|3 +++
>  drivers/fmc/Kconfig|1 +
>  drivers/fpga/Kconfig   |1 +
>  drivers/hwtracing/intel_th/Kconfig |1 +
>  drivers/mfd/Kconfig|1 +
>  drivers/misc/altera-stapl/Kconfig  |2 +-
>  drivers/mtd/chips/Kconfig  |4 
>  drivers/mtd/lpddr/Kconfig  |1 +
>  drivers/mtd/maps/Kconfig   |3 ++-
>  drivers/mtd/nand/Kconfig   |2 +-
>  drivers/mtd/spi-nor/Kconfig|1 +
>  drivers/net/can/Kconfig|1 +
>  drivers/net/hamradio/Kconfig   |9 ++---
>  drivers/nvmem/Kconfig  |1 +
>  drivers/phy/Kconfig|9 +++--
>  drivers/power/reset/Kconfig|4 +++-
>  drivers/staging/comedi/Kconfig |6 +-
>  drivers/thermal/Kconfig|   11 +--

For some of these I already started fixing:
https://lkml.org/lkml/2016/3/3/147
http://comments.gmane.org/gmane.linux.kernel/2167664


>  include/linux/irq.h|2 ++
>  include/linux/mtd/cfi.h|2 ++
>  include/linux/mtd/map.h|2 ++
>  kernel/resource.c  |2 ++
>  lib/Kconfig|7 ++-
>  mm/bootmem.c   |4 ++--
>  27 files changed, 85 insertions(+), 15 deletions(-)
>
> diff --git a/arch/um/include/asm/io.h b/arch/um/include/asm/io.h
> new file mode 100644
> index 000..618ff13
> --- /dev/null
> +++ b/arch/um/include/asm/io.h
> @@ -0,0 +1 @@
> +/* no IOPORT or IOMEM suport */
> diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
> index a043107..f6dc17a 100644
> --- a/drivers/char/Kconfig
> +++ b/drivers/char/Kconfig
> @@ -8,6 +8,7 @@ source "drivers/tty/Kconfig"
>
>  config DEVMEM
> bool "/dev/mem virtual device support"
> +   depends on HAS_IOMEM
> default y
> help
>   Say Y here if you want to support the 

[PATCH 2/6] staging: wilc1000: remove commented codes

2016-03-03 Thread Chaehyun Lim
This patch removes commented codes in struct wilc_cfg_str.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_wlan_cfg.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.c 
b/drivers/staging/wilc1000/wilc_wlan_cfg.c
index b992243..b25d772 100644
--- a/drivers/staging/wilc1000/wilc_wlan_cfg.c
+++ b/drivers/staging/wilc1000/wilc_wlan_cfg.c
@@ -136,7 +136,6 @@ static struct wilc_cfg_str g_cfg_str[] = {
{WID_BSSID, g_mac.bssid},   /* 6 bytes */
{WID_WEP_KEY_VALUE, g_mac.wep_key}, /* 27 bytes */
{WID_11I_PSK, g_mac.i_psk}, /* 65 bytes */
-   /* {WID_11E_P_ACTION_REQ, g_mac.action_req}, */
{WID_HARDWARE_VERSION, g_mac.hardwareProductVersion},
{WID_MAC_ADDR, g_mac.mac_address},
{WID_PHY_VERSION, g_mac.phyversion},
@@ -144,10 +143,8 @@ static struct wilc_cfg_str g_cfg_str[] = {
{WID_SUPP_PASSWORD, g_mac.supp_password},
{WID_SITE_SURVEY_RESULTS, g_mac.scan_result},
{WID_SITE_SURVEY_RESULTS, g_mac.scan_result1},
-   /* {WID_RX_POWER_LEVEL, g_mac.channel_rssi}, */
{WID_ASSOC_REQ_INFO, g_mac.assoc_req},
{WID_ASSOC_RES_INFO, g_mac.assoc_rsp},
-   /* {WID_11N_P_ACTION_REQ, g_mac.action_req}, */
{WID_FIRMWARE_INFO, g_mac.firmware_version},
{WID_IP_ADDRESS, g_mac.ip_address},
{WID_NIL, NULL}
-- 
2.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/6] staging: wilc1000: rename hardwareProductVersion in struct wilc_mac_cfg

2016-03-03 Thread Chaehyun Lim
This patch renames hardwareProductVersion to hw_product_version to avoid
camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_wlan_cfg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.c 
b/drivers/staging/wilc1000/wilc_wlan_cfg.c
index b25d772..6a33187 100644
--- a/drivers/staging/wilc1000/wilc_wlan_cfg.c
+++ b/drivers/staging/wilc1000/wilc_wlan_cfg.c
@@ -29,7 +29,7 @@ struct wilc_mac_cfg {
u8 supp_rate[24];
u8 wep_key[28];
u8 i_psk[66];
-   u8 hardwareProductVersion[33];
+   u8 hw_product_version[33];
u8 phyversion[17];
u8 supp_username[21];
u8 supp_password[64];
@@ -136,7 +136,7 @@ static struct wilc_cfg_str g_cfg_str[] = {
{WID_BSSID, g_mac.bssid},   /* 6 bytes */
{WID_WEP_KEY_VALUE, g_mac.wep_key}, /* 27 bytes */
{WID_11I_PSK, g_mac.i_psk}, /* 65 bytes */
-   {WID_HARDWARE_VERSION, g_mac.hardwareProductVersion},
+   {WID_HARDWARE_VERSION, g_mac.hw_product_version},
{WID_MAC_ADDR, g_mac.mac_address},
{WID_PHY_VERSION, g_mac.phyversion},
{WID_SUPP_USERNAME, g_mac.supp_username},
-- 
2.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 6/6] staging: wilc1000: use switch statement instead of multiple if statement

2016-03-03 Thread Chaehyun Lim
It is more readable than multiple if-else statement.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_wlan_cfg.c | 26 +++---
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.c 
b/drivers/staging/wilc1000/wilc_wlan_cfg.c
index 92f6d32..b3425b9 100644
--- a/drivers/staging/wilc1000/wilc_wlan_cfg.c
+++ b/drivers/staging/wilc1000/wilc_wlan_cfg.c
@@ -378,19 +378,31 @@ int wilc_wlan_cfg_set_wid(u8 *frame, u32 offset, u16 id, 
u8 *buf, int size)
u8 type = (id >> 12) & 0xf;
int ret = 0;
 
-   if (type == CFG_BYTE_CMD) {
+   switch (type) {
+   case CFG_BYTE_CMD:
if (size >= 1)
ret = wilc_wlan_cfg_set_byte(frame, offset, id, *buf);
-   } else if (type == CFG_HWORD_CMD) {
+   break;
+
+   case CFG_HWORD_CMD:
if (size >= 2)
-   ret = wilc_wlan_cfg_set_hword(frame, offset, id, *((u16 
*)buf));
-   } else if (type == CFG_WORD_CMD) {
+   ret = wilc_wlan_cfg_set_hword(frame, offset, id,
+ *((u16 *)buf));
+   break;
+
+   case CFG_WORD_CMD:
if (size >= 4)
-   ret = wilc_wlan_cfg_set_word(frame, offset, id, *((u32 
*)buf));
-   } else if (type == CFG_STR_CMD) {
+   ret = wilc_wlan_cfg_set_word(frame, offset, id,
+*((u32 *)buf));
+   break;
+
+   case CFG_STR_CMD:
ret = wilc_wlan_cfg_set_str(frame, offset, id, buf, size);
-   } else if (type == CFG_BIN_CMD) {
+   break;
+
+   case CFG_BIN_CMD:
ret = wilc_wlan_cfg_set_bin(frame, offset, id, buf, size);
+   break;
}
 
return ret;
-- 
2.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/6] staging: wilc1000: use TAG_PARAM_OFFSET define

2016-03-03 Thread Chaehyun Lim
TAG_PARAM_OFFSET is defined at top of this file so that it is used
to simplify codes.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/coreconfigurator.c | 12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
b/drivers/staging/wilc1000/coreconfigurator.c
index 25dc108..2c4ae1f 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -178,10 +178,8 @@ static inline void get_ssid(u8 *data, u8 *ssid, u8 
*p_ssid_len)
u8 i   = 0;
u8 j   = 0;
 
-   len = data[MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN +
-  CAP_INFO_LEN + 1];
-   j   = MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN +
-   CAP_INFO_LEN + 2;
+   len = data[TAG_PARAM_OFFSET + 1];
+   j   = TAG_PARAM_OFFSET + 2;
 
if (len >= MAX_SSID_LEN)
len = 0;
@@ -335,10 +333,8 @@ s32 wilc_parse_network_info(u8 *msg_buffer,
tim_elm = get_tim_elm(msa, rx_len + FCS_LEN, index);
if (tim_elm)
network_info->dtim_period = tim_elm[3];
-   ies = [MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN +
-  CAP_INFO_LEN];
-   ies_len = rx_len - (MAC_HDR_LEN + TIME_STAMP_LEN +
-   BEACON_INTERVAL_LEN + CAP_INFO_LEN);
+   ies = [TAG_PARAM_OFFSET];
+   ies_len = rx_len - TAG_PARAM_OFFSET;
 
if (ies_len > 0) {
network_info->ies = kmemdup(ies, ies_len, GFP_KERNEL);
-- 
2.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/6] staging: wilc1000: add enum cfg_type_cmd

2016-03-03 Thread Chaehyun Lim
This patch adds a new enum cfg_type_cmd to change hard-coded command
type.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_wlan_cfg.c | 25 -
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.c 
b/drivers/staging/wilc1000/wilc_wlan_cfg.c
index 6a33187..9cf68b7 100644
--- a/drivers/staging/wilc1000/wilc_wlan_cfg.c
+++ b/drivers/staging/wilc1000/wilc_wlan_cfg.c
@@ -18,6 +18,13 @@
  *  Global Data
  *
  /
+enum cfg_cmd_type {
+   CFG_BYTE_CMD= 0,
+   CFG_HWORD_CMD   = 1,
+   CFG_WORD_CMD= 2,
+   CFG_STR_CMD = 3,
+   CFG_BIN_CMD = 4
+};
 
 struct wilc_mac_cfg {
int mac_status;
@@ -371,18 +378,18 @@ int wilc_wlan_cfg_set_wid(u8 *frame, u32 offset, u16 id, 
u8 *buf, int size)
u8 type = (id >> 12) & 0xf;
int ret = 0;
 
-   if (type == 0) {/* byte command 
*/
+   if (type == CFG_BYTE_CMD) {/* 
byte command */
if (size >= 1)
ret = wilc_wlan_cfg_set_byte(frame, offset, id, *buf);
-   } else if (type == 1) { /* half word command */
+   } else if (type == CFG_HWORD_CMD) { /* half word 
command */
if (size >= 2)
ret = wilc_wlan_cfg_set_hword(frame, offset, id, *((u16 
*)buf));
-   } else if (type == 2) { /* word command */
+   } else if (type == CFG_WORD_CMD) { /* word command */
if (size >= 4)
ret = wilc_wlan_cfg_set_word(frame, offset, id, *((u32 
*)buf));
-   } else if (type == 3) { /* string command */
+   } else if (type == CFG_STR_CMD) { /* string command */
ret = wilc_wlan_cfg_set_str(frame, offset, id, buf, size);
-   } else if (type == 4) { /* binary command */
+   } else if (type == CFG_BIN_CMD) { /* binary command */
ret = wilc_wlan_cfg_set_bin(frame, offset, id, buf, size);
}
 
@@ -415,7 +422,7 @@ int wilc_wlan_cfg_get_wid_value(u16 wid, u8 *buffer, u32 
buffer_size)
}
 
i = 0;
-   if (type == 0) {/* byte command 
*/
+   if (type == CFG_BYTE_CMD) {/* 
byte command */
do {
if (g_cfg_byte[i].id == WID_NIL)
break;
@@ -427,7 +434,7 @@ int wilc_wlan_cfg_get_wid_value(u16 wid, u8 *buffer, u32 
buffer_size)
}
i++;
} while (1);
-   } else if (type == 1) { /* half word command */
+   } else if (type == CFG_HWORD_CMD) { /* half word 
command */
do {
if (g_cfg_hword[i].id == WID_NIL)
break;
@@ -439,7 +446,7 @@ int wilc_wlan_cfg_get_wid_value(u16 wid, u8 *buffer, u32 
buffer_size)
}
i++;
} while (1);
-   } else if (type == 2) { /* word command */
+   } else if (type == CFG_WORD_CMD) { /* word command */
do {
if (g_cfg_word[i].id == WID_NIL)
break;
@@ -451,7 +458,7 @@ int wilc_wlan_cfg_get_wid_value(u16 wid, u8 *buffer, u32 
buffer_size)
}
i++;
} while (1);
-   } else if (type == 3) { /* string command */
+   } else if (type == CFG_STR_CMD) { /* string command */
do {
if (g_cfg_str[i].id == WID_NIL)
break;
-- 
2.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 5/6] staging: wilc1000: remove unnecessary comments

2016-03-03 Thread Chaehyun Lim
This patch removes unnecessary comments because enum cfg_cmd_type
shows each command type without it.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_wlan_cfg.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.c 
b/drivers/staging/wilc1000/wilc_wlan_cfg.c
index 9cf68b7..92f6d32 100644
--- a/drivers/staging/wilc1000/wilc_wlan_cfg.c
+++ b/drivers/staging/wilc1000/wilc_wlan_cfg.c
@@ -378,18 +378,18 @@ int wilc_wlan_cfg_set_wid(u8 *frame, u32 offset, u16 id, 
u8 *buf, int size)
u8 type = (id >> 12) & 0xf;
int ret = 0;
 
-   if (type == CFG_BYTE_CMD) {/* 
byte command */
+   if (type == CFG_BYTE_CMD) {
if (size >= 1)
ret = wilc_wlan_cfg_set_byte(frame, offset, id, *buf);
-   } else if (type == CFG_HWORD_CMD) { /* half word 
command */
+   } else if (type == CFG_HWORD_CMD) {
if (size >= 2)
ret = wilc_wlan_cfg_set_hword(frame, offset, id, *((u16 
*)buf));
-   } else if (type == CFG_WORD_CMD) { /* word command */
+   } else if (type == CFG_WORD_CMD) {
if (size >= 4)
ret = wilc_wlan_cfg_set_word(frame, offset, id, *((u32 
*)buf));
-   } else if (type == CFG_STR_CMD) { /* string command */
+   } else if (type == CFG_STR_CMD) {
ret = wilc_wlan_cfg_set_str(frame, offset, id, buf, size);
-   } else if (type == CFG_BIN_CMD) { /* binary command */
+   } else if (type == CFG_BIN_CMD) {
ret = wilc_wlan_cfg_set_bin(frame, offset, id, buf, size);
}
 
@@ -422,7 +422,7 @@ int wilc_wlan_cfg_get_wid_value(u16 wid, u8 *buffer, u32 
buffer_size)
}
 
i = 0;
-   if (type == CFG_BYTE_CMD) {/* 
byte command */
+   if (type == CFG_BYTE_CMD) {
do {
if (g_cfg_byte[i].id == WID_NIL)
break;
@@ -434,7 +434,7 @@ int wilc_wlan_cfg_get_wid_value(u16 wid, u8 *buffer, u32 
buffer_size)
}
i++;
} while (1);
-   } else if (type == CFG_HWORD_CMD) { /* half word 
command */
+   } else if (type == CFG_HWORD_CMD) {
do {
if (g_cfg_hword[i].id == WID_NIL)
break;
@@ -446,7 +446,7 @@ int wilc_wlan_cfg_get_wid_value(u16 wid, u8 *buffer, u32 
buffer_size)
}
i++;
} while (1);
-   } else if (type == CFG_WORD_CMD) { /* word command */
+   } else if (type == CFG_WORD_CMD) {
do {
if (g_cfg_word[i].id == WID_NIL)
break;
@@ -458,7 +458,7 @@ int wilc_wlan_cfg_get_wid_value(u16 wid, u8 *buffer, u32 
buffer_size)
}
i++;
} while (1);
-   } else if (type == CFG_STR_CMD) { /* string command */
+   } else if (type == CFG_STR_CMD) {
do {
if (g_cfg_str[i].id == WID_NIL)
break;
-- 
2.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [rtc-linux] Re: [RFC 04/15] irqchip: st: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
2016-03-03 19:53 GMT+09:00 Arnd Bergmann :
> On Thursday 03 March 2016 17:03:30 Krzysztof Kozlowski wrote:
>>  config ST_IRQCHIP
>> bool
>> select REGMAP
>> +   depends on HAS_IOMEM# For MFD_SYSCON
>> select MFD_SYSCON
>> help
>>   Enables SysCfg Controlled IRQs on STi based platforms.
>>
>
> Not user visible.

Hmmm... you are right (here and in other patches) but why am I getting
all these errors:
warning: (ST_IRQCHIP && HIP04_ETH && STMMAC_PLATFORM && DWMAC_IPQ806X
&& DWMAC_LPC18XX && DWMAC_ROCKCHIP && DWMAC_SOCFPGA && DWMAC_STI &&
TI_CPSW && PINCTRL_ROCKCHIP && PINCTRL_DOVE && POWER_RESET_KEYSTONE &&
S3C2410_WATCHDOG && VIDEO_OMAP3 && VIDEO_S5P_FIMC && USB_XHCI_MTK &&
RTC_DRV_AT91SAM9 && LPC18XX_DMAMUX && VIDEO_OMAP4 && HWSPINLOCK_QCOM
&& ATMEL_ST && QCOM_GSBI && PHY_HI6220_USB) selects MFD_SYSCON which
has unmet direct dependencies (HAS_IOMEM)
?
(ARCH=um, allyesconfig)
Adding depends here (and in other places) really helps... but it
should not have any impact...

Thanks for comments,
Krzysztof
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 5/5] staging: media: lirc: use new parport device model

2016-03-03 Thread Sudip Mukherjee
On Mon, Jan 25, 2016 at 03:12:57PM -0200, Mauro Carvalho Chehab wrote:
> Em Mon, 25 Jan 2016 22:32:31 +0530
> Sudip Mukherjee  escreveu:
> 
> > On Mon, Jan 25, 2016 at 02:29:06PM -0200, Mauro Carvalho Chehab wrote:
> > > Em Fri, 18 Dec 2015 18:35:29 +0530
> > > Sudip Mukherjee  escreveu:
> > >   
> > > > Modify lirc_parallel driver to use the new parallel port device model.  
> > > 
> > > Did you or someone else tested this patch?  
> > 
> > Only build tested and tested by inserting and removing the module.
> > But since the only change is in the way it registers and nothing else
> > so it should not break.
> 
> It would be worth to wait for a while in the hope that someone could
> test with a real hardware.

Hi Mauro,
Merge window is almost going to open. Maybe now you can consider
applying it.

regards
sudip
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC 14/15] usb: xhci: mtk: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Arnd Bergmann
On Thursday 03 March 2016 17:03:40 Krzysztof Kozlowski wrote:
> index 8c20ebbc049c..f759a778d606 100644
> --- a/drivers/usb/host/Kconfig
> +++ b/drivers/usb/host/Kconfig
> @@ -45,6 +45,7 @@ config USB_XHCI_PLATFORM
>  
>  config USB_XHCI_MTK
> tristate "xHCI support for Mediatek MT65xx"
> +   depends on HAS_IOMEM# For MFD_SYSCON
> select MFD_SYSCON
> depends on ARCH_MEDIATEK || COMPILE_TEST
> ---help---
> 

This already has the dependency, as it depends on XHCD_PLATFORM
which depends on HAS_IOMEM.

Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC 11/15] power: reset: keystone: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Arnd Bergmann
On Thursday 03 March 2016 17:03:37 Krzysztof Kozlowski wrote:
> diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
> index 0a6408a39c66..0f34846ae80d 100644
> --- a/drivers/power/reset/Kconfig
> +++ b/drivers/power/reset/Kconfig
> @@ -141,6 +141,7 @@ config POWER_RESET_XGENE
>  config POWER_RESET_KEYSTONE
> bool "Keystone reset driver"
> depends on ARCH_KEYSTONE
> +   depends on HAS_IOMEM# For MFD_SYSCON
> select MFD_SYSCON
> help
>   Reboot support for the KEYSTONE SoCs.
> 

This is platform specific, but we should probably add || COMPILE_TEST
along with the HAS_IOMEM dependency.

Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC 10/15] net: ethernet: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Arnd Bergmann
On Thursday 03 March 2016 17:03:36 Krzysztof Kozlowski wrote:
> The MFD_SYSCON depends on HAS_IOMEM so when selecting it avoid unmet
> direct dependencies.
> 
> Signed-off-by: Krzysztof Kozlowski 
> ---
>  drivers/net/ethernet/hisilicon/Kconfig  | 1 +
>  drivers/net/ethernet/stmicro/stmmac/Kconfig | 6 ++
>  drivers/net/ethernet/ti/Kconfig | 1 +
>  3 files changed, 8 insertions(+)
> 
> diff --git a/drivers/net/ethernet/hisilicon/Kconfig 
> b/drivers/net/ethernet/hisilicon/Kconfig
> index 74beb1867230..6a9c91781bf9 100644
> --- a/drivers/net/ethernet/hisilicon/Kconfig
> +++ b/drivers/net/ethernet/hisilicon/Kconfig
> @@ -26,6 +26,7 @@ config HIX5HD2_GMAC
>  config HIP04_ETH
>   tristate "HISILICON P04 Ethernet support"
>   select MARVELL_PHY
> + depends on HAS_IOMEM# For MFD_SYSCON
>   select MFD_SYSCON
>   select HNS_MDIO
>   ---help---

Geert added a HAS_DMA dependency in linux-next, which takes
care of this, although it's still technically correct as well.

> diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig 
> b/drivers/net/ethernet/stmicro/stmmac/Kconfig
> index cec147d1d34f..d6902bf6e90f 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
> +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
> @@ -16,6 +16,7 @@ if STMMAC_ETH
>  config STMMAC_PLATFORM
>   tristate "STMMAC Platform bus support"
>   depends on STMMAC_ETH
> + depends on HAS_IOMEM# For MFD_SYSCON
>   select MFD_SYSCON
>   default y
>   ---help---

NET_VENDOR_STMICRO depends on HAS_IOMEM, so we are good here for the
entire directory.

> diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig
> index e7f0b7d95b65..ec56cebe929d 100644
> --- a/drivers/net/ethernet/ti/Kconfig
> +++ b/drivers/net/ethernet/ti/Kconfig
> @@ -62,6 +62,7 @@ config TI_CPSW_ALE
>  config TI_CPSW
>   tristate "TI CPSW Switch Support"
>   depends on ARCH_DAVINCI || ARCH_OMAP2PLUS
> + depends on HAS_IOMEM# For MFD_SYSCON
>   select TI_DAVINCI_CPDMA
>   select TI_DAVINCI_MDIO
>   select TI_CPSW_PHY_SEL
> 


This again is platform specific, so the chagnge is not needed.

Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC 09/15] media: platform: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Arnd Bergmann
On Thursday 03 March 2016 17:03:35 Krzysztof Kozlowski wrote:
> diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
> index 201f5c296a95..e5931e434fa2 100644
> --- a/drivers/media/platform/Kconfig
> +++ b/drivers/media/platform/Kconfig
> @@ -79,6 +79,7 @@ config VIDEO_OMAP3
> depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API && ARCH_OMAP3
> depends on HAS_DMA && OF
> depends on OMAP_IOMMU
> +   depends on HAS_IOMEM# For MFD_SYSCON
> select ARM_DMA_USE_IOMMU
> select VIDEOBUF2_DMA_CONTIG

This is only built for OMAP3, so we won't get here without HAS_IOMEM

> select MFD_SYSCON
> diff --git a/drivers/media/platform/exynos4-is/Kconfig 
> b/drivers/media/platform/exynos4-is/Kconfig
> index 57d42c6172c5..c4317b99d257 100644
> --- a/drivers/media/platform/exynos4-is/Kconfig
> +++ b/drivers/media/platform/exynos4-is/Kconfig
> @@ -17,6 +17,7 @@ config VIDEO_S5P_FIMC
> tristate "S5P/EXYNOS4 FIMC/CAMIF camera interface driver"
> depends on I2C
> depends on HAS_DMA
> +   depends on HAS_IOMEM# For MFD_SYSCON
> select VIDEOBUF2_DMA_CONTIG
> select V4L2_MEM2MEM_DEV

This  is guarded by HAS_DMA, which implies HAS_IOMEM afaik.

Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC 08/15] rtc: at91sam9: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Arnd Bergmann
On Thursday 03 March 2016 17:03:34 Krzysztof Kozlowski wrote:
> index 0da40e2e4280..5c530b6b125d 100644
> --- a/drivers/rtc/Kconfig
> +++ b/drivers/rtc/Kconfig
> @@ -1302,6 +1302,7 @@ config RTC_DRV_AT91RM9200
>  config RTC_DRV_AT91SAM9
> tristate "AT91SAM9 RTT as RTC"
> depends on ARCH_AT91 || COMPILE_TEST
> +   depends on HAS_IOMEM# For MFD_SYSCON
> select MFD_SYSCON
> help
>   Some AT91SAM9 SoCs provide an RTT (Real Time Timer) block which
> 

This is technically correct, but the entire RTC menu is hidden
inside of 'depends on !UML && !S390', so we won't ever get there
on any configuration that does not use HAS_IOMEM.

If we did, all other RTC drivers would also fail.

Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC 05/15] phy: hi6220: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Arnd Bergmann
On Thursday 03 March 2016 17:03:31 Krzysztof Kozlowski wrote:
> --- a/drivers/phy/Kconfig
> +++ b/drivers/phy/Kconfig
> @@ -225,6 +225,7 @@ config PHY_MT65XX_USB3
>  config PHY_HI6220_USB
> tristate "hi6220 USB PHY support"
> depends on (ARCH_HISI && ARM64) || COMPILE_TEST
> +   depends on HAS_IOMEM# For MFD_SYSCON
> select GENERIC_PHY
> select MFD_SYSCON
> help
> -- 
> 2.5.0
> 

This is indeed required, and seems to be what caused the problem
you saw in the first place.

Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC 03/15] hwspinlock: qcom: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Arnd Bergmann
On Thursday 03 March 2016 17:03:29 Krzysztof Kozlowski wrote:
> diff --git a/drivers/hwspinlock/Kconfig b/drivers/hwspinlock/Kconfig
> index 73a401662853..5ab2d51dc147 100644
> --- a/drivers/hwspinlock/Kconfig
> +++ b/drivers/hwspinlock/Kconfig
> @@ -21,6 +21,7 @@ config HWSPINLOCK_OMAP
>  config HWSPINLOCK_QCOM
> tristate "Qualcomm Hardware Spinlock device"
> depends on ARCH_QCOM
> +   depends on HAS_IOMEM# For MFD_SYSCON
> select HWSPINLOCK
> select MFD_SYSCON
> help
> 

This is only needed if we add "|| COMPILE_TEST", right now the driver
is limited to ARCH_QCOM.

Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC 04/15] irqchip: st: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Arnd Bergmann
On Thursday 03 March 2016 17:03:30 Krzysztof Kozlowski wrote:
>  config ST_IRQCHIP
> bool
> select REGMAP
> +   depends on HAS_IOMEM# For MFD_SYSCON
> select MFD_SYSCON
> help
>   Enables SysCfg Controlled IRQs on STi based platforms.
> 

Not user visible.

Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC 01/15] clocksource: atmel: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Arnd Bergmann
On Thursday 03 March 2016 17:03:27 Krzysztof Kozlowski wrote:
> 
> diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
> index c346be650892..5927944b46e0 100644
> --- a/drivers/clocksource/Kconfig
> +++ b/drivers/clocksource/Kconfig
> @@ -239,6 +239,7 @@ config ATMEL_PIT
>  
>  config ATMEL_ST
> bool
> +   depends on HAS_IOMEM# For MFD_SYSCON
> select CLKSRC_OF
> select MFD_SYSCON
> 

looking at this again, there is no need for the dependency here,
as it is not a user-selectable symbol.

Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC 15/15] mfd: syscon: Fix build of missing ioremap on UM

2016-03-03 Thread Arnd Bergmann
On Thursday 03 March 2016 17:03:41 Krzysztof Kozlowski wrote:
> Since commit c89c0114955a ("mfd: syscon: Set regmap max_register in
> of_syscon_register") the syscon uses ioremap so it fails on COMPILE_TEST
> without HAS_IOMEM:
> 
> drivers/mfd/syscon.c: In function ‘of_syscon_register’:
> drivers/mfd/syscon.c:67:9: error: implicit declaration of function ‘ioremap’ 
> [-Werror=implicit-function-declaration]
>   base = ioremap(res.start, resource_size());
>  ^
> drivers/mfd/syscon.c:67:7: warning: assignment makes pointer from integer 
> without a cast [-Wint-conversion]
>   base = ioremap(res.start, resource_size());
>^
> drivers/mfd/syscon.c:109:2: error: implicit declaration of function ‘iounmap’ 
> [-Werror=implicit-function-declaration]
>   iounmap(base);
> 
> When selecting MFD_SYSCON, depend on HAS_IOMEM to avoid unmet direct
> dependencies.
> 
> Reported-by: kbuild test robot 
> Fixes: c89c0114955a ("mfd: syscon: Set regmap max_register in 
> of_syscon_register")
> Signed-off-by: Krzysztof Kozlowski 
> ---

Thanks for looking into this, the patches all look right to me, but
I fear we are forever playing catch-up here, as the number of syscon users
is only growing, and it's not obvious to the average driver developer
why they have to select this symbol.

Interestingly, when I try to build an allmodconfig kernel for UML,
it seems to reject any driver calling ioremap/iounmap but not
the wrapper functions around that (of_iomap, devm_ioremap,
devm_ioremap_resource, ...) or the actual accessors that make no
sense without ioremap (readl, writel, inb, outb, iowrite32, ...).

I've played with this a bit, and arrived at the patch below, is this
something we want as well?

Arnd

> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index aa21dc55eb15..2e5b1e525a1d 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -1034,6 +1034,7 @@ config MFD_SUN6I_PRCM
>  
>  config MFD_SYSCON
>   bool "System Controller Register R/W Based on Regmap"
> + depends on HAS_IOMEM
>   select REGMAP_MMIO
>   help
> Select this option to enable accessing system control registers
> 


 arch/um/include/asm/io.h   |1 +
 drivers/char/Kconfig   |3 +++
 drivers/char/mem.c |   16 
 drivers/clocksource/Kconfig|3 +++
 drivers/fmc/Kconfig|1 +
 drivers/fpga/Kconfig   |1 +
 drivers/hwtracing/intel_th/Kconfig |1 +
 drivers/mfd/Kconfig|1 +
 drivers/misc/altera-stapl/Kconfig  |2 +-
 drivers/mtd/chips/Kconfig  |4 
 drivers/mtd/lpddr/Kconfig  |1 +
 drivers/mtd/maps/Kconfig   |3 ++-
 drivers/mtd/nand/Kconfig   |2 +-
 drivers/mtd/spi-nor/Kconfig|1 +
 drivers/net/can/Kconfig|1 +
 drivers/net/hamradio/Kconfig   |9 ++---
 drivers/nvmem/Kconfig  |1 +
 drivers/phy/Kconfig|9 +++--
 drivers/power/reset/Kconfig|4 +++-
 drivers/staging/comedi/Kconfig |6 +-
 drivers/thermal/Kconfig|   11 +--
 include/linux/irq.h|2 ++
 include/linux/mtd/cfi.h|2 ++
 include/linux/mtd/map.h|2 ++
 kernel/resource.c  |2 ++
 lib/Kconfig|7 ++-
 mm/bootmem.c   |4 ++--
 27 files changed, 85 insertions(+), 15 deletions(-)

diff --git a/arch/um/include/asm/io.h b/arch/um/include/asm/io.h
new file mode 100644
index 000..618ff13
--- /dev/null
+++ b/arch/um/include/asm/io.h
@@ -0,0 +1 @@
+/* no IOPORT or IOMEM suport */
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index a043107..f6dc17a 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -8,6 +8,7 @@ source "drivers/tty/Kconfig"
 
 config DEVMEM
bool "/dev/mem virtual device support"
+   depends on HAS_IOMEM
default y
help
  Say Y here if you want to support the /dev/mem device.
@@ -17,6 +18,7 @@ config DEVMEM
 
 config DEVKMEM
bool "/dev/kmem virtual device support"
+   depends on HAS_IOMEM
default y
help
  Say Y here if you want to support the /dev/kmem device. The
@@ -94,6 +96,7 @@ config BFIN_OTP_WRITE_ENABLE
 config PRINTER
tristate "Parallel printer support"
depends on PARPORT
+   depends on HAS_IOPORT
---help---
  If you intend to attach a printer to the parallel port of your Linux
  box (as opposed to using a serial printer; if the connector at the
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 4f6f94c..eedd129 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -91,6 +91,7 @@ void __weak unxlate_dev_mem_ptr(phys_addr_t phys, void *addr)
 }
 #endif
 
+#ifdef CONFIG_DEVMEM
 /*
  * This funcion reads the *physical* memory. The f_pos 

Re: [PATCH v6 5/6] staging/android: refactor SYNC_IOC_FILE_INFO

2016-03-03 Thread Maarten Lankhorst
Op 02-03-16 om 20:52 schreef Gustavo Padovan:
> From: Gustavo Padovan 
>
> Change SYNC_IOC_FILE_INFO behaviour to avoid future API breaks and
> optimize buffer
>
> Now num_fences can be filled by the caller to inform how many fences it
> wants to retrieve from the kernel. If the num_fences passed is greater
> than zero info->sync_fence_info should point to a buffer with enough space
> to fit all fences.
>
> However if num_fences passed to the kernel is 0, the kernel will reply
> with number of fences of the sync_file.
>
> Sending first an ioctl with num_fences = 0 can optimize buffer allocation,
> in a first call with num_fences = 0 userspace will receive the actual
> number of fences in the num_fences filed.
>
> Then it can allocate a buffer with the correct size on sync_fence_info and
> call SYNC_IOC_FILE_INFO again, but now with the actual value of num_fences
> in the sync_file.
>
> Also, info->sync_fence_info was converted to __u64 pointer to prevent
> 32bit compatibility issues.
>
> An example userspace code for the later would be:
>
>   struct sync_file_info *info;
>   int err, size, num_fences;
>
>   info = malloc(sizeof(*info));
>
>   info.flags = 0;
>   err = ioctl(fd, SYNC_IOC_FILE_INFO, info);
>   num_fences = info->num_fences;
>
>   if (num_fences) {
>   info.flags = 0;
>   size = sizeof(struct sync_fence_info) * num_fences;
>   info->num_fences = num_fences;
>   info->sync_fence_info = (uint64_t) calloc(num_fences,
> sizeof(struct 
> sync_fence_info));
>
>   err = ioctl(fd, SYNC_IOC_FILE_INFO, info);
>   }
>
> v2: fix fence_info memory leak
>
> v3: Comments from Emil Velikov
>   - improve commit message
>   - remove __u64 cast
>   - remove check for output fields in file_info
>   - clean up sync_fill_fence_info()
>
> Comments from Maarten Lankhorst
>   - remove in.num_fences && !in.sync_fence_info check
>   - remove info->len and use only num_fences to calculate size
>
> Comments from Dan Carpenter
>   - fix info->sync_fence_info documentation
>
> Signed-off-by: Gustavo Padovan 
> ---
>  drivers/staging/android/sync.c  | 64 
> -
>  drivers/staging/android/uapi/sync.h |  9 ++
>  2 files changed, 38 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
> index dc5f382..3604e453 100644
> --- a/drivers/staging/android/sync.c
> +++ b/drivers/staging/android/sync.c
> @@ -479,13 +479,9 @@ err_put_fd:
>   return err;
>  }
>  
> -static int sync_fill_fence_info(struct fence *fence, void *data, int size)
> +static void sync_fill_fence_info(struct fence *fence,
> + struct sync_fence_info *info)
>  {
> - struct sync_fence_info *info = data;
> -
> - if (size < sizeof(*info))
> - return -ENOMEM;
> -
>   strlcpy(info->obj_name, fence->ops->get_timeline_name(fence),
>   sizeof(info->obj_name));
>   strlcpy(info->driver_name, fence->ops->get_driver_name(fence),
> @@ -495,28 +491,20 @@ static int sync_fill_fence_info(struct fence *fence, 
> void *data, int size)
>   else
>   info->status = 0;
>   info->timestamp_ns = ktime_to_ns(fence->timestamp);
> -
> - return sizeof(*info);
>  }
>  
>  static long sync_file_ioctl_fence_info(struct sync_file *sync_file,
>   unsigned long arg)
>  {
> - struct sync_file_info *info;
> + struct sync_file_info in, *info;
Why put one copy on the stack, and allocate a second?
With sync_file_info now being a fixed size just put 1 copy on the stack from 
userspace,
run some sanity checks first, put in the new values and copy it back to 
userspace without additional memory allocation.

The rest looks good now. :)

~Maarten
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/2] isdn: i4l: move active-isdn drivers to staging

2016-03-03 Thread isdn
Hi Arnd,
I fully agree and ack.
Thanks for the work.
Am 02.03.2016 um 20:06 schrieb Arnd Bergmann:
> The icn, act2000 and pcbit drivers are all for very old hardware,
> and it is highly unlikely that anyone is actually still using them
> on modern kernels, if at all.
> 
> All three drivers apparently are for hardware that predates PCI
> being the common connector, as they are ISA-only and active
> PCI ISDN cards were widely available in the 1990s.
> 
> Looking through the git logs, it I cannot find any indication of a
> patch to any of these drivers that has been tested on real hardware,
> only cleanups or global API changes.
> 
> Signed-off-by: Arnd Bergmann 
> ---
>  Documentation/isdn/00-INDEX |  8 
>  drivers/isdn/Makefile   |  3 ---
>  drivers/isdn/i4l/Kconfig| 10 --
>  drivers/staging/Kconfig |  2 ++
>  drivers/staging/Makefile|  1 +
>  .../staging/i4l/Documentation}/README.act2000   |  0
>  .../isdn => drivers/staging/i4l/Documentation}/README.icn   |  0
>  .../isdn => drivers/staging/i4l/Documentation}/README.pcbit |  0
>  .../isdn => drivers/staging/i4l/Documentation}/README.sc|  0
>  drivers/staging/i4l/Kconfig | 13 
> +
>  drivers/staging/i4l/Makefile|  5 +
>  drivers/staging/i4l/TODO|  3 +++
>  drivers/{isdn => staging/i4l}/act2000/Kconfig   |  0
>  drivers/{isdn => staging/i4l}/act2000/Makefile  |  0
>  drivers/{isdn => staging/i4l}/act2000/act2000.h |  0
>  drivers/{isdn => staging/i4l}/act2000/act2000_isa.c |  0
>  drivers/{isdn => staging/i4l}/act2000/act2000_isa.h |  0
>  drivers/{isdn => staging/i4l}/act2000/capi.c|  0
>  drivers/{isdn => staging/i4l}/act2000/capi.h|  0
>  drivers/{isdn => staging/i4l}/act2000/module.c  |  0
>  drivers/{isdn => staging/i4l}/icn/Kconfig   |  0
>  drivers/{isdn => staging/i4l}/icn/Makefile  |  0
>  drivers/{isdn => staging/i4l}/icn/icn.c |  0
>  drivers/{isdn => staging/i4l}/icn/icn.h |  0
>  drivers/{isdn => staging/i4l}/pcbit/Kconfig |  0
>  drivers/{isdn => staging/i4l}/pcbit/Makefile|  0
>  drivers/{isdn => staging/i4l}/pcbit/callbacks.c |  0
>  drivers/{isdn => staging/i4l}/pcbit/callbacks.h |  0
>  drivers/{isdn => staging/i4l}/pcbit/capi.c  |  0
>  drivers/{isdn => staging/i4l}/pcbit/capi.h  |  0
>  drivers/{isdn => staging/i4l}/pcbit/drv.c   |  0
>  drivers/{isdn => staging/i4l}/pcbit/edss1.c |  0
>  drivers/{isdn => staging/i4l}/pcbit/edss1.h |  0
>  drivers/{isdn => staging/i4l}/pcbit/layer2.c|  0
>  drivers/{isdn => staging/i4l}/pcbit/layer2.h|  0
>  drivers/{isdn => staging/i4l}/pcbit/module.c|  0
>  drivers/{isdn => staging/i4l}/pcbit/pcbit.h |  0
>  37 files changed, 24 insertions(+), 21 deletions(-)
>  rename {Documentation/isdn => 
> drivers/staging/i4l/Documentation}/README.act2000 (100%)
>  rename {Documentation/isdn => drivers/staging/i4l/Documentation}/README.icn 
> (100%)
>  rename {Documentation/isdn => 
> drivers/staging/i4l/Documentation}/README.pcbit (100%)
>  rename {Documentation/isdn => drivers/staging/i4l/Documentation}/README.sc 
> (100%)
>  create mode 100644 drivers/staging/i4l/Kconfig
>  create mode 100644 drivers/staging/i4l/Makefile
>  create mode 100644 drivers/staging/i4l/TODO
>  rename drivers/{isdn => staging/i4l}/act2000/Kconfig (100%)
>  rename drivers/{isdn => staging/i4l}/act2000/Makefile (100%)
>  rename drivers/{isdn => staging/i4l}/act2000/act2000.h (100%)
>  rename drivers/{isdn => staging/i4l}/act2000/act2000_isa.c (100%)
>  rename drivers/{isdn => staging/i4l}/act2000/act2000_isa.h (100%)
>  rename drivers/{isdn => staging/i4l}/act2000/capi.c (100%)
>  rename drivers/{isdn => staging/i4l}/act2000/capi.h (100%)
>  rename drivers/{isdn => staging/i4l}/act2000/module.c (100%)
>  rename drivers/{isdn => staging/i4l}/icn/Kconfig (100%)
>  rename drivers/{isdn => staging/i4l}/icn/Makefile (100%)
>  rename drivers/{isdn => staging/i4l}/icn/icn.c (100%)
>  rename drivers/{isdn => staging/i4l}/icn/icn.h (100%)
>  rename drivers/{isdn => staging/i4l}/pcbit/Kconfig (100%)
>  rename drivers/{isdn => staging/i4l}/pcbit/Makefile (100%)
>  rename drivers/{isdn => staging/i4l}/pcbit/callbacks.c (100%)
>  rename drivers/{isdn => staging/i4l}/pcbit/callbacks.h (100%)
>  rename drivers/{isdn => staging/i4l}/pcbit/capi.c (100%)
>  rename drivers/{isdn => staging/i4l}/pcbit/capi.h (100%)
>  rename drivers/{isdn => 

[RFC 15/15] mfd: syscon: Fix build of missing ioremap on UM

2016-03-03 Thread Krzysztof Kozlowski
Since commit c89c0114955a ("mfd: syscon: Set regmap max_register in
of_syscon_register") the syscon uses ioremap so it fails on COMPILE_TEST
without HAS_IOMEM:

drivers/mfd/syscon.c: In function ‘of_syscon_register’:
drivers/mfd/syscon.c:67:9: error: implicit declaration of function ‘ioremap’ 
[-Werror=implicit-function-declaration]
  base = ioremap(res.start, resource_size());
 ^
drivers/mfd/syscon.c:67:7: warning: assignment makes pointer from integer 
without a cast [-Wint-conversion]
  base = ioremap(res.start, resource_size());
   ^
drivers/mfd/syscon.c:109:2: error: implicit declaration of function ‘iounmap’ 
[-Werror=implicit-function-declaration]
  iounmap(base);

When selecting MFD_SYSCON, depend on HAS_IOMEM to avoid unmet direct
dependencies.

Reported-by: kbuild test robot 
Fixes: c89c0114955a ("mfd: syscon: Set regmap max_register in 
of_syscon_register")
Signed-off-by: Krzysztof Kozlowski 
---
 drivers/mfd/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index aa21dc55eb15..2e5b1e525a1d 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -1034,6 +1034,7 @@ config MFD_SUN6I_PRCM
 
 config MFD_SYSCON
bool "System Controller Register R/W Based on Regmap"
+   depends on HAS_IOMEM
select REGMAP_MMIO
help
  Select this option to enable accessing system control registers
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RFC 12/15] soc: qcom: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
The MFD_SYSCON depends on HAS_IOMEM so when selecting it avoid unmet
direct dependencies.

Signed-off-by: Krzysztof Kozlowski 
---
 drivers/soc/qcom/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
index 461b387d03cc..24de48134c15 100644
--- a/drivers/soc/qcom/Kconfig
+++ b/drivers/soc/qcom/Kconfig
@@ -4,6 +4,7 @@
 config QCOM_GSBI
 tristate "QCOM General Serial Bus Interface"
 depends on ARCH_QCOM
+depends on HAS_IOMEM   # For MFD_SYSCON
 select MFD_SYSCON
 help
   Say y here to enable GSBI support.  The GSBI provides control
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RFC 13/15] staging: media: omap4iss: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
The MFD_SYSCON depends on HAS_IOMEM so when selecting it avoid unmet
direct dependencies.

Signed-off-by: Krzysztof Kozlowski 
---
 drivers/staging/media/omap4iss/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/media/omap4iss/Kconfig 
b/drivers/staging/media/omap4iss/Kconfig
index 46183464ee79..7dea072172aa 100644
--- a/drivers/staging/media/omap4iss/Kconfig
+++ b/drivers/staging/media/omap4iss/Kconfig
@@ -2,6 +2,7 @@ config VIDEO_OMAP4
tristate "OMAP 4 Camera support"
depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && I2C && ARCH_OMAP4
depends on HAS_DMA
+   depends on HAS_IOMEM# For MFD_SYSCON
select MFD_SYSCON
select VIDEOBUF2_DMA_CONTIG
---help---
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RFC 11/15] power: reset: keystone: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
The MFD_SYSCON depends on HAS_IOMEM so when selecting it avoid unmet
direct dependencies.

Signed-off-by: Krzysztof Kozlowski 
---
 drivers/power/reset/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
index 0a6408a39c66..0f34846ae80d 100644
--- a/drivers/power/reset/Kconfig
+++ b/drivers/power/reset/Kconfig
@@ -141,6 +141,7 @@ config POWER_RESET_XGENE
 config POWER_RESET_KEYSTONE
bool "Keystone reset driver"
depends on ARCH_KEYSTONE
+   depends on HAS_IOMEM# For MFD_SYSCON
select MFD_SYSCON
help
  Reboot support for the KEYSTONE SoCs.
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RFC 09/15] media: platform: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
The MFD_SYSCON depends on HAS_IOMEM so when selecting it avoid unmet
direct dependencies.

Signed-off-by: Krzysztof Kozlowski 
---
 drivers/media/platform/Kconfig| 1 +
 drivers/media/platform/exynos4-is/Kconfig | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index 201f5c296a95..e5931e434fa2 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -79,6 +79,7 @@ config VIDEO_OMAP3
depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API && ARCH_OMAP3
depends on HAS_DMA && OF
depends on OMAP_IOMMU
+   depends on HAS_IOMEM# For MFD_SYSCON
select ARM_DMA_USE_IOMMU
select VIDEOBUF2_DMA_CONTIG
select MFD_SYSCON
diff --git a/drivers/media/platform/exynos4-is/Kconfig 
b/drivers/media/platform/exynos4-is/Kconfig
index 57d42c6172c5..c4317b99d257 100644
--- a/drivers/media/platform/exynos4-is/Kconfig
+++ b/drivers/media/platform/exynos4-is/Kconfig
@@ -17,6 +17,7 @@ config VIDEO_S5P_FIMC
tristate "S5P/EXYNOS4 FIMC/CAMIF camera interface driver"
depends on I2C
depends on HAS_DMA
+   depends on HAS_IOMEM# For MFD_SYSCON
select VIDEOBUF2_DMA_CONTIG
select V4L2_MEM2MEM_DEV
select MFD_SYSCON
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RFC 10/15] net: ethernet: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
The MFD_SYSCON depends on HAS_IOMEM so when selecting it avoid unmet
direct dependencies.

Signed-off-by: Krzysztof Kozlowski 
---
 drivers/net/ethernet/hisilicon/Kconfig  | 1 +
 drivers/net/ethernet/stmicro/stmmac/Kconfig | 6 ++
 drivers/net/ethernet/ti/Kconfig | 1 +
 3 files changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/Kconfig 
b/drivers/net/ethernet/hisilicon/Kconfig
index 74beb1867230..6a9c91781bf9 100644
--- a/drivers/net/ethernet/hisilicon/Kconfig
+++ b/drivers/net/ethernet/hisilicon/Kconfig
@@ -26,6 +26,7 @@ config HIX5HD2_GMAC
 config HIP04_ETH
tristate "HISILICON P04 Ethernet support"
select MARVELL_PHY
+   depends on HAS_IOMEM# For MFD_SYSCON
select MFD_SYSCON
select HNS_MDIO
---help---
diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig 
b/drivers/net/ethernet/stmicro/stmmac/Kconfig
index cec147d1d34f..d6902bf6e90f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
@@ -16,6 +16,7 @@ if STMMAC_ETH
 config STMMAC_PLATFORM
tristate "STMMAC Platform bus support"
depends on STMMAC_ETH
+   depends on HAS_IOMEM# For MFD_SYSCON
select MFD_SYSCON
default y
---help---
@@ -41,6 +42,7 @@ config DWMAC_IPQ806X
tristate "QCA IPQ806x DWMAC support"
default ARCH_QCOM
depends on OF
+   depends on HAS_IOMEM# For MFD_SYSCON
select MFD_SYSCON
help
  Support for QCA IPQ806X DWMAC Ethernet.
@@ -54,6 +56,7 @@ config DWMAC_LPC18XX
tristate "NXP LPC18xx/43xx DWMAC support"
default ARCH_LPC18XX
depends on OF
+   depends on HAS_IOMEM# For MFD_SYSCON
select MFD_SYSCON
---help---
  Support for NXP LPC18xx/43xx DWMAC Ethernet.
@@ -73,6 +76,7 @@ config DWMAC_ROCKCHIP
tristate "Rockchip dwmac support"
default ARCH_ROCKCHIP
depends on OF
+   depends on HAS_IOMEM# For MFD_SYSCON
select MFD_SYSCON
help
  Support for Ethernet controller on Rockchip RK3288 SoC.
@@ -84,6 +88,7 @@ config DWMAC_SOCFPGA
tristate "SOCFPGA dwmac support"
default ARCH_SOCFPGA
depends on OF
+   depends on HAS_IOMEM# For MFD_SYSCON
select MFD_SYSCON
help
  Support for ethernet controller on Altera SOCFPGA
@@ -96,6 +101,7 @@ config DWMAC_STI
tristate "STi GMAC support"
default ARCH_STI
depends on OF
+   depends on HAS_IOMEM# For MFD_SYSCON
select MFD_SYSCON
---help---
  Support for ethernet controller on STi SOCs.
diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig
index e7f0b7d95b65..ec56cebe929d 100644
--- a/drivers/net/ethernet/ti/Kconfig
+++ b/drivers/net/ethernet/ti/Kconfig
@@ -62,6 +62,7 @@ config TI_CPSW_ALE
 config TI_CPSW
tristate "TI CPSW Switch Support"
depends on ARCH_DAVINCI || ARCH_OMAP2PLUS
+   depends on HAS_IOMEM# For MFD_SYSCON
select TI_DAVINCI_CPDMA
select TI_DAVINCI_MDIO
select TI_CPSW_PHY_SEL
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RFC 14/15] usb: xhci: mtk: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
The MFD_SYSCON depends on HAS_IOMEM so when selecting it avoid unmet
direct dependencies.

Signed-off-by: Krzysztof Kozlowski 
---
 drivers/usb/host/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 8c20ebbc049c..f759a778d606 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -45,6 +45,7 @@ config USB_XHCI_PLATFORM
 
 config USB_XHCI_MTK
tristate "xHCI support for Mediatek MT65xx"
+   depends on HAS_IOMEM# For MFD_SYSCON
select MFD_SYSCON
depends on ARCH_MEDIATEK || COMPILE_TEST
---help---
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RFC 08/15] rtc: at91sam9: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
The MFD_SYSCON depends on HAS_IOMEM so when selecting it avoid unmet
direct dependencies.

Signed-off-by: Krzysztof Kozlowski 
---
 drivers/rtc/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 0da40e2e4280..5c530b6b125d 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1302,6 +1302,7 @@ config RTC_DRV_AT91RM9200
 config RTC_DRV_AT91SAM9
tristate "AT91SAM9 RTT as RTC"
depends on ARCH_AT91 || COMPILE_TEST
+   depends on HAS_IOMEM# For MFD_SYSCON
select MFD_SYSCON
help
  Some AT91SAM9 SoCs provide an RTT (Real Time Timer) block which
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RFC 07/15] pinctrl: mvebu: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
The MFD_SYSCON depends on HAS_IOMEM so when selecting it avoid unmet
direct dependencies.

Signed-off-by: Krzysztof Kozlowski 
---
 drivers/pinctrl/mvebu/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pinctrl/mvebu/Kconfig b/drivers/pinctrl/mvebu/Kconfig
index 170602407c0d..13685923729c 100644
--- a/drivers/pinctrl/mvebu/Kconfig
+++ b/drivers/pinctrl/mvebu/Kconfig
@@ -7,6 +7,7 @@ config PINCTRL_MVEBU
 
 config PINCTRL_DOVE
bool
+   depends on HAS_IOMEM# For MFD_SYSCON
select PINCTRL_MVEBU
select MFD_SYSCON
 
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RFC 06/15] pinctrl: rockchip: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
The MFD_SYSCON depends on HAS_IOMEM so when selecting it avoid unmet
direct dependencies.

Signed-off-by: Krzysztof Kozlowski 
---
 drivers/pinctrl/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
index fb8200b8e8ec..dc7ab58d4d74 100644
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -131,6 +131,7 @@ config PINCTRL_MESON
 
 config PINCTRL_ROCKCHIP
bool
+   depends on HAS_IOMEM# For MFD_SYSCON
select PINMUX
select GENERIC_PINCONF
select GENERIC_IRQ_CHIP
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RFC 04/15] irqchip: st: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
The MFD_SYSCON depends on HAS_IOMEM so when selecting it avoid unmet
direct dependencies.

Signed-off-by: Krzysztof Kozlowski 
---
 drivers/irqchip/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
index 00bbec6eca0b..10775b099daa 100644
--- a/drivers/irqchip/Kconfig
+++ b/drivers/irqchip/Kconfig
@@ -157,6 +157,7 @@ config RENESAS_IRQC
 config ST_IRQCHIP
bool
select REGMAP
+   depends on HAS_IOMEM# For MFD_SYSCON
select MFD_SYSCON
help
  Enables SysCfg Controlled IRQs on STi based platforms.
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RFC 02/15] dmaengine: nxp: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
The MFD_SYSCON depends on HAS_IOMEM so when selecting it avoid unmet
direct dependencies.

Signed-off-by: Krzysztof Kozlowski 
---
 drivers/dma/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index c77f214c9466..7fbf96bff280 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -290,6 +290,7 @@ config LPC18XX_DMAMUX
bool "NXP LPC18xx/43xx DMA MUX for PL080"
depends on ARCH_LPC18XX || COMPILE_TEST
depends on OF && AMBA_PL08X
+   depends on HAS_IOMEM# For MFD_SYSCON
select MFD_SYSCON
help
  Enable support for DMA on NXP LPC18xx/43xx platforms
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RFC 03/15] hwspinlock: qcom: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
The MFD_SYSCON depends on HAS_IOMEM so when selecting it avoid unmet
direct dependencies.

Signed-off-by: Krzysztof Kozlowski 
---
 drivers/hwspinlock/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/hwspinlock/Kconfig b/drivers/hwspinlock/Kconfig
index 73a401662853..5ab2d51dc147 100644
--- a/drivers/hwspinlock/Kconfig
+++ b/drivers/hwspinlock/Kconfig
@@ -21,6 +21,7 @@ config HWSPINLOCK_OMAP
 config HWSPINLOCK_QCOM
tristate "Qualcomm Hardware Spinlock device"
depends on ARCH_QCOM
+   depends on HAS_IOMEM# For MFD_SYSCON
select HWSPINLOCK
select MFD_SYSCON
help
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RFC 05/15] phy: hi6220: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
The MFD_SYSCON depends on HAS_IOMEM so when selecting it avoid unmet
direct dependencies.

Signed-off-by: Krzysztof Kozlowski 
---
 drivers/phy/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index 0124d17bd9fe..cfdb3551a675 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -225,6 +225,7 @@ config PHY_MT65XX_USB3
 config PHY_HI6220_USB
tristate "hi6220 USB PHY support"
depends on (ARCH_HISI && ARM64) || COMPILE_TEST
+   depends on HAS_IOMEM# For MFD_SYSCON
select GENERIC_PHY
select MFD_SYSCON
help
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RFC 01/15] clocksource: atmel: Add missing MFD_SYSCON dependency on HAS_IOMEM

2016-03-03 Thread Krzysztof Kozlowski
The MFD_SYSCON depends on HAS_IOMEM so when selecting it avoid unmet
direct dependencies.

Signed-off-by: Krzysztof Kozlowski 
---
 drivers/clocksource/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index c346be650892..5927944b46e0 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -239,6 +239,7 @@ config ATMEL_PIT
 
 config ATMEL_ST
bool
+   depends on HAS_IOMEM# For MFD_SYSCON
select CLKSRC_OF
select MFD_SYSCON
 
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RFC 00/15] tree-wide: mfd: syscon: Fix unmet ioremap dependency

2016-03-03 Thread Krzysztof Kozlowski
Hi,

Building allyesconfig on ARCH=um fails with:
   drivers/mfd/syscon.c: In function ‘of_syscon_register’:
   drivers/mfd/syscon.c:67:9: error: implicit declaration of function ‘ioremap’ 
[-Werror=implicit-function-declaration]
  base = ioremap(res.start, resource_size());

Since commit c89c0114955a ("mfd: syscon: Set regmap max_register in
of_syscon_register") the syscon depends on HAS_IOMEM because
it uses the ioremap().

However syscon is often directly selected... so first the dependency on
HAS_IOMEM has to be added to all selecting symbols.

Comments are welcomed whether this is appropriate approach.


The last patch "mfd: syscon: Fix build of missing ioremap on UM" should
enter all other to avoid kbuild complains like:

warning: (ST_IRQCHIP && HIP04_ETH && STMMAC_PLATFORM && DWMAC_IPQ806X &&
DWMAC_LPC18XX && DWMAC_ROCKCHIP && DWMAC_SOCFPGA && DWMAC_STI && TI_CPSW
&& PINCTRL_ROCKCHIP && PINCTRL_DOVE && POWER_RESET_KEYSTONE &&
S3C2410_WATCHDOG && VIDEO_OMAP3 && VIDEO_S5P_FIMC && USB_XHCI_MTK &&
RTC_DRV_AT91SAM9 && LPC18XX_DMAMUX && VIDEO_OMAP4 && HWSPINLOCK_QCOM && ATMEL_ST
&& QCOM_GSBI && PHY_HI6220_USB)
selects MFD_SYSCON which has unmet direct dependencies (HAS_IOMEM)


Best regards,
Krzysztof


Krzysztof Kozlowski (15):
  clocksource: atmel: Add missing MFD_SYSCON dependency on HAS_IOMEM
  dmaengine: nxp: Add missing MFD_SYSCON dependency on HAS_IOMEM
  hwspinlock: qcom: Add missing MFD_SYSCON dependency on HAS_IOMEM
  irqchip: st: Add missing MFD_SYSCON dependency on HAS_IOMEM
  phy: hi6220: Add missing MFD_SYSCON dependency on HAS_IOMEM
  pinctrl: rockchip: Add missing MFD_SYSCON dependency on HAS_IOMEM
  pinctrl: mvebu: Add missing MFD_SYSCON dependency on HAS_IOMEM
  rtc: at91sam9: Add missing MFD_SYSCON dependency on HAS_IOMEM
  media: platform: Add missing MFD_SYSCON dependency on HAS_IOMEM
  net: ethernet: Add missing MFD_SYSCON dependency on HAS_IOMEM
  power: reset: keystone: Add missing MFD_SYSCON dependency on HAS_IOMEM
  soc: qcom: Add missing MFD_SYSCON dependency on HAS_IOMEM
  staging: media: omap4iss: Add missing MFD_SYSCON dependency on
HAS_IOMEM
  usb: xhci: mtk: Add missing MFD_SYSCON dependency on HAS_IOMEM
  mfd: syscon: Fix build of missing ioremap on UM

 drivers/clocksource/Kconfig | 1 +
 drivers/dma/Kconfig | 1 +
 drivers/hwspinlock/Kconfig  | 1 +
 drivers/irqchip/Kconfig | 1 +
 drivers/media/platform/Kconfig  | 1 +
 drivers/media/platform/exynos4-is/Kconfig   | 1 +
 drivers/mfd/Kconfig | 1 +
 drivers/net/ethernet/hisilicon/Kconfig  | 1 +
 drivers/net/ethernet/stmicro/stmmac/Kconfig | 6 ++
 drivers/net/ethernet/ti/Kconfig | 1 +
 drivers/phy/Kconfig | 1 +
 drivers/pinctrl/Kconfig | 1 +
 drivers/pinctrl/mvebu/Kconfig   | 1 +
 drivers/power/reset/Kconfig | 1 +
 drivers/rtc/Kconfig | 1 +
 drivers/soc/qcom/Kconfig| 1 +
 drivers/staging/media/omap4iss/Kconfig  | 1 +
 drivers/usb/host/Kconfig| 1 +
 18 files changed, 23 insertions(+)

-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel