From: Tomasz Figa <hidden> Date: 2014-09-13 11:27:50
Hi Abhilash,
Please see my comments inline.
On 13.09.2014 10:50, Abhilash Kesavan wrote:
Exynos7 uses different offsets for wakeup interrupt configuration registers.
So a new irq_chip instance for Exynos7 wakeup interrupts is added. The irq_chip
selection is now based on the wakeup interrupt controller compatible string.
[snip]
quoted hunk
@@ -328,9 +322,11 @@ static int exynos_wkup_irq_set_wake(struct irq_data *irqd, unsigned int on) /* * irq_chip for wakeup interrupts */-static struct exynos_irq_chip exynos_wkup_irq_chip = {+static struct exynos_irq_chip exynos_wkup_irq_chip;+
Why do you still need this, if you have both variants below?
@@ -434,7 +453,12 @@ static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d) int idx, irq; for_each_child_of_node(dev->of_node, np) {- if (of_match_node(exynos_wkup_irq_ids, np)) {+ const struct of_device_id *match;++ match = of_match_node(exynos_wkup_irq_ids, np);+ if (match) {+ memcpy(&exynos_wkup_irq_chip, match->data,+ sizeof(struct exynos_irq_chip));
Hmm, this doesn't look correct to me. You are modifying a static struct
here. Why couldn't you simply use the exynos irq chip pointed by
match->data in further registration code?
Interestingly enough, the offsets look just like the normal GPIO
interrupt controller of previous Exynos SoCs. Are you sure those are
correct? Also if somehow the controller now resembles the normal one,
doesn't it have the SVC register making it possible to reuse the non
wake-up code instead?
Best regards,
Tomasz
Hi Tomasz,
On Sat, Sep 13, 2014 at 4:57 PM, Tomasz Figa [off-list ref] wrote:
Hi Abhilash,
Please see my comments inline.
On 13.09.2014 10:50, Abhilash Kesavan wrote:
quoted
Exynos7 uses different offsets for wakeup interrupt configuration registers.
So a new irq_chip instance for Exynos7 wakeup interrupts is added. The irq_chip
selection is now based on the wakeup interrupt controller compatible string.
[snip]
quoted
@@ -328,9 +322,11 @@ static int exynos_wkup_irq_set_wake(struct irq_data *irqd, unsigned int on) /* * irq_chip for wakeup interrupts */-static struct exynos_irq_chip exynos_wkup_irq_chip = {+static struct exynos_irq_chip exynos_wkup_irq_chip;+
Why do you still need this, if you have both variants below?
After adding __initdata to the two variants, I will require to have a
copy of one of them.
@@ -434,7 +453,12 @@ static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d) int idx, irq; for_each_child_of_node(dev->of_node, np) {- if (of_match_node(exynos_wkup_irq_ids, np)) {+ const struct of_device_id *match;++ match = of_match_node(exynos_wkup_irq_ids, np);+ if (match) {+ memcpy(&exynos_wkup_irq_chip, match->data,+ sizeof(struct exynos_irq_chip));
Hmm, this doesn't look correct to me. You are modifying a static struct
here. Why couldn't you simply use the exynos irq chip pointed by
match->data in further registration code?
That will not be available later once I use __initdata.
Interestingly enough, the offsets look just like the normal GPIO
interrupt controller of previous Exynos SoCs. Are you sure those are
correct? Also if somehow the controller now resembles the normal one,
doesn't it have the SVC register making it possible to reuse the non
wake-up code instead?
The wakeup interrupt register offsets are the same as the GPIO
interrupt offsets in earlier Exynos SoCs. There is no SVC register for
the wakeup interrupt block.
Regards,
Abhilash
From: Tomasz Figa <hidden> Date: 2014-09-22 07:55:59
On 22.09.2014 08:17, Abhilash Kesavan wrote:
Hi Tomasz,
On Sat, Sep 13, 2014 at 4:57 PM, Tomasz Figa [off-list ref] wrote:
quoted
Hi Abhilash,
Please see my comments inline.
On 13.09.2014 10:50, Abhilash Kesavan wrote:
quoted
Exynos7 uses different offsets for wakeup interrupt configuration registers.
So a new irq_chip instance for Exynos7 wakeup interrupts is added. The irq_chip
selection is now based on the wakeup interrupt controller compatible string.
[snip]
quoted
@@ -328,9 +322,11 @@ static int exynos_wkup_irq_set_wake(struct irq_data *irqd, unsigned int on) /* * irq_chip for wakeup interrupts */-static struct exynos_irq_chip exynos_wkup_irq_chip = {+static struct exynos_irq_chip exynos_wkup_irq_chip;+
Why do you still need this, if you have both variants below?
After adding __initdata to the two variants, I will require to have a
copy of one of them.
@@ -434,7 +453,12 @@ static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d) int idx, irq; for_each_child_of_node(dev->of_node, np) {- if (of_match_node(exynos_wkup_irq_ids, np)) {+ const struct of_device_id *match;++ match = of_match_node(exynos_wkup_irq_ids, np);+ if (match) {+ memcpy(&exynos_wkup_irq_chip, match->data,+ sizeof(struct exynos_irq_chip));
Hmm, this doesn't look correct to me. You are modifying a static struct
here. Why couldn't you simply use the exynos irq chip pointed by
match->data in further registration code?
That will not be available later once I use __initdata.
Then either __initdata shouldn't be necessary or kmemdup() should be
used to allocate a copy.
Interestingly enough, the offsets look just like the normal GPIO
interrupt controller of previous Exynos SoCs. Are you sure those are
correct? Also if somehow the controller now resembles the normal one,
doesn't it have the SVC register making it possible to reuse the non
wake-up code instead?
The wakeup interrupt register offsets are the same as the GPIO
interrupt offsets in earlier Exynos SoCs. There is no SVC register for
the wakeup interrupt block.
Hi Tomasz,
On Mon, Sep 22, 2014 at 1:25 PM, Tomasz Figa [off-list ref] wrote:
On 22.09.2014 08:17, Abhilash Kesavan wrote:
quoted
Hi Tomasz,
On Sat, Sep 13, 2014 at 4:57 PM, Tomasz Figa [off-list ref] wrote:
quoted
Hi Abhilash,
Please see my comments inline.
On 13.09.2014 10:50, Abhilash Kesavan wrote:
quoted
Exynos7 uses different offsets for wakeup interrupt configuration registers.
So a new irq_chip instance for Exynos7 wakeup interrupts is added. The irq_chip
selection is now based on the wakeup interrupt controller compatible string.
[snip]
quoted
@@ -328,9 +322,11 @@ static int exynos_wkup_irq_set_wake(struct irq_data *irqd, unsigned int on) /* * irq_chip for wakeup interrupts */-static struct exynos_irq_chip exynos_wkup_irq_chip = {+static struct exynos_irq_chip exynos_wkup_irq_chip;+
Why do you still need this, if you have both variants below?
After adding __initdata to the two variants, I will require to have a
copy of one of them.
@@ -434,7 +453,12 @@ static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d) int idx, irq; for_each_child_of_node(dev->of_node, np) {- if (of_match_node(exynos_wkup_irq_ids, np)) {+ const struct of_device_id *match;++ match = of_match_node(exynos_wkup_irq_ids, np);+ if (match) {+ memcpy(&exynos_wkup_irq_chip, match->data,+ sizeof(struct exynos_irq_chip));
Hmm, this doesn't look correct to me. You are modifying a static struct
here. Why couldn't you simply use the exynos irq chip pointed by
match->data in further registration code?
That will not be available later once I use __initdata.
Then either __initdata shouldn't be necessary or kmemdup() should be
used to allocate a copy.
Will fix this and send out a new version soon.
Regards,
Abhilash
Interestingly enough, the offsets look just like the normal GPIO
interrupt controller of previous Exynos SoCs. Are you sure those are
correct? Also if somehow the controller now resembles the normal one,
doesn't it have the SVC register making it possible to reuse the non
wake-up code instead?
The wakeup interrupt register offsets are the same as the GPIO
interrupt offsets in earlier Exynos SoCs. There is no SVC register for
the wakeup interrupt block.