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: <c3d2d8b307f7e11b7a2be751673220049b9a1a77.camel@gmail.com>
Date:   Mon, 05 Sep 2022 18:27:03 +0200
From:   Bean Huo <huobean@...il.com>
To:     Asutosh Das <quic_asutoshd@...cinc.com>, quic_nguyenb@...cinc.com,
        quic_xiaosenh@...cinc.com, stanley.chu@...iatek.com,
        adrian.hunter@...el.com, bvanassche@....org, avri.altman@....com,
        mani@...nel.org, quic_cang@...cinc.com, beanhuo@...ron.com,
        martin.petersen@...cle.com, linux-scsi@...r.kernel.org
Cc:     linux-arm-msm@...r.kernel.org,
        Alim Akhtar <alim.akhtar@...sung.com>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
        Jinyoung Choi <j-young.choi@...sung.com>,
        Kiwoong Kim <kwmad.kim@...sung.com>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH v3 2/4] ufs: core: mcq: Adds Multi-Circular Queue
 support

On Fri, 2022-09-02 at 15:41 -0700, Asutosh Das wrote:
> 
> +
> +static void ufshcd_mcq_config_nr_queues(struct ufs_hba *hba)
> +{
> +       int i, rem;
> +       u32 hbaq_cap, cmp;
> +       struct Scsi_Host *host = hba->host;
> +
> +       hbaq_cap = hba->mcq_capabilities & 0xff;
> +
> +       rem = hbaq_cap - dev_cmd_queue;
> +       /* min() compares variables of same type */
> +       hba->nr_queues[HCTX_TYPE_DEFAULT] = min(hbaq_cap -
> dev_cmd_queue,

 hba->nr_queues[HCTX_TYPE_DEFAULT] = min(rem, num_possible_cpus());

> +                                               num_possible_cpus());
> +       rem -= hba->nr_queues[HCTX_TYPE_DEFAULT];
> +       if (rem <= 0)
> +               goto out;
> +       cmp = rem;
> +       hba->nr_queues[HCTX_TYPE_POLL] = min(cmp, poll_queues);
> +       rem -= hba->nr_queues[HCTX_TYPE_POLL];
> +       if (rem <= 0)
> +               goto out;
> +       cmp = rem;
> +       hba->nr_queues[HCTX_TYPE_READ] = min(cmp, read_queues);

static read_queues is not initialized.

> 
.....
> +static inline void ufshcd_inc_tp(struct ufs_hw_queue *q)
> +{
> +       u32 mask = q->max_entries - 1;
> +       u32 val;
> +
> +       q->sq_tp_slot = (q->sq_tp_slot + 1) & mask;
> +       val = q->sq_tp_slot * sizeof(struct utp_transfer_req_desc);
> +       writel(val, q->mcq_sq_tp);
> +}

This function just accesses the submission queue tail pointer. The
function name should clearly explain this.




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ