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]
Date:	Wed, 4 Mar 2015 22:50:52 +0900
From:	Akinobu Mita <akinobu.mita@...il.com>
To:	Gilad Broner <gbroner@...eaurora.org>
Cc:	Jej B <James.Bottomley@...senpartnership.com>,
	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>,
	Yaniv Gardi <ygardi@...eaurora.org>,
	Dolev Raviv <draviv@...eaurora.org>,
	Sujit Reddy Thumma <sthumma@...eaurora.org>,
	Vinayak Holikatti <vinholikatti@...il.com>,
	"James E.J. Bottomley" <JBottomley@...allels.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"David S. Miller" <davem@...emloft.net>,
	Ingo Molnar <mingo@...nel.org>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Davidlohr Bueso <davidlohr@...com>,
	Andi Kleen <ak@...ux.intel.com>,
	Alexei Starovoitov <ast@...mgrid.com>,
	Joonsoo Kim <iamjoonsoo.kim@....com>,
	Al Viro <viro@...iv.linux.org.uk>,
	Dan Streetman <ddstreet@...e.org>
Subject: Re: [PATCH v4 4/4] scsi: ufs: inject errors to verify error handling

2015-03-02 23:56 GMT+09:00 Gilad Broner <gbroner@...eaurora.org>:
> From: Sujit Reddy Thumma <sthumma@...eaurora.org>
>
> Use fault-injection framework to simulate error conditions
> in the controller and verify error handling mechanisms
> implemented in UFS host controller driver.
>
> This is used only during development and hence
> guarded by CONFIG_UFS_FAULT_INJECTION debug config option.

This feature looks useful, but I have a couple of comments and
question.

> +static bool inject_cmd_hang_tr(struct ufs_hba *hba)
> +{
> +       int tag;
> +
> +       tag = find_first_bit(&hba->outstanding_reqs, hba->nutrs);
> +       if (tag == hba->nutrs)
> +               return 0;
> +
> +       __clear_bit(tag, &hba->outstanding_reqs);
> +       hba->lrb[tag].cmd = NULL;
> +       __clear_bit(tag, &hba->lrb_in_use);

hba->lrb_in_use is a bitmap set by test_and_set_bit_lock().  So
this should be cleared by clear_bit_unlock().

And as soon as the bit corresponds to this slot in hba->lrb_in_use is
cleared, this slot could be reused.  But if the request corresponds
to the slot is not completed yet, it could sacrifice the new request,
too.  So should we only inject into the commands which have been
completed like this?

        tr_doorbell = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL);
        completed_reqs = tr_doorbell ^ hba->outstanding_reqs;
        tag = find_first_bit(&completed_reqs, hba->nutrs);
        ...

Or clear the corresponding bit in REG_UTP_TASK_REQ_LIST_CLEAR, just
like what inject_fatal_err_tr() does?

> +
> +       /* command hang injected */
> +       return 1;
> +}
> +
> +static int inject_cmd_hang_tm(struct ufs_hba *hba)
> +{
> +       int tag;
> +
> +       tag = find_first_bit(&hba->outstanding_tasks, hba->nutmrs);
> +       if (tag == hba->nutmrs)
> +               return 0;
> +
> +       __clear_bit(tag, &hba->outstanding_tasks);
> +       __clear_bit(tag, &hba->tm_slots_in_use);
> +
> +       /* command hang injected */
> +       return 1;
> +}

The same goes for hba->tm_slots_in_use.
--
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