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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham 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 2A12CC31E49 for ; Wed, 19 Jun 2019 10:16:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EF0CA206E0 for ; Wed, 19 Jun 2019 10:16:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726826AbfFSKQJ (ORCPT ); Wed, 19 Jun 2019 06:16:09 -0400 Received: from mga12.intel.com ([192.55.52.136]:61885 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726479AbfFSKQJ (ORCPT ); Wed, 19 Jun 2019 06:16:09 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jun 2019 03:16:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,392,1557212400"; d="scan'208";a="181606423" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by fmsmga001.fm.intel.com with SMTP; 19 Jun 2019 03:16:05 -0700 Received: by lahna (sSMTP sendmail emulation); Wed, 19 Jun 2019 13:16:04 +0300 Date: Wed, 19 Jun 2019 13:16:04 +0300 From: Mika Westerberg To: Ard Biesheuvel Cc: linux-spi@vger.kernel.org, broonie@kernel.org, kbuild test robot , Dan Carpenter , andy.shevchenko@gmail.com, masahisa.kojima@linaro.org, "Rafael J. Wysocki" , Jarkko Nikula , linux-acpi@vger.kernel.org, Lukas Wunner Subject: Re: [PATCH] spi/acpi: fix incorrect ACPI parent check Message-ID: <20190619101604.GR2640@lahna.fi.intel.com> References: <20190619095254.19559-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190619095254.19559-1-ard.biesheuvel@linaro.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Wed, Jun 19, 2019 at 11:52:54AM +0200, Ard Biesheuvel wrote: > The ACPI device object parsing code for SPI slaves enumerates the > entire ACPI namespace to look for devices that refer to the master > in question via the 'resource_source' field in the 'SPISerialBus' > resource. If that field does not refer to a valid ACPI device or > if it refers to the wrong SPI master, we should disregard the > device. > > Current, the valid device check is wrong, since it gets the > polarity of 'status' wrong. This could cause issues if the > 'resource_source' field is bogus but parent_handle happens to > refer to the correct master (which is not entirely imaginary > since this code runs in a loop) > > So test for ACPI_FAILURE() instead, to make the code more > self explanatory. > > Fixes: 4c3c59544f33 ("spi/acpi: enumerate all SPI slaves in the namespace") > Reported-by: kbuild test robot > Reported-by: Dan Carpenter > Cc: Mika Westerberg Acked-by: Mika Westerberg