Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp222795ybi; Fri, 7 Jun 2019 07:04:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxw9PQlMQAZMwGcZOBLGCoJGyuTyfjPjFKNGKI5I4WN8aMmUJvubx1976Kwa7WNnpYg2xde X-Received: by 2002:a62:1b85:: with SMTP id b127mr59059648pfb.165.1559916275035; Fri, 07 Jun 2019 07:04:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559916275; cv=none; d=google.com; s=arc-20160816; b=i31gEC2N5840a7CVcRNNitIwLmjvCWMTrK2+HVFVOKA2oO6qbNnwy5ZeA4dmL7P6LC aJBHge7Neyx/TE3Uab2LX0xKUZOZPk1/O0oY3rRHH0qtv+hWH1v38zc1B0Ox5domQ+bS 1NHE+8T5CuapFfNE9sXKQ+ixeep/mffnN3P+MW9wdm+2o7lORCmyqxS69rZpztrGfDHi g4gBekMuMuCzrd8pn6oqP5ZcBlH//xeHM6nMst0LjBa6Z6/knj4vnLDRnwCd9BJeZvw8 YdoM4Hp4NV+V2vCUrSBVPDlSHlSGXWRXvhSJhtwTlTCjWdKDvPvbnTal1SxxgClndF3t /WDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=b41tbY8XQRt7INtfdyIYjwjYCsxyzIoYSZrqkLgUmT4=; b=R77uE/JQiB9Z+jG8c1/FELW1LZhKt3NsXKckQFUGSGaszbD4EsY8NkCJSyDA75oVgz JQpSuKoWo1TgkXzIRmnVQYvVDlpN09mojd7D6UXk05qUv6MRWpssZOxv+XrImzL0V4U+ eCG0+Qu3OfHUEvEx5SIIPBDgYz11iQMr68eHvwLQcwwU7JuMUBc4pUEG6yrpcsKCDIVN v5o7yTkLcrOBf0ZRlxc5AqpWKHO/YDB3XPdKTRwwe7nnt3JVFdBGGfcdqZseL0ygLzNi d3UyQvluLrpPkGeSHFzh952xGPnDm+cMFhSCF4l6WTGq8aGwC1fKLkUxGtFa5AS/9j1I i/TQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o6si1653986pju.19.2019.06.07.07.04.14; Fri, 07 Jun 2019 07:04:35 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728499AbfFGNXW (ORCPT + 99 others); Fri, 7 Jun 2019 09:23:22 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:38895 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728019AbfFGNXV (ORCPT ); Fri, 7 Jun 2019 09:23:21 -0400 Received: by mail-lj1-f193.google.com with SMTP id o13so1723130lji.5; Fri, 07 Jun 2019 06:23:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=b41tbY8XQRt7INtfdyIYjwjYCsxyzIoYSZrqkLgUmT4=; b=PeIu6Zmj8jObSBEUsDqeybAJjfwmnzXY8gzs6oYLucpzvy3I5BaO5j0CzlHIJw7m8H pLMXsJXMQu0vt0nrFZxu+QElKo189OAinShmjKFqhJrOihgl85kJ+8sgzGFHrLnJApvq q7eeM7sSyPZHip/4DtHMGhkq83xpGjxdlfsVF7dfGCKQcZ2vvB+p4bY5vm9i1tlCC4QG 8a1powtL5Slvs0yrp84cBMJ/Aih2vGRg4xX5K5ZtY+kbWerAO5kMRCAt4nyfMtqZOmTA u7tC9GOLQBsj6k8Gf3HZltdkv4zqtHSeUeUwLCrZs8ioouiZeiOdkq5iOUMy0wpUn+sj adSA== X-Gm-Message-State: APjAAAVhIlHs0MnFelo2U9CvVzlTF3OoXdrzuwDAL8OLv1HVo5Re3KdM SO2sSIlfXjBKsN26mebP9CdFAWpVFUz284Imqbg= X-Received: by 2002:a2e:9a87:: with SMTP id p7mr3784285lji.133.1559913799571; Fri, 07 Jun 2019 06:23:19 -0700 (PDT) MIME-Version: 1.0 References: <1559901734-23540-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> In-Reply-To: <1559901734-23540-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> From: Geert Uytterhoeven Date: Fri, 7 Jun 2019 15:23:07 +0200 Message-ID: Subject: Re: [PATCH v2] phy: renesas: rcar-gen3-usb2: fix imbalance powered flag To: Yoshihiro Shimoda Cc: Kishon Vijay Abraham I , Geert Uytterhoeven , Linux Kernel Mailing List , Linux-Renesas Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Shimoda-san, Thanks for the update! On Fri, Jun 7, 2019 at 12:07 PM Yoshihiro Shimoda wrote: > The powered flag should be set for any other phys anyway. Also > the flag should be locked by the channel. Otherwise, after we have > revised the device tree for the usb phy, the following warning > happened during a second system suspend. And if the driver doesn't > lock the flag, enabling the regulator is possible to be imbalance I think it reads better as: ..., an imbalance is possible when enabling the regulator ... > during system resume. So, this patch fixes the issues. > --- a/drivers/phy/renesas/phy-rcar-gen3-usb2.c > +++ b/drivers/phy/renesas/phy-rcar-gen3-usb2.c > @@ -106,6 +107,7 @@ struct rcar_gen3_chan { > struct rcar_gen3_phy rphys[NUM_OF_PHYS]; > struct regulator *vbus; > struct work_struct work; > + struct mutex lock; It is always a good idea to document what is protected by the mutex: struct mutex lock; /* protects rphys[...].powered */ Checkpatch does have a check for this, but unfortunately it is enabled for drivers/net/, net/, and drivers/staging/ only: CHECK: struct mutex definition without comment Reviewed-by: Geert Uytterhoeven and the imbalance is gone: Tested-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds