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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F6D8C4332F for ; Thu, 20 Oct 2022 17:55:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229850AbiJTRzS (ORCPT ); Thu, 20 Oct 2022 13:55:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229711AbiJTRzR (ORCPT ); Thu, 20 Oct 2022 13:55:17 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B15AFFF87; Thu, 20 Oct 2022 10:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666288514; x=1697824514; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=VgOcQsFKsb9PTUpe93UzLsTrOEooTIEEIGBTpePY8J4=; b=BK/1+lcLBNorC1BzpbSfcmSphmgoyZDD1g5Y/TrO1xHmzrCJ4bqVxAbr sPDuVXw7hAjl14zcrd6gJpJtOwvY9n9HTZUly4ajNiKTA1IcYtpbsTuJ4 DIYgbfEKhuygka4Nlt+f22F/h3+B41eLy7eBWxPS1Sd/uM9PmZlRCfAK7 0nXcTPKBsJEiTdOOKMIeZPZ5t4UFmWRfydn+XoqPWuc+2sMfZKX/DZA3F 3M2skzH/uxiTs81PW9LAMYRQy6P2oBh5JOpprWgVnreOCyjPaGMZF7Q+n xv1JrQSDvV5dg3rWSLt3oWRkghIQ/AXDWReEArPFH4a10i/FS3ZYz54fV A==; X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="306784525" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="306784525" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2022 10:55:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="719208411" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="719208411" Received: from smile.fi.intel.com ([10.237.72.54]) by FMSMGA003.fm.intel.com with ESMTP; 20 Oct 2022 10:55:03 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1olZl0-00AgDi-0z; Thu, 20 Oct 2022 20:55:02 +0300 Date: Thu, 20 Oct 2022 20:55:02 +0300 From: Andy Shevchenko To: Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Mack , Haojian Zhuang , Robert Jarzmik Subject: Re: [PATCH v1 3/6] spi: pxa2xx: Remove no more needed PCI ID table Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org On Thu, Oct 20, 2022 at 06:45:19PM +0100, Mark Brown wrote: > On Thu, Oct 20, 2022 at 08:41:43PM +0300, Andy Shevchenko wrote: > > > Okay, would it work for you if we check the named resource and only if it's > > found take a property? In such case we can guarantee (AFAICS) that the 3rd > > parties (like unknown firmware) won't mess up with the driver. > > Not sure I quite get what you're proposing here but I *think* so, > assuming you mean checking the values if the property is present (and > error out if the property isn't there at all and you're instantiating > via a MFD rather than direct PCI/DT binding I guess)? When we instantiate via MFD, we (semi-)manually create resources for each of the children. These resources may or may not have a dedicated names. Those names can be given _only_ inside the source code in the kernel, so it means it is _explicit_ telling, that we are know where the device in question comes from. In the code it will be like if (resource_with_name_present()) { ret = device_property_... if (ret) return ERROR "No mandatory property provided"; } Like you said, checking property only when we have resource present _by name_ and bail out if there is none. -- With Best Regards, Andy Shevchenko 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1B100C4332F for ; Thu, 20 Oct 2022 17:56:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cAE12aiAqIqcJfgt/e3j0Ig7jx7qjruZ0LN1bN+PX8o=; b=U3FVofE0g3Sy1W DZgTG7Q/DixTbpnIYR9/MIqfMeLdE9WWSNBuHxSUOEqKXgL6ismO2mRMLDAc0IpQchMDP3PSipaIP Ls/X8pCQCbdTmImoCQUgzwX56oOQ872ijnVkpvl+Y9EMFKH4BKvePHqQ7oqB7HjyPlDZumlzJOYHD YlWB0Zcp8TNepG/WZbFrH+Lj5WENQAieBvWj8ZUoccE89ytKIFLksUZsbQUySjxeHLKEvRNeWRap+ P9ojDLJ4sPdxA98Z7C2l5z/OcmB3milfNHkNhYIWQZuHDWlGOizJbZw4uSTf3iFPg8cgyAU74m56c jKP9M2dZrnnFqqFfGJ8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1olZlQ-000zAm-Ta; Thu, 20 Oct 2022 17:55:29 +0000 Received: from mga14.intel.com ([192.55.52.115]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1olZlO-000z9F-TC for linux-arm-kernel@lists.infradead.org; Thu, 20 Oct 2022 17:55:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666288526; x=1697824526; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=VgOcQsFKsb9PTUpe93UzLsTrOEooTIEEIGBTpePY8J4=; b=TLtHvVk1tacWSfeSl2L1NZaaRvfExGzV1wh6iTTV5DSjAg1ZcJM8amiz wy5/ECwIwy5jaVMeoT03WsL96DaODx3nXHvxcyc9vE6HgSNLmLUCl3T8u POxJiPX62Xdri0cNge2IZcgRojwTlR67okBsGM/PXHYlE1JZOSH8M42S7 X03+e/6d/XlGR0fYyZX8PqOSj8HhyPgiRwHZqqHQP4G5sdFG2l+I1S0di O37d7w4EOqNkDTWv1FoCOmJN7zQ/xZKSng6uaFzL62QImyHOQm5YeK6LR Osm+rpVd6PilOIycCToaOz+GRgmqDzKLwMFWLoEMOBY9/raXOl7z4EIZY Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="306784526" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="306784526" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2022 10:55:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="719208411" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="719208411" Received: from smile.fi.intel.com ([10.237.72.54]) by FMSMGA003.fm.intel.com with ESMTP; 20 Oct 2022 10:55:03 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1olZl0-00AgDi-0z; Thu, 20 Oct 2022 20:55:02 +0300 Date: Thu, 20 Oct 2022 20:55:02 +0300 From: Andy Shevchenko To: Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Mack , Haojian Zhuang , Robert Jarzmik Subject: Re: [PATCH v1 3/6] spi: pxa2xx: Remove no more needed PCI ID table Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221020_105526_983341_0F881428 X-CRM114-Status: GOOD ( 19.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Oct 20, 2022 at 06:45:19PM +0100, Mark Brown wrote: > On Thu, Oct 20, 2022 at 08:41:43PM +0300, Andy Shevchenko wrote: > > > Okay, would it work for you if we check the named resource and only if it's > > found take a property? In such case we can guarantee (AFAICS) that the 3rd > > parties (like unknown firmware) won't mess up with the driver. > > Not sure I quite get what you're proposing here but I *think* so, > assuming you mean checking the values if the property is present (and > error out if the property isn't there at all and you're instantiating > via a MFD rather than direct PCI/DT binding I guess)? When we instantiate via MFD, we (semi-)manually create resources for each of the children. These resources may or may not have a dedicated names. Those names can be given _only_ inside the source code in the kernel, so it means it is _explicit_ telling, that we are know where the device in question comes from. In the code it will be like if (resource_with_name_present()) { ret = device_property_... if (ret) return ERROR "No mandatory property provided"; } Like you said, checking property only when we have resource present _by name_ and bail out if there is none. -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel