Linux kernel staging patches
 help / color / mirror / Atom feed
From: Umang Jain <umang.jain@ideasonboard.com>
To: Kieran Bingham <kieran.bingham@ideasonboard.com>,
	linux-staging@lists.linux.dev
Cc: Stefan Wahren <stefan.wahren@i2se.com>,
	Dan Carpenter <error27@gmail.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Phil Elwell <phil@raspberrypi.com>,
	Dave Stevenson <dave.stevenson@raspberrypi.com>,
	Greg KH <greg@kroah.com>
Subject: Re: [PATCH 2/5] staging: vc04_services: vchiq_arm: Use appropriate dev_* log helpers
Date: Thu, 21 Mar 2024 17:40:12 +0530	[thread overview]
Message-ID: <3a6b414b-1c40-4aa2-9d04-82798494d7b1@ideasonboard.com> (raw)
In-Reply-To: <171058492288.2556397.4617260952431108092@ping.linuxembedded.co.uk>

Hi Kieran,

On 16/03/24 3:58 pm, Kieran Bingham wrote:
> Quoting Umang Jain (2024-03-15 10:56:56)
>> Re-evaluate logs on error code paths and fix a few error logs
>> with  appropriate dev_* logging helpers.
>>
>> For a case where a null ptr check is performed, use a WARN_ON()
>> instead of logging to dev_err().
>>
>> No functional changes intended in this patch.
>>
>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
>> ---
>>   .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
>> index 1579bd4e5263..3c3e6f3e48ce 100644
>> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
>> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
>> @@ -1317,7 +1317,7 @@ vchiq_keepalive_thread_func(void *v)
>>                  long rc = 0, uc = 0;
>>   
>>                  if (wait_for_completion_interruptible(&arm_state->ka_evt)) {
>> -                       dev_err(state->dev, "suspend: %s: interrupted\n", __func__);
>> +                       dev_dbg(state->dev, "suspend: %s: interrupted\n", __func__);
> This looks good.
>
>>                          flush_signals(current);
>>                          continue;
>>                  }
>> @@ -1380,7 +1380,7 @@ vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service,
>>                           service->client_id);
>>                  entity_uc = &service->service_use_count;
>>          } else {
>> -               dev_err(state->dev, "suspend: %s: null service ptr\n", __func__);
>> +               WARN_ON(!service);
> This sounds like something that shouldn't happen. Can it actually happen?
>
> If it can happen - can it be caused by userspace through the VCHIQ
> interfaces or is this just an internal code path?

Yes it can happen, when the char device /dev/vchiq is being closed by a 
process.  See vchiq_release()
calls the below call in 
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c

....
vchiq_use_internal(instance->state, NULL, USE_TYPE_VCHIQ);
....

This was a review comment actually. I'll leave it out for this series 
and will handle it as standalone patch later.
>
> Bumping up to a WARN_ON could probably need justification that deserves
> it's own patch, but for the rest of the lines:

ack
>
>
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
>
>>                  ret = -EINVAL;
>>                  goto out;
>>          }
>> @@ -1753,7 +1753,7 @@ static int vchiq_probe(struct platform_device *pdev)
>>           */
>>          err = vchiq_register_chrdev(&pdev->dev);
>>          if (err) {
>> -               dev_warn(&pdev->dev, "arm: Failed to initialize vchiq cdev\n");
>> +               dev_err(&pdev->dev, "arm: Failed to initialize vchiq cdev\n");
>>                  goto error_exit;
>>          }
>>   
>> @@ -1763,7 +1763,7 @@ static int vchiq_probe(struct platform_device *pdev)
>>          return 0;
>>   
>>   failed_platform_init:
>> -       dev_warn(&pdev->dev, "arm: Could not initialize vchiq platform\n");
>> +       dev_err(&pdev->dev, "arm: Could not initialize vchiq platform\n");
>>   error_exit:
>>          return err;
>>   }
>> -- 
>> 2.43.0
>>


  reply	other threads:[~2024-03-21 12:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-15 10:56 [PATCH 0/5] staging: vc04_services: Address module cleanup Umang Jain
2024-03-15 10:56 ` [PATCH 1/5] staging: vc04_services: Remove unused function declarations Umang Jain
2024-03-15 11:00   ` Laurent Pinchart
2024-03-16 10:33   ` Kieran Bingham
2024-03-15 10:56 ` [PATCH 2/5] staging: vc04_services: vchiq_arm: Use appropriate dev_* log helpers Umang Jain
2024-03-16 10:28   ` Kieran Bingham
2024-03-21 12:10     ` Umang Jain [this message]
2024-03-15 10:56 ` [PATCH 3/5] staging: vc04_services: Do not log error on kzalloc() Umang Jain
2024-03-16  8:36   ` Dan Carpenter
2024-03-15 10:56 ` [PATCH 4/5] staging: vc04_services: Implement vchiq_bus .remove Umang Jain
2024-03-16 10:30   ` Kieran Bingham
2024-03-15 10:56 ` [PATCH 5/5] staging: vc04_services: vchiq_core: Stop kthreads on shutdown Umang Jain
2024-03-16 10:33   ` Kieran Bingham
2024-03-17 12:08 ` [PATCH 0/5] staging: vc04_services: Address module cleanup Stefan Wahren
2024-03-21 11:30   ` Umang Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3a6b414b-1c40-4aa2-9d04-82798494d7b1@ideasonboard.com \
    --to=umang.jain@ideasonboard.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=error27@gmail.com \
    --cc=greg@kroah.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-staging@lists.linux.dev \
    --cc=phil@raspberrypi.com \
    --cc=stefan.wahren@i2se.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).