Skip to content

Conversation

@mnkp
Copy link
Member

@mnkp mnkp commented Nov 8, 2019

This is a collection of mostly unrelated commits which were merged on topic-gpio branch as part of a clean up effort. They are compatible with the current GPIO API and can be merged with master before the work on topic-gpio branch is finished.

Affected platforms: SiLabs, NXP, STM32. Includes commits from #19256 by @mniestroj.

@andrewboie
Copy link
Contributor

Hmm, did CI get stuck?

@mniestroj
Copy link
Member

@mnkp Could you pull latest patches from #19256? There are now 4 instead of 3 patches. Most importantly things like#elif CONFIG_SOC_SERIES_STM32MP1X have been converted to #elif defined(CONFIG_SOC_SERIES_STM32MP1X).

@galak
Copy link
Contributor

galak commented Nov 8, 2019

Hmm, did CI get stuck?

Weird, rebased to kick CI off again.

@mnkp
Copy link
Member Author

mnkp commented Nov 8, 2019

@mnkp Could you pull latest patches from #19256? There are now 4 instead of 3 patches. Most importantly things like#elif CONFIG_SOC_SERIES_STM32MP1X have been converted to #elif defined(CONFIG_SOC_SERIES_STM32MP1X).

@mniestroj I've tried to cherry-pick the commit in question but unfortunately there were merge conflicts which I would rather not attempt to resolve. Your PR has undergone some modifications on the topic-gpio branch due to review process. Could you please verify that the version in this PR is fine with you. The commit modifying #elif CONFIG_SOC_SERIES_STM32MP1X needs to be recreated on top of this PR. Fortunately it's a minor change. I'm sorry about it.

@mniestroj
Copy link
Member

@mniestroj I've tried to cherry-pick the commit in question but unfortunately there were merge conflicts which I would rather not attempt to resolve. Your PR has undergone some modifications on the topic-gpio branch due to review process. Could you please verify that the version in this PR is fine with you. The commit modifying #elif CONFIG_SOC_SERIES_STM32MP1X needs to be recreated on top of this PR. Fortunately it's a minor change. I'm sorry about it.

@mnkp I've successfully rebased those 4 commits that I mentioned on top of d4fba7eba7da79753dd38ce79ae730d645533dd6 from your branch. The result is here: https://github.com/mniestroj/zephyr/tree/mnkp-gpio-stm32-int-disable. Then I rebased your topic-gpio-fixes on top (with skipping my old 3 patches) and the result is here: https://github.com/mniestroj/zephyr/tree/mnkp-topic-gpio-fixes. All without any conflicts. Basically you cannot just apply 1 additional patch, because those old 3 patches are not subset of new 4 (things were modified during review process).

@zephyrbot
Copy link

zephyrbot commented Nov 8, 2019

All checks passed.

checkpatch (informational only, not a failure)

-:356: WARNING:PREFER_KERNEL_TYPES: Prefer kernel type 'u32_t' over 'uint32_t'
#356: FILE: drivers/gpio/gpio_stm32.c:204:
+	uint32_t line = gpio_stm32_pin_to_exti_line(pin);

-:382: WARNING:PREFER_KERNEL_TYPES: Prefer kernel type 'u32_t' over 'uint32_t'
#382: FILE: drivers/gpio/gpio_stm32.c:230:
+	uint32_t line = gpio_stm32_pin_to_exti_line(pin);

-:783: WARNING:LONG_LINE: line over 80 characters
#783: FILE: soc/arm/silabs_exx32/efr32mg12p/dts_fixup.h:29:
+#define DT_GPIO_GECKO_PORTI_NAME	DT_SILABS_EFR32MG_GPIO_PORT_4000A180_LABEL

-:784: WARNING:LONG_LINE: line over 80 characters
#784: FILE: soc/arm/silabs_exx32/efr32mg12p/dts_fixup.h:30:
+#define DT_GPIO_GECKO_PORTJ_NAME	DT_SILABS_EFR32MG_GPIO_PORT_4000A1B0_LABEL

-:785: WARNING:LONG_LINE: line over 80 characters
#785: FILE: soc/arm/silabs_exx32/efr32mg12p/dts_fixup.h:31:
+#define DT_GPIO_GECKO_PORTK_NAME	DT_SILABS_EFR32MG_GPIO_PORT_4000A1E0_LABEL

- total: 0 errors, 5 warnings, 692 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Your patch has style problems, please review.

NOTE: Ignored message types: AVOID_EXTERNS BRACES CONFIG_EXPERIMENTAL CONST_STRUCT DATE_TIME FILE_PATH_CHANGES MINMAX NETWORKING_BLOCK_COMMENT_STYLE PRINTK_WITHOUT_KERN_LEVEL SPLIT_STRING VOLATILE

NOTE: If any of the errors are false positives, please report
      them to the maintainers.

Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages.

@mnkp
Copy link
Member Author

mnkp commented Nov 8, 2019

Basically you cannot just apply 1 additional patch, because those old 3 patches are not subset of new 4 (things were modified during review process).

Sure, that's clear. I didn't want to replace the old 3 patches with the 4 new since the old 3 may have included changes not done in the new 4. The work was happening on the topic-gpio branch and the old 3 patches could have been modified via fixup.

I'll drop STM32 patches from this PR. As reported by checkpatch there is some more clean up which needs to be done and the required extra commit can't be merged as it includes unrelated changes.

@mniestroj @erwango If we want to get this into 2.1. it may be best if we merge the original #19256 PR. It would need to be reverted to target the master branch again. This would need to be coordinated between you too since you know what was modified the best. @mniestroj once again sorry for the trouble.

@mniestroj
Copy link
Member

@mniestroj @erwango If we want to get this into 2.1. it may be best if we merge the original #19256 PR. It would need to be reverted to target the master branch again. This would need to be coordinated between you too since you know what was modified the best. @mniestroj once again sorry for the trouble.

Okay, then I can prepare a PR with only stm32 improvements. Looks like targetting those to topic-gpio branch was a bad idea in the first place, because they were never new GPIO API related. And because of this approach we are delaying fixes for dual core and disabling interrupts, almost by 2 months already.

@mnkp I'll prepare a PR with stm32 patches once you drop them here.

@erwango
Copy link
Member

erwango commented Nov 8, 2019

@mnkp, @mniestroj , #19256 is not in a state that could be merged right from what I can see.
If main difference is 95fdeb9, this is rather a cosmetic change, and I don't see why this should block merging of other commits.
Besides, aim of current PR is to ease merge of up coming gpio api changes. I don't guarantee these will fit nicely on top of #19256 (I might have tweaked minor stuff in the process). Though I know this works on top of the 3 commits present here.

@mnkp
Copy link
Member Author

mnkp commented Nov 8, 2019

Making sure that rebasing of topic-gpio goes smoothly would indeed be an issue if the work on #19256 continues. We should have waited for #19256 to be merged or close it once the commits were pulled to other PR. That was communication failure on our part.

I let others decide how to handle this issue.

If this PR is to be merged fully we still need to fix checkpatch warnings. There is a commit on topic-gpio branch that does it but I would need to split it and apply only partially.

@mniestroj
Copy link
Member

@mnkp, @mniestroj , #19256 is not in a state that could be merged right from what I can see.

@erwango What problem do you see? I've rebased my commits on top of master once again, with your commit fixing dual core systems.

If main difference is 95fdeb9, this is rather a cosmetic change, and I don't see why this should block merging of other commits.

This is not the only difference. I suggest to use git diff to see what are the other changes. In fact, those changes were requested by both @erwango and @mnkp during review process. So I do not understand your reasoning here, because you are trying to pull old version of patches, without changes you requested.

@erwango
Copy link
Member

erwango commented Nov 12, 2019

o I do not understand your reasoning here, because you are trying to pull old version of patches, without changes you requested.

@mniestroj, I've finally done the changes directly myself after pulling them (at that time I couldn't wait for your changes, sorry if this made additional work for you), so commits in topic-gpio branch are conform to what is expected. Besides there are commits on top of these ones in topic-gpio branch, that ensure the transition to new GPIO API. This set of changes have been reviewed tested and validated on all STM32 series as a whole.
Aim of current pull request is to prepare the landing of topic-gpio branch into main branch by merging the commits that do not touch directly the API. Taking commits that are not part of topic-gpio branch would imply the risks:

  • of introducing new bugs, or requesting need to review or testing once again
  • of merge issue when trying to merge remaining part of topic-gpio branch

So, there are 2 cases:

@mniestroj
Copy link
Member

@mniestroj, I've finally done the changes directly myself after pulling them (at that time I couldn't wait for your changes, sorry if this made additional work for you), so commits in topic-gpio branch are conform to what is expected.

@erwango You have done the changes part of another commit a070416 ("drivers/gpio: stm32: various clean up"), which is not part of this PR. My commits haven't been modified as far as I can see. Also #19256 contains improvements (made according to review process) which are not part of topic-gpio branch.

Besides there are commits on top of these ones in topic-gpio branch, that ensure the transition to new GPIO API. This set of changes have been reviewed tested and validated on all STM32 series as a whole.

I don't think this is a good approach to look at topic-gpio branch. This doesn't scale. If there would be 15 topic-something branches and you would want to make sure nothing gets broken there before merging other commits to master, then you would simply end up in a deadlock. It should be one way, so topic-gpio branch should be rebased on top of master whenever there are conflicts, but master should go with its own way applying fixes and minor improvements at a constant rate.

Taking commits that are not part of topic-gpio branch would imply the risks:

  • of introducing new bugs, or requesting need to review or testing once again

I bet that commits on topic-gpio branches were tested with all other changes together. Are you 100% sure that everything works with the cherry-picked commits on this PR? :) Did someone tested them that way?

  • of merge issue when trying to merge remaining part of topic-gpio branch

git rebase is very easy to use here. All conflicts will be automatically detected and you can easily drop patches with functionality that has been already introduced, even those done in slightly different way. And by saying that you want to achieve easier merge of topi-gpio I think that dropping patches with functionality already in master is what you really want to do.

So, there are 2 cases:

As I said earlier, this should go the other way around. Fixes should have a priority in landing in master branch, so they should be based on master. I think that this is why @mnkp started this PR, so topic-gpio branch can be freed from random improvements and fixes and include only changes related to new GPIO API.

And last thing... checking what are the real differences in codebase is as simple and quick as executing git diff one-branch..another-branch. It takes 10 seconds and another 20 seconds to look at the changes. We just discuss too much about such simple thing.

@galak galak added the TSC Topics that need TSC discussion label Nov 12, 2019
@galak
Copy link
Contributor

galak commented Nov 13, 2019

Approved by TSC for merge into 2.1

mnkp and others added 16 commits November 13, 2019 10:43
Adding code owners of gpio drivers.

Signed-off-by: Piotr Mienkowski <[email protected]>
With dual core handling introduction, we now need to take care to
always release lock before exiting function.
Rework gpio_stm32_config to take this into account.
Additionally, since ENOSYS usage is resevred to system calls
handling, replace with EIO.


Signed-off-by: Erwan Gouriou <[email protected]>
This allows compiler to inline function body and reduce overall code
size.

Signed-off-by: Marcin Niestroj <[email protected]>
This patch doesn't change functionality, but is only related to improved
readability and reusability.

Signed-off-by: Marcin Niestroj <[email protected]>
Up to now interrupts could be only configured once, with no way to
disable them in runtime.

Allow interrupts to be disabled in runtime and then properly reenabled
on user request. This allows to ignore interrupts when software is not
expecting them.

The improvement over previously reverted patch [1] is that we disable
interrupts only when we configure port for which interrupt line was
previously selected. This for example prevents to disable interrupts
line 2 in case PA2 was previously configured as interrupt source, but we
are currently configuring PB2 as output.

[1] 0951ce2 ("gpio: stm32: support disabling and reenabling
  interrupts on pin")

Signed-off-by: Marcin Niestroj <[email protected]>
Fix interrupt number for gpio5

Signed-off-by: Stanislav Poboril <[email protected]>
NXP's LPC family of MCU's GPIOs parameters is udated.
Boards LPC54xxx and LPC55xxx have updated values according
pin and interrupt layout.

Signed-off-by: Andrei Gansari <[email protected]>
Allocate all 8 PINT interrupts to ports 0 and 1, allocate 4 to each.

Signed-off-by: Andrei Gansari <[email protected]>
Board is refactored to use DTS generated value, not use
magic numbers.

Signed-off-by: Andrei Gansari <[email protected]>
PINT device is enabled when SoC is booting up. Applies to LPC54xxx and
LPC55xxx families.

Signed-off-by: Andrei Gansari <[email protected]>
SoC initialization had an incorrect comment regarding system clock.
Corrected from 48Mhz -> 96Mhz.

Signed-off-by: Andrei Gansari <[email protected]>
Add define that maps to IOCON register PULL-DOWN bit.

Signed-off-by: Andrei Gansari <[email protected]>
This removes a lot of copy-and-paste.

Signed-off-by: Christian Taedcke <[email protected]>
The gecko gpio driver can now utilize ports a to k.

Signed-off-by: Christian Taedcke <[email protected]>
Add device tree elements for all gpio ports of the efr32mg12p including
the dts fixup entries.
Also remove gpio port e since this is not available in efr32mg12p socs.

Signed-off-by: Christian Taedcke <[email protected]>
Some board description files failed to note where gpio was supported,
causing tests to be inappropriately filtered.  Add the feature where
the gpio_basic_api test would use it.

Signed-off-by: Peter Bigot <[email protected]>
Explicitly configures the rgb led pinmuxes as gpios. Currently the gpio
driver quietly changes the pinmux to gpio mode when configuring a gpio
pin, but this behavior is about to change.

Signed-off-by: Maureen Helm <[email protected]>
@galak galak removed the TSC Topics that need TSC discussion label Nov 13, 2019
@galak galak merged commit 1e077ff into zephyrproject-rtos:master Nov 13, 2019
@mnkp mnkp deleted the topic-gpio-fixes branch November 16, 2019 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.