lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <821e6994-9fed-2c15-6c25-b1761a267ec9@quicinc.com>
Date:   Thu, 9 Mar 2023 14:47:59 -0800
From:   "Bao D. Nguyen" <quic_nguyenb@...cinc.com>
To:     Bart Van Assche <bvanassche@....org>, <quic_asutoshd@...cinc.com>,
        <quic_cang@...cinc.com>, <mani@...nel.org>,
        <stanley.chu@...iatek.com>, <adrian.hunter@...el.com>,
        <beanhuo@...ron.com>, <avri.altman@....com>,
        <martin.petersen@...cle.com>
CC:     <linux-scsi@...r.kernel.org>,
        Alim Akhtar <alim.akhtar@...sung.com>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        Arthur Simchaev <Arthur.Simchaev@....com>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH v2 1/3] ufs: mcq: Add supporting functions for mcq
 abort

On 3/9/2023 10:15 AM, Bart Van Assche wrote:
> On 3/8/23 21:28, Bao D. Nguyen wrote:
>> +static bool ufshcd_mcq_sqe_search(struct ufs_hba *hba,
>> +        struct ufs_hw_queue *hwq, int task_tag)
>> +{
>> +    struct utp_transfer_req_desc *utrd;
>> +    u32 mask = hwq->max_entries - 1;
>> +    bool ret = false;
>> +    u64 addr, match;
>> +    u32 i;
>
> The variable name "i" is usually used for a loop index. In this case 
> it represents a slot in the submission queue. How about renaming "i" 
> into "slot"?
I will make the change.
>
>> +static inline void ufshcd_mcq_update_sq_head_slot(struct 
>> ufs_hw_queue *q)
>> +{
>> +    u32 val = readl(q->mcq_sq_head);
>> +
>> +    q->sq_head_slot = val / sizeof(struct utp_transfer_req_desc);
>> +}
>
> Please modify this function such that it returns the head slot value 
> instead of storing it in a member variable and remove the sq_head_slot 
> member variable. Storing the sq_head_slot value in a member variable 
> seems wrong to me since the value of that variable will be outdated as 
> soon as the submission queue is restarted.
>
I can modify the function that I am introducing in this patch namely 
ufshcd_mcq_update_sq_head_slot() according to your suggestion.
However, to keep the original mcq code consistent with this change, 
should I make the same modifications to these existing functions 
ufshcd_mcq_update_cq_tail_slot(), ufshcd_mcq_update_cq_head() in a 
separate patch and include in this series?

>> +static inline bool ufshcd_mcq_is_sq_empty(struct ufs_hw_queue *q)
>> +{
>> +    return q->sq_head_slot == q->sq_tail_slot;
>> +}
>
> Please remove this function and inline this function into its callers.

Same comment. Should I also update the existing ufshcd_mcq_is_cq_empty() 
in a separate patch together with ufshcd_mcq_update_cq_tail_slot(), 
ufshcd_mcq_update_cq_head() mentioned above?

Thanks,

Bao

>
> Thanks,
>
> Bart.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ