From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751340AbcFATFe (ORCPT ); Wed, 1 Jun 2016 15:05:34 -0400 Received: from mail-it0-f45.google.com ([209.85.214.45]:36549 "EHLO mail-it0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750850AbcFATFc (ORCPT ); Wed, 1 Jun 2016 15:05:32 -0400 X-Greylist: delayed 417 seconds by postgrey-1.27 at vger.kernel.org; Wed, 01 Jun 2016 15:05:32 EDT MIME-Version: 1.0 In-Reply-To: <1464505484-3661-2-git-send-email-wens@csie.org> References: <1464505484-3661-1-git-send-email-wens@csie.org> <1464505484-3661-2-git-send-email-wens@csie.org> Date: Wed, 1 Jun 2016 11:58:34 -0700 Message-ID: Subject: Re: [PATCH 1/3] mmc: fix mmc mode selection for HS-DDR and higher From: Bjorn Andersson To: Chen-Yu Tsai Cc: Ulf Hansson , Maxime Ripard , Hans de Goede , linux-mmc , linux-arm-kernel@lists.infradead.org, lkml , Arnd Bergmann Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 29, 2016 at 12:04 AM, Chen-Yu Tsai wrote: > When IS_ERR_VALUE was removed from the mmc core code, it was replaced > with a simple not-zero check. This does not work, as the value checked > is the return value for mmc_select_bus_width, which returns the set > bit width on success. This made eMMC modes higher than HS-DDR unusable. > > Fix this by checking for a positive return value instead. mmc_select_bus_width() can return 0 on "success" as well and the previous check was !IS_ERR_VALUE(err), which coverts that. So I believe these checks should be for err >= 0 rather than just > 0. Either way this fixes the boot failures seen on my Qualcomm based boards with v4.7-rc1. Regards, Bjorn From mboxrd@z Thu Jan 1 00:00:00 1970 From: bjorn.andersson@linaro.org (Bjorn Andersson) Date: Wed, 1 Jun 2016 11:58:34 -0700 Subject: [PATCH 1/3] mmc: fix mmc mode selection for HS-DDR and higher In-Reply-To: <1464505484-3661-2-git-send-email-wens@csie.org> References: <1464505484-3661-1-git-send-email-wens@csie.org> <1464505484-3661-2-git-send-email-wens@csie.org> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Sun, May 29, 2016 at 12:04 AM, Chen-Yu Tsai wrote: > When IS_ERR_VALUE was removed from the mmc core code, it was replaced > with a simple not-zero check. This does not work, as the value checked > is the return value for mmc_select_bus_width, which returns the set > bit width on success. This made eMMC modes higher than HS-DDR unusable. > > Fix this by checking for a positive return value instead. mmc_select_bus_width() can return 0 on "success" as well and the previous check was !IS_ERR_VALUE(err), which coverts that. So I believe these checks should be for err >= 0 rather than just > 0. Either way this fixes the boot failures seen on my Qualcomm based boards with v4.7-rc1. Regards, Bjorn