From: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Peter Hurley
<peter-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>,
Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Sanjeev Sharma
<Sanjeev_Sharma-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>,
Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
Ingo Molnar <mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH 01/21] uas: replace WARN_ON_ONCE() with lockdep_assert_held()
Date: Wed, 10 Sep 2014 17:02:34 +0200 [thread overview]
Message-ID: <5410680A.8020107@redhat.com> (raw)
In-Reply-To: <54106271.5090909-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>
Hi,
On 09/10/2014 04:38 PM, Peter Hurley wrote:
> [ +cc Peter Zijlstra, Ingo Molnar ]
>
> On 09/10/2014 07:46 AM, Hans de Goede wrote:
>> From: Sanjeev Sharma <Sanjeev_Sharma-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
>>
>> On some architecture spin_is_locked() always return false in
>> uniprocessor configuration and therefore it would be advise to replace
>> with lockdep_assert_held().
>>
>> Signed-off-by: Sanjeev Sharma <Sanjeev_Sharma-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
>> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>> ---
>> drivers/usb/storage/uas.c | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
>> index 3f42785..05b2d8e 100644
>> --- a/drivers/usb/storage/uas.c
>> +++ b/drivers/usb/storage/uas.c
>> @@ -154,7 +154,7 @@ static void uas_mark_cmd_dead(struct uas_dev_info *devinfo,
>> struct scsi_cmnd *cmnd = container_of(scp, struct scsi_cmnd, SCp);
>>
>> uas_log_cmd_state(cmnd, caller);
>> - WARN_ON_ONCE(!spin_is_locked(&devinfo->lock));
>> + lockdep_assert_held(&devinfo->lock);
>
> This change isn't equivalent.
>
> lockdep_assert_held() will continue to emit warnings; ie., there is no
> "once" functionality. Same for the other changes below.
Given that these should really never ever happen, that is not really a problem
IMHO. The idea ws to replace the wrong use of spin_is_locked with some
other sanity check, preferably a light weight one, the once behavior is not
that important.
Regards,
Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-09-10 15:02 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-10 11:46 [PATCH 00/21] uas: rewrite error handling for robustness + misc cleanups Hans de Goede
[not found] ` <1410349611-17573-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-09-10 11:46 ` [PATCH 01/21] uas: replace WARN_ON_ONCE() with lockdep_assert_held() Hans de Goede
2014-09-10 11:48 ` Hans de Goede
[not found] ` <54103AA3.7000801-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-09-10 11:56 ` Oliver Neukum
[not found] ` <1410350184.12706.18.camel-B2T3B9s34ElbnMAlSieJcQ@public.gmane.org>
2014-09-10 11:58 ` Sharma, Sanjeev
2014-09-10 12:00 ` Hans de Goede
[not found] ` <54103D73.5050104-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-09-10 12:54 ` Oliver Neukum
[not found] ` <1410353663.12706.20.camel-B2T3B9s34ElbnMAlSieJcQ@public.gmane.org>
2014-09-10 13:15 ` Hans de Goede
2014-09-10 13:51 ` Greg Kroah-Hartman
2014-09-11 3:40 ` Sharma, Sanjeev
2014-09-10 14:38 ` Peter Hurley
[not found] ` <54106271.5090909-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>
2014-09-10 15:02 ` Hans de Goede [this message]
2014-09-11 3:42 ` Sharma, Sanjeev
2014-09-10 11:46 ` [PATCH 02/21] uas: Remove task-management / abort error handling code Hans de Goede
2014-09-10 13:31 ` Oliver Neukum
2014-09-10 11:46 ` [PATCH 03/21] uas: Fix resetting flag handling Hans de Goede
2014-09-10 13:40 ` Oliver Neukum
2014-09-10 13:50 ` Hans de Goede
2014-09-10 11:46 ` [PATCH 07/21] uas: Simplify unlink of data urbs on error Hans de Goede
2014-09-10 11:46 ` [PATCH 08/21] uas: Free data urbs on completion Hans de Goede
2014-09-10 11:46 ` [PATCH 10/21] uas: zap_pending: data urbs should have completed at this time Hans de Goede
2014-09-10 14:10 ` Oliver Neukum
2014-09-10 14:17 ` Hans de Goede
2014-09-10 11:46 ` [PATCH 14/21] uas: Fix memleak of non-submitted urbs Hans de Goede
2014-09-10 11:46 ` [PATCH 20/21] uas: Remove support for old sense ui as used in pre-production hardware Hans de Goede
2014-09-10 14:06 ` Oliver Neukum
2014-09-10 14:16 ` Hans de Goede
2014-09-10 11:46 ` [PATCH 04/21] uas: Add uas_get_tag() helper function Hans de Goede
2014-09-10 11:46 ` [PATCH 05/21] uas: Do not use scsi_host_find_tag Hans de Goede
2014-09-10 11:46 ` [PATCH 06/21] uas: Check against unexpected completions Hans de Goede
2014-09-10 11:46 ` [PATCH 09/21] uas: Simplify reset / disconnect handling Hans de Goede
2014-09-10 11:46 ` [PATCH 11/21] uas: Drop inflight list Hans de Goede
2014-09-10 11:46 ` [PATCH 12/21] uas: Remove cmnd reference from the cmd urb Hans de Goede
2014-09-10 11:46 ` [PATCH 13/21] uas: Drop all references to a scsi_cmnd once it has been aborted Hans de Goede
2014-09-10 11:46 ` [PATCH 15/21] uas: pre_reset and suspend: Fix a few races Hans de Goede
2014-09-10 11:46 ` [PATCH 16/21] uas: Use streams on upcoming 10Gbps / 3.1 USB Hans de Goede
2014-09-10 11:46 ` [PATCH 17/21] uas: Do not log urb status error on cancellation Hans de Goede
2014-09-10 14:00 ` Oliver Neukum
2014-09-10 14:05 ` Hans de Goede
2014-09-10 11:46 ` [PATCH 18/21] uas: Use scsi_print_command Hans de Goede
2014-09-10 16:08 ` Elliott, Robert (Server Storage)
2014-09-10 17:58 ` Hans de Goede
2014-09-10 11:46 ` [PATCH 19/21] uas: Drop COMMAND_COMPLETED flag Hans de Goede
2014-09-10 11:46 ` [PATCH 21/21] uas: Remove protype hardware usb interface info Hans de Goede
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=5410680A.8020107@redhat.com \
--to=hdegoede-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=Sanjeev_Sharma-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=peter-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org \
--cc=peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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