Re: [RFC PATCH v3 1/1] scsi: ufs: Enable power management for wlun

2021-02-19 Thread Asutosh Das
On Fri, Feb 19 2021 at 00:35 -0800, Adrian Hunter wrote: On 11/02/21 9:18 pm, Asutosh Das wrote: During runtime-suspend of ufs host, the scsi devices are already suspended and so are the queues associated with them. But the ufs host sends SSU to wlun during its runtime-suspend. During the

Re: [RFC PATCH v3 1/1] scsi: ufs: Enable power management for wlun

2021-02-19 Thread Adrian Hunter
On 11/02/21 9:18 pm, Asutosh Das wrote: > During runtime-suspend of ufs host, the scsi devices are > already suspended and so are the queues associated with them. > But the ufs host sends SSU to wlun during its runtime-suspend. > During the process blk_queue_enter checks if the queue is not in >

Re: [RFC PATCH v3 1/1] scsi: ufs: Enable power management for wlun

2021-02-17 Thread Asutosh Das
On Tue, Feb 16 2021 at 09:44 -0800, Asutosh Das wrote: On Sat, Feb 13 2021 at 13:37 -0800, Avri Altman wrote: + } else { Is it possible to get here? Scsi_scan_host is called only after successful add_wluns It looks so. scsi 0:0:0:49488: Link setup for lun - ufshcd_setup_links [...]

Re: [RFC PATCH v3 1/1] scsi: ufs: Enable power management for wlun

2021-02-16 Thread Asutosh Das
On Fri, Feb 12 2021 at 19:25 -0800, Bart Van Assche wrote: On 2/11/21 11:18 AM, Asutosh Das wrote: +static inline bool is_rpmb_wlun(struct scsi_device *sdev) +{ + return (sdev->lun == ufshcd_upiu_wlun_to_scsi_wlun(UFS_UPIU_RPMB_WLUN)); +} + +static inline bool is_device_wlun(struct

Re: [RFC PATCH v3 1/1] scsi: ufs: Enable power management for wlun

2021-02-16 Thread Asutosh Das
On Sat, Feb 13 2021 at 13:37 -0800, Avri Altman wrote: + } else { Is it possible to get here? Scsi_scan_host is called only after successful add_wluns It looks so. scsi 0:0:0:49488: Link setup for lun - ufshcd_setup_links [...] Call trace: dump_backtrace+0x0/0x1d4 show_stack+0x18/0x24

RE: [RFC PATCH v3 1/1] scsi: ufs: Enable power management for wlun

2021-02-13 Thread Avri Altman
> + } else { Is it possible to get here? Scsi_scan_host is called only after successful add_wluns > + /* device wlun is probed */ > + hba->luns_avail--; > + } > +} > + > > /** > @@ -7254,6 +7312,14 @@ static int ufshcd_scsi_add_wlus(struct ufs_hba >

Re: [RFC PATCH v3 1/1] scsi: ufs: Enable power management for wlun

2021-02-12 Thread Bart Van Assche
On 2/11/21 11:18 AM, Asutosh Das wrote: > +static inline bool is_rpmb_wlun(struct scsi_device *sdev) > +{ > + return (sdev->lun == ufshcd_upiu_wlun_to_scsi_wlun(UFS_UPIU_RPMB_WLUN)); > +} > + > +static inline bool is_device_wlun(struct scsi_device *sdev) > +{ > + return (sdev->lun == > +