From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C7A6C76186 for ; Mon, 29 Jul 2019 21:25:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D503E206DD for ; Mon, 29 Jul 2019 21:25:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564435512; bh=KJFm+29xdmh4eMN4D0nGSnJhY+tLmcYbySYne7TR5rk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=nhPZARsYWWCnSxLXyigpY4jX0PPYCv5a6S3iGslmCgp1wK7ta2WfHZj9LUvLpOrcZ tf+EHlh9Pv15hR5D0p5knwMq+LBYqHd1B7eJQAQtcG86h74DqnZiTqXpEbOBoPdjGw /8Emk7hQi15G2vAy7cj87QGCeqROtWjQ6pHwVatk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728960AbfG2VZI (ORCPT ); Mon, 29 Jul 2019 17:25:08 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:34722 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725945AbfG2VZI (ORCPT ); Mon, 29 Jul 2019 17:25:08 -0400 Received: by mail-ot1-f65.google.com with SMTP id n5so64145254otk.1; Mon, 29 Jul 2019 14:25:07 -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=KJFm+29xdmh4eMN4D0nGSnJhY+tLmcYbySYne7TR5rk=; b=e46aDFveK7zG4xYYs0IECKEtaCORx0QzVb1zgQIKbIyChyNJX+s1ihxDVtTARc9SeO n74BbPaT4n/xjKFS4TTfpCVnP4ZnqfPCbSlnqR5/V5DTn1z1bwLk/VegxEcOwAeBYPn4 R0NiP2wC85C8jlWXlBb4P1Tx4AKyMiHc0Lyp8qpiqmNSR2Er5C9eGGnwSGdfxhpZo80d x+pKrkQ79wjKEHyAfju28iN1RWNQXomxtOfHljtf9ocr0azLpgzlEQndDS8rQBoBaAC+ rClZFLIrPnsmea6N6To34jU3HCEruDXWf5MmuTRlO6BLRBvmman4WblxmSmI8GXPZRxs 0fyw== X-Gm-Message-State: APjAAAWw6wE4eXS+Y3bx5EIOKOlycTONZVHUw0N2GbNaemjy0Amwuzi4 ulDegCjaNYTyNAzkYQ3Gf3JKYfg3HwX2qjYktos= X-Google-Smtp-Source: APXvYqwZKJSEHahFNopVUM0XNCLRgSdZ263ULw6EoirQNLdhBkJnGI89d2oNHu1aN8Et/1+cJZJbadg/yjCLAQjxwxI= X-Received: by 2002:a05:6830:1516:: with SMTP id k22mr77695493otp.189.1564435507068; Mon, 29 Jul 2019 14:25:07 -0700 (PDT) MIME-Version: 1.0 References: <2305283.AStDPdUUnE@kreacher> In-Reply-To: From: "Rafael J. Wysocki" Date: Mon, 29 Jul 2019 23:24:56 +0200 Message-ID: Subject: Re: [PATCH v2] driver core: Remove device link creation limitation To: Saravana Kannan Cc: Dmitry Osipenko , "Rafael J. Wysocki" , Greg Kroah-Hartman , LKML , Linux PM , Lukas Wunner , Jon Hunter , Ulf Hansson , Marek Szyprowski , "linux-tegra@vger.kernel.org" , Thierry Reding Content-Type: text/plain; charset="UTF-8" Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Mon, Jul 29, 2019 at 10:47 PM Saravana Kannan wrote: > > Rafael, > > This is the fix you need. Or something link this. > > I had asked you to reject DL_FLAG_MANAGED as an input flag if you are > marking it as internal (in the comments). But looks like you were also > trying to check for "undefined" bit positions. However, the check > isn't correct because DL_MANAGED_FLAGS doesn't include (rightfully so) > DL_FLAG_PM_RUNTIME and DL_FLAG_RPM_ACTIVE . > > I tried to write a DL_FLAG_EXTERNAL to include all the external flags, > but that felt like a maintenance headache that's not worth carrying. I > think it's simpler to just error out when internal flags being passed > in and ignore any undefined bit positions. Well, IMO it is better to prevent people from passing unrecognized flags to device_link_add() at all, even if that means some extra effort when adding new flags. I'll post an alternative fix shortly.