[PATCH V3 3/5] scsi: ufs: core: Remove unused ufshcd_res_info structure

Ram Kumar Dwivedi posted 5 patches 1 month, 1 week ago
[PATCH V3 3/5] scsi: ufs: core: Remove unused ufshcd_res_info structure
Posted by Ram Kumar Dwivedi 1 month, 1 week ago
From: Nitin Rawat <quic_nitirawa@quicinc.com>

Remove the ufshcd_res_info structure and associated enum ufshcd_res
definitions from the UFS host controller header. These were previously
used for MCQ resource mapping but are no longer needed following recent
refactoring to use direct base addresses instead of multiple separate
resource regions

Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com>
---
 include/ufs/ufshcd.h | 25 -------------------------
 1 file changed, 25 deletions(-)

diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index 1d3943777584..a7bcf7c7a1af 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -794,30 +794,6 @@ struct ufs_hba_monitor {
 	bool enabled;
 };
 
-/**
- * struct ufshcd_res_info_t - MCQ related resource regions
- *
- * @name: resource name
- * @resource: pointer to resource region
- * @base: register base address
- */
-struct ufshcd_res_info {
-	const char *name;
-	struct resource *resource;
-	void __iomem *base;
-};
-
-enum ufshcd_res {
-	RES_UFS,
-	RES_MCQ,
-	RES_MCQ_SQD,
-	RES_MCQ_SQIS,
-	RES_MCQ_CQD,
-	RES_MCQ_CQIS,
-	RES_MCQ_VS,
-	RES_MAX,
-};
-
 /**
  * struct ufshcd_mcq_opr_info_t - Operation and Runtime registers
  *
@@ -1127,7 +1103,6 @@ struct ufs_hba {
 	bool lsdb_sup;
 	bool mcq_enabled;
 	bool mcq_esi_enabled;
-	struct ufshcd_res_info res[RES_MAX];
 	void __iomem *mcq_base;
 	struct ufs_hw_queue *uhq;
 	struct ufs_hw_queue *dev_cmd_queue;
-- 
2.50.1
Re: [PATCH V3 3/5] scsi: ufs: core: Remove unused ufshcd_res_info structure
Posted by Krzysztof Kozlowski 1 month, 1 week ago
On 21/08/2025 13:24, Ram Kumar Dwivedi wrote:
> From: Nitin Rawat <quic_nitirawa@quicinc.com>
> 
> Remove the ufshcd_res_info structure and associated enum ufshcd_res
> definitions from the UFS host controller header. These were previously
> used for MCQ resource mapping but are no longer needed following recent
> refactoring to use direct base addresses instead of multiple separate
> resource regions
> 
> Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com>

Incomplete SoB chain.

But anyway this makes no sense as independent patch. First you remove
users of it making it redundant... and then you remove it? No.

Organize your patches in logical chunks.

Best regards,
Krzysztof
Re: [PATCH V3 3/5] scsi: ufs: core: Remove unused ufshcd_res_info structure
Posted by Nitin Rawat 1 month ago

On 8/21/2025 5:18 PM, Krzysztof Kozlowski wrote:
> On 21/08/2025 13:24, Ram Kumar Dwivedi wrote:
>> From: Nitin Rawat <quic_nitirawa@quicinc.com>
>>
>> Remove the ufshcd_res_info structure and associated enum ufshcd_res
>> definitions from the UFS host controller header. These were previously
>> used for MCQ resource mapping but are no longer needed following recent
>> refactoring to use direct base addresses instead of multiple separate
>> resource regions
>>
>> Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com>
> 
> Incomplete SoB chain.
> 
> But anyway this makes no sense as independent patch. First you remove
> users of it making it redundant... and then you remove it? No.

Hi Krzysztof,

The driver changes are in the UFS Qualcomm platform driver, which uses 
the definitions, while ufshcd.h is part of the UFS core driver. Hence 
kept in 2 separate patch.

Thanks,
Nitin

> 
> Organize your patches in logical chunks.
> 
> Best regards,
> Krzysztof
>
Re: [PATCH V3 3/5] scsi: ufs: core: Remove unused ufshcd_res_info structure
Posted by Manivannan Sadhasivam 1 month ago
On Mon, Sep 01, 2025 at 09:38:25PM GMT, Nitin Rawat wrote:
> 
> 
> On 8/21/2025 5:18 PM, Krzysztof Kozlowski wrote:
> > On 21/08/2025 13:24, Ram Kumar Dwivedi wrote:
> > > From: Nitin Rawat <quic_nitirawa@quicinc.com>
> > > 
> > > Remove the ufshcd_res_info structure and associated enum ufshcd_res
> > > definitions from the UFS host controller header. These were previously
> > > used for MCQ resource mapping but are no longer needed following recent
> > > refactoring to use direct base addresses instead of multiple separate
> > > resource regions
> > > 
> > > Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com>
> > 
> > Incomplete SoB chain.
> > 
> > But anyway this makes no sense as independent patch. First you remove
> > users of it making it redundant... and then you remove it? No.
> 
> Hi Krzysztof,
> 
> The driver changes are in the UFS Qualcomm platform driver, which uses the
> definitions, while ufshcd.h is part of the UFS core driver. Hence kept in 2
> separate patch.
> 

No, that is not a logical split. When the users are removed, the unused
definitions also have to be removed even if the definitions are in a different
file.

So I believe you need to remove 'ufshcd_res_info' in patch 1 and 'ufshcd_res' in
patch 2.

- Mani

-- 
மணிவண்ணன் சதாசிவம்
Re: [PATCH V3 3/5] scsi: ufs: core: Remove unused ufshcd_res_info structure
Posted by Nitin Rawat 1 month ago

On 9/3/2025 6:58 PM, Manivannan Sadhasivam wrote:
> On Mon, Sep 01, 2025 at 09:38:25PM GMT, Nitin Rawat wrote:
>>
>>
>> On 8/21/2025 5:18 PM, Krzysztof Kozlowski wrote:
>>> On 21/08/2025 13:24, Ram Kumar Dwivedi wrote:
>>>> From: Nitin Rawat <quic_nitirawa@quicinc.com>
>>>>
>>>> Remove the ufshcd_res_info structure and associated enum ufshcd_res
>>>> definitions from the UFS host controller header. These were previously
>>>> used for MCQ resource mapping but are no longer needed following recent
>>>> refactoring to use direct base addresses instead of multiple separate
>>>> resource regions
>>>>
>>>> Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com>
>>>
>>> Incomplete SoB chain.
>>>
>>> But anyway this makes no sense as independent patch. First you remove
>>> users of it making it redundant... and then you remove it? No.
>>
>> Hi Krzysztof,
>>
>> The driver changes are in the UFS Qualcomm platform driver, which uses the
>> definitions, while ufshcd.h is part of the UFS core driver. Hence kept in 2
>> separate patch.
>>
> 
> No, that is not a logical split. When the users are removed, the unused
> definitions also have to be removed even if the definitions are in a different
> file.
> 
> So I believe you need to remove 'ufshcd_res_info' in patch 1 and 'ufshcd_res' in
> patch 2.

Agree with this. Hence I have taken care of this in v4.


> 
> - Mani
>
Re: [PATCH V3 3/5] scsi: ufs: core: Remove unused ufshcd_res_info structure
Posted by Krzysztof Kozlowski 1 month ago
On 01/09/2025 18:08, Nitin Rawat wrote:
> 
> 
> On 8/21/2025 5:18 PM, Krzysztof Kozlowski wrote:
>> On 21/08/2025 13:24, Ram Kumar Dwivedi wrote:
>>> From: Nitin Rawat <quic_nitirawa@quicinc.com>
>>>
>>> Remove the ufshcd_res_info structure and associated enum ufshcd_res
>>> definitions from the UFS host controller header. These were previously
>>> used for MCQ resource mapping but are no longer needed following recent
>>> refactoring to use direct base addresses instead of multiple separate
>>> resource regions
>>>
>>> Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com>
>>
>> Incomplete SoB chain.
>>
>> But anyway this makes no sense as independent patch. First you remove
>> users of it making it redundant... and then you remove it? No.
> 
> Hi Krzysztof,
> 
> The driver changes are in the UFS Qualcomm platform driver, which uses 
> the definitions, while ufshcd.h is part of the UFS core driver. Hence 
> kept in 2 separate patch.
Don't explain the obvious but address the comment. I am going to repeat
since you just respond whatever:

This makes no sense as independent patch. First you remove
users of it making it redundant... and then you remove it? No.

Best regards,
Krzysztof