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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 6 Nov 2014 18:35:53 +0000
From:	Paul Zimmerman <Paul.Zimmerman@...opsys.com>
To:	"balbi@...com" <balbi@...com>,
	Romain Perier <romain.perier@...il.com>
CC:	Kever Yang <kever.yang@...k-chips.com>,
	Dinh Nguyen <dinguyen@...nsource.altera.com>,
	Heiko Stuebner <heiko@...ech.de>,
	"dianders@...omium.org" <dianders@...omium.org>,
	"sonnyrao@...omium.org" <sonnyrao@...omium.org>,
	"addy.ke@...k-chips.com" <addy.ke@...k-chips.com>,
	Eddie Cai <cf@...k-chips.com>,
	"xjq@...k-chips.com" <xjq@...k-chips.com>,
	"hj@...k-chips.com" <hj@...k-chips.com>,
	"dkl@...k-chips.com" <dkl@...k-chips.com>,
	"huangtao@...k-chips.com" <huangtao@...k-chips.com>,
	"linux-rockchip@...ts.infradead.org" 
	<linux-rockchip@...ts.infradead.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v2] usb: dwc2: add bus suspend/resume for dwc2

> From: Felipe Balbi [mailto:balbi@...com]
> Sent: Thursday, November 06, 2014 9:40 AM
> 
> On Thu, Nov 06, 2014 at 06:21:42PM +0100, Romain Perier wrote:
> >
> > 2014-11-06 2:30 GMT+01:00 Kever Yang <kever.yang@...k-chips.com>:
> > >
> > > +static int _dwc2_hcd_suspend(struct usb_hcd *hcd)
> > > +{
> > > +       struct dwc2_hsotg *hsotg = dwc2_hcd_to_hsotg(hcd);
> > > +       u32 hprt0;
> > > +
> > > +       if (!((hsotg->op_state == OTG_STATE_B_HOST) ||
> > > +               (hsotg->op_state == OTG_STATE_A_HOST)))
> > > +               return 0;
> > > +
> > > +       if (hsotg->lx_state != DWC2_L0)
> > > +               return 0;
> > > +
> > > +       hprt0 = dwc2_read_hprt0(hsotg);
> > > +       if (hprt0 & HPRT0_CONNSTS)
> > > +               dwc2_port_suspend(hsotg, 1);
> > > +
> > > +       return 0;
> > > +}
> > > +
> > > +static int _dwc2_hcd_resume(struct usb_hcd *hcd)
> > > +{
> > > +       struct dwc2_hsotg *hsotg = dwc2_hcd_to_hsotg(hcd);
> > > +       u32 hprt0;
> > > +
> > > +       if (!((hsotg->op_state == OTG_STATE_B_HOST) ||
> > > +               (hsotg->op_state == OTG_STATE_A_HOST)))
> > > +               return 0;
> > > +
> > > +       if (hsotg->lx_state != DWC2_L2)
> > > +               return 0;
> > > +
> > > +       hprt0 = dwc2_read_hprt0(hsotg);
> > > +       if ((hprt0 & HPRT0_CONNSTS) && (hprt0 & HPRT0_SUSP))
> > > +               dwc2_port_resume(hsotg);
> > > +
> > > +       return 0;
> > > +}
> >
> > Could you also define these functions under #ifdef CONFIG_PM ?
> 
> please don't. I'm actually considering ripping all ifdefs from all these
> drivers and also stop using SIMPLE_DEV_PM_OPS or any of its friends.
> 
> There's really nobody today would would build a kernel with CONFIG_PM.

I'm sure Felipe meant *without* CONFIG_PM.

Kever, in that case you should remove the #ifdef CONFIG_PM around the
.bus_suspend and .bus_resume assignments also, otherwise there will be
compiler warnings when built without CONFIG_PM. After that, you can
add my acked-by.

-- 
Paul

--
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