linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Smart <james.smart@emulex.com>
To: Tomas Henzl <thenzl@redhat.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH 02/21] lpfc: Add Lancer Temperature Event support to the lpfc driver
Date: Mon, 16 Feb 2015 11:10:39 -0500	[thread overview]
Message-ID: <54E2167F.3070500@emulex.com> (raw)
In-Reply-To: <54D4B0A0.2050602@redhat.com>


On 2/6/2015 7:16 AM, Tomas Henzl wrote:
> On 02/05/2015 08:23 PM, James Smart wrote:
>> ---
>>   drivers/scsi/lpfc/lpfc_hw4.h  |   1 +
>>   drivers/scsi/lpfc/lpfc_init.c | 179 +++++++++++++++++++++++++++++-------------
>>   2 files changed, 125 insertions(+), 55 deletions(-)
>>
>> diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h
>> index f432ec1..3121ec4 100644
>> --- a/drivers/scsi/lpfc/lpfc_hw4.h
>> +++ b/drivers/scsi/lpfc/lpfc_hw4.h
>> @@ -3244,6 +3244,7 @@ struct lpfc_acqe_sli {
>>   #define LPFC_SLI_EVENT_TYPE_NVLOG_POST		0x4
>>   #define LPFC_SLI_EVENT_TYPE_DIAG_DUMP		0x5
>>   #define LPFC_SLI_EVENT_TYPE_MISCONFIGURED	0x9
>> +#define LPFC_SLI_EVENT_TYPE_REMOTE_DPORT	0xA
>>   };
>>   
>>   /*
>> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
>> index 2b5b910..4ba91af 100644
>> --- a/drivers/scsi/lpfc/lpfc_init.c
>> +++ b/drivers/scsi/lpfc/lpfc_init.c
>> @@ -1330,13 +1330,14 @@ lpfc_offline_eratt(struct lpfc_hba *phba)
>>   void
>>   lpfc_sli4_offline_eratt(struct lpfc_hba *phba)
>>   {
>> +	spin_lock_irq(&phba->hbalock);
>> +	phba->link_state = LPFC_HBA_ERROR;
>> +	spin_unlock_irq(&phba->hbalock);
> Hi James,
> please explain why is the spinlock^ needed?
> There seems to be lot of other places where link_state is not protected,
> for example it is evaluated in lpfc_sli4_handle_received_buffer with no lock.
>
> Could you please also add some more description to the of the body your mails,
> sometimes  a subject only is not enough.
>
> Thanks,
> Tomas

Well - good question - access should be under lock, and it wouldn't 
surprise me if there are some cases, especially read checks, where it 
isn't. In most cases, this bad behavior works, as the variable doesn't 
change often, and even when it does, there's very long time delays 
before something would reference the change. Not trying to say it 
shouldn't be fixed, but rather why it hasn't been an issue. This one 
will take a little bit to clean up - it reached this point historically 
over many successive changes.

Yes, I'll add a little meat to future patches.

-- james s




  reply	other threads:[~2015-02-16 16:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05 19:23 [PATCH 02/21] lpfc: Add Lancer Temperature Event support to the lpfc driver James Smart
2015-02-06 12:16 ` Tomas Henzl
2015-02-16 16:10   ` James Smart [this message]
2015-02-17 13:01     ` Tomas Henzl
  -- strict thread matches above, loose matches on Subject: below --
2015-04-03 21:10 James Smart
2015-04-10  6:05 ` Hannes Reinecke

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=54E2167F.3070500@emulex.com \
    --to=james.smart@emulex.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=thenzl@redhat.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 NNTP newsgroup(s).