Re: [PATCH 01/11] staging: gasket: core: debug log updates
On Mon, Oct 15, 2018 at 12:34 AM Greg Kroah-Hartman wrote: > > On Sun, Oct 14, 2018 at 09:59:17PM -0700, Todd Poynor wrote: > > From: Todd Poynor > > > > Add debug logs for device enable/disable events, > > Why? > > What is going to need this? As one of the few people actually developing for Apex chips (but this may be more soon), I ran into a situation where I cared about this. But I usually cobble together custom debugging for development situations, and generally don't get debug logs for released-in-the-wild drivers, so I'm fine not including these or any other debug logs. It sounds like debug logs face a pretty high bar for acceptance. I'm happy to send a patch removing all of 'em from gasket/apex if that's preferred. > > remove logs for > > callbacks (the called functions can generate their own logs if needed). > > That's a different thing than "adding" them, so shouldn't this really be > 2 patches? If it was, I could have accepted this patch already, and > ignored the "add new logs" one :) Sure, the callbacks most frequently occur during disable/enable events and were linked in my brain, but will send a new patch to just remove the useless callback logs. > > thanks, > > greg k-h
Re: [PATCH 01/11] staging: gasket: core: debug log updates
On Mon, Oct 15, 2018 at 12:34 AM Greg Kroah-Hartman wrote: > > On Sun, Oct 14, 2018 at 09:59:17PM -0700, Todd Poynor wrote: > > From: Todd Poynor > > > > Add debug logs for device enable/disable events, > > Why? > > What is going to need this? As one of the few people actually developing for Apex chips (but this may be more soon), I ran into a situation where I cared about this. But I usually cobble together custom debugging for development situations, and generally don't get debug logs for released-in-the-wild drivers, so I'm fine not including these or any other debug logs. It sounds like debug logs face a pretty high bar for acceptance. I'm happy to send a patch removing all of 'em from gasket/apex if that's preferred. > > remove logs for > > callbacks (the called functions can generate their own logs if needed). > > That's a different thing than "adding" them, so shouldn't this really be > 2 patches? If it was, I could have accepted this patch already, and > ignored the "add new logs" one :) Sure, the callbacks most frequently occur during disable/enable events and were linked in my brain, but will send a new patch to just remove the useless callback logs. > > thanks, > > greg k-h
Re: [PATCH 01/11] staging: gasket: core: debug log updates
On Sun, Oct 14, 2018 at 09:59:17PM -0700, Todd Poynor wrote: > From: Todd Poynor > > Add debug logs for device enable/disable events, Why? What is going to need this? > remove logs for > callbacks (the called functions can generate their own logs if needed). That's a different thing than "adding" them, so shouldn't this really be 2 patches? If it was, I could have accepted this patch already, and ignored the "add new logs" one :) thanks, greg k-h
Re: [PATCH 01/11] staging: gasket: core: debug log updates
On Sun, Oct 14, 2018 at 09:59:17PM -0700, Todd Poynor wrote: > From: Todd Poynor > > Add debug logs for device enable/disable events, Why? What is going to need this? > remove logs for > callbacks (the called functions can generate their own logs if needed). That's a different thing than "adding" them, so shouldn't this really be 2 patches? If it was, I could have accepted this patch already, and ignored the "add new logs" one :) thanks, greg k-h
[PATCH 01/11] staging: gasket: core: debug log updates
From: Todd Poynor Add debug logs for device enable/disable events, remove logs for callbacks (the called functions can generate their own logs if needed). Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c index f230bec76ae4e..62a7515915e59 100644 --- a/drivers/staging/gasket/gasket_core.c +++ b/drivers/staging/gasket/gasket_core.c @@ -109,8 +109,6 @@ check_and_invoke_callback(struct gasket_dev *gasket_dev, { int ret = 0; - dev_dbg(gasket_dev->dev, "check_and_invoke_callback %p\n", - cb_function); if (cb_function) { mutex_lock(_dev->mutex); ret = cb_function(gasket_dev); @@ -126,11 +124,8 @@ gasket_check_and_invoke_callback_nolock(struct gasket_dev *gasket_dev, { int ret = 0; - if (cb_function) { - dev_dbg(gasket_dev->dev, - "Invoking device-specific callback.\n"); + if (cb_function) ret = cb_function(gasket_dev); - } return ret; } @@ -633,6 +628,7 @@ void gasket_disable_device(struct gasket_dev *gasket_dev) gasket_dev->internal_desc->driver_desc; int i; + dev_dbg(gasket_dev->dev, "disabling device\n"); /* Only delete the device if it has been successfully added. */ if (gasket_dev->dev_info.cdev_added) cdev_del(_dev->dev_info.cdev); @@ -1357,6 +1353,7 @@ int gasket_enable_device(struct gasket_dev *gasket_dev) const struct gasket_driver_desc *driver_desc = gasket_dev->internal_desc->driver_desc; + dev_dbg(gasket_dev->dev, "enabling device\n"); ret = gasket_interrupt_init(gasket_dev); if (ret) { dev_err(gasket_dev->dev, -- 2.19.0.605.g01d371f741-goog
[PATCH 01/11] staging: gasket: core: debug log updates
From: Todd Poynor Add debug logs for device enable/disable events, remove logs for callbacks (the called functions can generate their own logs if needed). Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c index f230bec76ae4e..62a7515915e59 100644 --- a/drivers/staging/gasket/gasket_core.c +++ b/drivers/staging/gasket/gasket_core.c @@ -109,8 +109,6 @@ check_and_invoke_callback(struct gasket_dev *gasket_dev, { int ret = 0; - dev_dbg(gasket_dev->dev, "check_and_invoke_callback %p\n", - cb_function); if (cb_function) { mutex_lock(_dev->mutex); ret = cb_function(gasket_dev); @@ -126,11 +124,8 @@ gasket_check_and_invoke_callback_nolock(struct gasket_dev *gasket_dev, { int ret = 0; - if (cb_function) { - dev_dbg(gasket_dev->dev, - "Invoking device-specific callback.\n"); + if (cb_function) ret = cb_function(gasket_dev); - } return ret; } @@ -633,6 +628,7 @@ void gasket_disable_device(struct gasket_dev *gasket_dev) gasket_dev->internal_desc->driver_desc; int i; + dev_dbg(gasket_dev->dev, "disabling device\n"); /* Only delete the device if it has been successfully added. */ if (gasket_dev->dev_info.cdev_added) cdev_del(_dev->dev_info.cdev); @@ -1357,6 +1353,7 @@ int gasket_enable_device(struct gasket_dev *gasket_dev) const struct gasket_driver_desc *driver_desc = gasket_dev->internal_desc->driver_desc; + dev_dbg(gasket_dev->dev, "enabling device\n"); ret = gasket_interrupt_init(gasket_dev); if (ret) { dev_err(gasket_dev->dev, -- 2.19.0.605.g01d371f741-goog