Re: [PATCH 2/3] lpd: marvell: handle non-unique/duplicate location codes

Vasant Hegde <[email protected]> Wed, 9 Nov 2016 16:17:21 +0530
Newsgroups gmane.linux.tools.diag.devel
Message-ID <[email protected]>
On 11/08/2016 06:58 PM, Mauricio Faria de Oliveira wrote:
> On 11/08/2016 09:02 AM, Vasant Hegde wrote:
>
>>> This could cause an user to specify a device by location code, and have
>>> the wrong device identified; if the service operation is a hotplug/pull
>>> the disk, that error would cause serious problems.
>>>
>>> Even though this might be a problem that requires a fix elsewhere, it's
>>
>> I'd prefer to fix at the source (avoid duplicate loc code) instead of
>> having workaround. But given the implications, I'm ok to accept this patch.
>
> Thanks; that helps for now.
>
>> But who is creating these dup location codes? lsvpd tools or sysfs
>> (kernel/DT) ?
>
> Taking a look now, it seems to be lsvpd, which handles it as SCSI disks
> (with Bus, Target, and LUN numbers).
>
> DeviceTreeCollector::buildSCSILocCode()
> ...
>      val << "-B" << bus->dataValue << "-T" << target->dataValue
>                           << "-L" << lun->dataValue;
> ...
>
> And from lsvpd:
>
> # lsvpd --list=sdj
> <...>
> *DS -SCSI Disk Drive
> <...>
> *MF ATA
> <...>
> *YL -B0-T0-L0
>
> I can try to come up w/ a patch for it later on.  If you want to tackle
> it yourself, just let me know.

Patch is always welcome :-) If you have time please fix it. Else I will chase 
this issue some other day.

-Vasant


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi