Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: John Garry <john.g.garry@oracle.com>
To: yangxingui <yangxingui@huawei.com>,
	yanaijie@huawei.com, jejb@linux.ibm.com,
	martin.petersen@oracle.com, damien.lemoal@opensource.wdc.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linuxarm@huawei.com, prime.zeng@hisilicon.com,
	kangfenglong@huawei.com, chenxiang66@hisilicon.com
Subject: Re: [PATCH v3] scsi: libsas: Fix set zero-address when device-type != NO_DEVICE
Date: Thu, 16 Nov 2023 16:54:35 +0000	[thread overview]
Message-ID: <a84f7c4e-5da1-4357-9001-c379734e500d@oracle.com> (raw)
In-Reply-To: <9cc196d7-0c4f-ef09-53b8-362d5eb599a6@huawei.com>

On 16/11/2023 13:45, yangxingui wrote:
>> I think that patch title can be improved, but I would need to know 
>> more about the problem before suggesting an improvement.
> How about "Fix port add phy failed" ?
>>
>>> Firstly, when ex_phy is added to the parent port, ex_phy->port is not 
>>> set.
>>
>> That seems correct, but why mention this now?
>>
>>> As a result, sas_port_delete_phy() won't be called in
>>> sas_unregister_devs_sas_addr(), and although ex_phy's sas_address is 
>>> zero,
>>> it is not deleted from the parent port's phy_list.
>>
>> I am not sure why you mention this now either. You seem to be 
>> describing how the problem occurs without actually mentioning what the 
>> problem is.
>>ohn
>>>
>>> Secondly, phy->attached_sas_addr will be set to a zero-address when
>>> phy->linkrate < SAS_LINK_RATE_1_5_GBPS and device-type != NO_DEVICE 
>>> during
>>> device registration, such as stp. It will create a new port and all 
>>> other
>>> ex_phys whose addresses are zero will be added to the new port in
>>> sas_ex_get_linkrate(), and it may trigger BUG() as follows:
>>
>> I think that it would be better to first mention this crash, i.e. the 
>> problem, how you recreate it, and then describe how and why it 
>> happens, and then tell us how you will fix it
> How about follows:
> 
> The following processes trigger a BUG(). A new port port-7:7:0 that 
> created by a new zero-address sata device tries to add phy-7:7:19 had 
> the same zero-address, but phy-7:7:19 is already part of another port.

I would like to know how to recreate, which gives a lot more context and 
helps me understand what the problem is.

Thanks,
John

  reply	other threads:[~2023-11-16 16:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-16  3:52 [PATCH v3] scsi: libsas: Fix set zero-address when device-type != NO_DEVICE Xingui Yang
2023-11-16 10:13 ` John Garry
2023-11-16 13:45   ` yangxingui
2023-11-16 16:54     ` John Garry [this message]
2023-11-17  9:05       ` yangxingui

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=a84f7c4e-5da1-4357-9001-c379734e500d@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=chenxiang66@hisilicon.com \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=jejb@linux.ibm.com \
    --cc=kangfenglong@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=martin.petersen@oracle.com \
    --cc=prime.zeng@hisilicon.com \
    --cc=yanaijie@huawei.com \
    --cc=yangxingui@huawei.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