All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suman Anna <s-anna-l0cyMroinI0@public.gmane.org>
To: Ohad Ben-Cohen <ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
Cc: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>,
	Josh Cartwright <joshc-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Bjorn Andersson <bjorn-UYDU3/A3LUY@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-arm
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCHv6 5/5] hwspinlock/omap: add support for dt nodes
Date: Wed, 12 Nov 2014 13:50:15 -0600	[thread overview]
Message-ID: <5463B9F7.8040105@ti.com> (raw)
In-Reply-To: <CAK=WgbZE7_WrsNz5E+MDX7j2tAGEjv91zeCgqhB=Jsiu0+d8vw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi Ohad,

On 11/12/2014 01:14 PM, Ohad Ben-Cohen wrote:
> Hi Suman,
> 
> On Fri, Sep 12, 2014 at 11:24 PM, Suman Anna <s-anna-l0cyMroinI0@public.gmane.org> wrote:
>>  static int omap_hwspinlock_probe(struct platform_device *pdev)
>>  {
>> -       struct hwspinlock_pdata *pdata = pdev->dev.platform_data;
>> +       struct device_node *node = pdev->dev.of_node;
>>         struct hwspinlock_device *bank;
>>         struct hwspinlock *hwlock;
>>         struct resource *res;
>>         void __iomem *io_base;
>> -       int num_locks, i, ret;
>> +       int num_locks, i, ret, base_id;
>>
>> -       if (!pdata)
>> +       if (!node)
>>                 return -ENODEV;
>>
>> +       ret = of_hwspin_lock_get_base_id(node);
>> +       if (ret < 0 && ret != -EINVAL)
>> +               return -ENODEV;
>> +       base_id = (ret > 0 ? ret : 0);
> 
> Does this mean you allow nodes not to have the base_id property? How
> do we protect against multiple nodes not having a base_id property
> then?
> 
> Implicitly assuming a base_id value (zero in this case) may not be always safe.

None of the OMAPs have multiple IP instances, and as such the base-id is
an optional property. I have made this change to make sure we atleast
attempt to use the value if mentioned in DT and not hard-coding the
value to begin with (going by the optional property semantics). If and
when multiple instances get added and a secondary node doesn't add the
property, the node will not be registered with the core due to an
overlap failure. Here is the previous version [1] for reference.

regards
Suman

[1] https://patchwork.kernel.org/patch/4096881/
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: s-anna@ti.com (Suman Anna)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv6 5/5] hwspinlock/omap: add support for dt nodes
Date: Wed, 12 Nov 2014 13:50:15 -0600	[thread overview]
Message-ID: <5463B9F7.8040105@ti.com> (raw)
In-Reply-To: <CAK=WgbZE7_WrsNz5E+MDX7j2tAGEjv91zeCgqhB=Jsiu0+d8vw@mail.gmail.com>

Hi Ohad,

On 11/12/2014 01:14 PM, Ohad Ben-Cohen wrote:
> Hi Suman,
> 
> On Fri, Sep 12, 2014 at 11:24 PM, Suman Anna <s-anna@ti.com> wrote:
>>  static int omap_hwspinlock_probe(struct platform_device *pdev)
>>  {
>> -       struct hwspinlock_pdata *pdata = pdev->dev.platform_data;
>> +       struct device_node *node = pdev->dev.of_node;
>>         struct hwspinlock_device *bank;
>>         struct hwspinlock *hwlock;
>>         struct resource *res;
>>         void __iomem *io_base;
>> -       int num_locks, i, ret;
>> +       int num_locks, i, ret, base_id;
>>
>> -       if (!pdata)
>> +       if (!node)
>>                 return -ENODEV;
>>
>> +       ret = of_hwspin_lock_get_base_id(node);
>> +       if (ret < 0 && ret != -EINVAL)
>> +               return -ENODEV;
>> +       base_id = (ret > 0 ? ret : 0);
> 
> Does this mean you allow nodes not to have the base_id property? How
> do we protect against multiple nodes not having a base_id property
> then?
> 
> Implicitly assuming a base_id value (zero in this case) may not be always safe.

None of the OMAPs have multiple IP instances, and as such the base-id is
an optional property. I have made this change to make sure we atleast
attempt to use the value if mentioned in DT and not hard-coding the
value to begin with (going by the optional property semantics). If and
when multiple instances get added and a secondary node doesn't add the
property, the node will not be registered with the core due to an
overlap failure. Here is the previous version [1] for reference.

regards
Suman

[1] https://patchwork.kernel.org/patch/4096881/

WARNING: multiple messages have this Message-ID (diff)
From: Suman Anna <s-anna@ti.com>
To: Ohad Ben-Cohen <ohad@wizery.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Kumar Gala <galak@codeaurora.org>,
	Tony Lindgren <tony@atomide.com>,
	Josh Cartwright <joshc@codeaurora.org>,
	Bjorn Andersson <bjorn@kryo.se>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	linux-arm <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCHv6 5/5] hwspinlock/omap: add support for dt nodes
Date: Wed, 12 Nov 2014 13:50:15 -0600	[thread overview]
Message-ID: <5463B9F7.8040105@ti.com> (raw)
In-Reply-To: <CAK=WgbZE7_WrsNz5E+MDX7j2tAGEjv91zeCgqhB=Jsiu0+d8vw@mail.gmail.com>

Hi Ohad,

On 11/12/2014 01:14 PM, Ohad Ben-Cohen wrote:
> Hi Suman,
> 
> On Fri, Sep 12, 2014 at 11:24 PM, Suman Anna <s-anna@ti.com> wrote:
>>  static int omap_hwspinlock_probe(struct platform_device *pdev)
>>  {
>> -       struct hwspinlock_pdata *pdata = pdev->dev.platform_data;
>> +       struct device_node *node = pdev->dev.of_node;
>>         struct hwspinlock_device *bank;
>>         struct hwspinlock *hwlock;
>>         struct resource *res;
>>         void __iomem *io_base;
>> -       int num_locks, i, ret;
>> +       int num_locks, i, ret, base_id;
>>
>> -       if (!pdata)
>> +       if (!node)
>>                 return -ENODEV;
>>
>> +       ret = of_hwspin_lock_get_base_id(node);
>> +       if (ret < 0 && ret != -EINVAL)
>> +               return -ENODEV;
>> +       base_id = (ret > 0 ? ret : 0);
> 
> Does this mean you allow nodes not to have the base_id property? How
> do we protect against multiple nodes not having a base_id property
> then?
> 
> Implicitly assuming a base_id value (zero in this case) may not be always safe.

None of the OMAPs have multiple IP instances, and as such the base-id is
an optional property. I have made this change to make sure we atleast
attempt to use the value if mentioned in DT and not hard-coding the
value to begin with (going by the optional property semantics). If and
when multiple instances get added and a secondary node doesn't add the
property, the node will not be registered with the core due to an
overlap failure. Here is the previous version [1] for reference.

regards
Suman

[1] https://patchwork.kernel.org/patch/4096881/

  parent reply	other threads:[~2014-11-12 19:50 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12 20:24 [PATCHv6 0/5] hwspinlock core/omap dt support Suman Anna
2014-09-12 20:24 ` Suman Anna
2014-09-12 20:24 ` Suman Anna
2014-09-12 20:24 ` [PATCHv6 1/5] Documentation: dt: add common bindings for hwspinlock Suman Anna
2014-09-12 20:24   ` Suman Anna
2014-09-12 20:24   ` Suman Anna
2014-11-12 15:14   ` Ohad Ben-Cohen
2014-11-12 15:14     ` Ohad Ben-Cohen
     [not found]     ` <CAK=WgbZqj23J4M8n5FOkPdUOcyK3==TXgc3DfX=LKS6E8C+-Bg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-12 17:08       ` Suman Anna
2014-11-12 17:08         ` Suman Anna
2014-11-12 17:08         ` Suman Anna
2014-12-08 17:21         ` Bjorn Andersson
2014-12-08 17:21           ` Bjorn Andersson
2014-09-12 20:24 ` [PATCHv6 2/5] Documentation: dt: add the omap hwspinlock bindings document Suman Anna
2014-09-12 20:24   ` Suman Anna
2014-09-12 20:24   ` Suman Anna
2014-11-12 15:16   ` Ohad Ben-Cohen
2014-11-12 15:16     ` Ohad Ben-Cohen
2014-09-12 20:24 ` [PATCHv6 3/5] hwspinlock/core: maintain a list of registered hwspinlock banks Suman Anna
2014-09-12 20:24   ` Suman Anna
2014-09-12 20:24   ` Suman Anna
     [not found] ` <1410553499-55951-1-git-send-email-s-anna-l0cyMroinI0@public.gmane.org>
2014-09-12 20:24   ` [PATCHv6 4/5] hwspinlock/core: add common OF helpers Suman Anna
2014-09-12 20:24     ` Suman Anna
2014-09-12 20:24     ` Suman Anna
     [not found]     ` <1410553499-55951-5-git-send-email-s-anna-l0cyMroinI0@public.gmane.org>
2014-11-12 19:08       ` Ohad Ben-Cohen
2014-11-12 19:08         ` Ohad Ben-Cohen
2014-11-12 19:08         ` Ohad Ben-Cohen
2014-11-12 19:32         ` Suman Anna
2014-11-12 19:32           ` Suman Anna
2014-11-13 10:03           ` Ohad Ben-Cohen
2014-11-13 10:03             ` Ohad Ben-Cohen
2014-11-13 17:38             ` Suman Anna
2014-11-13 17:38               ` Suman Anna
     [not found]               ` <5464EC7A.7050603-l0cyMroinI0@public.gmane.org>
2014-11-13 19:45                 ` Ohad Ben-Cohen
2014-11-13 19:45                   ` Ohad Ben-Cohen
2014-11-13 19:45                   ` Ohad Ben-Cohen
     [not found]                   ` <CAK=WgbbodS8GsUxQbkyCp6hAG+Ko4LMirx+pUa8_fUdxWFasvw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-13 21:02                     ` Suman Anna
2014-11-13 21:02                       ` Suman Anna
2014-11-13 21:02                       ` Suman Anna
2014-11-14  7:11                       ` Ohad Ben-Cohen
2014-11-14  7:11                         ` Ohad Ben-Cohen
     [not found]                         ` <CAK=WgbYMM19-rWLOBjix+TA3fF_Pb25ia1rutDxYSUg9SV0efg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-14 17:09                           ` Suman Anna
2014-11-14 17:09                             ` Suman Anna
2014-11-14 17:09                             ` Suman Anna
2014-11-14 20:05                             ` Ohad Ben-Cohen
2014-11-14 20:05                               ` Ohad Ben-Cohen
2014-09-12 20:24 ` [PATCHv6 5/5] hwspinlock/omap: add support for dt nodes Suman Anna
2014-09-12 20:24   ` Suman Anna
2014-09-12 20:24   ` Suman Anna
2014-11-12 19:14   ` Ohad Ben-Cohen
2014-11-12 19:14     ` Ohad Ben-Cohen
     [not found]     ` <CAK=WgbZE7_WrsNz5E+MDX7j2tAGEjv91zeCgqhB=Jsiu0+d8vw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-12 19:50       ` Suman Anna [this message]
2014-11-12 19:50         ` Suman Anna
2014-11-12 19:50         ` Suman Anna
2014-11-13  9:04         ` Ohad Ben-Cohen
2014-11-13  9:04           ` Ohad Ben-Cohen
2014-11-20  0:43     ` Bjorn Andersson
2014-11-20  0:43       ` Bjorn Andersson
2014-11-20  6:36       ` Ohad Ben-Cohen
2014-11-20  6:36         ` Ohad Ben-Cohen
2014-09-30 16:25 ` [PATCHv6 0/5] hwspinlock core/omap dt support Suman Anna
2014-09-30 16:25   ` Suman Anna
2014-09-30 16:25   ` Suman Anna
2014-09-30 20:54 ` Bjorn Andersson
2014-09-30 20:54   ` Bjorn Andersson
2014-09-30 21:27   ` Suman Anna
2014-09-30 21:27     ` Suman Anna

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5463B9F7.8040105@ti.com \
    --to=s-anna-l0cymroini0@public.gmane.org \
    --cc=bjorn-UYDU3/A3LUY@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=joshc-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.