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: <CAC5umyhByqXLUNfivzduKcYOzDV3Jquy4qZetpj5-cHnW+aWVQ@mail.gmail.com>
Date:	Tue, 19 May 2015 23:26:58 +0900
From:	Akinobu Mita <akinobu.mita@...il.com>
To:	Yaniv Gardi <ygardi@...eaurora.org>
Cc:	Jej B <James.Bottomley@...senpartnership.com>,
	Christoph Hellwig <hch@...radead.org>,
	LKML <linux-kernel@...r.kernel.org>,
	"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
	linux-arm-msm@...r.kernel.org, Santosh Y <santoshsy@...il.com>,
	linux-scsi-owner@...r.kernel.org,
	Subhash Jadavani <subhashj@...eaurora.org>,
	dovl@...eaurora.org, Dolev Raviv <draviv@...eaurora.org>,
	Vinayak Holikatti <vinholikatti@...il.com>,
	"James E.J. Bottomley" <JBottomley@...n.com>
Subject: Re: [PATCH v1 03/10] scsi: ufs: provide a quirk to disable the LCC

2015-05-18 0:54 GMT+09:00 Yaniv Gardi <ygardi@...eaurora.org>:
> LCC (Line Control Command) are being used for communication between
> UFS host and UFS device.
> New commercial UFS devices don't have the issues with LCC processing
> but UFS host controller might still have the issue with LCC processing,
> hence, added a routine to disable TX LCC on the device.
>
> Signed-off-by: Yaniv Gardi <ygardi@...eaurora.org>
>
> ---
>  drivers/scsi/ufs/ufshcd.c | 42 ++++++++++++++++++++++++++++++++++++++++++
>  drivers/scsi/ufs/ufshcd.h |  8 ++++++++
>  drivers/scsi/ufs/ufshci.h |  3 +++
>  3 files changed, 53 insertions(+)
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 9641bcb..3e57cca 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -2640,6 +2640,42 @@ static int ufshcd_hba_enable(struct ufs_hba *hba)
>         return 0;
>  }
>
> +static int ufshcd_disable_tx_lcc(struct ufs_hba *hba, bool peer)
> +{
> +       int tx_lanes, i, err = 0;
> +
> +       if (!peer)
> +               ufshcd_dme_get(hba, UIC_ARG_MIB(PA_CONNECTEDTXDATALANES),
> +                              &tx_lanes);
> +       else
> +               ufshcd_dme_peer_get(hba, UIC_ARG_MIB(PA_CONNECTEDTXDATALANES),
> +                                   &tx_lanes);
> +       for (i = 0; i < tx_lanes; i++) {
> +               if (!peer)
> +                       err = ufshcd_dme_set(hba,
> +                               UIC_ARG_MIB_SEL(TX_LCC_ENABLE,
> +                                       UIC_ARG_MPHY_TX_GEN_SEL_INDEX(i)),
> +                                       0);
> +               else
> +                       err = ufshcd_dme_peer_set(hba,
> +                               UIC_ARG_MIB_SEL(TX_LCC_ENABLE,
> +                                       UIC_ARG_MPHY_TX_GEN_SEL_INDEX(i)),
> +                                       0);

You can reduce duplication by:

        err = ufshcd_dme_set_attr(hba, UIC_ARG_MIB_SEL(TX_LCC_ENABLE,
                                        UIC_ARG_MPHY_TX_GEN_SEL_INDEX(i)),
                                ATTR_SET_NOR, 0, peer ? DME_PEER : DME_LOCAL);

> +               if (err) {
> +                       dev_err(hba->dev, "%s: TX LCC Disable failed, peer = %d, lane = %d, err = %d",
> +                               __func__, peer, i, err);

'\n' is missing in format string.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ