* Query: SCSI Device node creation when UFS is loaded as a module
@ 2019-10-23 23:51 asutoshd
2019-10-24 6:14 ` Avri Altman
2019-10-24 9:50 ` Steffen Maier
0 siblings, 2 replies; 4+ messages in thread
From: asutoshd @ 2019-10-23 23:51 UTC (permalink / raw)
To: linux-scsi
Hi
I'm loading the ufs-qcom driver as a module but am not seeing the
/dev/sda* device nodes.
Looks like it's not being created.
I find the sda nodes in other paths being enumerated though:
/ # find /sys -name sda
/sys/kernel/debug/block/sda
/sys/class/block/sda
/sys/devices/platform/<...>/<xxx>.ufshc/host0/target0:0:0/0:0:0:0/block/sda
/sys/block/sda
All Luns are detected and I see sda is detected and prints for all the
Luns as below -:
sd 0:0:0:0: [sda] .... ....-byte logical blocks:
... so on ...
But if I link it statically instead of a module, it works fine. All
device nodes are created.
I'm trying to figure out where/how in SCSI does it create these device
nodes - /dev/sd<a/b/c/d> ?
I've looked into sd.c but I couldn't figure out the exact place yet.
Any pointers please?
TIA
-asd
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: Query: SCSI Device node creation when UFS is loaded as a module
2019-10-23 23:51 Query: SCSI Device node creation when UFS is loaded as a module asutoshd
@ 2019-10-24 6:14 ` Avri Altman
2019-10-24 9:50 ` Steffen Maier
1 sibling, 0 replies; 4+ messages in thread
From: Avri Altman @ 2019-10-24 6:14 UTC (permalink / raw)
To: asutoshd, linux-scsi
>
> Hi
> I'm loading the ufs-qcom driver as a module but am not seeing the
> /dev/sda* device nodes.
> Looks like it's not being created.
>
> I find the sda nodes in other paths being enumerated though:
>
> / # find /sys -name sda
> /sys/kernel/debug/block/sda
> /sys/class/block/sda
> /sys/devices/platform/<...>/<xxx>.ufshc/host0/target0:0:0/0:0:0:0/block/sda
> /sys/block/sda
>
> All Luns are detected and I see sda is detected and prints for all the Luns as
> below -:
> sd 0:0:0:0: [sda] .... ....-byte logical blocks:
>
> ... so on ...
>
> But if I link it statically instead of a module, it works fine. All device nodes are
> created.
>
> I'm trying to figure out where/how in SCSI does it create these device nodes -
> /dev/sd<a/b/c/d> ?
> I've looked into sd.c but I couldn't figure out the exact place yet.
>
> Any pointers please?
I guess it's most probably in scsi_sysfs_add_devices, part of the async scan:
ufshcd_async_scan-> ufshcd_probe_hba-> scsi_scan_host->__scsi_scan_target-> scsi_probe_and_add_lun...
Thanks,
Avri
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Query: SCSI Device node creation when UFS is loaded as a module
2019-10-23 23:51 Query: SCSI Device node creation when UFS is loaded as a module asutoshd
2019-10-24 6:14 ` Avri Altman
@ 2019-10-24 9:50 ` Steffen Maier
2019-10-24 17:05 ` asutoshd
1 sibling, 1 reply; 4+ messages in thread
From: Steffen Maier @ 2019-10-24 9:50 UTC (permalink / raw)
To: asutoshd, linux-scsi
On 10/24/19 1:51 AM, asutoshd@codeaurora.org wrote:
> Hi
> I'm loading the ufs-qcom driver as a module but am not seeing the /dev/sda*
> device nodes.
> Looks like it's not being created.
>
> I find the sda nodes in other paths being enumerated though:
>
> / # find /sys -name sda
> /sys/kernel/debug/block/sda
> /sys/class/block/sda
> /sys/devices/platform/<...>/<xxx>.ufshc/host0/target0:0:0/0:0:0:0/block/sda
> /sys/block/sda
>
> All Luns are detected and I see sda is detected and prints for all the Luns as
> below -:
> sd 0:0:0:0: [sda] .... ....-byte logical blocks:
>
> ... so on ...
>
> But if I link it statically instead of a module, it works fine. All device
> nodes are created.
>
> I'm trying to figure out where/how in SCSI does it create these device nodes -
> /dev/sd<a/b/c/d> ?
That's from (systemd-)udevd user space based on uevents from the kernel.
> I've looked into sd.c but I couldn't figure out the exact place yet.
Yeah, based on the SCSI device probe and add lun, the high level driver sd
would emit udev events for block devices.
--
Mit freundlichen Gruessen / Kind regards
Steffen Maier
Linux on IBM Z Development
https://www.ibm.com/privacy/us/en/
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Matthias Hartmann
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Query: SCSI Device node creation when UFS is loaded as a module
2019-10-24 9:50 ` Steffen Maier
@ 2019-10-24 17:05 ` asutoshd
0 siblings, 0 replies; 4+ messages in thread
From: asutoshd @ 2019-10-24 17:05 UTC (permalink / raw)
To: Steffen Maier; +Cc: linux-scsi, linux-scsi-owner
On 2019-10-24 02:50, Steffen Maier wrote:
> On 10/24/19 1:51 AM, asutoshd@codeaurora.org wrote:
>> Hi
>> I'm loading the ufs-qcom driver as a module but am not seeing the
>> /dev/sda* device nodes.
>> Looks like it's not being created.
>>
>> I find the sda nodes in other paths being enumerated though:
>>
>> / # find /sys -name sda
>> /sys/kernel/debug/block/sda
>> /sys/class/block/sda
>> /sys/devices/platform/<...>/<xxx>.ufshc/host0/target0:0:0/0:0:0:0/block/sda
>> /sys/block/sda
>>
>> All Luns are detected and I see sda is detected and prints for all the
>> Luns as below -:
>> sd 0:0:0:0: [sda] .... ....-byte logical blocks:
>>
>> ... so on ...
>>
>> But if I link it statically instead of a module, it works fine. All
>> device nodes are created.
>>
>> I'm trying to figure out where/how in SCSI does it create these device
>> nodes - /dev/sd<a/b/c/d> ?
>
> That's from (systemd-)udevd user space based on uevents from the
> kernel.
>
>> I've looked into sd.c but I couldn't figure out the exact place yet.
>
> Yeah, based on the SCSI device probe and add lun, the high level
> driver sd would emit udev events for block devices.
Thanks Steffen and Avri.
I understood that sd.c creates the devices based on scsi_device and
establishes a relation between scsi_device (sdp) and scsi_disk (sdkp).
But I couldn't figure out why it creates the device fine when the
ufs-qcom is linked statically, but is unable to create the devices when
inserted as a module.
Does it follow a different method to create the device nodes when
statically linked and needs (systemd-)udevd to handle the events during
dynamic insertion?
Thanks
asd
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-10-24 17:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-23 23:51 Query: SCSI Device node creation when UFS is loaded as a module asutoshd
2019-10-24 6:14 ` Avri Altman
2019-10-24 9:50 ` Steffen Maier
2019-10-24 17:05 ` asutoshd
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.