* Re: [V2 PATCH 3/4] scsi:stex.c Add reboot support [not found] <5462D62C.50602@gmail.com> @ 2014-11-12 17:27 ` Christoph Hellwig 2014-11-13 10:07 ` Charles Chiou 2014-11-15 1:03 ` Greg Kroah-Hartman 0 siblings, 2 replies; 4+ messages in thread From: Christoph Hellwig @ 2014-11-12 17:27 UTC (permalink / raw) To: Charles Chiou Cc: JBottomley, linux-kernel, linux-scsi, Greg Kroah-Hartman, linux-pm > +static int stex_reboot_callback(struct notifier_block *self, > + unsigned long val, > + void *data) > +{ > + if (val == SYS_RESTART) > + isRestart = 1; > + return NOTIFY_OK; > +} > > @@ -1832,7 +1859,14 @@ static void stex_shutdown(struct pci_dev *pdev) > { > struct st_hba *hba = pci_get_drvdata(pdev); > > - stex_hba_stop(hba); > + if (hba->yellowstone == 1) > + stex_hba_stop(hba, ST_IGNORED); > + else { > + if (isRestart) > + stex_hba_stop(hba, ST_S6); > + else > + stex_hba_stop(hba, ST_S5); > + } This sort of check for reboot vs restart isn't really something we want in drivers. I don't really know how we could find this out assuming we even want drivers to behave differently. Maybe Greg or someone on lkml has an idea how to best handle this case. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [V2 PATCH 3/4] scsi:stex.c Add reboot support 2014-11-12 17:27 ` [V2 PATCH 3/4] scsi:stex.c Add reboot support Christoph Hellwig @ 2014-11-13 10:07 ` Charles Chiou 2014-11-14 2:23 ` Charles Chiou 2014-11-15 1:03 ` Greg Kroah-Hartman 1 sibling, 1 reply; 4+ messages in thread From: Charles Chiou @ 2014-11-13 10:07 UTC (permalink / raw) To: Christoph Hellwig, linux-scsi, linux-kernel; +Cc: JBottomley, linux-pm On 11/13/2014 01:27 AM, Christoph Hellwig wrote: >> +static int stex_reboot_callback(struct notifier_block *self, >> + unsigned long val, >> + void *data) >> +{ >> + if (val == SYS_RESTART) >> + isRestart = 1; >> + return NOTIFY_OK; >> +} >> >> @@ -1832,7 +1859,14 @@ static void stex_shutdown(struct pci_dev *pdev) >> { >> struct st_hba *hba = pci_get_drvdata(pdev); >> >> - stex_hba_stop(hba); >> + if (hba->yellowstone == 1) >> + stex_hba_stop(hba, ST_IGNORED); >> + else { >> + if (isRestart) >> + stex_hba_stop(hba, ST_S6); >> + else >> + stex_hba_stop(hba, ST_S5); >> + } > > This sort of check for reboot vs restart isn't really something > we want in drivers. I don't really know how we could find this > out assuming we even want drivers to behave differently. > > Maybe Greg or someone on lkml has an idea how to best handle this case. > I have no idea to distinguish OS is going to reboot or shut down without this approach. I'll try to find it out. Charles ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [V2 PATCH 3/4] scsi:stex.c Add reboot support 2014-11-13 10:07 ` Charles Chiou @ 2014-11-14 2:23 ` Charles Chiou 0 siblings, 0 replies; 4+ messages in thread From: Charles Chiou @ 2014-11-14 2:23 UTC (permalink / raw) To: Christoph Hellwig, linux-scsi, linux-kernel; +Cc: JBottomley, linux-pm On 11/13/2014 06:07 PM, Charles Chiou wrote: > > > On 11/13/2014 01:27 AM, Christoph Hellwig wrote: >>> +static int stex_reboot_callback(struct notifier_block *self, >>> + unsigned long val, >>> + void *data) >>> +{ >>> + if (val == SYS_RESTART) >>> + isRestart = 1; >>> + return NOTIFY_OK; >>> +} >>> >>> @@ -1832,7 +1859,14 @@ static void stex_shutdown(struct pci_dev *pdev) >>> { >>> struct st_hba *hba = pci_get_drvdata(pdev); >>> >>> - stex_hba_stop(hba); >>> + if (hba->yellowstone == 1) >>> + stex_hba_stop(hba, ST_IGNORED); >>> + else { >>> + if (isRestart) >>> + stex_hba_stop(hba, ST_S6); >>> + else >>> + stex_hba_stop(hba, ST_S5); >>> + } >> >> This sort of check for reboot vs restart isn't really something >> we want in drivers. I don't really know how we could find this >> out assuming we even want drivers to behave differently. >> >> Maybe Greg or someone on lkml has an idea how to best handle this case. Hi, we don't attempt to check for restart vs reboot, sorry for confusing. When host is going to restart/reboot, Pegasus need to restart too. Pegasus use same flow for restart and reboot. Maybe I could change variable name "isRestart" to "isReboot"? ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [V2 PATCH 3/4] scsi:stex.c Add reboot support 2014-11-12 17:27 ` [V2 PATCH 3/4] scsi:stex.c Add reboot support Christoph Hellwig 2014-11-13 10:07 ` Charles Chiou @ 2014-11-15 1:03 ` Greg Kroah-Hartman 1 sibling, 0 replies; 4+ messages in thread From: Greg Kroah-Hartman @ 2014-11-15 1:03 UTC (permalink / raw) To: Christoph Hellwig Cc: Charles Chiou, JBottomley, linux-kernel, linux-scsi, linux-pm On Wed, Nov 12, 2014 at 09:27:50AM -0800, Christoph Hellwig wrote: > > +static int stex_reboot_callback(struct notifier_block *self, > > + unsigned long val, > > + void *data) > > +{ > > + if (val == SYS_RESTART) > > + isRestart = 1; > > + return NOTIFY_OK; > > +} > > > > @@ -1832,7 +1859,14 @@ static void stex_shutdown(struct pci_dev *pdev) > > { > > struct st_hba *hba = pci_get_drvdata(pdev); > > > > - stex_hba_stop(hba); > > + if (hba->yellowstone == 1) > > + stex_hba_stop(hba, ST_IGNORED); > > + else { > > + if (isRestart) > > + stex_hba_stop(hba, ST_S6); > > + else > > + stex_hba_stop(hba, ST_S5); > > + } > > This sort of check for reboot vs restart isn't really something > we want in drivers. I don't really know how we could find this > out assuming we even want drivers to behave differently. > > Maybe Greg or someone on lkml has an idea how to best handle this case. What is "this case"? And yes, I agree, we shouldn't care, in drivers, about reboot vs. restart, as they should both be the same thing, along with "disconnect", right? thanks, greg k-h ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-11-15 1:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <5462D62C.50602@gmail.com>
2014-11-12 17:27 ` [V2 PATCH 3/4] scsi:stex.c Add reboot support Christoph Hellwig
2014-11-13 10:07 ` Charles Chiou
2014-11-14 2:23 ` Charles Chiou
2014-11-15 1:03 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).