Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753743AbbFIIoS (ORCPT ); Tue, 9 Jun 2015 04:44:18 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:51324 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751956AbbFIIoM (ORCPT ); Tue, 9 Jun 2015 04:44:12 -0400 X-AuditID: cbfee68d-f79106d00000728c-a6-5576a75a0a4e Message-id: <5576A75A.5050104@samsung.com> Date: Tue, 09 Jun 2015 17:44:10 +0900 From: Jaehoon Chung User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-version: 1.0 To: Suneel Garapati , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ulf Hansson , michals@xilinx.com, sorenb@xilinx.com, Adrian Hunter , Aisheng Dong , Haibo Chen , Tim Kryger , Shawn Guo , Yi Sun , "Rafael J. Wysocki" , stripathi@apm.com Subject: Re: [PATCH 1/2] drivers: mmc: add quirk SDHCI_QUIRK_CLOCK_DIV_ZERO_BROKEN References: <1433835111-32522-1-git-send-email-suneel.garapati@xilinx.com> <1433835111-32522-2-git-send-email-suneel.garapati@xilinx.com> In-reply-to: <1433835111-32522-2-git-send-email-suneel.garapati@xilinx.com> Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDIsWRmVeSWpSXmKPExsWyRsSkQDdqeVmowbZWVYuTT9awWTzc2c9i ce1IgMXlXXPYLI7872e0+PK0kdHi8Yq37BZP1y1httj4fT2zxZdTKRaPFt5jszh17QuzxfG1 4RYTpy9ic+Dz+Lj+E6PHv8P9TB47Z91l91i85yWTx51re9g8Pm+S89j7+TdLAHsUl01Kak5m WWqRvl0CV8aGfz9YCz7wVRxceIWpgfEPdxcjB4eEgInEgmaDLkZOIFNM4sK99WxdjFwcQgJL GSU2rpnJDpEwkThy5SZUYjqj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QJvFg3V5WiHpBiR+T74HNERHIlvg2/TvYAmaBr0wSC3c8BWsQFgiR +Ld+MjPE5m6gzcdvgnVwCnhLzHs3mbGLkQOoQ11iypRckDCzgLzE5jVvmScwCsxCsmMWQtUs JFULGJlXMYqmFiQXFCel5xrpFSfmFpfmpesl5+duYgQnimfSOxhXNVgcYhTgYFTi4T2hUBYq xJpYVlyZe4hRgoNZSYSXpQsoxJuSWFmVWpQfX1Sak1p8iNEUGAITmaVEk/OBSSyvJN7Q2MTM yNLI3NDCyNhcSZz3ZL5PqJBAemJJanZqakFqEUwfEwenVAPjfJcgxXWi8/TizHIu7f240Z1b 44iSluWO0llaxW1H2wX7bX0OKXetWKLNbCeUGNfhr6fywr2RYVNM62TX/b3mj6x3cb7muHi5 zqB+X9sPhkyzyGq7hh/mDxSVK79y//ZLWDc304r1VOdDnXb2KdrSIu80nj6Rr2vcqSfZvc/a Qq989f/Uu0osxRmJhlrMRcWJAOQsJSUqAwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2093 Lines: 61 Hi, On 06/09/2015 04:31 PM, Suneel Garapati wrote: > adds quirk for controllers whose clock divider zero is broken, > sdhci_set_clock function will incorporate this modification. > > Signed-off-by: Suneel Garapati > --- > drivers/mmc/host/sdhci.c | 4 ++++ > drivers/mmc/host/sdhci.h | 2 ++ > 2 files changed, 6 insertions(+) > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > index 1b4861d..087327e 100644 > --- a/drivers/mmc/host/sdhci.c > +++ b/drivers/mmc/host/sdhci.c > @@ -1210,6 +1210,10 @@ void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) > } > real_div = div; > div >>= 1; > + if ((host->quirks2 & SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN) > + && !div && host->max_clk <= 25000000) { > + div = 1; > + } I can't understand fully. how can it be broken for divider zero? When formatting error is occurred, do you check really clock value? I think your patch looks like just hard-coding for control clock. Best Regards, Jaehoon Chung > } > } else { > /* Version 2.00 divisors must be a power of 2. */ > diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h > index 5521d29..67046ca 100644 > --- a/drivers/mmc/host/sdhci.h > +++ b/drivers/mmc/host/sdhci.h > @@ -409,6 +409,8 @@ struct sdhci_host { > #define SDHCI_QUIRK2_SUPPORT_SINGLE (1<<13) > /* Controller broken with using ACMD23 */ > #define SDHCI_QUIRK2_ACMD23_BROKEN (1<<14) > +/* Broken Clock divider zero in controller */ > +#define SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN (1<<15) > > int irq; /* Device IRQ */ > void __iomem *ioaddr; /* Mapped address */ > -- > 2.1.2 > -- > To unsubscribe from this list: send the line "unsubscribe linux-mmc" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/