Message ID | cover.1668022680.git.quic_asutoshd@quicinc.com |
---|---|
Headers | show |
Series | Add Multi Circular Queue Support | expand |
On 11/9/22 11:41, Asutosh Das wrote: > The code to parse the extended feature is duplicated twice > in the ufs core. Replace the duplicated code with a > function. Reviewed-by: Bart Van Assche <bvanassche@acm.org>
On 11/9/22 11:41, Asutosh Das wrote: > +/* UFSHC 4.0 compliant HC support this mode, refer param_set_mcq_mode() */ > +static bool mcq_mode = true; Please rename both the variable and the kernel module parameter "mcq_mode" into "use_mcq_mode". > +module_param_cb(mcq_mode, &mcq_mode_ops, &mcq_mode, 0644); > +MODULE_PARM_DESC(mcq_mode, "Disable MCQ mode for UFSHCI 4.0 controllers"); The description of this parameter is confusing since it suggests that setting this parameter to 1 disables MCQ mode. Thanks, Bart.
On 11/9/22 11:41, Asutosh Das wrote: > + /* Manually allocate MCQ resource from ufs_mem */ Manually -> explicitly? The meaning of "manually" is "by hand and not by machine". Software is always executed by a CPU (machine) so nothing happens manually in software. > + ret = insert_resource(&iomem_resource, res_mcq); > + if (ret) { > + dev_err(hba->dev, "Failed to insert MCQ resource, err=%d\n", > + ret); > + devm_kfree(hba->dev, res_mcq); > + return ret; > + } > + > + res->base = devm_ioremap_resource(hba->dev, res_mcq); > + if (IS_ERR(res->base)) { > + dev_err(hba->dev, "MCQ registers mapping failed, err=%d\n", > + (int)PTR_ERR(res->base)); > + ret = PTR_ERR(res->base); > + res->base = NULL; > + remove_resource(res_mcq); > + devm_kfree(hba->dev, res_mcq); > + return ret; > + } I see duplicated code in error paths. Please move the code for freeing resources past the "return 0" statement and use goto statements to jump to that code in case of an error. Thanks, Bart.