Re: is there an efficient module_is_builtin() test ?

2021-03-16 Thread jim . cromie
On Tue, Mar 9, 2021 at 3:25 PM Valdis Klētnieks 
wrote:

> On Tue, 09 Mar 2021 12:55:14 -0700, jim.cro...@gmail.com said:
>
> > To use the index, I need  _sites[], and that only works
> > for builtin-module's callsites.   For loaded modules, I can/have
> > added a pointer to the section into module load_info, giving me
> > the base I will need for the ! builtin branch.
> >
> > I just need a not expensive  is-it-builtin (modref)
>

thanks Valdis, the back and forth helped.

So, to follow up, the above is embodied here;
https://lore.kernel.org/lkml/20210316050801.2446401-1-jim.cro...@gmail.com/
in the add index patch, near 13/18
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


help with linker script mods

2021-03-16 Thread jim . cromie
so Im trying to constrain the linker to put ELF section pairs
into contiguous chunks of memory.

this is on top of:
https://lore.kernel.org/lkml/20210316050801.2446401-1-jim.cro...@gmail.com/

The macro below works when used in vmlinux.lds.h,
it does pack the sections as desired.

but same macro, when reused in module.lds.h, fails.

The version below links ok, but appears to absorb the __dyndbg* sections
into the .data section, which works for vmlinux.lds.h, cuz there we use the
__start/stop ___dyndbg* symbols to use the section.

In contrast, for modules, I want to preserve the named sections
as proper elf sections in the ko, so that loader picks them up
and saves them into struct load-info

Anyone got some deep linker-fu ?


[jimc@frodo wk-next]$ git diff
diff --git a/include/asm-generic/module.lds.h
b/include/asm-generic/module.lds.h
index f210d5c1b78b..4840f01a0828 100644
--- a/include/asm-generic/module.lds.h
+++ b/include/asm-generic/module.lds.h
@@ -4,7 +4,26 @@

 /*
  *  can specify arch-specific sections for linking
modules.
- * Empty for the asm-generic header.
+ * DYNAMIC_DEBUG needs its header sections contiguous with its data
sections.
  */

+#if defined(CONFIG_DYNAMIC_DEBUG) ||\
+(defined(CONFIG_DYNAMIC_DEBUG_CORE) \
+ && defined(DYNAMIC_DEBUG_MODULE))
+#define DYNAMIC_DEBUG_DATA()\
+. = ALIGN(8);   \
+__start___dyndbg_sites = .; \
+KEEP(*(__dyndbg_sites .gnu.linkonce.dyndbg_site))   \
+__stop___dyndbg_sites = .;  \
+__start___dyndbg = .;   \
+KEEP(*(__dyndbg .gnu.linkonce.dyndbg))  \
+__stop___dyndbg = .;
+#else
+#define DYNAMIC_DEBUG_DATA()
+#endif
+
+SECTIONS {
+   .data : { DYNAMIC_DEBUG_DATA() }
+}
+
 #endif /* __ASM_GENERIC_MODULE_LDS_H */
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: [PATCH 05/15] staging: rtl8723bs: remove unused code blocks conditioned by never set CONFIG_PM

2021-03-16 Thread Fabio Aiuto
On Tue, Mar 16, 2021 at 12:39:19PM +0100, Greg KH wrote:
> On Mon, Mar 15, 2021 at 11:15:02AM +0100, Fabio Aiuto wrote:
> > remove conditional code blocks checked by unused CONFIG_PM
> > 
> > cleaning required in TODO file:
> > 
> > find and remove code blocks guarded by never set CONFIG_FOO defines
> > 
> > Signed-off-by: Fabio Aiuto 
> > ---
> >  drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 8 
> >  1 file changed, 8 deletions(-)
> > 
> > diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c 
> > b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
> > index 2ff71d001c07..5748e1c1a25c 100644
> > --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
> > +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
> > @@ -3198,14 +3198,6 @@ static void rtw_cfg80211_preinit_wiphy(struct 
> > adapter *padapter, struct wiphy *w
> > wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
> > wiphy->flags |= WIPHY_FLAG_OFFCHAN_TX | WIPHY_FLAG_HAVE_AP_SME;
> >  
> > -#if defined(CONFIG_PM)
> > -   wiphy->max_sched_scan_reqs = 1;
> > -#endif
> > -
> > -#if defined(CONFIG_PM)
> > -   wiphy->wowlan = _stub;
> > -#endif
> 
> How this is "unused"?  This is a real config option, did you just change
> the logic here?
> 
> thanks,
> 
> greg k-h

Hi Greg,

ignore this patch. I missed that definition of PM config option.
I dropped it off my own local repo.

Thank you,

fabio

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Kernelnewbies Digest, Vol 124, Issue 4

2021-03-16 Thread linux lover
Thanks a million for... !

Sent from my iPhone

> On Mar 11, 2021, at 10:46 AM, Axios N  wrote:
> 
> Re: Contents of Kernelnewbies digest...
> 
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies