[PATCH 11/11] staging: typec: tcpm: Switch to PORT_RESET instead of SNK_UNATTACHED

2017-08-26 Thread Badhri Jagan Sridharan
When VBUS is not discovered within PD_T_PS_SOURCE_ON although Rp is detected on CC, TCPM switches the port to SNK_UNATTACHED state. SNK_UNATTACHED, however does not force TYPEC_CC_OPEN which makes the partner(source) to think that it is connected. To overcome this issue, force the port into PORT_R

[PATCH 10/11] staging: typec: tcpm: Do not send PING msgs in TCPM

2017-08-26 Thread Badhri Jagan Sridharan
PING messages are used to monitor the connect/disconnect. However, when PD is carried over CC, so this is not required. Also, the spec does not clearly say if PD is possible when Type-c is connected to Type-A/B. So, removing sending PING messages altogether. Signed-off-by: Badhri Jagan Sridharan

[PATCH 08/11] staging: typec: tcpm: add cc change handling in src states

2017-08-26 Thread Badhri Jagan Sridharan
In the case that the lower layer driver reports a cc change directly from SINK state to SOURCE state, TCPM doesn't handle these cc change in SRC_SEND_CAPABILITIES, SRC_READY states. And with SRC_ATTACHED state, the change is not handled as the port is still considered connected. [49606.131672] sta

[PATCH 05/11 v2] staging: typec: tcpm: Follow Try.SRC exit requirements

2017-08-26 Thread Badhri Jagan Sridharan
According to spec: " 4.5.2.2.9.2 Exiting from Try.SRC State: The port shall transition to Attached.SRC when the SRC.Rd state is detected on exactly one of the CC1 or CC2 pins for at least tPDDebounce. The port shall transition to TryWait.SNK after tDRPTry and the SRC.Rd state has not been detected.

[PATCH 03/11 v2] staging: typec: tcpm: Prevent TCPM from looping in SRC_TRYWAIT

2017-08-26 Thread Badhri Jagan Sridharan
According to the spec the following is the condition for exiting TryWait.SRC: "The port shall transition to Attached.SRC when V BUS is at vSafe0V and the SRC.Rd state is detected on exactly one of the CC pins for at least tCCDebounce. The port shall transition to Unattached.SNK after tDRPTry if ne

[PATCH 01/11 v2] staging: typec: tcpm: set port type callback

2017-08-26 Thread Badhri Jagan Sridharan
The port type callback call enquires the tcpc_dev if the requested port type is supported. If supported, then performs a tcpm reset if required after setting the tcpm internal port_type variable. Check against the tcpm port_type instead of checking against caps.type as port_type reflects the curre

[PATCH 07/11] staging: typec: tcpm: Consider port_type while determining unattached_state

2017-08-26 Thread Badhri Jagan Sridharan
While performing PORT_RESET, upon receiving the cc disconnect signal from the underlaying tcpc device, TCPM transitions into unattached state. Consider, the current type of port while determining the unattached state. In the below logs, although the port_type was set to sink, TCPM transitioned int

[PATCH] staging: lustre: constify cl_lock_operations

2017-08-26 Thread Arvind Yadav
cl_lock_operations are not supposed to change at runtime. cl_lock_slice_add is working with const cl_lock_operations. So mark the non-const cl_lock_operations structs as const. Signed-off-by: Arvind Yadav --- drivers/staging/lustre/lustre/obdecho/echo_client.c | 2 +- 1 file changed, 1 insertion

[PATCH] staging: atomisp: constify v4l2_subdev_sensor_ops

2017-08-26 Thread Arvind Yadav
v4l2_subdev_sensor_ops are not supposed to change at runtime. v4l2_subdev_sensor_ops are working with const 'sensor' field of sturct v4l2_subdev_ops. So mark the non-const v4l2_subdev_sensor_ops structs as const. Signed-off-by: Arvind Yadav --- drivers/staging/media/atomisp/i2c/mt9m114.c | 2 +-

[PATCH 6/6] staging: usb: tcpm: Comply with TryWait.SNK State

2017-08-26 Thread Badhri Jagan Sridharan
According to the spec: "4.5.2.2.10.2 Exiting from TryWait.SNK State The port shall transition to Attached.SNK after tCCDebounce if or when VBUS is detected. Note the Source may initiate USB PD communications which will cause brief periods of the SNK.Open state on both the CC1 and CC2 pins, but this

[PATCH 5/6] staging: usb: tcpm: usb: typec: tcpm: Follow Try.SRC exit requirements

2017-08-26 Thread Badhri Jagan Sridharan
According to spec: " 4.5.2.2.9.2 Exiting from Try.SRC State: The port shall transition to Attached.SRC when the SRC.Rd state is detected on exactly one of the CC1 or CC2 pins for at least tPDDebounce. The port shall transition to TryWait.SNK after tDRPTry and the SRC.Rd state has not been detected.

[PATCH 4/6] staging: usb: tcpm: usb: type-c: tcpm: Check for Rp for tPDDebounce

2017-08-26 Thread Badhri Jagan Sridharan
According the spec, the following is the conditions for exiting Try.SNK state: "The port shall wait for tDRPTry and only then begin monitoring the CC1 and CC2 pins for the SNK.Rp state. The port shall then transition to Attached.SNK when the SNK.Rp state is detected on exactly one of the CC1 or CC2

[PATCH 2/6] staging: usb: typec: Check for port type for Try.SRC/Try.SNK

2017-08-26 Thread Badhri Jagan Sridharan
Enable Try.SRC or Try.SNK only when port_type is DRP. Try.SRC or Try.SNK state machines are not valid for SRC only or SNK only ports. Signed-off-by: Badhri Jagan Sridharan --- drivers/staging/typec/tcpm.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/t

[PATCH 3/6] staging: usb: tcpm: usb: typec: tcpm: Prevent TCPM from looping in SRC_TRYWAIT

2017-08-26 Thread Badhri Jagan Sridharan
According to the spec the following is the condition for exiting TryWait.SRC: "The port shall transition to Attached.SRC when V BUS is at vSafe0V and the SRC.Rd state is detected on exactly one of the CC pins for at least tCCDebounce. The port shall transition to Unattached.SNK after tDRPTry if ne

[PATCH 1/6] staging: usb: typec: tcpm set port type callback

2017-08-26 Thread Badhri Jagan Sridharan
The port type callback call enquires the tcpc_dev if the requested port type is supported. If supported, then performs a tcpm reset if required after setting the tcpm internal port_type variable. Check against the tcpm port_type instead of checking against caps.type as port_type reflects the curre

[PATCH v1] staging: most: hdm_usb: Driver registration with module_driver macro

2017-08-26 Thread Alex Briskin
Register with module_driver macro instead of module_init/module_exit. Signed-off-by: Alex Briskin --- drivers/staging/most/hdm-usb/hdm_usb.c | 20 +--- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c b/drivers/staging/most/hdm

[PATCH] [media] atomisp2: Remove null check before kfree

2017-08-26 Thread Himanshu Jha
Kfree on NULL pointer is a no-op and therefore checking is redundant. Signed-off-by: Himanshu Jha --- .../staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c| 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/

[PATCH] staging: rtl8723bs: remove null check before kfree

2017-08-26 Thread Himanshu Jha
Kfree on NULL pointer is a no-op and therefore checking is redundant. Signed-off-by: Himanshu Jha --- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/s

[PATCH] staging: netlogic: Delete an error message for a failed memory allocation in xlr_config_spill()

2017-08-26 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 26 Aug 2017 18:44:12 +0200 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/staging/netlogic/xlr_net.c | 4 +--- 1 file changed, 1 inserti

[PATCH] staging: fsl-mc: Delete an error message for a failed memory allocation in fsl_mc_resource_pool_add_device()

2017-08-26 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 26 Aug 2017 18:23:52 +0200 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/staging/fsl-mc/bus/fsl-mc-allocator.c | 2 -- 1 file changed,

Re: [PATCH] Staging rtlwifi efuse fix up a warning kzalloc

2017-08-26 Thread Joe Perches
On Sat, 2017-08-26 at 09:48 -0500, Larry Finger wrote: > I will NACK every > patch that tries to force code that I maintain to use kcalloc over kzalloc. Your choice. The concept behind the kzalloc with multiply vs kcalloc is protection against multiplication overflow. It's unlikely to solve any

Re: [PATCH] Staging rtlwifi efuse fix up a warning kzalloc

2017-08-26 Thread Larry Finger
On 08/26/2017 08:01 AM, Yurii Pavlenko wrote: Hello, I have attached a small patch to fix a warning "Prefer kcalloc over kzalloc with multiply" for efuse.c as part of challenge 10 of Eudyptula. Best regards, Yurii Pavlenko Signed-off-by: Yurii Pavlenko Before you waste any more of our tim

[PATCH] Staging rtlwifi efuse fix up a warning kzalloc

2017-08-26 Thread Yurii Pavlenko
Hello, I have attached a small patch to fix a warning "Prefer kcalloc over kzalloc with multiply" for efuse.c as part of challenge 10 of Eudyptula. Best regards, Yurii Pavlenko Signed-off-by: Yurii Pavlenko --- drivers/staging/rtlwifi/efuse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 d

[PATCH] [media] Staging: media: radio-bcm2048: make video_device const

2017-08-26 Thread Bhumika Goyal
Make this const as it is only used in a copy operation. Signed-off-by: Bhumika Goyal --- drivers/staging/media/bcm2048/radio-bcm2048.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.

[PATCH] staging: bcm2835-camera: make video_device const

2017-08-26 Thread Bhumika Goyal
Make this const as it is only used in a copy operation. Signed-off-by: Bhumika Goyal --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/stag

Re: [PATCH 00/14] VME: Adjustments for several function implementations

2017-08-26 Thread Greg Kroah-Hartman
On Fri, Aug 25, 2017 at 10:50:19PM +0100, Martyn Welch wrote: > On Fri, Aug 25, 2017 at 05:41:13PM +0200, SF Markus Elfring wrote: > > From: Markus Elfring > > Date: Fri, 25 Aug 2017 13:15:43 +0200 > > > > Several update suggestions were taken into account > > from static source code analysis. >

Re: [PATCH 13/14] vme: tsi148: Improve 17 size determinations

2017-08-26 Thread SF Markus Elfring
>> @@ -2363,5 +2364,5 @@ static int tsi148_probe(struct pci_dev *pdev, const >> struct pci_device_id *id) >> master_num--; >> >> tsi148_device->flush_image = >> -kmalloc(sizeof(struct vme_master_resource), GFP_KERNEL); >> +kmalloc