Re: [PATCH V9] i2c: tegra: remove BUG() macro

2019-06-19 Thread Bitan Biswas
On 6/18/19 4:09 AM, Bitan Biswas wrote: The usage of BUG() macro is generally discouraged in kernel, unless it's a problem that results in a physical damage or loss of data. This patch removes unnecessary BUG() macros and replaces the rest with warning. Signed-off-by: Bitan Biswas

Re: [PATCH V9] i2c: tegra: remove BUG() macro

2019-06-18 Thread Bitan Biswas
On 6/18/19 4:29 AM, Dmitry Osipenko wrote: 18.06.2019 14:09, Bitan Biswas пишет: The usage of BUG() macro is generally discouraged in kernel, unless it's a problem that results in a physical damage or loss of data. This patch removes unnecessary BUG() macros and replaces the rest

[PATCH V9] i2c: tegra: remove BUG() macro

2019-06-18 Thread Bitan Biswas
The usage of BUG() macro is generally discouraged in kernel, unless it's a problem that results in a physical damage or loss of data. This patch removes unnecessary BUG() macros and replaces the rest with warning. Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 47

Re: [PATCH V1] i2c: tegra: disable irq in tegra_i2c_xfer_msg

2019-06-18 Thread Bitan Biswas
On 6/17/19 11:32 PM, Jon Hunter wrote: On 18/06/2019 06:23, Bitan Biswas wrote: Synchronize ISR and tegra_i2c_xfer_msg execution by disabling interrupt. This avoids spinlock usage for same purpose. I think that you need to explain the motivation/benefit of this. It is not immediately

[PATCH V2] i2c: tegra: disable irq in tegra_i2c_xfer_msg

2019-06-18 Thread Bitan Biswas
is achieved by disabling I2C interrupt during preparation step and enabling interrupt once preparation is over and spinlock is no longer needed. Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/i2c

[PATCH V1] i2c: tegra: disable irq in tegra_i2c_xfer_msg

2019-06-18 Thread Bitan Biswas
Synchronize ISR and tegra_i2c_xfer_msg execution by disabling interrupt. This avoids spinlock usage for same purpose. Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/i2c/busses/i2c

Re: [PATCH V5 6/7] i2c: tegra: fix PIO rx/tx residual transfer check

2019-06-18 Thread Bitan Biswas
On 6/14/19 6:02 AM, Dmitry Osipenko wrote: 14.06.2019 12:50, Bitan Biswas пишет: On 6/13/19 5:28 AM, Dmitry Osipenko wrote: 13.06.2019 14:30, Bitan Biswas пишет: On 6/12/19 7:30 AM, Dmitry Osipenko wrote: 11.06.2019 13:51, Bitan Biswas пишет: Fix expression for residual bytes(less

[PATCH V8] i2c: tegra: remove BUG() macro

2019-06-17 Thread Bitan Biswas
The usage of BUG() macro is generally discouraged in kernel, unless it's a problem that results in a physical damage or loss of data. This patch removes unnecessary BUG() macros and replaces the rest with warning. Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 49

Re: [PATCH V7] i2c: tegra: remove BUG, BUG_ON

2019-06-17 Thread Bitan Biswas
On 6/17/19 12:28 PM, Dmitry Osipenko wrote: 17.06.2019 21:41, Bitan Biswas пишет: On 6/17/19 5:13 AM, Dmitry Osipenko wrote: 17.06.2019 8:09, Bitan Biswas пишет: Remove BUG, BUG_ON as it makes system usable:   - Remove redundant BUG_ON calls or replace with WARN_ON_ONCE     as needed

Re: [PATCH V6] i2c: tegra: remove BUG, BUG_ON

2019-06-17 Thread Bitan Biswas
On 6/14/19 10:51 AM, Dmitry Osipenko wrote: 14.06.2019 18:50, Bitan Biswas пишет: Remove redundant BUG_ON calls or replace with WARN_ON_ONCE as needed. Remove BUG() and mask Rx interrupt similar as Tx for message fully sent case. Add WARN_ON_ONCE check for non-zero rx_fifo_avail

Re: [PATCH V7] i2c: tegra: remove BUG, BUG_ON

2019-06-17 Thread Bitan Biswas
On 6/17/19 5:13 AM, Dmitry Osipenko wrote: 17.06.2019 8:09, Bitan Biswas пишет: Remove BUG, BUG_ON as it makes system usable: - Remove redundant BUG_ON calls or replace with WARN_ON_ONCE as needed. - Remove BUG() and mask Rx interrupt similar as Tx for message fully sent case

Re: [PATCH V3] i2c: busses: tegra: Add suspend-resume support

2019-06-17 Thread Bitan Biswas
On 6/17/19 12:09 AM, Thierry Reding wrote: On Sat, Jun 15, 2019 at 06:54:05AM +0200, Wolfram Sang wrote: Without a maintainer ack, this is an exception this time. Should we add Dmitry as another maintainer or reviewer at least? I shall followup with Maintainer for ACK in future I2C tegra

[PATCH V7] i2c: tegra: remove BUG, BUG_ON

2019-06-16 Thread Bitan Biswas
in tegra_i2c_empty_rx_fifo() after all processing. Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 45 ++ 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index 4dfb4c1

Re: [PATCH V3] i2c: busses: tegra: Add suspend-resume support

2019-06-14 Thread Bitan Biswas
On 6/14/19 2:11 PM, Wolfram Sang wrote: On Thu, Jun 06, 2019 at 10:37:47PM -0700, Bitan Biswas wrote: Post suspend I2C registers have power on reset values. Before any transfer initialize I2C registers to prevent I2C transfer timeout and implement suspend and resume callbacks needed. Fix

Re: [PATCH V1] firmware: tegra: early resume bpmp

2019-06-14 Thread Bitan Biswas
On 6/14/19 8:48 AM, Thierry Reding wrote: On Fri, Jun 14, 2019 at 05:31:39AM -0700, Bitan Biswas wrote: Early resume Tegra bpmp to fix Xavier clock rate error as follows: [ 159.017101] of_serial 311.serial: calling platform_pm_resume+0x0/0x58 @ 317, parent: cbb [ 159.025501] of_serial

[PATCH V2 2/2] mailbox: tegra: avoid resume NULL mailboxes

2019-06-14 Thread Bitan Biswas
If Tegra HSP device tree does not have 'shared irqs', mailboxes pointer is NULL. Add non-NULL HSP mailboxes check in resume callback before tegra_hsp_mailbox_startup() call and prevent NULL pointer exception. Signed-off-by: Bitan Biswas --- drivers/mailbox/tegra-hsp.c | 10 ++ 1 file

[PATCH V2 1/2] mailbox: tegra: hsp: add noirq resume

2019-06-14 Thread Bitan Biswas
Add noirq resume instead of resume callback for Tegra HSP. Tegra HSP resume needs tegra_hsp_doorbell_startup() call to fix timeout error for tegra_bpmp_transfer() during genpd resume noirq on Jetson TX2. Signed-off-by: Bitan Biswas --- drivers/mailbox/tegra-hsp.c | 10 +- 1 file changed

Re: [PATCH V1 2/2] mailbox: tegra: avoid resume NULL mailboxes

2019-06-14 Thread Bitan Biswas
On 6/14/19 8:52 AM, Thierry Reding wrote: On Fri, Jun 14, 2019 at 05:35:34AM -0700, Bitan Biswas wrote: If Tegra hsp device tree does not have 'shared irqs', s/hsp/HSP/, otherwise looks good. Shall correct. Thierry mailboxes pointer is NULL. Add non-NULL HSP mailboxes check in resume

Re: [PATCH V1 1/2] mailbox: tegra: hsp: add noirq resume

2019-06-14 Thread Bitan Biswas
On 6/14/19 8:50 AM, Thierry Reding wrote: On Fri, Jun 14, 2019 at 05:35:33AM -0700, Bitan Biswas wrote: Add noirq resume instead of resume callback for Tegra HSP. Tegra HSP resume needs tegra_hsp_doorbell_startup() call to fix timeout error for tegra_bpmp_transfer() during genpd resume noirq

[PATCH V6] i2c: tegra: remove BUG, BUG_ON

2019-06-14 Thread Bitan Biswas
is also added. Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 46 ++ 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index 4dfb4c1..26a7c8c 100644 --- a/drivers

[PATCH V1 1/2] mailbox: tegra: hsp: add noirq resume

2019-06-14 Thread Bitan Biswas
Add noirq resume instead of resume callback for Tegra HSP. Tegra HSP resume needs tegra_hsp_doorbell_startup() call to fix timeout error for tegra_bpmp_transfer() during genpd resume noirq on jetson-tx2. Signed-off-by: Bitan Biswas --- drivers/mailbox/tegra-hsp.c | 12 ++-- 1 file

[PATCH V1 2/2] mailbox: tegra: avoid resume NULL mailboxes

2019-06-14 Thread Bitan Biswas
If Tegra hsp device tree does not have 'shared irqs', mailboxes pointer is NULL. Add non-NULL HSP mailboxes check in resume callback before tegra_hsp_mailbox_startup() call and prevent NULL pointer exception. Signed-off-by: Bitan Biswas --- drivers/mailbox/tegra-hsp.c | 10 ++ 1 file

[PATCH V1] firmware: tegra: early resume bpmp

2019-06-14 Thread Bitan Biswas
usecs [ 159.063875] PM: Device 31c.i2c failed to resume: error -22 Signed-off-by: Bitan Biswas --- drivers/firmware/tegra/bpmp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/tegra/bpmp.c b/drivers/firmware/tegra/bpmp.c index dd775e8..de09036 100644

Re: [PATCH V5 6/7] i2c: tegra: fix PIO rx/tx residual transfer check

2019-06-14 Thread Bitan Biswas
On 6/13/19 5:28 AM, Dmitry Osipenko wrote: 13.06.2019 14:30, Bitan Biswas пишет: On 6/12/19 7:30 AM, Dmitry Osipenko wrote: 11.06.2019 13:51, Bitan Biswas пишет: Fix expression for residual bytes(less than word) transfer in I2C PIO mode RX/TX. Signed-off-by: Bitan Biswas --- [snip

Re: [PATCH V5 6/7] i2c: tegra: fix PIO rx/tx residual transfer check

2019-06-13 Thread Bitan Biswas
On 6/12/19 6:55 AM, Dmitry Osipenko wrote: 11.06.2019 13:51, Bitan Biswas пишет: Fix expression for residual bytes(less than word) transfer in I2C PIO mode RX/TX. Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 11 ++- 1 file changed, 6 insertions(+), 5

Re: [PATCH V5 6/7] i2c: tegra: fix PIO rx/tx residual transfer check

2019-06-13 Thread Bitan Biswas
On 6/12/19 7:30 AM, Dmitry Osipenko wrote: 11.06.2019 13:51, Bitan Biswas пишет: Fix expression for residual bytes(less than word) transfer in I2C PIO mode RX/TX. Signed-off-by: Bitan Biswas --- [snip] /* -* Update state before writing to FIFO

Re: [PATCH V4 6/6] i2c: tegra: remove BUG, BUG_ON

2019-06-13 Thread Bitan Biswas
On 6/12/19 6:33 AM, Dmitry Osipenko wrote: 11.06.2019 21:22, Bitan Biswas пишет: On 6/11/19 4:34 AM, Dmitry Osipenko wrote: 11.06.2019 10:38, Bitan Biswas пишет: On 6/10/19 2:00 PM, Dmitry Osipenko wrote: 10.06.2019 22:41, Bitan Biswas пишет: On 6/10/19 11:12 AM, Dmitry Osipenko

Re: [PATCH V5 6/7] i2c: tegra: fix PIO rx/tx residual transfer check

2019-06-13 Thread Bitan Biswas
On 6/12/19 3:24 AM, Wolfram Sang wrote: On Tue, Jun 11, 2019 at 03:51:13AM -0700, Bitan Biswas wrote: Fix expression for residual bytes(less than word) transfer in I2C PIO mode RX/TX. Signed-off-by: Bitan Biswas I applied patches 1-5 to my for-next tree now. No need to resend them

Re: [PATCH V3] i2c: busses: tegra: Add suspend-resume support

2019-06-13 Thread Bitan Biswas
On 6/6/19 11:27 PM, Dmitry Osipenko wrote: 07.06.2019 8:37, Bitan Biswas пишет: Post suspend I2C registers have power on reset values. Before any transfer initialize I2C registers to prevent I2C transfer timeout and implement suspend and resume callbacks needed. Fix below errors post suspend

Re: [PATCH V4 6/6] i2c: tegra: remove BUG, BUG_ON

2019-06-11 Thread Bitan Biswas
On 6/11/19 4:34 AM, Dmitry Osipenko wrote: 11.06.2019 10:38, Bitan Biswas пишет: On 6/10/19 2:00 PM, Dmitry Osipenko wrote: 10.06.2019 22:41, Bitan Biswas пишет: On 6/10/19 11:12 AM, Dmitry Osipenko wrote: 10.06.2019 20:08, Bitan Biswas пишет: Remove redundant BUG_ON calls or replace

[PATCH V5 7/7] i2c: tegra: remove BUG, BUG_ON

2019-06-11 Thread Bitan Biswas
Remove redundant BUG_ON calls or replace with WARN_ON_ONCE as needed. Remove BUG() and make Rx and Tx case handling similar. Add WARN_ON_ONCE check for non-zero rx_fifo_avail in tegra_i2c_empty_rx_fifo() and return new error I2C_ERR_UNEXPECTED_STATUS. Signed-off-by: Bitan Biswas --- drivers/i2c

[PATCH V5 1/7] i2c: tegra: clean up macros

2019-06-11 Thread Bitan Biswas
Clean up macros by: 1) removing unused macros 2) replace constants by macro BIT() Signed-off-by: Bitan Biswas Reviewed-by: Dmitry Osipenko --- drivers/i2c/busses/i2c-tegra.c | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b

[PATCH V5 4/7] i2c: tegra: add spinlock definition comment

2019-06-11 Thread Bitan Biswas
Fix checkpatch.pl CHECK as follows: CHECK: spinlock_t definition without comment + spinlock_t xfer_lock; Signed-off-by: Bitan Biswas Reviewed-by: Dmitry Osipenko --- drivers/i2c/busses/i2c-tegra.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/i2c/busses/i2c-tegra.c b

[PATCH V5 3/7] i2c: tegra: fix alignment and spacing violations

2019-06-11 Thread Bitan Biswas
Fix checkpatch.pl alignment and blank line check(s) in i2c-tegra.c Signed-off-by: Bitan Biswas Reviewed-by: Dmitry Osipenko --- drivers/i2c/busses/i2c-tegra.c | 35 +++ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/drivers/i2c/busses/i2c

[PATCH V5 6/7] i2c: tegra: fix PIO rx/tx residual transfer check

2019-06-11 Thread Bitan Biswas
Fix expression for residual bytes(less than word) transfer in I2C PIO mode RX/TX. Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index

[PATCH V5 5/7] i2c: tegra: fix msleep warning

2019-06-11 Thread Bitan Biswas
Fix checkpatch.pl WARNING for delay of approximately 1msec in flush i2c FIFO polling loop by using usleep_range(1000, 2000): WARNING: msleep < 20ms can sleep for up to 20ms; see ... Documentation/timers/timers-howto.txt + msleep(1); Signed-off-by: Bitan Biswas Reviewed-by: Dmi

[PATCH V5 2/7] i2c: tegra: remove unnecessary variable init

2019-06-11 Thread Bitan Biswas
Remove variable initializations in functions that are followed by assignments before use Signed-off-by: Bitan Biswas Reviewed-by: Dmitry Osipenko --- drivers/i2c/busses/i2c-tegra.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b

Re: [PATCH V4 6/6] i2c: tegra: remove BUG, BUG_ON

2019-06-11 Thread Bitan Biswas
On 6/10/19 2:00 PM, Dmitry Osipenko wrote: 10.06.2019 22:41, Bitan Biswas пишет: On 6/10/19 11:12 AM, Dmitry Osipenko wrote: 10.06.2019 20:08, Bitan Biswas пишет: Remove redundant BUG_ON calls or replace with WARN_ON_ONCE as needed. Remove BUG() and make Rx and Tx case handling similar

Re: [PATCH V4 6/6] i2c: tegra: remove BUG, BUG_ON

2019-06-10 Thread Bitan Biswas
On 6/10/19 11:12 AM, Dmitry Osipenko wrote: 10.06.2019 20:08, Bitan Biswas пишет: Remove redundant BUG_ON calls or replace with WARN_ON_ONCE as needed. Remove BUG() and make Rx and Tx case handling similar. Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 11

[PATCH V4 6/6] i2c: tegra: remove BUG, BUG_ON

2019-06-10 Thread Bitan Biswas
Remove redundant BUG_ON calls or replace with WARN_ON_ONCE as needed. Remove BUG() and make Rx and Tx case handling similar. Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c

[PATCH V4 4/6] i2c: tegra: add spinlock definition comment

2019-06-10 Thread Bitan Biswas
Fix checkpatch.pl CHECK as follows: CHECK: spinlock_t definition without comment + spinlock_t xfer_lock; Signed-off-by: Bitan Biswas Reviewed-by: Dmitry Osipenko --- drivers/i2c/busses/i2c-tegra.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/i2c/busses/i2c-tegra.c b

[PATCH V4 1/6] i2c: tegra: clean up macros

2019-06-10 Thread Bitan Biswas
Clean up macros by: 1) removing unused macros 2) replace constants by macro BIT() Signed-off-by: Bitan Biswas Reviewed-by: Dmitry Osipenko --- drivers/i2c/busses/i2c-tegra.c | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b

[PATCH V4 2/6] i2c: tegra: remove unnecessary variable init

2019-06-10 Thread Bitan Biswas
Remove variable initializations in functions that are followed by assignments before use Signed-off-by: Bitan Biswas Reviewed-by: Dmitry Osipenko --- drivers/i2c/busses/i2c-tegra.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b

[PATCH V4 3/6] i2c: tegra: fix alignment and spacing violations

2019-06-10 Thread Bitan Biswas
Fix checkpatch.pl alignment and blank line check(s) in i2c-tegra.c Signed-off-by: Bitan Biswas Reviewed-by: Dmitry Osipenko --- drivers/i2c/busses/i2c-tegra.c | 35 +++ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/drivers/i2c/busses/i2c

[PATCH V4 5/6] i2c: tegra: fix msleep warning

2019-06-10 Thread Bitan Biswas
Fix checkpatch.pl WARNING for delay of approximately 1msec in flush i2c FIFO polling loop by using usleep_range(1000, 2000): WARNING: msleep < 20ms can sleep for up to 20ms; see ... Documentation/timers/timers-howto.txt + msleep(1); Signed-off-by: Bitan Biswas Reviewed-by: Dmi

Re: [PATCH V3 6/6] i2c: tegra: remove BUG, BUG_ON

2019-06-10 Thread Bitan Biswas
On 6/10/19 3:30 AM, Dmitry Osipenko wrote: 10.06.2019 8:08, Bitan Biswas пишет: Remove redundant BUG_ON calls or replace with WARN_ON_ONCE as needed. Replace BUG() with error handling code. Define I2C_ERR_UNEXPECTED_STATUS for error handling. Signed-off-by: Bitan Biswas --- drivers/i2c

[PATCH V3 6/6] i2c: tegra: remove BUG, BUG_ON

2019-06-09 Thread Bitan Biswas
Remove redundant BUG_ON calls or replace with WARN_ON_ONCE as needed. Replace BUG() with error handling code. Define I2C_ERR_UNEXPECTED_STATUS for error handling. Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 18 +++--- 1 file changed, 11 insertions(+), 7

[PATCH V3 3/6] i2c: tegra: fix alignment and spacing violations

2019-06-09 Thread Bitan Biswas
Fix checkpatch.pl alignment and blank line check(s) in i2c-tegra.c Signed-off-by: Bitan Biswas Reviewed-by: Dmitry Osipenko --- drivers/i2c/busses/i2c-tegra.c | 35 +++ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/drivers/i2c/busses/i2c

[PATCH V3 4/6] i2c: tegra: add spinlock definition comment

2019-06-09 Thread Bitan Biswas
Fix checkpatch.pl CHECK as follows: CHECK: spinlock_t definition without comment + spinlock_t xfer_lock; Signed-off-by: Bitan Biswas Reviewed-by: Dmitry Osipenko --- drivers/i2c/busses/i2c-tegra.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/i2c/busses/i2c-tegra.c b

[PATCH V3 1/6] i2c: tegra: clean up macros

2019-06-09 Thread Bitan Biswas
Clean up macros by: 1) removing unused macros 2) replace constants by macro BIT() Signed-off-by: Bitan Biswas Reviewed-by: Dmitry Osipenko --- drivers/i2c/busses/i2c-tegra.c | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b

[PATCH V3 2/6] i2c: tegra: remove unnecessary variable init

2019-06-09 Thread Bitan Biswas
Remove variable initializations in functions that are followed by assignments before use Signed-off-by: Bitan Biswas Reviewed-by: Dmitry Osipenko --- drivers/i2c/busses/i2c-tegra.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b

[PATCH V3 5/6] i2c: tegra: fix msleep warning

2019-06-09 Thread Bitan Biswas
Fix checkpatch.pl WARNING for delay of approximately 1msec in flush i2c FIFO polling loop by using usleep_range(1000, 2000): WARNING: msleep < 20ms can sleep for up to 20ms; see ... Documentation/timers/timers-howto.txt + msleep(1); Signed-off-by: Bitan Biswas Reviewed-by: Dmi

Re: [PATCH V2 6/6] i2c: tegra: remove BUG, BUG_ON

2019-06-09 Thread Bitan Biswas
On 6/7/19 12:47 PM, Dmitry Osipenko wrote: 07.06.2019 22:30, Bitan Biswas пишет: Remove redundant BUG_ON calls or replace with WARN_ON_ONCE as needed. Replace BUG() with error handling code. Define I2C_ERR_UNEXPECTED_STATUS for error handling. Signed-off-by: Bitan Biswas --- drivers/i2c

[PATCH V2 6/6] i2c: tegra: remove BUG, BUG_ON

2019-06-07 Thread Bitan Biswas
Remove redundant BUG_ON calls or replace with WARN_ON_ONCE as needed. Replace BUG() with error handling code. Define I2C_ERR_UNEXPECTED_STATUS for error handling. Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions

[PATCH V2 5/6] i2c: tegra: fix msleep warning

2019-06-07 Thread Bitan Biswas
Fix checkpatch.pl WARNING for delay of approximately 1msec in flush i2c FIFO polling loop by using usleep_range(1000, 2000): WARNING: msleep < 20ms can sleep for up to 20ms; see ... Documentation/timers/timers-howto.txt + msleep(1); Signed-off-by: Bitan Biswas Reviewed-by: Dmi

[PATCH V2 4/6] i2c: tegra: add spinlock definition comment

2019-06-07 Thread Bitan Biswas
Fix checkpatch.pl CHECK as follows: CHECK: spinlock_t definition without comment + spinlock_t xfer_lock; Signed-off-by: Bitan Biswas Reviewed-by: Dmitry Osipenko --- drivers/i2c/busses/i2c-tegra.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/i2c/busses/i2c-tegra.c b

[PATCH V2 1/6] i2c: tegra: clean up macros

2019-06-07 Thread Bitan Biswas
Clean up macros by: 1) removing unused macros 2) replace constants by macro BIT() Signed-off-by: Bitan Biswas Reviewed-by: Dmitry Osipenko --- drivers/i2c/busses/i2c-tegra.c | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b

[PATCH V2 3/6] i2c: tegra: fix alignment and spacing violations

2019-06-07 Thread Bitan Biswas
Fix checkpatch.pl alignment and blank line check(s) in i2c-tegra.c Signed-off-by: Bitan Biswas Reviewed-by: Dmitry Osipenko --- drivers/i2c/busses/i2c-tegra.c | 35 +++ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/drivers/i2c/busses/i2c

[PATCH V2 2/6] i2c: tegra: remove unnecessary variable init

2019-06-07 Thread Bitan Biswas
Remove variable initializations in functions that are followed by assignments before use Signed-off-by: Bitan Biswas Reviewed-by: Dmitry Osipenko --- drivers/i2c/busses/i2c-tegra.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b

Re: [PATCH V1 6/6] i2c: tegra: remove BUG, BUG_ON

2019-06-07 Thread Bitan Biswas
On 6/7/19 11:55 AM, Bitan Biswas wrote: On 6/7/19 5:18 AM, Dmitry Osipenko wrote: 07.06.2019 15:12, Dmitry Osipenko пишет: 07.06.2019 15:08, Dmitry Osipenko пишет: 07.06.2019 14:55, Bitan Biswas пишет: Remove redundant BUG_ON calls or replace with WARN_ON_ONCE as needed. Replace BUG

Re: [PATCH V1 6/6] i2c: tegra: remove BUG, BUG_ON

2019-06-07 Thread Bitan Biswas
On 6/7/19 5:18 AM, Dmitry Osipenko wrote: 07.06.2019 15:12, Dmitry Osipenko пишет: 07.06.2019 15:08, Dmitry Osipenko пишет: 07.06.2019 14:55, Bitan Biswas пишет: Remove redundant BUG_ON calls or replace with WARN_ON_ONCE as needed. Replace BUG() with error handling code. Define

[PATCH V1 5/6] i2c: tegra: fix msleep warning

2019-06-07 Thread Bitan Biswas
Fix checkpatch.pl WARNING for delay of approximately 1msec in flush i2c FIFO polling loop by using usleep_range(1000, 2000): WARNING: msleep < 20ms can sleep for up to 20ms; see ... Documentation/timers/timers-howto.txt + msleep(1); Signed-off-by: Bitan Biswas --- drivers/

[PATCH V1 1/6] i2c: tegra: clean up macros

2019-06-07 Thread Bitan Biswas
Clean up macros by: 1) removing unused macros 2) replace constants by macro BIT() Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c

[PATCH V1 4/6] i2c: tegra: add spinlock definition comment

2019-06-07 Thread Bitan Biswas
Fix checkpatch.pl CHECK as follows: CHECK: spinlock_t definition without comment + spinlock_t xfer_lock; Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index

[PATCH V1 3/6] i2c: tegra: fix alignment and spacing violations

2019-06-07 Thread Bitan Biswas
Fix checkpatch.pl alignment and blank line check(s) in i2c-tegra.c Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 35 +++ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c

[PATCH V1 2/6] i2c: tegra: remove unnecessary variable init

2019-06-07 Thread Bitan Biswas
Remove variable initializations in functions that are followed by assignments before use Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index

[PATCH V1 6/6] i2c: tegra: remove BUG, BUG_ON

2019-06-07 Thread Bitan Biswas
Remove redundant BUG_ON calls or replace with WARN_ON_ONCE as needed. Replace BUG() with error handling code. Define I2C_ERR_UNEXPECTED_STATUS for error handling. Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions

Re: [PATCH V5] drivers: i2c: tegra: fix warning/check/error

2019-06-07 Thread Bitan Biswas
On 6/6/19 11:05 PM, Dmitry Osipenko wrote: 07.06.2019 8:25, Bitan Biswas пишет: Fix checkpatch.pl warning(s)/error(s)/check(s) in i2c-tegra.c Ignore checkpatch WARNING for 80 character line limit at places where renaming fields compromises readability. Delay of approximately 1msec in flush

Re: [PATCH V5] drivers: i2c: tegra: fix warning/check/error

2019-06-07 Thread Bitan Biswas
On 6/6/19 11:03 PM, Wolfram Sang wrote: On Thu, Jun 06, 2019 at 10:25:03PM -0700, Bitan Biswas wrote: Fix checkpatch.pl warning(s)/error(s)/check(s) in i2c-tegra.c Ignore checkpatch WARNING for 80 character line limit at places where renaming fields compromises readability. Delay

[PATCH V3] i2c: busses: tegra: Add suspend-resume support

2019-06-06 Thread Bitan Biswas
in resume callback as i2c_mark_adapter_* (suspended-resumed) help ensure i2c core calls from client are not executed before i2c-tegra resume. Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 24 1 file changed, 24 insertions(+) diff --git a/drivers/i2c/busses

[PATCH V5] drivers: i2c: tegra: fix warning/check/error

2019-06-06 Thread Bitan Biswas
. Remove redundant BUG_ON calls or replace with WARN_ON_ONCE as needed. Replace BUG() with error handling code. Define I2C_ERR_UNEXPECTED_STATUS for error handling. Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 61 ++ 1 file changed, 32

Re: [PATCH V4] drivers: i2c: tegra: fix checkpatch defects

2019-06-06 Thread Bitan Biswas
On 6/6/19 1:45 PM, Peter Rosin wrote: On 2019-06-06 09:35, Bitan Biswas wrote: Fix checkpatch.pl warning(s)/error(s)/check(s) in i2c-tegra.c Remove redundant BUG_ON calls or replace with WARN_ON_ONCE as needed. Replace BUG() with error handling code. Define I2C_ERR_UNEXPECTED_STATUS

Re: [PATCH V4] drivers: i2c: tegra: fix checkpatch defects

2019-06-06 Thread Bitan Biswas
On 6/6/19 4:57 AM, Wolfram Sang wrote: On Thu, Jun 06, 2019 at 12:35:23AM -0700, Bitan Biswas wrote: Fix checkpatch.pl warning(s)/error(s)/check(s) in i2c-tegra.c Remove redundant BUG_ON calls or replace with WARN_ON_ONCE as needed. Replace BUG() with error handling code. Define

Re: [PATCH V4] drivers: i2c: tegra: fix checkpatch defects

2019-06-06 Thread Bitan Biswas
On 6/6/19 4:39 AM, Dmitry Osipenko wrote: 06.06.2019 10:35, Bitan Biswas пишет: Fix checkpatch.pl warning(s)/error(s)/check(s) in i2c-tegra.c Remove redundant BUG_ON calls or replace with WARN_ON_ONCE as needed. Replace BUG() with error handling code. Define I2C_ERR_UNEXPECTED_STATUS

Re: [PATCH V2] i2c: busses: tegra: Add suspend-resume support

2019-06-06 Thread Bitan Biswas
On 6/6/19 5:06 AM, Dmitry Osipenko wrote: 06.06.2019 8:54, Bitan Biswas пишет: Post suspend I2C registers have power on reset values. Before any transfer initialize I2C registers to prevent I2C transfer timeout and implement suspend and resume callbacks needed. Fix below errors post suspend

Re: [PATCH V1] i2c: busses: tegra: Add suspend-resume support

2019-06-06 Thread Bitan Biswas
On 6/6/19 4:52 AM, Dmitry Osipenko wrote: 06.06.2019 8:43, Bitan Biswas пишет: On 5/31/19 5:43 AM, Dmitry Osipenko wrote: 31.05.2019 11:50, Bitan Biswas пишет: On 5/30/19 4:27 AM, Dmitry Osipenko wrote: 30.05.2019 8:55, Bitan Biswas пишет: Post suspend I2C registers have power

[PATCH V4] drivers: i2c: tegra: fix checkpatch defects

2019-06-06 Thread Bitan Biswas
Fix checkpatch.pl warning(s)/error(s)/check(s) in i2c-tegra.c Remove redundant BUG_ON calls or replace with WARN_ON_ONCE as needed. Replace BUG() with error handling code. Define I2C_ERR_UNEXPECTED_STATUS for error handling. Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 67

[PATCH V3] drivers: i2c: tegra: fix checkpatch defects

2019-06-06 Thread Bitan Biswas
Fix checkpatch.pl warning(s)/error(s)/check(s) in i2c-tegra.c Remove redundant BUG_ON calls or replace with WARN_ON_ONCE as needed. Replace BUG() with error handling code. Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 66 +++--- 1 file

Re: [PATCH V2] drivers: i2c: tegra: fix checkpatch defects

2019-06-06 Thread Bitan Biswas
On 5/31/19 5:45 AM, Dmitry Osipenko wrote: 31.05.2019 12:04, Bitan Biswas пишет: On 5/30/19 4:43 AM, Dmitry Osipenko wrote: 30.05.2019 14:36, Dmitry Osipenko пишет: 30.05.2019 9:14, Bitan Biswas пишет: Fix checkpatch.pl warning(s)/error(s)/check(s) in i2c-tegra.c except for BUG/BUG_ON

[PATCH V2] i2c: busses: tegra: Add suspend-resume support

2019-06-05 Thread Bitan Biswas
in resume callback as i2c_mark_adapter_* (suspended-resumed) help ensure i2c core calls from client are not executed before i2c-tegra resume. Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/drivers/i2c/busses/i2c

Re: [PATCH V1] i2c: busses: tegra: Add suspend-resume support

2019-06-05 Thread Bitan Biswas
On 5/31/19 5:43 AM, Dmitry Osipenko wrote: 31.05.2019 11:50, Bitan Biswas пишет: On 5/30/19 4:27 AM, Dmitry Osipenko wrote: 30.05.2019 8:55, Bitan Biswas пишет: Post suspend I2C registers have power on reset values. Before any transfer initialize I2C registers to prevent I2C transfer

Re: [PATCH V2] drivers: i2c: tegra: fix checkpatch defects

2019-05-31 Thread Bitan Biswas
On 5/30/19 4:43 AM, Dmitry Osipenko wrote: 30.05.2019 14:36, Dmitry Osipenko пишет: 30.05.2019 9:14, Bitan Biswas пишет: Fix checkpatch.pl warning(s)/error(s)/check(s) in i2c-tegra.c except for BUG/BUG_ON checks Please turn the BUG_ON's into WARN_ON's. The machine won't go on fire, hence

Re: [PATCH V1] i2c: busses: tegra: Add suspend-resume support

2019-05-31 Thread Bitan Biswas
On 5/30/19 4:27 AM, Dmitry Osipenko wrote: 30.05.2019 8:55, Bitan Biswas пишет: Post suspend I2C registers have power on reset values. Before any transfer initialize I2C registers to prevent I2C transfer timeout and implement suspend and resume callbacks needed. Fix below errors post suspend

[PATCH V2] drivers: i2c: tegra: fix checkpatch defects

2019-05-30 Thread Bitan Biswas
Fix checkpatch.pl warning(s)/error(s)/check(s) in i2c-tegra.c except for BUG/BUG_ON checks Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 54 +++--- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/drivers/i2c/busses/i2c

[PATCH V1] i2c: busses: tegra: Add suspend-resume support

2019-05-29 Thread Bitan Biswas
(): pca953x_resume+0x0/0x1b0 returns -110 [ 27.658375] pca953x 1-0074: pca953x_resume+0x0/0x1b0 returned -110 after 127152 usecs [ 27.666194] PM: Device 1-0074 failed to resume: error -110 2) Tegra I2C transfer timeout error on jetson Xavier post resume. Signed-off-by: Bitan Biswas

Re: [lm-sensors] hwmon : raw reading -> temperature conversion

2012-08-13 Thread Bitan Biswas
Hi Guenter, Thank you for the guidance. But looking at the hwmon linux documentation, seems the sensor kernel drivers should report only raw readings. The raw readings can be converted into required output, e.g. temperature in this case, by respective user space implementation. "raw" means

Re: [lm-sensors] hwmon : raw reading - temperature conversion

2012-08-13 Thread Bitan Biswas
Hi Guenter, Thank you for the guidance. But looking at the hwmon linux documentation, seems the sensor kernel drivers should report only raw readings. The raw readings can be converted into required output, e.g. temperature in this case, by respective user space implementation. raw means

hwmon : raw reading -> temperature conversion

2012-08-10 Thread Bitan Biswas
Hi, I have a question related to hwmon driver and need suggestions. I am working on a temperature sensor driver that is hwmon driver. - The temperature is calculated from raw sensor reading and certain initialization parameters. - Raw reading obtained from 2 different sensor instances under

hwmon : raw reading - temperature conversion

2012-08-10 Thread Bitan Biswas
Hi, I have a question related to hwmon driver and need suggestions. I am working on a temperature sensor driver that is hwmon driver. - The temperature is calculated from raw sensor reading and certain initialization parameters. - Raw reading obtained from 2 different sensor instances under