From: Oliver Neukum <oneukum@suse.de>
To: Charles Chiou <ch1102chiou@gmail.com>
Cc: JBottomley@parallels.com, linux-kernel@vger.kernel.org,
linux-scsi@vger.kernel.org, grace.chang@tw.promise.com,
victor.p@promise.com, ed.lin@promise.com
Subject: Re: [V3 PATCH 4/4] scsi:stex.c Add S3/S4 support
Date: Mon, 15 Dec 2014 08:29:51 +0100 [thread overview]
Message-ID: <1418628591.4443.0.camel@linux-0dmf.site> (raw)
In-Reply-To: <548E51AB.1030506@gmail.com>
On Mon, 2014-12-15 at 11:12 +0800, Charles Chiou wrote:
>
> On 12/10/2014 05:02 PM, Oliver Neukum wrote:
> > On Wed, 2014-12-10 at 09:38 +0800, Charles Chiou wrote:
> >> From 91868d4afe10533b8a4496075109e411100217bb Mon Sep 17 00:00:00 2001
> >> From: Charles Chiou <charles.chiou@tw.promise.com>
> >> Date: Fri, 7 Nov 2014 10:15:18 +0800
> >> Subject: [PATCH 4/4] scsi:stex.c Add S3/S4 support
> >>
> >> Add S3/S4 support, add .suspend and .resume function in pci_driver.
> >>
> >> Pegasus need 30~40 seconds to boot up. We don't want to OS wait
> >> in .resume function. Create a thread to handle device boot up.
> >>
> >
> >> +static int stex_resume(struct pci_dev *pdev)
> >> +{
> >> + struct st_hba *hba = pci_get_drvdata(pdev);
> >> + struct hba_handshake_workstruct *hswork;
> >> + int sts;
> >> +
> >> + hba->mu_status = MU_STATE_STARTING;
> >> + hswork = kzalloc(sizeof(struct hba_handshake_workstruct), GFP_KERNEL);
> >
> > The system is coming back from sleep. You cannot swap or page out
> > as disks may still be asleep. GFP_KERNEL is automatically changed
> > to GFP_NOIO. It would be nice to outright use GFP_NOIO.
> >
> >> + INIT_WORK(&hswork->handshake_work, resume_handshake);
> >
> > Memory allocations can fail.
> > I suggest you allocate the memory in suspend(). There you can just
> > return -ENOMEM in the error case.
> >
> >
> Hi Oliver, sorry for the late reply.
>
> Good point, could we move kzalloc function from suspend to probe and
> return -ENOMEM when allocation fail? We can avoid to allocate memory
> again and again in suspend/resume cycles.
Yes, that would work.
Regards
Oliver
prev parent reply other threads:[~2014-12-15 7:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-10 1:38 [V3 PATCH 4/4] scsi:stex.c Add S3/S4 support Charles Chiou
2014-12-10 9:02 ` Oliver Neukum
2014-12-15 3:12 ` Charles Chiou
2014-12-15 7:29 ` Oliver Neukum [this message]
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=1418628591.4443.0.camel@linux-0dmf.site \
--to=oneukum@suse.de \
--cc=JBottomley@parallels.com \
--cc=ch1102chiou@gmail.com \
--cc=ed.lin@promise.com \
--cc=grace.chang@tw.promise.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=victor.p@promise.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.