Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp126961yba; Mon, 20 May 2019 06:09:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwrJSgIHdA0p3AWCZ2uzRx32jHPed0L29gLEFhVHyCoRz/xFQEcZ5PM8mIvznb/kVMpxk1Q X-Received: by 2002:a17:902:9348:: with SMTP id g8mr33221834plp.174.1558357765991; Mon, 20 May 2019 06:09:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558357765; cv=none; d=google.com; s=arc-20160816; b=iyaWflclfQ0kWxH5LwK5+7dlCRvplxs1LUZKoXq56RA62Tj+9cQsfvLQoBYpQ9O56k jE5fxklRlPZUp6zK8oZoye0E6/QO0ccvVmohlsUNVys+6y2CwRm+ylHhbTXbWr3bpMu/ xkxd5zlag1n1u+DTI5WFxhFnutY+Xjf7EuhgTXjKLK1zeRsDh/JBz73pEFUGhNvgsb5P YNksm1FMg2YUAlvm9uUItRwMi/lUfmkHhwugYM5tpOzvPb77R5soWoJAeeF1/Sc4NnWc oOYTk1iSljgkDTvrnT7bWCQ6FGtnn4iqe2q6k8MwRPXEfK6BU/3LccvfbzCg+QzZgOBV 5VqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=ffq7QLSqt8lxuzqwE0DYmijQZyj5qCKC1WuCIEKbV2k=; b=q+WLeKFtKhXASkzDRCCyNzHqBsMX6S6A+/dAp5WbNOLYjjwjMESJ1Q2/sFvdvq36xv Yq1e5/RsJlsEBTRGngAsnQh5GjXy6HeKy+HY4D0+s5fKf3TZbV04DEttgIyFrR3Kcly1 ymZ67v/aWVrp64afTDZJS72alpbOhyMkaFGeCxf31UcPkobggP/ueP12RW8i/PXTmCvn FZSwNGSAIrMfzjP5VtB5fhTB373VXMmPygDaZ94790UYKGkynwD51kS9l0bD06aKna5y nVA+COMmU/H26QcNDH1D2yHhdr3kNqMK41mPXkVDUconsQC6oBYCZDv3C4AbqR2BVRCW e7tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=UDWHQ7jK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s13si11378720pgp.95.2019.05.20.06.09.07; Mon, 20 May 2019 06:09:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=UDWHQ7jK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731708AbfETJDy (ORCPT + 99 others); Mon, 20 May 2019 05:03:54 -0400 Received: from mail-eopbgr10056.outbound.protection.outlook.com ([40.107.1.56]:11406 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727301AbfETJDx (ORCPT ); Mon, 20 May 2019 05:03:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ffq7QLSqt8lxuzqwE0DYmijQZyj5qCKC1WuCIEKbV2k=; b=UDWHQ7jK2dmByIy71dxq2ikbrefNntFq8djUIr+0icqTQxATtn1kvGlT6IuiX/yegsi5qkNDWWK/nYIeo68hlqP6P6i7IEhbpYb2bSh6KuTvSIWuqMyBex9mImpPL7upTzNuYsx1uRjRxHm/O0nwLgS8YuffSEcMY3UJCh+kVBo= Received: from AM5PR0402MB2865.eurprd04.prod.outlook.com (10.175.44.16) by AM5PR0402MB2930.eurprd04.prod.outlook.com (10.175.42.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1900.16; Mon, 20 May 2019 09:03:50 +0000 Received: from AM5PR0402MB2865.eurprd04.prod.outlook.com ([fe80::d8ed:b418:4ee9:a51]) by AM5PR0402MB2865.eurprd04.prod.outlook.com ([fe80::d8ed:b418:4ee9:a51%9]) with mapi id 15.20.1900.020; Mon, 20 May 2019 09:03:50 +0000 From: Ran Wang To: Pavel Machek CC: Leo Li , Rob Herring , Mark Rutland , "Rafael J . Wysocki" , Len Brown , Greg Kroah-Hartman , "linuxppc-dev@lists.ozlabs.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-pm@vger.kernel.org" Subject: RE: [PATCH V2 3/3] soc: fsl: add RCPM driver Thread-Topic: [PATCH V2 3/3] soc: fsl: add RCPM driver Thread-Index: AQHVDGHzIQrvIPzRX0ytn5pxhdLuLqZy/bMAgACX+4CAACV3gIAAANBw Date: Mon, 20 May 2019 09:03:50 +0000 Message-ID: References: <20190517033946.30763-1-ran.wang_1@nxp.com> <20190517033946.30763-3-ran.wang_1@nxp.com> <20190519213844.GH31403@amd> <20190520085647.GA9748@amd> In-Reply-To: <20190520085647.GA9748@amd> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=ran.wang_1@nxp.com; x-originating-ip: [92.121.36.198] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: edb87af5-1522-4d53-33f2-08d6dd02135e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020);SRVR:AM5PR0402MB2930; x-ms-traffictypediagnostic: AM5PR0402MB2930: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2150; x-forefront-prvs: 004395A01C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(366004)(136003)(39860400002)(396003)(199004)(189003)(73956011)(74316002)(256004)(76176011)(8936002)(76116006)(99286004)(7416002)(86362001)(81166006)(81156014)(7696005)(52536014)(6916009)(14454004)(68736007)(7736002)(66946007)(305945005)(25786009)(8676002)(5660300002)(66066001)(4326008)(2906002)(54906003)(486006)(66476007)(476003)(6246003)(71200400001)(66556008)(316002)(102836004)(71190400001)(11346002)(446003)(6506007)(229853002)(3846002)(55016002)(66446008)(53546011)(64756008)(26005)(478600001)(186003)(6436002)(9686003)(6116002)(33656002)(53936002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM5PR0402MB2930;H:AM5PR0402MB2865.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: pT+n75gNk2YCuYp3VQS4NBU/k5rwSjP6ksb/K2FlSi97J2NuCBvQ+MuHrPrYVzHlP3r90ZqLlrVBZ/ULTLEwvdSMYIFJKVbhm+4IiVrH0x3WLcWC1/okWb3C+/m3orau9bkLA/OOu5Nu5luzxid8dvgScWF6mX7PwydhWK1P7lFR5ScyHx3V/sj5v1/qbg9XvytuKeM1ni6WNpUexFdygQ+640HNDq8qT4bjhW3FIXmb94Pye4KCOOp6W8v5y4f3DVDhK5BwSZUjqggu9ioUXarDRjAm55w+/UaOnHzVsHolwWjOGqNN7I10jGEG6URZV0Sr50M3iH+7WLm+rjtLCjvVsZo6jztUgNsRGeor+AcTd4p9dDQs/0kMoGhzvgpK8OU2xR24xXirfgBEmga4SKLWygYOSnWW+Oe2cEnNtfY= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: edb87af5-1522-4d53-33f2-08d6dd02135e X-MS-Exchange-CrossTenant-originalarrivaltime: 20 May 2019 09:03:50.3076 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0402MB2930 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pavel, On Monday, May 20, 2019 16:57, Pavel Machek wrote: >=20 > Hi! >=20 > > > > +static int rcpm_pm_prepare(struct device *dev) { > > > > + struct device_node *np =3D dev->of_node; > > > > + struct wakeup_source *ws; > > > > + struct rcpm *rcpm; > > > > + u32 value[RCPM_WAKEUP_CELL_MAX_SIZE + 1], tmp; > > > > + int i, ret; > > > > + > > > > + rcpm =3D dev_get_drvdata(dev); > > > > + if (!rcpm) > > > > + return -EINVAL; > > > > + > > > > + /* Begin with first registered wakeup source */ > > > > + ws =3D wakeup_source_get_next(NULL); > > > > + while (ws) { > > > > > > while (ws =3D wakeup_source_get_next(NULL)) ? > > > > Actually, we only pass NULL to wakeup_source_get_next() at very first > > call to get 1st wakeup source. Then in the while loop, we will fetch > > next source but not 1st, that's different. I am afraid your suggestion > > is not quite correct. >=20 > Sorry, I seen your next version before seeing this explanation. >=20 > You are right, but the current code is "interesting". What about >=20 > ws =3D NULL; > while (ws =3D wakeup_source_get_next(NULL)) ... >=20 > then? Did you mean: ws =3D NULL; while (ws =3D wakeup_source_get_next(ws)) ... Yes, that will be the same to my original logic, do you recommend to cha= nge to this? :) Regards, Ran