All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Bryn M. Reeves" <bmr@redhat.com>
To: loody <miloody@gmail.com>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	SCSI development list <linux-scsi@vger.kernel.org>
Subject: Re: dummy scsi read or scsi command periodically for external USB Hard Disk
Date: Mon, 7 Jul 2014 10:20:30 +0100	[thread overview]
Message-ID: <20140707092029.GA19630@localhost.localdomain> (raw)
In-Reply-To: <CANudz+sYkDthT9-xpt_hdqXHj+pSeTR5UcNmsPa4uP+YCvzSiw@mail.gmail.com>

On Sun, Jul 06, 2014 at 01:18:03AM +0800, loody wrote:
> hi all:
>     we met a USB Hard Disk that will go to suspend if host stop
> sending scsi command over 5mins.
>     To save the IO, kernel will keep the file in page cache as much as
> he can and under this circumstances, the scsi command may disappear
> for a while longer enough to cause the device suspend.
> 
>     is there any kernel config or module parameter can do the dummy
> read or scsi command periodically?

No but you could set up a simple cron job to call an sg3_utils command.

E.g. issue an sg_read for one sector to the device every 4m:

  */4 * * * * sg_read count=1 if=/dev/<disk>

You'll probably want to disable mail notification for the job or have
it dropped or it'll get a bit noisy running that frequently.

Regards,
Bryn.


  reply	other threads:[~2014-07-07  9:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-05 17:18 dummy scsi read or scsi command periodically for external USB Hard Disk loody
2014-07-07  9:20 ` Bryn M. Reeves [this message]
2014-07-07 14:37   ` loody
2014-07-07 14:59     ` Lars Melin
     [not found]       ` <53BAB5DF.5090606-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-07-07 15:06         ` David Laight
2014-07-07 15:39           ` loody
     [not found]             ` <CANudz+uOS3VVyz6FcHoui8z678R6Xc0CQrdqFRdS5NyfCB59Zw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-07 15:51               ` Lars Melin
2014-07-07 15:52             ` Bryn M. Reeves
     [not found]               ` <20140707155233.GD19630-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2014-07-07 16:15                 ` loody
     [not found]                   ` <CANudz+s8R3AnxEJ229EwAOOxEk2WZUjMjoE3rwdRM1YM5ZO=og-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-07 16:25                     ` Bryn M. Reeves
2014-07-09 14:15                       ` loody
2014-07-07 15:54     ` Alan Stern
     [not found]       ` <Pine.LNX.4.44L0.1407071147130.871-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2014-07-07 16:13         ` loody
2014-07-07 17:02           ` Alan Stern
     [not found]             ` <Pine.LNX.4.44L0.1407071258360.871-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2014-07-08 14:58               ` loody
     [not found]                 ` <CANudz+uRd3tRfPN-Fqcj5sSW-xkRSN-gERBP7HhUY_s5gEALbg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-08 16:00                   ` Alan Stern
     [not found]                     ` <Pine.LNX.4.44L0.1407081149280.1283-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2014-07-08 19:04                       ` loody
2014-07-08 19:26                         ` Alan Stern
2014-07-09  3:17                           ` loody
2014-07-09  8:37                             ` David Laight
2014-07-09 13:27                               ` loody
     [not found]                                 ` <CANudz+tQ4pJFmLTRsHtL=VjuCg30Af+7CpK1qRQM5TwwShoQtA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-09 14:25                                   ` Alan Stern
2014-07-09 14:19                             ` Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140707092029.GA19630@localhost.localdomain \
    --to=bmr@redhat.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=miloody@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.