[PATCH 1/5] Drivers: hv: vmbus: Raise retry/wait limits in vmbus_post_msg()
From: Vitaly Kuznetsov DoS protection conditions were altered in WS2016 and now it's easy to get -EAGAIN returned from vmbus_post_msg() (e.g. when we try changing MTU on a netvsc device in a loop). All vmbus_post_msg() callers don't retry the operation and we usually end up with a non-functional device or crash. While host's DoS protection conditions are unknown to me my tests show that it can take up to 10 seconds before the message is sent so doing udelay() is not an option, we really need to sleep. Almost all vmbus_post_msg() callers are ready to sleep but there is one special case: vmbus_initiate_unload() which can be called from interrupt/NMI context and we can't sleep there. I'm also not sure about the lonely vmbus_send_tl_connect_request() which has no in-tree users but its external users are most likely waiting for the host to reply so sleeping there is also appropriate. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan Cc: --- drivers/hv/channel.c | 17 + drivers/hv/channel_mgmt.c | 10 ++ drivers/hv/connection.c | 17 - drivers/hv/hyperv_vmbus.h |2 +- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index 5fb4c6d..d5b8d9f 100644 --- a/drivers/hv/channel.c +++ b/drivers/hv/channel.c @@ -181,7 +181,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size, spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags); ret = vmbus_post_msg(open_msg, - sizeof(struct vmbus_channel_open_channel)); +sizeof(struct vmbus_channel_open_channel), true); if (ret != 0) { err = ret; @@ -233,7 +233,7 @@ int vmbus_send_tl_connect_request(const uuid_le *shv_guest_servie_id, conn_msg.guest_endpoint_id = *shv_guest_servie_id; conn_msg.host_service_id = *shv_host_servie_id; - return vmbus_post_msg(&conn_msg, sizeof(conn_msg)); + return vmbus_post_msg(&conn_msg, sizeof(conn_msg), true); } EXPORT_SYMBOL_GPL(vmbus_send_tl_connect_request); @@ -419,7 +419,7 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer, spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags); ret = vmbus_post_msg(gpadlmsg, msginfo->msgsize - - sizeof(*msginfo)); +sizeof(*msginfo), true); if (ret != 0) goto cleanup; @@ -433,8 +433,8 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer, gpadl_body->gpadl = next_gpadl_handle; ret = vmbus_post_msg(gpadl_body, -submsginfo->msgsize - -sizeof(*submsginfo)); +submsginfo->msgsize - sizeof(*submsginfo), +true); if (ret != 0) goto cleanup; @@ -485,8 +485,8 @@ int vmbus_teardown_gpadl(struct vmbus_channel *channel, u32 gpadl_handle) list_add_tail(&info->msglistentry, &vmbus_connection.chn_msg_list); spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags); - ret = vmbus_post_msg(msg, - sizeof(struct vmbus_channel_gpadl_teardown)); + ret = vmbus_post_msg(msg, sizeof(struct vmbus_channel_gpadl_teardown), +true); if (ret) goto post_msg_err; @@ -557,7 +557,8 @@ static int vmbus_close_internal(struct vmbus_channel *channel) msg->header.msgtype = CHANNELMSG_CLOSECHANNEL; msg->child_relid = channel->offermsg.child_relid; - ret = vmbus_post_msg(msg, sizeof(struct vmbus_channel_close_channel)); + ret = vmbus_post_msg(msg, sizeof(struct vmbus_channel_close_channel), +true); if (ret) { pr_err("Close failed: close post msg return is %d\n", ret); diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 26b4192..b1e85d2 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -321,7 +321,8 @@ static void vmbus_release_relid(u32 relid) memset(&msg, 0, sizeof(struct vmbus_channel_relid_released)); msg.child_relid = relid; msg.header.msgtype = CHANNELMSG_RELID_RELEASED; - vmbus_post_msg(&msg, sizeof(struct vmbus_channel_relid_released)); + vmbus_post_msg(&msg, sizeof(struct vmbus_channel_relid_released), + true); } void hv_event_tasklet_disable(struct vmbus_channel *channel) @@ -728,7 +729,8 @@ void vmbus_initiate_unload(bool crash) init_completion(&vmbus_connection.unload_event); memset(&hdr, 0, sizeof(struct vmbus_channel_message_header)); hdr.msgtype = CHANNELMSG_UNLOAD; - vmbus_post_msg(&hdr, sizeof(struct vmbus_cha
[PATCH 5/5] Drivers: hv: vmbus: Prevent sending data on a rescinded channel
From: K. Y. Srinivasan After the channel is rescinded, the host does not read from the rescinded channel. Fail writes to a channel that has already been rescinded. If we permit writes on a rescinded channel, since the host will not respond we will have situations where we will be unable to unload vmbus drivers that cannot have any outstanding requests to the host at the point they are unoaded. Signed-off-by: K. Y. Srinivasan Cc: --- drivers/hv/ring_buffer.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c index cd49cb1..2cd4029 100644 --- a/drivers/hv/ring_buffer.c +++ b/drivers/hv/ring_buffer.c @@ -298,6 +298,9 @@ int hv_ringbuffer_write(struct vmbus_channel *channel, unsigned long flags = 0; struct hv_ring_buffer_info *outring_info = &channel->outbound; + if (channel->rescind) + return -ENODEV; + for (i = 0; i < kv_count; i++) totalbytes_towrite += kv_list[i].iov_len; @@ -350,6 +353,10 @@ int hv_ringbuffer_write(struct vmbus_channel *channel, spin_unlock_irqrestore(&outring_info->ring_lock, flags); hv_signal_on_write(old_write, channel, kick_q); + + if (channel->rescind) + return -ENODEV; + return 0; } -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/5] hv: init percpu_list in hv_synic_alloc()
From: Vitaly Kuznetsov Initializing hv_context.percpu_list in hv_synic_alloc() helps to prevent a crash in percpu_channel_enq() when not all CPUs were online during initialization and it naturally belongs there. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan Cc: --- drivers/hv/hv.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index c326c67..c11393c 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -457,6 +457,8 @@ int hv_synic_alloc(void) pr_err("Unable to allocate post msg page\n"); goto err; } + + INIT_LIST_HEAD(&hv_context.percpu_list[cpu]); } return 0; @@ -552,8 +554,6 @@ void hv_synic_init(void *arg) rdmsrl(HV_X64_MSR_VP_INDEX, vp_index); hv_context.vp_index[cpu] = (u32)vp_index; - INIT_LIST_HEAD(&hv_context.percpu_list[cpu]); - /* * Register the per-cpu clockevent source. */ -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/5] hv: allocate synic pages for all present CPUs
From: Vitaly Kuznetsov It may happen that not all CPUs are online when we do hv_synic_alloc() and in case more CPUs come online later we may try accessing these allocated structures. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan Cc: --- drivers/hv/hv.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 446802a..c326c67 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -411,7 +411,7 @@ int hv_synic_alloc(void) goto err; } - for_each_online_cpu(cpu) { + for_each_present_cpu(cpu) { hv_context.event_dpc[cpu] = kmalloc(size, GFP_ATOMIC); if (hv_context.event_dpc[cpu] == NULL) { pr_err("Unable to allocate event dpc\n"); @@ -482,7 +482,7 @@ void hv_synic_free(void) int cpu; kfree(hv_context.hv_numa_map); - for_each_online_cpu(cpu) + for_each_present_cpu(cpu) hv_synic_free_cpu(cpu); } -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/5] hv: don't reset hv_context.tsc_page on crash
From: Vitaly Kuznetsov It may happen that secondary CPUs are still alive and resetting hv_context.tsc_page will cause a consequent crash in read_hv_clock_tsc() as we don't check for it being not NULL there. It is safe as we're not freeing this page anyways. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan Cc: --- drivers/hv/hv.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index c11393c..60f14c4 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -309,9 +309,10 @@ void hv_cleanup(bool crash) hypercall_msr.as_uint64 = 0; wrmsrl(HV_X64_MSR_REFERENCE_TSC, hypercall_msr.as_uint64); - if (!crash) + if (!crash) { vfree(hv_context.tsc_page); - hv_context.tsc_page = NULL; + hv_context.tsc_page = NULL; + } } #endif } -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/5] Drivers: hv: vmbus: Some miscellaneous fixes
From: K. Y. Srinivasan Some miscellaneous fixes. K. Y. Srinivasan (1): Drivers: hv: vmbus: Prevent sending data on a rescinded channel Vitaly Kuznetsov (4): Drivers: hv: vmbus: Raise retry/wait limits in vmbus_post_msg() hv: allocate synic pages for all present CPUs hv: init percpu_list in hv_synic_alloc() hv: don't reset hv_context.tsc_page on crash drivers/hv/channel.c | 17 + drivers/hv/channel_mgmt.c | 10 ++ drivers/hv/connection.c | 17 - drivers/hv/hv.c | 13 +++-- drivers/hv/hyperv_vmbus.h |2 +- drivers/hv/ring_buffer.c |7 +++ 6 files changed, 42 insertions(+), 24 deletions(-) -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging/lustre/lnetselftest: Fix potential integer overflow
It looks like if the passed in parameter is not present, but parameter length is non zero, then sanity checks on the length are skipped and lstcon_test_add() might then use incorrect allocation that's prone to integer overflow size. This patch ensures that parameter len is zero if parameter is not present. Reported-by: Dan Carpenter Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lnet/selftest/conctl.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c index 02847bf..9438302 100644 --- a/drivers/staging/lustre/lnet/selftest/conctl.c +++ b/drivers/staging/lustre/lnet/selftest/conctl.c @@ -742,6 +742,10 @@ static int lst_test_add_ioctl(lstio_test_args_t *args) PAGE_SIZE - sizeof(struct lstcon_test))) return -EINVAL; + /* Enforce zero parameter length if there's no parameter */ + if (!args->lstio_tes_param && args->lstio_tes_param_len) + return -EINVAL; + LIBCFS_ALLOC(batch_name, args->lstio_tes_bat_nmlen + 1); if (!batch_name) return rc; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/5] staging/lustre: Convert all bare unsigned to unsigned int
Highlighted by relatively new checkpatch test, warnings like: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: Oleg Drokin --- drivers/staging/lustre/include/linux/lnet/lnetst.h | 6 +- .../staging/lustre/lustre/include/lprocfs_status.h | 3 +- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 8 +- drivers/staging/lustre/lustre/llite/llite_nfs.c| 2 +- drivers/staging/lustre/lustre/llite/rw26.c | 4 +- drivers/staging/lustre/lustre/llite/xattr_cache.c | 6 +- drivers/staging/lustre/lustre/lov/lov_pool.c | 3 +- .../lustre/lustre/obdclass/lprocfs_status.c| 3 +- drivers/staging/lustre/lustre/obdclass/lu_object.c | 6 +- .../staging/lustre/lustre/obdclass/obd_config.c| 4 +- drivers/staging/lustre/lustre/osc/osc_lock.c | 2 +- drivers/staging/lustre/lustre/osc/osc_quota.c | 4 +- drivers/staging/lustre/lustre/osc/osc_request.c| 6 +- drivers/staging/lustre/lustre/ptlrpc/connection.c | 4 +- .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c| 4 +- drivers/staging/lustre/lustre/ptlrpc/service.c | 6 +- drivers/staging/lustre/lustre/ptlrpc/wiretest.c| 92 +++--- 17 files changed, 83 insertions(+), 80 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lnetst.h b/drivers/staging/lustre/include/linux/lnet/lnetst.h index 78f825d..8a84888 100644 --- a/drivers/staging/lustre/include/linux/lnet/lnetst.h +++ b/drivers/staging/lustre/include/linux/lnet/lnetst.h @@ -244,7 +244,7 @@ typedef struct { int lstio_ses_timeout; /* IN: session timeout */ int lstio_ses_force; /* IN: force create ? */ /** IN: session features */ - unsigned lstio_ses_feats; + unsigned int lstio_ses_feats; lst_sid_t __user *lstio_ses_idp;/* OUT: session id */ int lstio_ses_nmlen; /* IN: name length */ char __user *lstio_ses_namep; /* IN: session name */ @@ -255,7 +255,7 @@ typedef struct { lst_sid_t __user*lstio_ses_idp; /* OUT: session id */ int __user *lstio_ses_keyp;/* OUT: local key */ /** OUT: session features */ - unsigned __user *lstio_ses_featp; + unsigned int __user *lstio_ses_featp; lstcon_ndlist_ent_t __user *lstio_ses_ndinfo; /* OUT: */ int lstio_ses_nmlen; /* IN: name length */ char __user *lstio_ses_namep; /* OUT: session name */ @@ -328,7 +328,7 @@ typedef struct { char __user *lstio_grp_namep; /* IN: group name */ int lstio_grp_count; /* IN: # of nodes */ /** OUT: session features */ - unsigned __user *lstio_grp_featp; + unsigned int __user *lstio_grp_featp; lnet_process_id_t __user *lstio_grp_idsp; /* IN: nodes */ struct list_head __user *lstio_grp_resultp; /* OUT: list head of result buffer */ diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h index adef2d2..62753da 100644 --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h @@ -542,7 +542,8 @@ lprocfs_alloc_stats(unsigned int num, enum lprocfs_stats_flags flags); void lprocfs_clear_stats(struct lprocfs_stats *stats); void lprocfs_free_stats(struct lprocfs_stats **stats); void lprocfs_counter_init(struct lprocfs_stats *stats, int index, - unsigned conf, const char *name, const char *units); + unsigned int conf, const char *name, + const char *units); struct obd_export; int lprocfs_exp_cleanup(struct obd_export *exp); struct dentry *ldebugfs_add_simple(struct dentry *root, diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c index 1095331..b22f5ba 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c @@ -445,8 +445,8 @@ static struct ldlm_resource *ldlm_resource_getref(struct ldlm_resource *res) return res; } -static unsigned ldlm_res_hop_hash(struct cfs_hash *hs, - const void *key, unsigned mask) +static unsigned int ldlm_res_hop_hash(struct cfs_hash *hs, + const void *key, unsigned int mask) { const struct ldlm_res_id *id = key; unsigned intval = 0; @@ -457,8 +457,8 @@ static unsigned ldlm_res_hop_hash(struct cfs_hash *hs, return val & mask; } -static unsigned ldlm_res_hop_fid_hash(struct cfs_hash *hs, - const void *key, unsigned mask) +static unsigned int ldlm_res
[PATCH 0/5] Lustre style fixes
These patches fix some more of the low hanging fruits in the style problems highlighted by checkpatch. Now only false positive ERRORs are left. This also converts all bare unsigneds into unsigned ints and a couple of spelling fixes. Please consider. Oleg Drokin (5): staging/lustre/o2iblnd: Add missing space staging/lustre/socklnd: Fix whitespace problem staging/lustre: Convert all bare unsigned to unsigned int staging/lustre/o2iblnd: Fix misspelling intialized->intialized staging/lustre/o2iblnd: Fix misspelled attemps->attempts drivers/staging/lustre/include/linux/lnet/lnetst.h | 6 +- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c| 4 +- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 4 +- .../staging/lustre/lnet/klnds/socklnd/socklnd.h| 2 +- .../staging/lustre/lustre/include/lprocfs_status.h | 3 +- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 8 +- drivers/staging/lustre/lustre/llite/llite_nfs.c| 2 +- drivers/staging/lustre/lustre/llite/rw26.c | 4 +- drivers/staging/lustre/lustre/llite/xattr_cache.c | 6 +- drivers/staging/lustre/lustre/lov/lov_pool.c | 3 +- .../lustre/lustre/obdclass/lprocfs_status.c| 3 +- drivers/staging/lustre/lustre/obdclass/lu_object.c | 6 +- .../staging/lustre/lustre/obdclass/obd_config.c| 4 +- drivers/staging/lustre/lustre/osc/osc_lock.c | 2 +- drivers/staging/lustre/lustre/osc/osc_quota.c | 4 +- drivers/staging/lustre/lustre/osc/osc_request.c| 6 +- drivers/staging/lustre/lustre/ptlrpc/connection.c | 4 +- .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c| 4 +- drivers/staging/lustre/lustre/ptlrpc/service.c | 6 +- drivers/staging/lustre/lustre/ptlrpc/wiretest.c| 92 +++--- 20 files changed, 88 insertions(+), 85 deletions(-) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/5] staging/lustre/o2iblnd: Fix misspelled attemps->attempts
Highlighted by checkpatch: WARNING: 'attemps' may be misspelled - perhaps 'attempts'? #20278: FILE: drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:3272: + * reconnection attemps. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c index bea408d..c7917ab 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -3269,7 +3269,7 @@ kiblnd_disconnect_conn(struct kib_conn *conn) #define KIB_RECONN_HIGH_RACE 10 /** * Allow connd to take a break and handle other things after consecutive - * reconnection attemps. + * reconnection attempts. */ #define KIB_RECONN_BREAK 100 -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/5] staging/lustre/o2iblnd: Fix misspelling intialized->intialized
Highlighted by checkpatch: + if (!ps->ps_net) /* intialized? */ Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c index e2fc65f..7f761b3 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c @@ -1489,7 +1489,7 @@ static int kiblnd_create_fmr_pool(struct kib_fmr_poolset *fps, static void kiblnd_fail_fmr_poolset(struct kib_fmr_poolset *fps, struct list_head *zombies) { - if (!fps->fps_net) /* intialized? */ + if (!fps->fps_net) /* initialized? */ return; spin_lock(&fps->fps_lock); @@ -1812,7 +1812,7 @@ static void kiblnd_destroy_pool_list(struct list_head *head) static void kiblnd_fail_poolset(struct kib_poolset *ps, struct list_head *zombies) { - if (!ps->ps_net) /* intialized? */ + if (!ps->ps_net) /* initialized? */ return; spin_lock(&ps->ps_lock); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/5] staging/lustre/o2iblnd: Add missing space
checkpatch highlighted missing space before assignment for lock variable. + spinlock_t *lock= &kiblnd_data.kib_connd_lock; Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c index 92692a2..bea408d 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -3276,7 +3276,7 @@ kiblnd_disconnect_conn(struct kib_conn *conn) int kiblnd_connd(void *arg) { - spinlock_t *lock= &kiblnd_data.kib_connd_lock; + spinlock_t *lock = &kiblnd_data.kib_connd_lock; wait_queue_t wait; unsigned long flags; struct kib_conn *conn; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/5] staging/lustre/socklnd: Fix whitespace problem
checkpatch highlighted there are 8 spaces that could be converted to a tab: ERROR: code indent should use tabs where possible +^I^I^I^I^I */$ Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h index 2978014..842c453 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h @@ -334,7 +334,7 @@ struct ksock_conn { atomic_t ksnc_conn_refcount;/* conn refcount */ atomic_t ksnc_sock_refcount;/* sock refcount */ struct ksock_sched *ksnc_scheduler; /* who schedules this connection -*/ +*/ __u32 ksnc_myipaddr; /* my IP */ __u32 ksnc_ipaddr; /* peer's IP */ intksnc_port; /* peer's port */ -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: greybus: audio_module: remove redundant OOM message
On Tue, Dec 6, 2016 at 7:39 PM, Srikant Ritolia wrote: > All kmalloc-based functions print enough information on failure > > Signed-off-by: Srikant Ritolia > --- > Changes in v2: > - Added driver name in the subject for better readability. Acked-by: Viresh Kumar ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging/lustre/osc: Revert erroneous list_for_each_entry_safe use
I have been having a lot of unexplainable crashes in osc_lru_shrink lately that I could not see a good explanation for and then I found this patch that slip under the radar somehow that incorrectly converted while loop for lru list iteration into list_for_each_entry_safe totally ignoring that in the body of the loop we drop spinlocks guarding this list and move list entries around. Not sure why it was not showing up right away, perhaps some of the more recent LRU changes committed caused some extra pressure on this code that finally highlighted the breakage. Reverts: 8adddc36b1fc ("staging: lustre: osc: Use list_for_each_entry_safe") CC: Bhaktipriya Shridhar Signed-off-by: Oleg Drokin --- I also do not see this patch in any of the mailing lists I am subscribed to. I wonder if there's a way to subscribe to those Greg's "This is a note to let you know that I've just added the patch " emails that concern Lustre to get them even if I am not on the CC list in the patch itself? drivers/staging/lustre/lustre/osc/osc_page.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/osc/osc_page.c b/drivers/staging/lustre/lustre/osc/osc_page.c index c5129d1..e356e4a 100644 --- a/drivers/staging/lustre/lustre/osc/osc_page.c +++ b/drivers/staging/lustre/lustre/osc/osc_page.c @@ -537,7 +537,6 @@ long osc_lru_shrink(const struct lu_env *env, struct client_obd *cli, struct cl_object *clobj = NULL; struct cl_page **pvec; struct osc_page *opg; - struct osc_page *temp; int maxscan = 0; long count = 0; int index = 0; @@ -568,7 +567,7 @@ long osc_lru_shrink(const struct lu_env *env, struct client_obd *cli, if (force) cli->cl_lru_reclaim++; maxscan = min(target << 1, atomic_long_read(&cli->cl_lru_in_list)); - list_for_each_entry_safe(opg, temp, &cli->cl_lru_list, ops_lru) { + while (!list_empty(&cli->cl_lru_list)) { struct cl_page *page; bool will_free = false; @@ -578,6 +577,8 @@ long osc_lru_shrink(const struct lu_env *env, struct client_obd *cli, if (--maxscan < 0) break; + opg = list_entry(cli->cl_lru_list.next, struct osc_page, +ops_lru); page = opg->ops_cl.cpl_page; if (lru_page_busy(cli, page)) { list_move_tail(&opg->ops_lru, &cli->cl_lru_list); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
VERTRAULICH
Mein lieber Freund, Ich mцchte mich erstmals gerne vorstellen. Mein Name ist Herr Morato Ortega die persцnliche Investment Berater und Vermцgensverwalterin meines verstorbenen Mandanten, der ihre familienname tragt. Er war als privater Geschдftsmann im internationalen Bereich tдtig. Im Jahr 2008 starb mein Mandant an einen schweren Herzinfarkt. Mein Mandant war ledig und kinderlos. Er hinterlieЯ ein Vermцgen im Wert von Ђ10.500.000 (Zehn Millionen fьnfhunderttausend Euro), das sich in einer Bank in Spanien befindet. Die Bank lieЯ mir zukommen, dass ich einen Erbberechtigen, Begьnstigten vorstellen muss. Nach mehreren Recherchen erhielt ich keine weiteren hilfreichen Informationen, ьber die Verwandten meines verstorbenen Mandanten. Aus diesem Grund schrieb ich Sie an, da Sie den gleichen Nachnamen haben. Ich benцtige Ihre Zustimmung und Ihre Kooperation um Sie als den Begьnstigten vorzustellen. Alle meine Bemьhungen Verwandte meines verstorbenen Mandanten zu finden, waren erfolglos. Infolgedessen wьrde ich vorschlagen das Vermцgen aufzuteilen, Sie erhalten 45% Prozent des Anteils und 45% Prozent wьrde mir dann zustehen. 10% Prozent werden an Gemeinnьtzige Organisationen gespendet. Alle notwendigen Dokumente beinhalten sinngemдЯ auch das Ursprungszeugnis, um demnach Fragen von der zustдndigen Bank zu vermeiden. Die beantragten Dokumente, die Sie fьr das Verfahren benцtigen, sind legal und beglaubigt. Das Vermцgen enthдlt kein kriminellen Ursprung. Das Verfahren wird einwandfrei ohne Komplikationen erfolgen, die Geldьberweisung wird rechts gemдЯ abgeschlossen. Alles was ich von Ihnen benцtige ist Ihr Vertrauen und eine gute Zusammenarbeit. Kontaktieren Sie mich bitte unter meine private E-Mail rod.ort...@consultant.com .Die geplante Transaktion wird durch legale Rechtsmitteln fьr Ihren rechtlichen Schutz gefьhrt. Mit freundlichen Grussen Dipl.finanzfachanwalt Abogado Morato Ortega ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [lustre-devel] [bug report] staging: add Lustre file system client support
On Tue, Dec 06, 2016 at 02:10:13PM -0500, Oleg Drokin wrote: > > On Dec 6, 2016, at 1:37 PM, Dan Carpenter wrote: > > > On Tue, Dec 06, 2016 at 10:44:54AM -0500, Oleg Drokin wrote: > >> I see, indeed, it all makes sense now. > >> So basically if we unconditionally check for the size to be > 0, we should > >> be > >> fine then, I imagine. > >> On the other hand there's probably no se for no param and nonzero param > >> len, > >> so it's probably even better to enforce size as zero when no param. > > > > Checking for > 0 is not enough, because it could also have an integer > > overflow on 32 bit systems. We need to cap the upper bound as well. > > How would it play out, though? > offsetof(struct lstcon_test, tes_param[large_positive_int]) would result in > some real "large" negative number. > So trying to allocate this many negative bytes would fail, right? Not always. Please properly bound your allocations. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 10/14] rtlwifi: Add BTC_TRACE_STRING to new btcoex
On Mon, Dec 05, 2016 at 04:34:08PM -0600, Larry Finger wrote: > Can you point me to a driver with a better way to conditionally dump > a debugging string to the logs? People should look at using ftrace and kprobes. They really are very powerful and useful. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [lustre-devel] [bug report] staging: add Lustre file system client support
On Tue, Dec 06, 2016 at 02:10:13PM -0500, Oleg Drokin wrote: > > On Dec 6, 2016, at 1:37 PM, Dan Carpenter wrote: > > > On Tue, Dec 06, 2016 at 10:44:54AM -0500, Oleg Drokin wrote: > >> I see, indeed, it all makes sense now. > >> So basically if we unconditionally check for the size to be > 0, we should > >> be > >> fine then, I imagine. > >> On the other hand there's probably no se for no param and nonzero param > >> len, > >> so it's probably even better to enforce size as zero when no param. > > > > Checking for > 0 is not enough, because it could also have an integer > > overflow on 32 bit systems. We need to cap the upper bound as well. > > How would it play out, though? > offsetof(struct lstcon_test, tes_param[large_positive_int]) would result in > some real "large" negative number. > So trying to allocate this many negative bytes would fail, right? Oh, yeah. You're right. Good point... regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Gigabit ethernet driver for Alacritechs SLIC devices (v4)
On 06.12.2016 17:30, David Miller wrote: > From: Lino Sanfilippo > Date: Mon, 5 Dec 2016 23:07:15 +0100 > >> this is the forth version of the slicoss gigabit ethernet driver (which is a >> rework of the driver from Alacritech which can currently be found under >> drivers/staging/slicoss). The driver is supposed to support Mojave, Oasis and >> Kalahari cards, for both copper and fiber. >> >> If this code is accepted the staging version can be removed. >> >> The driver has been tested on a SEN2104ET adapter (4 Port PCIe copper). > > I've applied this series, nice work. > Great, thanks! Regards, Lino ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [lustre-devel] [bug report] staging: add Lustre file system client support
On Dec 6, 2016, at 1:37 PM, Dan Carpenter wrote: > On Tue, Dec 06, 2016 at 10:44:54AM -0500, Oleg Drokin wrote: >> I see, indeed, it all makes sense now. >> So basically if we unconditionally check for the size to be > 0, we should be >> fine then, I imagine. >> On the other hand there's probably no se for no param and nonzero param len, >> so it's probably even better to enforce size as zero when no param. > > Checking for > 0 is not enough, because it could also have an integer > overflow on 32 bit systems. We need to cap the upper bound as well. How would it play out, though? offsetof(struct lstcon_test, tes_param[large_positive_int]) would result in some real "large" negative number. So trying to allocate this many negative bytes would fail, right? ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [lustre-devel] [bug report] staging: add Lustre file system client support
On Tue, Dec 06, 2016 at 10:44:54AM -0500, Oleg Drokin wrote: > I see, indeed, it all makes sense now. > So basically if we unconditionally check for the size to be > 0, we should be > fine then, I imagine. > On the other hand there's probably no se for no param and nonzero param len, > so it's probably even better to enforce size as zero when no param. Checking for > 0 is not enough, because it could also have an integer overflow on 32 bit systems. We need to cap the upper bound as well. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 7/8] staging: fsl-dpaa2/eth: Add TODO file
> -Original Message- > From: Greg KH [mailto:gre...@linuxfoundation.org] > Sent: Tuesday, December 06, 2016 11:56 AM > To: Stuart Yoder > Cc: Ruxandra Ioana Radulescu ; > de...@driverdev.osuosl.org; linux- > ker...@vger.kernel.org; ag...@suse.de; a...@arndb.de; Alexandru Marginean > ; > Bogdan Hamciuc ; Roy Pledge ; > Laurentiu Tudor > > Subject: Re: [PATCH 7/8] staging: fsl-dpaa2/eth: Add TODO file > > On Tue, Dec 06, 2016 at 12:59:59PM +, Stuart Yoder wrote: > > > > > > > -Original Message- > > > From: Greg KH [mailto:gre...@linuxfoundation.org] > > > Sent: Tuesday, December 06, 2016 4:20 AM > > > To: Ruxandra Ioana Radulescu > > > Cc: de...@driverdev.osuosl.org; linux-ker...@vger.kernel.org; > > > ag...@suse.de; a...@arndb.de; > Alexandru > > > Marginean ; Bogdan Hamciuc > > > ; Stuart Yoder > > > ; Roy Pledge ; Laurentiu Tudor > > > > > > Subject: Re: [PATCH 7/8] staging: fsl-dpaa2/eth: Add TODO file > > > > > > On Tue, Dec 06, 2016 at 10:06:25AM +, Ruxandra Ioana Radulescu wrote: > > > > > -Original Message- > > > > > From: Greg KH [mailto:gre...@linuxfoundation.org] > > > > > Sent: Tuesday, December 06, 2016 11:58 AM > > > > > To: Ruxandra Ioana Radulescu > > > > > Cc: de...@driverdev.osuosl.org; linux-ker...@vger.kernel.org; > > > > > ag...@suse.de; a...@arndb.de; Alexandru Marginean > > > > > ; Bogdan Hamciuc > > > > > ; Stuart Yoder ; Roy > > > > > Pledge ; Laurentiu Tudor > > > > > > > > > > Subject: Re: [PATCH 7/8] staging: fsl-dpaa2/eth: Add TODO file > > > > > > > > > > On Tue, Dec 06, 2016 at 03:34:41AM -0600, Ioana Radulescu wrote: > > > > > > Add a list of TODO items for the Ethernet driver > > > > > > > > > > > > Signed-off-by: Ioana Radulescu > > > > > > --- > > > > > > drivers/staging/fsl-dpaa2/ethernet/TODO |9 + > > > > > > 1 files changed, 9 insertions(+), 0 deletions(-) > > > > > > create mode 100644 drivers/staging/fsl-dpaa2/ethernet/TODO > > > > > > > > > > > > diff --git a/drivers/staging/fsl-dpaa2/ethernet/TODO > > > > > > b/drivers/staging/fsl- > > > > > dpaa2/ethernet/TODO > > > > > > new file mode 100644 > > > > > > index 000..833265b > > > > > > --- /dev/null > > > > > > +++ b/drivers/staging/fsl-dpaa2/ethernet/TODO > > > > > > @@ -0,0 +1,9 @@ > > > > > > +* Add a DPAA2 MAC kernel driver in order to allow PHY management; > > > > > currently > > > > > > + the DPMAC objects and their link to DPNIs are handled by MC > > > > > > internally > > > > > > + and all PHYs are seen as fixed-link > > > > > > +* add more debug support: decide how to expose detailed debug > > > > > statistics, > > > > > > + add ingress error queue support > > > > > > +* MC firmware uprev; the DPAA2 objects used by the Ethernet driver > > > > > need to > > > > > > + be kept in sync with binary interface changes in MC > > > > > > +* refine README file > > > > > > +* cleanup > > > > > > > > > > These seem like very minor things, why not just spend a week and do > > > > > this > > > > > work and get it merged to the "correct" portion of the kernel tree? > > > > > Why > > > > > does this have to go into staging? > > > > > > > > Actually the first bullet is not minor at all and requires some design > > > > choices that we aren't yet completely clear with, and which in turn may > > > > affect parts of the Ethernet driver. We figured it would be best to try > > > > adding this in staging first (and also provide this way an example of > > > > using > > > > the fsl-mc bus and dpio driver) than wait until all MAC development > > > > questions are ironed-out. > > > > > > Ok, that makes sense. > > > > > > > I can remove the other bullets from the TODO list if you think they're > > > > not worth mentioning. > > > > > > No, they should be mentioned, I just didn't think they are all that much > > > work, and if you didn't have major things needed to get done, you could > > > just knock it all out in a week of local development. > > > > > > I'll look into taking this into the tree later today... > > > > Note, as mentioned in the cover letter, in it's current form this patch > > series is based on the series: > > [PATCH v3 0/9] staging: fsl-mc: move bus driver out of staging, add dpio > > > > ...which means that it won't build or run without that series being > > applied first, due to header file dependencies. It also functionally > > depends on the DPIO driver. So we need the dpio driver merged first. > > > > Is moving the fsl-mc bus driver out of staging a possibility now? > > I'm ok with it, but I really haven't looked at the patches in a while, I > keep seeing others have problems with it. Want me to review it now? Yes, would like that very much. Thanks, Stuart ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: dgnc: fix blank line after '{' warnings.
Remove blank lines between open brace and comment. Remove blank lines after comment in line with the rest of the comments of the file. Signed-off-by: Fernando Apesteguia --- drivers/staging/dgnc/dgnc_tty.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index af4bc86..8bca929 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -376,9 +376,7 @@ static void dgnc_wmove(struct channel_t *ch, char *buf, uint n) } if (n > 0) { - /* Move rest of data. */ - remain = n; memcpy(ch->ch_wqueue + head, buf, remain); head += remain; @@ -1022,9 +1020,7 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file) /* Initialize if neither terminal or printer is open. */ if (!((ch->ch_tun.un_flags | ch->ch_pun.un_flags) & UN_ISOPEN)) { - /* Flush input queues. */ - ch->ch_r_head = 0; ch->ch_r_tail = 0; ch->ch_e_head = 0; @@ -1623,9 +1619,7 @@ static int dgnc_tty_write(struct tty_struct *tty, } if (n > 0) { - /* Move rest of data. */ - remain = n; memcpy(ch->ch_wqueue + head, buf, remain); head += remain; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 7/8] staging: fsl-dpaa2/eth: Add TODO file
On Tue, Dec 06, 2016 at 12:59:59PM +, Stuart Yoder wrote: > > > > -Original Message- > > From: Greg KH [mailto:gre...@linuxfoundation.org] > > Sent: Tuesday, December 06, 2016 4:20 AM > > To: Ruxandra Ioana Radulescu > > Cc: de...@driverdev.osuosl.org; linux-ker...@vger.kernel.org; > > ag...@suse.de; a...@arndb.de; Alexandru > > Marginean ; Bogdan Hamciuc > > ; Stuart Yoder > > ; Roy Pledge ; Laurentiu Tudor > > > > Subject: Re: [PATCH 7/8] staging: fsl-dpaa2/eth: Add TODO file > > > > On Tue, Dec 06, 2016 at 10:06:25AM +, Ruxandra Ioana Radulescu wrote: > > > > -Original Message- > > > > From: Greg KH [mailto:gre...@linuxfoundation.org] > > > > Sent: Tuesday, December 06, 2016 11:58 AM > > > > To: Ruxandra Ioana Radulescu > > > > Cc: de...@driverdev.osuosl.org; linux-ker...@vger.kernel.org; > > > > ag...@suse.de; a...@arndb.de; Alexandru Marginean > > > > ; Bogdan Hamciuc > > > > ; Stuart Yoder ; Roy > > > > Pledge ; Laurentiu Tudor > > > > > > > > Subject: Re: [PATCH 7/8] staging: fsl-dpaa2/eth: Add TODO file > > > > > > > > On Tue, Dec 06, 2016 at 03:34:41AM -0600, Ioana Radulescu wrote: > > > > > Add a list of TODO items for the Ethernet driver > > > > > > > > > > Signed-off-by: Ioana Radulescu > > > > > --- > > > > > drivers/staging/fsl-dpaa2/ethernet/TODO |9 + > > > > > 1 files changed, 9 insertions(+), 0 deletions(-) > > > > > create mode 100644 drivers/staging/fsl-dpaa2/ethernet/TODO > > > > > > > > > > diff --git a/drivers/staging/fsl-dpaa2/ethernet/TODO > > > > > b/drivers/staging/fsl- > > > > dpaa2/ethernet/TODO > > > > > new file mode 100644 > > > > > index 000..833265b > > > > > --- /dev/null > > > > > +++ b/drivers/staging/fsl-dpaa2/ethernet/TODO > > > > > @@ -0,0 +1,9 @@ > > > > > +* Add a DPAA2 MAC kernel driver in order to allow PHY management; > > > > currently > > > > > + the DPMAC objects and their link to DPNIs are handled by MC > > > > > internally > > > > > + and all PHYs are seen as fixed-link > > > > > +* add more debug support: decide how to expose detailed debug > > > > statistics, > > > > > + add ingress error queue support > > > > > +* MC firmware uprev; the DPAA2 objects used by the Ethernet driver > > > > need to > > > > > + be kept in sync with binary interface changes in MC > > > > > +* refine README file > > > > > +* cleanup > > > > > > > > These seem like very minor things, why not just spend a week and do this > > > > work and get it merged to the "correct" portion of the kernel tree? Why > > > > does this have to go into staging? > > > > > > Actually the first bullet is not minor at all and requires some design > > > choices that we aren't yet completely clear with, and which in turn may > > > affect parts of the Ethernet driver. We figured it would be best to try > > > adding this in staging first (and also provide this way an example of > > > using > > > the fsl-mc bus and dpio driver) than wait until all MAC development > > > questions are ironed-out. > > > > Ok, that makes sense. > > > > > I can remove the other bullets from the TODO list if you think they're > > > not worth mentioning. > > > > No, they should be mentioned, I just didn't think they are all that much > > work, and if you didn't have major things needed to get done, you could > > just knock it all out in a week of local development. > > > > I'll look into taking this into the tree later today... > > Note, as mentioned in the cover letter, in it's current form this patch > series is based on the series: > [PATCH v3 0/9] staging: fsl-mc: move bus driver out of staging, add dpio > > ...which means that it won't build or run without that series being > applied first, due to header file dependencies. It also functionally > depends on the DPIO driver. So we need the dpio driver merged first. > > Is moving the fsl-mc bus driver out of staging a possibility now? I'm ok with it, but I really haven't looked at the patches in a while, I keep seeing others have problems with it. Want me to review it now? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH V3] staging: dgnc: Fix lines longer than 80 characters
For two cases (beginning and end of the patch) I opted to create small functions instead of breaking the the lines in a weird way. The other changes are simple ones: either by breaking the line when appropriate or by turning a comment into a multi-line one. Signed-off-by: Fernando Apesteguia --- Changes from V2 include the addition of a new function to wake up processes waiting in a printer/terminal unit. This avoids code duplication and reduces line length. drivers/staging/dgnc/dgnc_tty.c | 64 + 1 file changed, 39 insertions(+), 25 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index af4bc86..37795a0 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -102,6 +102,8 @@ static int dgnc_tty_write(struct tty_struct *tty, const unsigned char *buf, static void dgnc_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios); static void dgnc_tty_send_xchar(struct tty_struct *tty, char ch); +static void dgnc_set_signal_low(struct channel_t *ch, const unsigned char line); +static void dgnc_wake_up_unit(struct un_t *unit); static const struct tty_operations dgnc_tty_ops = { .open = dgnc_tty_open, @@ -786,6 +788,12 @@ void dgnc_check_queue_flow_control(struct channel_t *ch) } } +static void dgnc_set_signal_low(struct channel_t *ch, const unsigned char sig) +{ + ch->ch_mostat &= ~(sig); + ch->ch_bd->bd_ops->assert_modem_signals(ch); +} + void dgnc_wakeup_writes(struct channel_t *ch) { int qlen = 0; @@ -823,19 +831,15 @@ void dgnc_wakeup_writes(struct channel_t *ch) * If RTS Toggle mode is on, whenever * the queue and UART is empty, keep RTS low. */ - if (ch->ch_digi.digi_flags & DIGI_RTS_TOGGLE) { - ch->ch_mostat &= ~(UART_MCR_RTS); - ch->ch_bd->bd_ops->assert_modem_signals(ch); - } + if (ch->ch_digi.digi_flags & DIGI_RTS_TOGGLE) + dgnc_set_signal_low(ch, UART_MCR_RTS); /* * If DTR Toggle mode is on, whenever * the queue and UART is empty, keep DTR low. */ - if (ch->ch_digi.digi_flags & DIGI_DTR_TOGGLE) { - ch->ch_mostat &= ~(UART_MCR_DTR); - ch->ch_bd->bd_ops->assert_modem_signals(ch); - } + if (ch->ch_digi.digi_flags & DIGI_DTR_TOGGLE) + dgnc_set_signal_low(ch, UART_MCR_DTR); } } @@ -969,8 +973,9 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file) * touched safely, the close routine will signal the * ch_flags_wait to wake us back up. */ - rc = wait_event_interruptible(ch->ch_flags_wait, (((ch->ch_tun.un_flags | - ch->ch_pun.un_flags) & UN_CLOSING) == 0)); + rc = wait_event_interruptible(ch->ch_flags_wait, + (((ch->ch_tun.un_flags | + ch->ch_pun.un_flags) & UN_CLOSING) == 0)); /* If ret is non-zero, user ctrl-c'ed us */ if (rc) @@ -1188,11 +1193,12 @@ static int dgnc_block_til_ready(struct tty_struct *tty, */ if (sleep_on_un_flags) retval = wait_event_interruptible - (un->un_flags_wait, (old_flags != (ch->ch_tun.un_flags | - ch->ch_pun.un_flags))); + (un->un_flags_wait, +(old_flags != (ch->ch_tun.un_flags | + ch->ch_pun.un_flags))); else retval = wait_event_interruptible(ch->ch_flags_wait, - (old_flags != ch->ch_flags)); + (old_flags != ch->ch_flags)); /* * We got woken up for some reason. @@ -2326,6 +2332,17 @@ static void dgnc_tty_flush_buffer(struct tty_struct *tty) spin_unlock_irqrestore(&ch->ch_lock, flags); } +/* + * dgnc_wake_up_unit() + * + * Wakes up processes waiting in the unit's (teminal/printer) wait queue + */ +static void dgnc_wake_up_unit(struct un_t *unit) +{ + unit->un_flags &= ~(UN_LOW | UN_EMPTY); + wake_up_interruptible(&unit->un_flags_wait); +} + /* The IOCTL function and all of its helpers */ /* @@ -2
Re: Gigabit ethernet driver for Alacritechs SLIC devices (v4)
From: Greg KH Date: Tue, 6 Dec 2016 17:40:39 +0100 > On Tue, Dec 06, 2016 at 11:30:04AM -0500, David Miller wrote: >> From: Lino Sanfilippo >> Date: Mon, 5 Dec 2016 23:07:15 +0100 >> >> > this is the forth version of the slicoss gigabit ethernet driver (which is >> > a >> > rework of the driver from Alacritech which can currently be found under >> > drivers/staging/slicoss). The driver is supposed to support Mojave, Oasis >> > and >> > Kalahari cards, for both copper and fiber. >> > >> > If this code is accepted the staging version can be removed. >> > >> > The driver has been tested on a SEN2104ET adapter (4 Port PCIe copper). >> >> I've applied this series, nice work. >> >> But realize that if you use SLICOSS as the Kconfig symbol to select >> this driver, then while the staging driver is still in the tree it >> will enable both drivers which both want to attach to the same exact >> device IDs. > > If you have taken this in your tree now, I will go delete the staging > driver from the staging tree, so we will not have that issue. Should I > do that now? Please do. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Gigabit ethernet driver for Alacritechs SLIC devices (v4)
On Tue, Dec 06, 2016 at 11:30:04AM -0500, David Miller wrote: > From: Lino Sanfilippo > Date: Mon, 5 Dec 2016 23:07:15 +0100 > > > this is the forth version of the slicoss gigabit ethernet driver (which is a > > rework of the driver from Alacritech which can currently be found under > > drivers/staging/slicoss). The driver is supposed to support Mojave, Oasis > > and > > Kalahari cards, for both copper and fiber. > > > > If this code is accepted the staging version can be removed. > > > > The driver has been tested on a SEN2104ET adapter (4 Port PCIe copper). > > I've applied this series, nice work. > > But realize that if you use SLICOSS as the Kconfig symbol to select > this driver, then while the staging driver is still in the tree it > will enable both drivers which both want to attach to the same exact > device IDs. If you have taken this in your tree now, I will go delete the staging driver from the staging tree, so we will not have that issue. Should I do that now? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Gigabit ethernet driver for Alacritechs SLIC devices (v4)
From: Lino Sanfilippo Date: Mon, 5 Dec 2016 23:07:15 +0100 > this is the forth version of the slicoss gigabit ethernet driver (which is a > rework of the driver from Alacritech which can currently be found under > drivers/staging/slicoss). The driver is supposed to support Mojave, Oasis and > Kalahari cards, for both copper and fiber. > > If this code is accepted the staging version can be removed. > > The driver has been tested on a SEN2104ET adapter (4 Port PCIe copper). I've applied this series, nice work. But realize that if you use SLICOSS as the Kconfig symbol to select this driver, then while the staging driver is still in the tree it will enable both drivers which both want to attach to the same exact device IDs. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] pci-hyperv: use kmalloc to allocate hypercall params buffer
On Tue, 6 Dec 2016 00:37:08 + Long Li wrote: > > -Original Message- > > From: Stephen Hemminger [mailto:step...@networkplumber.org] > > Sent: Monday, December 5, 2016 8:53 AM > > To: Long Li > > Cc: KY Srinivasan ; Haiyang Zhang > > ; Bjorn Helgaas ; > > de...@linuxdriverproject.org; linux-ker...@vger.kernel.org; linux- > > p...@vger.kernel.org > > Subject: Re: [PATCH] pci-hyperv: use kmalloc to allocate hypercall params > > buffer > > > > On Tue, 8 Nov 2016 14:04:38 -0800 > > Long Li wrote: > > > > > + spin_lock_irqsave(&hbus->retarget_msi_interrupt_lock, flags); > > > + > > > + params = &hbus->retarget_msi_interrupt_params; > > > + memset(params, 0, sizeof(*params)); > > > + params->partition_id = HV_PARTITION_ID_SELF; > > > + params->source = 1; /* MSI(-X) */ > > > + params->address = msi_desc->msg.address_lo; > > > + params->data = msi_desc->msg.data; > > > + params->device_id = (hbus->hdev->dev_instance.b[5] << 24) | > > > (hbus->hdev->dev_instance.b[4] << 16) | > > > (hbus->hdev->dev_instance.b[7] << 8) | > > > (hbus->hdev->dev_instance.b[6] & 0xf8) | > > > PCI_FUNC(pdev->devfn); > > > - params.vector = cfg->vector; > > > + params->vector = cfg->vector; > > > > > > for_each_cpu_and(cpu, dest, cpu_online_mask) > > > - params.vp_mask |= (1ULL << > > vmbus_cpu_number_to_vp_number(cpu)); > > > + params->vp_mask |= (1ULL << > > vmbus_cpu_number_to_vp_number(cpu)); > > > + > > > + hv_do_hypercall(HVCALL_RETARGET_INTERRUPT, params, NULL); > > > > > > - hv_do_hypercall(HVCALL_RETARGET_INTERRUPT, ¶ms, NULL); > > > + spin_unlock_irqrestore(&hbus->retarget_msi_interrupt_lock, flags); > > > > It looks like the additional locking here is being overly paranoid. > > The caller is already holding the irq descriptor lock. Look at fixup_irqs. > > You are right. On my test machine, there are two possible places calling > hv_irq_unmask(): request _irq() and handle_edge_irq(). They both have > desc->lock held when calling .irq_unmask on the chip. A review of the IRQ > code shows that desc->lock is always held while calling chip->irq_unmask(). > > Since the lock doesn't do any harm and it is not on performance code path, we > can remove the lock in the upcoming patches. Why add it then remove it, your patch hasn't been accepted. Please revise it and remove it. Don't add additional unnecessary code. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [lustre-devel] [bug report] staging: add Lustre file system client support
On Dec 6, 2016, at 6:02 AM, Dan Carpenter wrote: > On Mon, Dec 05, 2016 at 06:43:37PM -0500, Oleg Drokin wrote: >> >> On Nov 23, 2016, at 7:29 AM, Dan Carpenter wrote: >> >>> Hi Lustre Devs, >>> >>> The patch d7e09d0397e8: "staging: add Lustre file system client >>> support" from May 2, 2013, leads to the following static checker >>> warning: >>> >>> drivers/staging/lustre/lnet/selftest/console.c:1336 lstcon_test_add() >>> error: 'paramlen' from user is not capped properly >>> >>> The story here, is that "paramlen" is capped but only if "param" is >>> non-NULL. This causes a problem. >>> >>> drivers/staging/lustre/lnet/selftest/console.c >>> 1311 >>> 1312 LIBCFS_ALLOC(test, offsetof(struct lstcon_test, >>> tes_param[paramlen])); >>> >>> We don't know that paramlen is non-NULL here. Because of integer >>> overflows we could end up allocating less than intended. >> >> I think this must be a false positive in this case? >> >> Before calling this function we do: >>LIBCFS_ALLOC(param, args->lstio_tes_param_len); >> >> in lst_test_add_ioctl(), so it's not any bigger than 128k (or kmalloc will >> fail). >> Even if kmalloc would allow more than 128k allocations, >> offsetof(struct lstcon_test, tes_param[0]) is bound to be a lot smaller than >> the baseline allocation address for kmalloc, and therefore integer overflow >> cannot happen at all. >> > > I explained badly, and I typed the wrong variable names by mistake... > Here is the relevant code from the caller: > > drivers/staging/lustre/lnet/selftest/conctl.c > 710 static int lst_test_add_ioctl(lstio_test_args_t *args) > 711 { > 712 char *batch_name; > 713 char *src_name = NULL; > 714 char *dst_name = NULL; > 715 void *param = NULL; > 716 int ret = 0; > 717 int rc = -ENOMEM; > 718 > 719 if (!args->lstio_tes_resultp || > 720 !args->lstio_tes_retp || > 721 !args->lstio_tes_bat_name ||/* no specified batch > */ > 722 args->lstio_tes_bat_nmlen <= 0 || > 723 args->lstio_tes_bat_nmlen > LST_NAME_SIZE || > 724 !args->lstio_tes_sgrp_name || /* no source group */ > 725 args->lstio_tes_sgrp_nmlen <= 0 || > 726 args->lstio_tes_sgrp_nmlen > LST_NAME_SIZE || > 727 !args->lstio_tes_dgrp_name || /* no target group */ > 728 args->lstio_tes_dgrp_nmlen <= 0 || > 729 args->lstio_tes_dgrp_nmlen > LST_NAME_SIZE) > 730 return -EINVAL; > 731 > 732 if (!args->lstio_tes_loop ||/* negative is > infinite */ > 733 args->lstio_tes_concur <= 0 || > 734 args->lstio_tes_dist <= 0 || > 735 args->lstio_tes_span <= 0) > 736 return -EINVAL; > 737 > 738 /* have parameter, check if parameter length is valid */ > 739 if (args->lstio_tes_param && > 740 (args->lstio_tes_param_len <= 0 || > 741 args->lstio_tes_param_len > > 742 PAGE_SIZE - sizeof(struct lstcon_test))) > 743 return -EINVAL; > > If we don't have a parameter then we don't check ->lstio_tes_param_len. I see, indeed, it all makes sense now. So basically if we unconditionally check for the size to be > 0, we should be fine then, I imagine. On the other hand there's probably no se for no param and nonzero param len, so it's probably even better to enforce size as zero when no param. Thank you. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH net-next] tools: hv: Enable network manager for bonding scripts on RHEL
From: Haiyang Zhang Date: Fri, 2 Dec 2016 15:55:38 -0800 > From: Haiyang Zhang > > We found network manager is necessary on RHEL to make the synthetic > NIC, VF NIC bonding operations handled automatically. So, enabling > network manager here. > > Signed-off-by: Haiyang Zhang > Reviewed-by: K. Y. Srinivasan Applied, thanks. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH V2 15/15] hyperv: Add a function to detect if the device is a vmbus dev
> -Original Message- > From: Greg KH [mailto:gre...@linuxfoundation.org] > Sent: Tuesday, December 6, 2016 2:54 AM > To: KY Srinivasan > Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; > o...@aepfle.de; a...@canonical.com; vkuzn...@redhat.com; > jasow...@redhat.com; leann.ogasaw...@canonical.com; Haiyang Zhang > > Subject: Re: [PATCH V2 15/15] hyperv: Add a function to detect if the device > is a vmbus dev > > On Sat, Dec 03, 2016 at 12:34:42PM -0800, k...@exchange.microsoft.com > wrote: > > From: Haiyang Zhang > > > > On Hyper-V, every VF interface has a corresponding synthetic > > interface managed by netvsc that share the same MAC > > address. netvsc registers for netdev events to manage this > > association. Currently we use the MAC address to manage this > > association but going forward, we want to use a serial number that > > the host publishes. To do this we need functionality similar > > to dev_is_pci() for the vmbus devices. Implement such a function. > > > > This function will be used in subsequent patches to netvsc and in the > > interest of eliminating cross tree dependencies, this patch is being > > submitted first. > > As I stated before, I want to see those patches before I will take this > one... Thanks Greg; we will send you the patches. K. Y > > thanks, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: greybus: audio_module: remove redundant OOM message
On Tue, Dec 06, 2016 at 07:39:36PM +0530, Srikant Ritolia wrote: > All kmalloc-based functions print enough information on failure > > Signed-off-by: Srikant Ritolia Acked-by: Johan Hovold > --- > Changes in v2: > - Added driver name in the subject for better readability. > > drivers/staging/greybus/audio_module.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/staging/greybus/audio_module.c > b/drivers/staging/greybus/audio_module.c > index ae1c0fa..213251f 100644 > --- a/drivers/staging/greybus/audio_module.c > +++ b/drivers/staging/greybus/audio_module.c > @@ -207,10 +207,8 @@ static int gb_audio_add_data_connection(struct > gbaudio_module_info *gbmodule, > struct gbaudio_data_connection *dai; > > dai = devm_kzalloc(gbmodule->dev, sizeof(*dai), GFP_KERNEL); > - if (!dai) { > - dev_err(gbmodule->dev, "DAI Malloc failure\n"); > + if (!dai) > return -ENOMEM; > - } > > connection = gb_connection_create_offloaded(bundle, > le16_to_cpu(cport_desc->id), Thanks, Johan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: greybus: audio_module: remove redundant OOM message
All kmalloc-based functions print enough information on failure Signed-off-by: Srikant Ritolia --- Changes in v2: - Added driver name in the subject for better readability. drivers/staging/greybus/audio_module.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/greybus/audio_module.c b/drivers/staging/greybus/audio_module.c index ae1c0fa..213251f 100644 --- a/drivers/staging/greybus/audio_module.c +++ b/drivers/staging/greybus/audio_module.c @@ -207,10 +207,8 @@ static int gb_audio_add_data_connection(struct gbaudio_module_info *gbmodule, struct gbaudio_data_connection *dai; dai = devm_kzalloc(gbmodule->dev, sizeof(*dai), GFP_KERNEL); - if (!dai) { - dev_err(gbmodule->dev, "DAI Malloc failure\n"); + if (!dai) return -ENOMEM; - } connection = gb_connection_create_offloaded(bundle, le16_to_cpu(cport_desc->id), -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to user space
On 12/05/2016 11:58 PM, Oleg Drokin wrote: I guess it's a false positive? Yes, probably. Thank you for the explanation though, I don't fully understand all this yet, I am still learning. Sorry for the noise. Quentin ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH V2] staging: dgnc: Fix lines longer than 80 characters
On Tue, Dec 06, 2016 at 10:12:56AM +0100, Greg KH wrote: > On Sun, Dec 04, 2016 at 08:41:04PM +0100, Fernando Apesteguia wrote: > > For the first lines of the patch, I opted to create a small function > > instead of breaking the the line in a weird way. > > > > This is v2 of the patch with the name of the function changed from > > v1 > > This goes below the --- line. > > > > > The other changes are simple ones. > > What does that mean? Please always be specific. I'll rework the patch. Thanks. > > thanks, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 7/8] staging: fsl-dpaa2/eth: Add TODO file
> -Original Message- > From: Greg KH [mailto:gre...@linuxfoundation.org] > Sent: Tuesday, December 06, 2016 4:20 AM > To: Ruxandra Ioana Radulescu > Cc: de...@driverdev.osuosl.org; linux-ker...@vger.kernel.org; ag...@suse.de; > a...@arndb.de; Alexandru > Marginean ; Bogdan Hamciuc > ; Stuart Yoder > ; Roy Pledge ; Laurentiu Tudor > > Subject: Re: [PATCH 7/8] staging: fsl-dpaa2/eth: Add TODO file > > On Tue, Dec 06, 2016 at 10:06:25AM +, Ruxandra Ioana Radulescu wrote: > > > -Original Message- > > > From: Greg KH [mailto:gre...@linuxfoundation.org] > > > Sent: Tuesday, December 06, 2016 11:58 AM > > > To: Ruxandra Ioana Radulescu > > > Cc: de...@driverdev.osuosl.org; linux-ker...@vger.kernel.org; > > > ag...@suse.de; a...@arndb.de; Alexandru Marginean > > > ; Bogdan Hamciuc > > > ; Stuart Yoder ; Roy > > > Pledge ; Laurentiu Tudor > > > > > > Subject: Re: [PATCH 7/8] staging: fsl-dpaa2/eth: Add TODO file > > > > > > On Tue, Dec 06, 2016 at 03:34:41AM -0600, Ioana Radulescu wrote: > > > > Add a list of TODO items for the Ethernet driver > > > > > > > > Signed-off-by: Ioana Radulescu > > > > --- > > > > drivers/staging/fsl-dpaa2/ethernet/TODO |9 + > > > > 1 files changed, 9 insertions(+), 0 deletions(-) > > > > create mode 100644 drivers/staging/fsl-dpaa2/ethernet/TODO > > > > > > > > diff --git a/drivers/staging/fsl-dpaa2/ethernet/TODO > > > > b/drivers/staging/fsl- > > > dpaa2/ethernet/TODO > > > > new file mode 100644 > > > > index 000..833265b > > > > --- /dev/null > > > > +++ b/drivers/staging/fsl-dpaa2/ethernet/TODO > > > > @@ -0,0 +1,9 @@ > > > > +* Add a DPAA2 MAC kernel driver in order to allow PHY management; > > > currently > > > > + the DPMAC objects and their link to DPNIs are handled by MC > > > > internally > > > > + and all PHYs are seen as fixed-link > > > > +* add more debug support: decide how to expose detailed debug > > > statistics, > > > > + add ingress error queue support > > > > +* MC firmware uprev; the DPAA2 objects used by the Ethernet driver > > > need to > > > > + be kept in sync with binary interface changes in MC > > > > +* refine README file > > > > +* cleanup > > > > > > These seem like very minor things, why not just spend a week and do this > > > work and get it merged to the "correct" portion of the kernel tree? Why > > > does this have to go into staging? > > > > Actually the first bullet is not minor at all and requires some design > > choices that we aren't yet completely clear with, and which in turn may > > affect parts of the Ethernet driver. We figured it would be best to try > > adding this in staging first (and also provide this way an example of using > > the fsl-mc bus and dpio driver) than wait until all MAC development > > questions are ironed-out. > > Ok, that makes sense. > > > I can remove the other bullets from the TODO list if you think they're > > not worth mentioning. > > No, they should be mentioned, I just didn't think they are all that much > work, and if you didn't have major things needed to get done, you could > just knock it all out in a week of local development. > > I'll look into taking this into the tree later today... Note, as mentioned in the cover letter, in it's current form this patch series is based on the series: [PATCH v3 0/9] staging: fsl-mc: move bus driver out of staging, add dpio ...which means that it won't build or run without that series being applied first, due to header file dependencies. It also functionally depends on the DPIO driver. So we need the dpio driver merged first. Is moving the fsl-mc bus driver out of staging a possibility now? Seems like there are several options-- A. Keep bus driver in drivers/staging for now, create new series to add dpio driver into staging, add fsl-dpaa2/eth into staging and refactor it to assume include dependencies in staging directories. B. Apply the series: [PATCH v3 0/9] staging: fsl-mc: move bus driver out of staging, add dpio ...in something close to it's current form. There is some minor feedback on the dpio driver that will require a v4, which I can send in the next day or so. The fsl-mc bus driver to do list is complete, with the exception of demonstrating a functional driver on top of the bus driver, and as described in the cover letter of the "move bus driver out of staging" series the dpio driver demonstrates what an fsl-mc device driver looks like. Thanks, Stuart ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [lustre-devel] [bug report] staging: add Lustre file system client support
On Mon, Dec 05, 2016 at 06:43:37PM -0500, Oleg Drokin wrote: > > On Nov 23, 2016, at 7:29 AM, Dan Carpenter wrote: > > > Hi Lustre Devs, > > > > The patch d7e09d0397e8: "staging: add Lustre file system client > > support" from May 2, 2013, leads to the following static checker > > warning: > > > > drivers/staging/lustre/lnet/selftest/console.c:1336 lstcon_test_add() > > error: 'paramlen' from user is not capped properly > > > > The story here, is that "paramlen" is capped but only if "param" is > > non-NULL. This causes a problem. > > > > drivers/staging/lustre/lnet/selftest/console.c > > 1311 > > 1312 LIBCFS_ALLOC(test, offsetof(struct lstcon_test, > > tes_param[paramlen])); > > > > We don't know that paramlen is non-NULL here. Because of integer > > overflows we could end up allocating less than intended. > > I think this must be a false positive in this case? > > Before calling this function we do: > LIBCFS_ALLOC(param, args->lstio_tes_param_len); > > in lst_test_add_ioctl(), so it's not any bigger than 128k (or kmalloc will > fail). > Even if kmalloc would allow more than 128k allocations, > offsetof(struct lstcon_test, tes_param[0]) is bound to be a lot smaller than > the baseline allocation address for kmalloc, and therefore integer overflow > cannot happen at all. > I explained badly, and I typed the wrong variable names by mistake... Here is the relevant code from the caller: drivers/staging/lustre/lnet/selftest/conctl.c 710 static int lst_test_add_ioctl(lstio_test_args_t *args) 711 { 712 char *batch_name; 713 char *src_name = NULL; 714 char *dst_name = NULL; 715 void *param = NULL; 716 int ret = 0; 717 int rc = -ENOMEM; 718 719 if (!args->lstio_tes_resultp || 720 !args->lstio_tes_retp || 721 !args->lstio_tes_bat_name ||/* no specified batch */ 722 args->lstio_tes_bat_nmlen <= 0 || 723 args->lstio_tes_bat_nmlen > LST_NAME_SIZE || 724 !args->lstio_tes_sgrp_name || /* no source group */ 725 args->lstio_tes_sgrp_nmlen <= 0 || 726 args->lstio_tes_sgrp_nmlen > LST_NAME_SIZE || 727 !args->lstio_tes_dgrp_name || /* no target group */ 728 args->lstio_tes_dgrp_nmlen <= 0 || 729 args->lstio_tes_dgrp_nmlen > LST_NAME_SIZE) 730 return -EINVAL; 731 732 if (!args->lstio_tes_loop ||/* negative is infinite */ 733 args->lstio_tes_concur <= 0 || 734 args->lstio_tes_dist <= 0 || 735 args->lstio_tes_span <= 0) 736 return -EINVAL; 737 738 /* have parameter, check if parameter length is valid */ 739 if (args->lstio_tes_param && 740 (args->lstio_tes_param_len <= 0 || 741 args->lstio_tes_param_len > 742 PAGE_SIZE - sizeof(struct lstcon_test))) 743 return -EINVAL; If we don't have a parameter then we don't check ->lstio_tes_param_len. 744 745 LIBCFS_ALLOC(batch_name, args->lstio_tes_bat_nmlen + 1); 746 if (!batch_name) 747 return rc; 748 749 LIBCFS_ALLOC(src_name, args->lstio_tes_sgrp_nmlen + 1); 750 if (!src_name) 751 goto out; 752 753 LIBCFS_ALLOC(dst_name, args->lstio_tes_dgrp_nmlen + 1); 754 if (!dst_name) 755 goto out; 756 757 if (args->lstio_tes_param) { 758 LIBCFS_ALLOC(param, args->lstio_tes_param_len); 759 if (!param) 760 goto out; 761 if (copy_from_user(param, args->lstio_tes_param, 762 args->lstio_tes_param_len)) { 763 rc = -EFAULT; 764 goto out; 765 } 766 } This is the code that you mentioned. But we don't have a parameter so it's not invoked. 767 768 rc = -EFAULT; 769 if (copy_from_user(batch_name, args->lstio_tes_bat_name, 770 args->lstio_tes_bat_nmlen) || 771 copy_from_user(src_name, args->lstio_tes_sgrp_name, 772 args->lstio_tes_sgrp_nmlen) || 773 copy_from_user(dst_name, args->lstio_tes_dgrp_name, 774 args->lstio_tes_dgrp_nmlen)) 775 goto out; 776 777 rc = lstcon_test_add(batch_name, args->lstio_tes_type, 778 args->lstio_tes_loop, args->lstio_tes_concur, 779 args->lstio_tes_dist, args->lstio_tes_span, 780 s
Re: [PATCH] staging: greybus: don't print on ENOMEM
On Tue, Dec 06, 2016 at 04:25:07PM +0530, Srikant Ritolia wrote: > All kmalloc-based functions print enough information on failure > > Signed-off-by: Srikant Ritolia Please include the driver or component you are modifying in your subject prefix (e.g. use "staging: greybus: audio_module: remove redundant OOM message"). Fix that up and you can add my Acked-by: Johan Hovold Thanks, Johan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: greybus: don't print on ENOMEM
All kmalloc-based functions print enough information on failure Signed-off-by: Srikant Ritolia --- drivers/staging/greybus/audio_module.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/greybus/audio_module.c b/drivers/staging/greybus/audio_module.c index ae1c0fa..213251f 100644 --- a/drivers/staging/greybus/audio_module.c +++ b/drivers/staging/greybus/audio_module.c @@ -207,10 +207,8 @@ static int gb_audio_add_data_connection(struct gbaudio_module_info *gbmodule, struct gbaudio_data_connection *dai; dai = devm_kzalloc(gbmodule->dev, sizeof(*dai), GFP_KERNEL); - if (!dai) { - dev_err(gbmodule->dev, "DAI Malloc failure\n"); + if (!dai) return -ENOMEM; - } connection = gb_connection_create_offloaded(bundle, le16_to_cpu(cport_desc->id), -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH V2 00/15] Drivers: hv: CPU management fixes and a new uio driver
On Sat, Dec 03, 2016 at 12:33:59PM -0800, k...@exchange.microsoft.com wrote: > From: K. Y. Srinivasan > > Fixes to handle CPU online/offline. Also included is a new uio > driver for Hyper-V. > > V2: Updated commit logs (Greg KH) > Re-implemented the API to detect if it is a vmbus device I've taken some of these patches now, please fix up and resend the rest (or drop them in the case of the last patch...) thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH V2 15/15] hyperv: Add a function to detect if the device is a vmbus dev
On Sat, Dec 03, 2016 at 12:34:42PM -0800, k...@exchange.microsoft.com wrote: > From: Haiyang Zhang > > On Hyper-V, every VF interface has a corresponding synthetic > interface managed by netvsc that share the same MAC > address. netvsc registers for netdev events to manage this > association. Currently we use the MAC address to manage this > association but going forward, we want to use a serial number that > the host publishes. To do this we need functionality similar > to dev_is_pci() for the vmbus devices. Implement such a function. > > This function will be used in subsequent patches to netvsc and in the > interest of eliminating cross tree dependencies, this patch is being > submitted first. As I stated before, I want to see those patches before I will take this one... thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 4/9] bus: fsl-mc: dpio: add frame descriptor and scatter/gather APIs
On 12/05/2016 10:52 PM, Dan Carpenter wrote: > On Fri, Dec 02, 2016 at 12:12:14PM +, Laurentiu Tudor wrote: >>> +static inline bool dpaa2_sg_is_final(const struct dpaa2_sg_entry *sg) >>> +{ >>> + return !!(le16_to_cpu(sg->format_offset) >> SG_FINAL_FLAG_SHIFT); >> >> In other places in this file we don't use the '!!' to convert to bool. Maybe >> we should drop it here too. > > I like the explicit "!!". I think it makes the code more obvious since > all the information is on one line. > That's fine too, as long as we're doing it consistently in all the places. --- Best Regards, Laurentiu ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 7/8] staging: fsl-dpaa2/eth: Add TODO file
On Tue, Dec 06, 2016 at 10:06:25AM +, Ruxandra Ioana Radulescu wrote: > > -Original Message- > > From: Greg KH [mailto:gre...@linuxfoundation.org] > > Sent: Tuesday, December 06, 2016 11:58 AM > > To: Ruxandra Ioana Radulescu > > Cc: de...@driverdev.osuosl.org; linux-ker...@vger.kernel.org; > > ag...@suse.de; a...@arndb.de; Alexandru Marginean > > ; Bogdan Hamciuc > > ; Stuart Yoder ; Roy > > Pledge ; Laurentiu Tudor > > > > Subject: Re: [PATCH 7/8] staging: fsl-dpaa2/eth: Add TODO file > > > > On Tue, Dec 06, 2016 at 03:34:41AM -0600, Ioana Radulescu wrote: > > > Add a list of TODO items for the Ethernet driver > > > > > > Signed-off-by: Ioana Radulescu > > > --- > > > drivers/staging/fsl-dpaa2/ethernet/TODO |9 + > > > 1 files changed, 9 insertions(+), 0 deletions(-) > > > create mode 100644 drivers/staging/fsl-dpaa2/ethernet/TODO > > > > > > diff --git a/drivers/staging/fsl-dpaa2/ethernet/TODO > > > b/drivers/staging/fsl- > > dpaa2/ethernet/TODO > > > new file mode 100644 > > > index 000..833265b > > > --- /dev/null > > > +++ b/drivers/staging/fsl-dpaa2/ethernet/TODO > > > @@ -0,0 +1,9 @@ > > > +* Add a DPAA2 MAC kernel driver in order to allow PHY management; > > currently > > > + the DPMAC objects and their link to DPNIs are handled by MC internally > > > + and all PHYs are seen as fixed-link > > > +* add more debug support: decide how to expose detailed debug > > statistics, > > > + add ingress error queue support > > > +* MC firmware uprev; the DPAA2 objects used by the Ethernet driver > > need to > > > + be kept in sync with binary interface changes in MC > > > +* refine README file > > > +* cleanup > > > > These seem like very minor things, why not just spend a week and do this > > work and get it merged to the "correct" portion of the kernel tree? Why > > does this have to go into staging? > > Actually the first bullet is not minor at all and requires some design > choices that we aren't yet completely clear with, and which in turn may > affect parts of the Ethernet driver. We figured it would be best to try > adding this in staging first (and also provide this way an example of using > the fsl-mc bus and dpio driver) than wait until all MAC development > questions are ironed-out. Ok, that makes sense. > I can remove the other bullets from the TODO list if you think they're > not worth mentioning. No, they should be mentioned, I just didn't think they are all that much work, and if you didn't have major things needed to get done, you could just knock it all out in a week of local development. I'll look into taking this into the tree later today... thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 12/19] staging: iio: isl29028: fix comparison between signed and unsigned integers
On Mon, Dec 05, 2016 at 07:10:45PM -0500, Brian Masney wrote: > On Mon, Dec 05, 2016 at 11:53:39PM +0300, Dan Carpenter wrote: > > On Sat, Dec 03, 2016 at 09:19:36PM -0500, Brian Masney wrote: > > > Fixed warning found by make W=2 to reduce the amount of build noise: > > > > > > warning: comparison between signed and unsigned integer expressions > > > [-Wsign-compare] > > > > Ugh... Please don't do work arounds for nonsense warnings. W=2 is so > > stupid. Better to just grep -v this warning instead of trying to please > > a broken static analysis. Warnings like this are why it's disabled by > > default. > > Hi Dan, >I would normally agree, however there could be a case where this > warning flags a legitimate issue. It is obviously not an issue in this > case. Since I'm already working on cleaning up this driver to move it > out of staging, I figured that I would make sure that it builds cleanly > with W=2. This was the only warning found in that driver. The > change is harmless in my opinion and it may eliminate a nonsense warning > for someone else down the road when doing security audits. Iterators should be int unless there is a specific reason for a fancier data type. Using complicated types just makes the code more complicated and tiring to read. Smatch or other similar static analysis tools know that "sel" is in the 0-7 range and that ARRAY_SIZE(prox_period) is 8. GCC almost certainly knows this as well. The warning messages is just printed because the devs are lazy. It's totally pointless. Don't work around lazy static analysis. It sends the wrong message to do pointless things. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] staging: android: ashmem: convert range macros to inlines and clean-up
On 12/06/16 07:39, Greg Kroah-Hartman wrote: > On Mon, Dec 05, 2016 at 08:01:35PM +, Guillaume Tucker wrote: >> On 12/05/16 18:08, Greg Kroah-Hartman wrote: >>> On Mon, Dec 05, 2016 at 05:34:15PM +, Guillaume Tucker wrote: Convert ashmem_range related macros to inline functions to fix checkpatch errors. Clean up the code in related existing inline functions. >>> >>> How about breaking this up into two different patches, one for the >>> inlines, and one to fix up the existing inline functions for coding >>> style issues? >>> >>> thanks, >>> >>> greg k-h >> >> Sure, thanks. I've sent a v2. >> >> (and sorry the series still doesn't seem to be treated as a thread in >> spite of the In-Reply-To: and References: headers being there...) > > They are there, but they are incorrect, are you using git send-email to > set them, or are you trying to do it by hand? I was using 'git format-patch --thread' and 'git imap-send' to upload them to my gmail drafts and then send them with my email client (Icedove in this case). It looks like it all worked except for the Message-IDs, they got rewritten somehow. I'll either find a way to fix it or use plain 'git send-email' to get this sorted before I send any more patches. Thanks! Guillaume ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH V2 07/15] hv: init percpu_list in hv_synic_alloc()
On Sat, Dec 03, 2016 at 12:34:34PM -0800, k...@exchange.microsoft.com wrote: > From: Vitaly Kuznetsov > > Initializing hv_context.percpu_list in hv_synic_alloc() helps to prevent a > crash in percpu_channel_enq() when not all CPUs were online during > initialization and it naturally belongs there. > > Signed-off-by: Vitaly Kuznetsov > Signed-off-by: K. Y. Srinivasan > --- > drivers/hv/hv.c |4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) stable kernels? ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH V2 06/15] hv: allocate synic pages for all present CPUs
On Sat, Dec 03, 2016 at 12:34:33PM -0800, k...@exchange.microsoft.com wrote: > From: Vitaly Kuznetsov > > It may happen that not all CPUs are online when we do hv_synic_alloc() and > in case more CPUs come online later we may try accessing these allocated > structures. > > Signed-off-by: Vitaly Kuznetsov > Signed-off-by: K. Y. Srinivasan > --- > drivers/hv/hv.c |4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) For stable releases? ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH V2 04/15] Drivers: hv: vmbus: Enhance the rescind callback functionality
On Sat, Dec 03, 2016 at 12:34:31PM -0800, k...@exchange.microsoft.com wrote: > From: K. Y. Srinivasan > > Enhance the rescind callback functionality by permitting the passing of an > opaque > pointer. This functionality will be used by vmbus device drivers to implement > rescind related cleanup more efficiently. Eeek, why a void *? Please make this a _real_ pointer. > > Signed-off-by: K. Y. Srinivasan > --- > drivers/hv/channel_mgmt.c | 11 +++ > include/linux/hyperv.h|7 --- > 2 files changed, 11 insertions(+), 7 deletions(-) > > diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c > index f9c5827..d83c1ac 100644 > --- a/drivers/hv/channel_mgmt.c > +++ b/drivers/hv/channel_mgmt.c > @@ -825,8 +825,10 @@ static void vmbus_onoffer_rescind(struct > vmbus_channel_message_header *hdr) > > if (channel->device_obj) { > if (channel->chn_rescind_callback) { > - channel->chn_rescind_callback(channel); > - goto out; > + channel->chn_rescind_callback(channel, > + channel->rescind_arg); > + if (is_hvsock_channel(channel)) > + goto out; > } > /* >* We will have to unregister this device from the > @@ -1215,9 +1217,10 @@ bool vmbus_are_subchannels_present(struct > vmbus_channel *primary) > } > EXPORT_SYMBOL_GPL(vmbus_are_subchannels_present); > > -void vmbus_set_chn_rescind_callback(struct vmbus_channel *channel, > - void (*chn_rescind_cb)(struct vmbus_channel *)) > +void vmbus_set_chn_rescind_callback(struct vmbus_channel *channel, void *arg, > + void (*chn_rescind_cb)(struct vmbus_channel *, void *)) > { > channel->chn_rescind_callback = chn_rescind_cb; > + channel->rescind_arg = arg; > } > EXPORT_SYMBOL_GPL(vmbus_set_chn_rescind_callback); > diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h > index 35053f9..a9a0ce4 100644 > --- a/include/linux/hyperv.h > +++ b/include/linux/hyperv.h > @@ -800,7 +800,8 @@ struct vmbus_channel { >* Channel rescind callback. Some channels (the hvsock ones), need to >* register a callback which is invoked in vmbus_onoffer_rescind(). >*/ > - void (*chn_rescind_callback)(struct vmbus_channel *channel); > + void (*chn_rescind_callback)(struct vmbus_channel *channel, void *arg); > + void *rescind_arg; Why does the channel have rescind_arg here? Where do you use this functionality? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH V2 01/15] Drivers: hv: vmbus: Raise retry/wait limits in vmbus_post_msg()
On Sat, Dec 03, 2016 at 12:34:28PM -0800, k...@exchange.microsoft.com wrote: > From: Vitaly Kuznetsov > > DoS protection conditions were altered in WS2016 and now it's easy to get > -EAGAIN returned from vmbus_post_msg() (e.g. when we try changing MTU on a > netvsc device in a loop). All vmbus_post_msg() callers don't retry the > operation and we usually end up with a non-functional device or crash. > > While host's DoS protection conditions are unknown to me my tests show that > it can take up to 10 seconds before the message is sent so doing udelay() > is not an option, we really need to sleep. Almost all vmbus_post_msg() > callers are ready to sleep but there is one special case: > vmbus_initiate_unload() which can be called from interrupt/NMI context and > we can't sleep there. I'm also not sure about the lonely > vmbus_send_tl_connect_request() which has no in-tree users but its external > users are most likely waiting for the host to reply so sleeping there is > also appropriate. > > Signed-off-by: Vitaly Kuznetsov > Signed-off-by: K. Y. Srinivasan Shouldn't this go to stable kernels so that 4.9 and earlier can work properly on WS2016? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 7/8] staging: fsl-dpaa2/eth: Add TODO file
> -Original Message- > From: Greg KH [mailto:gre...@linuxfoundation.org] > Sent: Tuesday, December 06, 2016 11:58 AM > To: Ruxandra Ioana Radulescu > Cc: de...@driverdev.osuosl.org; linux-ker...@vger.kernel.org; > ag...@suse.de; a...@arndb.de; Alexandru Marginean > ; Bogdan Hamciuc > ; Stuart Yoder ; Roy > Pledge ; Laurentiu Tudor > > Subject: Re: [PATCH 7/8] staging: fsl-dpaa2/eth: Add TODO file > > On Tue, Dec 06, 2016 at 03:34:41AM -0600, Ioana Radulescu wrote: > > Add a list of TODO items for the Ethernet driver > > > > Signed-off-by: Ioana Radulescu > > --- > > drivers/staging/fsl-dpaa2/ethernet/TODO |9 + > > 1 files changed, 9 insertions(+), 0 deletions(-) > > create mode 100644 drivers/staging/fsl-dpaa2/ethernet/TODO > > > > diff --git a/drivers/staging/fsl-dpaa2/ethernet/TODO b/drivers/staging/fsl- > dpaa2/ethernet/TODO > > new file mode 100644 > > index 000..833265b > > --- /dev/null > > +++ b/drivers/staging/fsl-dpaa2/ethernet/TODO > > @@ -0,0 +1,9 @@ > > +* Add a DPAA2 MAC kernel driver in order to allow PHY management; > currently > > + the DPMAC objects and their link to DPNIs are handled by MC internally > > + and all PHYs are seen as fixed-link > > +* add more debug support: decide how to expose detailed debug > statistics, > > + add ingress error queue support > > +* MC firmware uprev; the DPAA2 objects used by the Ethernet driver > need to > > + be kept in sync with binary interface changes in MC > > +* refine README file > > +* cleanup > > These seem like very minor things, why not just spend a week and do this > work and get it merged to the "correct" portion of the kernel tree? Why > does this have to go into staging? Actually the first bullet is not minor at all and requires some design choices that we aren't yet completely clear with, and which in turn may affect parts of the Ethernet driver. We figured it would be best to try adding this in staging first (and also provide this way an example of using the fsl-mc bus and dpio driver) than wait until all MAC development questions are ironed-out. I can remove the other bullets from the TODO list if you think they're not worth mentioning. Thanks, Ioana ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] Staging: dgnc: dgnc_*.c: Use usleep_range over udelay to improve coalescing processor wakeups
On Tue, Dec 06, 2016 at 09:59:58AM +0100, Shiva Kerdel wrote: In most cases, usleep_range is better than udelay, as the precise wakeup from udelay is unnecessary. But, udelay does something different than usleep, are you sure you should be giving up the cpu at this point in time? Are you sure you are even in a function that is allowed to sleep? I don't think that is the case for all of these at all, sorry, unless you have the hardware to test this change, I can't take it. greg k-h I wasn't aware of this, thank you for pointing out. Since I don't have this hardware, I'm unable to test the changes. Shiva Kerdel ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 00/22] Next batch of missing work for upstream client
On Fri, Dec 02, 2016 at 07:53:07PM -0500, James Simmons wrote: > Batch of various fixes and clean ups missing in the upstream client. > Only one smaller batch of patches left to sync lustre 2.8.0 version. > These patches are independent of each other so they can be landed > in any order. I've applied most of these now, please fix up the remaining ones and resend. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 14/22] staging: lustre: obd: add callback for llog_cat_process_or_fork
On Fri, Dec 02, 2016 at 07:53:21PM -0500, James Simmons wrote: > From: Alexander Boyko > > Currently llog_process_or_fork() is hard coded to > always pass the function pointer llog_cat_process_cb(). > Change llog_cat_process_or_fork() to pass in any > function pointer which will allow us more options > for llog_cat callback routines in the future. Don't change this until you have an actual user for this. Adding infrastructure that is not used is not ok for a staging driver, or really any kernel driver at all. sorry, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 7/8] staging: fsl-dpaa2/eth: Add TODO file
On Tue, Dec 06, 2016 at 03:34:41AM -0600, Ioana Radulescu wrote: > Add a list of TODO items for the Ethernet driver > > Signed-off-by: Ioana Radulescu > --- > drivers/staging/fsl-dpaa2/ethernet/TODO |9 + > 1 files changed, 9 insertions(+), 0 deletions(-) > create mode 100644 drivers/staging/fsl-dpaa2/ethernet/TODO > > diff --git a/drivers/staging/fsl-dpaa2/ethernet/TODO > b/drivers/staging/fsl-dpaa2/ethernet/TODO > new file mode 100644 > index 000..833265b > --- /dev/null > +++ b/drivers/staging/fsl-dpaa2/ethernet/TODO > @@ -0,0 +1,9 @@ > +* Add a DPAA2 MAC kernel driver in order to allow PHY management; currently > + the DPMAC objects and their link to DPNIs are handled by MC internally > + and all PHYs are seen as fixed-link > +* add more debug support: decide how to expose detailed debug statistics, > + add ingress error queue support > +* MC firmware uprev; the DPAA2 objects used by the Ethernet driver need to > + be kept in sync with binary interface changes in MC > +* refine README file > +* cleanup These seem like very minor things, why not just spend a week and do this work and get it merged to the "correct" portion of the kernel tree? Why does this have to go into staging? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH TRIVIAL] staging: lustre: lnet: corrected label name.
On Sat, Dec 03, 2016 at 08:47:28AM +, Parav Pandit wrote: > Corrected label name from err_destory_routes to err_destroy_routes. > > Signed-off-by: Parav Pandit > --- > drivers/staging/lustre/lnet/lnet/api-ni.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) This is already in the tree :( ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/6] staging: lustre: obdclass: Create a header for obdo related functions
On Fri, Dec 02, 2016 at 02:40:47PM -0500, James Simmons wrote: > From: Ben Evans > > Remove all obdo related functions from lustre_idl.h > Create lustre_odbo.h. Include where appropriate. > Make the functions lustre_get_wire_obdo and > lustre_set_wire_obdo to not be inlined functions. Breaks the build, please test better. I'm dropping this, and the rest of this series from my queue :( greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/8] staging: fsl-dpaa2/eth: Add APIs for DPNI objects
Add the command build/parse APIs for operating on DPNI objects through the DPAA2 Management Complex. Signed-off-by: Ioana Radulescu --- drivers/staging/Kconfig |2 + drivers/staging/Makefile |1 + drivers/staging/fsl-dpaa2/Kconfig | 17 + drivers/staging/fsl-dpaa2/Makefile|5 + drivers/staging/fsl-dpaa2/ethernet/Makefile |7 + drivers/staging/fsl-dpaa2/ethernet/dpkg.h | 176 +++ drivers/staging/fsl-dpaa2/ethernet/dpni-cmd.h | 540 + drivers/staging/fsl-dpaa2/ethernet/dpni.c | 1594 + drivers/staging/fsl-dpaa2/ethernet/dpni.h | 831 + drivers/staging/fsl-dpaa2/ethernet/net.h | 480 10 files changed, 3653 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/fsl-dpaa2/Kconfig create mode 100644 drivers/staging/fsl-dpaa2/Makefile create mode 100644 drivers/staging/fsl-dpaa2/ethernet/Makefile create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpkg.h create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpni-cmd.h create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpni.c create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpni.h create mode 100644 drivers/staging/fsl-dpaa2/ethernet/net.h diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig index 8d7a13f..5a19f53 100644 --- a/drivers/staging/Kconfig +++ b/drivers/staging/Kconfig @@ -104,4 +104,6 @@ source "drivers/staging/greybus/Kconfig" source "drivers/staging/vc04_services/Kconfig" +source "drivers/staging/fsl-dpaa2/Kconfig" + endif # STAGING diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile index b5e494e..9beb330 100644 --- a/drivers/staging/Makefile +++ b/drivers/staging/Makefile @@ -41,3 +41,4 @@ obj-$(CONFIG_ISDN_I4L)+= i4l/ obj-$(CONFIG_KS7010) += ks7010/ obj-$(CONFIG_GREYBUS) += greybus/ obj-$(CONFIG_BCM2835_VCHIQ)+= vc04_services/ +obj-$(CONFIG_FSL_MC_BUS) += fsl-dpaa2/ diff --git a/drivers/staging/fsl-dpaa2/Kconfig b/drivers/staging/fsl-dpaa2/Kconfig new file mode 100644 index 000..2e325cb --- /dev/null +++ b/drivers/staging/fsl-dpaa2/Kconfig @@ -0,0 +1,17 @@ +# +# Freescale DataPath Acceleration Architecture Gen2 (DPAA2) drivers +# + +config FSL_DPAA2 + bool "Freescale DPAA2 devices" + depends on FSL_MC_BUS + ---help--- + Build drivers for Freescale DataPath Acceleration + Architecture (DPAA2) family of SoCs. + +config FSL_DPAA2_ETH + tristate "Freescale DPAA2 Ethernet" + depends on FSL_DPAA2 && FSL_MC_DPIO + ---help--- + Ethernet driver for Freescale DPAA2 SoCs, using the + Freescale MC bus driver diff --git a/drivers/staging/fsl-dpaa2/Makefile b/drivers/staging/fsl-dpaa2/Makefile new file mode 100644 index 000..0836ba8 --- /dev/null +++ b/drivers/staging/fsl-dpaa2/Makefile @@ -0,0 +1,5 @@ +# +# Freescale DataPath Acceleration Architecture Gen2 (DPAA2) drivers +# + +obj-$(CONFIG_FSL_DPAA2_ETH)+= ethernet/ diff --git a/drivers/staging/fsl-dpaa2/ethernet/Makefile b/drivers/staging/fsl-dpaa2/ethernet/Makefile new file mode 100644 index 000..83b6264 --- /dev/null +++ b/drivers/staging/fsl-dpaa2/ethernet/Makefile @@ -0,0 +1,7 @@ +# +# Makefile for the Freescale DPAA2 Ethernet controller +# + +obj-$(CONFIG_FSL_DPAA2_ETH) += fsl-dpaa2-eth.o + +fsl-dpaa2-eth-objs:= dpni.o diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpkg.h b/drivers/staging/fsl-dpaa2/ethernet/dpkg.h new file mode 100644 index 000..02290a0 --- /dev/null +++ b/drivers/staging/fsl-dpaa2/ethernet/dpkg.h @@ -0,0 +1,176 @@ +/* Copyright 2013-2015 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the above-listed copyright holders nor the + * names of any contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBU
[PATCH 3/8] staging: fsl-dpaa2/eth: Add Freescale DPAA2 Ethernet driver
Introduce the DPAA2 Ethernet driver, which manages Datapath Network Interface (DPNI) objects discovered on the MC bus. In addition to DPNIs, the Ethernet driver uses several other MC objects to build a network interface abstraction: buffer pools (DPBPs), I/O Portals (DPIOs) and concentrators (DPCONs). Signed-off-by: Ioana Radulescu Signed-off-by: Bogdan Hamciuc --- drivers/staging/fsl-dpaa2/ethernet/Makefile|2 +- drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 2460 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h | 302 +++ 3 files changed, 2763 insertions(+), 1 deletions(-) create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h diff --git a/drivers/staging/fsl-dpaa2/ethernet/Makefile b/drivers/staging/fsl-dpaa2/ethernet/Makefile index 83b6264..4897d39 100644 --- a/drivers/staging/fsl-dpaa2/ethernet/Makefile +++ b/drivers/staging/fsl-dpaa2/ethernet/Makefile @@ -4,4 +4,4 @@ obj-$(CONFIG_FSL_DPAA2_ETH) += fsl-dpaa2-eth.o -fsl-dpaa2-eth-objs:= dpni.o +fsl-dpaa2-eth-objs:= dpaa2-eth.o dpni.o diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c new file mode 100644 index 000..eda7885 --- /dev/null +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c @@ -0,0 +1,2460 @@ +/* Copyright 2014-2016 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "dpaa2-eth.h" + +MODULE_LICENSE("Dual BSD/GPL"); +MODULE_AUTHOR("Freescale Semiconductor, Inc"); +MODULE_DESCRIPTION("Freescale DPAA2 Ethernet Driver"); + +static void validate_rx_csum(struct dpaa2_eth_priv *priv, +u32 fd_status, +struct sk_buff *skb) +{ + skb_checksum_none_assert(skb); + + /* HW checksum validation is disabled, nothing to do here */ + if (!(priv->net_dev->features & NETIF_F_RXCSUM)) + return; + + /* Read checksum validation bits */ + if (!((fd_status & DPAA2_FAS_L3CV) && + (fd_status & DPAA2_FAS_L4CV))) + return; + + /* Inform the stack there's no need to compute L3/L4 csum anymore */ + skb->ip_summed = CHECKSUM_UNNECESSARY; +} + +/* Free a received FD. + * Not to be used for Tx conf FDs or on any other paths. + */ +static void free_rx_fd(struct dpaa2_eth_priv *priv, + const struct dpaa2_fd *fd, + void *vaddr) +{ + struct device *dev = priv->net_dev->dev.parent; + dma_addr_t addr = dpaa2_fd_get_addr(fd); + u8 fd_format = dpaa2_fd_get_format(fd); + struct dpaa2_sg_entry *sgt; + void *sg_vaddr; + int i; + + /* If single buffer frame, just free the data buffer */ + if (fd_format == dpaa2_fd_single) + goto free_buf; + else if (fd_format != dpaa2_fd_sg) + /* We don't support any other format */ + return; + + /* For S/G frames, we first need to free all SG entries */ + sgt = vaddr + dpaa2_fd_get_offset(fd); + for (i = 0; i < DPAA2_ETH_MAX_SG_
[PATCH 6/8] staging: fsl-dpaa2/eth: Add trace points
Add trace events in significant places of the data path. Useful for debuggging. Signed-off-by: Ioana Radulescu --- drivers/staging/fsl-dpaa2/ethernet/Makefile|3 + .../staging/fsl-dpaa2/ethernet/dpaa2-eth-trace.h | 185 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 21 +++ drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h |2 + 4 files changed, 211 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth-trace.h diff --git a/drivers/staging/fsl-dpaa2/ethernet/Makefile b/drivers/staging/fsl-dpaa2/ethernet/Makefile index 4327ebe..77b0b74 100644 --- a/drivers/staging/fsl-dpaa2/ethernet/Makefile +++ b/drivers/staging/fsl-dpaa2/ethernet/Makefile @@ -5,3 +5,6 @@ obj-$(CONFIG_FSL_DPAA2_ETH) += fsl-dpaa2-eth.o fsl-dpaa2-eth-objs:= dpaa2-eth.o dpaa2-ethtool.o dpni.o + +# Needed by the tracing framework +CFLAGS_dpaa2-eth.o := -I$(src) diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth-trace.h b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth-trace.h new file mode 100644 index 000..3b040e8 --- /dev/null +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth-trace.h @@ -0,0 +1,185 @@ +/* Copyright 2014-2015 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM dpaa2_eth + +#if !defined(_DPAA2_ETH_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) +#define _DPAA2_ETH_TRACE_H + +#include +#include +#include "dpaa2-eth.h" +#include + +#define TR_FMT "[%s] fd: addr=0x%llx, len=%u, off=%u" +/* trace_printk format for raw buffer event class */ +#define TR_BUF_FMT "[%s] vaddr=%p size=%zu dma_addr=%pad map_size=%zu bpid=%d" + +/* This is used to declare a class of events. + * individual events of this type will be defined below. + */ + +/* Store details about a frame descriptor */ +DECLARE_EVENT_CLASS(dpaa2_eth_fd, + /* Trace function prototype */ + TP_PROTO(struct net_device *netdev, +const struct dpaa2_fd *fd), + + /* Repeat argument list here */ + TP_ARGS(netdev, fd), + + /* A structure containing the relevant information we want +* to record. Declare name and type for each normal element, +* name, type and size for arrays. Use __string for variable +* length strings. +*/ + TP_STRUCT__entry( +__field(u64, fd_addr) +__field(u32, fd_len) +__field(u16, fd_offset) +__string(name, netdev->name) + ), + + /* The function that assigns values to the above declared +* fields +*/ + TP_fast_assign( + __entry->fd_addr = dpaa2_fd_get_addr(fd); + __entry->fd_len = dpaa2_fd_get_len(fd); + __entry->fd_offset = dpaa2_fd_get_offset(fd); + __assign_str(name, netdev->name); + ), + +
[PATCH 8/8] staging: fsl-dpaa2/eth: Add maintainer for Ethernet driver
Signed-off-by: Ioana Radulescu --- MAINTAINERS |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 312c582..da4a6fa 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5057,6 +5057,12 @@ S: Maintained F: drivers/net/ethernet/freescale/fman F: Documentation/devicetree/bindings/powerpc/fsl/fman.txt +FREESCALE QORIQ DPAA2 ETHERNET DRIVER +M: Ioana Radulescu +L: linux-ker...@vger.kernel.org +S: Maintained +F: drivers/staging/fsl-dpaa2/ethernet + FREESCALE QUICC ENGINE LIBRARY L: linuxppc-...@lists.ozlabs.org S: Orphan -- 1.7.3.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/8] staging: fsl-dpaa2/eth: Add driver specific stats
Add custom statistics to be reported via ethtool -S. These include driver specific per-cpu statistics as well as queue and channel counters. Signed-off-by: Ioana Radulescu --- drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 42 - drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h | 36 ++ drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c | 49 +++- 3 files changed, 123 insertions(+), 4 deletions(-) diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c index cfa1d36..9033b70 100644 --- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c @@ -207,6 +207,7 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv, void *vaddr; struct sk_buff *skb; struct rtnl_link_stats64 *percpu_stats; + struct dpaa2_eth_drv_stats *percpu_extras; struct device *dev = priv->net_dev->dev.parent; struct dpaa2_fas *fas; u32 status = 0; @@ -218,6 +219,7 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv, prefetch(vaddr + dpaa2_fd_get_offset(fd)); percpu_stats = this_cpu_ptr(priv->percpu_stats); + percpu_extras = this_cpu_ptr(priv->percpu_extras); if (fd_format == dpaa2_fd_single) { skb = build_linear_skb(priv, ch, fd, vaddr); @@ -226,6 +228,8 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv, vaddr + dpaa2_fd_get_offset(fd); skb = build_frag_skb(priv, ch, sgt); skb_free_frag(vaddr); + percpu_extras->rx_sg_frames++; + percpu_extras->rx_sg_bytes += dpaa2_fd_get_len(fd); } else { /* We don't support any other format */ goto err_frame_format; @@ -290,6 +294,7 @@ static int consume_frames(struct dpaa2_eth_channel *ch) fd = dpaa2_dq_fd(dq); fq = (struct dpaa2_eth_fq *)dpaa2_dq_fqd_ctx(dq); + fq->stats.frames++; fq->consume(priv, ch, fd, &ch->napi); cleaned++; @@ -531,11 +536,13 @@ static int dpaa2_eth_tx(struct sk_buff *skb, struct net_device *net_dev) struct dpaa2_eth_priv *priv = netdev_priv(net_dev); struct dpaa2_fd fd; struct rtnl_link_stats64 *percpu_stats; + struct dpaa2_eth_drv_stats *percpu_extras; struct dpaa2_eth_fq *fq; u16 queue_mapping; int err, i; percpu_stats = this_cpu_ptr(priv->percpu_stats); + percpu_extras = this_cpu_ptr(priv->percpu_extras); if (unlikely(skb_headroom(skb) < DPAA2_ETH_NEEDED_HEADROOM(priv))) { struct sk_buff *ns; @@ -564,10 +571,14 @@ static int dpaa2_eth_tx(struct sk_buff *skb, struct net_device *net_dev) /* Setup the FD fields */ memset(&fd, 0, sizeof(fd)); - if (skb_is_nonlinear(skb)) + if (skb_is_nonlinear(skb)) { err = build_sg_fd(priv, skb, &fd); - else + percpu_extras->tx_sg_frames++; + percpu_extras->tx_sg_bytes += skb->len; + } else { err = build_single_fd(priv, skb, &fd); + } + if (unlikely(err)) { percpu_stats->tx_dropped++; goto err_build_fd; @@ -584,6 +595,7 @@ static int dpaa2_eth_tx(struct sk_buff *skb, struct net_device *net_dev) if (err != -EBUSY) break; } + percpu_extras->tx_portal_busy += i; if (unlikely(err < 0)) { percpu_stats->tx_errors++; /* Clean up everything, including freeing the skb */ @@ -609,8 +621,13 @@ static void dpaa2_eth_tx_conf(struct dpaa2_eth_priv *priv, struct napi_struct *napi __always_unused) { struct rtnl_link_stats64 *percpu_stats; + struct dpaa2_eth_drv_stats *percpu_extras; u32 status = 0; + percpu_extras = this_cpu_ptr(priv->percpu_extras); + percpu_extras->tx_conf_frames++; + percpu_extras->tx_conf_bytes += dpaa2_fd_get_len(fd); + free_tx_fd(priv, fd, &status); if (unlikely(status & DPAA2_ETH_TXCONF_ERR_MASK)) { @@ -815,13 +832,19 @@ static int refill_pool(struct dpaa2_eth_priv *priv, static int pull_channel(struct dpaa2_eth_channel *ch) { int err; + int dequeues = -1; /* Retry while portal is busy */ do { err = dpaa2_io_service_pull_channel(NULL, ch->ch_id, ch->store); + dequeues++; cpu_relax(); } while (err == -EBUSY); + ch->stats.dequeue_portal_busy += dequeues; + if (unlikely(err)) + ch->stats.pull_err++; + return err; } @@ -869,6 +892,8 @@ static int dpaa2_eth_poll(struct napi_struct *napi, int budget) } while (err == -EBUSY); } + ch->stats.frames += cleaned; + return cleaned;
[PATCH 0/8] staging: Introduce Freescale DPAA2 Ethernet driver
This patchset introduces the Ethernet driver for Freescale / NXP SoCs with DPAA2 (DataPath Acceleration Architecture v2). The driver manages network objects discovered on the fsl-mc bus. A description of the driver can be found in the associated README file. The patchset consists of: * A set of libraries containing APIs for configuring and controlling Management Complex (MC) networking objects * The DPAA2 Ethernet basic driver * A couple of patches adding ethtool and debug support This series depends on the following patches: [PATCH v3 0/9] staging: fsl-mc: move bus driver out of staging, add dpio https://www.spinics.net/lists/kernel/msg2396338.html [PATCH] bus: fsl-mc: add DPCON object APIs https://www.spinics.net/lists/kernel/msg2398182.html Ioana Radulescu (8): staging: fsl-dpaa2/eth: Add Ethernet driver overview document staging: fsl-dpaa2/eth: Add APIs for DPNI objects staging: fsl-dpaa2/eth: Add Freescale DPAA2 Ethernet driver staging: fsl-dpaa2/eth: Add ethtool support staging: fsl-dpaa2/eth: Add driver specific stats staging: fsl-dpaa2/eth: Add trace points staging: fsl-dpaa2/eth: Add TODO file staging: fsl-dpaa2/eth: Add maintainer for Ethernet driver MAINTAINERS|6 + drivers/staging/Kconfig|2 + drivers/staging/Makefile |1 + drivers/staging/fsl-dpaa2/Kconfig | 17 + drivers/staging/fsl-dpaa2/Makefile |5 + drivers/staging/fsl-dpaa2/ethernet/Makefile| 10 + drivers/staging/fsl-dpaa2/ethernet/README | 186 ++ drivers/staging/fsl-dpaa2/ethernet/TODO|9 + .../staging/fsl-dpaa2/ethernet/dpaa2-eth-trace.h | 185 ++ drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 2525 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h | 346 +++ drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c | 278 +++ drivers/staging/fsl-dpaa2/ethernet/dpkg.h | 176 ++ drivers/staging/fsl-dpaa2/ethernet/dpni-cmd.h | 540 + drivers/staging/fsl-dpaa2/ethernet/dpni.c | 1594 drivers/staging/fsl-dpaa2/ethernet/dpni.h | 831 +++ drivers/staging/fsl-dpaa2/ethernet/net.h | 480 17 files changed, 7191 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/fsl-dpaa2/Kconfig create mode 100644 drivers/staging/fsl-dpaa2/Makefile create mode 100644 drivers/staging/fsl-dpaa2/ethernet/Makefile create mode 100644 drivers/staging/fsl-dpaa2/ethernet/README create mode 100644 drivers/staging/fsl-dpaa2/ethernet/TODO create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth-trace.h create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpkg.h create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpni-cmd.h create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpni.c create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpni.h create mode 100644 drivers/staging/fsl-dpaa2/ethernet/net.h -- 1.7.3.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/8] staging: fsl-dpaa2/eth: Add ethtool support
Add support for several ethtool operations: show hardware statistics, get/set link settings, get hash configuration. Signed-off-by: Ioana Radulescu Signed-off-by: Bogdan Hamciuc --- drivers/staging/fsl-dpaa2/ethernet/Makefile|2 +- drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c |6 + drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h |6 + drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c | 233 4 files changed, 246 insertions(+), 1 deletions(-) create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c diff --git a/drivers/staging/fsl-dpaa2/ethernet/Makefile b/drivers/staging/fsl-dpaa2/ethernet/Makefile index 4897d39..4327ebe 100644 --- a/drivers/staging/fsl-dpaa2/ethernet/Makefile +++ b/drivers/staging/fsl-dpaa2/ethernet/Makefile @@ -4,4 +4,4 @@ obj-$(CONFIG_FSL_DPAA2_ETH) += fsl-dpaa2-eth.o -fsl-dpaa2-eth-objs:= dpaa2-eth.o dpni.o +fsl-dpaa2-eth-objs:= dpaa2-eth.o dpaa2-ethtool.o dpni.o diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c index eda7885..cfa1d36 100644 --- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c @@ -45,6 +45,8 @@ MODULE_AUTHOR("Freescale Semiconductor, Inc"); MODULE_DESCRIPTION("Freescale DPAA2 Ethernet Driver"); +const char dpaa2_eth_drv_version[] = "0.1"; + static void validate_rx_csum(struct dpaa2_eth_priv *priv, u32 fd_status, struct sk_buff *skb) @@ -1939,6 +1941,8 @@ int dpaa2_eth_set_hash(struct net_device *net_dev, u64 flags) key->extract.from_hdr.type = DPKG_FULL_FIELD; key->extract.from_hdr.field = hash_fields[i].cls_field; cls_cfg.num_extracts++; + + priv->rx_hash_fields |= hash_fields[i].rxnfc_field; } dma_mem = kzalloc(DPAA2_CLASSIFIER_DMA_SIZE, GFP_DMA | GFP_KERNEL); @@ -2365,6 +2369,8 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev) if (err) goto err_alloc_rings; + net_dev->ethtool_ops = &dpaa2_ethtool_ops; + err = setup_irqs(dpni_dev); if (err) { netdev_warn(net_dev, "Failed to set link interrupt, fall back to polling\n"); diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h index 8827c24..b757a99 100644 --- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h @@ -279,6 +279,9 @@ struct dpaa2_eth_priv { struct dpni_link_state link_state; bool do_link_poll; struct task_struct *poll_thread; + + /* enabled ethtool hashing bits */ + u64 rx_hash_fields; }; /* default Rx hash options, set during probing */ @@ -292,6 +295,9 @@ struct dpaa2_eth_priv { /* Required by struct dpni_rx_tc_dist_cfg::key_cfg_iova */ #define DPAA2_CLASSIFIER_DMA_SIZE 256 +extern const struct ethtool_ops dpaa2_ethtool_ops; +extern const char dpaa2_eth_drv_version[]; + int dpaa2_eth_set_hash(struct net_device *net_dev, u64 flags); static int dpaa2_eth_queue_count(struct dpaa2_eth_priv *priv) diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c new file mode 100644 index 000..09cc2c7 --- /dev/null +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c @@ -0,0 +1,233 @@ +/* Copyright 2014-2016 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, D
[PATCH 1/8] staging: fsl-dpaa2/eth: Add Ethernet driver overview document
Add a README file describing the driver architecture, components and I/O interface. Signed-off-by: Ioana Radulescu --- drivers/staging/fsl-dpaa2/ethernet/README | 186 + 1 files changed, 186 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/fsl-dpaa2/ethernet/README diff --git a/drivers/staging/fsl-dpaa2/ethernet/README b/drivers/staging/fsl-dpaa2/ethernet/README new file mode 100644 index 000..0c5aa68 --- /dev/null +++ b/drivers/staging/fsl-dpaa2/ethernet/README @@ -0,0 +1,186 @@ +Freescale DPAA2 Ethernet driver +=== + +This file provides documentation for the Freescale DPAA2 Ethernet driver. + + +Contents + + Supported Platforms + Architecture Overview + Creating a Network Interface + Features & Offloads + + +Supported Platforms +=== +This driver provides networking support for Freescale DPAA2 SoCs, e.g. +LS2080A, LS2088A, LS1088A. + + +Architecture Overview += +Unlike regular NICs, in the DPAA2 architecture there is no single hardware block +representing network interfaces; instead, several separate hardware resources +concur to provide the networking functionality: +- network interfaces +- queues, channels +- buffer pools +- MAC/PHY + +All hardware resources are allocated and configured through the Management +Complex (MC) portals. MC abstracts most of these resources as DPAA2 objects +and exposes ABIs through which they can be configured and controlled. A few +hardware resources, like queues, do not have a corresponding MC object and +are treated as internal resources of other objects. + +For a more detailed description of the DPAA2 architecture and its object +abstractions see: + drivers/staging/fsl-mc/README.txt + +Each Linux net device is built on top of a Datapath Network Interface (DPNI) +object and uses Buffer Pools (DPBPs), I/O Portals (DPIOs) and Concentrators +(DPCONs). + +Configuration interface: + + --- +| DPAA2 Ethernet Driver | + --- + . . . + . . . + . . . . . . . . . . . . + . .. + . .. + -- -- --- +| DPBP API | | DPNI API || DPCON API | + -- -- --- + . .. software +=== . == . . === + . .. hardware + -- +|MC hardware portals | + -- + . .. + . .. + -- ----- + | DPBP | | DPNI | | DPCON | + -- ----- + +The DPNIs are network interfaces without a direct one-on-one mapping to PHYs. +DPBPs represent hardware buffer pools. Packet I/O is performed in the context +of DPCON objects, using DPIO portals for managing and communicating with the +hardware resources. + +Datapath (I/O) interface: + + --- +| DPAA2 Ethernet Driver | + --- + | ^^ || + | || || + enqueue| dequeue| data | dequeue| seed | +(Tx) | (Rx, TxC)| avail.| request| buffers| + | | notify| || + | || || + V || VV + --- +| DPIO Driver | + --- + | || || software + | || || + | || || hardware + --- +| I/O hardware portals| + --- + | ^^ || + | || || + | || V| + V | V +-- | - + queues -- | | Buffer pool | + -- |
[PATCH 7/8] staging: fsl-dpaa2/eth: Add TODO file
Add a list of TODO items for the Ethernet driver Signed-off-by: Ioana Radulescu --- drivers/staging/fsl-dpaa2/ethernet/TODO |9 + 1 files changed, 9 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/fsl-dpaa2/ethernet/TODO diff --git a/drivers/staging/fsl-dpaa2/ethernet/TODO b/drivers/staging/fsl-dpaa2/ethernet/TODO new file mode 100644 index 000..833265b --- /dev/null +++ b/drivers/staging/fsl-dpaa2/ethernet/TODO @@ -0,0 +1,9 @@ +* Add a DPAA2 MAC kernel driver in order to allow PHY management; currently + the DPMAC objects and their link to DPNIs are handled by MC internally + and all PHYs are seen as fixed-link +* add more debug support: decide how to expose detailed debug statistics, + add ingress error queue support +* MC firmware uprev; the DPAA2 objects used by the Ethernet driver need to + be kept in sync with binary interface changes in MC +* refine README file +* cleanup -- 1.7.3.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/6] staging: lustre: headers: sort headers affected by swab move
On Fri, Dec 02, 2016 at 02:40:46PM -0500, James Simmons wrote: > From: Ben Evans > > It was found if you sort the headers alphabetically > that it reduced patch conflicts. This patch sorts > the headers alphabetically and also place linux > header first, then uapi header and finally the > lustre kernel headers. I really doesn't matter what order you put them in, patch conflicts should still happen at the same frequency :) But I'll take it if it makes people happy... thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] Staging: ks7010: eap_packet.h: fixed coding style issue
On Sun, Dec 04, 2016 at 02:59:13PM +, Manoj Sawai wrote: > Rearranged comments so that lines are less than 80 characters long > > Signed-off-by: Manoj Sawai > --- > drivers/staging/ks7010/eap_packet.h | 9 ++--- > 1 file changed, 6 insertions(+), 3 deletions(-) Where is patch 1/2 for this series? confused, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: wilc1000: fixed the wrong error code
On Sat, Dec 03, 2016 at 12:26:06AM +0530, Atul Raj wrote: > in case of memory failure -ENOMEM should be returned. > > Signed-off-by: Atul Raj > --- > drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) This patch doesn't apply at all :( Please fix up and resend. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: sm750fb: Aligning Block comments
On Fri, Dec 02, 2016 at 12:04:39AM +0530, SRIKANT RITOLIA wrote: > Fix checkpatch.pl warnings:- > Block comments should align the * on each line > > Signed-off-by: Srikant Ritolia > --- > drivers/staging/sm750fb/ddk750.h | 20 ++-- > drivers/staging/sm750fb/ddk750_chip.c | 14 +++--- > drivers/staging/sm750fb/ddk750_chip.h | 10 +- > drivers/staging/sm750fb/ddk750_mode.c | 12 ++-- > drivers/staging/sm750fb/ddk750_swi2c.c | 22 +++--- > drivers/staging/sm750fb/ddk750_swi2c.h | 22 +++--- > 6 files changed, 50 insertions(+), 50 deletions(-) > > diff --git a/drivers/staging/sm750fb/ddk750.h > b/drivers/staging/sm750fb/ddk750.h > index 2c10a08ed964..7ee371443e28 100644 > --- a/drivers/staging/sm750fb/ddk750.h > +++ b/drivers/staging/sm750fb/ddk750.h > @@ -1,16 +1,16 @@ > #ifndef DDK750_H__ > #define DDK750_H__ > /*** > -* > -* Copyright (c) 2007 by Silicon Motion, Inc. (SMI) > -* > -* All rights are reserved. Reproduction or in part is prohibited > -* without the written consent of the copyright owner. > -* > -* RegSC.h --- SM718 SDK > -* This file contains the definitions for the System Configuration registers. > -* > -***/ > + * > + * Copyright (c) 2007 by Silicon Motion, Inc. (SMI) > + * > + * All rights are reserved. Reproduction or in part is prohibited > + * without the written consent of the copyright owner. > + * > + * RegSC.h --- SM718 SDK > + * This file contains the definitions for the System Configuration > registers. > + * > + ***/ > #include "ddk750_reg.h" > #include "ddk750_mode.h" > #include "ddk750_chip.h" > diff --git a/drivers/staging/sm750fb/ddk750_chip.c > b/drivers/staging/sm750fb/ddk750_chip.c > index 839d6730bde9..b7697ac206cf 100644 > --- a/drivers/staging/sm750fb/ddk750_chip.c > +++ b/drivers/staging/sm750fb/ddk750_chip.c > @@ -63,17 +63,17 @@ static void setChipClock(unsigned int frequency) > > if (frequency) { > /* > - * Set up PLL, a structure to hold the value to be set in clocks. > - */ > + * Set up PLL, a structure to hold the value to be set in clocks. > + */ > pll.inputFreq = DEFAULT_INPUT_CLOCK; /* Defined in CLOCK.H */ > pll.clockType = MXCLK_PLL; > > /* > - * Call calcPllValue() to fill the other fields of PLL structure. > - * Sometime, the chip cannot set up the exact clock > - * required by the User. > - * Return value of calcPllValue gives the actual possible clock. > - */ > + * Call calcPllValue() to fill the other fields of PLL structure. > + * Sometime, the chip cannot set up the exact clock > + * required by the User. > + * Return value of calcPllValue gives the actual possible clock. > + */ > ulActualMxClk = calcPllValue(frequency, &pll); > > /* Master Clock Control: MXCLK_PLL */ > diff --git a/drivers/staging/sm750fb/ddk750_chip.h > b/drivers/staging/sm750fb/ddk750_chip.h > index 14357fd1cc6b..20031f4e03fa 100644 > --- a/drivers/staging/sm750fb/ddk750_chip.h > +++ b/drivers/staging/sm750fb/ddk750_chip.h > @@ -40,27 +40,27 @@ pll_value_t; > /* input struct to initChipParam() function */ > typedef struct _initchip_param_t { > unsigned short powerMode;/* Use power mode 0 or 1 */ > - unsigned short chipClock;/** > + unsigned short chipClock;/* >* Speed of main chip clock in MHz unit >* 0 = keep the current clock setting >* Others = the new main chip clock >*/ This change doesn't match up with your changelog comment :( Please fix up and resend. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH V2] staging: dgnc: Fix lines longer than 80 characters
On Sun, Dec 04, 2016 at 08:41:04PM +0100, Fernando Apesteguia wrote: > For the first lines of the patch, I opted to create a small function > instead of breaking the the line in a weird way. > > This is v2 of the patch with the name of the function changed from > v1 This goes below the --- line. > > The other changes are simple ones. What does that mean? Please always be specific. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] Staging: dgnc: dgnc_*.c: Use usleep_range over udelay to improve coalescing processor wakeups
On Tue, Dec 06, 2016 at 09:59:58AM +0100, Shiva Kerdel wrote: > In most cases, usleep_range is better than udelay, as the precise wakeup > from udelay is unnecessary. But, udelay does something different than usleep, are you sure you should be giving up the cpu at this point in time? Are you sure you are even in a function that is allowed to sleep? I don't think that is the case for all of these at all, sorry, unless you have the hardware to test this change, I can't take it. greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v4] staging: greybus: arche-platform: fix line over 80 characters style warnings
On Thu, Dec 01, 2016 at 10:39:53PM +0100, Andrea Ghittino wrote: > Fixes greybus "line over 80 characters" style warnings > found by checkpatch.pl tool > > Signed-off-by: Andrea Ghittino > --- > changelog: > v2) Review patch based on Vaibhav Hiremath review > v3) Fixed email text > v4) Review the patch based on received comments Always run checkpatch.pl on your patches so you don't get a grumpy maintainer asking you to run checkpatch.pl on your patches... ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] Staging: dgnc: dgnc_*.c: Use usleep_range over udelay to improve coalescing processor wakeups
In most cases, usleep_range is better than udelay, as the precise wakeup from udelay is unnecessary. usleep_range gives a much better chance of coalescing processor wakeups. Signed-off-by: Shiva Kerdel --- Changes for v2: - Squashed the two commits to one patch. drivers/staging/dgnc/dgnc_cls.c | 6 +++--- drivers/staging/dgnc/dgnc_neo.c | 10 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index c20ffdd..6607243a 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -409,7 +409,7 @@ static void cls_assert_modem_signals(struct channel_t *ch) writeb(out, &ch->ch_cls_uart->mcr); /* Give time for the UART to actually drop the signals */ - udelay(10); + usleep_range(10, 20); } static void cls_copy_data_from_queue_to_uart(struct channel_t *ch) @@ -631,7 +631,7 @@ static void cls_flush_uart_read(struct channel_t *ch) * Presumably, this is a bug in this UART. */ - udelay(10); + usleep_range(10, 20); } /* @@ -1096,7 +1096,7 @@ static void cls_uart_init(struct channel_t *ch) writeb(UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT, &ch->ch_cls_uart->isr_fcr); - udelay(10); + usleep_range(10, 20); ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM); diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c index 3eefefe..20bc271 100644 --- a/drivers/staging/dgnc/dgnc_neo.c +++ b/drivers/staging/dgnc/dgnc_neo.c @@ -1352,7 +1352,7 @@ static void neo_flush_uart_write(struct channel_t *ch) */ tmp = readb(&ch->ch_neo_uart->isr_fcr); if (tmp & 4) - udelay(10); + usleep_range(10, 20); else break; } @@ -1384,7 +1384,7 @@ static void neo_flush_uart_read(struct channel_t *ch) */ tmp = readb(&ch->ch_neo_uart->isr_fcr); if (tmp & 2) - udelay(10); + usleep_range(10, 20); else break; } @@ -1616,7 +1616,7 @@ static void neo_assert_modem_signals(struct channel_t *ch) neo_pci_posting_flush(ch->ch_bd); /* Give time for the UART to actually raise/drop the signals */ - udelay(10); + usleep_range(10, 20); } static void neo_send_start_character(struct channel_t *ch) @@ -1628,7 +1628,7 @@ static void neo_send_start_character(struct channel_t *ch) ch->ch_xon_sends++; writeb(ch->ch_startc, &ch->ch_neo_uart->txrx); neo_pci_posting_flush(ch->ch_bd); - udelay(10); + usleep_range(10, 20); } } @@ -1641,7 +1641,7 @@ static void neo_send_stop_character(struct channel_t *ch) ch->ch_xoff_sends++; writeb(ch->ch_stopc, &ch->ch_neo_uart->txrx); neo_pci_posting_flush(ch->ch_bd); - udelay(10); + usleep_range(10, 20); } } -- 2.10.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel