From patchwork Thu Jan 16 23:16:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 233677 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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 2224EC33CB3 for ; Thu, 16 Jan 2020 23:47:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EAF1A2064C for ; Thu, 16 Jan 2020 23:47:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579218460; bh=98cRC04yURKjGE1BkLFvLk6G387leR2Q90ANMDBQl5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=UMl+APiZMJY6CsC1UWqzzYNMjoQFrKCrTYac9fKTVFEcLtuBtSMJJxGabCa4WagF0 LzM7hrjejI9obG3qwHK0+SBYFv1FxLvUBfPJFMn7KpHiiARcs/hDTKA2IJxQdTxvuQ K5iGO/SE2KdNsHGJa9WtV2S4GcbeQAONTjvgpkl4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732782AbgAPXrf (ORCPT ); Thu, 16 Jan 2020 18:47:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:47586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390727AbgAPXUs (ORCPT ); Thu, 16 Jan 2020 18:20:48 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DE9492072B; Thu, 16 Jan 2020 23:20:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579216848; bh=98cRC04yURKjGE1BkLFvLk6G387leR2Q90ANMDBQl5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yQsWHzJXt1rHLoRYLKrv2DJ8E/lfKwqoLx4oI+ND/6YkW1Wufue5FlG84LY03belr eQfBEMuuDNAqVds23W8x1PolB0qhtGYhlKRihH0mi1MvPMZoP2AH/7WkWS6rbTyMoX RSDGQDG3FIJvVLe86GhCLguI+pU2tIzPrL50bzIQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Fainelli , Philipp Zabel Subject: [PATCH 5.4 044/203] reset: brcmstb: Remove resource checks Date: Fri, 17 Jan 2020 00:16:01 +0100 Message-Id: <20200116231747.854191375@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231745.218684830@linuxfoundation.org> References: <20200116231745.218684830@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Florian Fainelli commit ce89d8d3a70fa530e16f0b0f8994385a214cd0c0 upstream. The use of IS_ALIGNED() is incorrect, the typical resource we pass looks like this: start: 0x8404318, size: 0x30. When using IS_ALIGNED() we will get the following 0x8404318 & (0x18 - 1) = 0x10 which is definitively not equal to 0, same goes with the size. These two checks would make the driver fail probing. Remove the resource checks, since there should be no constraint on the base addresse or size. Fixes: 77750bc089e4 ("reset: Add Broadcom STB SW_INIT reset controller driver") Signed-off-by: Florian Fainelli Signed-off-by: Philipp Zabel Signed-off-by: Greg Kroah-Hartman --- drivers/reset/reset-brcmstb.c | 6 ------ 1 file changed, 6 deletions(-) --- a/drivers/reset/reset-brcmstb.c +++ b/drivers/reset/reset-brcmstb.c @@ -91,12 +91,6 @@ static int brcmstb_reset_probe(struct pl return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!IS_ALIGNED(res->start, SW_INIT_BANK_SIZE) || - !IS_ALIGNED(resource_size(res), SW_INIT_BANK_SIZE)) { - dev_err(kdev, "incorrect register range\n"); - return -EINVAL; - } - priv->base = devm_ioremap_resource(kdev, res); if (IS_ERR(priv->base)) return PTR_ERR(priv->base);