Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1556354

Re: [PATCHv3 3/8] rtc: add STM32 RTC driver

From Amelie DELAUNAY <amelie.delaunay@st.com>
Newsgroups linux.kernel
Subject Re: [PATCHv3 3/8] rtc: add STM32 RTC driver
Date 2017-01-11 11:10 +0100
Message-ID <sYo0V-5B1-3@gated-at.bofh.it> (permalink)
References <sWgAx-3JT-9@gated-at.bofh.it> <sWgAy-3JT-29@gated-at.bofh.it> <sYeEh-88l-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Alexandre,

On 01/11/2017 01:08 AM, Alexandre Belloni wrote:
> Looks good to me, however...
>
>
> On 05/01/2017 at 14:43:24 +0100, Amelie Delaunay wrote :
>> +struct stm32_rtc {
>> +	struct rtc_device *rtc_dev;
>> +	void __iomem *base;
>> +	struct clk *ck_rtc;
>> +	spinlock_t lock; /* Protects registers accesses */
>
> This spinlock seems to be useless, the rtc ops_lock is already
> protecting everywhere it is taken.
>
After having a deeper look on ops_lock, it seems this one is sufficient, 
so I'll remove all spinlock uses in this driver.
>> +	int irq_alarm;
>> +};
>> +
>
> [...]
>
>> +static int stm32_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
>> +{
>> +	struct stm32_rtc *rtc = dev_get_drvdata(dev);
>> +	struct rtc_time *tm = &alrm->time;
>> +	unsigned long irqflags;
>> +	unsigned int cr, isr, alrmar;
>> +	int ret = 0;
>> +
>> +	if (rtc_valid_tm(tm)) {
>> +		dev_err(dev, "Alarm time not valid.\n");
>> +		return -EINVAL;
>
> This will never happen, tm is already checked multiple times (up to
> three) in the core before this function can be called.
>
You're right. I'll remove all rtc_valid_tm calls.
>> +	}
>> +
>
> You don't need to resend the whole series, just this patch. I'll take
> 2/8 and 3/8, the other ones can go through the stm32 tree.
>
Thanks for reviewing. I send a v4 for this patch right now.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCHv3 3/8] rtc: add STM32 RTC driver Amelie Delaunay <amelie.delaunay@st.com> - 2017-01-05 14:50 +0100
  Re: [PATCHv3 3/8] rtc: add STM32 RTC driver Mathieu Poirier <mathieu.poirier@linaro.org> - 2017-01-05 18:40 +0100
    Re: [PATCHv3 3/8] rtc: add STM32 RTC driver Amelie DELAUNAY <amelie.delaunay@st.com> - 2017-01-09 17:50 +0100
  Re: [PATCHv3 3/8] rtc: add STM32 RTC driver Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2017-01-11 01:10 +0100
    Re: [PATCHv3 3/8] rtc: add STM32 RTC driver Amelie DELAUNAY <amelie.delaunay@st.com> - 2017-01-11 11:10 +0100
      Re: [PATCHv3 3/8] rtc: add STM32 RTC driver Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2017-01-11 11:20 +0100
        Re: [PATCHv3 3/8] rtc: add STM32 RTC driver Amelie DELAUNAY <amelie.delaunay@st.com> - 2017-01-11 11:50 +0100
          Re: [PATCHv3 3/8] rtc: add STM32 RTC driver Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2017-01-11 12:00 +0100

csiph-web