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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 23 Feb 2023 18:49:59 +0800
From:   Ziqi Chen <quic_ziqichen@...cinc.com>
To:     Po-Wen Kao <powen.kao@...iatek.com>, <linux-scsi@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-mediatek@...ts.infradead.org>,
        Alim Akhtar <alim.akhtar@...sung.com>,
        Avri Altman <avri.altman@....com>,
        Bart Van Assche <bvanassche@....org>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        <quic_ziqichen@...cinc.com>
CC:     <wsd_upstream@...iatek.com>, <peter.wang@...iatek.com>,
        <stanley.chu@...iatek.com>, <alice.chao@...iatek.com>,
        <naomi.chu@...iatek.com>, <chun-hung.wu@...iatek.com>,
        <cc.chou@...iatek.com>, <eddie.huang@...iatek.com>,
        <mason.zhang@...iatek.com>, <chaotian.jing@...iatek.com>,
        <jiajie.hao@...iatek.com>, <quic_cang@...cinc.com>,
        <quic_asutoshd@...cinc.com>
Subject: Re: [PATCH v2 4/7] scsi: ufs: core: Add hwq print for debug


On 2/23/2023 6:14 PM, Ziqi Chen wrote:

> Hi Po-Wen,
>
> On 2/22/2023 11:04 AM, Po-Wen Kao wrote:
>> +void ufshcd_mcq_print_hwqs(struct ufs_hba *hba, unsigned long bitmap)
>> +{
>> +    int id, i;
>> +    char prefix[15];
>> +
>> +    if (!is_mcq_enabled(hba))
>> +        return;
>> +
>> +    for_each_set_bit(id, &bitmap, hba->nr_hw_queues) {
>> +        snprintf(prefix, sizeof(prefix), "q%d SQCFG: ", id);
>> +        ufshcd_hex_dump(prefix,
>> +            hba->mcq_base + MCQ_QCFG_SIZE * id, MCQ_QCFG_SQ_SIZE);
>
> Is your purpose dump per hardware queue registers here?  If yes, why 
> don't use ufsmcq_readl() to save to a buffer and then use 
> ufshcd_hex_dump()
>
> to dump ? Are you sure ufshcd_hex_dump() can dump register directly?
>
>> +
>> +        snprintf(prefix, sizeof(prefix), "q%d CQCFG: ", id);
>> +        ufshcd_hex_dump(prefix,
>> +            hba->mcq_base + MCQ_QCFG_SIZE * id + MCQ_QCFG_SQ_SIZE, 
>> MCQ_QCFG_CQ_SIZE);
> Same to above comment.
>> +
>> +        for (i = 0; i < OPR_MAX ; i++) {
>> +            snprintf(prefix, sizeof(prefix), "q%d OPR%d: ", id, i);
>> +            ufshcd_hex_dump(prefix, mcq_opr_base(hba, i, id), 
>> mcq_opr_size[i]);
> Same.
>> +        }
>> +    }
>> +}
>> +
>>
>>   @@ -574,7 +569,16 @@ void ufshcd_print_trs(struct ufs_hba *hba, 
>> unsigned long bitmap, bool pr_prdt)
>>           if (pr_prdt)
>>               ufshcd_hex_dump("UPIU PRDT: ", lrbp->ucd_prdt_ptr,
>>                   ufshcd_sg_entry_size(hba) * prdt_length);
>> +
>> +        if (is_mcq_enabled(hba)) {
>> +            cmd = lrbp->cmd;
>> +            if (!cmd)
>> +                return;
>> +            hwq = ufshcd_mcq_req_to_hwq(hba, scsi_cmd_to_rq(cmd));
>> +            ufshcd_mcq_print_hwqs(hba, 1 << hwq->id);
>
> Calling registers dump function in ufshcd_print_trs() is not 
> reasonable, eg.. for each aborted request, it would print out all hwq 
> registers, it's not make sense.
>
> I think we should move it out of ufshcd_print_trs().

One more thing,  ufshcd_err_handler() pass hba-> outstanding_reqs to 
ufshcd_print_trs() as the 2nd parameter, but the hba-> outstanding_reqs 
is not used in MCQ mode.

I am making a change to print trs for MCQ mode by trying to get bitmap 
of started Reqs from block layer .

My opinion is keeping ufshcd_print_trs just print UPIU details , don't 
invoke register dump.

>
>> +        }
>>       }
>> +
>>   }
>
>
> Best Regards,
>
> Ziqi
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ